@abi-software/scaffoldvuer 0.1.3 → 0.1.5-1.beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +12 -0
- package/README.md +88 -2
- package/babel.config.js +9 -0
- package/dist/scaffoldvuer.common.js +3088 -74192
- package/dist/scaffoldvuer.common.js.map +1 -1
- package/dist/scaffoldvuer.css +1 -91
- package/dist/scaffoldvuer.umd.js +3090 -74194
- package/dist/scaffoldvuer.umd.js.map +1 -1
- package/dist/scaffoldvuer.umd.min.js +1 -195
- package/dist/scaffoldvuer.umd.min.js.map +1 -1
- package/package-lock.json +13115 -4688
- package/package.json +34 -11
- package/src/App.vue +410 -9
- package/src/assets/_variables.scss +43 -0
- package/src/assets/styles.scss +7 -0
- package/src/components/ModelsInformation.js +35 -0
- package/src/components/ModelsTable.vue +113 -0
- package/src/components/OpacityControls.vue +222 -0
- package/src/components/ScaffoldVuer.md +44 -0
- package/src/components/ScaffoldVuer.vue +1435 -52
- package/src/components/TraditionalControls.vue +546 -0
- package/src/components/index.js +3 -11
- package/src/credential.json +12 -0
- package/src/main.js +6 -0
- package/src/scripts/BaseModule.js +80 -0
- package/src/scripts/RendererModule.js +261 -0
- package/src/scripts/WebGL.js +94 -0
- package/src/scripts/annotation.js +5 -0
- package/src/scripts/eventNotifier.js +65 -0
- package/src/scripts/graphicsHighlight.js +132 -0
- package/src/scripts/organsRenderer.js +536 -0
- package/styleguide.config.js +22 -0
- package/vue.config.js +36 -9
|
@@ -1,196 +1,2 @@
|
|
|
1
|
-
(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e(require("vue")):"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["scaffoldvuer"]=e(require("vue")):t["scaffoldvuer"]=e(t["Vue"])})("undefined"!==typeof self?self:this,(function(t){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="fb15")}({0:function(t,e){},"06cf":function(t,e,n){var i=n("83ab"),r=n("d1e7"),o=n("5c6c"),a=n("fc6a"),s=n("c04e"),c=n("5135"),l=n("0cfb"),u=Object.getOwnPropertyDescriptor;e.f=i?u:function(t,e){if(t=a(t),e=s(e,!0),l)try{return u(t,e)}catch(n){}if(c(t,e))return o(!r.f.call(t,e),t[e])}},"0772":function(t,e,n){"use strict";var i=n("4b5b"),r=n.n(i);r.a},"0773":function(t,e,n){},"07f7":function(t,e,n){"use strict";function i(t){var e=this.constructor;return this.then((function(n){return e.resolve(t()).then((function(){return n}))}),(function(n){return e.resolve(t()).then((function(){return e.reject(n)}))}))}n.r(e);var r=i,o=setTimeout;function a(t){return Boolean(t&&"undefined"!==typeof t.length)}function s(){}function c(t,e){return function(){t.apply(e,arguments)}}function l(t){if(!(this instanceof l))throw new TypeError("Promises must be constructed via new");if("function"!==typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],m(t,this)}function u(t,e){while(3===t._state)t=t._value;0!==t._state?(t._handled=!0,l._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var i;try{i=n(t._value)}catch(r){return void p(e.promise,r)}h(e.promise,i)}else(1===t._state?h:p)(e.promise,t._value)}))):t._deferreds.push(e)}function h(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"===typeof e||"function"===typeof e)){var n=e.then;if(e instanceof l)return t._state=3,t._value=e,void d(t);if("function"===typeof n)return void m(c(n,e),t)}t._state=1,t._value=e,d(t)}catch(i){p(t,i)}}function p(t,e){t._state=2,t._value=e,d(t)}function d(t){2===t._state&&0===t._deferreds.length&&l._immediateFn((function(){t._handled||l._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)u(t,t._deferreds[e]);t._deferreds=null}function f(t,e,n){this.onFulfilled="function"===typeof t?t:null,this.onRejected="function"===typeof e?e:null,this.promise=n}function m(t,e){var n=!1;try{t((function(t){n||(n=!0,h(e,t))}),(function(t){n||(n=!0,p(e,t))}))}catch(i){if(n)return;n=!0,p(e,i)}}l.prototype["catch"]=function(t){return this.then(null,t)},l.prototype.then=function(t,e){var n=new this.constructor(s);return u(this,new f(t,e,n)),n},l.prototype["finally"]=r,l.all=function(t){return new l((function(e,n){if(!a(t))return n(new TypeError("Promise.all accepts an array"));var i=Array.prototype.slice.call(t);if(0===i.length)return e([]);var r=i.length;function o(t,a){try{if(a&&("object"===typeof a||"function"===typeof a)){var s=a.then;if("function"===typeof s)return void s.call(a,(function(e){o(t,e)}),n)}i[t]=a,0===--r&&e(i)}catch(c){n(c)}}for(var s=0;s<i.length;s++)o(s,i[s])}))},l.resolve=function(t){return t&&"object"===typeof t&&t.constructor===l?t:new l((function(e){e(t)}))},l.reject=function(t){return new l((function(e,n){n(t)}))},l.race=function(t){return new l((function(e,n){if(!a(t))return n(new TypeError("Promise.race accepts an array"));for(var i=0,r=t.length;i<r;i++)l.resolve(t[i]).then(e,n)}))},l._immediateFn="function"===typeof setImmediate&&function(t){setImmediate(t)}||function(t){o(t,0)},l._unhandledRejectionFn=function(t){"undefined"!==typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};e["default"]=l},"0ae9":function(t,e,n){var i,r,o;
|
|
2
|
-
/*!
|
|
3
|
-
* jQuery UI :data 1.12.1
|
|
4
|
-
* http://jqueryui.com
|
|
5
|
-
*
|
|
6
|
-
* Copyright jQuery Foundation and other contributors
|
|
7
|
-
* Released under the MIT license.
|
|
8
|
-
* http://jquery.org/license
|
|
9
|
-
*/(function(a){r=[n("1157"),n("4309")],i=a,o="function"===typeof i?i.apply(e,r):i,void 0===o||(t.exports=o)})((function(t){return t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo((function(e){return function(n){return!!t.data(n,e)}})):function(e,n,i){return!!t.data(e,i[3])}})}))},"0cfb":function(t,e,n){var i=n("83ab"),r=n("d039"),o=n("cc12");t.exports=!i&&!r((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},"10c9":function(t,e){e.WEBGL={isWebGLAvailable:function(){try{var t=document.createElement("canvas");return!(!window.WebGLRenderingContext||!t.getContext("webgl")&&!t.getContext("experimental-webgl"))}catch(e){return!1}},isWebGL2Available:function(){try{var t=document.createElement("canvas");return!(!window.WebGL2RenderingContext||!t.getContext("webgl2"))}catch(e){return!1}},getWebGLErrorMessage:function(){return this.getErrorMessage(1)},getWebGL2ErrorMessage:function(){return this.getErrorMessage(2)},getErrorMessage:function(t){var e={1:"WebGL",2:"WebGL 2"},n={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext},i='This module requires <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#008">$1</a> support but your $0 does not seem to support it.',r=document.createElement("div");return r.id="webglmessage",r.style.fontFamily="monospace",r.style.fontSize="20px",r.style.fontWeight="normal",r.style.textAlign="center",r.style.background="#fff",r.style.color="#000",r.style.padding="1.5em",r.style.width="400px",r.style.margin="5em auto 0",i=n[t]?i.replace("$0","graphics card"):i.replace("$0","browser"),i=i.replace("$1",e[t]),r.innerHTML=i,r}}},1157:function(t,e,n){var i,r;
|
|
10
|
-
/*!
|
|
11
|
-
* jQuery JavaScript Library v3.4.1
|
|
12
|
-
* https://jquery.com/
|
|
13
|
-
*
|
|
14
|
-
* Includes Sizzle.js
|
|
15
|
-
* https://sizzlejs.com/
|
|
16
|
-
*
|
|
17
|
-
* Copyright JS Foundation and other contributors
|
|
18
|
-
* Released under the MIT license
|
|
19
|
-
* https://jquery.org/license
|
|
20
|
-
*
|
|
21
|
-
* Date: 2019-05-01T21:04Z
|
|
22
|
-
*/(function(e,n){"use strict";"object"===typeof t.exports?t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(e)})("undefined"!==typeof window?window:this,(function(n,o){"use strict";var a=[],s=n.document,c=Object.getPrototypeOf,l=a.slice,u=a.concat,h=a.push,p=a.indexOf,d={},f=d.toString,m=d.hasOwnProperty,g=m.toString,v=g.call(Object),y={},b=function(t){return"function"===typeof t&&"number"!==typeof t.nodeType},x=function(t){return null!=t&&t===t.window},w={type:!0,src:!0,nonce:!0,noModule:!0};function _(t,e,n){n=n||s;var i,r,o=n.createElement("script");if(o.text=t,e)for(i in w)r=e[i]||e.getAttribute&&e.getAttribute(i),r&&o.setAttribute(i,r);n.head.appendChild(o).parentNode.removeChild(o)}function M(t){return null==t?t+"":"object"===typeof t||"function"===typeof t?d[f.call(t)]||"object":typeof t}var T="3.4.1",S=function(t,e){return new S.fn.init(t,e)},E=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function A(t){var e=!!t&&"length"in t&&t.length,n=M(t);return!b(t)&&!x(t)&&("array"===n||0===e||"number"===typeof e&&e>0&&e-1 in t)}S.fn=S.prototype={jquery:T,constructor:S,length:0,toArray:function(){return l.call(this)},get:function(t){return null==t?l.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=S.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return S.each(this,t)},map:function(t){return this.pushStack(S.map(this,(function(e,n){return t.call(e,n,e)})))},slice:function(){return this.pushStack(l.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n<e?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:h,sort:a.sort,splice:a.splice},S.extend=S.fn.extend=function(){var t,e,n,i,r,o,a=arguments[0]||{},s=1,c=arguments.length,l=!1;for("boolean"===typeof a&&(l=a,a=arguments[s]||{},s++),"object"===typeof a||b(a)||(a={}),s===c&&(a=this,s--);s<c;s++)if(null!=(t=arguments[s]))for(e in t)i=t[e],"__proto__"!==e&&a!==i&&(l&&i&&(S.isPlainObject(i)||(r=Array.isArray(i)))?(n=a[e],o=r&&!Array.isArray(n)?[]:r||S.isPlainObject(n)?n:{},r=!1,a[e]=S.extend(l,o,i)):void 0!==i&&(a[e]=i));return a},S.extend({expando:"jQuery"+(T+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isPlainObject:function(t){var e,n;return!(!t||"[object Object]"!==f.call(t))&&(e=c(t),!e||(n=m.call(e,"constructor")&&e.constructor,"function"===typeof n&&g.call(n)===v))},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t,e){_(t,{nonce:e&&e.nonce})},each:function(t,e){var n,i=0;if(A(t)){for(n=t.length;i<n;i++)if(!1===e.call(t[i],i,t[i]))break}else for(i in t)if(!1===e.call(t[i],i,t[i]))break;return t},trim:function(t){return null==t?"":(t+"").replace(E,"")},makeArray:function(t,e){var n=e||[];return null!=t&&(A(Object(t))?S.merge(n,"string"===typeof t?[t]:t):h.call(n,t)),n},inArray:function(t,e,n){return null==e?-1:p.call(e,t,n)},merge:function(t,e){for(var n=+e.length,i=0,r=t.length;i<n;i++)t[r++]=e[i];return t.length=r,t},grep:function(t,e,n){for(var i,r=[],o=0,a=t.length,s=!n;o<a;o++)i=!e(t[o],o),i!==s&&r.push(t[o]);return r},map:function(t,e,n){var i,r,o=0,a=[];if(A(t))for(i=t.length;o<i;o++)r=e(t[o],o,n),null!=r&&a.push(r);else for(o in t)r=e(t[o],o,n),null!=r&&a.push(r);return u.apply([],a)},guid:1,support:y}),"function"===typeof Symbol&&(S.fn[Symbol.iterator]=a[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(t,e){d["[object "+e+"]"]=e.toLowerCase()}));var C=
|
|
23
|
-
/*!
|
|
24
|
-
* Sizzle CSS Selector Engine v2.3.4
|
|
25
|
-
* https://sizzlejs.com/
|
|
26
|
-
*
|
|
27
|
-
* Copyright JS Foundation and other contributors
|
|
28
|
-
* Released under the MIT license
|
|
29
|
-
* https://js.foundation/
|
|
30
|
-
*
|
|
31
|
-
* Date: 2019-04-08
|
|
32
|
-
*/
|
|
33
|
-
function(t){var e,n,i,r,o,a,s,c,l,u,h,p,d,f,m,g,v,y,b,x="sizzle"+1*new Date,w=t.document,_=0,M=0,T=ct(),S=ct(),E=ct(),A=ct(),C=function(t,e){return t===e&&(h=!0),0},L={}.hasOwnProperty,P=[],R=P.pop,O=P.push,D=P.push,N=P.slice,I=function(t,e){for(var n=0,i=t.length;n<i;n++)if(t[n]===e)return n;return-1},z="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",B="[\\x20\\t\\r\\n\\f]",k="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",H="\\["+B+"*("+k+")(?:"+B+"*([*^$|!~]?=)"+B+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+k+"))|)"+B+"*\\]",U=":("+k+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+H+")*)|.*)\\)|)",G=new RegExp(B+"+","g"),F=new RegExp("^"+B+"+|((?:^|[^\\\\])(?:\\\\.)*)"+B+"+$","g"),j=new RegExp("^"+B+"*,"+B+"*"),V=new RegExp("^"+B+"*([>+~]|"+B+")"+B+"*"),W=new RegExp(B+"|>"),q=new RegExp(U),X=new RegExp("^"+k+"$"),Y={ID:new RegExp("^#("+k+")"),CLASS:new RegExp("^\\.("+k+")"),TAG:new RegExp("^("+k+"|[*])"),ATTR:new RegExp("^"+H),PSEUDO:new RegExp("^"+U),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+B+"*(even|odd|(([+-]|)(\\d*)n|)"+B+"*(?:([+-]|)"+B+"*(\\d+)|))"+B+"*\\)|)","i"),bool:new RegExp("^(?:"+z+")$","i"),needsContext:new RegExp("^"+B+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+B+"*((?:-\\d)?\\d*)"+B+"*\\)|)(?=[^-]|$)","i")},J=/HTML$/i,Z=/^(?:input|select|textarea|button)$/i,$=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,K=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tt=/[+~]/,et=new RegExp("\\\\([\\da-f]{1,6}"+B+"?|("+B+")|.)","ig"),nt=function(t,e,n){var i="0x"+e-65536;return i!==i||n?e:i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)},it=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,rt=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},ot=function(){p()},at=xt((function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{D.apply(P=N.call(w.childNodes),w.childNodes),P[w.childNodes.length].nodeType}catch(At){D={apply:P.length?function(t,e){O.apply(t,N.call(e))}:function(t,e){var n=t.length,i=0;while(t[n++]=e[i++]);t.length=n-1}}}function st(t,e,i,r){var o,s,l,u,h,f,v,y=e&&e.ownerDocument,_=e?e.nodeType:9;if(i=i||[],"string"!==typeof t||!t||1!==_&&9!==_&&11!==_)return i;if(!r&&((e?e.ownerDocument||e:w)!==d&&p(e),e=e||d,m)){if(11!==_&&(h=K.exec(t)))if(o=h[1]){if(9===_){if(!(l=e.getElementById(o)))return i;if(l.id===o)return i.push(l),i}else if(y&&(l=y.getElementById(o))&&b(e,l)&&l.id===o)return i.push(l),i}else{if(h[2])return D.apply(i,e.getElementsByTagName(t)),i;if((o=h[3])&&n.getElementsByClassName&&e.getElementsByClassName)return D.apply(i,e.getElementsByClassName(o)),i}if(n.qsa&&!A[t+" "]&&(!g||!g.test(t))&&(1!==_||"object"!==e.nodeName.toLowerCase())){if(v=t,y=e,1===_&&W.test(t)){(u=e.getAttribute("id"))?u=u.replace(it,rt):e.setAttribute("id",u=x),f=a(t),s=f.length;while(s--)f[s]="#"+u+" "+bt(f[s]);v=f.join(","),y=tt.test(t)&&vt(e.parentNode)||e}try{return D.apply(i,y.querySelectorAll(v)),i}catch(M){A(t,!0)}finally{u===x&&e.removeAttribute("id")}}}return c(t.replace(F,"$1"),e,i,r)}function ct(){var t=[];function e(n,r){return t.push(n+" ")>i.cacheLength&&delete e[t.shift()],e[n+" "]=r}return e}function lt(t){return t[x]=!0,t}function ut(t){var e=d.createElement("fieldset");try{return!!t(e)}catch(At){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function ht(t,e){var n=t.split("|"),r=n.length;while(r--)i.attrHandle[n[r]]=e}function pt(t,e){var n=e&&t,i=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(i)return i;if(n)while(n=n.nextSibling)if(n===e)return-1;return t?1:-1}function dt(t){return function(e){var n=e.nodeName.toLowerCase();return"input"===n&&e.type===t}}function ft(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function mt(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&at(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function gt(t){return lt((function(e){return e=+e,lt((function(n,i){var r,o=t([],n.length,e),a=o.length;while(a--)n[r=o[a]]&&(n[r]=!(i[r]=n[r]))}))}))}function vt(t){return t&&"undefined"!==typeof t.getElementsByTagName&&t}for(e in n=st.support={},o=st.isXML=function(t){var e=t.namespaceURI,n=(t.ownerDocument||t).documentElement;return!J.test(e||n&&n.nodeName||"HTML")},p=st.setDocument=function(t){var e,r,a=t?t.ownerDocument||t:w;return a!==d&&9===a.nodeType&&a.documentElement?(d=a,f=d.documentElement,m=!o(d),w!==d&&(r=d.defaultView)&&r.top!==r&&(r.addEventListener?r.addEventListener("unload",ot,!1):r.attachEvent&&r.attachEvent("onunload",ot)),n.attributes=ut((function(t){return t.className="i",!t.getAttribute("className")})),n.getElementsByTagName=ut((function(t){return t.appendChild(d.createComment("")),!t.getElementsByTagName("*").length})),n.getElementsByClassName=Q.test(d.getElementsByClassName),n.getById=ut((function(t){return f.appendChild(t).id=x,!d.getElementsByName||!d.getElementsByName(x).length})),n.getById?(i.filter["ID"]=function(t){var e=t.replace(et,nt);return function(t){return t.getAttribute("id")===e}},i.find["ID"]=function(t,e){if("undefined"!==typeof e.getElementById&&m){var n=e.getElementById(t);return n?[n]:[]}}):(i.filter["ID"]=function(t){var e=t.replace(et,nt);return function(t){var n="undefined"!==typeof t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},i.find["ID"]=function(t,e){if("undefined"!==typeof e.getElementById&&m){var n,i,r,o=e.getElementById(t);if(o){if(n=o.getAttributeNode("id"),n&&n.value===t)return[o];r=e.getElementsByName(t),i=0;while(o=r[i++])if(n=o.getAttributeNode("id"),n&&n.value===t)return[o]}return[]}}),i.find["TAG"]=n.getElementsByTagName?function(t,e){return"undefined"!==typeof e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,i=[],r=0,o=e.getElementsByTagName(t);if("*"===t){while(n=o[r++])1===n.nodeType&&i.push(n);return i}return o},i.find["CLASS"]=n.getElementsByClassName&&function(t,e){if("undefined"!==typeof e.getElementsByClassName&&m)return e.getElementsByClassName(t)},v=[],g=[],(n.qsa=Q.test(d.querySelectorAll))&&(ut((function(t){f.appendChild(t).innerHTML="<a id='"+x+"'></a><select id='"+x+"-\r\\' msallowcapture=''><option selected=''></option></select>",t.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+B+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||g.push("\\["+B+"*(?:value|"+z+")"),t.querySelectorAll("[id~="+x+"-]").length||g.push("~="),t.querySelectorAll(":checked").length||g.push(":checked"),t.querySelectorAll("a#"+x+"+*").length||g.push(".#.+[+~]")})),ut((function(t){t.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var e=d.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&g.push("name"+B+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),f.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),g.push(",.*:")}))),(n.matchesSelector=Q.test(y=f.matches||f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&ut((function(t){n.disconnectedMatch=y.call(t,"*"),y.call(t,"[s!='']:x"),v.push("!=",U)})),g=g.length&&new RegExp(g.join("|")),v=v.length&&new RegExp(v.join("|")),e=Q.test(f.compareDocumentPosition),b=e||Q.test(f.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,i=e&&e.parentNode;return t===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):t.compareDocumentPosition&&16&t.compareDocumentPosition(i)))}:function(t,e){if(e)while(e=e.parentNode)if(e===t)return!0;return!1},C=e?function(t,e){if(t===e)return h=!0,0;var i=!t.compareDocumentPosition-!e.compareDocumentPosition;return i||(i=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1,1&i||!n.sortDetached&&e.compareDocumentPosition(t)===i?t===d||t.ownerDocument===w&&b(w,t)?-1:e===d||e.ownerDocument===w&&b(w,e)?1:u?I(u,t)-I(u,e):0:4&i?-1:1)}:function(t,e){if(t===e)return h=!0,0;var n,i=0,r=t.parentNode,o=e.parentNode,a=[t],s=[e];if(!r||!o)return t===d?-1:e===d?1:r?-1:o?1:u?I(u,t)-I(u,e):0;if(r===o)return pt(t,e);n=t;while(n=n.parentNode)a.unshift(n);n=e;while(n=n.parentNode)s.unshift(n);while(a[i]===s[i])i++;return i?pt(a[i],s[i]):a[i]===w?-1:s[i]===w?1:0},d):d},st.matches=function(t,e){return st(t,null,null,e)},st.matchesSelector=function(t,e){if((t.ownerDocument||t)!==d&&p(t),n.matchesSelector&&m&&!A[e+" "]&&(!v||!v.test(e))&&(!g||!g.test(e)))try{var i=y.call(t,e);if(i||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(At){A(e,!0)}return st(e,d,null,[t]).length>0},st.contains=function(t,e){return(t.ownerDocument||t)!==d&&p(t),b(t,e)},st.attr=function(t,e){(t.ownerDocument||t)!==d&&p(t);var r=i.attrHandle[e.toLowerCase()],o=r&&L.call(i.attrHandle,e.toLowerCase())?r(t,e,!m):void 0;return void 0!==o?o:n.attributes||!m?t.getAttribute(e):(o=t.getAttributeNode(e))&&o.specified?o.value:null},st.escape=function(t){return(t+"").replace(it,rt)},st.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},st.uniqueSort=function(t){var e,i=[],r=0,o=0;if(h=!n.detectDuplicates,u=!n.sortStable&&t.slice(0),t.sort(C),h){while(e=t[o++])e===t[o]&&(r=i.push(o));while(r--)t.splice(i[r],1)}return u=null,t},r=st.getText=function(t){var e,n="",i=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"===typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=r(t)}else if(3===o||4===o)return t.nodeValue}else while(e=t[i++])n+=r(e);return n},i=st.selectors={cacheLength:50,createPseudo:lt,match:Y,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(et,nt),t[3]=(t[3]||t[4]||t[5]||"").replace(et,nt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||st.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&st.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return Y["CHILD"].test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&q.test(n)&&(e=a(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(et,nt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=T[t+" "];return e||(e=new RegExp("(^|"+B+")"+t+"("+B+"|$)"))&&T(t,(function(t){return e.test("string"===typeof t.className&&t.className||"undefined"!==typeof t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(i){var r=st.attr(i,t);return null==r?"!="===e:!e||(r+="","="===e?r===n:"!="===e?r!==n:"^="===e?n&&0===r.indexOf(n):"*="===e?n&&r.indexOf(n)>-1:"$="===e?n&&r.slice(-n.length)===n:"~="===e?(" "+r.replace(G," ")+" ").indexOf(n)>-1:"|="===e&&(r===n||r.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,i,r){var o="nth"!==t.slice(0,3),a="last"!==t.slice(-4),s="of-type"===e;return 1===i&&0===r?function(t){return!!t.parentNode}:function(e,n,c){var l,u,h,p,d,f,m=o!==a?"nextSibling":"previousSibling",g=e.parentNode,v=s&&e.nodeName.toLowerCase(),y=!c&&!s,b=!1;if(g){if(o){while(m){p=e;while(p=p[m])if(s?p.nodeName.toLowerCase()===v:1===p.nodeType)return!1;f=m="only"===t&&!f&&"nextSibling"}return!0}if(f=[a?g.firstChild:g.lastChild],a&&y){p=g,h=p[x]||(p[x]={}),u=h[p.uniqueID]||(h[p.uniqueID]={}),l=u[t]||[],d=l[0]===_&&l[1],b=d&&l[2],p=d&&g.childNodes[d];while(p=++d&&p&&p[m]||(b=d=0)||f.pop())if(1===p.nodeType&&++b&&p===e){u[t]=[_,d,b];break}}else if(y&&(p=e,h=p[x]||(p[x]={}),u=h[p.uniqueID]||(h[p.uniqueID]={}),l=u[t]||[],d=l[0]===_&&l[1],b=d),!1===b)while(p=++d&&p&&p[m]||(b=d=0)||f.pop())if((s?p.nodeName.toLowerCase()===v:1===p.nodeType)&&++b&&(y&&(h=p[x]||(p[x]={}),u=h[p.uniqueID]||(h[p.uniqueID]={}),u[t]=[_,b]),p===e))break;return b-=r,b===i||b%i===0&&b/i>=0}}},PSEUDO:function(t,e){var n,r=i.pseudos[t]||i.setFilters[t.toLowerCase()]||st.error("unsupported pseudo: "+t);return r[x]?r(e):r.length>1?(n=[t,t,"",e],i.setFilters.hasOwnProperty(t.toLowerCase())?lt((function(t,n){var i,o=r(t,e),a=o.length;while(a--)i=I(t,o[a]),t[i]=!(n[i]=o[a])})):function(t){return r(t,0,n)}):r}},pseudos:{not:lt((function(t){var e=[],n=[],i=s(t.replace(F,"$1"));return i[x]?lt((function(t,e,n,r){var o,a=i(t,null,r,[]),s=t.length;while(s--)(o=a[s])&&(t[s]=!(e[s]=o))})):function(t,r,o){return e[0]=t,i(e,null,o,n),e[0]=null,!n.pop()}})),has:lt((function(t){return function(e){return st(t,e).length>0}})),contains:lt((function(t){return t=t.replace(et,nt),function(e){return(e.textContent||r(e)).indexOf(t)>-1}})),lang:lt((function(t){return X.test(t||"")||st.error("unsupported lang: "+t),t=t.replace(et,nt).toLowerCase(),function(e){var n;do{if(n=m?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return n=n.toLowerCase(),n===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===f},focus:function(t){return t===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:mt(!1),disabled:mt(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!i.pseudos["empty"](t)},header:function(t){return $.test(t.nodeName)},input:function(t){return Z.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:gt((function(){return[0]})),last:gt((function(t,e){return[e-1]})),eq:gt((function(t,e,n){return[n<0?n+e:n]})),even:gt((function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t})),odd:gt((function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t})),lt:gt((function(t,e,n){for(var i=n<0?n+e:n>e?e:n;--i>=0;)t.push(i);return t})),gt:gt((function(t,e,n){for(var i=n<0?n+e:n;++i<e;)t.push(i);return t}))}},i.pseudos["nth"]=i.pseudos["eq"],{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[e]=dt(e);for(e in{submit:!0,reset:!0})i.pseudos[e]=ft(e);function yt(){}function bt(t){for(var e=0,n=t.length,i="";e<n;e++)i+=t[e].value;return i}function xt(t,e,n){var i=e.dir,r=e.next,o=r||i,a=n&&"parentNode"===o,s=M++;return e.first?function(e,n,r){while(e=e[i])if(1===e.nodeType||a)return t(e,n,r);return!1}:function(e,n,c){var l,u,h,p=[_,s];if(c){while(e=e[i])if((1===e.nodeType||a)&&t(e,n,c))return!0}else while(e=e[i])if(1===e.nodeType||a)if(h=e[x]||(e[x]={}),u=h[e.uniqueID]||(h[e.uniqueID]={}),r&&r===e.nodeName.toLowerCase())e=e[i]||e;else{if((l=u[o])&&l[0]===_&&l[1]===s)return p[2]=l[2];if(u[o]=p,p[2]=t(e,n,c))return!0}return!1}}function wt(t){return t.length>1?function(e,n,i){var r=t.length;while(r--)if(!t[r](e,n,i))return!1;return!0}:t[0]}function _t(t,e,n){for(var i=0,r=e.length;i<r;i++)st(t,e[i],n);return n}function Mt(t,e,n,i,r){for(var o,a=[],s=0,c=t.length,l=null!=e;s<c;s++)(o=t[s])&&(n&&!n(o,i,r)||(a.push(o),l&&e.push(s)));return a}function Tt(t,e,n,i,r,o){return i&&!i[x]&&(i=Tt(i)),r&&!r[x]&&(r=Tt(r,o)),lt((function(o,a,s,c){var l,u,h,p=[],d=[],f=a.length,m=o||_t(e||"*",s.nodeType?[s]:s,[]),g=!t||!o&&e?m:Mt(m,p,t,s,c),v=n?r||(o?t:f||i)?[]:a:g;if(n&&n(g,v,s,c),i){l=Mt(v,d),i(l,[],s,c),u=l.length;while(u--)(h=l[u])&&(v[d[u]]=!(g[d[u]]=h))}if(o){if(r||t){if(r){l=[],u=v.length;while(u--)(h=v[u])&&l.push(g[u]=h);r(null,v=[],l,c)}u=v.length;while(u--)(h=v[u])&&(l=r?I(o,h):p[u])>-1&&(o[l]=!(a[l]=h))}}else v=Mt(v===a?v.splice(f,v.length):v),r?r(null,a,v,c):D.apply(a,v)}))}function St(t){for(var e,n,r,o=t.length,a=i.relative[t[0].type],s=a||i.relative[" "],c=a?1:0,u=xt((function(t){return t===e}),s,!0),h=xt((function(t){return I(e,t)>-1}),s,!0),p=[function(t,n,i){var r=!a&&(i||n!==l)||((e=n).nodeType?u(t,n,i):h(t,n,i));return e=null,r}];c<o;c++)if(n=i.relative[t[c].type])p=[xt(wt(p),n)];else{if(n=i.filter[t[c].type].apply(null,t[c].matches),n[x]){for(r=++c;r<o;r++)if(i.relative[t[r].type])break;return Tt(c>1&&wt(p),c>1&&bt(t.slice(0,c-1).concat({value:" "===t[c-2].type?"*":""})).replace(F,"$1"),n,c<r&&St(t.slice(c,r)),r<o&&St(t=t.slice(r)),r<o&&bt(t))}p.push(n)}return wt(p)}function Et(t,e){var n=e.length>0,r=t.length>0,o=function(o,a,s,c,u){var h,f,g,v=0,y="0",b=o&&[],x=[],w=l,M=o||r&&i.find["TAG"]("*",u),T=_+=null==w?1:Math.random()||.1,S=M.length;for(u&&(l=a===d||a||u);y!==S&&null!=(h=M[y]);y++){if(r&&h){f=0,a||h.ownerDocument===d||(p(h),s=!m);while(g=t[f++])if(g(h,a||d,s)){c.push(h);break}u&&(_=T)}n&&((h=!g&&h)&&v--,o&&b.push(h))}if(v+=y,n&&y!==v){f=0;while(g=e[f++])g(b,x,a,s);if(o){if(v>0)while(y--)b[y]||x[y]||(x[y]=R.call(c));x=Mt(x)}D.apply(c,x),u&&!o&&x.length>0&&v+e.length>1&&st.uniqueSort(c)}return u&&(_=T,l=w),b};return n?lt(o):o}return yt.prototype=i.filters=i.pseudos,i.setFilters=new yt,a=st.tokenize=function(t,e){var n,r,o,a,s,c,l,u=S[t+" "];if(u)return e?0:u.slice(0);s=t,c=[],l=i.preFilter;while(s){for(a in n&&!(r=j.exec(s))||(r&&(s=s.slice(r[0].length)||s),c.push(o=[])),n=!1,(r=V.exec(s))&&(n=r.shift(),o.push({value:n,type:r[0].replace(F," ")}),s=s.slice(n.length)),i.filter)!(r=Y[a].exec(s))||l[a]&&!(r=l[a](r))||(n=r.shift(),o.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return e?s.length:s?st.error(t):S(t,c).slice(0)},s=st.compile=function(t,e){var n,i=[],r=[],o=E[t+" "];if(!o){e||(e=a(t)),n=e.length;while(n--)o=St(e[n]),o[x]?i.push(o):r.push(o);o=E(t,Et(r,i)),o.selector=t}return o},c=st.select=function(t,e,n,r){var o,c,l,u,h,p="function"===typeof t&&t,d=!r&&a(t=p.selector||t);if(n=n||[],1===d.length){if(c=d[0]=d[0].slice(0),c.length>2&&"ID"===(l=c[0]).type&&9===e.nodeType&&m&&i.relative[c[1].type]){if(e=(i.find["ID"](l.matches[0].replace(et,nt),e)||[])[0],!e)return n;p&&(e=e.parentNode),t=t.slice(c.shift().value.length)}o=Y["needsContext"].test(t)?0:c.length;while(o--){if(l=c[o],i.relative[u=l.type])break;if((h=i.find[u])&&(r=h(l.matches[0].replace(et,nt),tt.test(c[0].type)&&vt(e.parentNode)||e))){if(c.splice(o,1),t=r.length&&bt(c),!t)return D.apply(n,r),n;break}}}return(p||s(t,d))(r,e,!m,n,!e||tt.test(t)&&vt(e.parentNode)||e),n},n.sortStable=x.split("").sort(C).join("")===x,n.detectDuplicates=!!h,p(),n.sortDetached=ut((function(t){return 1&t.compareDocumentPosition(d.createElement("fieldset"))})),ut((function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")}))||ht("type|href|height|width",(function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)})),n.attributes&&ut((function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")}))||ht("value",(function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue})),ut((function(t){return null==t.getAttribute("disabled")}))||ht(z,(function(t,e,n){var i;if(!n)return!0===t[e]?e.toLowerCase():(i=t.getAttributeNode(e))&&i.specified?i.value:null})),st}(n);S.find=C,S.expr=C.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=C.uniqueSort,S.text=C.getText,S.isXMLDoc=C.isXML,S.contains=C.contains,S.escapeSelector=C.escape;var L=function(t,e,n){var i=[],r=void 0!==n;while((t=t[e])&&9!==t.nodeType)if(1===t.nodeType){if(r&&S(t).is(n))break;i.push(t)}return i},P=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},R=S.expr.match.needsContext;function O(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var D=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function N(t,e,n){return b(e)?S.grep(t,(function(t,i){return!!e.call(t,i,t)!==n})):e.nodeType?S.grep(t,(function(t){return t===e!==n})):"string"!==typeof e?S.grep(t,(function(t){return p.call(e,t)>-1!==n})):S.filter(e,t,n)}S.filter=function(t,e,n){var i=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===i.nodeType?S.find.matchesSelector(i,t)?[i]:[]:S.find.matches(t,S.grep(e,(function(t){return 1===t.nodeType})))},S.fn.extend({find:function(t){var e,n,i=this.length,r=this;if("string"!==typeof t)return this.pushStack(S(t).filter((function(){for(e=0;e<i;e++)if(S.contains(r[e],this))return!0})));for(n=this.pushStack([]),e=0;e<i;e++)S.find(t,r[e],n);return i>1?S.uniqueSort(n):n},filter:function(t){return this.pushStack(N(this,t||[],!1))},not:function(t){return this.pushStack(N(this,t||[],!0))},is:function(t){return!!N(this,"string"===typeof t&&R.test(t)?S(t):t||[],!1).length}});var I,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,B=S.fn.init=function(t,e,n){var i,r;if(!t)return this;if(n=n||I,"string"===typeof t){if(i="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:z.exec(t),!i||!i[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(i[1]){if(e=e instanceof S?e[0]:e,S.merge(this,S.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:s,!0)),D.test(i[1])&&S.isPlainObject(e))for(i in e)b(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}return r=s.getElementById(i[2]),r&&(this[0]=r,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):b(t)?void 0!==n.ready?n.ready(t):t(S):S.makeArray(t,this)};B.prototype=S.fn,I=S(s);var k=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function U(t,e){while((t=t[e])&&1!==t.nodeType);return t}S.fn.extend({has:function(t){var e=S(t,this),n=e.length;return this.filter((function(){for(var t=0;t<n;t++)if(S.contains(this,e[t]))return!0}))},closest:function(t,e){var n,i=0,r=this.length,o=[],a="string"!==typeof t&&S(t);if(!R.test(t))for(;i<r;i++)for(n=this[i];n&&n!==e;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&S.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?S.uniqueSort(o):o)},index:function(t){return t?"string"===typeof t?p.call(S(t),this[0]):p.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),S.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return L(t,"parentNode")},parentsUntil:function(t,e,n){return L(t,"parentNode",n)},next:function(t){return U(t,"nextSibling")},prev:function(t){return U(t,"previousSibling")},nextAll:function(t){return L(t,"nextSibling")},prevAll:function(t){return L(t,"previousSibling")},nextUntil:function(t,e,n){return L(t,"nextSibling",n)},prevUntil:function(t,e,n){return L(t,"previousSibling",n)},siblings:function(t){return P((t.parentNode||{}).firstChild,t)},children:function(t){return P(t.firstChild)},contents:function(t){return"undefined"!==typeof t.contentDocument?t.contentDocument:(O(t,"template")&&(t=t.content||t),S.merge([],t.childNodes))}},(function(t,e){S.fn[t]=function(n,i){var r=S.map(this,e,n);return"Until"!==t.slice(-5)&&(i=n),i&&"string"===typeof i&&(r=S.filter(i,r)),this.length>1&&(H[t]||S.uniqueSort(r),k.test(t)&&r.reverse()),this.pushStack(r)}}));var G=/[^\x20\t\r\n\f]+/g;function F(t){var e={};return S.each(t.match(G)||[],(function(t,n){e[n]=!0})),e}function j(t){return t}function V(t){throw t}function W(t,e,n,i){var r;try{t&&b(r=t.promise)?r.call(t).done(e).fail(n):t&&b(r=t.then)?r.call(t,e,n):e.apply(void 0,[t].slice(i))}catch(t){n.apply(void 0,[t])}}S.Callbacks=function(t){t="string"===typeof t?F(t):S.extend({},t);var e,n,i,r,o=[],a=[],s=-1,c=function(){for(r=r||t.once,i=e=!0;a.length;s=-1){n=a.shift();while(++s<o.length)!1===o[s].apply(n[0],n[1])&&t.stopOnFalse&&(s=o.length,n=!1)}t.memory||(n=!1),e=!1,r&&(o=n?[]:"")},l={add:function(){return o&&(n&&!e&&(s=o.length-1,a.push(n)),function e(n){S.each(n,(function(n,i){b(i)?t.unique&&l.has(i)||o.push(i):i&&i.length&&"string"!==M(i)&&e(i)}))}(arguments),n&&!e&&c()),this},remove:function(){return S.each(arguments,(function(t,e){var n;while((n=S.inArray(e,o,n))>-1)o.splice(n,1),n<=s&&s--})),this},has:function(t){return t?S.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return r=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return r=a=[],n||e||(o=n=""),this},locked:function(){return!!r},fireWith:function(t,n){return r||(n=n||[],n=[t,n.slice?n.slice():n],a.push(n),e||c()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!i}};return l},S.extend({Deferred:function(t){var e=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],i="pending",r={state:function(){return i},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return r.then(null,t)},pipe:function(){var t=arguments;return S.Deferred((function(n){S.each(e,(function(e,i){var r=b(t[i[4]])&&t[i[4]];o[i[1]]((function(){var t=r&&r.apply(this,arguments);t&&b(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[i[0]+"With"](this,r?[t]:arguments)}))})),t=null})).promise()},then:function(t,i,r){var o=0;function a(t,e,i,r){return function(){var s=this,c=arguments,l=function(){var n,l;if(!(t<o)){if(n=i.apply(s,c),n===e.promise())throw new TypeError("Thenable self-resolution");l=n&&("object"===typeof n||"function"===typeof n)&&n.then,b(l)?r?l.call(n,a(o,e,j,r),a(o,e,V,r)):(o++,l.call(n,a(o,e,j,r),a(o,e,V,r),a(o,e,j,e.notifyWith))):(i!==j&&(s=void 0,c=[n]),(r||e.resolveWith)(s,c))}},u=r?l:function(){try{l()}catch(n){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(n,u.stackTrace),t+1>=o&&(i!==V&&(s=void 0,c=[n]),e.rejectWith(s,c))}};t?u():(S.Deferred.getStackHook&&(u.stackTrace=S.Deferred.getStackHook()),n.setTimeout(u))}}return S.Deferred((function(n){e[0][3].add(a(0,n,b(r)?r:j,n.notifyWith)),e[1][3].add(a(0,n,b(t)?t:j)),e[2][3].add(a(0,n,b(i)?i:V))})).promise()},promise:function(t){return null!=t?S.extend(t,r):r}},o={};return S.each(e,(function(t,n){var a=n[2],s=n[5];r[n[1]]=a.add,s&&a.add((function(){i=s}),e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),a.add(n[3].fire),o[n[0]]=function(){return o[n[0]+"With"](this===o?void 0:this,arguments),this},o[n[0]+"With"]=a.fireWith})),r.promise(o),t&&t.call(o,o),o},when:function(t){var e=arguments.length,n=e,i=Array(n),r=l.call(arguments),o=S.Deferred(),a=function(t){return function(n){i[t]=this,r[t]=arguments.length>1?l.call(arguments):n,--e||o.resolveWith(i,r)}};if(e<=1&&(W(t,o.done(a(n)).resolve,o.reject,!e),"pending"===o.state()||b(r[n]&&r[n].then)))return o.then();while(n--)W(r[n],a(n),o.reject);return o.promise()}});var q=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(t,e){n.console&&n.console.warn&&t&&q.test(t.name)&&n.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},S.readyException=function(t){n.setTimeout((function(){throw t}))};var X=S.Deferred();function Y(){s.removeEventListener("DOMContentLoaded",Y),n.removeEventListener("load",Y),S.ready()}S.fn.ready=function(t){return X.then(t).catch((function(t){S.readyException(t)})),this},S.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--S.readyWait:S.isReady)||(S.isReady=!0,!0!==t&&--S.readyWait>0||X.resolveWith(s,[S]))}}),S.ready.then=X.then,"complete"===s.readyState||"loading"!==s.readyState&&!s.documentElement.doScroll?n.setTimeout(S.ready):(s.addEventListener("DOMContentLoaded",Y),n.addEventListener("load",Y));var J=function(t,e,n,i,r,o,a){var s=0,c=t.length,l=null==n;if("object"===M(n))for(s in r=!0,n)J(t,e,s,n[s],!0,o,a);else if(void 0!==i&&(r=!0,b(i)||(a=!0),l&&(a?(e.call(t,i),e=null):(l=e,e=function(t,e,n){return l.call(S(t),n)})),e))for(;s<c;s++)e(t[s],n,a?i:i.call(t[s],s,e(t[s],n)));return r?t:l?e.call(t):c?e(t[0],n):o},Z=/^-ms-/,$=/-([a-z])/g;function Q(t,e){return e.toUpperCase()}function K(t){return t.replace(Z,"ms-").replace($,Q)}var tt=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};function et(){this.expando=S.expando+et.uid++}et.uid=1,et.prototype={cache:function(t){var e=t[this.expando];return e||(e={},tt(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,n){var i,r=this.cache(t);if("string"===typeof e)r[K(e)]=n;else for(i in e)r[K(i)]=e[i];return r},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][K(e)]},access:function(t,e,n){return void 0===e||e&&"string"===typeof e&&void 0===n?this.get(t,e):(this.set(t,e,n),void 0!==n?n:e)},remove:function(t,e){var n,i=t[this.expando];if(void 0!==i){if(void 0!==e){Array.isArray(e)?e=e.map(K):(e=K(e),e=e in i?[e]:e.match(G)||[]),n=e.length;while(n--)delete i[e[n]]}(void 0===e||S.isEmptyObject(i))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!S.isEmptyObject(e)}};var nt=new et,it=new et,rt=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,ot=/[A-Z]/g;function at(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:rt.test(t)?JSON.parse(t):t)}function st(t,e,n){var i;if(void 0===n&&1===t.nodeType)if(i="data-"+e.replace(ot,"-$&").toLowerCase(),n=t.getAttribute(i),"string"===typeof n){try{n=at(n)}catch(r){}it.set(t,e,n)}else n=void 0;return n}S.extend({hasData:function(t){return it.hasData(t)||nt.hasData(t)},data:function(t,e,n){return it.access(t,e,n)},removeData:function(t,e){it.remove(t,e)},_data:function(t,e,n){return nt.access(t,e,n)},_removeData:function(t,e){nt.remove(t,e)}}),S.fn.extend({data:function(t,e){var n,i,r,o=this[0],a=o&&o.attributes;if(void 0===t){if(this.length&&(r=it.get(o),1===o.nodeType&&!nt.get(o,"hasDataAttrs"))){n=a.length;while(n--)a[n]&&(i=a[n].name,0===i.indexOf("data-")&&(i=K(i.slice(5)),st(o,i,r[i])));nt.set(o,"hasDataAttrs",!0)}return r}return"object"===typeof t?this.each((function(){it.set(this,t)})):J(this,(function(e){var n;if(o&&void 0===e)return n=it.get(o,t),void 0!==n?n:(n=st(o,t),void 0!==n?n:void 0);this.each((function(){it.set(this,t,e)}))}),null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each((function(){it.remove(this,t)}))}}),S.extend({queue:function(t,e,n){var i;if(t)return e=(e||"fx")+"queue",i=nt.get(t,e),n&&(!i||Array.isArray(n)?i=nt.access(t,e,S.makeArray(n)):i.push(n)),i||[]},dequeue:function(t,e){e=e||"fx";var n=S.queue(t,e),i=n.length,r=n.shift(),o=S._queueHooks(t,e),a=function(){S.dequeue(t,e)};"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===e&&n.unshift("inprogress"),delete o.stop,r.call(t,a,o)),!i&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return nt.get(t,n)||nt.access(t,n,{empty:S.Callbacks("once memory").add((function(){nt.remove(t,[e+"queue",n])}))})}}),S.fn.extend({queue:function(t,e){var n=2;return"string"!==typeof t&&(e=t,t="fx",n--),arguments.length<n?S.queue(this[0],t):void 0===e?this:this.each((function(){var n=S.queue(this,t,e);S._queueHooks(this,t),"fx"===t&&"inprogress"!==n[0]&&S.dequeue(this,t)}))},dequeue:function(t){return this.each((function(){S.dequeue(this,t)}))},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,i=1,r=S.Deferred(),o=this,a=this.length,s=function(){--i||r.resolveWith(o,[o])};"string"!==typeof t&&(e=t,t=void 0),t=t||"fx";while(a--)n=nt.get(o[a],t+"queueHooks"),n&&n.empty&&(i++,n.empty.add(s));return s(),r.promise(e)}});var ct=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,lt=new RegExp("^(?:([+-])=|)("+ct+")([a-z%]*)$","i"),ut=["Top","Right","Bottom","Left"],ht=s.documentElement,pt=function(t){return S.contains(t.ownerDocument,t)},dt={composed:!0};ht.getRootNode&&(pt=function(t){return S.contains(t.ownerDocument,t)||t.getRootNode(dt)===t.ownerDocument});var ft=function(t,e){return t=e||t,"none"===t.style.display||""===t.style.display&&pt(t)&&"none"===S.css(t,"display")},mt=function(t,e,n,i){var r,o,a={};for(o in e)a[o]=t.style[o],t.style[o]=e[o];for(o in r=n.apply(t,i||[]),e)t.style[o]=a[o];return r};function gt(t,e,n,i){var r,o,a=20,s=i?function(){return i.cur()}:function(){return S.css(t,e,"")},c=s(),l=n&&n[3]||(S.cssNumber[e]?"":"px"),u=t.nodeType&&(S.cssNumber[e]||"px"!==l&&+c)&<.exec(S.css(t,e));if(u&&u[3]!==l){c/=2,l=l||u[3],u=+c||1;while(a--)S.style(t,e,u+l),(1-o)*(1-(o=s()/c||.5))<=0&&(a=0),u/=o;u*=2,S.style(t,e,u+l),n=n||[]}return n&&(u=+u||+c||0,r=n[1]?u+(n[1]+1)*n[2]:+n[2],i&&(i.unit=l,i.start=u,i.end=r)),r}var vt={};function yt(t){var e,n=t.ownerDocument,i=t.nodeName,r=vt[i];return r||(e=n.body.appendChild(n.createElement(i)),r=S.css(e,"display"),e.parentNode.removeChild(e),"none"===r&&(r="block"),vt[i]=r,r)}function bt(t,e){for(var n,i,r=[],o=0,a=t.length;o<a;o++)i=t[o],i.style&&(n=i.style.display,e?("none"===n&&(r[o]=nt.get(i,"display")||null,r[o]||(i.style.display="")),""===i.style.display&&ft(i)&&(r[o]=yt(i))):"none"!==n&&(r[o]="none",nt.set(i,"display",n)));for(o=0;o<a;o++)null!=r[o]&&(t[o].style.display=r[o]);return t}S.fn.extend({show:function(){return bt(this,!0)},hide:function(){return bt(this)},toggle:function(t){return"boolean"===typeof t?t?this.show():this.hide():this.each((function(){ft(this)?S(this).show():S(this).hide()}))}});var xt=/^(?:checkbox|radio)$/i,wt=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,_t=/^$|^module$|\/(?:java|ecma)script/i,Mt={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function Tt(t,e){var n;return n="undefined"!==typeof t.getElementsByTagName?t.getElementsByTagName(e||"*"):"undefined"!==typeof t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&O(t,e)?S.merge([t],n):n}function St(t,e){for(var n=0,i=t.length;n<i;n++)nt.set(t[n],"globalEval",!e||nt.get(e[n],"globalEval"))}Mt.optgroup=Mt.option,Mt.tbody=Mt.tfoot=Mt.colgroup=Mt.caption=Mt.thead,Mt.th=Mt.td;var Et=/<|&#?\w+;/;function At(t,e,n,i,r){for(var o,a,s,c,l,u,h=e.createDocumentFragment(),p=[],d=0,f=t.length;d<f;d++)if(o=t[d],o||0===o)if("object"===M(o))S.merge(p,o.nodeType?[o]:o);else if(Et.test(o)){a=a||h.appendChild(e.createElement("div")),s=(wt.exec(o)||["",""])[1].toLowerCase(),c=Mt[s]||Mt._default,a.innerHTML=c[1]+S.htmlPrefilter(o)+c[2],u=c[0];while(u--)a=a.lastChild;S.merge(p,a.childNodes),a=h.firstChild,a.textContent=""}else p.push(e.createTextNode(o));h.textContent="",d=0;while(o=p[d++])if(i&&S.inArray(o,i)>-1)r&&r.push(o);else if(l=pt(o),a=Tt(h.appendChild(o),"script"),l&&St(a),n){u=0;while(o=a[u++])_t.test(o.type||"")&&n.push(o)}return h}(function(){var t=s.createDocumentFragment(),e=t.appendChild(s.createElement("div")),n=s.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),e.appendChild(n),y.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="<textarea>x</textarea>",y.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue})();var Ct=/^key/,Lt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Pt=/^([^.]*)(?:\.(.+)|)/;function Rt(){return!0}function Ot(){return!1}function Dt(t,e){return t===Nt()===("focus"===e)}function Nt(){try{return s.activeElement}catch(t){}}function It(t,e,n,i,r,o){var a,s;if("object"===typeof e){for(s in"string"!==typeof n&&(i=i||n,n=void 0),e)It(t,s,n,i,e[s],o);return t}if(null==i&&null==r?(r=n,i=n=void 0):null==r&&("string"===typeof n?(r=i,i=void 0):(r=i,i=n,n=void 0)),!1===r)r=Ot;else if(!r)return t;return 1===o&&(a=r,r=function(t){return S().off(t),a.apply(this,arguments)},r.guid=a.guid||(a.guid=S.guid++)),t.each((function(){S.event.add(this,e,r,i,n)}))}function zt(t,e,n){n?(nt.set(t,e,!1),S.event.add(t,e,{namespace:!1,handler:function(t){var i,r,o=nt.get(this,e);if(1&t.isTrigger&&this[e]){if(o.length)(S.event.special[e]||{}).delegateType&&t.stopPropagation();else if(o=l.call(arguments),nt.set(this,e,o),i=n(this,e),this[e](),r=nt.get(this,e),o!==r||i?nt.set(this,e,!1):r={},o!==r)return t.stopImmediatePropagation(),t.preventDefault(),r.value}else o.length&&(nt.set(this,e,{value:S.event.trigger(S.extend(o[0],S.Event.prototype),o.slice(1),this)}),t.stopImmediatePropagation())}})):void 0===nt.get(t,e)&&S.event.add(t,e,Rt)}S.event={global:{},add:function(t,e,n,i,r){var o,a,s,c,l,u,h,p,d,f,m,g=nt.get(t);if(g){n.handler&&(o=n,n=o.handler,r=o.selector),r&&S.find.matchesSelector(ht,r),n.guid||(n.guid=S.guid++),(c=g.events)||(c=g.events={}),(a=g.handle)||(a=g.handle=function(e){return"undefined"!==typeof S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),e=(e||"").match(G)||[""],l=e.length;while(l--)s=Pt.exec(e[l])||[],d=m=s[1],f=(s[2]||"").split(".").sort(),d&&(h=S.event.special[d]||{},d=(r?h.delegateType:h.bindType)||d,h=S.event.special[d]||{},u=S.extend({type:d,origType:m,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&S.expr.match.needsContext.test(r),namespace:f.join(".")},o),(p=c[d])||(p=c[d]=[],p.delegateCount=0,h.setup&&!1!==h.setup.call(t,i,f,a)||t.addEventListener&&t.addEventListener(d,a)),h.add&&(h.add.call(t,u),u.handler.guid||(u.handler.guid=n.guid)),r?p.splice(p.delegateCount++,0,u):p.push(u),S.event.global[d]=!0)}},remove:function(t,e,n,i,r){var o,a,s,c,l,u,h,p,d,f,m,g=nt.hasData(t)&&nt.get(t);if(g&&(c=g.events)){e=(e||"").match(G)||[""],l=e.length;while(l--)if(s=Pt.exec(e[l])||[],d=m=s[1],f=(s[2]||"").split(".").sort(),d){h=S.event.special[d]||{},d=(i?h.delegateType:h.bindType)||d,p=c[d]||[],s=s[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)u=p[o],!r&&m!==u.origType||n&&n.guid!==u.guid||s&&!s.test(u.namespace)||i&&i!==u.selector&&("**"!==i||!u.selector)||(p.splice(o,1),u.selector&&p.delegateCount--,h.remove&&h.remove.call(t,u));a&&!p.length&&(h.teardown&&!1!==h.teardown.call(t,f,g.handle)||S.removeEvent(t,d,g.handle),delete c[d])}else for(d in c)S.event.remove(t,d+e[l],n,i,!0);S.isEmptyObject(c)&&nt.remove(t,"handle events")}},dispatch:function(t){var e,n,i,r,o,a,s=S.event.fix(t),c=new Array(arguments.length),l=(nt.get(this,"events")||{})[s.type]||[],u=S.event.special[s.type]||{};for(c[0]=s,e=1;e<arguments.length;e++)c[e]=arguments[e];if(s.delegateTarget=this,!u.preDispatch||!1!==u.preDispatch.call(this,s)){a=S.event.handlers.call(this,s,l),e=0;while((r=a[e++])&&!s.isPropagationStopped()){s.currentTarget=r.elem,n=0;while((o=r.handlers[n++])&&!s.isImmediatePropagationStopped())s.rnamespace&&!1!==o.namespace&&!s.rnamespace.test(o.namespace)||(s.handleObj=o,s.data=o.data,i=((S.event.special[o.origType]||{}).handle||o.handler).apply(r.elem,c),void 0!==i&&!1===(s.result=i)&&(s.preventDefault(),s.stopPropagation()))}return u.postDispatch&&u.postDispatch.call(this,s),s.result}},handlers:function(t,e){var n,i,r,o,a,s=[],c=e.delegateCount,l=t.target;if(c&&l.nodeType&&!("click"===t.type&&t.button>=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==t.type||!0!==l.disabled)){for(o=[],a={},n=0;n<c;n++)i=e[n],r=i.selector+" ",void 0===a[r]&&(a[r]=i.needsContext?S(r,this).index(l)>-1:S.find(r,this,null,[l]).length),a[r]&&o.push(i);o.length&&s.push({elem:l,handlers:o})}return l=this,c<e.length&&s.push({elem:l,handlers:e.slice(c)}),s},addProp:function(t,e){Object.defineProperty(S.Event.prototype,t,{enumerable:!0,configurable:!0,get:b(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(t){return t[S.expando]?t:new S.Event(t)},special:{load:{noBubble:!0},click:{setup:function(t){var e=this||t;return xt.test(e.type)&&e.click&&O(e,"input")&&zt(e,"click",Rt),!1},trigger:function(t){var e=this||t;return xt.test(e.type)&&e.click&&O(e,"input")&&zt(e,"click"),!0},_default:function(t){var e=t.target;return xt.test(e.type)&&e.click&&O(e,"input")&&nt.get(e,"click")||O(e,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},S.removeEvent=function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n)},S.Event=function(t,e){if(!(this instanceof S.Event))return new S.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?Rt:Ot,this.target=t.target&&3===t.target.nodeType?t.target.parentNode:t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget):this.type=t,e&&S.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Ot,isPropagationStopped:Ot,isImmediatePropagationStopped:Ot,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=Rt,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=Rt,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=Rt,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(t){var e=t.button;return null==t.which&&Ct.test(t.type)?null!=t.charCode?t.charCode:t.keyCode:!t.which&&void 0!==e&&Lt.test(t.type)?1&e?1:2&e?3:4&e?2:0:t.which}},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},(function(t,e){S.event.special[t]={setup:function(){return zt(this,t,Dt),!1},trigger:function(){return zt(this,t),!0},delegateType:e}})),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(t,e){S.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,i=this,r=t.relatedTarget,o=t.handleObj;return r&&(r===i||S.contains(i,r))||(t.type=o.origType,n=o.handler.apply(this,arguments),t.type=e),n}}})),S.fn.extend({on:function(t,e,n,i){return It(this,t,e,n,i)},one:function(t,e,n,i){return It(this,t,e,n,i,1)},off:function(t,e,n){var i,r;if(t&&t.preventDefault&&t.handleObj)return i=t.handleObj,S(t.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"===typeof t){for(r in t)this.off(r,e,t[r]);return this}return!1!==e&&"function"!==typeof e||(n=e,e=void 0),!1===n&&(n=Ot),this.each((function(){S.event.remove(this,t,n,e)}))}});var Bt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,kt=/<script|<style|<link/i,Ht=/checked\s*(?:[^=]|=\s*.checked.)/i,Ut=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Gt(t,e){return O(t,"table")&&O(11!==e.nodeType?e:e.firstChild,"tr")&&S(t).children("tbody")[0]||t}function Ft(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function jt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Vt(t,e){var n,i,r,o,a,s,c,l;if(1===e.nodeType){if(nt.hasData(t)&&(o=nt.access(t),a=nt.set(e,o),l=o.events,l))for(r in delete a.handle,a.events={},l)for(n=0,i=l[r].length;n<i;n++)S.event.add(e,r,l[r][n]);it.hasData(t)&&(s=it.access(t),c=S.extend({},s),it.set(e,c))}}function Wt(t,e){var n=e.nodeName.toLowerCase();"input"===n&&xt.test(t.type)?e.checked=t.checked:"input"!==n&&"textarea"!==n||(e.defaultValue=t.defaultValue)}function qt(t,e,n,i){e=u.apply([],e);var r,o,a,s,c,l,h=0,p=t.length,d=p-1,f=e[0],m=b(f);if(m||p>1&&"string"===typeof f&&!y.checkClone&&Ht.test(f))return t.each((function(r){var o=t.eq(r);m&&(e[0]=f.call(this,r,o.html())),qt(o,e,n,i)}));if(p&&(r=At(e,t[0].ownerDocument,!1,t,i),o=r.firstChild,1===r.childNodes.length&&(r=o),o||i)){for(a=S.map(Tt(r,"script"),Ft),s=a.length;h<p;h++)c=r,h!==d&&(c=S.clone(c,!0,!0),s&&S.merge(a,Tt(c,"script"))),n.call(t[h],c,h);if(s)for(l=a[a.length-1].ownerDocument,S.map(a,jt),h=0;h<s;h++)c=a[h],_t.test(c.type||"")&&!nt.access(c,"globalEval")&&S.contains(l,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?S._evalUrl&&!c.noModule&&S._evalUrl(c.src,{nonce:c.nonce||c.getAttribute("nonce")}):_(c.textContent.replace(Ut,""),c,l))}return t}function Xt(t,e,n){for(var i,r=e?S.filter(e,t):t,o=0;null!=(i=r[o]);o++)n||1!==i.nodeType||S.cleanData(Tt(i)),i.parentNode&&(n&&pt(i)&&St(Tt(i,"script")),i.parentNode.removeChild(i));return t}S.extend({htmlPrefilter:function(t){return t.replace(Bt,"<$1></$2>")},clone:function(t,e,n){var i,r,o,a,s=t.cloneNode(!0),c=pt(t);if(!y.noCloneChecked&&(1===t.nodeType||11===t.nodeType)&&!S.isXMLDoc(t))for(a=Tt(s),o=Tt(t),i=0,r=o.length;i<r;i++)Wt(o[i],a[i]);if(e)if(n)for(o=o||Tt(t),a=a||Tt(s),i=0,r=o.length;i<r;i++)Vt(o[i],a[i]);else Vt(t,s);return a=Tt(s,"script"),a.length>0&&St(a,!c&&Tt(t,"script")),s},cleanData:function(t){for(var e,n,i,r=S.event.special,o=0;void 0!==(n=t[o]);o++)if(tt(n)){if(e=n[nt.expando]){if(e.events)for(i in e.events)r[i]?S.event.remove(n,i):S.removeEvent(n,i,e.handle);n[nt.expando]=void 0}n[it.expando]&&(n[it.expando]=void 0)}}}),S.fn.extend({detach:function(t){return Xt(this,t,!0)},remove:function(t){return Xt(this,t)},text:function(t){return J(this,(function(t){return void 0===t?S.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return qt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Gt(this,t);e.appendChild(t)}}))},prepend:function(){return qt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Gt(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return qt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return qt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(S.cleanData(Tt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return S.clone(this,t,e)}))},html:function(t){return J(this,(function(t){var e=this[0]||{},n=0,i=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"===typeof t&&!kt.test(t)&&!Mt[(wt.exec(t)||["",""])[1].toLowerCase()]){t=S.htmlPrefilter(t);try{for(;n<i;n++)e=this[n]||{},1===e.nodeType&&(S.cleanData(Tt(e,!1)),e.innerHTML=t);e=0}catch(r){}}e&&this.empty().append(t)}),null,t,arguments.length)},replaceWith:function(){var t=[];return qt(this,arguments,(function(e){var n=this.parentNode;S.inArray(this,t)<0&&(S.cleanData(Tt(this)),n&&n.replaceChild(e,this))}),t)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(t,e){S.fn[t]=function(t){for(var n,i=[],r=S(t),o=r.length-1,a=0;a<=o;a++)n=a===o?this:this.clone(!0),S(r[a])[e](n),h.apply(i,n.get());return this.pushStack(i)}}));var Yt=new RegExp("^("+ct+")(?!px)[a-z%]+$","i"),Jt=function(t){var e=t.ownerDocument.defaultView;return e&&e.opener||(e=n),e.getComputedStyle(t)},Zt=new RegExp(ut.join("|"),"i");function $t(t,e,n){var i,r,o,a,s=t.style;return n=n||Jt(t),n&&(a=n.getPropertyValue(e)||n[e],""!==a||pt(t)||(a=S.style(t,e)),!y.pixelBoxStyles()&&Yt.test(a)&&Zt.test(e)&&(i=s.width,r=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=i,s.minWidth=r,s.maxWidth=o)),void 0!==a?a+"":a}function Qt(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}(function(){function t(){if(u){l.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",u.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ht.appendChild(l).appendChild(u);var t=n.getComputedStyle(u);i="1%"!==t.top,c=12===e(t.marginLeft),u.style.right="60%",a=36===e(t.right),r=36===e(t.width),u.style.position="absolute",o=12===e(u.offsetWidth/3),ht.removeChild(l),u=null}}function e(t){return Math.round(parseFloat(t))}var i,r,o,a,c,l=s.createElement("div"),u=s.createElement("div");u.style&&(u.style.backgroundClip="content-box",u.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===u.style.backgroundClip,S.extend(y,{boxSizingReliable:function(){return t(),r},pixelBoxStyles:function(){return t(),a},pixelPosition:function(){return t(),i},reliableMarginLeft:function(){return t(),c},scrollboxSize:function(){return t(),o}}))})();var Kt=["Webkit","Moz","ms"],te=s.createElement("div").style,ee={};function ne(t){var e=t[0].toUpperCase()+t.slice(1),n=Kt.length;while(n--)if(t=Kt[n]+e,t in te)return t}function ie(t){var e=S.cssProps[t]||ee[t];return e||(t in te?t:ee[t]=ne(t)||t)}var re=/^(none|table(?!-c[ea]).+)/,oe=/^--/,ae={position:"absolute",visibility:"hidden",display:"block"},se={letterSpacing:"0",fontWeight:"400"};function ce(t,e,n){var i=lt.exec(e);return i?Math.max(0,i[2]-(n||0))+(i[3]||"px"):e}function le(t,e,n,i,r,o){var a="width"===e?1:0,s=0,c=0;if(n===(i?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(c+=S.css(t,n+ut[a],!0,r)),i?("content"===n&&(c-=S.css(t,"padding"+ut[a],!0,r)),"margin"!==n&&(c-=S.css(t,"border"+ut[a]+"Width",!0,r))):(c+=S.css(t,"padding"+ut[a],!0,r),"padding"!==n?c+=S.css(t,"border"+ut[a]+"Width",!0,r):s+=S.css(t,"border"+ut[a]+"Width",!0,r));return!i&&o>=0&&(c+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-o-c-s-.5))||0),c}function ue(t,e,n){var i=Jt(t),r=!y.boxSizingReliable()||n,o=r&&"border-box"===S.css(t,"boxSizing",!1,i),a=o,s=$t(t,e,i),c="offset"+e[0].toUpperCase()+e.slice(1);if(Yt.test(s)){if(!n)return s;s="auto"}return(!y.boxSizingReliable()&&o||"auto"===s||!parseFloat(s)&&"inline"===S.css(t,"display",!1,i))&&t.getClientRects().length&&(o="border-box"===S.css(t,"boxSizing",!1,i),a=c in t,a&&(s=t[c])),s=parseFloat(s)||0,s+le(t,e,n||(o?"border":"content"),a,i,s)+"px"}function he(t,e,n,i,r){return new he.prototype.init(t,e,n,i,r)}S.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=$t(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(t,e,n,i){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var r,o,a,s=K(e),c=oe.test(e),l=t.style;if(c||(e=ie(s)),a=S.cssHooks[e]||S.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(r=a.get(t,!1,i))?r:l[e];o=typeof n,"string"===o&&(r=lt.exec(n))&&r[1]&&(n=gt(t,e,r),o="number"),null!=n&&n===n&&("number"!==o||c||(n+=r&&r[3]||(S.cssNumber[s]?"":"px")),y.clearCloneStyle||""!==n||0!==e.indexOf("background")||(l[e]="inherit"),a&&"set"in a&&void 0===(n=a.set(t,n,i))||(c?l.setProperty(e,n):l[e]=n))}},css:function(t,e,n,i){var r,o,a,s=K(e),c=oe.test(e);return c||(e=ie(s)),a=S.cssHooks[e]||S.cssHooks[s],a&&"get"in a&&(r=a.get(t,!0,n)),void 0===r&&(r=$t(t,e,i)),"normal"===r&&e in se&&(r=se[e]),""===n||n?(o=parseFloat(r),!0===n||isFinite(o)?o||0:r):r}}),S.each(["height","width"],(function(t,e){S.cssHooks[e]={get:function(t,n,i){if(n)return!re.test(S.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?ue(t,e,i):mt(t,ae,(function(){return ue(t,e,i)}))},set:function(t,n,i){var r,o=Jt(t),a=!y.scrollboxSize()&&"absolute"===o.position,s=a||i,c=s&&"border-box"===S.css(t,"boxSizing",!1,o),l=i?le(t,e,i,c,o):0;return c&&a&&(l-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(o[e])-le(t,e,"border",!1,o)-.5)),l&&(r=lt.exec(n))&&"px"!==(r[3]||"px")&&(t.style[e]=n,n=S.css(t,e)),ce(t,n,l)}}})),S.cssHooks.marginLeft=Qt(y.reliableMarginLeft,(function(t,e){if(e)return(parseFloat($t(t,"marginLeft"))||t.getBoundingClientRect().left-mt(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),S.each({margin:"",padding:"",border:"Width"},(function(t,e){S.cssHooks[t+e]={expand:function(n){for(var i=0,r={},o="string"===typeof n?n.split(" "):[n];i<4;i++)r[t+ut[i]+e]=o[i]||o[i-2]||o[0];return r}},"margin"!==t&&(S.cssHooks[t+e].set=ce)})),S.fn.extend({css:function(t,e){return J(this,(function(t,e,n){var i,r,o={},a=0;if(Array.isArray(e)){for(i=Jt(t),r=e.length;a<r;a++)o[e[a]]=S.css(t,e[a],!1,i);return o}return void 0!==n?S.style(t,e,n):S.css(t,e)}),t,e,arguments.length>1)}}),S.Tween=he,he.prototype={constructor:he,init:function(t,e,n,i,r,o){this.elem=t,this.prop=n,this.easing=r||S.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=i,this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var t=he.propHooks[this.prop];return t&&t.get?t.get(this):he.propHooks._default.get(this)},run:function(t){var e,n=he.propHooks[this.prop];return this.options.duration?this.pos=e=S.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):he.propHooks._default.set(this),this}},he.prototype.init.prototype=he.prototype,he.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=S.css(t.elem,t.prop,""),e&&"auto"!==e?e:0)},set:function(t){S.fx.step[t.prop]?S.fx.step[t.prop](t):1!==t.elem.nodeType||!S.cssHooks[t.prop]&&null==t.elem.style[ie(t.prop)]?t.elem[t.prop]=t.now:S.style(t.elem,t.prop,t.now+t.unit)}}},he.propHooks.scrollTop=he.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},S.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},S.fx=he.prototype.init,S.fx.step={};var pe,de,fe=/^(?:toggle|show|hide)$/,me=/queueHooks$/;function ge(){de&&(!1===s.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(ge):n.setTimeout(ge,S.fx.interval),S.fx.tick())}function ve(){return n.setTimeout((function(){pe=void 0})),pe=Date.now()}function ye(t,e){var n,i=0,r={height:t};for(e=e?1:0;i<4;i+=2-e)n=ut[i],r["margin"+n]=r["padding"+n]=t;return e&&(r.opacity=r.width=t),r}function be(t,e,n){for(var i,r=(_e.tweeners[e]||[]).concat(_e.tweeners["*"]),o=0,a=r.length;o<a;o++)if(i=r[o].call(n,e,t))return i}function xe(t,e,n){var i,r,o,a,s,c,l,u,h="width"in e||"height"in e,p=this,d={},f=t.style,m=t.nodeType&&ft(t),g=nt.get(t,"fxshow");for(i in n.queue||(a=S._queueHooks(t,"fx"),null==a.unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always((function(){p.always((function(){a.unqueued--,S.queue(t,"fx").length||a.empty.fire()}))}))),e)if(r=e[i],fe.test(r)){if(delete e[i],o=o||"toggle"===r,r===(m?"hide":"show")){if("show"!==r||!g||void 0===g[i])continue;m=!0}d[i]=g&&g[i]||S.style(t,i)}if(c=!S.isEmptyObject(e),c||!S.isEmptyObject(d))for(i in h&&1===t.nodeType&&(n.overflow=[f.overflow,f.overflowX,f.overflowY],l=g&&g.display,null==l&&(l=nt.get(t,"display")),u=S.css(t,"display"),"none"===u&&(l?u=l:(bt([t],!0),l=t.style.display||l,u=S.css(t,"display"),bt([t]))),("inline"===u||"inline-block"===u&&null!=l)&&"none"===S.css(t,"float")&&(c||(p.done((function(){f.display=l})),null==l&&(u=f.display,l="none"===u?"":u)),f.display="inline-block")),n.overflow&&(f.overflow="hidden",p.always((function(){f.overflow=n.overflow[0],f.overflowX=n.overflow[1],f.overflowY=n.overflow[2]}))),c=!1,d)c||(g?"hidden"in g&&(m=g.hidden):g=nt.access(t,"fxshow",{display:l}),o&&(g.hidden=!m),m&&bt([t],!0),p.done((function(){for(i in m||bt([t]),nt.remove(t,"fxshow"),d)S.style(t,i,d[i])}))),c=be(m?g[i]:0,i,p),i in g||(g[i]=c.start,m&&(c.end=c.start,c.start=0))}function we(t,e){var n,i,r,o,a;for(n in t)if(i=K(n),r=e[i],o=t[n],Array.isArray(o)&&(r=o[1],o=t[n]=o[0]),n!==i&&(t[i]=o,delete t[n]),a=S.cssHooks[i],a&&"expand"in a)for(n in o=a.expand(o),delete t[i],o)n in t||(t[n]=o[n],e[n]=r);else e[i]=r}function _e(t,e,n){var i,r,o=0,a=_e.prefilters.length,s=S.Deferred().always((function(){delete c.elem})),c=function(){if(r)return!1;for(var e=pe||ve(),n=Math.max(0,l.startTime+l.duration-e),i=n/l.duration||0,o=1-i,a=0,c=l.tweens.length;a<c;a++)l.tweens[a].run(o);return s.notifyWith(t,[l,o,n]),o<1&&c?n:(c||s.notifyWith(t,[l,1,0]),s.resolveWith(t,[l]),!1)},l=s.promise({elem:t,props:S.extend({},e),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},n),originalProperties:e,originalOptions:n,startTime:pe||ve(),duration:n.duration,tweens:[],createTween:function(e,n){var i=S.Tween(t,l.opts,e,n,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(i),i},stop:function(e){var n=0,i=e?l.tweens.length:0;if(r)return this;for(r=!0;n<i;n++)l.tweens[n].run(1);return e?(s.notifyWith(t,[l,1,0]),s.resolveWith(t,[l,e])):s.rejectWith(t,[l,e]),this}}),u=l.props;for(we(u,l.opts.specialEasing);o<a;o++)if(i=_e.prefilters[o].call(l,t,u,l.opts),i)return b(i.stop)&&(S._queueHooks(l.elem,l.opts.queue).stop=i.stop.bind(i)),i;return S.map(u,be,l),b(l.opts.start)&&l.opts.start.call(t,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),S.fx.timer(S.extend(c,{elem:t,anim:l,queue:l.opts.queue})),l}S.Animation=S.extend(_e,{tweeners:{"*":[function(t,e){var n=this.createTween(t,e);return gt(n.elem,t,lt.exec(e),n),n}]},tweener:function(t,e){b(t)?(e=t,t=["*"]):t=t.match(G);for(var n,i=0,r=t.length;i<r;i++)n=t[i],_e.tweeners[n]=_e.tweeners[n]||[],_e.tweeners[n].unshift(e)},prefilters:[xe],prefilter:function(t,e){e?_e.prefilters.unshift(t):_e.prefilters.push(t)}}),S.speed=function(t,e,n){var i=t&&"object"===typeof t?S.extend({},t):{complete:n||!n&&e||b(t)&&t,duration:t,easing:n&&e||e&&!b(e)&&e};return S.fx.off?i.duration=0:"number"!==typeof i.duration&&(i.duration in S.fx.speeds?i.duration=S.fx.speeds[i.duration]:i.duration=S.fx.speeds._default),null!=i.queue&&!0!==i.queue||(i.queue="fx"),i.old=i.complete,i.complete=function(){b(i.old)&&i.old.call(this),i.queue&&S.dequeue(this,i.queue)},i},S.fn.extend({fadeTo:function(t,e,n,i){return this.filter(ft).css("opacity",0).show().end().animate({opacity:e},t,n,i)},animate:function(t,e,n,i){var r=S.isEmptyObject(t),o=S.speed(e,n,i),a=function(){var e=_e(this,S.extend({},t),o);(r||nt.get(this,"finish"))&&e.stop(!0)};return a.finish=a,r||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(t,e,n){var i=function(t){var e=t.stop;delete t.stop,e(n)};return"string"!==typeof t&&(n=e,e=t,t=void 0),e&&!1!==t&&this.queue(t||"fx",[]),this.each((function(){var e=!0,r=null!=t&&t+"queueHooks",o=S.timers,a=nt.get(this);if(r)a[r]&&a[r].stop&&i(a[r]);else for(r in a)a[r]&&a[r].stop&&me.test(r)&&i(a[r]);for(r=o.length;r--;)o[r].elem!==this||null!=t&&o[r].queue!==t||(o[r].anim.stop(n),e=!1,o.splice(r,1));!e&&n||S.dequeue(this,t)}))},finish:function(t){return!1!==t&&(t=t||"fx"),this.each((function(){var e,n=nt.get(this),i=n[t+"queue"],r=n[t+"queueHooks"],o=S.timers,a=i?i.length:0;for(n.finish=!0,S.queue(this,t,[]),r&&r.stop&&r.stop.call(this,!0),e=o.length;e--;)o[e].elem===this&&o[e].queue===t&&(o[e].anim.stop(!0),o.splice(e,1));for(e=0;e<a;e++)i[e]&&i[e].finish&&i[e].finish.call(this);delete n.finish}))}}),S.each(["toggle","show","hide"],(function(t,e){var n=S.fn[e];S.fn[e]=function(t,i,r){return null==t||"boolean"===typeof t?n.apply(this,arguments):this.animate(ye(e,!0),t,i,r)}})),S.each({slideDown:ye("show"),slideUp:ye("hide"),slideToggle:ye("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(t,e){S.fn[t]=function(t,n,i){return this.animate(e,t,n,i)}})),S.timers=[],S.fx.tick=function(){var t,e=0,n=S.timers;for(pe=Date.now();e<n.length;e++)t=n[e],t()||n[e]!==t||n.splice(e--,1);n.length||S.fx.stop(),pe=void 0},S.fx.timer=function(t){S.timers.push(t),S.fx.start()},S.fx.interval=13,S.fx.start=function(){de||(de=!0,ge())},S.fx.stop=function(){de=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(t,e){return t=S.fx&&S.fx.speeds[t]||t,e=e||"fx",this.queue(e,(function(e,i){var r=n.setTimeout(e,t);i.stop=function(){n.clearTimeout(r)}}))},function(){var t=s.createElement("input"),e=s.createElement("select"),n=e.appendChild(s.createElement("option"));t.type="checkbox",y.checkOn=""!==t.value,y.optSelected=n.selected,t=s.createElement("input"),t.value="t",t.type="radio",y.radioValue="t"===t.value}();var Me,Te=S.expr.attrHandle;S.fn.extend({attr:function(t,e){return J(this,S.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each((function(){S.removeAttr(this,t)}))}}),S.extend({attr:function(t,e,n){var i,r,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"===typeof t.getAttribute?S.prop(t,e,n):(1===o&&S.isXMLDoc(t)||(r=S.attrHooks[e.toLowerCase()]||(S.expr.match.bool.test(e)?Me:void 0)),void 0!==n?null===n?void S.removeAttr(t,e):r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:(t.setAttribute(e,n+""),n):r&&"get"in r&&null!==(i=r.get(t,e))?i:(i=S.find.attr(t,e),null==i?void 0:i))},attrHooks:{type:{set:function(t,e){if(!y.radioValue&&"radio"===e&&O(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,i=0,r=e&&e.match(G);if(r&&1===t.nodeType)while(n=r[i++])t.removeAttribute(n)}}),Me={set:function(t,e,n){return!1===e?S.removeAttr(t,n):t.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),(function(t,e){var n=Te[e]||S.find.attr;Te[e]=function(t,e,i){var r,o,a=e.toLowerCase();return i||(o=Te[a],Te[a]=r,r=null!=n(t,e,i)?a:null,Te[a]=o),r}}));var Se=/^(?:input|select|textarea|button)$/i,Ee=/^(?:a|area)$/i;function Ae(t){var e=t.match(G)||[];return e.join(" ")}function Ce(t){return t.getAttribute&&t.getAttribute("class")||""}function Le(t){return Array.isArray(t)?t:"string"===typeof t&&t.match(G)||[]}S.fn.extend({prop:function(t,e){return J(this,S.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[S.propFix[t]||t]}))}}),S.extend({prop:function(t,e,n){var i,r,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(t)||(e=S.propFix[e]||e,r=S.propHooks[e]),void 0!==n?r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:t[e]=n:r&&"get"in r&&null!==(i=r.get(t,e))?i:t[e]},propHooks:{tabIndex:{get:function(t){var e=S.find.attr(t,"tabindex");return e?parseInt(e,10):Se.test(t.nodeName)||Ee.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),y.optSelected||(S.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){S.propFix[this.toLowerCase()]=this})),S.fn.extend({addClass:function(t){var e,n,i,r,o,a,s,c=0;if(b(t))return this.each((function(e){S(this).addClass(t.call(this,e,Ce(this)))}));if(e=Le(t),e.length)while(n=this[c++])if(r=Ce(n),i=1===n.nodeType&&" "+Ae(r)+" ",i){a=0;while(o=e[a++])i.indexOf(" "+o+" ")<0&&(i+=o+" ");s=Ae(i),r!==s&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,i,r,o,a,s,c=0;if(b(t))return this.each((function(e){S(this).removeClass(t.call(this,e,Ce(this)))}));if(!arguments.length)return this.attr("class","");if(e=Le(t),e.length)while(n=this[c++])if(r=Ce(n),i=1===n.nodeType&&" "+Ae(r)+" ",i){a=0;while(o=e[a++])while(i.indexOf(" "+o+" ")>-1)i=i.replace(" "+o+" "," ");s=Ae(i),r!==s&&n.setAttribute("class",s)}return this},toggleClass:function(t,e){var n=typeof t,i="string"===n||Array.isArray(t);return"boolean"===typeof e&&i?e?this.addClass(t):this.removeClass(t):b(t)?this.each((function(n){S(this).toggleClass(t.call(this,n,Ce(this),e),e)})):this.each((function(){var e,r,o,a;if(i){r=0,o=S(this),a=Le(t);while(e=a[r++])o.hasClass(e)?o.removeClass(e):o.addClass(e)}else void 0!==t&&"boolean"!==n||(e=Ce(this),e&&nt.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":nt.get(this,"__className__")||""))}))},hasClass:function(t){var e,n,i=0;e=" "+t+" ";while(n=this[i++])if(1===n.nodeType&&(" "+Ae(Ce(n))+" ").indexOf(e)>-1)return!0;return!1}});var Pe=/\r/g;S.fn.extend({val:function(t){var e,n,i,r=this[0];return arguments.length?(i=b(t),this.each((function(n){var r;1===this.nodeType&&(r=i?t.call(this,n,S(this).val()):t,null==r?r="":"number"===typeof r?r+="":Array.isArray(r)&&(r=S.map(r,(function(t){return null==t?"":t+""}))),e=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()],e&&"set"in e&&void 0!==e.set(this,r,"value")||(this.value=r))}))):r?(e=S.valHooks[r.type]||S.valHooks[r.nodeName.toLowerCase()],e&&"get"in e&&void 0!==(n=e.get(r,"value"))?n:(n=r.value,"string"===typeof n?n.replace(Pe,""):null==n?"":n)):void 0}}),S.extend({valHooks:{option:{get:function(t){var e=S.find.attr(t,"value");return null!=e?e:Ae(S.text(t))}},select:{get:function(t){var e,n,i,r=t.options,o=t.selectedIndex,a="select-one"===t.type,s=a?null:[],c=a?o+1:r.length;for(i=o<0?c:a?o:0;i<c;i++)if(n=r[i],(n.selected||i===o)&&!n.disabled&&(!n.parentNode.disabled||!O(n.parentNode,"optgroup"))){if(e=S(n).val(),a)return e;s.push(e)}return s},set:function(t,e){var n,i,r=t.options,o=S.makeArray(e),a=r.length;while(a--)i=r[a],(i.selected=S.inArray(S.valHooks.option.get(i),o)>-1)&&(n=!0);return n||(t.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],(function(){S.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=S.inArray(S(t).val(),e)>-1}},y.checkOn||(S.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})})),y.focusin="onfocusin"in n;var Re=/^(?:focusinfocus|focusoutblur)$/,Oe=function(t){t.stopPropagation()};S.extend(S.event,{trigger:function(t,e,i,r){var o,a,c,l,u,h,p,d,f=[i||s],g=m.call(t,"type")?t.type:t,v=m.call(t,"namespace")?t.namespace.split("."):[];if(a=d=c=i=i||s,3!==i.nodeType&&8!==i.nodeType&&!Re.test(g+S.event.triggered)&&(g.indexOf(".")>-1&&(v=g.split("."),g=v.shift(),v.sort()),u=g.indexOf(":")<0&&"on"+g,t=t[S.expando]?t:new S.Event(g,"object"===typeof t&&t),t.isTrigger=r?2:3,t.namespace=v.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),e=null==e?[t]:S.makeArray(e,[t]),p=S.event.special[g]||{},r||!p.trigger||!1!==p.trigger.apply(i,e))){if(!r&&!p.noBubble&&!x(i)){for(l=p.delegateType||g,Re.test(l+g)||(a=a.parentNode);a;a=a.parentNode)f.push(a),c=a;c===(i.ownerDocument||s)&&f.push(c.defaultView||c.parentWindow||n)}o=0;while((a=f[o++])&&!t.isPropagationStopped())d=a,t.type=o>1?l:p.bindType||g,h=(nt.get(a,"events")||{})[t.type]&&nt.get(a,"handle"),h&&h.apply(a,e),h=u&&a[u],h&&h.apply&&tt(a)&&(t.result=h.apply(a,e),!1===t.result&&t.preventDefault());return t.type=g,r||t.isDefaultPrevented()||p._default&&!1!==p._default.apply(f.pop(),e)||!tt(i)||u&&b(i[g])&&!x(i)&&(c=i[u],c&&(i[u]=null),S.event.triggered=g,t.isPropagationStopped()&&d.addEventListener(g,Oe),i[g](),t.isPropagationStopped()&&d.removeEventListener(g,Oe),S.event.triggered=void 0,c&&(i[u]=c)),t.result}},simulate:function(t,e,n){var i=S.extend(new S.Event,n,{type:t,isSimulated:!0});S.event.trigger(i,null,e)}}),S.fn.extend({trigger:function(t,e){return this.each((function(){S.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var n=this[0];if(n)return S.event.trigger(t,e,n,!0)}}),y.focusin||S.each({focus:"focusin",blur:"focusout"},(function(t,e){var n=function(t){S.event.simulate(e,t.target,S.event.fix(t))};S.event.special[e]={setup:function(){var i=this.ownerDocument||this,r=nt.access(i,e);r||i.addEventListener(t,n,!0),nt.access(i,e,(r||0)+1)},teardown:function(){var i=this.ownerDocument||this,r=nt.access(i,e)-1;r?nt.access(i,e,r):(i.removeEventListener(t,n,!0),nt.remove(i,e))}}}));var De=n.location,Ne=Date.now(),Ie=/\?/;S.parseXML=function(t){var e;if(!t||"string"!==typeof t)return null;try{e=(new n.DOMParser).parseFromString(t,"text/xml")}catch(i){e=void 0}return e&&!e.getElementsByTagName("parsererror").length||S.error("Invalid XML: "+t),e};var ze=/\[\]$/,Be=/\r?\n/g,ke=/^(?:submit|button|image|reset|file)$/i,He=/^(?:input|select|textarea|keygen)/i;function Ue(t,e,n,i){var r;if(Array.isArray(e))S.each(e,(function(e,r){n||ze.test(t)?i(t,r):Ue(t+"["+("object"===typeof r&&null!=r?e:"")+"]",r,n,i)}));else if(n||"object"!==M(e))i(t,e);else for(r in e)Ue(t+"["+r+"]",e[r],n,i)}S.param=function(t,e){var n,i=[],r=function(t,e){var n=b(e)?e():e;i[i.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!S.isPlainObject(t))S.each(t,(function(){r(this.name,this.value)}));else for(n in t)Ue(n,t[n],e,r);return i.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=S.prop(this,"elements");return t?S.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!S(this).is(":disabled")&&He.test(this.nodeName)&&!ke.test(t)&&(this.checked||!xt.test(t))})).map((function(t,e){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,(function(t){return{name:e.name,value:t.replace(Be,"\r\n")}})):{name:e.name,value:n.replace(Be,"\r\n")}})).get()}});var Ge=/%20/g,Fe=/#.*$/,je=/([?&])_=[^&]*/,Ve=/^(.*?):[ \t]*([^\r\n]*)$/gm,We=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,qe=/^(?:GET|HEAD)$/,Xe=/^\/\//,Ye={},Je={},Ze="*/".concat("*"),$e=s.createElement("a");function Qe(t){return function(e,n){"string"!==typeof e&&(n=e,e="*");var i,r=0,o=e.toLowerCase().match(G)||[];if(b(n))while(i=o[r++])"+"===i[0]?(i=i.slice(1)||"*",(t[i]=t[i]||[]).unshift(n)):(t[i]=t[i]||[]).push(n)}}function Ke(t,e,n,i){var r={},o=t===Je;function a(s){var c;return r[s]=!0,S.each(t[s]||[],(function(t,s){var l=s(e,n,i);return"string"!==typeof l||o||r[l]?o?!(c=l):void 0:(e.dataTypes.unshift(l),a(l),!1)})),c}return a(e.dataTypes[0])||!r["*"]&&a("*")}function tn(t,e){var n,i,r=S.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((r[n]?t:i||(i={}))[n]=e[n]);return i&&S.extend(!0,t,i),t}function en(t,e,n){var i,r,o,a,s=t.contents,c=t.dataTypes;while("*"===c[0])c.shift(),void 0===i&&(i=t.mimeType||e.getResponseHeader("Content-Type"));if(i)for(r in s)if(s[r]&&s[r].test(i)){c.unshift(r);break}if(c[0]in n)o=c[0];else{for(r in n){if(!c[0]||t.converters[r+" "+c[0]]){o=r;break}a||(a=r)}o=o||a}if(o)return o!==c[0]&&c.unshift(o),n[o]}function nn(t,e,n,i){var r,o,a,s,c,l={},u=t.dataTypes.slice();if(u[1])for(a in t.converters)l[a.toLowerCase()]=t.converters[a];o=u.shift();while(o)if(t.responseFields[o]&&(n[t.responseFields[o]]=e),!c&&i&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),c=o,o=u.shift(),o)if("*"===o)o=c;else if("*"!==c&&c!==o){if(a=l[c+" "+o]||l["* "+o],!a)for(r in l)if(s=r.split(" "),s[1]===o&&(a=l[c+" "+s[0]]||l["* "+s[0]],a)){!0===a?a=l[r]:!0!==l[r]&&(o=s[0],u.unshift(s[1]));break}if(!0!==a)if(a&&t.throws)e=a(e);else try{e=a(e)}catch(h){return{state:"parsererror",error:a?h:"No conversion from "+c+" to "+o}}}return{state:"success",data:e}}$e.href=De.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:De.href,type:"GET",isLocal:We.test(De.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ze,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?tn(tn(t,S.ajaxSettings),e):tn(S.ajaxSettings,t)},ajaxPrefilter:Qe(Ye),ajaxTransport:Qe(Je),ajax:function(t,e){"object"===typeof t&&(e=t,t=void 0),e=e||{};var i,r,o,a,c,l,u,h,p,d,f=S.ajaxSetup({},e),m=f.context||f,g=f.context&&(m.nodeType||m.jquery)?S(m):S.event,v=S.Deferred(),y=S.Callbacks("once memory"),b=f.statusCode||{},x={},w={},_="canceled",M={readyState:0,getResponseHeader:function(t){var e;if(u){if(!a){a={};while(e=Ve.exec(o))a[e[1].toLowerCase()+" "]=(a[e[1].toLowerCase()+" "]||[]).concat(e[2])}e=a[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return u?o:null},setRequestHeader:function(t,e){return null==u&&(t=w[t.toLowerCase()]=w[t.toLowerCase()]||t,x[t]=e),this},overrideMimeType:function(t){return null==u&&(f.mimeType=t),this},statusCode:function(t){var e;if(t)if(u)M.always(t[M.status]);else for(e in t)b[e]=[b[e],t[e]];return this},abort:function(t){var e=t||_;return i&&i.abort(e),T(0,e),this}};if(v.promise(M),f.url=((t||f.url||De.href)+"").replace(Xe,De.protocol+"//"),f.type=e.method||e.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(G)||[""],null==f.crossDomain){l=s.createElement("a");try{l.href=f.url,l.href=l.href,f.crossDomain=$e.protocol+"//"+$e.host!==l.protocol+"//"+l.host}catch(E){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!==typeof f.data&&(f.data=S.param(f.data,f.traditional)),Ke(Ye,f,e,M),u)return M;for(p in h=S.event&&f.global,h&&0===S.active++&&S.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!qe.test(f.type),r=f.url.replace(Fe,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(Ge,"+")):(d=f.url.slice(r.length),f.data&&(f.processData||"string"===typeof f.data)&&(r+=(Ie.test(r)?"&":"?")+f.data,delete f.data),!1===f.cache&&(r=r.replace(je,"$1"),d=(Ie.test(r)?"&":"?")+"_="+Ne+++d),f.url=r+d),f.ifModified&&(S.lastModified[r]&&M.setRequestHeader("If-Modified-Since",S.lastModified[r]),S.etag[r]&&M.setRequestHeader("If-None-Match",S.etag[r])),(f.data&&f.hasContent&&!1!==f.contentType||e.contentType)&&M.setRequestHeader("Content-Type",f.contentType),M.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Ze+"; q=0.01":""):f.accepts["*"]),f.headers)M.setRequestHeader(p,f.headers[p]);if(f.beforeSend&&(!1===f.beforeSend.call(m,M,f)||u))return M.abort();if(_="abort",y.add(f.complete),M.done(f.success),M.fail(f.error),i=Ke(Je,f,e,M),i){if(M.readyState=1,h&&g.trigger("ajaxSend",[M,f]),u)return M;f.async&&f.timeout>0&&(c=n.setTimeout((function(){M.abort("timeout")}),f.timeout));try{u=!1,i.send(x,T)}catch(E){if(u)throw E;T(-1,E)}}else T(-1,"No Transport");function T(t,e,a,s){var l,p,d,x,w,_=e;u||(u=!0,c&&n.clearTimeout(c),i=void 0,o=s||"",M.readyState=t>0?4:0,l=t>=200&&t<300||304===t,a&&(x=en(f,M,a)),x=nn(f,x,M,l),l?(f.ifModified&&(w=M.getResponseHeader("Last-Modified"),w&&(S.lastModified[r]=w),w=M.getResponseHeader("etag"),w&&(S.etag[r]=w)),204===t||"HEAD"===f.type?_="nocontent":304===t?_="notmodified":(_=x.state,p=x.data,d=x.error,l=!d)):(d=_,!t&&_||(_="error",t<0&&(t=0))),M.status=t,M.statusText=(e||_)+"",l?v.resolveWith(m,[p,_,M]):v.rejectWith(m,[M,_,d]),M.statusCode(b),b=void 0,h&&g.trigger(l?"ajaxSuccess":"ajaxError",[M,f,l?p:d]),y.fireWith(m,[M,_]),h&&(g.trigger("ajaxComplete",[M,f]),--S.active||S.event.trigger("ajaxStop")))}return M},getJSON:function(t,e,n){return S.get(t,e,n,"json")},getScript:function(t,e){return S.get(t,void 0,e,"script")}}),S.each(["get","post"],(function(t,e){S[e]=function(t,n,i,r){return b(n)&&(r=r||i,i=n,n=void 0),S.ajax(S.extend({url:t,type:e,dataType:r,data:n,success:i},S.isPlainObject(t)&&t))}})),S._evalUrl=function(t,e){return S.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){S.globalEval(t,e)}})},S.fn.extend({wrapAll:function(t){var e;return this[0]&&(b(t)&&(t=t.call(this[0])),e=S(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){var t=this;while(t.firstElementChild)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return b(t)?this.each((function(e){S(this).wrapInner(t.call(this,e))})):this.each((function(){var e=S(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=b(t);return this.each((function(n){S(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){S(this).replaceWith(this.childNodes)})),this}}),S.expr.pseudos.hidden=function(t){return!S.expr.pseudos.visible(t)},S.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(t){}};var rn={0:200,1223:204},on=S.ajaxSettings.xhr();y.cors=!!on&&"withCredentials"in on,y.ajax=on=!!on,S.ajaxTransport((function(t){var e,i;if(y.cors||on&&!t.crossDomain)return{send:function(r,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];for(a in t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest"),r)s.setRequestHeader(a,r[a]);e=function(t){return function(){e&&(e=i=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===t?s.abort():"error"===t?"number"!==typeof s.status?o(0,"error"):o(s.status,s.statusText):o(rn[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!==typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=e(),i=s.onerror=s.ontimeout=e("error"),void 0!==s.onabort?s.onabort=i:s.onreadystatechange=function(){4===s.readyState&&n.setTimeout((function(){e&&i()}))},e=e("abort");try{s.send(t.hasContent&&t.data||null)}catch(c){if(e)throw c}},abort:function(){e&&e()}}})),S.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return S.globalEval(t),t}}}),S.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),S.ajaxTransport("script",(function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(i,r){e=S("<script>").attr(t.scriptAttrs||{}).prop({charset:t.scriptCharset,src:t.url}).on("load error",n=function(t){e.remove(),n=null,t&&r("error"===t.type?404:200,t.type)}),s.head.appendChild(e[0])},abort:function(){n&&n()}}}));var an=[],sn=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=an.pop()||S.expando+"_"+Ne++;return this[t]=!0,t}}),S.ajaxPrefilter("json jsonp",(function(t,e,i){var r,o,a,s=!1!==t.jsonp&&(sn.test(t.url)?"url":"string"===typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&sn.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return r=t.jsonpCallback=b(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(sn,"$1"+r):!1!==t.jsonp&&(t.url+=(Ie.test(t.url)?"&":"?")+t.jsonp+"="+r),t.converters["script json"]=function(){return a||S.error(r+" was not called"),a[0]},t.dataTypes[0]="json",o=n[r],n[r]=function(){a=arguments},i.always((function(){void 0===o?S(n).removeProp(r):n[r]=o,t[r]&&(t.jsonpCallback=e.jsonpCallback,an.push(r)),a&&b(o)&&o(a[0]),a=o=void 0})),"script"})),y.createHTMLDocument=function(){var t=s.implementation.createHTMLDocument("").body;return t.innerHTML="<form></form><form></form>",2===t.childNodes.length}(),S.parseHTML=function(t,e,n){return"string"!==typeof t?[]:("boolean"===typeof e&&(n=e,e=!1),e||(y.createHTMLDocument?(e=s.implementation.createHTMLDocument(""),i=e.createElement("base"),i.href=s.location.href,e.head.appendChild(i)):e=s),r=D.exec(t),o=!n&&[],r?[e.createElement(r[1])]:(r=At([t],e,o),o&&o.length&&S(o).remove(),S.merge([],r.childNodes)));var i,r,o},S.fn.load=function(t,e,n){var i,r,o,a=this,s=t.indexOf(" ");return s>-1&&(i=Ae(t.slice(s)),t=t.slice(0,s)),b(e)?(n=e,e=void 0):e&&"object"===typeof e&&(r="POST"),a.length>0&&S.ajax({url:t,type:r||"GET",dataType:"html",data:e}).done((function(t){o=arguments,a.html(i?S("<div>").append(S.parseHTML(t)).find(i):t)})).always(n&&function(t,e){a.each((function(){n.apply(this,o||[t.responseText,e,t])}))}),this},S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(t,e){S.fn[e]=function(t){return this.on(e,t)}})),S.expr.pseudos.animated=function(t){return S.grep(S.timers,(function(e){return t===e.elem})).length},S.offset={setOffset:function(t,e,n){var i,r,o,a,s,c,l,u=S.css(t,"position"),h=S(t),p={};"static"===u&&(t.style.position="relative"),s=h.offset(),o=S.css(t,"top"),c=S.css(t,"left"),l=("absolute"===u||"fixed"===u)&&(o+c).indexOf("auto")>-1,l?(i=h.position(),a=i.top,r=i.left):(a=parseFloat(o)||0,r=parseFloat(c)||0),b(e)&&(e=e.call(t,n,S.extend({},s))),null!=e.top&&(p.top=e.top-s.top+a),null!=e.left&&(p.left=e.left-s.left+r),"using"in e?e.using.call(t,p):h.css(p)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each((function(e){S.offset.setOffset(this,t,e)}));var e,n,i=this[0];return i?i.getClientRects().length?(e=i.getBoundingClientRect(),n=i.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,n,i=this[0],r={top:0,left:0};if("fixed"===S.css(i,"position"))e=i.getBoundingClientRect();else{e=this.offset(),n=i.ownerDocument,t=i.offsetParent||n.documentElement;while(t&&(t===n.body||t===n.documentElement)&&"static"===S.css(t,"position"))t=t.parentNode;t&&t!==i&&1===t.nodeType&&(r=S(t).offset(),r.top+=S.css(t,"borderTopWidth",!0),r.left+=S.css(t,"borderLeftWidth",!0))}return{top:e.top-r.top-S.css(i,"marginTop",!0),left:e.left-r.left-S.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){var t=this.offsetParent;while(t&&"static"===S.css(t,"position"))t=t.offsetParent;return t||ht}))}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(t,e){var n="pageYOffset"===e;S.fn[t]=function(i){return J(this,(function(t,i,r){var o;if(x(t)?o=t:9===t.nodeType&&(o=t.defaultView),void 0===r)return o?o[e]:t[i];o?o.scrollTo(n?o.pageXOffset:r,n?r:o.pageYOffset):t[i]=r}),t,i,arguments.length)}})),S.each(["top","left"],(function(t,e){S.cssHooks[e]=Qt(y.pixelPosition,(function(t,n){if(n)return n=$t(t,e),Yt.test(n)?S(t).position()[e]+"px":n}))})),S.each({Height:"height",Width:"width"},(function(t,e){S.each({padding:"inner"+t,content:e,"":"outer"+t},(function(n,i){S.fn[i]=function(r,o){var a=arguments.length&&(n||"boolean"!==typeof r),s=n||(!0===r||!0===o?"margin":"border");return J(this,(function(e,n,r){var o;return x(e)?0===i.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(o=e.documentElement,Math.max(e.body["scroll"+t],o["scroll"+t],e.body["offset"+t],o["offset"+t],o["client"+t])):void 0===r?S.css(e,n,s):S.style(e,n,r,s)}),e,a?r:void 0,a)}}))})),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(t,e){S.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}})),S.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),S.fn.extend({bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,n,i){return this.on(e,t,n,i)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)}}),S.proxy=function(t,e){var n,i,r;if("string"===typeof e&&(n=t[e],e=t,t=n),b(t))return i=l.call(arguments,2),r=function(){return t.apply(e||this,i.concat(l.call(arguments)))},r.guid=t.guid=t.guid||S.guid++,r},S.holdReady=function(t){t?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=O,S.isFunction=b,S.isWindow=x,S.camelCase=K,S.type=M,S.now=Date.now,S.isNumeric=function(t){var e=S.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},i=[],r=function(){return S}.apply(e,i),void 0===r||(t.exports=r);var cn=n.jQuery,ln=n.$;return S.noConflict=function(t){return n.$===S&&(n.$=ln),t&&n.jQuery===S&&(n.jQuery=cn),S},o||(n.jQuery=n.$=S),S}))},"159b":function(t,e,n){var i=n("da84"),r=n("fdbc"),o=n("17c2"),a=n("9112");for(var s in r){var c=i[s],l=c&&c.prototype;if(l&&l.forEach!==o)try{a(l,"forEach",o)}catch(u){l.forEach=o}}},"17c2":function(t,e,n){"use strict";var i=n("b727").forEach,r=n("b301");t.exports=r("forEach")?function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}:[].forEach},1823:function(t,e){t.exports="precision highp float;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\n\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\nattribute vec2 uv;\nattribute vec3 position_1;\nattribute vec3 position_2;\nattribute vec2 uv_1;\nattribute vec2 uv_2;\n\nuniform float time;\nuniform float slide_pos;\nvarying vec2 vUv;\n\nvoid main() {\n\tvUv = uv;\n\t\n\tvec3 transformed_xi1 = position * vec3(1.0 - time) + position_1 * vec3(time);\n\t\n\tvec3 xi0_time_1 = vec3(position_1.x, position_1.y, 0.0);\n\tvec3 transformed_xi0 = position_2 * vec3(1.0 - time) + xi0_time_1 * vec3(time);\n\n\tvec3 transformed = vec3(transformed_xi0) * vec3(1.0 - slide_pos) + vec3(transformed_xi1) * vec3(slide_pos);\n\t\n\tvec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\n}\n"},"182f":function(t,e,n){var i,r,o;(function(a){r=[n("1157"),n("4309")],i=a,o="function"===typeof i?i.apply(e,r):i,void 0===o||(t.exports=o)})((function(t){return t.ui.escapeSelector=function(){var t=/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;return function(e){return e.replace(t,"\\$1")}}()}))},1859:function(t,e,n){},"1c0b":function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},"1cb4":function(t,e,n){n("3084"),n("0ae9"),n("f088"),n("721b"),n("9025"),n("8869"),n("3ff8"),n("0773")},"1d80":function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},"1ef9":function(t,e,n){"use strict";(function(t){function i(t){return!(!t||"function"!==typeof t.then)}function r(t){return t||(t=0),new Promise((function(e){return setTimeout(e,t)}))}function o(t,e){return Math.floor(Math.random()*(e-t+1)+t)}function a(t){t||(t=5);for(var e="",n="abcdefghijklmnopqrstuvwxzy0123456789",i=0;i<t;i++)e+=n.charAt(Math.floor(Math.random()*n.length));return e}n.d(e,"b",(function(){return i})),n.d(e,"f",(function(){return r})),n.d(e,"d",(function(){return o})),n.d(e,"e",(function(){return a})),n.d(e,"c",(function(){return l})),n.d(e,"a",(function(){return u}));var s=0,c=0;function l(){var t=(new Date).getTime();return t===s?(c++,1e3*t+c):(s=t,c=0,1e3*t)}var u="[object process]"===Object.prototype.toString.call("undefined"!==typeof t?t:0)}).call(this,n("4362"))},"21a3":function(t,e,n){},"236e":function(t,e,n){"use strict";n.r(e);var i=n("1ef9"),r=i["c"],o="native";function a(t){var e={messagesCallback:null,bc:new BroadcastChannel(t),subFns:[]};return e.bc.onmessage=function(t){e.messagesCallback&&e.messagesCallback(t.data)},e}function s(t){t.bc.close(),t.subFns=[]}function c(t,e){t.bc.postMessage(e,!1)}function l(t,e){t.messagesCallback=e}function u(){if(i["a"]&&"undefined"===typeof window)return!1;if("function"===typeof BroadcastChannel){if(BroadcastChannel._pubkey)throw new Error("BroadcastChannel: Do not overwrite window.BroadcastChannel with this module, this is not a polyfill");return!0}return!1}function h(){return 150}var p={create:a,close:s,onMessage:l,postMessage:c,canBeUsed:u,type:o,averageResponseTime:h,microSeconds:r},d=function(t){var e=new Set,n=new Map;function i(){var i=f()-t,r=e[Symbol.iterator]();while(1){var o=r.next().value;if(!o)return;var a=n.get(o);if(!(a<i))return;n["delete"](o),e["delete"](o)}}this.has=e.has.bind(e),this.add=function(t){n.set(t,f()),e.add(t),i()},this.clear=function(){e.clear(),n.clear()}};function f(){return(new Date).getTime()}var m=d;function g(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=JSON.parse(JSON.stringify(t));return"undefined"===typeof e.webWorkerSupport&&(e.webWorkerSupport=!0),e.idb||(e.idb={}),e.idb.ttl||(e.idb.ttl=45e3),e.idb.fallbackInterval||(e.idb.fallbackInterval=150),e.localstorage||(e.localstorage={}),e.localstorage.removeTimeout||(e.localstorage.removeTimeout=6e4),t.methods&&(e.methods=t.methods),e.node||(e.node={}),e.node.ttl||(e.node.ttl=12e4),"undefined"===typeof e.node.useFastPath&&(e.node.useFastPath=!0),e}var v=i["c"],y="pubkey.broadcast-channel-0-",b="messages",x="idb";function w(){return"undefined"!==typeof indexedDB?indexedDB:"undefined"!==typeof window.mozIndexedDB?window.mozIndexedDB:"undefined"!==typeof window.webkitIndexedDB?window.webkitIndexedDB:"undefined"!==typeof window.msIndexedDB&&window.msIndexedDB}function _(t){var e=w(),n=y+t,i=e.open(n,1);i.onupgradeneeded=function(t){var e=t.target.result;e.createObjectStore(b,{keyPath:"id",autoIncrement:!0})};var r=new Promise((function(t,e){i.onerror=function(t){return e(t)},i.onsuccess=function(){t(i.result)}}));return r}function M(t,e,n){var i=(new Date).getTime(),r={uuid:e,time:i,data:n},o=t.transaction([b],"readwrite");return new Promise((function(t,e){o.oncomplete=function(){return t()},o.onerror=function(t){return e(t)};var n=o.objectStore(b);n.add(r)}))}function T(t,e){var n=t.transaction(b).objectStore(b),i=[],r=IDBKeyRange.bound(e+1,1/0);return new Promise((function(t){n.openCursor(r).onsuccess=function(e){var n=e.target.result;n?(i.push(n.value),n["continue"]()):t(i)}}))}function S(t,e){var n=t.transaction([b],"readwrite").objectStore(b)["delete"](e);return new Promise((function(t){n.onsuccess=function(){return t()}}))}function E(t,e){var n=(new Date).getTime()-e,i=t.transaction(b).objectStore(b),r=[];return new Promise((function(t){i.openCursor().onsuccess=function(e){var i=e.target.result;if(i){var o=i.value;if(!(o.time<n))return void t(r);r.push(o),i["continue"]()}else t(r)}}))}function A(t,e){return E(t,e).then((function(e){return Promise.all(e.map((function(e){return S(t,e.id)})))}))}function C(t,e){return e=g(e),_(t).then((function(n){var r={closed:!1,lastCursorId:0,channelName:t,options:e,uuid:Object(i["e"])(10),eMIs:new m(2*e.idb.ttl),writeBlockPromise:Promise.resolve(),messagesCallback:null,readQueuePromises:[],db:n};return L(r),r}))}function L(t){if(!t.closed)return R(t).then((function(){return Object(i["f"])(t.options.idb.fallbackInterval)})).then((function(){return L(t)}))}function P(t,e){return t.uuid!==e.uuid&&(!e.eMIs.has(t.id)&&!(t.data.time<e.messagesCallbackTime))}function R(t){return t.closed?Promise.resolve():t.messagesCallback?T(t.db,t.lastCursorId).then((function(e){var n=e.filter((function(t){return!!t})).map((function(e){return e.id>t.lastCursorId&&(t.lastCursorId=e.id),e})).filter((function(e){return P(e,t)})).sort((function(t,e){return t.time-e.time}));return n.forEach((function(e){t.messagesCallback&&(t.eMIs.add(e.id),t.messagesCallback(e.data))})),Promise.resolve()})):Promise.resolve()}function O(t){t.closed=!0,t.db.close()}function D(t,e){return t.writeBlockPromise=t.writeBlockPromise.then((function(){return M(t.db,t.uuid,e)})).then((function(){0===Object(i["d"])(0,10)&&A(t.db,t.options.idb.ttl)})),t.writeBlockPromise}function N(t,e,n){t.messagesCallbackTime=n,t.messagesCallback=e,R(t)}function I(){if(i["a"])return!1;var t=w();return!!t}function z(t){return 2*t.idb.fallbackInterval}var B={create:C,close:O,onMessage:N,postMessage:D,canBeUsed:I,type:x,averageResponseTime:z,microSeconds:v},k=i["c"],H="pubkey.broadcastChannel-",U="localstorage";function G(){var t;if("undefined"===typeof window)return null;try{t=window.localStorage,t=window["ie8-eventlistener/storage"]||window.localStorage}catch(e){}return t}function F(t){return H+t}function j(t,e){return new Promise((function(n){Object(i["f"])().then((function(){var r=F(t.channelName),o={token:Object(i["e"])(10),time:(new Date).getTime(),data:e,uuid:t.uuid},a=JSON.stringify(o);G().setItem(r,a);var s=document.createEvent("Event");s.initEvent("storage",!0,!0),s.key=r,s.newValue=a,window.dispatchEvent(s),n()}))}))}function V(t,e){var n=F(t),i=function(t){t.key===n&&e(JSON.parse(t.newValue))};return window.addEventListener("storage",i),i}function W(t){window.removeEventListener("storage",t)}function q(t,e){if(e=g(e),!J())throw new Error("BroadcastChannel: localstorage cannot be used");var n=Object(i["e"])(10),r=new m(e.localstorage.removeTimeout),o={channelName:t,uuid:n,eMIs:r};return o.listener=V(t,(function(t){o.messagesCallback&&t.uuid!==n&&t.token&&!r.has(t.token)&&(t.data.time&&t.data.time<o.messagesCallbackTime||(r.add(t.token),o.messagesCallback(t.data)))})),o}function X(t){W(t.listener)}function Y(t,e,n){t.messagesCallbackTime=n,t.messagesCallback=e}function J(){if(i["a"])return!1;var t=G();if(!t)return!1;try{var e="__broadcastchannel_check";t.setItem(e,"works"),t.removeItem(e)}catch(n){return!1}return!0}function Z(){return 120}var $={create:q,close:X,onMessage:Y,postMessage:j,canBeUsed:J,type:U,averageResponseTime:Z,microSeconds:k},Q=i["c"],K="simulate",tt=new Set;function et(t){var e={name:t,messagesCallback:null};return tt.add(e),e}function nt(t){tt["delete"](t)}function it(t,e){return new Promise((function(n){return setTimeout((function(){var i=Array.from(tt);i.filter((function(e){return e.name===t.name})).filter((function(e){return e!==t})).filter((function(t){return!!t.messagesCallback})).forEach((function(t){return t.messagesCallback(e)})),n()}),5)}))}function rt(t,e){t.messagesCallback=e}function ot(){return!0}function at(){return 5}var st={create:et,close:nt,onMessage:rt,postMessage:it,canBeUsed:ot,type:K,averageResponseTime:at,microSeconds:Q},ct=[p,B,$];if(i["a"]){var lt=n(0);"function"===typeof lt.canBeUsed&&ct.push(lt)}function ut(t){var e=[].concat(t.methods,ct).filter(Boolean);if(t.type){if("simulate"===t.type)return st;var n=e.find((function(e){return e.type===t.type}));if(n)return n;throw new Error("method-type "+t.type+" not found")}t.webWorkerSupport||i["a"]||(e=e.filter((function(t){return"idb"!==t.type})));var r=e.find((function(t){return t.canBeUsed()}));if(r)return r;throw new Error("No useable methode found:"+JSON.stringify(ct.map((function(t){return t.type}))))}var ht,pt=function(t,e){this.name=t,ht&&(e=ht),this.options=g(e),this.method=ut(this.options),this._iL=!1,this._onML=null,this._addEL={message:[],internal:[]},this._befC=[],this._prepP=null,ft(this)};function dt(t,e,n){var i=t.method.microSeconds(),r={time:i,type:e,data:n},o=t._prepP?t._prepP:Promise.resolve();return o.then((function(){return t.method.postMessage(t._state,r)}))}function ft(t){var e=t.method.create(t.name,t.options);Object(i["b"])(e)?(t._prepP=e,e.then((function(e){t._state=e}))):t._state=e}function mt(t){return t._addEL.message.length>0||t._addEL.internal.length>0}function gt(t,e,n){t._addEL[e].push(n),yt(t)}function vt(t,e,n){t._addEL[e]=t._addEL[e].filter((function(t){return t!==n})),bt(t)}function yt(t){if(!t._iL&&mt(t)){var e=function(e){t._addEL[e.type].forEach((function(t){e.time>=t.time&&t.fn(e.data)}))},n=t.method.microSeconds();t._prepP?t._prepP.then((function(){t._iL=!0,t.method.onMessage(t._state,e,n)})):(t._iL=!0,t.method.onMessage(t._state,e,n))}}function bt(t){if(t._iL&&!mt(t)){t._iL=!1;var e=t.method.microSeconds();t.method.onMessage(t._state,null,e)}}pt._pubkey=!0,pt.clearNodeFolder=function(t){t=g(t);var e=ut(t);return"node"===e.type?e.clearNodeFolder().then((function(){return!0})):Promise.resolve(!1)},pt.enforceOptions=function(t){ht=t},pt.prototype={postMessage:function(t){if(this.closed)throw new Error("BroadcastChannel.postMessage(): Cannot post message after channel has closed");return dt(this,"message",t)},postInternal:function(t){return dt(this,"internal",t)},set onmessage(t){var e=this.method.microSeconds(),n={time:e,fn:t};vt(this,"message",this._onML),t&&"function"===typeof t?(this._onML=n,gt(this,"message",n)):this._onML=null},addEventListener:function(t,e){var n=this.method.microSeconds(),i={time:n,fn:e};gt(this,t,i)},removeEventListener:function(t,e){var n=this._addEL[t].find((function(t){return t.fn===e}));vt(this,t,n)},close:function(){var t=this;if(!this.closed){this.closed=!0;var e=this._prepP?this._prepP:Promise.resolve();return this._onML=null,this._addEL.message=[],e.then((function(){return Promise.all(t._befC.map((function(t){return t()})))})).then((function(){return t.method.close(t._state)}))}},get type(){return this.method.type}};e["default"]=pt},"23cb":function(t,e,n){var i=n("a691"),r=Math.max,o=Math.min;t.exports=function(t,e){var n=i(t);return n<0?r(n+e,0):o(n,e)}},"23e7":function(t,e,n){var i=n("da84"),r=n("06cf").f,o=n("9112"),a=n("6eeb"),s=n("ce4e"),c=n("e893"),l=n("94ca");t.exports=function(t,e){var n,u,h,p,d,f,m=t.target,g=t.global,v=t.stat;if(u=g?i:v?i[m]||s(m,{}):(i[m]||{}).prototype,u)for(h in e){if(d=e[h],t.noTargetGet?(f=r(u,h),p=f&&f.value):p=u[h],n=l(g?h:m+(v?".":"#")+h,t.forced),!n&&void 0!==p){if(typeof d===typeof p)continue;c(d,p)}(t.sham||p&&p.sham)&&o(d,"sham",!0),a(u,h,d,t)}}},"241c":function(t,e,n){var i=n("ca84"),r=n("7839"),o=r.concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return i(t,o)}},2431:function(t,e,n){},"25c8":function(t,e,n){var i,r,o;
|
|
34
|
-
/*!
|
|
35
|
-
* jQuery UI Position 1.12.1
|
|
36
|
-
* http://jqueryui.com
|
|
37
|
-
*
|
|
38
|
-
* Copyright jQuery Foundation and other contributors
|
|
39
|
-
* Released under the MIT license.
|
|
40
|
-
* http://jquery.org/license
|
|
41
|
-
*
|
|
42
|
-
* http://api.jqueryui.com/position/
|
|
43
|
-
*/(function(a){r=[n("1157"),n("4309")],i=a,o="function"===typeof i?i.apply(e,r):i,void 0===o||(t.exports=o)})((function(t){return function(){var e,n=Math.max,i=Math.abs,r=/left|center|right/,o=/top|center|bottom/,a=/[\+\-]\d+(\.[\d]+)?%?/,s=/^\w+/,c=/%$/,l=t.fn.position;function u(t,e,n){return[parseFloat(t[0])*(c.test(t[0])?e/100:1),parseFloat(t[1])*(c.test(t[1])?n/100:1)]}function h(e,n){return parseInt(t.css(e,n),10)||0}function p(e){var n=e[0];return 9===n.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(n)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:n.preventDefault?{width:0,height:0,offset:{top:n.pageY,left:n.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}t.position={scrollbarWidth:function(){if(void 0!==e)return e;var n,i,r=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=r.children()[0];return t("body").append(r),n=o.offsetWidth,r.css("overflow","scroll"),i=o.offsetWidth,n===i&&(i=r[0].clientWidth),r.remove(),e=n-i},getScrollInfo:function(e){var n=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),i=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),r="scroll"===n||"auto"===n&&e.width<e.element[0].scrollWidth,o="scroll"===i||"auto"===i&&e.height<e.element[0].scrollHeight;return{width:o?t.position.scrollbarWidth():0,height:r?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var n=t(e||window),i=t.isWindow(n[0]),r=!!n[0]&&9===n[0].nodeType,o=!i&&!r;return{element:n,isWindow:i,isDocument:r,offset:o?t(e).offset():{left:0,top:0},scrollLeft:n.scrollLeft(),scrollTop:n.scrollTop(),width:n.outerWidth(),height:n.outerHeight()}}},t.fn.position=function(e){if(!e||!e.of)return l.apply(this,arguments);e=t.extend({},e);var c,d,f,m,g,v,y=t(e.of),b=t.position.getWithinInfo(e.within),x=t.position.getScrollInfo(b),w=(e.collision||"flip").split(" "),_={};return v=p(y),y[0].preventDefault&&(e.at="left top"),d=v.width,f=v.height,m=v.offset,g=t.extend({},m),t.each(["my","at"],(function(){var t,n,i=(e[this]||"").split(" ");1===i.length&&(i=r.test(i[0])?i.concat(["center"]):o.test(i[0])?["center"].concat(i):["center","center"]),i[0]=r.test(i[0])?i[0]:"center",i[1]=o.test(i[1])?i[1]:"center",t=a.exec(i[0]),n=a.exec(i[1]),_[this]=[t?t[0]:0,n?n[0]:0],e[this]=[s.exec(i[0])[0],s.exec(i[1])[0]]})),1===w.length&&(w[1]=w[0]),"right"===e.at[0]?g.left+=d:"center"===e.at[0]&&(g.left+=d/2),"bottom"===e.at[1]?g.top+=f:"center"===e.at[1]&&(g.top+=f/2),c=u(_.at,d,f),g.left+=c[0],g.top+=c[1],this.each((function(){var r,o,a=t(this),s=a.outerWidth(),l=a.outerHeight(),p=h(this,"marginLeft"),v=h(this,"marginTop"),M=s+p+h(this,"marginRight")+x.width,T=l+v+h(this,"marginBottom")+x.height,S=t.extend({},g),E=u(_.my,a.outerWidth(),a.outerHeight());"right"===e.my[0]?S.left-=s:"center"===e.my[0]&&(S.left-=s/2),"bottom"===e.my[1]?S.top-=l:"center"===e.my[1]&&(S.top-=l/2),S.left+=E[0],S.top+=E[1],r={marginLeft:p,marginTop:v},t.each(["left","top"],(function(n,i){t.ui.position[w[n]]&&t.ui.position[w[n]][i](S,{targetWidth:d,targetHeight:f,elemWidth:s,elemHeight:l,collisionPosition:r,collisionWidth:M,collisionHeight:T,offset:[c[0]+E[0],c[1]+E[1]],my:e.my,at:e.at,within:b,elem:a})})),e.using&&(o=function(t){var r=m.left-S.left,o=r+d-s,c=m.top-S.top,u=c+f-l,h={target:{element:y,left:m.left,top:m.top,width:d,height:f},element:{element:a,left:S.left,top:S.top,width:s,height:l},horizontal:o<0?"left":r>0?"right":"center",vertical:u<0?"top":c>0?"bottom":"middle"};d<s&&i(r+o)<d&&(h.horizontal="center"),f<l&&i(c+u)<f&&(h.vertical="middle"),n(i(r),i(o))>n(i(c),i(u))?h.important="horizontal":h.important="vertical",e.using.call(this,t,h)}),a.offset(t.extend(S,{using:o}))}))},t.ui.position={fit:{left:function(t,e){var i,r=e.within,o=r.isWindow?r.scrollLeft:r.offset.left,a=r.width,s=t.left-e.collisionPosition.marginLeft,c=o-s,l=s+e.collisionWidth-a-o;e.collisionWidth>a?c>0&&l<=0?(i=t.left+c+e.collisionWidth-a-o,t.left+=c-i):t.left=l>0&&c<=0?o:c>l?o+a-e.collisionWidth:o:c>0?t.left+=c:l>0?t.left-=l:t.left=n(t.left-s,t.left)},top:function(t,e){var i,r=e.within,o=r.isWindow?r.scrollTop:r.offset.top,a=e.within.height,s=t.top-e.collisionPosition.marginTop,c=o-s,l=s+e.collisionHeight-a-o;e.collisionHeight>a?c>0&&l<=0?(i=t.top+c+e.collisionHeight-a-o,t.top+=c-i):t.top=l>0&&c<=0?o:c>l?o+a-e.collisionHeight:o:c>0?t.top+=c:l>0?t.top-=l:t.top=n(t.top-s,t.top)}},flip:{left:function(t,e){var n,r,o=e.within,a=o.offset.left+o.scrollLeft,s=o.width,c=o.isWindow?o.scrollLeft:o.offset.left,l=t.left-e.collisionPosition.marginLeft,u=l-c,h=l+e.collisionWidth-s-c,p="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,d="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];u<0?(n=t.left+p+d+f+e.collisionWidth-s-a,(n<0||n<i(u))&&(t.left+=p+d+f)):h>0&&(r=t.left-e.collisionPosition.marginLeft+p+d+f-c,(r>0||i(r)<h)&&(t.left+=p+d+f))},top:function(t,e){var n,r,o=e.within,a=o.offset.top+o.scrollTop,s=o.height,c=o.isWindow?o.scrollTop:o.offset.top,l=t.top-e.collisionPosition.marginTop,u=l-c,h=l+e.collisionHeight-s-c,p="top"===e.my[1],d=p?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,m=-2*e.offset[1];u<0?(r=t.top+d+f+m+e.collisionHeight-s-a,(r<0||r<i(u))&&(t.top+=d+f+m)):h>0&&(n=t.top-e.collisionPosition.marginTop+d+f+m-c,(n>0||i(n)<h)&&(t.top+=d+f+m))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}(),t.ui.position}))},3084:function(t,e,n){var i,r,o;
|
|
44
|
-
/*!
|
|
45
|
-
* jQuery UI Widget 1.12.1
|
|
46
|
-
* http://jqueryui.com
|
|
47
|
-
*
|
|
48
|
-
* Copyright jQuery Foundation and other contributors
|
|
49
|
-
* Released under the MIT license.
|
|
50
|
-
* http://jquery.org/license
|
|
51
|
-
*/(function(a){r=[n("1157"),n("4309")],i=a,o="function"===typeof i?i.apply(e,r):i,void 0===o||(t.exports=o)})((function(t){var e=0,n=Array.prototype.slice;return t.cleanData=function(e){return function(n){var i,r,o;for(o=0;null!=(r=n[o]);o++)try{i=t._data(r,"events"),i&&i.remove&&t(r).triggerHandler("remove")}catch(a){}e(n)}}(t.cleanData),t.widget=function(e,n,i){var r,o,a,s={},c=e.split(".")[0];e=e.split(".")[1];var l=c+"-"+e;return i||(i=n,n=t.Widget),t.isArray(i)&&(i=t.extend.apply(null,[{}].concat(i))),t.expr[":"][l.toLowerCase()]=function(e){return!!t.data(e,l)},t[c]=t[c]||{},r=t[c][e],o=t[c][e]=function(t,e){if(!this._createWidget)return new o(t,e);arguments.length&&this._createWidget(t,e)},t.extend(o,r,{version:i.version,_proto:t.extend({},i),_childConstructors:[]}),a=new n,a.options=t.widget.extend({},a.options),t.each(i,(function(e,i){t.isFunction(i)?s[e]=function(){function t(){return n.prototype[e].apply(this,arguments)}function r(t){return n.prototype[e].apply(this,t)}return function(){var e,n=this._super,o=this._superApply;return this._super=t,this._superApply=r,e=i.apply(this,arguments),this._super=n,this._superApply=o,e}}():s[e]=i})),o.prototype=t.widget.extend(a,{widgetEventPrefix:r&&a.widgetEventPrefix||e},s,{constructor:o,namespace:c,widgetName:e,widgetFullName:l}),r?(t.each(r._childConstructors,(function(e,n){var i=n.prototype;t.widget(i.namespace+"."+i.widgetName,o,n._proto)})),delete r._childConstructors):n._childConstructors.push(o),t.widget.bridge(e,o),o},t.widget.extend=function(e){for(var i,r,o=n.call(arguments,1),a=0,s=o.length;a<s;a++)for(i in o[a])r=o[a][i],o[a].hasOwnProperty(i)&&void 0!==r&&(t.isPlainObject(r)?e[i]=t.isPlainObject(e[i])?t.widget.extend({},e[i],r):t.widget.extend({},r):e[i]=r);return e},t.widget.bridge=function(e,i){var r=i.prototype.widgetFullName||e;t.fn[e]=function(o){var a="string"===typeof o,s=n.call(arguments,1),c=this;return a?this.length||"instance"!==o?this.each((function(){var n,i=t.data(this,r);return"instance"===o?(c=i,!1):i?t.isFunction(i[o])&&"_"!==o.charAt(0)?(n=i[o].apply(i,s),n!==i&&void 0!==n?(c=n&&n.jquery?c.pushStack(n.get()):n,!1):void 0):t.error("no such method '"+o+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; attempted to call method '"+o+"'")})):c=void 0:(s.length&&(o=t.widget.extend.apply(null,[o].concat(s))),this.each((function(){var e=t.data(this,r);e?(e.option(o||{}),e._init&&e._init()):t.data(this,r,new i(o,this))}))),c}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(n,i){i=t(i||this.defaultElement||this)[0],this.element=t(i),this.uuid=e++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},i!==this&&(t.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===i&&this.destroy()}}),this.document=t(i.style?i.ownerDocument:i.document||i),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),n),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,(function(t,n){e._removeClass(n,t)})),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,n){var i,r,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"===typeof e)if(a={},i=e.split("."),e=i.shift(),i.length){for(r=a[e]=t.widget.extend({},this.options[e]),o=0;o<i.length-1;o++)r[i[o]]=r[i[o]]||{},r=r[i[o]];if(e=i.pop(),1===arguments.length)return void 0===r[e]?null:r[e];r[e]=n}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=n}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var n,i,r;for(n in e)r=this.classesElementLookup[n],e[n]!==this.options.classes[n]&&r&&r.length&&(i=t(r.get()),this._removeClass(r,n),i.addClass(this._classes({element:i,keys:n,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){var n=[],i=this;function r(r,o){var a,s;for(s=0;s<r.length;s++)a=i.classesElementLookup[r[s]]||t(),a=e.add?t(t.unique(a.get().concat(e.element.get()))):t(a.not(e.element).get()),i.classesElementLookup[r[s]]=a,n.push(r[s]),o&&e.classes[r[s]]&&n.push(e.classes[r[s]])}return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&r(e.keys.match(/\S+/g)||[],!0),e.extra&&r(e.extra.match(/\S+/g)||[]),n.join(" ")},_untrackClassesElement:function(e){var n=this;t.each(n.classesElementLookup,(function(i,r){-1!==t.inArray(e.target,r)&&(n.classesElementLookup[i]=t(r.not(e.target).get()))}))},_removeClass:function(t,e,n){return this._toggleClass(t,e,n,!1)},_addClass:function(t,e,n){return this._toggleClass(t,e,n,!0)},_toggleClass:function(t,e,n,i){i="boolean"===typeof i?i:n;var r="string"===typeof t||null===t,o={extra:r?e:n,keys:r?t:e,element:r?this.element:t,add:i};return o.element.toggleClass(this._classes(o),i),this},_on:function(e,n,i){var r,o=this;"boolean"!==typeof e&&(i=n,n=e,e=!1),i?(n=r=t(n),this.bindings=this.bindings.add(n)):(i=n,n=this.element,r=this.widget()),t.each(i,(function(i,a){function s(){if(e||!0!==o.options.disabled&&!t(this).hasClass("ui-state-disabled"))return("string"===typeof a?o[a]:a).apply(o,arguments)}"string"!==typeof a&&(s.guid=a.guid=a.guid||s.guid||t.guid++);var c=i.match(/^([\w:-]*)\s*(.*)$/),l=c[1]+o.eventNamespace,u=c[2];u?r.on(l,u,s):n.on(l,s)}))},_off:function(e,n){n=(n||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(n).off(n),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function n(){return("string"===typeof t?i[t]:t).apply(i,arguments)}var i=this;return setTimeout(n,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,n,i){var r,o,a=this.options[e];if(i=i||{},n=t.Event(n),n.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),n.target=this.element[0],o=n.originalEvent,o)for(r in o)r in n||(n[r]=o[r]);return this.element.trigger(n,i),!(t.isFunction(a)&&!1===a.apply(this.element[0],[n].concat(i))||n.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},(function(e,n){t.Widget.prototype["_"+e]=function(i,r,o){var a;"string"===typeof r&&(r={effect:r});var s=r?!0===r||"number"===typeof r?n:r.effect||n:e;r=r||{},"number"===typeof r&&(r={duration:r}),a=!t.isEmptyObject(r),r.complete=o,r.delay&&i.delay(r.delay),a&&t.effects&&t.effects.effect[s]?i[e](r):s!==e&&i[s]?i[s](r.duration,r.easing,o):i.queue((function(n){t(this)[e](),o&&o.call(i[0]),n()}))}})),t.widget}))},"30c6":function(t,e,n){n("3084"),n("83ef"),n("8869"),n("3ff8"),n("1859")},3478:function(t,e,n){var i,r,o;(function(a){r=[n("1157"),n("4309")],i=a,o="function"===typeof i?i.apply(e,r):i,void 0===o||(t.exports=o)})((function(t){return t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase())}))},"354d":function(t,e,n){},"36fa":function(t,e,n){var i,r,o;
|
|
52
|
-
/*!
|
|
53
|
-
* jQuery UI Sortable 1.12.1
|
|
54
|
-
* http://jqueryui.com
|
|
55
|
-
*
|
|
56
|
-
* Copyright jQuery Foundation and other contributors
|
|
57
|
-
* Released under the MIT license.
|
|
58
|
-
* http://jquery.org/license
|
|
59
|
-
*/(function(a){r=[n("1157"),n("8869"),n("0ae9"),n("3478"),n("f088"),n("4309"),n("3084")],i=a,o="function"===typeof i?i.apply(e,r):i,void 0===o||(t.exports=o)})((function(t){return t.widget("ui.sortable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,n){return t>=e&&t<e+n},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(t,e){this._super(t,e),"handle"===t&&this._setHandleClassName()},_setHandleClassName:function(){var e=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),t.each(this.items,(function(){e._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")}))},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(e,n){var i=null,r=!1,o=this;return!this.reverting&&(!this.options.disabled&&"static"!==this.options.type&&(this._refreshItems(e),t(e.target).parents().each((function(){if(t.data(this,o.widgetName+"-item")===o)return i=t(this),!1})),t.data(e.target,o.widgetName+"-item")===o&&(i=t(e.target)),!!i&&(!(this.options.handle&&!n&&(t(this.options.handle,i).find("*").addBack().each((function(){this===e.target&&(r=!0)})),!r))&&(this.currentItem=i,this._removeCurrentsFromItems(),!0))))},_mouseStart:function(e,n,i){var r,o,a=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&"auto"!==a.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",a.cursor),this.storedStylesheet=t("<style>*{ cursor: "+a.cursor+" !important; }</style>").appendTo(o)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!i)for(r=this.containers.length-1;r>=0;r--)this.containers[r]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var n,i,r,o,a=this.options,s=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<a.scrollSensitivity?this.scrollParent[0].scrollTop=s=this.scrollParent[0].scrollTop+a.scrollSpeed:e.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=s=this.scrollParent[0].scrollTop-a.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=s=this.scrollParent[0].scrollLeft+a.scrollSpeed:e.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=s=this.scrollParent[0].scrollLeft-a.scrollSpeed)):(e.pageY-this.document.scrollTop()<a.scrollSensitivity?s=this.document.scrollTop(this.document.scrollTop()-a.scrollSpeed):this.window.height()-(e.pageY-this.document.scrollTop())<a.scrollSensitivity&&(s=this.document.scrollTop(this.document.scrollTop()+a.scrollSpeed)),e.pageX-this.document.scrollLeft()<a.scrollSensitivity?s=this.document.scrollLeft(this.document.scrollLeft()-a.scrollSpeed):this.window.width()-(e.pageX-this.document.scrollLeft())<a.scrollSensitivity&&(s=this.document.scrollLeft(this.document.scrollLeft()+a.scrollSpeed))),!1!==s&&t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),n=this.items.length-1;n>=0;n--)if(i=this.items[n],r=i.item[0],o=this._intersectsWithPointer(i),o&&i.instance===this.currentContainer&&r!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==r&&!t.contains(this.placeholder[0],r)&&("semi-dynamic"!==this.options.type||!t.contains(this.element[0],r))){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(i))break;this._rearrange(e,i),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,n){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var i=this,r=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=r.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(a.top=r.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(a,parseInt(this.options.revert,10)||500,(function(){i._clear(e)}))}else this._clear(e,n);return!1}},cancel:function(){if(this.dragging){this._mouseUp(new t.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var n=this._getItemsAsjQuery(e&&e.connected),i=[];return e=e||{},t(n).each((function(){var n=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);n&&i.push((e.key||n[1]+"[]")+"="+(e.key&&e.expression?n[1]:n[2]))})),!i.length&&e.key&&i.push(e.key+"="),i.join("&")},toArray:function(e){var n=this._getItemsAsjQuery(e&&e.connected),i=[];return e=e||{},n.each((function(){i.push(t(e.item||this).attr(e.attribute||"id")||"")})),i},_intersectsWith:function(t){var e=this.positionAbs.left,n=e+this.helperProportions.width,i=this.positionAbs.top,r=i+this.helperProportions.height,o=t.left,a=o+t.width,s=t.top,c=s+t.height,l=this.offset.click.top,u=this.offset.click.left,h="x"===this.options.axis||i+l>s&&i+l<c,p="y"===this.options.axis||e+u>o&&e+u<a,d=h&&p;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?d:o<e+this.helperProportions.width/2&&n-this.helperProportions.width/2<a&&s<i+this.helperProportions.height/2&&r-this.helperProportions.height/2<c},_intersectsWithPointer:function(t){var e,n,i="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),r="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width),o=i&&r;return!!o&&(e=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection(),this.floating?"right"===n||"down"===e?2:1:e&&("down"===e?2:1))},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),n=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),i=this._getDragVerticalDirection(),r=this._getDragHorizontalDirection();return this.floating&&r?"right"===r&&n||"left"===r&&!n:i&&("down"===i&&e||"up"===i&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){var n,i,r,o,a=[],s=[],c=this._connectWith();if(c&&e)for(n=c.length-1;n>=0;n--)for(r=t(c[n],this.document[0]),i=r.length-1;i>=0;i--)o=t.data(r[i],this.widgetFullName),o&&o!==this&&!o.options.disabled&&s.push([t.isFunction(o.options.items)?o.options.items.call(o.element):t(o.options.items,o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),o]);function l(){a.push(this)}for(s.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),n=s.length-1;n>=0;n--)s[n][0].each(l);return t(a)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,(function(t){for(var n=0;n<e.length;n++)if(e[n]===t.item[0])return!1;return!0}))},_refreshItems:function(e){this.items=[],this.containers=[this];var n,i,r,o,a,s,c,l,u=this.items,h=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],p=this._connectWith();if(p&&this.ready)for(n=p.length-1;n>=0;n--)for(r=t(p[n],this.document[0]),i=r.length-1;i>=0;i--)o=t.data(r[i],this.widgetFullName),o&&o!==this&&!o.options.disabled&&(h.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]),this.containers.push(o));for(n=h.length-1;n>=0;n--)for(a=h[n][1],s=h[n][0],i=0,l=s.length;i<l;i++)c=t(s[i]),c.data(this.widgetName+"-item",a),u.push({item:c,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(e){var n,i,r,o;for(this.floating=!!this.items.length&&("x"===this.options.axis||this._isFloating(this.items[0].item)),this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset()),n=this.items.length-1;n>=0;n--)i=this.items[n],i.instance!==this.currentContainer&&this.currentContainer&&i.item[0]!==this.currentItem[0]||(r=this.options.toleranceElement?t(this.options.toleranceElement,i.item):i.item,e||(i.width=r.outerWidth(),i.height=r.outerHeight()),o=r.offset(),i.left=o.left,i.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(n=this.containers.length-1;n>=0;n--)o=this.containers[n].element.offset(),this.containers[n].containerCache.left=o.left,this.containers[n].containerCache.top=o.top,this.containers[n].containerCache.width=this.containers[n].element.outerWidth(),this.containers[n].containerCache.height=this.containers[n].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var n,i=e.options;i.placeholder&&i.placeholder.constructor!==String||(n=i.placeholder,i.placeholder={element:function(){var i=e.currentItem[0].nodeName.toLowerCase(),r=t("<"+i+">",e.document[0]);return e._addClass(r,"ui-sortable-placeholder",n||e.currentItem[0].className)._removeClass(r,"ui-sortable-helper"),"tbody"===i?e._createTrPlaceholder(e.currentItem.find("tr").eq(0),t("<tr>",e.document[0]).appendTo(r)):"tr"===i?e._createTrPlaceholder(e.currentItem,r):"img"===i&&r.attr("src",e.currentItem.attr("src")),n||r.css("visibility","hidden"),r},update:function(t,r){n&&!i.forcePlaceholderSize||(r.height()||r.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),r.width()||r.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(i.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),i.placeholder.update(e,e.placeholder)},_createTrPlaceholder:function(e,n){var i=this;e.children().each((function(){t("<td> </td>",i.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(n)}))},_contactContainers:function(e){var n,i,r,o,a,s,c,l,u,h,p=null,d=null;for(n=this.containers.length-1;n>=0;n--)if(!t.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(p&&t.contains(this.containers[n].element[0],p.element[0]))continue;p=this.containers[n],d=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",e,this._uiHash(this)),this.containers[n].containerCache.over=0);if(p)if(1===this.containers.length)this.containers[d].containerCache.over||(this.containers[d]._trigger("over",e,this._uiHash(this)),this.containers[d].containerCache.over=1);else{for(r=1e4,o=null,u=p.floating||this._isFloating(this.currentItem),a=u?"left":"top",s=u?"width":"height",h=u?"pageX":"pageY",i=this.items.length-1;i>=0;i--)t.contains(this.containers[d].element[0],this.items[i].item[0])&&this.items[i].item[0]!==this.currentItem[0]&&(c=this.items[i].item.offset()[a],l=!1,e[h]-c>this.items[i][s]/2&&(l=!0),Math.abs(e[h]-c)<r&&(r=Math.abs(e[h]-c),o=this.items[i],this.direction=l?"up":"down"));if(!o&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[d])return void(this.currentContainer.containerCache.over||(this.containers[d]._trigger("over",e,this._uiHash()),this.currentContainer.containerCache.over=1));o?this._rearrange(e,o,null,!0):this._rearrange(e,null,this.containers[d].element,!0),this._trigger("change",e,this._uiHash()),this.containers[d]._trigger("change",e,this._uiHash(this)),this.currentContainer=this.containers[d],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[d]._trigger("over",e,this._uiHash(this)),this.containers[d].containerCache.over=1}},_createHelper:function(e){var n=this.options,i=t.isFunction(n.helper)?t(n.helper.apply(this.element[0],[e,this.currentItem])):"clone"===n.helper?this.currentItem.clone():this.currentItem;return i.parents("body").length||t("parent"!==n.appendTo?n.appendTo:this.currentItem[0].parentNode)[0].appendChild(i[0]),i[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),i[0].style.width&&!n.forceHelperSize||i.width(this.currentItem.width()),i[0].style.height&&!n.forceHelperSize||i.height(this.currentItem.height()),i},_adjustOffsetFromHelper:function(e){"string"===typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,n,i,r=this.options;"parent"===r.containment&&(r.containment=this.helper[0].parentNode),"document"!==r.containment&&"window"!==r.containment||(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===r.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===r.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(r.containment)||(e=t(r.containment)[0],n=t(r.containment).offset(),i="hidden"!==t(e).css("overflow"),this.containment=[n.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,n.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,n.left+(i?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,n.top+(i?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,n){n||(n=this.position);var i="absolute"===e?1:-1,r="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(r[0].tagName);return{top:n.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:r.scrollTop())*i,left:n.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:r.scrollLeft())*i}},_generatePosition:function(e){var n,i,r=this.options,o=e.pageX,a=e.pageY,s="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,c=/(html|body)/i.test(s[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(o=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(a=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),r.grid&&(n=this.originalPageY+Math.round((a-this.originalPageY)/r.grid[1])*r.grid[1],a=this.containment?n-this.offset.click.top>=this.containment[1]&&n-this.offset.click.top<=this.containment[3]?n:n-this.offset.click.top>=this.containment[1]?n-r.grid[1]:n+r.grid[1]:n,i=this.originalPageX+Math.round((o-this.originalPageX)/r.grid[0])*r.grid[0],o=this.containment?i-this.offset.click.left>=this.containment[0]&&i-this.offset.click.left<=this.containment[2]?i:i-this.offset.click.left>=this.containment[0]?i-r.grid[0]:i+r.grid[0]:i)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():c?0:s.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():c?0:s.scrollLeft())}},_rearrange:function(t,e,n,i){n?n[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var r=this.counter;this._delay((function(){r===this.counter&&this.refreshPositions(!i)}))},_clear:function(t,e){this.reverting=!1;var n,i=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(n in this._storedCSS)"auto"!==this._storedCSS[n]&&"static"!==this._storedCSS[n]||(this._storedCSS[n]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();function r(t,e,n){return function(i){n._trigger(t,i,e._uiHash(e))}}for(this.fromOutside&&!e&&i.push((function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))})),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||i.push((function(t){this._trigger("update",t,this._uiHash())})),this!==this.currentContainer&&(e||(i.push((function(t){this._trigger("remove",t,this._uiHash())})),i.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),i.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),n=this.containers.length-1;n>=0;n--)e||i.push(r("deactivate",this,this.containers[n])),this.containers[n].containerCache.over&&(i.push(r("out",this,this.containers[n])),this.containers[n].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(n=0;n<i.length;n++)i[n].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){!1===t.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(e){var n=e||this;return{helper:n.helper,placeholder:n.placeholder||t([]),position:n.position,originalPosition:n.originalPosition,offset:n.positionAbs,item:n.currentItem,sender:e?e.element:null}}})}))},"37a7":function(t,e,n){var i,r,o;
|
|
60
|
-
/*!
|
|
61
|
-
* jQuery UI Form Reset Mixin 1.12.1
|
|
62
|
-
* http://jqueryui.com
|
|
63
|
-
*
|
|
64
|
-
* Copyright jQuery Foundation and other contributors
|
|
65
|
-
* Released under the MIT license.
|
|
66
|
-
* http://jquery.org/license
|
|
67
|
-
*/(function(a){r=[n("1157"),n("d76d"),n("4309")],i=a,o="function"===typeof i?i.apply(e,r):i,void 0===o||(t.exports=o)})((function(t){return t.ui.formResetMixin={_formResetHandler:function(){var e=t(this);setTimeout((function(){var n=e.data("ui-form-reset-instances");t.each(n,(function(){this.refresh()}))}))},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var t=this.form.data("ui-form-reset-instances")||[];t.length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t)}},_unbindFormResetHandler:function(){if(this.form.length){var e=this.form.data("ui-form-reset-instances");e.splice(t.inArray(this,e),1),e.length?this.form.data("ui-form-reset-instances",e):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}}}))},3966:function(t,e,n){var i={ALL:0,DESTROYED:1,NAME_CHANGED:2,SETTINGS_CHANGED:3},r=function(){this.typeName="Base Module",this.instanceName="default",this.onChangedCallbacks=[],this.messageFunction=void 0,this.eventNotifiers=[],this.broadcastChannels={}};r.prototype.setName=function(t){if(t&&this.instanceName!==t){this.instanceName=t;for(var e=this.onChangedCallbacks.slice(),n=0;n<e.length;n++)e[n](this,i.NAME_CHANGED)}},r.prototype.addBroadcastChannels=function(t){if(t in this.broadcastChannels)return!1;var e=new(n("236e").default)(t);return this.broadcastChannels[t]=e,!0},r.prototype.removeBroadcastChannels=function(t){t in this.broadcastChannels&&(this.broadcastChannels[t].close(),delete broadcastChannels[t])},r.prototype.settingsChanged=function(){for(var t=this.onChangedCallbacks.slice(),e=0;e<t.length;e++)t[e](this,i.SETTINGS_CHANGED)},r.prototype.exportSettings=function(){var t={};return t.dialog=this.typeName,t.name=this.instanceName,t},r.prototype.importSettings=function(t){return t.dialog==this.typeName&&(this.setName(t.name),!0)},r.prototype.publishChanges=function(t,e){for(var i=0;i<this.eventNotifiers.length;i++)this.eventNotifiers[i].publish(this,e,t);if(e===n("549c").EVENT_TYPE.SELECTED&&t&&t[0]){var r=t[0],o={action:"query-data",resource:r.data.id,data:r.data,sender:this.instanceName};for(var a in this.broadcastChannels)this.broadcastChannels[a].postMessage(o)}},r.prototype.setMessageFunction=function(t){this.messageFunction=t},r.prototype.displayMessage=function(t){this.messageFunction&&this.messageFunction(t)},r.prototype.getName=function(){return this.instanceName},r.prototype.destroy=function(){for(var t=this.onChangedCallbacks.slice(),e=0;e<t.length;e++)t[e](this,i.DESTROYED)},r.prototype.addChangedCallback=function(t){0==this.onChangedCallbacks.includes(t)&&this.onChangedCallbacks.push(t)},r.prototype.removeChangedCallback=function(t){var e=this.onChangedCallbacks.indexOf(t);e>-1&&this.onChangedCallbacks.splice(e,1)},r.prototype.addNotifier=function(t){this.eventNotifiers.push(t)},e.BaseModule=r,e.MODULE_CHANGE=i},"3ff8":function(t,e,n){},4160:function(t,e,n){"use strict";var i=n("23e7"),r=n("17c2");i({target:"Array",proto:!0,forced:[].forEach!=r},{forEach:r})},"428f":function(t,e,n){t.exports=n("da84")},4309:function(t,e,n){var i,r,o;(function(a){r=[n("1157")],i=a,o="function"===typeof i?i.apply(e,r):i,void 0===o||(t.exports=o)})((function(t){return t.ui=t.ui||{},t.ui.version="1.12.1"}))},4362:function(t,e,n){e.nextTick=function(t){var e=Array.prototype.slice.call(arguments);e.shift(),setTimeout((function(){t.apply(null,e)}),0)},e.platform=e.arch=e.execPath=e.title="browser",e.pid=1,e.browser=!0,e.env={},e.argv=[],e.binding=function(t){throw new Error("No such module. (Possibly not yet loaded)")},function(){var t,i="/";e.cwd=function(){return i},e.chdir=function(e){t||(t=n("df7c")),i=t.resolve(e,i)}}(),e.exit=e.kill=e.umask=e.dlopen=e.uptime=e.memoryUsage=e.uvCounters=function(){},e.features={}},"449c":function(t,e,n){var i,r,o;
|
|
68
|
-
/*!
|
|
69
|
-
* jQuery UI Tabbable 1.12.1
|
|
70
|
-
* http://jqueryui.com
|
|
71
|
-
*
|
|
72
|
-
* Copyright jQuery Foundation and other contributors
|
|
73
|
-
* Released under the MIT license.
|
|
74
|
-
* http://jquery.org/license
|
|
75
|
-
*/(function(a){r=[n("1157"),n("4309"),n("c9bc")],i=a,o="function"===typeof i?i.apply(e,r):i,void 0===o||(t.exports=o)})((function(t){return t.extend(t.expr[":"],{tabbable:function(e){var n=t.attr(e,"tabindex"),i=null!=n;return(!i||n>=0)&&t.ui.focusable(e,i)}})}))},"44ad":function(t,e,n){var i=n("d039"),r=n("c6b6"),o="".split;t.exports=i((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==r(t)?o.call(t,""):Object(t)}:Object},4930:function(t,e,n){var i=n("d039");t.exports=!!Object.getOwnPropertySymbols&&!i((function(){return!String(Symbol())}))},"4b5b":function(t,e,n){},"4c72":function(t,e,n){var i,r,o;
|
|
76
|
-
/*!
|
|
77
|
-
* jQuery UI Disable Selection 1.12.1
|
|
78
|
-
* http://jqueryui.com
|
|
79
|
-
*
|
|
80
|
-
* Copyright jQuery Foundation and other contributors
|
|
81
|
-
* Released under the MIT license.
|
|
82
|
-
* http://jquery.org/license
|
|
83
|
-
*/(function(a){r=[n("1157"),n("4309")],i=a,o="function"===typeof i?i.apply(e,r):i,void 0===o||(t.exports=o)})((function(t){return t.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",(function(t){t.preventDefault()}))}}(),enableSelection:function(){return this.off(".ui-disableSelection")}})}))},"4d4c":function(t,e,n){(function(e,n){t.exports=n()})(0,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){n(1);var i=function(){this.Revision=29,this.defaultMaterialColor=16777215,this.defaultOpacity=1,this.modelPrefix=void 0,this.Geometry=n(2).Geometry,this.Glyph=n(6).Glyph,this.Glyphset=n(8).Glyphset,this.Pointset=n(11).Pointset,this.Lines=n(14).Lines,this.Renderer=n(17).Renderer,this.Scene=n(18).Scene,this.GeometryCSG=n(22).GeometryCSG,this.GlyphsetCSG=n(28).GlyphsetCSG,this.Viewport=n(21).Viewport,this.CameraControls=n(21).CameraControls,this.SmoothCameraTransition=n(21).SmoothCameraTransition,this.RayCaster=n(21).RayCaster,this.CameraAutoTumble=n(21).CameraAutoTumble,this.StereoEffect=n(21).StereoEffect,this.loadExternalFile=n(4).loadExternalFile,this.loadExternalFiles=n(4).loadExternalFiles,this.THREE=n(3)};t.exports=new i},function(t,e){t.exports=n("4f5a")},function(t,e,n){var i=n(3);function r(t,e){return Math.abs(e[1])-Math.abs(t[1])}e.Geometry=function(){var t=this;this.geometry=void 0,this.mixer=void 0,this.timeEnabled=!1,this.morphColour=!1,this.modelId=-1,this.videoHandler=void 0,this.morph=void 0,this.clipAction=void 0,this.isGeometry=!0,this.duration=3e3,this.groupName=void 0;var e=0;this.userData=[],this.setMesh=function(e,n,r,o){if(t.mixer=new i.AnimationMixer(e),t.geometry=e.geometry,t.clipAction=void 0,t.geometry.morphAttributes.position){var a=i.AnimationClip.CreateClipsFromMorphTargetSequences(t.geometry.morphAttributes.position,10,!0);a&&null!=a[0]&&(t.clipAction=t.mixer.clipAction(a[0]).setDuration(t.duration),t.clipAction.loop=i.loopOnce,t.clipAction.clampWhenFinished=!0,t.clipAction.play())}t.timeEnabled=r,t.morphColour=o,t.modelId=n,t.morph=e,t.morph.userData=t,t.timeEnabled&&t.setFrustumCulled(!1)},this.createMesh=function(e,r,o){if(!t.geometry||!t.morph||null==e){var a;e instanceof i.Geometry?(o.localTimeEnabled&&(null==e.morphNormals||0==e.morphNormals.length)&&e.computeMorphNormals(),a=(new i.BufferGeometry).fromGeometry(e),o.localMorphColour&&n(4).copyMorphColorsToBufferGeometry(e,a)):e instanceof i.BufferGeometry&&(a=new i.BufferGeometry,a.copy(e)),e._video&&(a._video=e._video);var s,c,l=!1;if(1>o.opacity&&(l=!0),void 0===a._video)r?(s=r,s.morphTargets=o.localTimeEnabled,s.morphNormals=o.localTimeEnabled):s=a instanceof i.BufferGeometry&&void 0===a.attributes.color?new i.MeshPhongMaterial({color:o.colour,morphTargets:o.localTimeEnabled,morphNormals:o.localTimeEnabled,transparent:l,opacity:o.opacity,side:i.DoubleSide}):new i.MeshPhongMaterial({color:o.colour,morphTargets:o.localTimeEnabled,morphNormals:o.localTimeEnabled,vertexColors:i.VertexColors,transparent:l,opacity:o.opacity,side:i.DoubleSide}),o.localMorphColour&&a.morphAttributes.color&&(s.onBeforeCompile=n(5).augmentMorphColor());else{var u=a._video.createCanvasVideoTexture();s=new i.MeshBasicMaterial({morphTargets:o.localTimeEnabled,color:new i.Color(1,1,1),transparent:l,opacity:o.opacity,map:u,side:i.DoubleSide}),t.videoHandler=a._video}c=new i.Mesh(a,s),t.setMesh(c,o.modelId,o.localTimeEnabled,o.localMorphColour)}},this.setName=function(e){t.groupName=e,t.morph&&(t.morph.name=t.groupName)},this.setVisibility=function(e){t.morph.visible=e},this.setAlpha=function(e){var n=t.morph.material,i=!1;1>e&&(i=!0),n.transparent=i,n.opacity=e},this.setFrustumCulled=function(e){t.morph&&(t.morph.frustumCulled=e)},this.getCurrentTime=function(){if(t.clipAction){var n=t.clipAction.time/t.clipAction._clip.duration;return t.duration*n}return e},this.setMorphTime=function(n){var i=!1;if(t.clipAction){var r=n/t.duration,a=t.clipAction._clip.duration,s=r*a;s!=t.clipAction.time&&(t.clipAction.time=s,i=!0),t.clipAction.time>a&&(t.clipAction.time=a),0>t.clipAction.time&&(t.clipAction.time=0),i&&1==t.timeEnabled&&t.mixer.update(0)}else{var c=n;c=n>t.duration?t.duration:0>n?0:n,c!=e&&(e=c,i=!0)}i&&o(t.geometry,t.morph,t.clipAction)},this.calculateUVs=function(){t.geometry.computeBoundingBox();var e=t.geometry.boundingBox.max,n=t.geometry.boundingBox.min,r=new i.Vector2(0-n.x,0-n.y),o=new i.Vector2(e.x-n.x,e.y-n.y);t.geometry.faceVertexUvs[0]=[];for(var a=0;a<t.geometry.faces.length;a++){var s=t.geometry.vertices[t.geometry.faces[a].a],c=t.geometry.vertices[t.geometry.faces[a].b],l=t.geometry.vertices[t.geometry.faces[a].c];geometry.faceVertexUvs[0].push([new i.Vector2((s.x+r.x)/o.x,(s.y+r.y)/o.y),new i.Vector2((c.x+r.x)/o.x,(c.y+r.y)/o.y),new i.Vector2((l.x+r.x)/o.x,(l.y+r.y)/o.y)])}geometry.uvsNeedUpdate=!0},this.setWireframe=function(e){t.morph.material.wireframe=e},this.setVertexColors=function(e){t.morph.material.vertexColors=e,t.geometry.colorsNeedUpdate=!0},this.setColour=function(e){t.morph.material.color=e,t.geometry.colorsNeedUpdate=!0},this.setMaterial=function(e){t.morph.material=e,t.geometry.colorsNeedUpdate=!0};var o=function(t,e){if(e&&t.morphAttributes.color){var n=t.morphAttributes.color,i=e.morphTargetInfluences,o=i.length;t.removeAttribute("morphColor0"),t.removeAttribute("morphColor1");for(var a=0,s=[],c=0;1>a||c<o;c++)0<i[c]&&(a++,s.push([c,i[c]]));s.sort(r),2==s.length?(t.addAttribute("morphColor0",n[s[0][0]]),t.addAttribute("morphColor1",n[s[1][0]])):1==s.length&&(t.addAttribute("morphColor0",n[s[0][0]]),t.addAttribute("morphColor1",n[s[0][0]]))}};this.isTimeVarying=function(){return!(!t.timeEnabled&&!t.morphColour)},this.getBoundingBox=function(){if(t.morph){var e=(new i.Box3).setFromObject(t.morph);return e}},this.dispose=function(){t.morph&&t.morph.geometry&&t.morph.geometry.dispose(),t.morph&&t.morph.material&&t.morph.material.dispose(),t.geometry=void 0,t.mixer=void 0,t.morph=void 0,t.clipAction=void 0,t.groupName=void 0},this.render=function(n,r){if(1==r){if(t.clipAction&&1==t.timeEnabled)t.mixer.update(n);else{var a=e+n;a>t.duration&&(a-=t.duration),e=a}var s;if(0!=n&&1==t.morphColour&&"undefined"!=typeof t.geometry&&t.morph.material.vertexColors==i.VertexColors)t.clipAction&&1==t.timeEnabled&&(s=t.clipAction),o(t.geometry,t.morph,s)}}}},function(t,e){t.exports=n("5a89")},function(t,e,n){function i(t){throw new Error('"'+t+'" is read-only')}var r=n(3);function o(t){var e=t,r=n(0).modelPrefix;if(r){"/"!=r[r.length-1]&&(i("prefix"),r+="/");var o=/^(?:[a-z]+:)?\/\//i;o.test(t)||(e=r+t)}return e}function a(t,e,n,i){var r=new XMLHttpRequest;r.open("GET",o(t),!0),r.onreadystatechange=function(){4==r.readyState&&(200==r.status?n(r.responseText,e):i(t))},r.send(null)}function s(t,e,n){function i(t,n){s[n]=t,o++,o==r&&e(s)}for(var r=t.length,o=0,s=[],c=0;c<r;c++)a(t[c],c,i,n)}e.getColorsRGB=function(t,e){var n=Math.floor(e/3),i=e%3,o=0;0==i?o=t[n].r:1==i?o=t[n].g:2==i&&(o=t[n].b);var a=new r.Color(o);return[a.r,a.g,a.b]},e.copyMorphColorsToBufferGeometry=function(t,e){if(t&&t.morphColors&&0<t.morphColors.length){for(var i=[],o=t.morphColors,a=n(4).getColorsRGB,s=0,c=o.length;s<c;s++){for(var l=o[s],u=[],h=0;h<t.faces.length;h++){var p=t.faces[h],d=a(l.colors,p.a);u.push(d[0],d[1],d[2]),d=a(l.colors,p.b),u.push(d[0],d[1],d[2]),d=a(l.colors,p.c),u.push(d[0],d[1],d[2])}var f=new r.Float32BufferAttribute(3*t.faces.length*3,3);f.name=l.name,i.push(f.copyArray(u))}e.morphAttributes.color=i}},e.mergeVertices=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1e-4;e=Math.max(e,Number.EPSILON);for(var n={},i=t.getIndex(),o=t.getAttribute("position"),a=i?i.count:o.count,s=0,c=Object.keys(t.attributes),l={},u={},h=[],p=["getX","getY","getZ","getW"],d=0,f=c.length;d<f;d++){w=c[d],l[w]=[];var m=t.morphAttributes[w];m&&(u[w]=Array(m.length).fill().map((function(){return[]})))}var g=Math.log10(1/e),v=Math.pow(10,g);for(d=0;d<a;d++){var y=i?i.getX(d):d,b="",x=0;for(f=c.length;x<f;x++)for(var w=c[x],_=t.getAttribute(w),M=_.itemSize,T=0;T<M;T++)b+="".concat(~~(_[p[T]](y)*v),",");if(b in n)h.push(n[b]);else{for(x=0,f=c.length;x<f;x++){w=c[x],_=t.getAttribute(w),m=t.morphAttributes[w],M=_.itemSize;var S,E=l[w],A=u[w];for(T=0;T<M;T++)if(S=p[T],E.push(_[S](y)),m)for(var C=0,L=m.length;C<L;C++)A[C].push(m[C][S](y))}n[b]=s,h.push(s),s++}}var P=t.clone();for(d=0,f=c.length;d<f;d++){w=c[d];var R=t.getAttribute(w),O=new R.array.constructor(l[w]);if(R.isInterleavedBufferAttribute?_=new r.BufferAttribute(O,R.itemSize,R.itemSize):(_=t.getAttribute(w).clone(),_.setArray(O)),P.addAttribute(w,_),w in u){var D;for(x=0;x<u[w].length;x++)D=t.morphAttributes[w][x].clone(),D.setArray(new D.array.constructor(u[w][x])),P.morphAttributes[w][x]=D}}var N=Uint8Array;h.length>=Math.pow(2,8)&&(N=Uint16Array),h.length>=Math.pow(2,16)&&(N=Uint32Array);var I=new N(h);h=null;return null===i?h=new r.BufferAttribute(I,1):(h=t.getIndex().clone(),h.setArray(I)),P.setIndex(h),P},e.resolveURL=o,e.loadExternalFile=a,e.loadExternalFiles=s},function(t,e){e.augmentMorphColor=function(){return function(t){t.vertexShader=t.vertexShader.replace("#include <color_pars_vertex>",["varying vec3 vColor;","attribute vec3 morphColor0;","attribute vec3 morphColor1;"].join("\n")),t.vertexShader=t.vertexShader.replace("#include <color_vertex>",["vColor.xyz = color.xyz;","#ifdef USE_MORPHTARGETS","vColor = morphColor0 * morphTargetInfluences[ 0 ];","vColor += morphColor1 * morphTargetInfluences[ 1 ];","#endif"].join("\n"))}}},function(t,e,n){var i=n(3);e.Glyph=function(t,e,r,o){var a=this,s=void 0;e&&(s=e.clone(),s.vertexColors=i.FaceColors);var c=void 0;this.id=r,this.userData=[];var l=void 0,u=void 0,h=new i.Group;this.isGlyph=!0,this.fromMesh=function(t){return!(!t||!t.isMesh)&&(c=t.clone(),c.userData=a,h.add(c),!0)},t&&s&&this.fromMesh(new i.Mesh(t,s)),this.getGlyphset=function(){return o},this.setLabel=function(t){t&&("string"==typeof t||t instanceof String)&&(u=t,c&&(c.name=t)),l&&a.showLabel()},this.showLabel=function(){if(l&&(position=l.getPosition(),h.remove(l.getSprite()),l.dispose(),l=void 0),u&&("string"==typeof u||u instanceof String)){var t=[0,0,0];l=new(n(7).Label)(u),l.setPosition(t[0],t[1],t[2]),h.add(l.getSprite())}},this.getGroup=function(){return h},this.getLabel=function(){return u},this.getMesh=function(){return c},this.setFrustumCulled=function(t){c&&(c.frustumCulled=t)},this.getBoundingBox=function(){return c?(new i.Box3).setFromObject(c):void 0},this.getColor=function(){return c&&c.material?c.material:void 0},this.setColor=function(t){c.material.color=t,c.geometry.colorsNeedUpdate=!0},this.setTransformation=function(t,e,n,i){c.matrix.elements[0]=e[0],c.matrix.elements[1]=e[1],c.matrix.elements[2]=e[2],c.matrix.elements[3]=0,c.matrix.elements[4]=n[0],c.matrix.elements[5]=n[1],c.matrix.elements[6]=n[2],c.matrix.elements[7]=0,c.matrix.elements[8]=i[0],c.matrix.elements[9]=i[1],c.matrix.elements[10]=i[2],c.matrix.elements[11]=0,c.matrix.elements[12]=t[0],c.matrix.elements[13]=t[1],c.matrix.elements[14]=t[2],c.matrix.elements[15]=1,c.matrixAutoUpdate=!1,l&&l.setPosition(t[0],t[1],t[2])},this.dispose=function(){a.material&&a.material.dispose(),c=void 0}}},function(t,e,n){var i=n(3);e.Label=function(t){var e=this,n=t;this.element=void 0;var r=void 0,o=function(){var t=document.createElement("canvas");t.width=128,t.height=32;var e=t.getContext("2d");e.textBaseline="alphabetic";var i=e.measureText(n);i.width;return e.fillStyle="rgb(255,255,255)",e.textAlign="centre",e.font="20px Helvetica",e.fillText(n,64,16),e.strokeStyle="rgba(255,255,255)",e.strokeText(n,64,16),t},a=function(){var t=new i.Texture(e.element);t.needsUpdate=!0;var n=new i.SpriteMaterial({map:t,color:"#ffffff"});r=new i.Sprite(n)};this.getPosition=function(){return r?[r.position.x,r.position.y,r.position.z]:[0,0,0]},this.setPosition=function(t,e,n){r&&r.position.set(t,e,n)},this.setScale=function(t){r&&0<t&&r.scale.set(t,t,1)},this.dispose=function(){e.object=void 0,e.element.parentNode.removeChild(e.element)},this.getSprite=function(){return r},this.getString=function(){return Text},function(){e.element=o(),a()}()}},function(t,e,n){var i=n(3),r=n(9).JSONLoader;e.Glyphset=function(){var t=this,e=[],o=void 0,a=void 0,s=void 0,c=void 0,l=void 0,u=void 0,h=void 0,p=0,d=0,f=[0,0,0],m=[0,0,0],g=[0,0,0],v="NONE";this.duration=3e3;var y=0;this.ready=!1;var b=new i.Group,x=!1,w=!1;this.groupName=void 0,this.isGlyphset=!0,this.userData=[],this.getGroup=function(){return b},this.setVisibility=function(t){b.visible=t},this.load=function(t,e,n){o=t.axis1,a=t.axis2,s=t.axis3,c=t.positions,l=t.scale,u=t.colors,h=t.label,x=t.metadata.MorphColours,w=t.metadata.MorphVertices,p=t.metadata.number_of_time_steps,v=t.metadata.repeat_mode,d=t.metadata.number_of_vertices,"AXES_2D"==v||"MIRROR"==v?d*=2:"AXES_3D"==v&&(d*=3),f=t.metadata.base_size,m=t.metadata.offset,g=t.metadata.scale_factors;var i=new r;i.crossOrigin="Anonymous",i.load(e,A(n))};var _=function(t,e,n,i,r){var o=[];if("NONE"==v||"MIRROR"==v){for(var a=[0,0,0],s=[0,0,0],c=[0,0,0],l=[0,0,0],u=[0,0,0],h=[0,0,0],p=[0,0,0],d=[0,0,0],y=[0,0,0],b=0;3>b;b++)x=0>r[b]?-1:1,a[b]=x*f[b]+r[b]*g[b];for(b=0;3>b;b++)s[b]=e[b]*a[0],c[b]=n[b]*a[1],l[b]=i[b]*a[2],u[b]=t[b]+m[0]*s[b]+m[1]*c[b]+m[2]*l[b],"MIRROR"==v&&(h[b]=-s[b],p[b]=-c[b],d[b]=-l[b],y[b]=u[b],0>r[0]&&(u[b]-=s[b],y[b]-=h[b]));0>l[0]*(s[1]*c[2]-s[2]*c[1])+l[1]*(s[2]*c[0]-s[0]*c[2])+l[2]*(s[0]*c[1]-s[1]*c[0])&&(l[0]=-l[0],l[1]=-l[1],l[2]=-l[2]),o.push([u,s,c,l]),"MIRROR"==v&&(0>d[0]*(h[1]*p[2]-h[2]*p[1])+d[1]*(h[2]*p[0]-h[0]*p[2])+d[2]*(h[0]*p[1]-h[1]*p[0])&&(d[0]=-d[0],d[1]=-d[1],d[2]=-d[2]),o.push([y,h,p,d]))}else if("AXES_2D"==v||"AXES_3D"==v){var x,w=[0,0,0],_=[0,0,0];for(b=0;3>b;b++)x=0>r[b]?-1:1,w[b]=x*f[0]+r[b]*g[0];for(b=0;3>b;b++)_[b]=t[b]+m[0]*w[0]*e[b]+m[1]*w[1]*n[b]+m[2]*w[2]*i[b];for(var M="AXES_2D"==glyph_repeat_mode?2:3,T=0;T<M;T++){var S=void 0,E=void 0,A=r[T],C=[0,0,0],L=[0,0,0],P=[0,0,0];0==T?(S=e,E=n):1==T?(S=n,E="AXES_2D"==glyph_repeat_mode?e:i):(S=i,E=e);var R=f[0]+A*g[0];C[0]=S[0]*R,C[1]=S[1]*R,C[2]=S[2]*R,P[0]=C[1]*E[2]-E[1]*C[2],P[1]=C[2]*E[0]-E[2]*C[0],P[2]=C[0]*E[1]-C[1]*E[0];var O=Math.sqrt(P[0]*P[0]+P[1]*P[1]+P[2]*P[2]);if(0<O){var D=(f[2]+A*g[2])/O;"AXES_2D"==v&&0<T&&(D*=-1),P[0]*=D,P[1]*=D,P[2]*=D}if(L[0]=P[1]*C[2]-C[1]*P[2],L[1]=P[2]*C[0]-C[2]*P[0],L[2]=P[0]*C[1]-P[1]*C[0],O=Math.sqrt(L[0]*L[0]+L[1]*L[1]+L[2]*L[2]),0<O){var N=(f[1]+A*g[1])/O;L[0]*=N,L[1]*=N,L[2]*=N}o.push([_,C,L,P])}}return o},M=function(t,n,i,r,o){var a=1;"AXES_2D"==v||"MIRROR"==v?a=2:"AXES_3D"==v&&(a=3);for(var s=t.length/3,c=0,l=0;l<s;l++){var u=3*l,h=[t[u],t[u+1],t[u+2]],p=[n[u],n[u+1],n[u+2]],d=[i[u],i[u+1],i[u+2]],f=[r[u],r[u+1],r[u+2]],m=[o[u],o[u+1],o[u+2]],g=_(h,p,d,f,m);if(g.length==a)for(var y,b=0;b<a;b++)y=e[c],y&&y.setTransformation(g[b][0],g[b][1],g[b][2],g[b][3]),c++}},T=function(t){var n=1;"AXES_2D"==v||"MIRROR"==v?n=2:"AXES_3D"==v&&(n=3);for(var r,o=t.length,a=0,s=0;s<o;s++){r=t[s];for(var c,l=0;l<n;l++){if(c=e[a],c){var u=new i.Color(r);c.setColor(u)}a++}}},S=function(){var e=[],n=[],r=[],h=[],d=[],f=[],m=y/t.duration*(p-1),g=Math.floor(m),v=1-(m-g),b=Math.ceil(m);if(w)for(var _=c[g.toString()],S=c[b.toString()],E=o[g.toString()],A=o[b.toString()],C=a[g.toString()],L=a[b.toString()],P=s[g.toString()],R=s[b.toString()],O=l[g.toString()],D=l[b.toString()],N=0;N<_.length;N++)e.push(v*_[N]+(1-v)*S[N]),n.push(v*E[N]+(1-v)*A[N]),r.push(v*C[N]+(1-v)*L[N]),h.push(v*P[N]+(1-v)*R[N]),d.push(v*O[N]+(1-v)*D[N]);else e=c[0],n=o[0],r=a[0],h=s[0],d=l[0];if(M(e,n,r,h,d),null!=u){if(x)for(var I=u[g.toString()],z=u[b.toString()],B=0;B<I.length;B++){var k=new i.Color(I[B]),H=new i.Color(z[B]),U=new i.Color(k.r*v+H.r*(1-v),k.g*v+H.g*(1-v),k.b*v+H.b*(1-v));f.push(U.getHex())}else f=u[0];T(f)}e=null,n=null,r=null,h=null,d=null,f=null};this.showLabel=function(){for(var t=0;t<e.length;t++)e[t].showLabel()};var E=function(i,r){for(var f,m=0;m<d;m++)f=new(n(6).Glyph)(i,r,m+1,t),null!=h&&null!=h[m]&&f.setLabel(h[m]),0<p&&f.setFrustumCulled(!1),e[m]=f,b.add(f.getGroup());M(c[0],o[0],a[0],s[0],l[0]),null!=u&&T(u[0]),t.ready=!0};this.addCustomGlyph=function(n){n.isGlyph&&e.push(n),t.ready=!0},this.addMeshAsGlyph=function(i,r){if(i.isMesh){var o=new(n(6).Glyph)(void 0,void 0,r,t);return o.fromMesh(i),e.push(o),b.add(o.getGroup()),t.ready=!0,o}},this.forEachGlyph=function(t){for(var n=0;n<e.length;n++)t(e[n])};var A=function(e){return function(n,r){var o=(new i.BufferGeometry).fromGeometry(n),a=void 0;r&&r[0]&&(a=r[0]),E(o,a),null!=e&&"function"==typeof e&&e(t)}};this.getBoundingBox=function(){var t,n;if(b.visible)for(var i=0;i<e.length;i++)n=e[i].getBoundingBox(),null==t?t=n:t.union(n);return t},this.setMorphTime=function(e){y=e>t.duration?t.duration:0>e?0:e,(x||w)&&S()},this.isTimeVarying=function(){return!!(0<p&&(x||w))},this.getCurrentTime=function(){return y},this.dispose=function(){for(var n=e.length-1;0<=n;n--)e[n].dispose();o=void 0,a=void 0,s=void 0,c=void 0,l=void 0,u=void 0,t.ready=!1,t.groupName=void 0},this.render=function(e,n){if(1==n){var i=y+e;i>t.duration&&(i-=t.duration),y=i,(x||w)&&S()}}}},function(t,e,n){"use strict";n.r(e),n.d(e,"JSONLoader",(function(){return m}));var i=n(3),r=i.Loader,o=i.LoaderUtils,a=i.AnimationClip,s=i.Vector3,c=i.Vector4,l=i.Color,u=i.Vector2,h=i.Face3,p=i.Geometry,d=i.FileLoader,f=i.DefaultLoadingManager;function m(t){"boolean"==typeof t&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),t=void 0),this.manager=void 0===t?f:t,this.withCredentials=!1}Object.assign(m.prototype,{load:function(t,e,n,i){var r=this,a=this.texturePath&&"string"==typeof this.texturePath?this.texturePath:o.extractUrlBase(t),s=new d(this.manager);s.setWithCredentials(this.withCredentials),s.load(t,(function(n){var i=JSON.parse(n),o=i.metadata;if(void 0!==o){var s=o.type;if(void 0!==s&&"object"===s.toLowerCase())return void console.error("THREE.JSONLoader: "+t+" should be loaded with THREE.ObjectLoader instead.")}var c=r.parse(i,a);e(c.geometry,c.materials)}),n,i)},setTexturePath:function(t){this.texturePath=t},parse:function(){function t(t,e){function n(t,e){return t&1<<e}var i,r,o,a,c,p,d,f,m,g,v,y,b,x,w,_,M,T,S,E,A,C,L,P,R,O,D,N=t.faces,I=t.vertices,z=t.normals,B=t.colors,k=t.scale,H=0;if(void 0!==t.uvs){for(i=0;i<t.uvs.length;i++)t.uvs[i].length&&H++;for(i=0;i<H;i++)e.faceVertexUvs[i]=[]}for(a=0,c=I.length;a<c;)T=new s,T.x=I[a++]*k,T.y=I[a++]*k,T.z=I[a++]*k,e.vertices.push(T);for(a=0,c=N.length;a<c;)if(g=N[a++],v=n(g,0),y=n(g,1),b=n(g,3),x=n(g,4),w=n(g,5),_=n(g,6),M=n(g,7),v){if(E=new h,E.a=N[a],E.b=N[a+1],E.c=N[a+3],A=new h,A.a=N[a+1],A.b=N[a+2],A.c=N[a+3],a+=4,y&&(m=N[a++],E.materialIndex=m,A.materialIndex=m),o=e.faces.length,b)for(i=0;i<H;i++)for(P=t.uvs[i],e.faceVertexUvs[i][o]=[],e.faceVertexUvs[i][o+1]=[],r=0;4>r;r++)f=N[a++],O=P[2*f],D=P[2*f+1],R=new u(O,D),2!==r&&e.faceVertexUvs[i][o].push(R),0!==r&&e.faceVertexUvs[i][o+1].push(R);if(x&&(d=3*N[a++],E.normal.set(z[d++],z[d++],z[d]),A.normal.copy(E.normal)),w)for(i=0;4>i;i++)d=3*N[a++],L=new s(z[d++],z[d++],z[d]),2!==i&&E.vertexNormals.push(L),0!==i&&A.vertexNormals.push(L);if(_&&(p=N[a++],C=B[p],E.color.setHex(C),A.color.setHex(C)),M)for(i=0;4>i;i++)p=N[a++],C=B[p],2!==i&&E.vertexColors.push(new l(C)),0!==i&&A.vertexColors.push(new l(C));e.faces.push(E),e.faces.push(A)}else{if(S=new h,S.a=N[a++],S.b=N[a++],S.c=N[a++],y&&(m=N[a++],S.materialIndex=m),o=e.faces.length,b)for(i=0;i<H;i++)for(P=t.uvs[i],e.faceVertexUvs[i][o]=[],r=0;3>r;r++)f=N[a++],O=P[2*f],D=P[2*f+1],R=new u(O,D),e.faceVertexUvs[i][o].push(R);if(x&&(d=3*N[a++],S.normal.set(z[d++],z[d++],z[d])),w)for(i=0;3>i;i++)d=3*N[a++],L=new s(z[d++],z[d++],z[d]),S.vertexNormals.push(L);if(_&&(p=N[a++],S.color.setHex(B[p])),M)for(i=0;3>i;i++)p=N[a++],S.vertexColors.push(new l(B[p]));e.faces.push(S)}}function e(t,e){var n=void 0===t.influencesPerVertex?2:t.influencesPerVertex;if(t.skinWeights)for(var i=0,r=t.skinWeights.length;i<r;i+=n){var o=t.skinWeights[i],a=1<n?t.skinWeights[i+1]:0,s=2<n?t.skinWeights[i+2]:0,l=3<n?t.skinWeights[i+3]:0;e.skinWeights.push(new c(o,a,s,l))}if(t.skinIndices)for(i=0,r=t.skinIndices.length;i<r;i+=n){var u=t.skinIndices[i],h=1<n?t.skinIndices[i+1]:0,p=2<n?t.skinIndices[i+2]:0,d=3<n?t.skinIndices[i+3]:0;e.skinIndices.push(new c(u,h,p,d))}e.bones=t.bones,e.bones&&0<e.bones.length&&(e.skinWeights.length!==e.skinIndices.length||e.skinIndices.length!==e.vertices.length)&&console.warn("When skinning, number of vertices ("+e.vertices.length+"), skinIndices ("+e.skinIndices.length+"), and skinWeights ("+e.skinWeights.length+") should match.")}function o(t,e){var n,r,o,a,c,l=t.scale;if(void 0!==t.morphTargets)for(var u=0,h=t.morphTargets.length;u<h;u++){e.morphTargets[u]={},e.morphTargets[u].name=t.morphTargets[u].name,e.morphTargets[u].vertices=[];for(var p,d=e.morphTargets[u].vertices,f=t.morphTargets[u].vertices,m=0,g=f.length;m<g;m+=3)p=new s,p.x=f[m]*l,p.y=f[m+1]*l,p.z=f[m+2]*l,d.push(p)}if(void 0!==t.morphColors)for(u=0,h=t.morphColors.length;u<h;u++)for(e.morphColors[u]={},e.morphColors[u].name=t.morphColors[u].name,e.morphColors[u].colors=[],o=e.morphColors[u].colors,a=t.morphColors[u].colors,n=0,r=a.length;n<r;n+=3)c=new i.Color(16755200),c.setRGB(a[n],a[n+1],a[n+2]),o.push(c)}function d(t,e){var n=[],i=[];void 0!==t.animation&&i.push(t.animation),void 0!==t.animations&&(t.animations.length?i=i.concat(t.animations):i.push(t.animations));for(var r,o=0;o<i.length;o++)r=a.parseAnimation(i[o],e.bones),r&&n.push(r);if(e.morphTargets){var s=a.CreateClipsFromMorphTargetSequences(e.morphTargets,10);n=n.concat(s)}0<n.length&&(e.animations=n)}return function(a,s){void 0!==a.data&&(a=a.data),a.scale=void 0===a.scale?1:1/a.scale;var c=new p;if(c.morphColors=[],t(a,c),e(a,c),o(a,c),d(a,c),c.computeFaceNormals(),c.computeBoundingSphere(),void 0===a.materials||0===a.materials.length)return{geometry:c};var l=r.prototype.initMaterials(a.materials,s,"Anonymous");if(a.materials[0].video){var u=s+a.materials[0].video,h=new(n(10).VideoHandler)(u);c._video=h}return l&&0<l.length&&(a.materials[0].singleSided?l[0].side=i.FrontSide:a.materials[0].flipSided?l[0].side=i.BackSide:l[0].side=i.DoubleSide),{geometry:c,materials:l}}}()})},function(t,e,n){var i=n(3);e.VideoHandler=function(t){var e=this;this.video=void 0,this.videoTexture=void 0;this.setMorphTime=function(t,n){var i=t/n*e.video.duration;e.video.currentTime=i},this.getVideoDuration=function(){return e.video.duration},this.createCanvasVideoTexture=function(){return e.videoTexture=new i.VideoTexture(e.video),e.videoTexture.minFilter=i.LinearFilter,e.videoTexture.magFilter=i.LinearFilter,e.videoTexture.format=i.RGBFormat,e.videoTexture},this.getCurrentTime=function(t){return e.video?t*(e.video.currentTime/e.video.duration):0},this.isReadyToPlay=function(){return!!(e.video&&3<=e.video.readyState)},function(){document&&(e.video=document.createElement("video"),e.video.crossOrigin="anonymous",e.video.src=t,e.video.load(),e.video.loop=!0)}()}},function(t,e,n){var i=n(3),r=n(12).Points;e.Pointset=function(){var t=this;this.morph=void 0,this.groupName=void 0,this.timeEnabled=!1,this.morphColour=!1,this.isPointset=!0;var e=0;this.duration=3e3,this.clipAction=void 0,this.userData=[],this.setFrustumCulled=function(e){t.morph&&(t.morph.frustumCulled=e)};var o=function(){var t=new Image;t.src=n(13);var e=new i.Texture;return e.image=t,e.needsUpdate=!0,e};this.isTimeVarying=function(){return!(!t.timeEnabled&&!t.morphColour)},this.setMesh=function(e,n,r){if(t.mixer=new i.AnimationMixer(e),t.geometry=e.geometry,t.clipAction=void 0,t.geometry.morphAttributes.position){var o=i.AnimationClip.CreateClipsFromMorphTargetSequences(t.geometry.morphAttributes.position,10,!0);o&&null!=o[0]&&(t.clipAction=t.mixer.clipAction(o[0]).setDuration(t.duration),t.clipAction.loop=i.loopOnce,t.clipAction.clampWhenFinished=!0,t.clipAction.play())}t.timeEnabled=n,t.morphColour=r,t.morph=e,t.morph.userData=t,t.morph.name=t.groupName,t.timeEnabled&&t.setFrustumCulled(!1)},this.createMesh=function(e,a,s){if(e&&a){var c;e instanceof i.Geometry?(c=(new i.BufferGeometry).fromGeometry(e),s.localMorphColour&&n(4).copyMorphColorsToBufferGeometry(e,c)):e instanceof i.BufferGeometry&&(c=new i.BufferGeometry,c.copy(e)),c.colorsNeedUpdate=!0;var l=o();a.map=l;var u=new r(c,a);t.setMesh(u,s.localTimeEnabled,s.localMorphColour)}},this.setSize=function(e){t.morph&&t.morph.material&&(t.morph.material.size=e,t.morph.material.needsUpdate=!0)},this.setSizeAttenuation=function(e){t.morph&&t.morph.material&&(t.morph.material.sizeAttenuation=e,t.morph.material.needsUpdate=!0)},this.setName=function(e){t.groupName=e,t.morph&&(t.morph.name=t.groupName)},this.setVisibility=function(e){t.morph.visible=e},this.getBoundingBox=function(){if(t.morph&&t.morph.visible){var e=new i.Box3;if(t.morph.geometry.computeBoundingBox(),e.copy(t.morph.geometry.boundingBox),t.timeEnabled){var n=t.morph.geometry.morphTargets;if(n)for(var r=0,o=n.length;r<o;r++){var a=n[r].vertices,s=(new i.Box3).setFromPoints(a);e.union(s)}}return e}},this.getCurrentTime=function(){if(t.clipAction){var n=t.clipAction.time/t.clipAction._clip.duration;return t.duration*n}return e},this.setMorphTime=function(n){if(t.clipAction){var r=n/t.duration,o=t.clipAction._clip.duration;t.clipAction.time=r*o,t.clipAction.time>o&&(t.clipAction.time=o),0>t.clipAction.time&&(t.clipAction.time=0),1==t.timeEnabled&&t.mixer.update(0)}else e=n>t.duration?t.duration:0>n?0:n;1==t.morphColour&&"undefined"!=typeof t.geometry&&(t.morph.material.vertexColors==i.VertexColors&&morphColorsToVertexColors(t.geometry,t.morph,t.clipAction),t.geometry.colorsNeedUpdate=!0)},this.isTimeVarying=function(){return!(!t.timeEnabled&&!t.morphColour)},this.dispose=function(){t.morph&&t.morph.geometry&&t.morph.geometry.dispose(),t.morph&&t.morph.material&&t.morph.material.dispose(),t.geometry=void 0,t.mixer=void 0,t.morph=void 0,t.clipAction=void 0,t.groupName=void 0},this.render=function(n,r){if(1==r){if(t.clipAction&&1==t.timeEnabled)t.mixer.update(n);else{var o=e+n;o>t.duration&&(o-=t.duration),e=o}var a;if(1==t.morphColour&&"undefined"!=typeof t.geometry&&t.morph.material.vertexColors==i.VertexColors)t.clipAction&&1==t.timeEnabled&&(a=t.clipAction),morphColorsToVertexColors(t.geometry,t.morph,a),t.geometry.colorsNeedUpdate=!0}}}},function(t,e,n){"use strict";n.r(e),n.d(e,"Points",(function(){return h}));var i=n(3),r=i.Sphere,o=i.Ray,a=i.Matrix4,s=i.Object3D,c=i.Vector3,l=i.PointsMaterial,u=i.BufferGeometry;function h(t,e){s.call(this),this.type="Points",this.geometry=void 0===t?new u:t,this.material=void 0===e?new l({color:16777215*Math.random()}):e,this.updateMorphTargets()}h.prototype=Object.assign(Object.create(s.prototype),{constructor:h,isPoints:!0,copy:function(t){return s.prototype.copy.call(this,t),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this},updateMorphTargets:function(){var t,e,n,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,o=Object.keys(r);if(0<o.length){var a=r[o[0]];if(void 0!==a)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=a.length;t<e;t++)n=a[t].name||t+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}else{var s=i.morphTargets;void 0!==s&&0<s.length&&console.error("THREE.Line.updateMorphTargets() does not supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(){function t(t,e,n,i,r){s.fromBufferAttribute(n,r);var o=t.morphTargetInfluences;if(e.morphTargets&&i&&o){l.set(0,0,0);for(var a=0,c=i.length;a<c;a++){var h=o[a],p=i[a];0===h||(u.fromBufferAttribute(p,r),l.addScaledVector(u.sub(s),h))}s.add(l)}}var e=new a,n=new o,i=new r,s=new c,l=new c,u=new c;return function(r,o){function a(t,e){var i=n.distanceSqToPoint(t);if(i<m){n.closestPointToPoint(t,g),g.applyMatrix4(h);var a=r.ray.origin.distanceTo(g);if(a<r.near||a>r.far)return;o.push({distance:a,distanceToRay:Math.sqrt(i),point:g.clone(),index:e,face:null,object:l})}}var l=this,u=this.geometry,h=this.matrixWorld,p=this.material,d=r.params.Points.threshold;if(u.isBufferGeometry||!0!==this.material.morphTargets){if(null===u.boundingSphere&&u.computeBoundingSphere(),i.copy(u.boundingSphere),i.applyMatrix4(h),i.radius+=d,!1===r.ray.intersectsSphere(i))return;e.getInverse(h),n.copy(r.ray).applyMatrix4(e)}var f=d/((this.scale.x+this.scale.y+this.scale.z)/3),m=f*f,g=new c;if(u.isBufferGeometry){var v=u.index,y=u.attributes.position,b=u.morphAttributes.position;if(null!==v)for(var x,w=v.array,_=0,M=w.length;_<M;_++)x=w[_],t(this,p,y,b,x),a(s,x);else{_=0;for(var T=y.count;_<T;_++)t(this,p,y,b,_),a(s,_)}}else{var S=u.vertices;if(!0===this.material.morphTargets){var E=[],A=u.morphTargets,C=this.morphTargetInfluences,L=S.length,P=new c;for(T=0;T<L;T++){var R=new c,O=S[T];R.set(0,0,0);for(var D,N=0,I=A.length;N<I;N++)if(D=C[N],0!==D){var z=A[N].vertices;R.addScaledVector(P.subVectors(z[T],O),D)}R.add(O),E.push(R)}if(S=E,i.setFromPoints(S),i.applyMatrix4(h),i.radius+=d,!1===r.ray.intersectsSphere(i))return;e.getInverse(h),n.copy(r.ray).applyMatrix4(e)}for(_=0,T=S.length;_<T;_++)a(S[_],_)}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}})},function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg=="},function(t,e,n){var i=n(3);e.Lines=function(){var t=this;this.morph=void 0,this.groupName=void 0,this.timeEnabled=!1,this.morphColour=!1,this.isLines=!0;var e=0;this.duration=3e3,this.clipAction=void 0,this.userData=[],this.setFrustumCulled=function(e){t.morph&&(t.morph.frustumCulled=e)},this.isTimeVarying=function(){return!(!t.timeEnabled&&!t.morphColour)},this.setLine=function(e,n,r){if(t.mixer=new i.AnimationMixer(e),t.geometry=e.geometry,t.clipAction=void 0,t.geometry.morphAttributes.position){var o=i.AnimationClip.CreateClipsFromMorphTargetSequences(t.geometry.morphAttributes.position,10,!0);o&&null!=o[0]&&(t.clipAction=t.mixer.clipAction(o[0]).setDuration(t.duration),t.clipAction.loop=i.loopOnce,t.clipAction.clampWhenFinished=!0,t.clipAction.play())}t.timeEnabled=n,t.morphColour=r,t.morph=e,t.morph.userData=t,t.timeEnabled&&t.setFrustumCulled(!1)},this.createLineSegment=function(e,r,o){if(e&&r){var a;e instanceof i.Geometry?(a=(new i.BufferGeometry).fromGeometry(e),o.localMorphColour&&n(4).copyMorphColorsToBufferGeometry(e,a)):e instanceof i.BufferGeometry&&(a=new i.BufferGeometry,a.copy(e)),a.colorsNeedUpdate=!0;var s=new(n(15).LineSegments)(a,r);t.setLine(s,o.localTimeEnabled,o.localMorphColour)}},this.setWidth=function(e){t.morph&&t.morph.material&&(t.morph.material.linewidth=e,t.morph.material.needsUpdate=!0)},this.setName=function(e){t.groupName=e,t.morph&&(t.morph.name=t.groupName)},this.setVisibility=function(e){t.morph.visible=e},this.getBoundingBox=function(){if(t.morph&&t.morph.visible){var e=new i.Box3;if(t.morph.geometry.computeBoundingBox(),e.copy(t.morph.geometry.boundingBox),t.timeEnabled){var n=t.morph.geometry.morphTargets;if(n)for(var r=0,o=n.length;r<o;r++){var a=n[r].vertices,s=(new i.Box3).setFromPoints(a);e.union(s)}}return e}},this.getCurrentTime=function(){if(t.clipAction){var n=t.clipAction.time/t.clipAction._clip.duration;return t.duration*n}return e},this.setMorphTime=function(n){if(t.clipAction){var r=n/t.duration,o=t.clipAction._clip.duration;t.clipAction.time=r*o,t.clipAction.time>o&&(t.clipAction.time=o),0>t.clipAction.time&&(t.clipAction.time=0),1==t.timeEnabled&&t.mixer.update(0)}else e=n>t.duration?t.duration:0>n?0:n;1==t.morphColour&&"undefined"!=typeof t.geometry&&(t.morph.material.vertexColors==i.VertexColors&&morphColorsToVertexColors(t.geometry,t.morph,t.clipAction),t.geometry.colorsNeedUpdate=!0)},this.isTimeVarying=function(){return!(!t.timeEnabled&&!t.morphColour)},this.dispose=function(){t.morph&&t.morph.geometry&&t.morph.geometry.dispose(),t.morph&&t.morph.material&&t.morph.material.dispose(),t.geometry=void 0,t.mixer=void 0,t.morph=void 0,t.clipAction=void 0,t.groupName=void 0},this.render=function(n,r){if(1==r){if(t.clipAction&&1==t.timeEnabled)t.mixer.update(n);else{var o=e+n;o>t.duration&&(o-=t.duration),e=o}var a;if(1==t.morphColour&&"undefined"!=typeof t.geometry&&t.morph.material.vertexColors==i.VertexColors)t.clipAction&&1==t.timeEnabled&&(a=t.clipAction),morphColorsToVertexColors(t.geometry,t.morph,a),t.geometry.colorsNeedUpdate=!0}}}},function(t,e,n){"use strict";n.r(e),n.d(e,"LineSegments",(function(){return s}));var i=n(3),r=n(16).Line,o=i.Vector3,a=i.Float32BufferAttribute;function s(t,e){r.call(this,t,e),this.type="LineSegments"}s.prototype=Object.assign(Object.create(r.prototype),{constructor:s,isLineSegments:!0,computeLineDistances:function(){var t=new o,e=new o;return function(){var n=this.geometry;if(n.isBufferGeometry)if(null===n.index){for(var i=n.attributes.position,r=[],o=0,s=i.count;o<s;o+=2)t.fromBufferAttribute(i,o),e.fromBufferAttribute(i,o+1),r[o]=0==o?0:r[o-1],r[o+1]=r[o]+t.distanceTo(e);n.addAttribute("lineDistance",new a(r,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(n.isGeometry){var c=n.vertices;for(r=n.lineDistances,o=0,s=c.length;o<s;o+=2)t.copy(c[o]),e.copy(c[o+1]),r[o]=0==o?0:r[o-1],r[o+1]=r[o]+t.distanceTo(e)}return this}}()})},function(t,e,n){"use strict";n.r(e),n.d(e,"Line",(function(){return p}));var i=n(3),r=i.Sphere,o=i.Ray,a=i.Matrix4,s=i.Object3D,c=i.Vector3,l=i.LineBasicMaterial,u=i.BufferGeometry,h=i.Float32BufferAttribute;function p(t,e,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),s.call(this),this.type="Line",this.geometry=void 0===t?new u:t,this.material=void 0===e?new l({color:16777215*Math.random()}):e,this.updateMorphTargets()}p.prototype=Object.assign(Object.create(s.prototype),{constructor:p,isLine:!0,computeLineDistances:function(){var t=new c,e=new c;return function(){var n=this.geometry;if(n.isBufferGeometry)if(null===n.index){for(var i=n.attributes.position,r=[0],o=1,a=i.count;o<a;o++)t.fromBufferAttribute(i,o-1),e.fromBufferAttribute(i,o),r[o]=r[o-1],r[o]+=t.distanceTo(e);n.addAttribute("lineDistance",new h(r,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(n.isGeometry){var s=n.vertices;r=n.lineDistances;r[0]=0;for(o=1,a=s.length;o<a;o++)r[o]=r[o-1],r[o]+=s[o-1].distanceTo(s[o])}return this}}(),copy:function(t){return s.prototype.copy.call(this,t),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this},updateMorphTargets:function(){var t,e,n,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,o=Object.keys(r);if(0<o.length){var a=r[o[0]];if(void 0!==a)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=a.length;t<e;t++)n=a[t].name||t+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}else{var s=i.morphTargets;void 0!==s&&0<s.length&&console.error("THREE.Line.updateMorphTargets() does not supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(){function t(t,e,n,i,r,o){s.fromBufferAttribute(n,r),l.fromBufferAttribute(n,o);var a=t.morphTargetInfluences;if(e.morphTargets&&i&&a){u.set(0,0,0),h.set(0,0,0);for(var c=0,f=i.length;c<f;c++){var m=a[c],g=i[c];0===m||(p.fromBufferAttribute(g,r),d.fromBufferAttribute(g,o),u.addScaledVector(p.sub(s),m),h.addScaledVector(d.sub(l),m))}s.add(u),l.add(h)}}var e=new a,n=new o,i=new r,s=new c,l=new c,u=new c,h=new c,p=new c,d=new c;return function(r,o){var a=r.linePrecision,u=this.geometry,h=this.material,p=this.matrixWorld;if(null===u.boundingSphere&&u.computeBoundingSphere(),i.copy(u.boundingSphere),i.applyMatrix4(p),i.radius+=a,!1!==r.ray.intersectsSphere(i)){e.getInverse(p),n.copy(r.ray).applyMatrix4(e);var d=a/((this.scale.x+this.scale.y+this.scale.z)/3),f=d*d,m=new c,g=new c,v=this&&this.isLineSegments?2:1;if(u.isBufferGeometry){var y=u.index,b=u.attributes.position,x=u.morphAttributes.position;if(null!==y)for(var w=y.array,_=0,M=w.length-1;_<M;_+=v){var T=w[_],S=w[_+1];t(this,h,b,x,T,S);var E=n.distanceSqToSegment(s,l,g,m);if(!(E>f)){g.applyMatrix4(this.matrixWorld);var A=r.ray.origin.distanceTo(g);A<r.near||A>r.far||o.push({distance:A,point:m.clone().applyMatrix4(this.matrixWorld),index:_,face:null,faceIndex:null,object:this})}}else for(_=0,M=b.count-1;_<M;_+=v){t(this,h,b,x,_,_+1);E=n.distanceSqToSegment(s,l,g,m);if(!(E>f)){g.applyMatrix4(this.matrixWorld);A=r.ray.origin.distanceTo(g);A<r.near||A>r.far||o.push({distance:A,point:m.clone().applyMatrix4(this.matrixWorld),index:_,face:null,faceIndex:null,object:this})}}}else if(u.isGeometry){var C=u.vertices,L=C.length;for(_=0;_<L-1;_+=v)if(E=n.distanceSqToSegment(C[_],C[_+1],g,m),!(E>f)){g.applyMatrix4(this.matrixWorld);A=r.ray.origin.distanceTo(g);A<r.near||A>r.far||o.push({distance:A,point:m.clone().applyMatrix4(this.matrixWorld),index:_,face:null,faceIndex:null,object:this})}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}})},function(t,e,n){var r=n(3);e.Renderer=function(t){var e=this,o=t,a=void 0,s=void 0,c=new r.Clock;this.playAnimation=!0;var l=500,u=[],h=0,p=void 0,d=void 0,f=void 0,m=void 0,g=[],v=[],y=new r.Group,b=void 0,x=[0,0],w=[0,0];this.getDrawingWidth=function(){return o?o.clientWidth:b?"undefined"==typeof b.clientWidth?Math.round(b.width):Math.round(b.clientWidth):0},this.getDrawingHeight=function(){return o?o.clientHeight:b?"undefined"==typeof b.clientHeight?Math.round(b.height):Math.round(b.clientHeight):0},this.onWindowResize=function(){s.onWindowResize();var t=e.getDrawingWidth(),n=e.getDrawingHeight();if(null!=a){var i;o?(i=o.getBoundingClientRect(),a.setSize(t,n)):b&&("undefined"==typeof b.getBoundingClientRect?a.setSize(t,n,!1):(i=b.getBoundingClientRect(),b.width=t,b.height=n,a.setSize(t,n,!1))),i&&(w[0]=i.left,w[1]=i.top);var c=new r.Vector2;a.getSize(c),x[0]=c.x,x[1]=c.y}};var _=function(){var t=e.getDrawingWidth(),n=e.getDrawingHeight(),i=void 0,r=0,a=0;o?i=o.getBoundingClientRect():b&&"undefined"!=typeof b.getBoundingClientRect&&(i=b.getBoundingClientRect()),i&&(r=i.left,a=i.top),(x[0]!=t||x[1]!=n||r!=w[0]||a!=w[1])&&e.onWindowResize()};this.initialiseVisualisation=function(t){if(t=t||{},void 0===t.antialias){var n=!1;try{/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&(n=!0)}catch(s){n=!1}t.antialias=!n}t.canvas&&(o=void 0,b=t.canvas),a=new r.WebGLRenderer(t),void 0!==o&&o.appendChild(a.domElement),a.setClearColor(16777215,1),b&&b.style&&(b.style.height="100%",b.style.width="100%");var i=e.createScene("default");e.setCurrentScene(i)},this.getCurrentScene=function(){return s},this.setCurrentScene=function(t){if(t){e.removeActiveScene(t);var n=s;s=t,n&&n.setInteractiveControlEnable(!1),s.setInteractiveControlEnable(!0),s.setAdditionalScenesGroup(y),e.onWindowResize()}},this.getSceneByName=function(t){return g[t]},this.createScene=function(t){var e;if(null==g[t])return e=b?new(n(18).Scene)(b,a):new(n(18).Scene)(o,a),g[t]=e,e.sceneName=t,e},this.resetView=function(){s.resetView()},this.viewAll=function(){if(s){var t=s.getBoundingBox();if(t){for(i=0;i<v.length;i++){var e=v[i].getBoundingBox();e&&t.union(e)}s.viewAllWithBoundingBox(t)}}},this.loadModelsURL=function(t,e,n,i,r,o){s.loadModelsURL(t,e,n,i,r,o)},this.loadViewURL=function(t){s.loadViewURL(t)},this.loadFromViewURL=function(t,e){s.loadFromViewURL(t,e)},this.addZincGeometry=function(t,e,n,i,r,o,a,c){return s.addZincGeometry(t,e,n,i,r,o,a,c)},this.updateDirectionalLight=function(){s.updateDirectionalLight()},this.stopAnimate=function(){cancelAnimationFrame(p),p=void 0},this.animate=function(){p=requestAnimationFrame(e.animate),e.render()},Date.now(),this.addPreRenderCallbackFunction=function(t){return++h,u[h]=t,h},this.removePreRenderCallbackFunction=function(t){t in u&&delete u[t]},this.getPlayRate=function(){return l},this.setPlayRate=function(t){l=t},this.getCurrentTime=function(){return s.getCurrentTime()},this.setMorphsTime=function(t){s.setMorphsTime(t)},this.getZincGeometryByID=function(t){return s.getZincGeometryByID(t)},this.addToScene=function(t){s.addObject(t)},this.addToOrthoScene=function(t){if(null==f&&(f=new r.Scene),null==d){var n=e.getDrawingWidth(),i=e.getDrawingHeight();d=new r.OrthographicCamera(-n/2,n/2,i/2,-i/2,1,10),d.position.z=10}f.add(t)};var M=function(t){return function(n){n.needsUpdate=!0;var i=new r.SpriteMaterial({map:n}),o=i.map.image.width,a=i.map.image.height;t.material=i,t.scale.set(o,a,1);var s=e.getDrawingWidth(),c=e.getDrawingHeight();t.position.set((s-o)/2,(-c+a)/2,1),e.addToOrthoScene(t)}};this.addLogo=function(){m=new r.Sprite,r.ImageUtils.loadTexture("images/abi_big_logo_transparent_small.png",void 0,M(m))},this.render=function(){_();var t=c.getDelta();for(s.renderGeometries(l,t,e.playAnimation),i=0;i<v.length;i++){var n=v[i];n.renderGeometries(l,t,e.playAnimation)}for(key in null!=d&&null!=f&&(a.clearDepth(),a.render(f,d)),u)u.hasOwnProperty(key)&&u[key].call();s.render(a)},this.getThreeJSRenderer=function(){return a},this.isSceneActive=function(t){if(s===t)return!0;for(i=0;i<v.length;i++){var e=v[i];if(e===t)return!0}return!1},this.addActiveScene=function(t){e.isSceneActive(t)||(v.push(t),y.add(t.getThreeJSScene()))},this.removeActiveScene=function(t){for(i=0;i<v.length;i++){var e=v[i];if(e===t)return v.splice(i,1),void y.remove(t.getThreeJSScene())}},this.clearAllActiveScene=function(){for(var t=0;t<v.length;t++)y.remove(v[t].getThreeJSScene());v.splice(0,v.length)},this.dispose=function(){for(var t in g)g.hasOwnProperty(t)&&g[t].clearAll();g=[],v=[],y=new r.Group,e.stopAnimate(),u=[],h=0,d=void 0,f=void 0,m=void 0;var n=e.createScene("default");e.setCurrentScene(n)},this.transitionScene=function(t,e){if(s){var n=s.getZincCameraControls(),i=t.getBoundingBox();if(i){var r=i.min.distanceTo(i.max)/2,o=(i.min.x+i.max.x)/2,a=(i.min.y+i.max.y)/2,c=(i.min.z+i.max.z)/2,l=n.getViewportFromCentreAndRadius(o,a,c,r,40,4*r),u=n.getCurrentViewport();n.cameraTransition(u,l,e),n.enableCameraTransition()}}}}},function(t,e,n){var r=n(3),o=n(4).resolveURL,a=n(9).JSONLoader,s=n(19).STLLoader,c=n(20).OBJLoader;e.Scene=function(t,e){var l=this,u=t,h=[],p=[],d=[],f=[],m=void 0,g=new r.Scene;this.directionalLight=void 0,this.ambient=void 0,this.camera=void 0;var v=3e3,y=void 0,b=0,x=1e3;this.sceneName=void 0,this.progressMap=[];var w=!1,_=!1,M=void 0;this.autoClearFlag=!0;var T=function(){return u?"undefined"==typeof u.clientWidth?u.width:u.clientWidth:0},S=function(){return u?"undefined"==typeof u.clientHeight?u.height:u.clientHeight:0};this.getDownloadProgress=function(){var t=0,e=0,n=!1;for(var i in l.progressMap){var r=l.progressMap[i];t+=r[1],e+=r[0],0==r[1]&&(n=!0)}return n&&(t=0),[t,e,w]},this.onProgress=function(t){return function(e){l.progressMap[t]=[e.loaded,e.total]}},this.onError=function(){--b,w=!0},this.onWindowResize=function(){y.onResize(),l.camera.aspect=T()/S(),l.camera.updateProjectionMatrix()},this.resetView=function(){l.onWindowResize(),y.resetView()};var E=function(){l.camera=new r.PerspectiveCamera(40,T()/S(),0,10),l.ambient=new r.AmbientLight(2105376),g.add(l.ambient),l.directionalLight=new r.DirectionalLight(7829367),g.add(l.directionalLight),y=new(n(21).CameraControls)(l.camera,e.domElement,e,g),y.setDirectionalLight(l.directionalLight),y.resetView()};E();var A=function(){for(var t=!0;1==t;){x++,t=!1;for(var e=0;e<h.length;e++)h[e].modelId==x&&(t=!0)}return x};this.loadView=function(t){var e=t.nearPlane,i=t.farPlane,r=t.eyePosition,o=t.targetPosition,a=t.upVector,s=new(n(21).Viewport);s.nearPlane=e,s.farPlane=i,s.eyePosition=r,s.targetPosition=o,s.upVector=a,y.setDefaultCameraSettings(s),y.resetView()},this.getBoundingBox=function(){for(var t=void 0,e=void 0,n=0;n<h.length;n++)e=h[n].getBoundingBox(),null==t?t=e:t.union(e);for(var i=0;i<p.length;i++)e=p[i].getBoundingBox(),null==t?t=e:t.union(e);for(var r=0;r<d.length;r++)e=d[r].getBoundingBox(),null==t?t=e:t.union(e);for(var o=0;o<f.length;o++)e=f[o].getBoundingBox(),null==t?t=e:t.union(e);return t},this.viewAllWithBoundingBox=function(t){if(t){var e=t.min.distanceTo(t.max)/2,n=(t.min.x+t.max.x)/2,i=(t.min.y+t.max.y)/2,r=(t.min.z+t.max.z)/2,o=y.getViewportFromCentreAndRadius(n,i,r,e,40,4*e);y.setCurrentCameraSettings(o)}},this.viewAll=function(){var t=l.getBoundingBox();l.viewAllWithBoundingBox(t)},this.forEachGeometry=function(t){for(var e=h.length-1;0<=e;e--)t(h[e])},this.forEachGlyphset=function(t){for(var e=p.length-1;0<=e;e--)t(p[e])},this.forEachPointset=function(t){for(var e=d.length-1;0<=e;e--)t(d[e])},this.forEachLine=function(t){for(var e=f.length-1;0<=e;e--)t(f[e])},this.findGeometriesWithGroupName=function(t){for(var e=[],n=0;n<h.length;n++)h[n].groupName==t&&e.push(h[n]);return e},this.findPointsetsWithGroupName=function(t){for(var e=[],n=0;n<d.length;n++)d[n].groupName==t&&e.push(d[n]);return e},this.findGlyphsetsWithGroupName=function(t){for(var e=[],n=0;n<p.length;n++)p[n].groupName==t&&e.push(p[n]);return e},this.findLinesWithGroupName=function(t){for(var e=[],n=0;n<f.length;n++)f[n].groupName==t&&e.push(f[n]);return e},this.addGlyphset=function(t){if(t&&t.isGlyphset){var e=t.getGroup();g.add(e),p.push(t)}};var C=function(t,e,i,r){var a=new(n(8).Glyphset);a.duration=3e3,a.load(t,o(e),r),a.groupName=i,l.addGlyphset(a)},L=function(t,e,n,i){return function(){if(4==t.readyState&&200==t.status){var r=JSON.parse(t.responseText);C(r,e,n,i)}}};this.loadGlyphsetURL=function(t,e,n,i){var r=new XMLHttpRequest;r.onreadystatechange=L(r,e,n,i),r.open("GET",o(t),!0),r.send()};var P=function(t,e,i,o){return function(a,s){var c=new(n(11).Pointset),l=new r.PointsMaterial({alphaTest:.5,size:5,sizeAttenuation:!1});s&&s[0]&&(1>s[0].opacity&&(l.transparent=!0),l.opacity=s[0].opacity,l.color=s[0].color,l.morphTargets=t,l.vertexColors=s[0].vertexColors);var u={};u.localTimeEnabled=t,u.localMorphColour=e,c.createMesh(a,l,u),c&&(c.setName(i),g.add(c.morph),d.push(c)),null!=o&&"function"==typeof o&&o(c)}},R=function(t,e,i,o){return function(a,s){var c=new(n(14).Lines),l=void 0;s&&s[0]&&(l=new r.LineBasicMaterial({color:s[0].color.clone()}),1>s[0].opacity&&(l.transparent=!0),l.opacity=s[0].opacity,l.morphTargets=t,l.vertexColors=s[0].vertexColors);var u={};u.localTimeEnabled=t,u.localMorphColour=e,c.createLineSegment(a,l,u),c&&(c.setName(i),g.add(c.morph),f.push(c)),null!=o&&"function"==typeof o&&o(c)}};this.loadPointsetURL=function(t,e,n,r,o){var s=0;b+=1,null!=e&&(s=!!e);var c=0;null!=n&&(c=!!n);var u=new a;u.crossOrigin="Anonymous",u.load(t,P(s,c,r,o),l.onProgress(i),l.onError)},this.loadLinesURL=function(t,e,n,r,o){var s=0;b+=1,null!=e&&(s=!!e);var c=0;null!=n&&(c=!!n);var u=new a;u.crossOrigin="Anonymous",u.load(t,R(s,c,r,o),l.onProgress(i),l.onError)};var O=function(t,e,r,o,u,h){b+=1;var p=A(),d=n(0).defaultMaterialColor,f=n(0).defaultOpacity,m=0;null!=e&&(m=!!e);var g=0;null!=r&&(g=!!r);var v=new a;if(void 0!==u)if("STL"==u)v=new s;else if("OBJ"==u)return v=new c,v.crossOrigin="Anonymous",void v.load(t,z(p,d,f,m,g,o,h),l.onProgress(i),l.onError);v.crossOrigin="Anonymous",v.load(t,B(p,d,f,m,g,o,h),l.onProgress(i),l.onError)},D=function(t,e,n){var i=0;return function(r){++i,null!=e&&"function"==typeof e&&e(r),i==t&&null!=n&&"function"==typeof n&&n()}},N=function(t,e,n){if(e){var i=e.URL;if(t&&(i=new URL(e.URL,t).href),"Surfaces"==e.Type)O(i,e.MorphVertices,e.MorphColours,e.GroupName,e.FileFormat,n);else if("Glyph"==e.Type){var r=e.GlyphGeometriesURL;t&&(r=new URL(e.GlyphGeometriesURL,t).href),l.loadGlyphsetURL(i,r,e.GroupName,n)}else"Points"==e.Type?l.loadPointsetURL(i,e.MorphVertices,e.MorphColours,e.GroupName,n):"Lines"==e.Type?l.loadLinesURL(i,e.MorphVertices,e.MorphColours,e.GroupName,n):"View"==e.Type&&l.loadViewURL(i)}};this.loadSTL=function(t,e,i){b+=1;var r=A(),a=n(0).defaultMaterialColor,c=n(0).defaultOpacity,l=new s;l.crossOrigin="Anonymous",l.load(o(t),B(r,a,c,!1,!1,e,i))},this.loadOBJ=function(t,e,i){b+=1;var r=A(),a=n(0).defaultMaterialColor,s=n(0).defaultOpacity,l=new c;l.crossOrigin="Anonymous",l.load(o(t),B(r,a,s,!1,!1,e,i))},this.loadMetadataURL=function(t,e,n){var i=new XMLHttpRequest,r=o(t);i.onreadystatechange=function(){if(4==i.readyState&&200==i.status){var t=i.responseURL;void 0===t&&(t=new URL(r).href);for(var o=JSON.parse(i.responseText),a=o.length,s=0;s<o.length;s++)o[s]&&"View"==o[s].Type&&--a;var c=new D(a,e,n);for(s=0;s<o.length;s++)N(t,o[s],c)}},i.open("GET",r,!0),i.send()},this.loadModelsURL=function(t,e,i,r,s,c){var u=t.length;b+=u;for(var h=0;h<u;h++){var p=A(),d=t[h],f=new a,m=n(0).defaultMaterialColor,g=n(0).defaultOpacity;null!=e&&null!=e[h]&&(m=!!e[h]),null!=i&&null!=i[h]&&(g=i[h]);var v=0;null!=r&&null!=r[h]&&(v=!!r[h]);var y=0;null!=s&&null!=s[h]&&(y=!!s[h]),f.crossOrigin="Anonymous",f.load(o(d),B(p,m,g,v,y,void 0,c),l.onProgress(h),l.onError)}},this.loadViewURL=function(t){var e=new XMLHttpRequest;e.onreadystatechange=function(){if(4==e.readyState&&200==e.status){var t=JSON.parse(e.responseText);l.loadView(t)}},requestURL=o(t),e.open("GET",requestURL,!0),e.send()},this.loadFromViewURL=function(t,e){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4==n.readyState&&200==n.status){var i=JSON.parse(n.responseText);l.loadView(i);for(var r,o=[],a=0;a<i.numberOfResources;a++)r=t+"_"+(a+1)+".json",o.push(r);l.loadModelsURL(o,i.colour,i.opacity,i.timeEnabled,i.morphColour,e)}},requestURL=o(t+"_view.json"),n.open("GET",requestURL,!0),n.send()},this.addGeometry=function(t){t&&t.morph&&(-1===t.modelId&&(b++,t.modelId=A()),g.add(t.morph),h.push(t))};var I=function(t,e,i,r){var o=new(n(2).Geometry);return o.setMesh(t,e,i,r),o},z=function(t,e,n,i,o,a,s){return function(e){b++,e.traverse((function(e){if(e instanceof r.Mesh){var n=I(e,t,i,o);l.addGeometry(n),n.morph&&(n.morph.name=a),n.groupName=a,null!=s&&"function"==typeof s&&s(n)}}))}};this.addZincGeometry=function(t,e,i,r,o,a,s,c,u){var h=new(n(2).Geometry);return h.createMesh(t,u,{modelId:e,colour:i,opacity:r,localTimeEnabled:o,localMorphColour:a}),h.morph?(l.addGeometry(h),null==s&&(s=!0),s&&b++,null!=c&&"function"==typeof c&&c(h),!m&&h.videoHandler&&(m=h.videoHandler),h):void 0};var B=function(t,e,n,i,r,o,a){return function(s,c){var u;c&&c[0]&&(u=c[0]);var h=l.addZincGeometry(s,t,e,n,i,r,!1,void 0,u);h&&h.setName(o),null!=a&&"function"==typeof a&&a(h)}};this.updateDirectionalLight=function(){y.updateDirectionalLight()},this.addObject=function(t){g.add(t)},this.removeObject=function(t){g.remove(t)},this.getCurrentTime=function(){return null==m?null==h[0]?null==d[0]?null==p[0]?null==f[0]?0:f[0].getCurrentTime():p[0].getCurrentTime():d[0].getCurrentTime():h[0].getCurrentTime():m.getCurrentTime(v)},this.setMorphsTime=function(t){null!=m&&m.setMorphTime(t,v);for(var e=0;e<h.length;e++)zincGeometry=h[e],zincGeometry.setMorphTime(t);for(var n=0;n<p.length;n++)zincGlyphset=p[n],zincGlyphset.setMorphTime(t);for(var i=0;i<d.length;i++)zincPointset=d[i],zincPointset.setMorphTime(t);for(var r=0;r<f.length;r++)zincLine=f[r],zincLine.setMorphTime(t)},this.isTimeVarying=function(){for(var t=0;t<h.length;t++)if(h[t].isTimeVarying())return!0;for(var e=0;e<p.length;e++)if(p[e].isTimeVarying())return!0;for(var n=0;n<d.length;n++)if(d[n].isTimeVarying())return!0;for(var i=0;i<f.length;i++)if(f[i].isTimeVarying())return!0;return!(!m||!m.video||m.video.error)},this.getZincGeometryByID=function(t){for(var e=0;e<h.length;e++)if(h[e].modelId==t)return h[e];return null};var k=function(){for(var t=0;t<p.length;t++)if(zincGlyphset=p[t],0==zincGlyphset.ready)return!1;return!0};this.renderGeometries=function(t,e,n){if(m)if(m.isReadyToPlay()){n?m.video.play():m.video.pause();var i=m.video.currentTime/m.getVideoDuration()*3e3;c=h.length+d.length;if(c==b&&k()){y.setTime(i),y.update(0);for(var r=0;r<h.length;r++)h[r].setMorphTime(i),h[r].render(0,n);for(var o=0;o<p.length;o++)p[o].setMorphTime(i),p[o].render(0,n);for(var a=0;a<d.length;a++)d[a].setMorphTime(i),d[a].render(0,n);for(var s=0;s<f.length;s++)f[s].setMorphTime(i),f[s].render(0,n)}else y.update(0)}else myPlayRate=0;else{var c=h.length+d.length+f.length;if(c==b&&k()){y.update(e);for(var l=0;l<h.length;l++)h[l].render(t*e,n);for(var u=0;u<p.length;u++)p[u].render(t*e,n);for(var g=0;g<d.length;g++)d[g].render(t*e,n);for(var v=0;v<f.length;v++)f[v].render(t*e,n)}else y.update(0)}},this.getThreeJSScene=function(){return g},this.setAdditionalScenesGroup=function(t){g.add(t)},this.render=function(t){l.autoClearFlag&&t.clear(),_&&M?M.render(g,l.camera):t.render(g,l.camera)},this.setInteractiveControlEnable=function(t){1==t?y.enable():y.disable()},this.getZincCameraControls=function(){return y},this.getThreeJSScene=function(){return g},this.setDuration=function(t){v=t},this.getDuration=function(){return v},this.setStereoEffectEnable=function(t){1!=t||M||(M=new n(21).StereoEffect(e)),e.setSize(T(),S()),l.camera.updateProjectionMatrix(),_=t},this.objectIsInScene=function(t){for(var e=0;e<h.length;e++)if(t===h[e])return!0;for(var n=0;n<p.length;n++)if(zincObjects===p[n])return!0;for(var i=0;i<d.length;i++)if(t===d[i])return!0;for(var r=0;r<f.length;r++)if(zincObjects===f[r])return!0;return!1},this.alignObjectToCameraView=function(t,e){if(l.objectIsInScene(t)){var n=new r.Vector3,i=t.getBoundingBox(),o=l.getZincCameraControls().getCurrentViewport();i.getCenter(n);var a=new r.Vector3(o.targetPosition[0],o.targetPosition[1],o.targetPosition[2]),s=new r.Vector3(o.eyePosition[0],o.eyePosition[1],o.eyePosition[2]),c=(new r.Vector3(o.upVector[0],o.upVector[1],o.upVector[2]),new r.Vector3),u=new r.Vector3;c.subVectors(a,s).normalize(),u.subVectors(a,n).normalize();var h=new r.Vector3;h.crossVectors(c,u);var p=c.angleTo(u);0<e?(l.getZincCameraControls().rotateCameraTransition(h,p,e),l.getZincCameraControls().enableCameraTransition()):l.getZincCameraControls().rotateAboutLookAtpoint(h,p)}},this.setCameraTargetToObject=function(t){if(l.objectIsInScene(t)){var e=new r.Vector3,n=t.getBoundingBox(),i=l.getZincCameraControls().getCurrentViewport();n.getCenter(e);var o=new r.Vector3(i.targetPosition[0],i.targetPosition[1],i.targetPosition[2]),a=new r.Vector3(i.eyePosition[0],i.eyePosition[1],i.eyePosition[2]),s=new r.Vector3,c=new r.Vector3;s.subVectors(a,o),c.addVectors(e,s),i.eyePosition[0]=c.x,i.eyePosition[1]=c.y,i.eyePosition[2]=c.z,i.targetPosition[0]=e.x,i.targetPosition[1]=e.y,i.targetPosition[2]=e.z,l.getZincCameraControls().setCurrentCameraSettings(i)}},this.isStereoEffectEnable=function(){return _},this.removeZincGeometry=function(t){for(var e=0;e<h.length;e++)if(t===h[e])return g.remove(t.morph),h.splice(e,1),void t.dispose()},this.removeZincGlyphset=function(t){for(var e=0;e<p.length;e++)if(t===p[e])return g.remove(t.getGroup()),p[e].dispose(),void p.splice(e,1)},this.removeZincPointset=function(t){for(var e=0;e<d.length;e++)if(t===d[e])return g.remove(t.morph),d[e].dispose(),void d.splice(e,1)},this.removeZincLine=function(t){for(var e=0;e<f.length;e++)if(t===f[e])return g.remove(t.morph),f[e].dispose(),void f.splice(e,1)},this.clearAll=function(){for(var t=h.length-1;0<=t;t--)g.remove(h[t].morph),h[t].dispose();h=[];for(var e=p.length-1;0<=e;e--)g.remove(p[e].getGroup()),p[e].dispose();p=[];for(var n=d.length-1;0<=n;n--)g.remove(d[n].morph),d[n].dispose();d=[];for(var i=f.length-1;0<=i;i--)g.remove(f[i].morph),f[i].dispose();f=[]}}},function(t,e,n){"use strict";n.r(e),n.d(e,"STLLoader",(function(){return r}));var i=n(3);function r(t){this.manager=void 0===t?i.DefaultLoadingManager:t}r.prototype={constructor:r,load:function(t,e,n,r){var o=this,a=new i.FileLoader(o.manager);a.setResponseType("arraybuffer"),a.load(t,(function(t){try{e(o.parse(t))}catch(n){r&&r(n)}}),n,r)},parse:function(t){var e=function(t){if("string"==typeof t){for(var e=new Uint8Array(t.length),n=0;n<t.length;n++)e[n]=255&t.charCodeAt(n);return e.buffer||e}return t}(t);return function(t){var e,n,i,r;if(r=new DataView(t),n=50,i=r.getUint32(80,!0),e=84+i*n,e===r.byteLength)return!0;for(var o=[115,111,108,105,100],a=0;5>a;a++)if(o[a]!=r.getUint8(a,!1))return!0;return!1}(e)?function(t){for(var e,n,r,o,a,s,c,l,u=new DataView(t),h=u.getUint32(80,!0),p=!1,d=0;d<70;d++)1129270351==u.getUint32(d,!1)&&82==u.getUint8(d+4)&&61==u.getUint8(d+5)&&(p=!0,o=[],a=u.getUint8(d+6)/255,s=u.getUint8(d+7)/255,c=u.getUint8(d+8)/255,l=u.getUint8(d+9)/255);for(var f=new i.BufferGeometry,m=[],g=[],v=0;v<h;v++){var y=84+50*v,b=u.getFloat32(y,!0),x=u.getFloat32(y+4,!0),w=u.getFloat32(y+8,!0);if(p){var _=u.getUint16(y+48,!0);0==(32768&_)?(e=(31&_)/31,n=(31&_>>5)/31,r=(31&_>>10)/31):(e=a,n=s,r=c)}for(var M,T=1;3>=T;T++)M=y+12*T,m.push(u.getFloat32(M,!0)),m.push(u.getFloat32(M+4,!0)),m.push(u.getFloat32(M+8,!0)),g.push(b,x,w),p&&o.push(e,n,r)}return f.addAttribute("position",new i.BufferAttribute(new Float32Array(m),3)),f.addAttribute("normal",new i.BufferAttribute(new Float32Array(g),3)),p&&(f.addAttribute("color",new i.BufferAttribute(new Float32Array(o),3)),f.hasColors=!0,f.alpha=l),f}(e):function(t){for(var e,n=new i.BufferGeometry,r=/facet([\s\S]*?)endfacet/g,o=0,a=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,s=new RegExp("vertex"+a+a+a,"g"),c=new RegExp("normal"+a+a+a,"g"),l=[],u=[],h=new i.Vector3;null!==(e=r.exec(t));){for(var p=0,d=0,f=e[0];null!==(e=c.exec(f));)h.x=parseFloat(e[1]),h.y=parseFloat(e[2]),h.z=parseFloat(e[3]),d++;for(;null!==(e=s.exec(f));)l.push(parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3])),u.push(h.x,h.y,h.z),p++;1!==d&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+o),3!==p&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+o),o++}return n.addAttribute("position",new i.Float32BufferAttribute(l,3)),n.addAttribute("normal",new i.Float32BufferAttribute(u,3)),n}(function(t){return"string"==typeof t?t:i.LoaderUtils.decodeText(new Uint8Array(t))}(t))}}},function(t,e,n){"use strict";n.r(e),n.d(e,"OBJLoader",(function(){return r}));var i=n(3),r=function(){function t(){var t={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materialLibraries:[],startObject:function(t,e){if(this.object&&!1===this.object.fromDeclaration)return this.object.name=t,void(this.object.fromDeclaration=!1!==e);var n=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object={name:t||"",fromDeclaration:!1!==e,geometry:{vertices:[],normals:[],colors:[],uvs:[]},materials:[],smooth:!0,startMaterial:function(t,e){var n=this._finalize(!1);n&&(n.inherited||0>=n.groupCount)&&this.materials.splice(n.index,1);var i={index:this.materials.length,name:t||"",mtllib:Array.isArray(e)&&0<e.length?e[e.length-1]:"",smooth:void 0===n?this.smooth:n.smooth,groupStart:void 0===n?0:n.groupEnd,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(t){var e={index:"number"==typeof t?t:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return e.clone=this.clone.bind(e),e}};return this.materials.push(i),i},currentMaterial:function(){return 0<this.materials.length?this.materials[this.materials.length-1]:void 0},_finalize:function(t){var e=this.currentMaterial();if(e&&-1===e.groupEnd&&(e.groupEnd=this.geometry.vertices.length/3,e.groupCount=e.groupEnd-e.groupStart,e.inherited=!1),t&&1<this.materials.length)for(var n=this.materials.length-1;0<=n;n--)0>=this.materials[n].groupCount&&this.materials.splice(n,1);return t&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),e}},n&&n.name&&"function"==typeof n.clone){var i=n.clone(0);i.inherited=!0,this.object.materials.push(i)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(t,e){var n=parseInt(t,10);return 3*(0<=n?n-1:n+e/3)},parseNormalIndex:function(t,e){var n=parseInt(t,10);return 3*(0<=n?n-1:n+e/3)},parseUVIndex:function(t,e){var n=parseInt(t,10);return 2*(0<=n?n-1:n+e/2)},addVertex:function(t,e,n){var i=this.vertices,r=this.object.geometry.vertices;r.push(i[t+0],i[t+1],i[t+2]),r.push(i[e+0],i[e+1],i[e+2]),r.push(i[n+0],i[n+1],i[n+2])},addVertexPoint:function(t){var e=this.vertices,n=this.object.geometry.vertices;n.push(e[t+0],e[t+1],e[t+2])},addVertexLine:function(t){var e=this.vertices,n=this.object.geometry.vertices;n.push(e[t+0],e[t+1],e[t+2])},addNormal:function(t,e,n){var i=this.normals,r=this.object.geometry.normals;r.push(i[t+0],i[t+1],i[t+2]),r.push(i[e+0],i[e+1],i[e+2]),r.push(i[n+0],i[n+1],i[n+2])},addColor:function(t,e,n){var i=this.colors,r=this.object.geometry.colors;r.push(i[t+0],i[t+1],i[t+2]),r.push(i[e+0],i[e+1],i[e+2]),r.push(i[n+0],i[n+1],i[n+2])},addUV:function(t,e,n){var i=this.uvs,r=this.object.geometry.uvs;r.push(i[t+0],i[t+1]),r.push(i[e+0],i[e+1]),r.push(i[n+0],i[n+1])},addUVLine:function(t){var e=this.uvs,n=this.object.geometry.uvs;n.push(e[t+0],e[t+1])},addFace:function(t,e,n,i,r,o,a,s,c){var l=this.vertices.length,u=this.parseVertexIndex(t,l),h=this.parseVertexIndex(e,l),p=this.parseVertexIndex(n,l);if(this.addVertex(u,h,p),void 0!==i&&""!==i){var d=this.uvs.length;u=this.parseUVIndex(i,d),h=this.parseUVIndex(r,d),p=this.parseUVIndex(o,d),this.addUV(u,h,p)}if(void 0!==a&&""!==a){var f=this.normals.length;u=this.parseNormalIndex(a,f),h=a===s?u:this.parseNormalIndex(s,f),p=a===c?u:this.parseNormalIndex(c,f),this.addNormal(u,h,p)}0<this.colors.length&&this.addColor(u,h,p)},addPointGeometry:function(t){this.object.geometry.type="Points";for(var e=this.vertices.length,n=0,i=t.length;n<i;n++)this.addVertexPoint(this.parseVertexIndex(t[n],e))},addLineGeometry:function(t,e){this.object.geometry.type="Line";for(var n=this.vertices.length,i=this.uvs.length,r=0,o=t.length;r<o;r++)this.addVertexLine(this.parseVertexIndex(t[r],n));var a=0;for(o=e.length;a<o;a++)this.addUVLine(this.parseUVIndex(e[a],i))}};return t.startObject("",!1),t}function e(t){this.manager=void 0===t?i.DefaultLoadingManager:t,this.materials=null}var n=/^[og]\s*(.+)?/,r=/^mtllib /,o=/^usemtl /;return e.prototype={constructor:e,load:function(t,e,n,r){var o=this,a=new i.FileLoader(o.manager);a.setPath(this.path),a.load(t,(function(t){e(o.parse(t))}),n,r)},setPath:function(t){return this.path=t,this},setMaterials:function(t){return this.materials=t,this},parse:function(e){console.time("OBJLoader");var a=new t;-1!==e.indexOf("\r\n")&&(e=e.replace(/\r\n/g,"\n")),-1!==e.indexOf("\\\n")&&(e=e.replace(/\\\n/g,""));for(var s=e.split("\n"),c="",l="",u=0,h=[],p="function"==typeof"".trimLeft,d=0,f=s.length;d<f;d++)if(c=s[d],c=p?c.trimLeft():c.trim(),u=c.length,0!==u&&(l=c.charAt(0),"#"!==l))if("v"===l){var m=c.split(/\s+/);switch(m[0]){case"v":a.vertices.push(parseFloat(m[1]),parseFloat(m[2]),parseFloat(m[3])),8===m.length&&a.colors.push(parseFloat(m[4]),parseFloat(m[5]),parseFloat(m[6]));break;case"vn":a.normals.push(parseFloat(m[1]),parseFloat(m[2]),parseFloat(m[3]));break;case"vt":a.uvs.push(parseFloat(m[1]),parseFloat(m[2]))}}else if("f"===l){for(var g,v=c.substr(1).trim(),y=v.split(/\s+/),b=[],x=0,w=y.length;x<w;x++)if(g=y[x],0<g.length){var _=g.split("/");b.push(_)}var M=b[0];for(x=1,w=b.length-1;x<w;x++){var T=b[x],S=b[x+1];a.addFace(M[0],T[0],S[0],M[1],T[1],S[1],M[2],T[2],S[2])}}else if("l"===l){var E=c.substring(1).trim().split(" "),A=[],C=[];if(-1===c.indexOf("/"))A=E;else for(var L,P=0,R=E.length;P<R;P++)L=E[P].split("/"),""!==L[0]&&A.push(L[0]),""!==L[1]&&C.push(L[1]);a.addLineGeometry(A,C)}else if("p"===l){v=c.substr(1).trim();var O=v.split(" ");a.addPointGeometry(O)}else if(null!==(h=n.exec(c))){var D=(" "+h[0].substr(1).trim()).substr(1);a.startObject(D)}else if(o.test(c))a.object.startMaterial(c.substring(7).trim(),a.materialLibraries);else if(r.test(c))a.materialLibraries.push(c.substring(7).trim());else{if("s"!==l){if("\0"===c)continue;throw new Error('THREE.OBJLoader: Unexpected line: "'+c+'"')}if(h=c.split(" "),1<h.length){var N=h[1].trim().toLowerCase();a.object.smooth="0"!==N&&"off"!==N}else a.object.smooth=!0;var I=a.object.currentMaterial();I&&(I.smooth=a.object.smooth)}a.finalize();var z=new i.Group;z.materialLibraries=[].concat(a.materialLibraries);for(d=0,f=a.objects.length;d<f;d++){var B=a.objects[d],k=B.geometry,H=B.materials,U="Line"===k.type,G="Points"===k.type,F=!1;if(0!==k.vertices.length){var j,V=new i.BufferGeometry;V.addAttribute("position",new i.Float32BufferAttribute(k.vertices,3)),0<k.normals.length?V.addAttribute("normal",new i.Float32BufferAttribute(k.normals,3)):V.computeVertexNormals(),0<k.colors.length&&(F=!0,V.addAttribute("color",new i.Float32BufferAttribute(k.colors,3))),0<k.uvs.length&&V.addAttribute("uv",new i.Float32BufferAttribute(k.uvs,2));for(var W=[],q=0,X=H.length;q<X;q++){var Y=H[q];I=void 0;if(null!==this.materials)if(I=this.materials.create(Y.name),!U||!I||I instanceof i.LineBasicMaterial){if(G&&I&&!(I instanceof i.PointsMaterial)){var J=new i.PointsMaterial({size:10,sizeAttenuation:!1});Z.copy(I),I=J}}else{var Z=new i.LineBasicMaterial;Z.copy(I),Z.lights=!1,I=Z}I||(I=U?new i.LineBasicMaterial:G?new i.PointsMaterial({size:1,sizeAttenuation:!1}):new i.MeshPhongMaterial,I.name=Y.name),I.flatShading=!Y.smooth,I.vertexColors=F?i.VertexColors:i.NoColors,W.push(I)}if(1<W.length){for(q=0,X=H.length;q<X;q++)Y=H[q],V.addGroup(Y.groupStart,Y.groupCount,q);j=U?new i.LineSegments(V,W):G?new i.Points(V,W):new i.Mesh(V,W)}else j=U?new i.LineSegments(V,W[0]):G?new i.Points(V,W[0]):new i.Mesh(V,W[0]);j.name=B.name,z.add(j)}}return console.timeEnd("OBJLoader"),z}},e}()},function(t,e,n){var i=n(3),r=n(4).resolveURL,o=function(){this.nearPlane=.1,this.farPlane=2e3,this.eyePosition=[0,0,0],this.targetPosition=[0,0,0],this.upVector=[0,1,0]},a=function(t,e,n,a){var h=this,p={NONE:-1,DEFAULT:0,PATH:1,SMOOTH_CAMERA_TRANSITION:2,AUTO_TUMBLE:3,ROTATE_TRANSITION:4},d={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM:4,TOUCH_PAN:5,SCROLL:6},f={};f.MAIN=d.ROTATE,f.AUXILIARY=d.PAN,f.SECONDARY=d.ZOOM,this.cameraObject=t,this.domElement=void 0===e?document:e,this.renderer=n,this.scene=a,this.tumble_rate=1.5,this.pointer_x=0,this.pointer_y=0,this.pointer_x_start=0,this.pointer_y_start=0,this.previous_pointer_x=0,this.previous_pointer_y=0,this.near_plane_fly_debt=0,this.touchZoomDistanceStart=0,this.touchZoomDistanceEnd=0,this.directionalLight=0,this.scrollRate=50;var m,g,v=3e3,y=0,b=void 0,x=void 0,w=!1,_=500,M=void 0,T=new o,S=p.DEFAULT,E=void 0,A=void 0,C=void 0,L=0;this._state=d.NONE,this.targetTouchId=-1,void 0===this.cameraObject.target&&(this.cameraObject.target=new i.Vector3(0,0,0)),this.onResize=function(){g&&(g=void 0)},this.setMouseButtonAction=function(t,e){f[t]=d[e]};var P=function(t){void 0===g&&(g=h.domElement.getBoundingClientRect()),0==t.button?h._state=f.MAIN:1==t.button?(t.preventDefault(),h._state=f.AUXILIARY):2==t.button&&(h._state=f.SECONDARY),h.pointer_x=t.clientX-g.left,h.pointer_y=t.clientY-g.top,h.pointer_x_start=h.pointer_x,h.pointer_y_start=h.pointer_y,h.previous_pointer_x=h.pointer_x,h.previous_pointer_y=h.pointer_y},R=function(t){void 0===g&&(g=h.domElement.getBoundingClientRect()),h.pointer_x=t.clientX-g.left,h.pointer_y=t.clientY-g.top,void 0!==m&&m.move(h,t.clientX,t.clientY,h.renderer)},O=function(t){h._state=d.NONE,void 0!==m&&h.pointer_x_start==t.clientX-g.left&&h.pointer_y_start==t.clientY-g.top&&m.pick(h,t.clientX,t.clientY,h.renderer)},D=function(){h._state=d.NONE},N=function(t){void 0===g&&(g=h.domElement.getBoundingClientRect());var e=t.touches.length;if(1==e)h._state=d.TOUCH_ROTATE,h.pointer_x=t.touches[0].clientX-g.left,h.pointer_y=t.touches[0].clientY-g.top,h.pointer_x_start=h.pointer_x,h.pointer_y_start=h.pointer_y,h.previous_pointer_x=h.pointer_x,h.previous_pointer_y=h.pointer_y;else if(2==e){h._state=d.TOUCH_ZOOM;var n=t.touches[0].clientX-t.touches[1].clientX,i=t.touches[0].clientY-t.touches[1].clientY;h.touchZoomDistanceEnd=h.touchZoomDistanceStart=Math.sqrt(n*n+i*i)}else 3==e&&(h._state=d.TOUCH_PAN,h.targetTouchId=t.touches[0].identifier,h.pointer_x=t.touches[0].clientX-g.left,h.pointer_y=t.touches[0].clientY-g.top,h.previous_pointer_x=h.pointer_x,h.previous_pointer_y=h.pointer_y)},I=function(t){t.preventDefault(),t.stopPropagation();var e=t.touches.length;if(1==e)h.pointer_x=t.touches[0].clientX-g.left,h.pointer_y=t.touches[0].clientY-g.top;else if(2==e){if(h._state===d.TOUCH_ZOOM){var n=t.touches[0].clientX-t.touches[1].clientX,i=t.touches[0].clientY-t.touches[1].clientY;h.touchZoomDistanceEnd=Math.sqrt(n*n+i*i)}}else if(3==e&&h._state===d.TOUCH_PAN)for(var r=0;3>r;r++)t.touches[r].identifier==h.targetTouchId&&(h.pointer_x=t.touches[0].clientX-g.left,h.pointer_y=t.touches[0].clientY-g.top)},z=function(t){var e=t.touches.length;h.touchZoomDistanceStart=h.touchZoomDistanceEnd=0,h.targetTouchId=-1,h._state=d.NONE,1==e&&void 0!==m&&h.pointer_x_start==t.touches[0].clientX-g.left&&h.pointer_y_start==t.touches[0].clientY-g.top&&m.pick(h.cameraObject,t.touches[0].clientX,t.touches[0].clientY,h.renderer)},B=function(t){void 0===g&&(g=h.domElement.getBoundingClientRect()),h._state=d.SCROLL;var e=0;0<t.deltaY?e=h.scrollRate:0>t.deltaY&&(e=-1*h.scrollRate),L+=e,t.preventDefault(),t.stopImmediatePropagation()},k=function(){if("undefined"!=typeof h.cameraObject){g.width;var t=g.height,e=h.cameraObject.position.distanceTo(h.cameraObject.target),n=0;h.cameraObject.far>h.cameraObject.near&&e>=h.cameraObject.near&&e<=h.cameraObject.far&&(n=(e-h.cameraObject.near)/(h.cameraObject.far-h.cameraObject.near));var r=new i.Vector3(h.previous_pointer_x,t-h.previous_pointer_y,0),o=new i.Vector3(h.previous_pointer_x,t-h.previous_pointer_y,1),a=new i.Vector3(h.pointer_x,t-h.pointer_y,0),s=new i.Vector3(h.pointer_x,t-h.pointer_y,1);r.unproject(h.cameraObject),o.unproject(h.cameraObject),a.unproject(h.cameraObject),s.unproject(h.cameraObject);var c=.002,l=c*((1-n)*(a.x-r.x)+n*(s.x-o.x)),u=c*((1-n)*(a.y-r.y)+n*(s.y-o.y)),p=c*((1-n)*(a.z-r.z)+n*(s.z-o.z));h.cameraObject.position.set(h.cameraObject.position.x-l,h.cameraObject.position.y-u,h.cameraObject.position.z-p),h.updateDirectionalLight(),h.cameraObject.target.set(h.cameraObject.target.x-l,h.cameraObject.target.y-u,h.cameraObject.target.z-p)}h.previous_pointer_x=h.pointer_x,h.previous_pointer_y=h.pointer_y};this.getVectorsFromRotateAboutLookAtPoints=function(t,e){t.normalize();var n=h.cameraObject.position.clone();n.sub(h.cameraObject.target);var r=n.clone();n.normalize(),.8<Math.abs(n.x*t.x+n.y*t.y+n.z*t.z)&&(n=h.cameraObject.up.clone());var o=new i.Vector3(t.y*n.z-t.z*n.y,t.z*n.x-t.x*n.z,t.x*n.y-t.y*n.x);o.normalize();var a=new i.Vector3(t.y*o.z-t.z*o.y,t.z*o.x-t.x*o.z,t.x*o.y-t.y*o.x),s=t.x*r.x+t.y*r.y+t.z*r.z,c=o.x*r.x+o.y*r.y+o.z*r.z,l=a.x*r.x+a.y*r.y+a.z*r.z,u=t.x*h.cameraObject.up.x+t.y*h.cameraObject.up.y+t.z*h.cameraObject.up.z,p=o.x*h.cameraObject.up.x+o.y*h.cameraObject.up.y+o.z*h.cameraObject.up.z,d=a.x*h.cameraObject.up.x+a.y*h.cameraObject.up.y+a.z*h.cameraObject.up.z,f=Math.cos(e),m=Math.sin(e),g=new i.Vector3(f*o.x+m*a.x,f*o.y+m*a.y,f*o.z+m*a.z),v=new i.Vector3(f*a.x-m*o.x,f*a.y-m*o.y,f*a.z-m*o.z),y=h.cameraObject.target.clone();y.x=y.x+t.x*s+g.x*c+v.x*l,y.y=y.y+t.y*s+g.y*c+v.y*l,y.z=y.z+t.z*s+g.z*c+v.z*l,y=[y.x,y.y,y.z];var b=[t.x*u+g.x*p+v.x*d,t.y*u+g.y*p+v.y*d,t.z*u+g.z*p+v.z*d];return{position:y,up:b}},this.rotateAboutLookAtpoint=function(t,e){var n=h.getVectorsFromRotateAboutLookAtPoints(t,e),i=n.position,r=n.up;h.cameraObject.position.set(i[0],i[1],i[2]),h.updateDirectionalLight(),h.cameraObject.up.set(r[0],r[1],r[2])};var H=function(){if("undefined"!=typeof h.cameraObject){var t=g.width,e=g.height;if(0<t&&0<e){var n=.25*(t+e);delta_x=h.pointer_x-h.previous_pointer_x,delta_y=h.previous_pointer_y-h.pointer_y;var r=Math.sqrt(delta_x*delta_x+delta_y*delta_y);if(0<r){var o=1*-delta_y/r,a=1*delta_x/r,s=o*(h.pointer_x-.5*(t-1))+a*(.5*(e-1)-h.pointer_y);s>n?s=n:s<-n&&(s=-n);var c=Math.acos(s/n)-.5*Math.PI,l=h.tumble_rate*r/n,u=h.cameraObject.position.clone();u.sub(h.cameraObject.target),u.normalize();var p=h.cameraObject.up.clone();p.normalize();var d=p.clone();d.cross(u),d.normalize();var f=[o*d.x+a*p.x,o*d.y+a*p.y,o*d.z+a*p.z],m=new i.Vector3;m.set(Math.sin(c)*u.x+Math.cos(c)*f[0],Math.sin(c)*u.y+Math.cos(c)*f[1],Math.sin(c)*u.z+Math.cos(c)*f[2]),h.rotateAboutLookAtpoint(m,-l)}}}h.previous_pointer_x=h.pointer_x,h.previous_pointer_y=h.pointer_y},U=function(){var t=0;return h._state===d.ZOOM?t=h.previous_pointer_y-h.pointer_y:h._state===d.SCROLL?t=L:(t=-1*(h.touchZoomDistanceEnd-h.touchZoomDistanceStart),h.touchZoomDistanceStart=h.touchZoomDistanceEnd),t},G=function(){if("undefined"!=typeof h.cameraObject){g.width;var t=g.height,e=h.cameraObject.position.clone();e.sub(h.cameraObject.target);var n=U(),i=e.length(),r=1.5*n/t;if(.01<i+r*i){e.normalize();var o=h.cameraObject.position.clone();o.x+=e.x*r*i,o.y+=e.y*r*i,o.z+=e.z*r*i,h.cameraObject.position.set(o.x,o.y,o.z),h.updateDirectionalLight();var a=1e-5;if(a*h.cameraObject.far<h.cameraObject.near+r*i+h.near_plane_fly_debt)0!=h.near_plane_fly_debt&&(h.near_plane_fly_debt+=r*i,0<h.near_plane_fly_debt?(h.cameraObject.near+=h.near_plane_fly_debt,h.cameraObject.far+=h.near_plane_fly_debt,h.near_plane_fly_debt=0):(h.cameraObject.near+=r*i,h.cameraObject.far+=r*i));else{if(0==h.near_plane_fly_debt){var s=h.cameraObject.near-a*h.cameraObject.far;h.cameraObject.near=a*h.cameraObject.far,h.cameraObject.far-=s,h.near_plane_fly_debt-=a*h.cameraObject.far}h.near_plane_fly_debt+=r*i}}}h._state===d.ZOOM&&(h.previous_pointer_x=h.pointer_x,h.previous_pointer_y=h.pointer_y),h._state===d.SCROLL&&(L=0)};this.setDirectionalLight=function(t){h.directionalLight=t},this.updateDirectionalLight=function(){0!=h.directionalLight&&h.directionalLight.position.set(h.cameraObject.position.x,h.cameraObject.position.y,h.cameraObject.position.z)},this.enable=function(){enabled=!0,this.domElement&&this.domElement.addEventListener&&(this.domElement.addEventListener("mousedown",P,!1),this.domElement.addEventListener("mousemove",R,!1),this.domElement.addEventListener("mouseup",O,!1),this.domElement.addEventListener("mouseleave",D,!1),this.domElement.addEventListener("touchstart",N,!1),this.domElement.addEventListener("touchmove",I,!1),this.domElement.addEventListener("touchend",z,!1),this.domElement.addEventListener("wheel",B,!1),this.domElement.addEventListener("contextmenu",(function(t){t.preventDefault()}),!1))},this.disable=function(){enabled=!1,this.domElement&&this.domElement.removeEventListener&&(this.domElement.removeEventListener("mousedown",P,!1),this.domElement.removeEventListener("mousemove",R,!1),this.domElement.removeEventListener("mouseup",O,!1),this.domElement.removeEventListener("mouseleave",D,!1),this.domElement.removeEventListener("touchstart",N,!1),this.domElement.removeEventListener("touchmove",I,!1),this.domElement.removeEventListener("touchend",z,!1),this.domElement.removeEventListener("wheel",B,!1),this.domElement.removeEventListener("contextmenu",(function(t){t.preventDefault()}),!1))},this.loadPath=function(t){b=t.CameraPath,x=t.NumberOfPoints},this.loadPathURL=function(t,e){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4==n.readyState&&200==n.status){var t=JSON.parse(n.responseText);h.loadPath(t),null!=e&&"function"==typeof e&&e()}},requestURL=r(t),n.open("GET",requestURL,!0),n.send()},this.setPathDuration=function(t){v=t},this.getPlayRate=function(){return _},this.setPlayRate=function(t){_=t};var F=function(t){var e=y+t;e>v&&(e-=v),y=e};this.getTime=function(){return y},this.setTime=function(t){y=t>v?v:0>t?0:t},this.getNumberOfTimeFrame=function(){return x},this.getCurrentTimeFrame=function(){if(2<x){var t=y/v*(x-1),e=Math.floor(t),n=Math.ceil(t);return e==n?e==x-1?[e-1,n,0]:[e,n+1,1]:[e,n,1-(t-e)]}return 1==x?[0,0,0]:void 0},this.setCurrentTimeFrame=function(t){2<x&&(y=v*t/(x-1),0>y&&(y=0),y>v&&(y=v))};var j=function(t){if(S===p.PATH&&(F(t),b)){for(var e=h.getCurrentTimeFrame(),n=e[0],i=e[1],r=e[2],o=[b[3*n],b[3*n+1],b[3*n+2]],a=[b[3*i],b[3*i+1],b[3*i+2]],s=[],c=0;c<o.length;c++)s.push(r*o[c]+(1-r)*a[c]);h.cameraObject.position.set(s[0],s[1],s[2]),h.cameraObject.target.set(a[0],a[1],a[2]),M&&h.cameraObject.lookAt(h.cameraObject.target),w&&(h.directionalLight.position.set(s[0],s[1],s[2]),h.directionalLight.target.position.set(a[0],a[1],a[2]))}};this.calculatePathNow=function(){j(0)},this.update=function(t){var e=t*_,n=enabled;S===p.PATH?j(e):S===p.SMOOTH_CAMERA_TRANSITION&&E?(E.update(e),E.isTransitionCompleted()&&(S=p.DEFAULT),n=!1):S===p.ROTATE_CAMERA_TRANSITION&&A?(A.update(e),A.isTransitionCompleted()&&(S=p.DEFAULT),n=!1):S===p.AUTO_TUMBLE&&C&&C.update(e),n&&(h._state===d.ROTATE||h._state===d.TOUCH_ROTATE?H():h._state===d.PAN||h._state===d.TOUCH_PAN?k():(h._state===d.ZOOM||h._state===d.TOUCH_ZOOM||h._state===d.SCROLL)&&G(),h._state!==d.NONE&&S===p.AUTO_TUMBLE&&C&&C.stopOnCameraInput,h._state===d.SCROLL&&(h._state=d.NONE)),M?M.update():h.cameraObject.lookAt(h.cameraObject.target)},this.playPath=function(){S=p.PATH},this.stopPath=function(){S=p.DEFAULT},this.isPlayingPath=function(){return S===p.PATH},this.enableDirectionalLightUpdateWithPath=function(t){w=t},this.enableDeviceOrientation=function(){M||(M=new ModifiedDeviceOrientationControls(h.cameraObject))},this.disableDeviceOrientation=function(){M&&(M.dispose(),M=void 0)},this.isDeviceOrientationEnabled=function(){return!!M},this.resetView=function(){h.cameraObject.near=T.nearPlane,h.cameraObject.far=T.farPlane,h.cameraObject.position.set(T.eyePosition[0],T.eyePosition[1],T.eyePosition[2]),h.cameraObject.target.set(T.targetPosition[0],T.targetPosition[1],T.targetPosition[2]),h.cameraObject.up.set(T.upVector[0],T.upVector[1],T.upVector[2]),h.cameraObject.updateProjectionMatrix(),h.updateDirectionalLight()},this.setDefaultCameraSettings=function(t){t.nearPlane&&(T.nearPlane=t.nearPlane),t.farPlane&&(T.farPlane=t.farPlane),t.eyePosition&&(T.eyePosition=t.eyePosition),t.targetPosition&&(T.targetPosition=t.targetPosition),t.upVector&&(T.upVector=t.upVector)},this.setCurrentCameraSettings=function(t){t.nearPlane&&(h.cameraObject.near=t.nearPlane),t.farPlane&&(h.cameraObject.far=t.farPlane),t.eyePosition&&h.cameraObject.position.set(t.eyePosition[0],t.eyePosition[1],t.eyePosition[2]),t.targetPosition&&h.cameraObject.target.set(t.targetPosition[0],t.targetPosition[1],t.targetPosition[2]),t.upVector&&h.cameraObject.up.set(t.upVector[0],t.upVector[1],t.upVector[2]),h.cameraObject.updateProjectionMatrix(),h.updateDirectionalLight()},this.getViewportFromCentreAndRadius=function(t,e,n,i,r,a){var s=h.cameraObject.position.x-h.cameraObject.target.x,c=h.cameraObject.position.y-h.cameraObject.target.y,l=h.cameraObject.position.z-h.cameraObject.target.z,u=1/Math.sqrt(s*s+c*c+l*l);s*=u,c*=u,l*=u;var p=i/Math.tan(r*Math.PI/360),d=[t+s*p,e+c*p,n+l*p],f=0,m=.95;f=a>m*p?(1-m)*p:p-a;var g=new o;return g.nearPlane=f,g.farPlane=p+a,g.eyePosition=d,g.targetPosition=[t,e,n],g.upVector=[h.cameraObject.up.x,h.cameraObject.up.y,h.cameraObject.up.z],g},this.getDefaultViewport=function(){return T},this.getCurrentViewport=function(){var t=new o;return t.nearPlane=h.cameraObject.near,t.farPlane=h.cameraObject.far,t.eyePosition[0]=h.cameraObject.position.x,t.eyePosition[1]=h.cameraObject.position.y,t.eyePosition[2]=h.cameraObject.position.z,t.targetPosition[0]=h.cameraObject.target.x,t.targetPosition[1]=h.cameraObject.target.y,t.targetPosition[2]=h.cameraObject.target.z,t.upVector[0]=h.cameraObject.up.x,t.upVector[1]=h.cameraObject.up.y,t.upVector[2]=h.cameraObject.up.z,t},this.getDefaultEyePosition=function(){return eyePosition},this.getDefaultTargetPosition=function(){return targetPosition},this.cameraTransition=function(t,e,n){null==A&&(E=new s(t,e,h,n))},this.rotateCameraTransition=function(t,e,n){null==E&&(A=new c(t,e,h,n))},this.enableCameraTransition=function(){E&&(S=p.SMOOTH_CAMERA_TRANSITION),A&&(S=p.ROTATE_CAMERA_TRANSITION)},this.pauseCameraTransition=function(){S=p.DEFAULT},this.stopCameraTransition=function(){S=p.DEFAULT,E=void 0,A=void 0},this.isTransitioningCamera=function(){return S===p.SMOOTH_CAMERA_TRANSITION||S===p.ROTATE_CAMERA_TRANSITION},this.autoTumble=function(t,e,n){C=new u(t,e,n,h)},this.enableAutoTumble=function(){S=p.AUTO_TUMBLE},this.stopAutoTumble=function(){S=p.DEFAULT,C=void 0},this.updateAutoTumble=function(){C&&(C.requireUpdate=!0)},this.isAutoTumble=function(){return S===p.AUTO_TUMBLE},this.enableRaycaster=function(t,e,n){null==m&&(m=new l(t,e,n,h.renderer))},this.disableRaycaster=function(){m.disable(),m=void 0},this.enable()},s=function(t,e,n,i){var r=this,o=t.eyePosition,a=t.targetPosition,s=t.upVector,c=e.eyePosition,l=e.targetPosition,u=e.upVector,h=n,p=i,d=0,f=!1;h.near=Math.min(t.nearPlane,e.nearPlane),h.far=Math.max(t.farPlane,e.farPlane),h.cameraObject.up.set(e.upVector[0],e.upVector[1],e.upVector[2]);var m=function(t){var e=d+t;e>p&&(e=p),d=e},g=function(){var t=d/p,e=[o[0]*(1-t)+c[0]*t,o[1]*(1-t)+c[1]*t,o[2]*(1-t)+c[2]*t],n=[a[0]*(1-t)+l[0]*t,a[1]*(1-t)+l[1]*t,a[2]*(1-t)+l[2]*t];s[0],u[0],s[1],u[1],s[2],u[2];h.cameraObject.position.set(e[0],e[1],e[2]),h.cameraObject.target.set(n[0],n[1],n[2])};this.update=function(t){!1===r.enabled||(m(t),g(),d==p&&(f=!0))},this.isTransitionCompleted=function(){return f}},c=function(t,e,n,i){var r=this,o=i,a=0,s=!1,c=function(i){var r=a,s=a+i;s>o&&(s=o),a=s;var c=a-r;n.rotateAboutLookAtpoint(t,c/o*e)};this.update=function(t){!1===r.enabled||(c(t),a==o&&(s=!0))},this.isTransitionCompleted=function(){return s}},l=function(t,e,n,r){var o=t,a=r,s=e,c=n,l=!0,u=new i.Raycaster;u.linePrecision=.1,u.params.Points.threshold=.1;var h=new i.Vector2;this.enable=function(){enable=!0},this.disable=function(){enable=!1};var p=function(t,e,n){var i=t.domElement.getBoundingClientRect();h.x=(e-i.left)/i.width*2-1,h.y=-(n-i.top)/i.height*2+1;var r=o.getThreeJSScene();return a.render(r,t.cameraObject),u.setFromCamera(h,t.cameraObject),u.intersectObjects(r.children,!0)};this.pick=function(t,e,n){if(l&&a&&o&&t&&s){var i=p(t,e,n);s(i,e,n)}},this.move=function(t,e,n){if(l&&a&&o&&t&&c){var i=p(t,e,n);c(i,e,n)}}},u=function(t,e,n,r){var o=this,a=new i.Vector3,s=r;this.stopOnCameraInput=n,this.requireUpdate=!0;var c=function(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]),n=4*Math.abs(t[0]),r=4*Math.abs(t[1]),o=.25*(n+r),c=-t[1]/e,l=t[0]/e,u=c*t[0]+l*-t[1];u>o?u=o:u<-o&&(u=-o);var h=Math.acos(u/o)-.5*Math.PI,p=new i.Vector3(s.cameraObject.position.x-s.cameraObject.target.x,s.cameraObject.position.y-s.cameraObject.target.y,s.cameraObject.position.z-s.cameraObject.target.z);p.normalize();var d=new i.Vector3(s.cameraObject.up.x,s.cameraObject.up.y,s.cameraObject.up.z);d.normalize();var f=new i.Vector3;f.crossVectors(d,p),f.normalize();var m=new i.Vector3(c*f.x+l*d.x,c*f.y+l*d.y,c*f.z+l*d.z);a.x=Math.sin(h)*p.x+Math.cos(h)*m.x,a.y=Math.sin(h)*p.y+Math.cos(h)*m.y,a.z=Math.sin(h)*p.z+Math.cos(h)*m.z};this.update=function(){!1===o.enabled||(o.requireUpdate&&(c(t),o.requireUpdate=!1),s.rotateAboutLookAtpoint(a,-e))}};StereoCameraZoomFixed=function(){this.type="StereoCamera",this.aspect=1,this.cameraL=new i.PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new i.PerspectiveCamera,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1},Object.assign(StereoCameraZoomFixed.prototype,{update:function(){var t,e,n,r,o,a,s=new i.Matrix4,c=new i.Matrix4;return function(l){var u=t!==l.focus||e!==l.fov||n!==l.aspect*this.aspect||r!==l.near||o!==l.far||a!==l.zoom;if(u){t=l.focus,e=l.fov,n=l.aspect*this.aspect,r=l.near,o=l.far,a=l.zoom;var h,p,d=l.projectionMatrix.clone(),f=.032,m=f*r/t,g=r*Math.tan(i.Math.DEG2RAD*e*.5)/l.zoom;c.elements[12]=-f,s.elements[12]=f,h=-g*n+m,p=g*n+m,d.elements[0]=2*r/(p-h),d.elements[8]=(p+h)/(p-h),this.cameraL.projectionMatrix.copy(d),h=-g*n-m,p=g*n-m,d.elements[0]=2*r/(p-h),d.elements[8]=(p+h)/(p-h),this.cameraR.projectionMatrix.copy(d)}this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(c),this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(s)}}()});var h=function(t){var e=new StereoCameraZoomFixed;e.aspect=.5,this.setSize=function(e,n){t.setSize(e,n)},this.render=function(n,i){n.updateMatrixWorld(),null===i.parent&&i.updateMatrixWorld(),e.update(i);var r=t.getSize();t.setScissorTest(!0),t.clear(),t.setScissor(0,0,r.width/2,r.height),t.setViewport(0,0,r.width/2,r.height),t.render(n,e.cameraL),t.setScissor(r.width/2,0,r.width/2,r.height),t.setViewport(r.width/2,0,r.width/2,r.height),t.render(n,e.cameraR),t.setScissorTest(!1)}};ModifiedDeviceOrientationControls=function(t){var e=this;this.object=t,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0;var n=function(t){e.deviceOrientation=t},r=function(){"undefined"!=typeof window&&(e.screenOrientation=window.orientation||0)},o=function(){var t=new i.Vector3(0,0,1),e=new i.Euler,n=new i.Quaternion,r=new i.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5));return function(o,a,s,c,l){var u=new i.Vector3(0,0,1);u.subVectors(o.target,o.position),e.set(s,a,-c,"YXZ");var h=new i.Quaternion;h.setFromEuler(e),h.multiply(r),h.multiply(n.setFromAxisAngle(t,-l)),u.applyQuaternion(h),u.addVectors(o.position,u),o.lookAt(u)}}();this.connect=function(){r(),"undefined"!=typeof window&&(window.addEventListener("orientationchange",r,!1),window.addEventListener("deviceorientation",n,!1)),e.enabled=!0},this.disconnect=function(){"undefined"!=typeof window&&(window.removeEventListener("orientationchange",r,!1),window.removeEventListener("deviceorientation",n,!1)),e.enabled=!1},this.update=function(){if(!1!==e.enabled){var t=e.deviceOrientation.alpha?i.Math.degToRad(e.deviceOrientation.alpha):0,n=e.deviceOrientation.beta?i.Math.degToRad(e.deviceOrientation.beta):0,r=e.deviceOrientation.gamma?i.Math.degToRad(e.deviceOrientation.gamma):0,a=e.screenOrientation?i.Math.degToRad(e.screenOrientation):0;o(e.object,t,n,r,a)}},this.dispose=function(){this.disconnect()},this.connect()},e.Viewport=o,e.CameraControls=a,e.SmoothCameraTransition=s,e.RotateCameraTransition=c,e.RayCaster=l,e.CameraAutoTumble=u,e.StereoEffect=h},function(t,e,n){var i=n(3),r=n(23)(i),o=n(2).Geometry,a=n(24),s=n(25)["default"],c=i.BufferGeometryLoader,l=function(t){var e;t&&t.isGeometry&&(e=t);var u=void 0,h=void 0,p=!1,d=void 0,f=function(t){var n=e.morph.material.clone();n.morphTargets=!1;var r=new o,a=new c,s=a.parse(t),l=new i.Mesh(s.geometry,n);return r.geometry=l.geometry,r.morph=l,r.morph.userData=r,r},m=function(t){switch(t.data.action){case"message":console.log(t.data.message);break;case"result":var e=new l(f(t.data.object));d&&d(e),d=void 0,p=!1;break;default:throw"Cannot handle specified action."}},g=function(t){if(void 0!==a&&(h=a(26)),h){if(t&&t.isGeometry){var e=t.morph,i=e.geometry.clone().applyMatrix(e.matrix).toJSON();h.addEventListener("message",(function(t){m(t)})),h.postMessage({action:"initialise",object:i})}}else u=new(n(27).GeometryCSGInternal)(t)};this.getHostGeometry=function(){var t=new r(e.morph);return new v(t)},this.getGeometry=function(){return e};var v=function(t){var n=e.morph.material.clone();n.morphTargets=!1;var i=t.toMesh(n),r=new o;return r.geometry=i.geometry,r.morph=i,r.morph.userData=r,r};this.setCSG=function(t){u.setCSG(t)};var y=function(t,e,n,i){if(p)i("On progress");else{var r=t.morph,o=r.geometry.clone().applyMatrix(r.matrix).toJSON();d=n,p=!0,h.postMessage({action:e,object:o})}};this.intersect=function(t){return new s((function(e,n){if(h)y(t,"intersect",e,n);else{var i=u.intersect(t),r=new l(v(i));r.setCSG(i),e(r)}}))},this.subtract=function(t){return new s((function(e,n){if(h)y(t,"intersect",e,n);else{var i=u.subtract(t),r=new l(v(i));r.setCSG(i),e(r)}}))},this.union=function(t){return new s((function(e,n){if(h)y(t,"intersect",e,n);else{var i=u.union(t),r=new l(v(i));r.setCSG(i),e(r)}}))},this.terminateWorker=function(){h&&h.terminate()},g(t)};e.GeometryCSG=l},function(t,e,n){"use strict";function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}var r=1e-5,o=0,a=1,s=2,c=3;t.exports=function(t){var e=function(n){var r,o,a,s,c,l,u,h=[];if(n.isBufferGeometry&&(n=(new t.Geometry).fromBufferGeometry(n)),n instanceof t.Geometry)this.matrix=new t.Matrix4;else{if(!n.isMesh){if(n instanceof e.Node)return this.tree=n,this.matrix=new t.Matrix4,this;throw"ThreeBSP: Given geometry is unsupported"}n.updateMatrix(),this.matrix=n.matrix.clone(),n=n.geometry,n.isBufferGeometry&&(n=(new t.Geometry).fromBufferGeometry(n)),n.mergeVertices(),n.computeVertexNormals(!1)}for(r=0,o=n.faces.length;r<o;r++){if(a=n.faces[r],c=n.faceVertexUvs[0][r],u=new e.Polygon,a instanceof t.Face3)s=n.vertices[a.a],l=c?new t.Vector2(c[0].x,c[0].y):null,s=new e.Vertex(s.x,s.y,s.z,a.vertexNormals[0],l),s.applyMatrix4(this.matrix),u.vertices.push(s),s=n.vertices[a.b],l=c?new t.Vector2(c[1].x,c[1].y):null,s=new e.Vertex(s.x,s.y,s.z,a.vertexNormals[2],l),s.applyMatrix4(this.matrix),u.vertices.push(s),s=n.vertices[a.c],l=c?new t.Vector2(c[2].x,c[2].y):null,s=new e.Vertex(s.x,s.y,s.z,a.vertexNormals[2],l),s.applyMatrix4(this.matrix),u.vertices.push(s);else{if(!i(t.Face4))throw"Invalid face type at index "+r;s=n.vertices[a.a],l=c?new t.Vector2(c[0].x,c[0].y):null,s=new e.Vertex(s.x,s.y,s.z,a.vertexNormals[0],l),s.applyMatrix4(this.matrix),u.vertices.push(s),s=n.vertices[a.b],l=c?new t.Vector2(c[1].x,c[1].y):null,s=new e.Vertex(s.x,s.y,s.z,a.vertexNormals[1],l),s.applyMatrix4(this.matrix),u.vertices.push(s),s=n.vertices[a.c],l=c?new t.Vector2(c[2].x,c[2].y):null,s=new e.Vertex(s.x,s.y,s.z,a.vertexNormals[2],l),s.applyMatrix4(this.matrix),u.vertices.push(s),s=n.vertices[a.d],l=c?new t.Vector2(c[3].x,c[3].y):null,s=new e.Vertex(s.x,s.y,s.z,a.vertexNormals[3],l),s.applyMatrix4(this.matrix),u.vertices.push(s)}u.calculateProperties(),h.push(u)}this.tree=new e.Node(h)};return e.prototype.subtract=function(t){var n=this.tree.clone(),i=t.tree.clone();return n.invert(),n.clipTo(i),i.clipTo(n),i.invert(),i.clipTo(n),i.invert(),n.build(i.allPolygons()),n.invert(),n=new e(n),n.matrix=this.matrix,n},e.prototype.union=function(t){var n=this.tree.clone(),i=t.tree.clone();return n.clipTo(i),i.clipTo(n),i.invert(),i.clipTo(n),i.invert(),n.build(i.allPolygons()),n=new e(n),n.matrix=this.matrix,n},e.prototype.intersect=function(t){var n=this.tree.clone(),i=t.tree.clone();return n.invert(),i.clipTo(n),i.invert(),n.clipTo(i),i.clipTo(n),n.build(i.allPolygons()),n.invert(),n=new e(n),n.matrix=this.matrix,n},e.prototype.toGeometry=function(){var e,n,i,r,o,a,s,c,l,u,h=(new t.Matrix4).getInverse(this.matrix),p=new t.Geometry,d=this.tree.allPolygons(),f=d.length,m={};for(e=0;e<f;e++)for(i=d[e],r=i.vertices.length,n=2;n<r;n++)u=[],c=i.vertices[0],u.push(new t.Vector2(c.uv.x,c.uv.y)),c=new t.Vector3(c.x,c.y,c.z),c.applyMatrix4(h),"undefined"==typeof m[c.x+","+c.y+","+c.z]?(p.vertices.push(c),o=m[c.x+","+c.y+","+c.z]=p.vertices.length-1):o=m[c.x+","+c.y+","+c.z],c=i.vertices[n-1],u.push(new t.Vector2(c.uv.x,c.uv.y)),c=new t.Vector3(c.x,c.y,c.z),c.applyMatrix4(h),"undefined"==typeof m[c.x+","+c.y+","+c.z]?(p.vertices.push(c),a=m[c.x+","+c.y+","+c.z]=p.vertices.length-1):a=m[c.x+","+c.y+","+c.z],c=i.vertices[n],u.push(new t.Vector2(c.uv.x,c.uv.y)),c=new t.Vector3(c.x,c.y,c.z),c.applyMatrix4(h),"undefined"==typeof m[c.x+","+c.y+","+c.z]?(p.vertices.push(c),s=m[c.x+","+c.y+","+c.z]=p.vertices.length-1):s=m[c.x+","+c.y+","+c.z],l=new t.Face3(o,a,s,new t.Vector3(i.normal.x,i.normal.y,i.normal.z)),p.faces.push(l),p.faceVertexUvs[0].push(u);return p},e.prototype.toBufferGeometry=function(){var e=this.toGeometry(),n=(new t.BufferGeometry).fromGeometry(e);return n},e.prototype.toMesh=function(e){var n=this.toBufferGeometry(),i=new t.Mesh(n,e);return i.position.setFromMatrixPosition(this.matrix),i.rotation.setFromRotationMatrix(this.matrix),i},e.Polygon=function(t){t instanceof Array||(t=[]),this.vertices=t,0<t.length?this.calculateProperties():this.normal=this.w=void 0},e.Polygon.prototype.calculateProperties=function(){var t=this.vertices[0],e=this.vertices[1],n=this.vertices[2];return this.normal=e.clone().subtract(t).cross(n.clone().subtract(t)).normalize(),this.w=this.normal.clone().dot(t),this},e.Polygon.prototype.clone=function(){var t,n,i=new e.Polygon;for(t=0,n=this.vertices.length;t<n;t++)i.vertices.push(this.vertices[t].clone());return i.calculateProperties(),i},e.Polygon.prototype.flip=function(){var t,e=[];for(this.normal.multiplyScalar(-1),this.w*=-1,t=this.vertices.length-1;0<=t;t--)e.push(this.vertices[t]);return this.vertices=e,this},e.Polygon.prototype.classifyVertex=function(t){var e=this.normal.dot(t)-this.w;return e<-r?s:e>r?a:o},e.Polygon.prototype.classifySide=function(t){var e,n,i,r=0,l=0,u=t.vertices.length;for(e=0;e<u;e++)n=t.vertices[e],i=this.classifyVertex(n),i===a?r++:i===s&&l++;return 0<r&&0===l?a:0===r&&0<l?s:0===r&&0===l?o:c},e.Polygon.prototype.splitPolygon=function(t,n,i,r,l){var u=this.classifySide(t);if(u===o)(0<this.normal.dot(t.normal)?n:i).push(t);else if(u===a)r.push(t);else if(u===s)l.push(t);else{var h,p,d,f,m,g,v,y,b,x=[],w=[];for(p=0,h=t.vertices.length;p<h;p++)d=(p+1)%h,g=t.vertices[p],v=t.vertices[d],f=this.classifyVertex(g),m=this.classifyVertex(v),f!=s&&x.push(g),f!=a&&w.push(g),(f|m)===c&&(y=(this.w-this.normal.dot(g))/this.normal.dot(v.clone().subtract(g)),b=g.interpolate(v,y),x.push(b),w.push(b));3<=x.length&&r.push(new e.Polygon(x).calculateProperties()),3<=w.length&&l.push(new e.Polygon(w).calculateProperties())}},e.Vertex=function(e,n,i,r,o){this.x=e,this.y=n,this.z=i,this.normal=r||new t.Vector3,this.uv=o||new t.Vector2},e.Vertex.prototype.clone=function(){return new e.Vertex(this.x,this.y,this.z,this.normal.clone(),this.uv.clone())},e.Vertex.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this},e.Vertex.prototype.subtract=function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this},e.Vertex.prototype.multiplyScalar=function(t){return this.x*=t,this.y*=t,this.z*=t,this},e.Vertex.prototype.cross=function(t){var e=this.x,n=this.y,i=this.z;return this.x=n*t.z-i*t.y,this.y=i*t.x-e*t.z,this.z=e*t.y-n*t.x,this},e.Vertex.prototype.normalize=function(){var t=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z);return this.x/=t,this.y/=t,this.z/=t,this},e.Vertex.prototype.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z},e.Vertex.prototype.lerp=function(t,e){return this.add(t.clone().subtract(this).multiplyScalar(e)),this.normal.add(t.normal.clone().sub(this.normal).multiplyScalar(e)),this.uv.add(t.uv.clone().sub(this.uv).multiplyScalar(e)),this},e.Vertex.prototype.interpolate=function(t,e){return this.clone().lerp(t,e)},e.Vertex.prototype.applyMatrix4=function(t){var e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*i+r[12],this.y=r[1]*e+r[5]*n+r[9]*i+r[13],this.z=r[2]*e+r[6]*n+r[10]*i+r[14],this},e.Node=function(t){var n,i,r=[],o=[];if(this.polygons=[],this.front=this.back=void 0,t instanceof Array&&0!==t.length){for(this.divider=t[0].clone(),n=0,i=t.length;n<i;n++)this.divider.splitPolygon(t[n],this.polygons,this.polygons,r,o);0<r.length&&(this.front=new e.Node(r)),0<o.length&&(this.back=new e.Node(o))}},e.Node.isConvex=function(t){var e,n;for(e=0;e<t.length;e++)for(n=0;n<t.length;n++)if(e!==n&&t[e].classifySide(t[n])!==s)return!1;return!0},e.Node.prototype.build=function(t){var n,i,r=[],o=[];for(this.divider||(this.divider=t[0].clone()),n=0,i=t.length;n<i;n++)this.divider.splitPolygon(t[n],this.polygons,this.polygons,r,o);0<r.length&&(!this.front&&(this.front=new e.Node),this.front.build(r)),0<o.length&&(!this.back&&(this.back=new e.Node),this.back.build(o))},e.Node.prototype.allPolygons=function(){var t=this.polygons.slice();return this.front&&(t=t.concat(this.front.allPolygons())),this.back&&(t=t.concat(this.back.allPolygons())),t},e.Node.prototype.clone=function(){var t=new e.Node;return t.divider=this.divider.clone(),t.polygons=this.polygons.map((function(t){return t.clone()})),t.front=this.front&&this.front.clone(),t.back=this.back&&this.back.clone(),t},e.Node.prototype.invert=function(){var t,e,n;for(t=0,e=this.polygons.length;t<e;t++)this.polygons[t].flip();return this.divider.flip(),this.front&&this.front.invert(),this.back&&this.back.invert(),n=this.front,this.front=this.back,this.back=n,this},e.Node.prototype.clipPolygons=function(t){var e,n,i,r;if(!this.divider)return t.slice();for(i=[],r=[],e=0,n=t.length;e<n;e++)this.divider.splitPolygon(t[e],i,r,i,r);return this.front&&(i=this.front.clipPolygons(i)),r=this.back?this.back.clipPolygons(r):[],i.concat(r)},e.Node.prototype.clipTo=function(t){this.polygons=t.clipPolygons(this.polygons),this.front&&this.front.clipTo(t),this.back&&this.back.clipTo(t)},e}},function(t,e){t.exports=n("ae69")},function(t,e){t.exports=n("07f7")},function(t,e,n){var i=n(2).Geometry,r=n(3),o=r.BufferGeometryLoader;t.exports=function(t){var e=void 0,a=function(t){var e=new o,n=e.parse(t),a=new r.MeshPhongMaterial,s=new r.Mesh(n.geometry,a),c=new i;return c.morph=s,c},s=function(i){var r=a(i);e=new(n(27).GeometryCSGInternal)(r),t.postMessage({action:"message",message:"Initialised"})},c=function(n){if(e){var i=a(n),r=e.intersect(i),o=r.toBufferGeometry().toJSON();t.postMessage({action:"result",object:o})}},l=function(n){if(e){var i=a(n),r=e.subtract(i),o=r.toBufferGeometry().toJSON();t.postMessage({action:"result",object:o})}},u=function(n){if(e){var i=a(n),r=e.union(i),o=r.toBufferGeometry().toJSON();t.postMessage({action:"result",object:o})}};t.addEventListener("message",(function(t){switch(t.data.action){case"initialise":s(t.data.object);break;case"intersect":c(t.data.object);break;case"subtract":l(t.data.object);break;case"union":u(t.data.object);break;default:throw"Cannot handle specified action."}}))}},function(t,e,n){var i=n(3),r=n(23)(i),o=(n(2).Geometry,n(22).GeometryCSG,function(t){var e,n;t&&t.isGeometry&&(e=t),this.setGeometry=function(t){t&&t.isGeometry&&(e=t),n=void 0},this.setCSG=function(t){n=t};var i=function(t){if(e&&e.morph&&t&&t.morph){void 0===n&&(n=new r(e.morph));var i=new r(t.morph);return i}};this.intersect=function(t){var e=i(t);return n&&e?n.intersect(e):void 0},this.subtract=function(t){var e=i(t);return n&&e?n.subtract(e):void 0},this.union=function(t){var e=i(t);return n&&e?n.union(e):void 0}});e.GeometryCSGInternal=o},function(t,e,n){var i=n(3),r=n(23)(i),o=(n(8).Glyphset,function(t){var e;t&&t.isGlyphset&&(e=t);var a=[];this.setGlyphset=function(t){t&&t.isGlyphset&&(e=t),hostCSG=void 0},this.getGlyphset=function(){return e};var s=function(){return function(t){var e=t.getMesh(),n=t.getLabel();t.getColor();if(e){var i=new r(e.geometry.clone().applyMatrix(e.matrix)),o=[];o.csg=i,o.label=n,e.material&&(o.material=e.material.clone()),a.push(o)}}},c=function(t){if(e&&t&&t.morph){0==a.length&&e.forEachGlyph(s());var n=new r(t.morph);return n}};this.intersect=function(t){var e=c(t);if(0<a.length&&e){for(var r=new(n(8).Glyphset),s=0;s<a.length;s++){var l=a[s],u=l.csg.intersect(e),h=u.toMesh();if(h&&h.geometry&&0<h.geometry.vertices.length){l.material&&(h.material=l.material,h.material.side=i.DoubleSide,h.material.clippingPlanes=null);var p=r.addMeshAsGlyph(h,s+1);p.setLabel(l.label)}}var d=new o(r);return d}}});e.GlyphsetCSG=o}])}))},"4d64":function(t,e,n){var i=n("fc6a"),r=n("50c4"),o=n("23cb"),a=function(t){return function(e,n,a){var s,c=i(e),l=r(c.length),u=o(a,l);if(t&&n!=n){while(l>u)if(s=c[u++],s!=s)return!0}else for(;l>u;u++)if((t||u in c)&&c[u]===n)return t||u||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},"4e8a":function(t,e){t.exports="precision highp float;\nuniform sampler2D myTex;\nvarying vec2 vUv;\n\nvoid main() {\n\tgl_FragColor = texture2D( myTex, vUv );\n\n}\n"},"4f5a":function(t,e,n){(function(t){(function(t){var e=function(){try{return!!Symbol.iterator}catch(t){return!1}},n=e(),i=function(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return n&&(e[Symbol.iterator]=function(){return e}),e},r=function(t){return encodeURIComponent(t).replace(/%20/g,"+")},o=function(t){return decodeURIComponent(String(t).replace(/\+/g," "))},a=function(){var e=function(t){Object.defineProperty(this,"_entries",{writable:!0,value:{}});var n=typeof t;if("undefined"===n);else if("string"===n)""!==t&&this._fromString(t);else if(t instanceof e){var i=this;t.forEach((function(t,e){i.append(e,t)}))}else{if(null===t||"object"!==n)throw new TypeError("Unsupported input's type for URLSearchParams");if("[object Array]"===Object.prototype.toString.call(t))for(var r=0;r<t.length;r++){var o=t[r];if("[object Array]"!==Object.prototype.toString.call(o)&&2===o.length)throw new TypeError("Expected [string, any] as entry at index "+r+" of URLSearchParams's input");this.append(o[0],o[1])}else for(var a in t)t.hasOwnProperty(a)&&this.append(a,t[a])}},o=e.prototype;o.append=function(t,e){t in this._entries?this._entries[t].push(String(e)):this._entries[t]=[String(e)]},o.delete=function(t){delete this._entries[t]},o.get=function(t){return t in this._entries?this._entries[t][0]:null},o.getAll=function(t){return t in this._entries?this._entries[t].slice(0):[]},o.has=function(t){return t in this._entries},o.set=function(t,e){this._entries[t]=[String(e)]},o.forEach=function(t,e){var n;for(var i in this._entries)if(this._entries.hasOwnProperty(i)){n=this._entries[i];for(var r=0;r<n.length;r++)t.call(e,n[r],i,this)}},o.keys=function(){var t=[];return this.forEach((function(e,n){t.push(n)})),i(t)},o.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),i(t)},o.entries=function(){var t=[];return this.forEach((function(e,n){t.push([n,e])})),i(t)},n&&(o[Symbol.iterator]=o.entries),o.toString=function(){var t=[];return this.forEach((function(e,n){t.push(r(n)+"="+r(e))})),t.join("&")},t.URLSearchParams=e},s=function(){try{var e=t.URLSearchParams;return"a=1"===new e("?a=1").toString()&&"function"===typeof e.prototype.set}catch(n){return!1}};s()||a();var c=t.URLSearchParams.prototype;"function"!==typeof c.sort&&(c.sort=function(){var t=this,e=[];this.forEach((function(n,i){e.push([i,n]),t._entries||t.delete(i)})),e.sort((function(t,e){return t[0]<e[0]?-1:t[0]>e[0]?1:0})),t._entries&&(t._entries={});for(var n=0;n<e.length;n++)this.append(e[n][0],e[n][1])}),"function"!==typeof c._fromString&&Object.defineProperty(c,"_fromString",{enumerable:!1,configurable:!1,writable:!1,value:function(t){if(this._entries)this._entries={};else{var e=[];this.forEach((function(t,n){e.push(n)}));for(var n=0;n<e.length;n++)this.delete(e[n])}t=t.replace(/^\?/,"");var i,r=t.split("&");for(n=0;n<r.length;n++)i=r[n].split("="),this.append(o(i[0]),i.length>1?o(i[1]):"")}})})("undefined"!==typeof t?t:"undefined"!==typeof window?window:"undefined"!==typeof self?self:this),function(t){var e=function(){try{var e=new t.URL("b","http://a");return e.pathname="c%20d","http://a/c%20d"===e.href&&e.searchParams}catch(n){return!1}},n=function(){var e=t.URL,n=function(e,n){"string"!==typeof e&&(e=String(e));var i,r=document;if(n&&(void 0===t.location||n!==t.location.href)){r=document.implementation.createHTMLDocument(""),i=r.createElement("base"),i.href=n,r.head.appendChild(i);try{if(0!==i.href.indexOf(n))throw new Error(i.href)}catch(h){throw new Error("URL unable to set base "+n+" due to "+h)}}var o=r.createElement("a");if(o.href=e,i&&(r.body.appendChild(o),o.href=o.href),":"===o.protocol||!/:/.test(o.href))throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:o});var a=new t.URLSearchParams(this.search),s=!0,c=!0,l=this;["append","delete","set"].forEach((function(t){var e=a[t];a[t]=function(){e.apply(a,arguments),s&&(c=!1,l.search=a.toString(),c=!0)}})),Object.defineProperty(this,"searchParams",{value:a,enumerable:!0});var u=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==u&&(u=this.search,c&&(s=!1,this.searchParams._fromString(this.search),s=!0))}})},i=n.prototype,r=function(t){Object.defineProperty(i,t,{get:function(){return this._anchorElement[t]},set:function(e){this._anchorElement[t]=e},enumerable:!0})};["hash","host","hostname","port","protocol"].forEach((function(t){r(t)})),Object.defineProperty(i,"search",{get:function(){return this._anchorElement["search"]},set:function(t){this._anchorElement["search"]=t,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(i,{toString:{get:function(){var t=this;return function(){return t.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(t){this._anchorElement.href=t,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(t){this._anchorElement.pathname=t},enumerable:!0},origin:{get:function(){var t={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],e=this._anchorElement.port!=t&&""!==this._anchorElement.port;return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(e?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(t){},enumerable:!0},username:{get:function(){return""},set:function(t){},enumerable:!0}}),n.createObjectURL=function(t){return e.createObjectURL.apply(e,arguments)},n.revokeObjectURL=function(t){return e.revokeObjectURL.apply(e,arguments)},t.URL=n};if(e()||n(),void 0!==t.location&&!("origin"in t.location)){var i=function(){return t.location.protocol+"//"+t.location.hostname+(t.location.port?":"+t.location.port:"")};try{Object.defineProperty(t.location,"origin",{get:i,enumerable:!0})}catch(r){setInterval((function(){t.location.origin=i()}),100)}}}("undefined"!==typeof t?t:"undefined"!==typeof window?window:"undefined"!==typeof self?self:this)}).call(this,n("c8ba"))},"50c4":function(t,e,n){var i=n("a691"),r=Math.min;t.exports=function(t){return t>0?r(i(t),9007199254740991):0}},5130:function(t,e,n){var i,r,o;
|
|
84
|
-
/*!
|
|
85
|
-
* jQuery UI Checkboxradio 1.12.1
|
|
86
|
-
* http://jqueryui.com
|
|
87
|
-
*
|
|
88
|
-
* Copyright jQuery Foundation and other contributors
|
|
89
|
-
* Released under the MIT license.
|
|
90
|
-
* http://jquery.org/license
|
|
91
|
-
*/(function(a){r=[n("1157"),n("182f"),n("37a7"),n("af5e"),n("3084")],i=a,o="function"===typeof i?i.apply(e,r):i,void 0===o||(t.exports=o)})((function(t){return t.widget("ui.checkboxradio",[t.ui.formResetMixin,{version:"1.12.1",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var e,n,i=this,r=this._super()||{};return this._readType(),n=this.element.labels(),this.label=t(n[n.length-1]),this.label.length||t.error("No label found for checkboxradio widget"),this.originalLabel="",this.label.contents().not(this.element[0]).each((function(){i.originalLabel+=3===this.nodeType?t(this).text():this.outerHTML})),this.originalLabel&&(r.label=this.originalLabel),e=this.element[0].disabled,null!=e&&(r.disabled=e),r},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),t&&(this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this.icon&&this._addClass(this.icon,null,"ui-state-hover")),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var e=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===e&&/radio|checkbox/.test(this.type)||t.error("Can't create checkboxradio on element.nodeName="+e+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var e,n=this.element[0].name,i="input[name='"+t.ui.escapeSelector(n)+"']";return n?(e=this.form.length?t(this.form[0].elements).filter(i):t(i).filter((function(){return 0===t(this).form().length})),e.not(this.element)):t([])},_toggleClasses:function(){var e=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",e),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",e)._toggleClass(this.icon,null,"ui-icon-blank",!e),"radio"===this.type&&this._getRadioGroup().each((function(){var e=t(this).checkboxradio("instance");e&&e._removeClass(e.label,"ui-checkboxradio-checked","ui-state-active")}))},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(t,e){if("label"!==t||e){if(this._super(t,e),"disabled"===t)return this._toggleClass(this.label,null,"ui-state-disabled",e),void(this.element[0].disabled=e);this.refresh()}},_updateIcon:function(e){var n="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=t("<span>"),this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(n+=e?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,e?"ui-icon-blank":"ui-icon-check")):n+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",n),e||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);this.icon&&(t=t.not(this.icon[0])),this.iconSpace&&(t=t.not(this.iconSpace[0])),t.remove(),this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),null!==this.options.label&&this._updateLabel(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]),t.ui.checkboxradio}))},5135:function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},"549c":function(t,e){var n={ALL:0,SELECTED:1,HIGHLIGHTED:2},i=function(t,e){this.eventType=t,this.identifiers=e},r=function(t,e,r){this.targetedID=[];var o=t;this.targetEventType=void 0===r?n.ALL:r;var a=e,s=this;this.getEventType=function(){return r},this.notify=function(t,e,r){if(t!==o&&(s.targetEventType===n.ALL||s.targetEventType===e)){var c=new i(e,r);a(c)}}};e.EventNotifier=function(){var t=[];this.publish=function(e,n,i){for(var r=0;r<t.length;r++)t[r].notify(e,n,i)},this.subscribe=function(e,n,i){if("function"===typeof n){var o=new r(e,n,i);return t.push(o),o}},this.unsubscribe=function(e){for(var n=0;n<t.length;n++)if(e===t[n])return void t.splice(n,1)}},e.EVENT_TYPE=n},5692:function(t,e,n){var i=n("c430"),r=n("c6cd");(t.exports=function(t,e){return r[t]||(r[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.4.1",mode:i?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},5694:function(t,e,n){n("cb1e"),n("a5a8"),n("1cb4"),n("6740"),n("30c6"),n("8501");var r=n("4d4c"),o=n("10c9").WEBGL;e.ITEM_LOADED={FALSE:-1,DOWNLOADING:0,TRUE:1},e.createDialogContainer=function(t,e){var n=$("<div></div>");n.attr("title",t);var r=$('<div class="ui-widget-content" style="position:absolute;width:100%;height:100%;"></div>');n.append(r),n.dialog({width:600,height:500});var o=$.parseHTML(e);for(i=0;i<o.length;i++)r[0].appendChild(o[i]);return r},e.createRenderer=function(){var t=document.createElement("div"),e=void 0;if(t.style.height="100%",o.isWebGLAvailable()){e=new r.Renderer(t,window);r.defaultMaterialColor=16777116,e.initialiseVisualisation(),e.playAnimation=!1}else{var n=o.getWebGLErrorMessage();t.appendChild(n)}return{renderer:e,container:t}},e.findCSSRule=function(t){for(var e=0;e<document.styleSheets.length;e++)for(var n=document.styleSheets[e].cssRules||document.styleSheets[i].rules,i=0;i<n.length;i++)if(n[i].selectorText===t)return n[i]},e.getSelector=function(t){var e,n=$(t);while(n.length){var i=n[0],r=i.localName;if(!r)break;r=r.toLowerCase(),i.id?r+="#"+i.id:i.className&&(r+="."+i.className.split(/\s+/).join("."));var o=n.parent(),a=o.children(r);if(a.length>1){var s=o.children(),c=s.index(i)+1;c>1&&(r+=":nth-child("+c+")")}e=r+(e?">"+e:""),n=o}return e}},"56ef":function(t,e,n){var i=n("d066"),r=n("241c"),o=n("7418"),a=n("825a");t.exports=i("Reflect","ownKeys")||function(t){var e=r.f(a(t)),n=o.f;return n?e.concat(n(t)):e}},5732:function(t,e,n){},"5a89":function(t,e,n){"use strict";function i(){}n.r(e),n.d(e,"ACESFilmicToneMapping",(function(){return ct})),n.d(e,"AddEquation",(function(){return P})),n.d(e,"AddOperation",(function(){return nt})),n.d(e,"AdditiveBlending",(function(){return E})),n.d(e,"AlphaFormat",(function(){return kt})),n.d(e,"AlwaysDepth",(function(){return X})),n.d(e,"AmbientLight",(function(){return vu})),n.d(e,"AmbientLightProbe",(function(){return Fu})),n.d(e,"AnimationClip",(function(){return yl})),n.d(e,"AnimationLoader",(function(){return El})),n.d(e,"AnimationMixer",(function(){return ah})),n.d(e,"AnimationObjectGroup",(function(){return rh})),n.d(e,"AnimationUtils",(function(){return ol})),n.d(e,"ArcCurve",(function(){return Nl})),n.d(e,"ArrayCamera",(function(){return Ka})),n.d(e,"ArrowHelper",(function(){return Nh})),n.d(e,"Audio",(function(){return Ju})),n.d(e,"AudioAnalyser",(function(){return $u})),n.d(e,"AudioContext",(function(){return Bu})),n.d(e,"AudioListener",(function(){return Yu})),n.d(e,"AudioLoader",(function(){return ku})),n.d(e,"AxesHelper",(function(){return Ih})),n.d(e,"AxisHelper",(function(){return sp})),n.d(e,"BackSide",(function(){return v})),n.d(e,"BasicDepthPacking",(function(){return ze})),n.d(e,"BasicShadowMap",(function(){return d})),n.d(e,"BinaryTextureLoader",(function(){return pp})),n.d(e,"Bone",(function(){return vs})),n.d(e,"BooleanKeyframeTrack",(function(){return hl})),n.d(e,"BoundingBoxHelper",(function(){return cp})),n.d(e,"Box2",(function(){return fh})),n.d(e,"Box3",(function(){return Ke})),n.d(e,"Box3Helper",(function(){return Oh})),n.d(e,"BoxBufferGeometry",(function(){return Yr})),n.d(e,"BoxGeometry",(function(){return Xr})),n.d(e,"BoxHelper",(function(){return Rh})),n.d(e,"BufferAttribute",(function(){return Dr})),n.d(e,"BufferGeometry",(function(){return qr})),n.d(e,"BufferGeometryLoader",(function(){return Mu})),n.d(e,"ByteType",(function(){return At})),n.d(e,"Cache",(function(){return wl})),n.d(e,"Camera",(function(){return $a})),n.d(e,"CameraHelper",(function(){return Ph})),n.d(e,"CanvasRenderer",(function(){return fp})),n.d(e,"CanvasTexture",(function(){return Es})),n.d(e,"CatmullRomCurve3",(function(){return Ul})),n.d(e,"CineonToneMapping",(function(){return st})),n.d(e,"CircleBufferGeometry",(function(){return qc})),n.d(e,"CircleGeometry",(function(){return Wc})),n.d(e,"ClampToEdgeWrapping",(function(){return yt})),n.d(e,"Clock",(function(){return Xu})),n.d(e,"ClosedSplineCurve3",(function(){return rp})),n.d(e,"Color",(function(){return wr})),n.d(e,"ColorKeyframeTrack",(function(){return pl})),n.d(e,"CompressedTexture",(function(){return Ss})),n.d(e,"CompressedTextureLoader",(function(){return Al})),n.d(e,"ConeBufferGeometry",(function(){return Vc})),n.d(e,"ConeGeometry",(function(){return jc})),n.d(e,"CubeCamera",(function(){return qu})),n.d(e,"CubeGeometry",(function(){return Xr})),n.d(e,"CubeReflectionMapping",(function(){return ut})),n.d(e,"CubeRefractionMapping",(function(){return ht})),n.d(e,"CubeTexture",(function(){return yo})),n.d(e,"CubeTextureLoader",(function(){return Pl})),n.d(e,"CubeUVReflectionMapping",(function(){return mt})),n.d(e,"CubeUVRefractionMapping",(function(){return gt})),n.d(e,"CubicBezierCurve",(function(){return $l})),n.d(e,"CubicBezierCurve3",(function(){return Ql})),n.d(e,"CubicInterpolant",(function(){return sl})),n.d(e,"CullFaceBack",(function(){return c})),n.d(e,"CullFaceFront",(function(){return l})),n.d(e,"CullFaceFrontBack",(function(){return u})),n.d(e,"CullFaceNone",(function(){return s})),n.d(e,"Curve",(function(){return Ol})),n.d(e,"CurvePath",(function(){return ou})),n.d(e,"CustomBlending",(function(){return L})),n.d(e,"CylinderBufferGeometry",(function(){return Fc})),n.d(e,"CylinderGeometry",(function(){return Gc})),n.d(e,"Cylindrical",(function(){return dh})),n.d(e,"DataTexture",(function(){return Qe})),n.d(e,"DataTexture2DArray",(function(){return bo})),n.d(e,"DataTexture3D",(function(){return xo})),n.d(e,"DataTextureLoader",(function(){return Cl})),n.d(e,"DefaultLoadingManager",(function(){return Ml})),n.d(e,"DepthFormat",(function(){return Vt})),n.d(e,"DepthStencilFormat",(function(){return Wt})),n.d(e,"DepthTexture",(function(){return As})),n.d(e,"DirectionalLight",(function(){return gu})),n.d(e,"DirectionalLightHelper",(function(){return Lh})),n.d(e,"DirectionalLightShadow",(function(){return mu})),n.d(e,"DiscreteInterpolant",(function(){return ll})),n.d(e,"DodecahedronBufferGeometry",(function(){return Us})),n.d(e,"DodecahedronGeometry",(function(){return Hs})),n.d(e,"DoubleSide",(function(){return y})),n.d(e,"DstAlphaFactor",(function(){return G})),n.d(e,"DstColorFactor",(function(){return j})),n.d(e,"DynamicBufferAttribute",(function(){return Yh})),n.d(e,"EdgesGeometry",(function(){return Uc})),n.d(e,"EdgesHelper",(function(){return lp})),n.d(e,"EllipseCurve",(function(){return Dl})),n.d(e,"EqualDepth",(function(){return Z})),n.d(e,"EquirectangularReflectionMapping",(function(){return pt})),n.d(e,"EquirectangularRefractionMapping",(function(){return dt})),n.d(e,"Euler",(function(){return Ar})),n.d(e,"EventDispatcher",(function(){return i})),n.d(e,"ExtrudeBufferGeometry",(function(){return Ec})),n.d(e,"ExtrudeGeometry",(function(){return Sc})),n.d(e,"Face3",(function(){return Er})),n.d(e,"Face4",(function(){return zh})),n.d(e,"FaceColors",(function(){return _})),n.d(e,"FaceNormalsHelper",(function(){return Ch})),n.d(e,"FileLoader",(function(){return Sl})),n.d(e,"FlatShading",(function(){return b})),n.d(e,"Float32Attribute",(function(){return np})),n.d(e,"Float32BufferAttribute",(function(){return Gr})),n.d(e,"Float64Attribute",(function(){return ip})),n.d(e,"Float64BufferAttribute",(function(){return Fr})),n.d(e,"FloatType",(function(){return Ot})),n.d(e,"Fog",(function(){return cs})),n.d(e,"FogExp2",(function(){return ss})),n.d(e,"Font",(function(){return Ou})),n.d(e,"FontLoader",(function(){return Iu})),n.d(e,"FrontFaceDirectionCCW",(function(){return p})),n.d(e,"FrontFaceDirectionCW",(function(){return h})),n.d(e,"FrontSide",(function(){return g})),n.d(e,"Frustum",(function(){return nn})),n.d(e,"GammaEncoding",(function(){return Pe})),n.d(e,"Geometry",(function(){return Or})),n.d(e,"GeometryUtils",(function(){return dp})),n.d(e,"GreaterDepth",(function(){return Q})),n.d(e,"GreaterEqualDepth",(function(){return $})),n.d(e,"GridHelper",(function(){return Sh})),n.d(e,"Group",(function(){return Za})),n.d(e,"HalfFloatType",(function(){return Dt})),n.d(e,"HemisphereLight",(function(){return lu})),n.d(e,"HemisphereLightHelper",(function(){return Mh})),n.d(e,"HemisphereLightProbe",(function(){return Gu})),n.d(e,"IcosahedronBufferGeometry",(function(){return ks})),n.d(e,"IcosahedronGeometry",(function(){return Bs})),n.d(e,"ImageBitmapLoader",(function(){return Pu})),n.d(e,"ImageLoader",(function(){return Ll})),n.d(e,"ImageUtils",(function(){return We})),n.d(e,"ImmediateRenderObject",(function(){return gh})),n.d(e,"InstancedBufferAttribute",(function(){return _u})),n.d(e,"InstancedBufferGeometry",(function(){return wu})),n.d(e,"InstancedInterleavedBuffer",(function(){return ch})),n.d(e,"Int16Attribute",(function(){return Qh})),n.d(e,"Int16BufferAttribute",(function(){return Br})),n.d(e,"Int32Attribute",(function(){return tp})),n.d(e,"Int32BufferAttribute",(function(){return Hr})),n.d(e,"Int8Attribute",(function(){return Jh})),n.d(e,"Int8BufferAttribute",(function(){return Nr})),n.d(e,"IntType",(function(){return Pt})),n.d(e,"InterleavedBuffer",(function(){return us})),n.d(e,"InterleavedBufferAttribute",(function(){return hs})),n.d(e,"Interpolant",(function(){return al})),n.d(e,"InterpolateDiscrete",(function(){return be})),n.d(e,"InterpolateLinear",(function(){return xe})),n.d(e,"InterpolateSmooth",(function(){return we})),n.d(e,"JSONLoader",(function(){return mp})),n.d(e,"KeyframeTrack",(function(){return ul})),n.d(e,"LOD",(function(){return fs})),n.d(e,"LatheBufferGeometry",(function(){return zc})),n.d(e,"LatheGeometry",(function(){return Ic})),n.d(e,"Layers",(function(){return Cr})),n.d(e,"LensFlare",(function(){return vp})),n.d(e,"LessDepth",(function(){return Y})),n.d(e,"LessEqualDepth",(function(){return J})),n.d(e,"Light",(function(){return cu})),n.d(e,"LightProbe",(function(){return Uu})),n.d(e,"LightProbeHelper",(function(){return Th})),n.d(e,"LightShadow",(function(){return uu})),n.d(e,"Line",(function(){return bs})),n.d(e,"Line3",(function(){return mh})),n.d(e,"LineBasicMaterial",(function(){return ys})),n.d(e,"LineCurve",(function(){return Kl})),n.d(e,"LineCurve3",(function(){return tu})),n.d(e,"LineDashedMaterial",(function(){return il})),n.d(e,"LineLoop",(function(){return ws})),n.d(e,"LinePieces",(function(){return kh})),n.d(e,"LineSegments",(function(){return xs})),n.d(e,"LineStrip",(function(){return Bh})),n.d(e,"LinearEncoding",(function(){return Ce})),n.d(e,"LinearFilter",(function(){return Mt})),n.d(e,"LinearInterpolant",(function(){return cl})),n.d(e,"LinearMipMapLinearFilter",(function(){return St})),n.d(e,"LinearMipMapNearestFilter",(function(){return Tt})),n.d(e,"LinearToneMapping",(function(){return rt})),n.d(e,"Loader",(function(){return zu})),n.d(e,"LoaderUtils",(function(){return xu})),n.d(e,"LoadingManager",(function(){return _l})),n.d(e,"LogLuvEncoding",(function(){return Oe})),n.d(e,"LoopOnce",(function(){return ge})),n.d(e,"LoopPingPong",(function(){return ye})),n.d(e,"LoopRepeat",(function(){return ve})),n.d(e,"LuminanceAlphaFormat",(function(){return Ft})),n.d(e,"LuminanceFormat",(function(){return Gt})),n.d(e,"MOUSE",(function(){return a})),n.d(e,"Material",(function(){return Qr})),n.d(e,"MaterialLoader",(function(){return bu})),n.d(e,"Math",(function(){return Ue})),n.d(e,"Matrix3",(function(){return Ve})),n.d(e,"Matrix4",(function(){return rn})),n.d(e,"MaxEquation",(function(){return N})),n.d(e,"Mesh",(function(){return oo})),n.d(e,"MeshBasicMaterial",(function(){return ro})),n.d(e,"MeshDepthMaterial",(function(){return Va})),n.d(e,"MeshDistanceMaterial",(function(){return Wa})),n.d(e,"MeshFaceMaterial",(function(){return Hh})),n.d(e,"MeshLambertMaterial",(function(){return el})),n.d(e,"MeshMatcapMaterial",(function(){return nl})),n.d(e,"MeshNormalMaterial",(function(){return tl})),n.d(e,"MeshPhongMaterial",(function(){return Qc})),n.d(e,"MeshPhysicalMaterial",(function(){return $c})),n.d(e,"MeshStandardMaterial",(function(){return Zc})),n.d(e,"MeshToonMaterial",(function(){return Kc})),n.d(e,"MinEquation",(function(){return D})),n.d(e,"MirroredRepeatWrapping",(function(){return bt})),n.d(e,"MixOperation",(function(){return et})),n.d(e,"MultiMaterial",(function(){return Uh})),n.d(e,"MultiplyBlending",(function(){return C})),n.d(e,"MultiplyOperation",(function(){return tt})),n.d(e,"NearestFilter",(function(){return xt})),n.d(e,"NearestMipMapLinearFilter",(function(){return _t})),n.d(e,"NearestMipMapNearestFilter",(function(){return wt})),n.d(e,"NeverDepth",(function(){return q})),n.d(e,"NoBlending",(function(){return T})),n.d(e,"NoColors",(function(){return w})),n.d(e,"NoToneMapping",(function(){return it})),n.d(e,"NormalBlending",(function(){return S})),n.d(e,"NotEqualDepth",(function(){return K})),n.d(e,"NumberKeyframeTrack",(function(){return dl})),n.d(e,"Object3D",(function(){return Pr})),n.d(e,"ObjectLoader",(function(){return Su})),n.d(e,"ObjectSpaceNormalMap",(function(){return He})),n.d(e,"OctahedronBufferGeometry",(function(){return zs})),n.d(e,"OctahedronGeometry",(function(){return Is})),n.d(e,"OneFactor",(function(){return z})),n.d(e,"OneMinusDstAlphaFactor",(function(){return F})),n.d(e,"OneMinusDstColorFactor",(function(){return V})),n.d(e,"OneMinusSrcAlphaFactor",(function(){return U})),n.d(e,"OneMinusSrcColorFactor",(function(){return k})),n.d(e,"OrthographicCamera",(function(){return fu})),n.d(e,"PCFShadowMap",(function(){return f})),n.d(e,"PCFSoftShadowMap",(function(){return m})),n.d(e,"ParametricBufferGeometry",(function(){return Ps})),n.d(e,"ParametricGeometry",(function(){return Ls})),n.d(e,"Particle",(function(){return Fh})),n.d(e,"ParticleBasicMaterial",(function(){return Wh})),n.d(e,"ParticleSystem",(function(){return jh})),n.d(e,"ParticleSystemMaterial",(function(){return qh})),n.d(e,"Path",(function(){return au})),n.d(e,"PerspectiveCamera",(function(){return Qa})),n.d(e,"Plane",(function(){return en})),n.d(e,"PlaneBufferGeometry",(function(){return Zr})),n.d(e,"PlaneGeometry",(function(){return Jr})),n.d(e,"PlaneHelper",(function(){return Dh})),n.d(e,"PointCloud",(function(){return Gh})),n.d(e,"PointCloudMaterial",(function(){return Vh})),n.d(e,"PointLight",(function(){return du})),n.d(e,"PointLightHelper",(function(){return wh})),n.d(e,"Points",(function(){return Ms})),n.d(e,"PointsMaterial",(function(){return _s})),n.d(e,"PolarGridHelper",(function(){return Eh})),n.d(e,"PolyhedronBufferGeometry",(function(){return Os})),n.d(e,"PolyhedronGeometry",(function(){return Rs})),n.d(e,"PositionalAudio",(function(){return Zu})),n.d(e,"PositionalAudioHelper",(function(){return Ah})),n.d(e,"PropertyBinding",(function(){return ih})),n.d(e,"PropertyMixer",(function(){return Qu})),n.d(e,"QuadraticBezierCurve",(function(){return eu})),n.d(e,"QuadraticBezierCurve3",(function(){return nu})),n.d(e,"Quaternion",(function(){return Fe})),n.d(e,"QuaternionKeyframeTrack",(function(){return ml})),n.d(e,"QuaternionLinearInterpolant",(function(){return fl})),n.d(e,"REVISION",(function(){return o})),n.d(e,"RGBADepthPacking",(function(){return Be})),n.d(e,"RGBAFormat",(function(){return Ut})),n.d(e,"RGBA_ASTC_10x10_Format",(function(){return de})),n.d(e,"RGBA_ASTC_10x5_Format",(function(){return ue})),n.d(e,"RGBA_ASTC_10x6_Format",(function(){return he})),n.d(e,"RGBA_ASTC_10x8_Format",(function(){return pe})),n.d(e,"RGBA_ASTC_12x10_Format",(function(){return fe})),n.d(e,"RGBA_ASTC_12x12_Format",(function(){return me})),n.d(e,"RGBA_ASTC_4x4_Format",(function(){return ne})),n.d(e,"RGBA_ASTC_5x4_Format",(function(){return ie})),n.d(e,"RGBA_ASTC_5x5_Format",(function(){return re})),n.d(e,"RGBA_ASTC_6x5_Format",(function(){return oe})),n.d(e,"RGBA_ASTC_6x6_Format",(function(){return ae})),n.d(e,"RGBA_ASTC_8x5_Format",(function(){return se})),n.d(e,"RGBA_ASTC_8x6_Format",(function(){return ce})),n.d(e,"RGBA_ASTC_8x8_Format",(function(){return le})),n.d(e,"RGBA_PVRTC_2BPPV1_Format",(function(){return te})),n.d(e,"RGBA_PVRTC_4BPPV1_Format",(function(){return Kt})),n.d(e,"RGBA_S3TC_DXT1_Format",(function(){return Yt})),n.d(e,"RGBA_S3TC_DXT3_Format",(function(){return Jt})),n.d(e,"RGBA_S3TC_DXT5_Format",(function(){return Zt})),n.d(e,"RGBDEncoding",(function(){return Ie})),n.d(e,"RGBEEncoding",(function(){return Re})),n.d(e,"RGBEFormat",(function(){return jt})),n.d(e,"RGBFormat",(function(){return Ht})),n.d(e,"RGBM16Encoding",(function(){return Ne})),n.d(e,"RGBM7Encoding",(function(){return De})),n.d(e,"RGB_ETC1_Format",(function(){return ee})),n.d(e,"RGB_PVRTC_2BPPV1_Format",(function(){return Qt})),n.d(e,"RGB_PVRTC_4BPPV1_Format",(function(){return $t})),n.d(e,"RGB_S3TC_DXT1_Format",(function(){return Xt})),n.d(e,"RawShaderMaterial",(function(){return Jc})),n.d(e,"Ray",(function(){return no})),n.d(e,"Raycaster",(function(){return lh})),n.d(e,"RectAreaLight",(function(){return yu})),n.d(e,"RectAreaLightHelper",(function(){return _h})),n.d(e,"RedFormat",(function(){return qt})),n.d(e,"ReinhardToneMapping",(function(){return ot})),n.d(e,"RepeatWrapping",(function(){return vt})),n.d(e,"ReverseSubtractEquation",(function(){return O})),n.d(e,"RingBufferGeometry",(function(){return Nc})),n.d(e,"RingGeometry",(function(){return Dc})),n.d(e,"Scene",(function(){return ls})),n.d(e,"SceneUtils",(function(){return gp})),n.d(e,"ShaderChunk",(function(){return gr})),n.d(e,"ShaderLib",(function(){return Mr})),n.d(e,"ShaderMaterial",(function(){return eo})),n.d(e,"ShadowMaterial",(function(){return Yc})),n.d(e,"Shape",(function(){return su})),n.d(e,"ShapeBufferGeometry",(function(){return kc})),n.d(e,"ShapeGeometry",(function(){return Bc})),n.d(e,"ShapePath",(function(){return Ru})),n.d(e,"ShapeUtils",(function(){return _c})),n.d(e,"ShortType",(function(){return Ct})),n.d(e,"Skeleton",(function(){return gs})),n.d(e,"SkeletonHelper",(function(){return xh})),n.d(e,"SkinnedMesh",(function(){return ms})),n.d(e,"SmoothShading",(function(){return x})),n.d(e,"Sphere",(function(){return tn})),n.d(e,"SphereBufferGeometry",(function(){return Oc})),n.d(e,"SphereGeometry",(function(){return Rc})),n.d(e,"Spherical",(function(){return ph})),n.d(e,"SphericalHarmonics3",(function(){return Hu})),n.d(e,"SphericalReflectionMapping",(function(){return ft})),n.d(e,"Spline",(function(){return ap})),n.d(e,"SplineCurve",(function(){return iu})),n.d(e,"SplineCurve3",(function(){return op})),n.d(e,"SpotLight",(function(){return pu})),n.d(e,"SpotLightHelper",(function(){return yh})),n.d(e,"SpotLightShadow",(function(){return hu})),n.d(e,"Sprite",(function(){return ds})),n.d(e,"SpriteMaterial",(function(){return ps})),n.d(e,"SrcAlphaFactor",(function(){return H})),n.d(e,"SrcAlphaSaturateFactor",(function(){return W})),n.d(e,"SrcColorFactor",(function(){return B})),n.d(e,"StereoCamera",(function(){return ju})),n.d(e,"StringKeyframeTrack",(function(){return gl})),n.d(e,"SubtractEquation",(function(){return R})),n.d(e,"SubtractiveBlending",(function(){return A})),n.d(e,"TangentSpaceNormalMap",(function(){return ke})),n.d(e,"TetrahedronBufferGeometry",(function(){return Ns})),n.d(e,"TetrahedronGeometry",(function(){return Ds})),n.d(e,"TextBufferGeometry",(function(){return Pc})),n.d(e,"TextGeometry",(function(){return Lc})),n.d(e,"Texture",(function(){return Xe})),n.d(e,"TextureLoader",(function(){return Rl})),n.d(e,"TorusBufferGeometry",(function(){return qs})),n.d(e,"TorusGeometry",(function(){return Ws})),n.d(e,"TorusKnotBufferGeometry",(function(){return Vs})),n.d(e,"TorusKnotGeometry",(function(){return js})),n.d(e,"Triangle",(function(){return io})),n.d(e,"TriangleFanDrawMode",(function(){return Ae})),n.d(e,"TriangleStripDrawMode",(function(){return Ee})),n.d(e,"TrianglesDrawMode",(function(){return Se})),n.d(e,"TubeBufferGeometry",(function(){return Fs})),n.d(e,"TubeGeometry",(function(){return Gs})),n.d(e,"UVMapping",(function(){return lt})),n.d(e,"Uint16Attribute",(function(){return Kh})),n.d(e,"Uint16BufferAttribute",(function(){return kr})),n.d(e,"Uint32Attribute",(function(){return ep})),n.d(e,"Uint32BufferAttribute",(function(){return Ur})),n.d(e,"Uint8Attribute",(function(){return Zh})),n.d(e,"Uint8BufferAttribute",(function(){return Ir})),n.d(e,"Uint8ClampedAttribute",(function(){return $h})),n.d(e,"Uint8ClampedBufferAttribute",(function(){return zr})),n.d(e,"Uncharted2ToneMapping",(function(){return at})),n.d(e,"Uniform",(function(){return sh})),n.d(e,"UniformsLib",(function(){return _r})),n.d(e,"UniformsUtils",(function(){return br})),n.d(e,"UnsignedByteType",(function(){return Et})),n.d(e,"UnsignedInt248Type",(function(){return Bt})),n.d(e,"UnsignedIntType",(function(){return Rt})),n.d(e,"UnsignedShort4444Type",(function(){return Nt})),n.d(e,"UnsignedShort5551Type",(function(){return It})),n.d(e,"UnsignedShort565Type",(function(){return zt})),n.d(e,"UnsignedShortType",(function(){return Lt})),n.d(e,"Vector2",(function(){return Ge})),n.d(e,"Vector3",(function(){return je})),n.d(e,"Vector4",(function(){return Ye})),n.d(e,"VectorKeyframeTrack",(function(){return vl})),n.d(e,"Vertex",(function(){return Xh})),n.d(e,"VertexColors",(function(){return M})),n.d(e,"VertexNormalsHelper",(function(){return vh})),n.d(e,"VideoTexture",(function(){return Ts})),n.d(e,"WebGLMultisampleRenderTarget",(function(){return Ze})),n.d(e,"WebGLRenderTarget",(function(){return Je})),n.d(e,"WebGLRenderTargetCube",(function(){return $e})),n.d(e,"WebGLRenderer",(function(){return as})),n.d(e,"WebGLUtils",(function(){return Ja})),n.d(e,"WireframeGeometry",(function(){return Cs})),n.d(e,"WireframeHelper",(function(){return up})),n.d(e,"WrapAroundEnding",(function(){return Te})),n.d(e,"XHRLoader",(function(){return hp})),n.d(e,"ZeroCurvatureEnding",(function(){return _e})),n.d(e,"ZeroFactor",(function(){return I})),n.d(e,"ZeroSlopeEnding",(function(){return Me})),n.d(e,"sRGBEncoding",(function(){return Le})),void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(t){return"number"===typeof t&&isFinite(t)&&Math.floor(t)===t}),void 0===Math.sign&&(Math.sign=function(t){return t<0?-1:t>0?1:+t}),"name"in Function.prototype===!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&function(){Object.assign=function(t){if(void 0===t||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var i=arguments[n];if(void 0!==i&&null!==i)for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e}}(),Object.assign(i.prototype,{addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)},removeEventListener:function(t,e){if(void 0!==this._listeners){var n=this._listeners,i=n[t];if(void 0!==i){var r=i.indexOf(e);-1!==r&&i.splice(r,1)}}},dispatchEvent:function(t){if(void 0!==this._listeners){var e=this._listeners,n=e[t.type];if(void 0!==n){t.target=this;for(var i=n.slice(0),r=0,o=i.length;r<o;r++)i[r].call(this,t)}}}});var r,o="105",a={LEFT:0,MIDDLE:1,RIGHT:2},s=0,c=1,l=2,u=3,h=0,p=1,d=0,f=1,m=2,g=0,v=1,y=2,b=1,x=2,w=0,_=1,M=2,T=0,S=1,E=2,A=3,C=4,L=5,P=100,R=101,O=102,D=103,N=104,I=200,z=201,B=202,k=203,H=204,U=205,G=206,F=207,j=208,V=209,W=210,q=0,X=1,Y=2,J=3,Z=4,$=5,Q=6,K=7,tt=0,et=1,nt=2,it=0,rt=1,ot=2,at=3,st=4,ct=5,lt=300,ut=301,ht=302,pt=303,dt=304,ft=305,mt=306,gt=307,vt=1e3,yt=1001,bt=1002,xt=1003,wt=1004,_t=1005,Mt=1006,Tt=1007,St=1008,Et=1009,At=1010,Ct=1011,Lt=1012,Pt=1013,Rt=1014,Ot=1015,Dt=1016,Nt=1017,It=1018,zt=1019,Bt=1020,kt=1021,Ht=1022,Ut=1023,Gt=1024,Ft=1025,jt=Ut,Vt=1026,Wt=1027,qt=1028,Xt=33776,Yt=33777,Jt=33778,Zt=33779,$t=35840,Qt=35841,Kt=35842,te=35843,ee=36196,ne=37808,ie=37809,re=37810,oe=37811,ae=37812,se=37813,ce=37814,le=37815,ue=37816,he=37817,pe=37818,de=37819,fe=37820,me=37821,ge=2200,ve=2201,ye=2202,be=2300,xe=2301,we=2302,_e=2400,Me=2401,Te=2402,Se=0,Ee=1,Ae=2,Ce=3e3,Le=3001,Pe=3007,Re=3002,Oe=3003,De=3004,Ne=3005,Ie=3006,ze=3200,Be=3201,ke=0,He=1,Ue={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){for(var t=[],e=0;e<256;e++)t[e]=(e<16?"0":"")+e.toString(16);return function(){var e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0,r=4294967295*Math.random()|0,o=t[255&e]+t[e>>8&255]+t[e>>16&255]+t[e>>24&255]+"-"+t[255&n]+t[n>>8&255]+"-"+t[n>>16&15|64]+t[n>>24&255]+"-"+t[63&i|128]+t[i>>8&255]+"-"+t[i>>16&255]+t[i>>24&255]+t[255&r]+t[r>>8&255]+t[r>>16&255]+t[r>>24&255];return o.toUpperCase()}}(),clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)},lerp:function(t,e,n){return(1-n)*t+n*e},smoothstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(6*t-15)+10))},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*Ue.DEG2RAD},radToDeg:function(t){return t*Ue.RAD2DEG},isPowerOfTwo:function(t){return 0===(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}};function Ge(t,e){this.x=t||0,this.y=e||0}function Fe(t,e,n,i){this._x=t||0,this._y=e||0,this._z=n||0,this._w=void 0!==i?i:1}function je(t,e,n){this.x=t||0,this.y=e||0,this.z=n||0}function Ve(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}Object.defineProperties(Ge.prototype,{width:{get:function(){return this.x},set:function(t){this.x=t}},height:{get:function(){return this.y},set:function(t){this.y=t}}}),Object.assign(Ge.prototype,{isVector2:!0,set:function(t,e){return this.x=t,this.y=e,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},applyMatrix3:function(t){var e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this},rotateAround:function(t,e){var n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,o=this.y-t.y;return this.x=r*n-o*i+t.x,this.y=r*i+o*n+t.y,this}}),Object.assign(Fe,{slerp:function(t,e,n,i){return n.copy(t).slerp(e,i)},slerpFlat:function(t,e,n,i,r,o,a){var s=n[i+0],c=n[i+1],l=n[i+2],u=n[i+3],h=r[o+0],p=r[o+1],d=r[o+2],f=r[o+3];if(u!==f||s!==h||c!==p||l!==d){var m=1-a,g=s*h+c*p+l*d+u*f,v=g>=0?1:-1,y=1-g*g;if(y>Number.EPSILON){var b=Math.sqrt(y),x=Math.atan2(b,g*v);m=Math.sin(m*x)/b,a=Math.sin(a*x)/b}var w=a*v;if(s=s*m+h*w,c=c*m+p*w,l=l*m+d*w,u=u*m+f*w,m===1-a){var _=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=_,c*=_,l*=_,u*=_}}t[e]=s,t[e+1]=c,t[e+2]=l,t[e+3]=u}}),Object.defineProperties(Fe.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback()}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback()}}}),Object.assign(Fe.prototype,{isQuaternion:!0,set:function(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this.onChangeCallback(),this},setFromEuler:function(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=t._x,i=t._y,r=t._z,o=t.order,a=Math.cos,s=Math.sin,c=a(n/2),l=a(i/2),u=a(r/2),h=s(n/2),p=s(i/2),d=s(r/2);return"XYZ"===o?(this._x=h*l*u+c*p*d,this._y=c*p*u-h*l*d,this._z=c*l*d+h*p*u,this._w=c*l*u-h*p*d):"YXZ"===o?(this._x=h*l*u+c*p*d,this._y=c*p*u-h*l*d,this._z=c*l*d-h*p*u,this._w=c*l*u+h*p*d):"ZXY"===o?(this._x=h*l*u-c*p*d,this._y=c*p*u+h*l*d,this._z=c*l*d+h*p*u,this._w=c*l*u-h*p*d):"ZYX"===o?(this._x=h*l*u-c*p*d,this._y=c*p*u+h*l*d,this._z=c*l*d-h*p*u,this._w=c*l*u+h*p*d):"YZX"===o?(this._x=h*l*u+c*p*d,this._y=c*p*u+h*l*d,this._z=c*l*d-h*p*u,this._w=c*l*u-h*p*d):"XZY"===o&&(this._x=h*l*u-c*p*d,this._y=c*p*u-h*l*d,this._z=c*l*d+h*p*u,this._w=c*l*u+h*p*d),!1!==e&&this.onChangeCallback(),this},setFromAxisAngle:function(t,e){var n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this.onChangeCallback(),this},setFromRotationMatrix:function(t){var e,n=t.elements,i=n[0],r=n[4],o=n[8],a=n[1],s=n[5],c=n[9],l=n[2],u=n[6],h=n[10],p=i+s+h;return p>0?(e=.5/Math.sqrt(p+1),this._w=.25/e,this._x=(u-c)*e,this._y=(o-l)*e,this._z=(a-r)*e):i>s&&i>h?(e=2*Math.sqrt(1+i-s-h),this._w=(u-c)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(o+l)/e):s>h?(e=2*Math.sqrt(1+s-i-h),this._w=(o-l)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(c+u)/e):(e=2*Math.sqrt(1+h-i-s),this._w=(a-r)/e,this._x=(o+l)/e,this._y=(c+u)/e,this._z=.25*e),this.onChangeCallback(),this},setFromUnitVectors:function(t,e){var n=1e-6,i=t.dot(e)+1;return i<n?(i=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=i),this.normalize()},angleTo:function(t){return 2*Math.acos(Math.abs(Ue.clamp(this.dot(t),-1,1)))},rotateTowards:function(t,e){var n=this.angleTo(t);if(0===n)return this;var i=Math.min(1,e/n);return this.slerp(t,i),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this.onChangeCallback(),this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,e){var n=t._x,i=t._y,r=t._z,o=t._w,a=e._x,s=e._y,c=e._z,l=e._w;return this._x=n*l+o*a+i*c-r*s,this._y=i*l+o*s+r*a-n*c,this._z=r*l+o*c+n*s-i*a,this._w=o*l-n*a-i*s-r*c,this.onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var n=this._x,i=this._y,r=this._z,o=this._w,a=o*t._w+n*t._x+i*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=n,this._y=i,this._z=r,this;var s=1-a*a;if(s<=Number.EPSILON){var c=1-e;return this._w=c*o+e*this._w,this._x=c*n+e*this._x,this._y=c*i+e*this._y,this._z=c*r+e*this._z,this.normalize()}var l=Math.sqrt(s),u=Math.atan2(l,a),h=Math.sin((1-e)*u)/l,p=Math.sin(e*u)/l;return this._w=o*h+this._w*p,this._x=n*h+this._x*p,this._y=i*h+this._y*p,this._z=r*h+this._z*p,this.onChangeCallback(),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}}),Object.assign(je.prototype,{isVector3:!0,set:function(t,e,n){return this.x=t,this.y=e,this.z=n,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},applyEuler:function(){var t=new Fe;return function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(t.setFromEuler(e))}}(),applyAxisAngle:function(){var t=new Fe;return function(e,n){return this.applyQuaternion(t.setFromAxisAngle(e,n))}}(),applyMatrix3:function(t){var e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this},applyMatrix4:function(t){var e=this.x,n=this.y,i=this.z,r=t.elements,o=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*o,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*o,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*o,this},applyQuaternion:function(t){var e=this.x,n=this.y,i=this.z,r=t.x,o=t.y,a=t.z,s=t.w,c=s*e+o*i-a*n,l=s*n+a*e-r*i,u=s*i+r*n-o*e,h=-r*e-o*n-a*i;return this.x=c*s+h*-r+l*-a-u*-o,this.y=l*s+h*-o+u*-r-c*-a,this.z=u*s+h*-a+c*-o-l*-r,this},project:function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)},unproject:function(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)},transformDirection:function(t){var e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+r[10]*i,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},cross:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)},crossVectors:function(t,e){var n=t.x,i=t.y,r=t.z,o=e.x,a=e.y,s=e.z;return this.x=i*s-r*a,this.y=r*o-n*s,this.z=n*a-i*o,this},projectOnVector:function(t){var e=t.dot(this)/t.lengthSq();return this.copy(t).multiplyScalar(e)},projectOnPlane:function(){var t=new je;return function(e){return t.copy(this).projectOnVector(e),this.sub(t)}}(),reflect:function(){var t=new je;return function(e){return this.sub(t.copy(e).multiplyScalar(2*this.dot(e)))}}(),angleTo:function(t){var e=this.dot(t)/Math.sqrt(this.lengthSq()*t.lengthSq());return Math.acos(Ue.clamp(e,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)},setFromSphericalCoords:function(t,e,n){var i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this},setFromCylindrical:function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)},setFromCylindricalCoords:function(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this},setFromMatrixPosition:function(t){var e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this},setFromMatrixScale:function(t){var e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this},setFromMatrixColumn:function(t,e){return this.fromArray(t.elements,4*e)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}}),Object.assign(Ve.prototype,{isMatrix3:!0,set:function(t,e,n,i,r,o,a,s,c){var l=this.elements;return l[0]=t,l[1]=i,l[2]=a,l[3]=e,l[4]=r,l[5]=s,l[6]=n,l[7]=o,l[8]=c,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this},setFromMatrix4:function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},applyToBufferAttribute:function(){var t=new je;return function(e){for(var n=0,i=e.count;n<i;n++)t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.applyMatrix3(this),e.setXYZ(n,t.x,t.y,t.z);return e}}(),multiply:function(t){return this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var n=t.elements,i=e.elements,r=this.elements,o=n[0],a=n[3],s=n[6],c=n[1],l=n[4],u=n[7],h=n[2],p=n[5],d=n[8],f=i[0],m=i[3],g=i[6],v=i[1],y=i[4],b=i[7],x=i[2],w=i[5],_=i[8];return r[0]=o*f+a*v+s*x,r[3]=o*m+a*y+s*w,r[6]=o*g+a*b+s*_,r[1]=c*f+l*v+u*x,r[4]=c*m+l*y+u*w,r[7]=c*g+l*b+u*_,r[2]=h*f+p*v+d*x,r[5]=h*m+p*y+d*w,r[8]=h*g+p*b+d*_,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},determinant:function(){var t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],a=t[5],s=t[6],c=t[7],l=t[8];return e*o*l-e*a*c-n*r*l+n*a*s+i*r*c-i*o*s},getInverse:function(t,e){t&&t.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var n=t.elements,i=this.elements,r=n[0],o=n[1],a=n[2],s=n[3],c=n[4],l=n[5],u=n[6],h=n[7],p=n[8],d=p*c-l*h,f=l*u-p*s,m=h*s-c*u,g=r*d+o*f+a*m;if(0===g){var v="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===e)throw new Error(v);return console.warn(v),this.identity()}var y=1/g;return i[0]=d*y,i[1]=(a*h-p*o)*y,i[2]=(l*o-a*c)*y,i[3]=f*y,i[4]=(p*r-a*u)*y,i[5]=(a*s-l*r)*y,i[6]=m*y,i[7]=(o*u-h*r)*y,i[8]=(c*r-o*s)*y,this},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},setUvTransform:function(t,e,n,i,r,o,a){var s=Math.cos(r),c=Math.sin(r);this.set(n*s,n*c,-n*(s*o+c*a)+o+t,-i*c,i*s,-i*(-c*o+s*a)+a+e,0,0,1)},scale:function(t,e){var n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=e,n[4]*=e,n[7]*=e,this},rotate:function(t){var e=Math.cos(t),n=Math.sin(t),i=this.elements,r=i[0],o=i[3],a=i[6],s=i[1],c=i[4],l=i[7];return i[0]=e*r+n*s,i[3]=e*o+n*c,i[6]=e*a+n*l,i[1]=-n*r+e*s,i[4]=-n*o+e*c,i[7]=-n*a+e*l,this},translate:function(t,e){var n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=e*n[2],n[4]+=e*n[5],n[7]+=e*n[8],this},equals:function(t){for(var e=this.elements,n=t.elements,i=0;i<9;i++)if(e[i]!==n[i])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var n=0;n<9;n++)this.elements[n]=t[n+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}});var We={getDataURL:function(t){var e;if("undefined"==typeof HTMLCanvasElement)return t.src;if(t instanceof HTMLCanvasElement)e=t;else{void 0===r&&(r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),r.width=t.width,r.height=t.height;var n=r.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=r}return e.width>2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}},qe=0;function Xe(t,e,n,i,r,o,a,s,c,l){Object.defineProperty(this,"id",{value:qe++}),this.uuid=Ue.generateUUID(),this.name="",this.image=void 0!==t?t:Xe.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:Xe.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:yt,this.wrapT=void 0!==i?i:yt,this.magFilter=void 0!==r?r:Mt,this.minFilter=void 0!==o?o:St,this.anisotropy=void 0!==c?c:1,this.format=void 0!==a?a:Ut,this.type=void 0!==s?s:Et,this.offset=new Ge(0,0),this.repeat=new Ge(1,1),this.center=new Ge(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Ve,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==l?l:Ce,this.version=0,this.onUpdate=null}function Ye(t,e,n,i){this.x=t||0,this.y=e||0,this.z=n||0,this.w=void 0!==i?i:1}function Je(t,e,n){this.width=t,this.height=e,this.scissor=new Ye(0,0,t,e),this.scissorTest=!1,this.viewport=new Ye(0,0,t,e),n=n||{},this.texture=new Xe(void 0,void 0,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:Mt,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0===n.stencilBuffer||n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function Ze(t,e,n){Je.call(this,t,e,n),this.samples=4}function $e(t,e,n){Je.call(this,t,e,n)}function Qe(t,e,n,i,r,o,a,s,c,l,u,h){Xe.call(this,null,o,a,s,c,l,i,r,u,h),this.image={data:t,width:e,height:n},this.magFilter=void 0!==c?c:xt,this.minFilter=void 0!==l?l:xt,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function Ke(t,e){this.min=void 0!==t?t:new je(1/0,1/0,1/0),this.max=void 0!==e?e:new je(-1/0,-1/0,-1/0)}function tn(t,e){this.center=void 0!==t?t:new je,this.radius=void 0!==e?e:0}function en(t,e){this.normal=void 0!==t?t:new je(1,0,0),this.constant=void 0!==e?e:0}function nn(t,e,n,i,r,o){this.planes=[void 0!==t?t:new en,void 0!==e?e:new en,void 0!==n?n:new en,void 0!==i?i:new en,void 0!==r?r:new en,void 0!==o?o:new en]}function rn(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}Xe.DEFAULT_IMAGE=void 0,Xe.DEFAULT_MAPPING=lt,Xe.prototype=Object.assign(Object.create(i.prototype),{constructor:Xe,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){var e=void 0===t||"string"===typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];var n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var i=this.image;if(void 0===i.uuid&&(i.uuid=Ue.generateUUID()),!e&&void 0===t.images[i.uuid]){var r;if(Array.isArray(i)){r=[];for(var o=0,a=i.length;o<a;o++)r.push(We.getDataURL(i[o]))}else r=We.getDataURL(i);t.images[i.uuid]={uuid:i.uuid,url:r}}n.image=i.uuid}return e||(t.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(this.mapping!==lt)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case vt:t.x=t.x-Math.floor(t.x);break;case yt:t.x=t.x<0?0:1;break;case bt:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case vt:t.y=t.y-Math.floor(t.y);break;case yt:t.y=t.y<0?0:1;break;case bt:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}}),Object.defineProperty(Xe.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Ye.prototype,{isVector4:!0,set:function(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){var e=this.x,n=this.y,i=this.z,r=this.w,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*i+o[12]*r,this.y=o[1]*e+o[5]*n+o[9]*i+o[13]*r,this.z=o[2]*e+o[6]*n+o[10]*i+o[14]*r,this.w=o[3]*e+o[7]*n+o[11]*i+o[15]*r,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,n,i,r,o=.01,a=.1,s=t.elements,c=s[0],l=s[4],u=s[8],h=s[1],p=s[5],d=s[9],f=s[2],m=s[6],g=s[10];if(Math.abs(l-h)<o&&Math.abs(u-f)<o&&Math.abs(d-m)<o){if(Math.abs(l+h)<a&&Math.abs(u+f)<a&&Math.abs(d+m)<a&&Math.abs(c+p+g-3)<a)return this.set(1,0,0,0),this;e=Math.PI;var v=(c+1)/2,y=(p+1)/2,b=(g+1)/2,x=(l+h)/4,w=(u+f)/4,_=(d+m)/4;return v>y&&v>b?v<o?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(v),i=x/n,r=w/n):y>b?y<o?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(y),n=x/i,r=_/i):b<o?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(b),n=w/r,i=_/r),this.set(n,i,r,e),this}var M=Math.sqrt((m-d)*(m-d)+(u-f)*(u-f)+(h-l)*(h-l));return Math.abs(M)<.001&&(M=1),this.x=(m-d)/M,this.y=(u-f)/M,this.z=(h-l)/M,this.w=Math.acos((c+p+g-1)/2),this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},clampScalar:function(){var t,e;return function(n,i){return void 0===t&&(t=new Ye,e=new Ye),t.set(n,n,n,n),e.set(i,i,i,i),this.clamp(t,e)}}(),clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}}),Je.prototype=Object.assign(Object.create(i.prototype),{constructor:Je,isWebGLRenderTarget:!0,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Ze.prototype=Object.assign(Object.create(Je.prototype),{constructor:Ze,isWebGLMultisampleRenderTarget:!0,copy:function(t){return Je.prototype.copy.call(this,t),this.samples=t.samples,this}}),$e.prototype=Object.create(Je.prototype),$e.prototype.constructor=$e,$e.prototype.isWebGLRenderTargetCube=!0,Qe.prototype=Object.create(Xe.prototype),Qe.prototype.constructor=Qe,Qe.prototype.isDataTexture=!0,Object.assign(Ke.prototype,{isBox3:!0,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){for(var e=1/0,n=1/0,i=1/0,r=-1/0,o=-1/0,a=-1/0,s=0,c=t.length;s<c;s+=3){var l=t[s],u=t[s+1],h=t[s+2];l<e&&(e=l),u<n&&(n=u),h<i&&(i=h),l>r&&(r=l),u>o&&(o=u),h>a&&(a=h)}return this.min.set(e,n,i),this.max.set(r,o,a),this},setFromBufferAttribute:function(t){for(var e=1/0,n=1/0,i=1/0,r=-1/0,o=-1/0,a=-1/0,s=0,c=t.count;s<c;s++){var l=t.getX(s),u=t.getY(s),h=t.getZ(s);l<e&&(e=l),u<n&&(n=u),h<i&&(i=h),l>r&&(r=l),u>o&&(o=u),h>a&&(a=h)}return this.min.set(e,n,i),this.max.set(r,o,a),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(){var t=new je;return function(e,n){var i=t.copy(n).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}}(),setFromObject:function(t){return this.makeEmpty(),this.expandByObject(t)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(t){return void 0===t&&(console.warn("THREE.Box3: .getCenter() target is now required"),t=new je),this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box3: .getSize() target is now required"),t=new je),this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},expandByObject:function(){var t,e,n,i=new je;function r(r){var o=r.geometry;if(void 0!==o)if(o.isGeometry){var a=o.vertices;for(e=0,n=a.length;e<n;e++)i.copy(a[e]),i.applyMatrix4(r.matrixWorld),t.expandByPoint(i)}else if(o.isBufferGeometry){var s=o.attributes.position;if(void 0!==s)for(e=0,n=s.count;e<n;e++)i.fromBufferAttribute(s,e).applyMatrix4(r.matrixWorld),t.expandByPoint(i)}}return function(e){return t=this,e.updateMatrixWorld(!0),e.traverse(r),this}}(),containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .getParameter() target is now required"),e=new je),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},intersectsSphere:function(){var t=new je;return function(e){return this.clampPoint(e.center,t),t.distanceToSquared(e.center)<=e.radius*e.radius}}(),intersectsPlane:function(t){var e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant},intersectsTriangle:function(){var t=new je,e=new je,n=new je,i=new je,r=new je,o=new je,a=new je,s=new je,c=new je,l=new je;function u(i){var r,o;for(r=0,o=i.length-3;r<=o;r+=3){a.fromArray(i,r);var s=c.x*Math.abs(a.x)+c.y*Math.abs(a.y)+c.z*Math.abs(a.z),l=t.dot(a),u=e.dot(a),h=n.dot(a);if(Math.max(-Math.max(l,u,h),Math.min(l,u,h))>s)return!1}return!0}return function(a){if(this.isEmpty())return!1;this.getCenter(s),c.subVectors(this.max,s),t.subVectors(a.a,s),e.subVectors(a.b,s),n.subVectors(a.c,s),i.subVectors(e,t),r.subVectors(n,e),o.subVectors(t,n);var h=[0,-i.z,i.y,0,-r.z,r.y,0,-o.z,o.y,i.z,0,-i.x,r.z,0,-r.x,o.z,0,-o.x,-i.y,i.x,0,-r.y,r.x,0,-o.y,o.x,0];return!!u(h)&&(h=[1,0,0,0,1,0,0,0,1],!!u(h)&&(l.crossVectors(i,r),h=[l.x,l.y,l.z],u(h)))}}(),clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new je),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new je;return function(e){var n=t.copy(e).clamp(this.min,this.max);return n.sub(e).length()}}(),getBoundingSphere:function(){var t=new je;return function(e){return void 0===e&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=.5*this.getSize(t).length(),e}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:function(){var t=[new je,new je,new je,new je,new je,new je,new je,new je];return function(e){return this.isEmpty()?this:(t[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),t[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),t[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),t[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),t[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),t[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),t[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),t[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(t),this)}}(),translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}),Object.assign(tn.prototype,{set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:function(){var t=new Ke;return function(e,n){var i=this.center;void 0!==n?i.copy(n):t.setFromPoints(e).getCenter(i);for(var r=0,o=0,a=e.length;o<a;o++)r=Math.max(r,i.distanceToSquared(e[o]));return this.radius=Math.sqrt(r),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},empty:function(){return this.radius<=0},containsPoint:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(t){return t.distanceTo(this.center)-this.radius},intersectsSphere:function(t){var e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius},clampPoint:function(t,e){var n=this.center.distanceToSquared(t);return void 0===e&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),e=new je),e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e},getBoundingBox:function(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new Ke),t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}}),Object.assign(en.prototype,{set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:function(){var t=new je,e=new je;return function(n,i,r){var o=t.subVectors(r,i).cross(e.subVectors(n,i)).normalize();return this.setFromNormalAndCoplanarPoint(o,n),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){return void 0===e&&(console.warn("THREE.Plane: .projectPoint() target is now required"),e=new je),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:function(){var t=new je;return function(e,n){void 0===n&&(console.warn("THREE.Plane: .intersectLine() target is now required"),n=new je);var i=e.delta(t),r=this.normal.dot(i);if(0===r)return 0===this.distanceToPoint(e.start)?n.copy(e.start):void 0;var o=-(e.start.dot(this.normal)+this.constant)/r;return o<0||o>1?void 0:n.copy(i).multiplyScalar(o).add(e.start)}}(),intersectsLine:function(t){var e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new je),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var t=new je,e=new Ve;return function(n,i){var r=i||e.getNormalMatrix(n),o=this.coplanarPoint(t).applyMatrix4(n),a=this.normal.applyMatrix3(r).normalize();return this.constant=-o.dot(a),this}}(),translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}}),Object.assign(nn.prototype,{set:function(t,e,n,i,r,o){var a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(i),a[4].copy(r),a[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,n=0;n<6;n++)e[n].copy(t.planes[n]);return this},setFromMatrix:function(t){var e=this.planes,n=t.elements,i=n[0],r=n[1],o=n[2],a=n[3],s=n[4],c=n[5],l=n[6],u=n[7],h=n[8],p=n[9],d=n[10],f=n[11],m=n[12],g=n[13],v=n[14],y=n[15];return e[0].setComponents(a-i,u-s,f-h,y-m).normalize(),e[1].setComponents(a+i,u+s,f+h,y+m).normalize(),e[2].setComponents(a+r,u+c,f+p,y+g).normalize(),e[3].setComponents(a-r,u-c,f-p,y-g).normalize(),e[4].setComponents(a-o,u-l,f-d,y-v).normalize(),e[5].setComponents(a+o,u+l,f+d,y+v).normalize(),this},intersectsObject:function(){var t=new tn;return function(e){var n=e.geometry;return null===n.boundingSphere&&n.computeBoundingSphere(),t.copy(n.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(t)}}(),intersectsSprite:function(){var t=new tn;return function(e){return t.center.set(0,0,0),t.radius=.7071067811865476,t.applyMatrix4(e.matrixWorld),this.intersectsSphere(t)}}(),intersectsSphere:function(t){for(var e=this.planes,n=t.center,i=-t.radius,r=0;r<6;r++){var o=e[r].distanceToPoint(n);if(o<i)return!1}return!0},intersectsBox:function(){var t=new je;return function(e){for(var n=this.planes,i=0;i<6;i++){var r=n[i];if(t.x=r.normal.x>0?e.max.x:e.min.x,t.y=r.normal.y>0?e.max.y:e.min.y,t.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(t)<0)return!1}return!0}}(),containsPoint:function(t){for(var e=this.planes,n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}}),Object.assign(rn.prototype,{isMatrix4:!0,set:function(t,e,n,i,r,o,a,s,c,l,u,h,p,d,f,m){var g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=i,g[1]=r,g[5]=o,g[9]=a,g[13]=s,g[2]=c,g[6]=l,g[10]=u,g[14]=h,g[3]=p,g[7]=d,g[11]=f,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new rn).fromArray(this.elements)},copy:function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this},copyPosition:function(t){var e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this},extractBasis:function(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this},extractRotation:function(){var t=new je;return function(e){var n=this.elements,i=e.elements,r=1/t.setFromMatrixColumn(e,0).length(),o=1/t.setFromMatrixColumn(e,1).length(),a=1/t.setFromMatrixColumn(e,2).length();return n[0]=i[0]*r,n[1]=i[1]*r,n[2]=i[2]*r,n[3]=0,n[4]=i[4]*o,n[5]=i[5]*o,n[6]=i[6]*o,n[7]=0,n[8]=i[8]*a,n[9]=i[9]*a,n[10]=i[10]*a,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}}(),makeRotationFromEuler:function(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,n=t.x,i=t.y,r=t.z,o=Math.cos(n),a=Math.sin(n),s=Math.cos(i),c=Math.sin(i),l=Math.cos(r),u=Math.sin(r);if("XYZ"===t.order){var h=o*l,p=o*u,d=a*l,f=a*u;e[0]=s*l,e[4]=-s*u,e[8]=c,e[1]=p+d*c,e[5]=h-f*c,e[9]=-a*s,e[2]=f-h*c,e[6]=d+p*c,e[10]=o*s}else if("YXZ"===t.order){var m=s*l,g=s*u,v=c*l,y=c*u;e[0]=m+y*a,e[4]=v*a-g,e[8]=o*c,e[1]=o*u,e[5]=o*l,e[9]=-a,e[2]=g*a-v,e[6]=y+m*a,e[10]=o*s}else if("ZXY"===t.order){m=s*l,g=s*u,v=c*l,y=c*u;e[0]=m-y*a,e[4]=-o*u,e[8]=v+g*a,e[1]=g+v*a,e[5]=o*l,e[9]=y-m*a,e[2]=-o*c,e[6]=a,e[10]=o*s}else if("ZYX"===t.order){h=o*l,p=o*u,d=a*l,f=a*u;e[0]=s*l,e[4]=d*c-p,e[8]=h*c+f,e[1]=s*u,e[5]=f*c+h,e[9]=p*c-d,e[2]=-c,e[6]=a*s,e[10]=o*s}else if("YZX"===t.order){var b=o*s,x=o*c,w=a*s,_=a*c;e[0]=s*l,e[4]=_-b*u,e[8]=w*u+x,e[1]=u,e[5]=o*l,e[9]=-a*l,e[2]=-c*l,e[6]=x*u+w,e[10]=b-_*u}else if("XZY"===t.order){b=o*s,x=o*c,w=a*s,_=a*c;e[0]=s*l,e[4]=-u,e[8]=c*l,e[1]=b*u+_,e[5]=o*l,e[9]=x*u-w,e[2]=w*u-x,e[6]=a*l,e[10]=_*u+b}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(){var t=new je(0,0,0),e=new je(1,1,1);return function(n){return this.compose(t,n,e)}}(),lookAt:function(){var t=new je,e=new je,n=new je;return function(i,r,o){var a=this.elements;return n.subVectors(i,r),0===n.lengthSq()&&(n.z=1),n.normalize(),t.crossVectors(o,n),0===t.lengthSq()&&(1===Math.abs(o.z)?n.x+=1e-4:n.z+=1e-4,n.normalize(),t.crossVectors(o,n)),t.normalize(),e.crossVectors(n,t),a[0]=t.x,a[4]=e.x,a[8]=n.x,a[1]=t.y,a[5]=e.y,a[9]=n.y,a[2]=t.z,a[6]=e.z,a[10]=n.z,this}}(),multiply:function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var n=t.elements,i=e.elements,r=this.elements,o=n[0],a=n[4],s=n[8],c=n[12],l=n[1],u=n[5],h=n[9],p=n[13],d=n[2],f=n[6],m=n[10],g=n[14],v=n[3],y=n[7],b=n[11],x=n[15],w=i[0],_=i[4],M=i[8],T=i[12],S=i[1],E=i[5],A=i[9],C=i[13],L=i[2],P=i[6],R=i[10],O=i[14],D=i[3],N=i[7],I=i[11],z=i[15];return r[0]=o*w+a*S+s*L+c*D,r[4]=o*_+a*E+s*P+c*N,r[8]=o*M+a*A+s*R+c*I,r[12]=o*T+a*C+s*O+c*z,r[1]=l*w+u*S+h*L+p*D,r[5]=l*_+u*E+h*P+p*N,r[9]=l*M+u*A+h*R+p*I,r[13]=l*T+u*C+h*O+p*z,r[2]=d*w+f*S+m*L+g*D,r[6]=d*_+f*E+m*P+g*N,r[10]=d*M+f*A+m*R+g*I,r[14]=d*T+f*C+m*O+g*z,r[3]=v*w+y*S+b*L+x*D,r[7]=v*_+y*E+b*P+x*N,r[11]=v*M+y*A+b*R+x*I,r[15]=v*T+y*C+b*O+x*z,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},applyToBufferAttribute:function(){var t=new je;return function(e){for(var n=0,i=e.count;n<i;n++)t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.applyMatrix4(this),e.setXYZ(n,t.x,t.y,t.z);return e}}(),determinant:function(){var t=this.elements,e=t[0],n=t[4],i=t[8],r=t[12],o=t[1],a=t[5],s=t[9],c=t[13],l=t[2],u=t[6],h=t[10],p=t[14],d=t[3],f=t[7],m=t[11],g=t[15];return d*(+r*s*u-i*c*u-r*a*h+n*c*h+i*a*p-n*s*p)+f*(+e*s*p-e*c*h+r*o*h-i*o*p+i*c*l-r*s*l)+m*(+e*c*u-e*a*p-r*o*u+n*o*p+r*a*l-n*c*l)+g*(-i*a*l-e*s*u+e*a*h+i*o*u-n*o*h+n*s*l)},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},setPosition:function(t,e,n){var i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this},getInverse:function(t,e){var n=this.elements,i=t.elements,r=i[0],o=i[1],a=i[2],s=i[3],c=i[4],l=i[5],u=i[6],h=i[7],p=i[8],d=i[9],f=i[10],m=i[11],g=i[12],v=i[13],y=i[14],b=i[15],x=d*y*h-v*f*h+v*u*m-l*y*m-d*u*b+l*f*b,w=g*f*h-p*y*h-g*u*m+c*y*m+p*u*b-c*f*b,_=p*v*h-g*d*h+g*l*m-c*v*m-p*l*b+c*d*b,M=g*d*u-p*v*u-g*l*f+c*v*f+p*l*y-c*d*y,T=r*x+o*w+a*_+s*M;if(0===T){var S="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===e)throw new Error(S);return console.warn(S),this.identity()}var E=1/T;return n[0]=x*E,n[1]=(v*f*s-d*y*s-v*a*m+o*y*m+d*a*b-o*f*b)*E,n[2]=(l*y*s-v*u*s+v*a*h-o*y*h-l*a*b+o*u*b)*E,n[3]=(d*u*s-l*f*s-d*a*h+o*f*h+l*a*m-o*u*m)*E,n[4]=w*E,n[5]=(p*y*s-g*f*s+g*a*m-r*y*m-p*a*b+r*f*b)*E,n[6]=(g*u*s-c*y*s-g*a*h+r*y*h+c*a*b-r*u*b)*E,n[7]=(c*f*s-p*u*s+p*a*h-r*f*h-c*a*m+r*u*m)*E,n[8]=_*E,n[9]=(g*d*s-p*v*s-g*o*m+r*v*m+p*o*b-r*d*b)*E,n[10]=(c*v*s-g*l*s+g*o*h-r*v*h-c*o*b+r*l*b)*E,n[11]=(p*l*s-c*d*s-p*o*h+r*d*h+c*o*m-r*l*m)*E,n[12]=M*E,n[13]=(p*v*a-g*d*a+g*o*f-r*v*f-p*o*y+r*d*y)*E,n[14]=(g*l*a-c*v*a-g*o*u+r*v*u+c*o*y-r*l*y)*E,n[15]=(c*d*a-p*l*a+p*o*u-r*d*u-c*o*f+r*l*f)*E,this},scale:function(t){var e=this.elements,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,this},getMaxScaleOnAxis:function(){var t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))},makeTranslation:function(t,e,n){return this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this},makeRotationX:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this},makeRotationY:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this},makeRotationZ:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,e){var n=Math.cos(e),i=Math.sin(e),r=1-n,o=t.x,a=t.y,s=t.z,c=r*o,l=r*a;return this.set(c*o+n,c*a-i*s,c*s+i*a,0,c*a+i*s,l*a+n,l*s-i*o,0,c*s-i*a,l*s+i*o,r*s*s+n,0,0,0,0,1),this},makeScale:function(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(t,e,n){return this.set(1,e,n,0,t,1,n,0,t,e,1,0,0,0,0,1),this},compose:function(t,e,n){var i=this.elements,r=e._x,o=e._y,a=e._z,s=e._w,c=r+r,l=o+o,u=a+a,h=r*c,p=r*l,d=r*u,f=o*l,m=o*u,g=a*u,v=s*c,y=s*l,b=s*u,x=n.x,w=n.y,_=n.z;return i[0]=(1-(f+g))*x,i[1]=(p+b)*x,i[2]=(d-y)*x,i[3]=0,i[4]=(p-b)*w,i[5]=(1-(h+g))*w,i[6]=(m+v)*w,i[7]=0,i[8]=(d+y)*_,i[9]=(m-v)*_,i[10]=(1-(h+f))*_,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this},decompose:function(){var t=new je,e=new rn;return function(n,i,r){var o=this.elements,a=t.set(o[0],o[1],o[2]).length(),s=t.set(o[4],o[5],o[6]).length(),c=t.set(o[8],o[9],o[10]).length(),l=this.determinant();l<0&&(a=-a),n.x=o[12],n.y=o[13],n.z=o[14],e.copy(this);var u=1/a,h=1/s,p=1/c;return e.elements[0]*=u,e.elements[1]*=u,e.elements[2]*=u,e.elements[4]*=h,e.elements[5]*=h,e.elements[6]*=h,e.elements[8]*=p,e.elements[9]*=p,e.elements[10]*=p,i.setFromRotationMatrix(e),r.x=a,r.y=s,r.z=c,this}}(),makePerspective:function(t,e,n,i,r,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var a=this.elements,s=2*r/(e-t),c=2*r/(n-i),l=(e+t)/(e-t),u=(n+i)/(n-i),h=-(o+r)/(o-r),p=-2*o*r/(o-r);return a[0]=s,a[4]=0,a[8]=l,a[12]=0,a[1]=0,a[5]=c,a[9]=u,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=p,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this},makeOrthographic:function(t,e,n,i,r,o){var a=this.elements,s=1/(e-t),c=1/(n-i),l=1/(o-r),u=(e+t)*s,h=(n+i)*c,p=(o+r)*l;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-u,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2*l,a[14]=-p,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this},equals:function(t){for(var e=this.elements,n=t.elements,i=0;i<16;i++)if(e[i]!==n[i])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var n=0;n<16;n++)this.elements[n]=t[n+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}});var on="#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",an="#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",sn="#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",cn="#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( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif",ln="#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",un="vec3 transformed = vec3( position );",hn="vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",pn="vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\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\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\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}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\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 );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\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\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\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}",dn="#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 = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\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\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\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",fn="#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",mn="#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",gn="#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvarying vec3 vViewPosition;\n#endif",vn="#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif",yn="#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",bn="#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",xn="#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",wn="#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",_n="#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 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}",Mn="#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);\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( sampler2D envMap, 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",Tn="vec3 transformedNormal = normalMatrix * objectNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = normalMatrix * objectTangent;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",Sn="#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",En="#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif",An="#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",Cn="#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",Ln="gl_FragColor = linearToOutputTexel( gl_FragColor );",Pn="\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\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.a );\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.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\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.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, 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.r, 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 = cLogLuvM * value.rgb;\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 = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",Rn="#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, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\treflectVec = normalize( reflectVec );\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = 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",On="#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\tuniform int maxMipLevel;\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",Dn="#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",Nn="#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;\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",In="#ifdef USE_FOG\n\tfogDepth = -mvPosition.z;\n#endif",zn="#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",Bn="#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",kn="#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",Hn="#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",Un="#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif",Gn="#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",Fn="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 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\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\t#pragma unroll_loop\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\t#pragma unroll_loop\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\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif",jn="uniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\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\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\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}\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 ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in 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",Vn="#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( envMap, 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( envMap, queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent ));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 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",Wn="BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",qn="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};\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_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",Xn="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",Yn="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 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( 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\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#endif\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\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\tfloat clearCoatInv = 1.0 - clearCoatDHR;\n\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec3 singleScattering = vec3( 0.0 );\n\t\tvec3 multiScattering = vec3( 0.0 );\n\t\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\t\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\t\treflectedLight.indirectSpecular += clearCoatInv * radiance * singleScattering;\n\t\treflectedLight.indirectDiffuse += multiScattering * cosineWeightedIrradiance;\n\t\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n\t#else\n\t\treflectedLight.indirectSpecular += clearCoatInv * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#endif\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}",Jn="\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\t#pragma unroll_loop\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 ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 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\t#pragma unroll_loop\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\t#pragma unroll_loop\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\t#pragma unroll_loop\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\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop\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#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearCoatRadiance = vec3( 0.0 );\n#endif",Zn="#if defined( RE_IndirectDiffuse )\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 defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), maxMipLevel );\n\t#ifndef STANDARD\n\t\tclearCoatRadiance += getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), maxMipLevel );\n\t#endif\n#endif",$n="#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, irradiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif",Qn="#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",Kn="#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n#endif",ti="#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",ei="#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\tgl_Position.z *= gl_Position.w;\n\t#endif\n#endif",ni="#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",ii="#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",ri="#ifdef USE_MAP\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif",oi="#ifdef USE_MAP\n\tuniform mat3 uvTransform;\n\tuniform sampler2D map;\n#endif",ai="float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",si="#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",ci="#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",li="#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",ui="#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",hi="#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 );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t#endif\n#endif",pi="#ifdef USE_NORMALMAP\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t#ifdef FLIP_SIDED\n\t\t\tnormal = - normal;\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\tnormal = normalize( normalMatrix * normal );\n\t#else\n\t\t#ifdef USE_TANGENT\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t\tmapN.xy = normalScale * mapN.xy;\n\t\t\tnormal = normalize( vTBN * mapN );\n\t\t#else\n\t\t\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n\t\t#endif\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",di="#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tuniform mat3 normalMatrix;\n\t#else\n\t\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\t\tvec2 st0 = dFdx( vUv.st );\n\t\t\tvec2 st1 = dFdy( vUv.st );\n\t\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\t\tvec3 N = normalize( surf_norm );\n\t\t\tmat3 tsn = mat3( S, T, N );\n\t\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t\tmapN.xy *= normalScale;\n\t\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\treturn normalize( tsn * mapN );\n\t\t}\n\t#endif\n#endif",fi="vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\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}",mi="#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",gi="vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;",vi="#if defined( DITHERING )\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",yi="#if defined( DITHERING )\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",bi="float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",xi="#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",wi="#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 ];\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\tfloat shadow = 1.0;\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\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 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\tshadow = (\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\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\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, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\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",_i="#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 ];\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",Mi="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\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\t#pragma unroll_loop\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\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif",Ti="float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\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\t#pragma unroll_loop\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\t#pragma unroll_loop\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 ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}",Si="#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",Ei="#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 boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\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",Ai="#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",Ci="#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",Li="float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",Pi="#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",Ri="#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",Oi="#ifndef saturate\n\t#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\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}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n}",Di="#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",Ni="#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 mat3 uvTransform;\n#endif",Ii="#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 = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",zi="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",Bi="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",ki="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",Hi="#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n#endif",Ui="uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",Gi="varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",Fi="uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",ji="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",Vi="#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( 1.0 - gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}",Wi="#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#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}",qi="#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",Xi="#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",Yi="uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",Ji="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",Zi="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}",$i="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}",Qi="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 <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}",Ki="#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}",tr="uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\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_begin>\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#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\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 <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",er="#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\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_begin>\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}",nr="#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_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 <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.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}",ir="#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_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 <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",rr="#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 <dithering_pars_fragment>\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_begin>\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_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\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 <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",or="#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 <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_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}",ar="#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\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\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 <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\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 <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\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 <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",sr="#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\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 <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\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_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}",cr="#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\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_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",lr="#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\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\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",ur="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_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\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}",hr="uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_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 <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",pr="uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <fog_fragment>\n}",dr="#include <fog_pars_vertex>\n#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\t#include <fog_vertex>\n}",fr="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_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\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",mr="uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",gr={alphamap_fragment:on,alphamap_pars_fragment:an,alphatest_fragment:sn,aomap_fragment:cn,aomap_pars_fragment:ln,begin_vertex:un,beginnormal_vertex:hn,bsdfs:pn,bumpmap_pars_fragment:dn,clipping_planes_fragment:fn,clipping_planes_pars_fragment:mn,clipping_planes_pars_vertex:gn,clipping_planes_vertex:vn,color_fragment:yn,color_pars_fragment:bn,color_pars_vertex:xn,color_vertex:wn,common:_n,cube_uv_reflection_fragment:Mn,defaultnormal_vertex:Tn,displacementmap_pars_vertex:Sn,displacementmap_vertex:En,emissivemap_fragment:An,emissivemap_pars_fragment:Cn,encodings_fragment:Ln,encodings_pars_fragment:Pn,envmap_fragment:Rn,envmap_pars_fragment:On,envmap_pars_vertex:Dn,envmap_physical_pars_fragment:Vn,envmap_vertex:Nn,fog_vertex:In,fog_pars_vertex:zn,fog_fragment:Bn,fog_pars_fragment:kn,gradientmap_pars_fragment:Hn,lightmap_fragment:Un,lightmap_pars_fragment:Gn,lights_lambert_vertex:Fn,lights_pars_begin:jn,lights_phong_fragment:Wn,lights_phong_pars_fragment:qn,lights_physical_fragment:Xn,lights_physical_pars_fragment:Yn,lights_fragment_begin:Jn,lights_fragment_maps:Zn,lights_fragment_end:$n,logdepthbuf_fragment:Qn,logdepthbuf_pars_fragment:Kn,logdepthbuf_pars_vertex:ti,logdepthbuf_vertex:ei,map_fragment:ni,map_pars_fragment:ii,map_particle_fragment:ri,map_particle_pars_fragment:oi,metalnessmap_fragment:ai,metalnessmap_pars_fragment:si,morphnormal_vertex:ci,morphtarget_pars_vertex:li,morphtarget_vertex:ui,normal_fragment_begin:hi,normal_fragment_maps:pi,normalmap_pars_fragment:di,packing:fi,premultiplied_alpha_fragment:mi,project_vertex:gi,dithering_fragment:vi,dithering_pars_fragment:yi,roughnessmap_fragment:bi,roughnessmap_pars_fragment:xi,shadowmap_pars_fragment:wi,shadowmap_pars_vertex:_i,shadowmap_vertex:Mi,shadowmask_pars_fragment:Ti,skinbase_vertex:Si,skinning_pars_vertex:Ei,skinning_vertex:Ai,skinnormal_vertex:Ci,specularmap_fragment:Li,specularmap_pars_fragment:Pi,tonemapping_fragment:Ri,tonemapping_pars_fragment:Oi,uv_pars_fragment:Di,uv_pars_vertex:Ni,uv_vertex:Ii,uv2_pars_fragment:zi,uv2_pars_vertex:Bi,uv2_vertex:ki,worldpos_vertex:Hi,background_frag:Ui,background_vert:Gi,cube_frag:Fi,cube_vert:ji,depth_frag:Vi,depth_vert:Wi,distanceRGBA_frag:qi,distanceRGBA_vert:Xi,equirect_frag:Yi,equirect_vert:Ji,linedashed_frag:Zi,linedashed_vert:$i,meshbasic_frag:Qi,meshbasic_vert:Ki,meshlambert_frag:tr,meshlambert_vert:er,meshmatcap_frag:nr,meshmatcap_vert:ir,meshphong_frag:rr,meshphong_vert:or,meshphysical_frag:ar,meshphysical_vert:sr,normal_frag:cr,normal_vert:lr,points_frag:ur,points_vert:hr,shadow_frag:pr,shadow_vert:dr,sprite_frag:fr,sprite_vert:mr};function vr(t){var e={};for(var n in t)for(var i in e[n]={},t[n]){var r=t[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture)?e[n][i]=r.clone():Array.isArray(r)?e[n][i]=r.slice():e[n][i]=r}return e}function yr(t){for(var e={},n=0;n<t.length;n++){var i=vr(t[n]);for(var r in i)e[r]=i[r]}return e}var br={clone:vr,merge:yr},xr={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function wr(t,e,n){return void 0===e&&void 0===n?this.set(t):this.setRGB(t,e,n)}Object.assign(wr.prototype,{isColor:!0,r:1,g:1,b:1,set:function(t){return t&&t.isColor?this.copy(t):"number"===typeof t?this.setHex(t):"string"===typeof t&&this.setStyle(t),this},setScalar:function(t){return this.r=t,this.g=t,this.b=t,this},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,n){return this.r=t,this.g=e,this.b=n,this},setHSL:function(){function t(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}return function(e,n,i){if(e=Ue.euclideanModulo(e,1),n=Ue.clamp(n,0,1),i=Ue.clamp(i,0,1),0===n)this.r=this.g=this.b=i;else{var r=i<=.5?i*(1+n):i+n-i*n,o=2*i-r;this.r=t(o,r,e+1/3),this.g=t(o,r,e),this.b=t(o,r,e-1/3)}return this}}(),setStyle:function(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){var i,r=n[1],o=n[2];switch(r){case"rgb":case"rgba":if(i=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,e(i[5]),this;if(i=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,e(i[5]),this;break;case"hsl":case"hsla":if(i=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)){var a=parseFloat(i[1])/360,s=parseInt(i[2],10)/100,c=parseInt(i[3],10)/100;return e(i[5]),this.setHSL(a,s,c)}break}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(t)){var l=n[1],u=l.length;if(3===u)return this.r=parseInt(l.charAt(0)+l.charAt(0),16)/255,this.g=parseInt(l.charAt(1)+l.charAt(1),16)/255,this.b=parseInt(l.charAt(2)+l.charAt(2),16)/255,this;if(6===u)return this.r=parseInt(l.charAt(0)+l.charAt(1),16)/255,this.g=parseInt(l.charAt(2)+l.charAt(3),16)/255,this.b=parseInt(l.charAt(4)+l.charAt(5),16)/255,this}if(t&&t.length>0){l=xr[t];void 0!==l?this.setHex(l):console.warn("THREE.Color: Unknown color "+t)}return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);var n=e>0?1/e:1;return this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this},convertGammaToLinear:function(t){return this.copyGammaToLinear(this,t),this},convertLinearToGamma:function(t){return this.copyLinearToGamma(this,t),this},copySRGBToLinear:function(){function t(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}return function(e){return this.r=t(e.r),this.g=t(e.g),this.b=t(e.b),this}}(),copyLinearToSRGB:function(){function t(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}return function(e){return this.r=t(e.r),this.g=t(e.g),this.b=t(e.b),this}}(),convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});var e,n,i=this.r,r=this.g,o=this.b,a=Math.max(i,r,o),s=Math.min(i,r,o),c=(s+a)/2;if(s===a)e=0,n=0;else{var l=a-s;switch(n=c<=.5?l/(a+s):l/(2-a-s),a){case i:e=(r-o)/l+(r<o?6:0);break;case r:e=(o-i)/l+2;break;case o:e=(i-r)/l+4;break}e/=6}return t.h=e,t.s=n,t.l=c,t},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(){var t={};return function(e,n,i){return this.getHSL(t),t.h+=e,t.s+=n,t.l+=i,this.setHSL(t.h,t.s,t.l),this}}(),add:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this},addColors:function(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this},addScalar:function(t){return this.r+=t,this.g+=t,this.b+=t,this},sub:function(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this},multiply:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this},multiplyScalar:function(t){return this.r*=t,this.g*=t,this.b*=t,this},lerp:function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this},lerpHSL:function(){var t={h:0,s:0,l:0},e={h:0,s:0,l:0};return function(n,i){this.getHSL(t),n.getHSL(e);var r=Ue.lerp(t.h,e.h,i),o=Ue.lerp(t.s,e.s,i),a=Ue.lerp(t.l,e.l,i);return this.setHSL(r,o,a),this}}(),equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t,e){return void 0===e&&(e=0),this.r=t[e],this.g=t[e+1],this.b=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t},toJSON:function(){return this.getHex()}});var _r={common:{diffuse:{value:new wr(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new Ve},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Ge(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new wr(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new wr(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},uvTransform:{value:new Ve}},sprite:{diffuse:{value:new wr(15658734)},opacity:{value:1},center:{value:new Ge(.5,.5)},rotation:{value:0},map:{value:null},uvTransform:{value:new Ve}}},Mr={basic:{uniforms:yr([_r.common,_r.specularmap,_r.envmap,_r.aomap,_r.lightmap,_r.fog]),vertexShader:gr.meshbasic_vert,fragmentShader:gr.meshbasic_frag},lambert:{uniforms:yr([_r.common,_r.specularmap,_r.envmap,_r.aomap,_r.lightmap,_r.emissivemap,_r.fog,_r.lights,{emissive:{value:new wr(0)}}]),vertexShader:gr.meshlambert_vert,fragmentShader:gr.meshlambert_frag},phong:{uniforms:yr([_r.common,_r.specularmap,_r.envmap,_r.aomap,_r.lightmap,_r.emissivemap,_r.bumpmap,_r.normalmap,_r.displacementmap,_r.gradientmap,_r.fog,_r.lights,{emissive:{value:new wr(0)},specular:{value:new wr(1118481)},shininess:{value:30}}]),vertexShader:gr.meshphong_vert,fragmentShader:gr.meshphong_frag},standard:{uniforms:yr([_r.common,_r.envmap,_r.aomap,_r.lightmap,_r.emissivemap,_r.bumpmap,_r.normalmap,_r.displacementmap,_r.roughnessmap,_r.metalnessmap,_r.fog,_r.lights,{emissive:{value:new wr(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:gr.meshphysical_vert,fragmentShader:gr.meshphysical_frag},matcap:{uniforms:yr([_r.common,_r.bumpmap,_r.normalmap,_r.displacementmap,_r.fog,{matcap:{value:null}}]),vertexShader:gr.meshmatcap_vert,fragmentShader:gr.meshmatcap_frag},points:{uniforms:yr([_r.points,_r.fog]),vertexShader:gr.points_vert,fragmentShader:gr.points_frag},dashed:{uniforms:yr([_r.common,_r.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:gr.linedashed_vert,fragmentShader:gr.linedashed_frag},depth:{uniforms:yr([_r.common,_r.displacementmap]),vertexShader:gr.depth_vert,fragmentShader:gr.depth_frag},normal:{uniforms:yr([_r.common,_r.bumpmap,_r.normalmap,_r.displacementmap,{opacity:{value:1}}]),vertexShader:gr.normal_vert,fragmentShader:gr.normal_frag},sprite:{uniforms:yr([_r.sprite,_r.fog]),vertexShader:gr.sprite_vert,fragmentShader:gr.sprite_frag},background:{uniforms:{uvTransform:{value:new Ve},t2D:{value:null}},vertexShader:gr.background_vert,fragmentShader:gr.background_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:gr.cube_vert,fragmentShader:gr.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:gr.equirect_vert,fragmentShader:gr.equirect_frag},distanceRGBA:{uniforms:yr([_r.common,_r.displacementmap,{referencePosition:{value:new je},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:gr.distanceRGBA_vert,fragmentShader:gr.distanceRGBA_frag},shadow:{uniforms:yr([_r.lights,_r.fog,{color:{value:new wr(0)},opacity:{value:1}}]),vertexShader:gr.shadow_vert,fragmentShader:gr.shadow_frag}};function Tr(){var t=null,e=!1,n=null;function i(r,o){!1!==e&&(n(r,o),t.requestAnimationFrame(i))}return{start:function(){!0!==e&&null!==n&&(t.requestAnimationFrame(i),e=!0)},stop:function(){e=!1},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function Sr(t){var e=new WeakMap;function n(e,n){var i=e.array,r=e.dynamic?35048:35044,o=t.createBuffer();t.bindBuffer(n,o),t.bufferData(n,i,r),e.onUploadCallback();var a=5126;return i instanceof Float32Array?a=5126:i instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):i instanceof Uint16Array?a=5123:i instanceof Int16Array?a=5122:i instanceof Uint32Array?a=5125:i instanceof Int32Array?a=5124:i instanceof Int8Array?a=5120:i instanceof Uint8Array&&(a=5121),{buffer:o,type:a,bytesPerElement:i.BYTES_PER_ELEMENT,version:e.version}}function i(e,n,i){var r=n.array,o=n.updateRange;t.bindBuffer(i,e),!1===n.dynamic?t.bufferData(i,r,35044):-1===o.count?t.bufferSubData(i,0,r):0===o.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(t.bufferSubData(i,o.offset*r.BYTES_PER_ELEMENT,r.subarray(o.offset,o.offset+o.count)),o.count=-1)}function r(t){return t.isInterleavedBufferAttribute&&(t=t.data),e.get(t)}function o(n){n.isInterleavedBufferAttribute&&(n=n.data);var i=e.get(n);i&&(t.deleteBuffer(i.buffer),e.delete(n))}function a(t,r){t.isInterleavedBufferAttribute&&(t=t.data);var o=e.get(t);void 0===o?e.set(t,n(t,r)):o.version<t.version&&(i(o.buffer,t,r),o.version=t.version)}return{get:r,remove:o,update:a}}function Er(t,e,n,i,r,o){this.a=t,this.b=e,this.c=n,this.normal=i&&i.isVector3?i:new je,this.vertexNormals=Array.isArray(i)?i:[],this.color=r&&r.isColor?r:new wr,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=void 0!==o?o:0}function Ar(t,e,n,i){this._x=t||0,this._y=e||0,this._z=n||0,this._order=i||Ar.DefaultOrder}function Cr(){this.mask=1}Mr.physical={uniforms:yr([Mr.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:gr.meshphysical_vert,fragmentShader:gr.meshphysical_frag},Object.assign(Er.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(var e=0,n=t.vertexNormals.length;e<n;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(e=0,n=t.vertexColors.length;e<n;e++)this.vertexColors[e]=t.vertexColors[e].clone();return this}}),Ar.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],Ar.DefaultOrder="XYZ",Object.defineProperties(Ar.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback()}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback()}}}),Object.assign(Ar.prototype,{isEuler:!0,set:function(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._order=i||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this.onChangeCallback(),this},setFromRotationMatrix:function(t,e,n){var i=Ue.clamp,r=t.elements,o=r[0],a=r[4],s=r[8],c=r[1],l=r[5],u=r[9],h=r[2],p=r[6],d=r[10];return e=e||this._order,"XYZ"===e?(this._y=Math.asin(i(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(-u,d),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(p,l),this._z=0)):"YXZ"===e?(this._x=Math.asin(-i(u,-1,1)),Math.abs(u)<.99999?(this._y=Math.atan2(s,d),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-h,o),this._z=0)):"ZXY"===e?(this._x=Math.asin(i(p,-1,1)),Math.abs(p)<.99999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(c,o))):"ZYX"===e?(this._y=Math.asin(-i(h,-1,1)),Math.abs(h)<.99999?(this._x=Math.atan2(p,d),this._z=Math.atan2(c,o)):(this._x=0,this._z=Math.atan2(-a,l))):"YZX"===e?(this._z=Math.asin(i(c,-1,1)),Math.abs(c)<.99999?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-h,o)):(this._x=0,this._y=Math.atan2(s,d))):"XZY"===e?(this._z=Math.asin(-i(a,-1,1)),Math.abs(a)<.99999?(this._x=Math.atan2(p,l),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-u,d),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+e),this._order=e,!1!==n&&this.onChangeCallback(),this},setFromQuaternion:function(){var t=new rn;return function(e,n,i){return t.makeRotationFromQuaternion(e),this.setFromRotationMatrix(t,n,i)}}(),setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:function(){var t=new Fe;return function(e){return t.setFromEuler(this),this.setFromQuaternion(t,e)}}(),equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new je(this._x,this._y,this._z)},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}}),Object.assign(Cr.prototype,{set:function(t){this.mask=1<<t|0},enable:function(t){this.mask|=1<<t|0},toggle:function(t){this.mask^=1<<t|0},disable:function(t){this.mask&=~(1<<t|0)},test:function(t){return 0!==(this.mask&t.mask)}});var Lr=0;function Pr(){Object.defineProperty(this,"id",{value:Lr++}),this.uuid=Ue.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Pr.DefaultUp.clone();var t=new je,e=new Ar,n=new Fe,i=new je(1,1,1);function r(){n.setFromEuler(e,!1)}function o(){e.setFromQuaternion(n,void 0,!1)}e.onChange(r),n.onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new rn},normalMatrix:{value:new Ve}}),this.matrix=new rn,this.matrixWorld=new rn,this.matrixAutoUpdate=Pr.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Cr,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}Pr.DefaultUp=new je(0,1,0),Pr.DefaultMatrixAutoUpdate=!0,Pr.prototype=Object.assign(Object.create(i.prototype),{constructor:Pr,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix:function(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(t){return this.quaternion.premultiply(t),this},setRotationFromAxisAngle:function(t,e){this.quaternion.setFromAxisAngle(t,e)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:function(){var t=new Fe;return function(e,n){return t.setFromAxisAngle(e,n),this.quaternion.multiply(t),this}}(),rotateOnWorldAxis:function(){var t=new Fe;return function(e,n){return t.setFromAxisAngle(e,n),this.quaternion.premultiply(t),this}}(),rotateX:function(){var t=new je(1,0,0);return function(e){return this.rotateOnAxis(t,e)}}(),rotateY:function(){var t=new je(0,1,0);return function(e){return this.rotateOnAxis(t,e)}}(),rotateZ:function(){var t=new je(0,0,1);return function(e){return this.rotateOnAxis(t,e)}}(),translateOnAxis:function(){var t=new je;return function(e,n){return t.copy(e).applyQuaternion(this.quaternion),this.position.add(t.multiplyScalar(n)),this}}(),translateX:function(){var t=new je(1,0,0);return function(e){return this.translateOnAxis(t,e)}}(),translateY:function(){var t=new je(0,1,0);return function(e){return this.translateOnAxis(t,e)}}(),translateZ:function(){var t=new je(0,0,1);return function(e){return this.translateOnAxis(t,e)}}(),localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var t=new rn;return function(e){return e.applyMatrix4(t.getInverse(this.matrixWorld))}}(),lookAt:function(){var t=new Fe,e=new rn,n=new je,i=new je;return function(r,o,a){r.isVector3?n.copy(r):n.set(r,o,a);var s=this.parent;this.updateWorldMatrix(!0,!1),i.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?e.lookAt(i,n,this.up):e.lookAt(n,i,this.up),this.quaternion.setFromRotationMatrix(e),s&&(e.extractRotation(s.matrixWorld),t.setFromRotationMatrix(e),this.quaternion.premultiply(t.inverse()))}}(),add:function(t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,t.dispatchEvent({type:"added"}),this.children.push(t)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)},remove:function(t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}var n=this.children.indexOf(t);return-1!==n&&(t.parent=null,t.dispatchEvent({type:"removed"}),this.children.splice(n,1)),this},attach:function(){var t=new rn;return function(e){return this.updateWorldMatrix(!0,!1),t.getInverse(this.matrixWorld),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),t.multiply(e.parent.matrixWorld)),e.applyMatrix(t),e.updateWorldMatrix(!1,!1),this.add(e),this}}(),getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,e){if(this[t]===e)return this;for(var n=0,i=this.children.length;n<i;n++){var r=this.children[n],o=r.getObjectByProperty(t,e);if(void 0!==o)return o}},getWorldPosition:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),t=new je),this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var t=new je,e=new je;return function(n){return void 0===n&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),n=new Fe),this.updateMatrixWorld(!0),this.matrixWorld.decompose(t,n,e),n}}(),getWorldScale:function(){var t=new je,e=new Fe;return function(n){return void 0===n&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),n=new je),this.updateMatrixWorld(!0),this.matrixWorld.decompose(t,e,n),n}}(),getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),t=new je),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()},raycast:function(){},traverse:function(t){t(this);for(var e=this.children,n=0,i=e.length;n<i;n++)e[n].traverse(t)},traverseVisible:function(t){if(!1!==this.visible){t(this);for(var e=this.children,n=0,i=e.length;n<i;n++)e[n].traverseVisible(t)}},traverseAncestors:function(t){var e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);for(var e=this.children,n=0,i=e.length;n<i;n++)e[n].updateMatrixWorld(t)},updateWorldMatrix:function(t,e){var n=this.parent;if(!0===t&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e)for(var i=this.children,r=0,o=i.length;r<o;r++)i[r].updateWorldMatrix(!1,!0)},toJSON:function(t){var e=void 0===t||"string"===typeof t,n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var i={};function r(e,n){return void 0===e[n.uuid]&&(e[n.uuid]=n.toJSON(t)),n.uuid}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),!0===this.castShadow&&(i.castShadow=!0),!0===this.receiveShadow&&(i.receiveShadow=!0),!1===this.visible&&(i.visible=!1),!1===this.frustumCulled&&(i.frustumCulled=!1),0!==this.renderOrder&&(i.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isMesh&&this.drawMode!==Se&&(i.drawMode=this.drawMode),this.isMesh||this.isLine||this.isPoints){i.geometry=r(t.geometries,this.geometry);var o=this.geometry.parameters;if(void 0!==o&&void 0!==o.shapes){var a=o.shapes;if(Array.isArray(a))for(var s=0,c=a.length;s<c;s++){var l=a[s];r(t.shapes,l)}else r(t.shapes,a)}}if(void 0!==this.material)if(Array.isArray(this.material)){var u=[];for(s=0,c=this.material.length;s<c;s++)u.push(r(t.materials,this.material[s]));i.material=u}else i.material=r(t.materials,this.material);if(this.children.length>0){i.children=[];for(s=0;s<this.children.length;s++)i.children.push(this.children[s].toJSON(t).object)}if(e){var h=m(t.geometries),p=m(t.materials),d=m(t.textures),f=m(t.images);a=m(t.shapes);h.length>0&&(n.geometries=h),p.length>0&&(n.materials=p),d.length>0&&(n.textures=d),f.length>0&&(n.images=f),a.length>0&&(n.shapes=a)}return n.object=i,n;function m(t){var e=[];for(var n in t){var i=t[n];delete i.metadata,e.push(i)}return e}},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(var n=0;n<t.children.length;n++){var i=t.children[n];this.add(i.clone())}return this}});var Rr=0;function Or(){Object.defineProperty(this,"id",{value:Rr+=2}),this.uuid=Ue.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}function Dr(t,e,n){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===n,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0}function Nr(t,e,n){Dr.call(this,new Int8Array(t),e,n)}function Ir(t,e,n){Dr.call(this,new Uint8Array(t),e,n)}function zr(t,e,n){Dr.call(this,new Uint8ClampedArray(t),e,n)}function Br(t,e,n){Dr.call(this,new Int16Array(t),e,n)}function kr(t,e,n){Dr.call(this,new Uint16Array(t),e,n)}function Hr(t,e,n){Dr.call(this,new Int32Array(t),e,n)}function Ur(t,e,n){Dr.call(this,new Uint32Array(t),e,n)}function Gr(t,e,n){Dr.call(this,new Float32Array(t),e,n)}function Fr(t,e,n){Dr.call(this,new Float64Array(t),e,n)}function jr(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function Vr(t){if(0===t.length)return-1/0;for(var e=t[0],n=1,i=t.length;n<i;++n)t[n]>e&&(e=t[n]);return e}Or.prototype=Object.assign(Object.create(i.prototype),{constructor:Or,isGeometry:!0,applyMatrix:function(t){for(var e=(new Ve).getNormalMatrix(t),n=0,i=this.vertices.length;n<i;n++){var r=this.vertices[n];r.applyMatrix4(t)}for(n=0,i=this.faces.length;n<i;n++){var o=this.faces[n];o.normal.applyMatrix3(e).normalize();for(var a=0,s=o.vertexNormals.length;a<s;a++)o.vertexNormals[a].applyMatrix3(e).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(){var t=new rn;return function(e){return t.makeRotationX(e),this.applyMatrix(t),this}}(),rotateY:function(){var t=new rn;return function(e){return t.makeRotationY(e),this.applyMatrix(t),this}}(),rotateZ:function(){var t=new rn;return function(e){return t.makeRotationZ(e),this.applyMatrix(t),this}}(),translate:function(){var t=new rn;return function(e,n,i){return t.makeTranslation(e,n,i),this.applyMatrix(t),this}}(),scale:function(){var t=new rn;return function(e,n,i){return t.makeScale(e,n,i),this.applyMatrix(t),this}}(),lookAt:function(){var t=new Pr;return function(e){t.lookAt(e),t.updateMatrix(),this.applyMatrix(t.matrix)}}(),fromBufferGeometry:function(t){var e=this,n=null!==t.index?t.index.array:void 0,i=t.attributes,r=i.position.array,o=void 0!==i.normal?i.normal.array:void 0,a=void 0!==i.color?i.color.array:void 0,s=void 0!==i.uv?i.uv.array:void 0,c=void 0!==i.uv2?i.uv2.array:void 0;void 0!==c&&(this.faceVertexUvs[1]=[]);for(var l=0;l<r.length;l+=3)e.vertices.push((new je).fromArray(r,l)),void 0!==a&&e.colors.push((new wr).fromArray(a,l));function u(t,n,i,r){var l=void 0===a?[]:[e.colors[t].clone(),e.colors[n].clone(),e.colors[i].clone()],u=void 0===o?[]:[(new je).fromArray(o,3*t),(new je).fromArray(o,3*n),(new je).fromArray(o,3*i)],h=new Er(t,n,i,u,l,r);e.faces.push(h),void 0!==s&&e.faceVertexUvs[0].push([(new Ge).fromArray(s,2*t),(new Ge).fromArray(s,2*n),(new Ge).fromArray(s,2*i)]),void 0!==c&&e.faceVertexUvs[1].push([(new Ge).fromArray(c,2*t),(new Ge).fromArray(c,2*n),(new Ge).fromArray(c,2*i)])}var h=t.groups;if(h.length>0)for(l=0;l<h.length;l++)for(var p=h[l],d=p.start,f=p.count,m=d,g=d+f;m<g;m+=3)void 0!==n?u(n[m],n[m+1],n[m+2],p.materialIndex):u(m,m+1,m+2,p.materialIndex);else if(void 0!==n)for(l=0;l<n.length;l+=3)u(n[l],n[l+1],n[l+2]);else for(l=0;l<r.length/3;l+=3)u(l,l+1,l+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},center:function(){var t=new je;return function(){return this.computeBoundingBox(),this.boundingBox.getCenter(t).negate(),this.translate(t.x,t.y,t.z),this}}(),normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,e=this.boundingSphere.radius,n=0===e?1:1/e,i=new rn;return i.set(n,0,0,-n*t.x,0,n,0,-n*t.y,0,0,n,-n*t.z,0,0,0,1),this.applyMatrix(i),this},computeFaceNormals:function(){for(var t=new je,e=new je,n=0,i=this.faces.length;n<i;n++){var r=this.faces[n],o=this.vertices[r.a],a=this.vertices[r.b],s=this.vertices[r.c];t.subVectors(s,a),e.subVectors(o,a),t.cross(e),t.normalize(),r.normal.copy(t)}},computeVertexNormals:function(t){var e,n,i,r,o,a;for(void 0===t&&(t=!0),a=new Array(this.vertices.length),e=0,n=this.vertices.length;e<n;e++)a[e]=new je;if(t){var s,c,l,u=new je,h=new je;for(i=0,r=this.faces.length;i<r;i++)o=this.faces[i],s=this.vertices[o.a],c=this.vertices[o.b],l=this.vertices[o.c],u.subVectors(l,c),h.subVectors(s,c),u.cross(h),a[o.a].add(u),a[o.b].add(u),a[o.c].add(u)}else for(this.computeFaceNormals(),i=0,r=this.faces.length;i<r;i++)o=this.faces[i],a[o.a].add(o.normal),a[o.b].add(o.normal),a[o.c].add(o.normal);for(e=0,n=this.vertices.length;e<n;e++)a[e].normalize();for(i=0,r=this.faces.length;i<r;i++){o=this.faces[i];var p=o.vertexNormals;3===p.length?(p[0].copy(a[o.a]),p[1].copy(a[o.b]),p[2].copy(a[o.c])):(p[0]=a[o.a].clone(),p[1]=a[o.b].clone(),p[2]=a[o.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var t,e,n;for(this.computeFaceNormals(),t=0,e=this.faces.length;t<e;t++){n=this.faces[t];var i=n.vertexNormals;3===i.length?(i[0].copy(n.normal),i[1].copy(n.normal),i[2].copy(n.normal)):(i[0]=n.normal.clone(),i[1]=n.normal.clone(),i[2]=n.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,e,n,i,r;for(n=0,i=this.faces.length;n<i;n++)for(r=this.faces[n],r.__originalFaceNormal?r.__originalFaceNormal.copy(r.normal):r.__originalFaceNormal=r.normal.clone(),r.__originalVertexNormals||(r.__originalVertexNormals=[]),t=0,e=r.vertexNormals.length;t<e;t++)r.__originalVertexNormals[t]?r.__originalVertexNormals[t].copy(r.vertexNormals[t]):r.__originalVertexNormals[t]=r.vertexNormals[t].clone();var o=new Or;for(o.faces=this.faces,t=0,e=this.morphTargets.length;t<e;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[];var a=this.morphNormals[t].faceNormals,s=this.morphNormals[t].vertexNormals;for(n=0,i=this.faces.length;n<i;n++)c=new je,l={a:new je,b:new je,c:new je},a.push(c),s.push(l)}var c,l,u=this.morphNormals[t];for(o.vertices=this.morphTargets[t].vertices,o.computeFaceNormals(),o.computeVertexNormals(),n=0,i=this.faces.length;n<i;n++)r=this.faces[n],c=u.faceNormals[n],l=u.vertexNormals[n],c.copy(r.normal),l.a.copy(r.vertexNormals[0]),l.b.copy(r.vertexNormals[1]),l.c.copy(r.vertexNormals[2])}for(n=0,i=this.faces.length;n<i;n++)r=this.faces[n],r.normal=r.__originalFaceNormal,r.vertexNormals=r.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Ke),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new tn),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,n){if(t&&t.isGeometry){var i,r=this.vertices.length,o=this.vertices,a=t.vertices,s=this.faces,c=t.faces,l=this.faceVertexUvs[0],u=t.faceVertexUvs[0],h=this.colors,p=t.colors;void 0===n&&(n=0),void 0!==e&&(i=(new Ve).getNormalMatrix(e));for(var d=0,f=a.length;d<f;d++){var m=a[d],g=m.clone();void 0!==e&&g.applyMatrix4(e),o.push(g)}for(d=0,f=p.length;d<f;d++)h.push(p[d].clone());for(d=0,f=c.length;d<f;d++){var v,y,b,x=c[d],w=x.vertexNormals,_=x.vertexColors;v=new Er(x.a+r,x.b+r,x.c+r),v.normal.copy(x.normal),void 0!==i&&v.normal.applyMatrix3(i).normalize();for(var M=0,T=w.length;M<T;M++)y=w[M].clone(),void 0!==i&&y.applyMatrix3(i).normalize(),v.vertexNormals.push(y);v.color.copy(x.color);for(M=0,T=_.length;M<T;M++)b=_[M],v.vertexColors.push(b.clone());v.materialIndex=x.materialIndex+n,s.push(v)}for(d=0,f=u.length;d<f;d++){var S=u[d],E=[];if(void 0!==S){for(M=0,T=S.length;M<T;M++)E.push(S[M].clone());l.push(E)}}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",t)},mergeMesh:function(t){t&&t.isMesh?(t.matrixAutoUpdate&&t.updateMatrix(),this.merge(t.geometry,t.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",t)},mergeVertices:function(){var t,e,n,i,r,o,a,s,c={},l=[],u=[],h=4,p=Math.pow(10,h);for(n=0,i=this.vertices.length;n<i;n++)t=this.vertices[n],e=Math.round(t.x*p)+"_"+Math.round(t.y*p)+"_"+Math.round(t.z*p),void 0===c[e]?(c[e]=n,l.push(this.vertices[n]),u[n]=l.length-1):u[n]=u[c[e]];var d=[];for(n=0,i=this.faces.length;n<i;n++){r=this.faces[n],r.a=u[r.a],r.b=u[r.b],r.c=u[r.c],o=[r.a,r.b,r.c];for(var f=0;f<3;f++)if(o[f]===o[(f+1)%3]){d.push(n);break}}for(n=d.length-1;n>=0;n--){var m=d[n];for(this.faces.splice(m,1),a=0,s=this.faceVertexUvs.length;a<s;a++)this.faceVertexUvs[a].splice(m,1)}var g=this.vertices.length-l.length;return this.vertices=l,g},setFromPoints:function(t){this.vertices=[];for(var e=0,n=t.length;e<n;e++){var i=t[e];this.vertices.push(new je(i.x,i.y,i.z||0))}return this},sortFacesByMaterialIndex:function(){for(var t=this.faces,e=t.length,n=0;n<e;n++)t[n]._id=n;function i(t,e){return t.materialIndex-e.materialIndex}t.sort(i);var r,o,a=this.faceVertexUvs[0],s=this.faceVertexUvs[1];a&&a.length===e&&(r=[]),s&&s.length===e&&(o=[]);for(n=0;n<e;n++){var c=t[n]._id;r&&r.push(a[c]),o&&o.push(s[c])}r&&(this.faceVertexUvs[0]=r),o&&(this.faceVertexUvs[1]=o)},toJSON:function(){var t={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),void 0!==this.parameters){var e=this.parameters;for(var n in e)void 0!==e[n]&&(t[n]=e[n]);return t}for(var i=[],r=0;r<this.vertices.length;r++){var o=this.vertices[r];i.push(o.x,o.y,o.z)}var a=[],s=[],c={},l=[],u={},h=[],p={};for(r=0;r<this.faces.length;r++){var d=this.faces[r],f=!0,m=!1,g=void 0!==this.faceVertexUvs[0][r],v=d.normal.length()>0,y=d.vertexNormals.length>0,b=1!==d.color.r||1!==d.color.g||1!==d.color.b,x=d.vertexColors.length>0,w=0;if(w=S(w,0,0),w=S(w,1,f),w=S(w,2,m),w=S(w,3,g),w=S(w,4,v),w=S(w,5,y),w=S(w,6,b),w=S(w,7,x),a.push(w),a.push(d.a,d.b,d.c),a.push(d.materialIndex),g){var _=this.faceVertexUvs[0][r];a.push(C(_[0]),C(_[1]),C(_[2]))}if(v&&a.push(E(d.normal)),y){var M=d.vertexNormals;a.push(E(M[0]),E(M[1]),E(M[2]))}if(b&&a.push(A(d.color)),x){var T=d.vertexColors;a.push(A(T[0]),A(T[1]),A(T[2]))}}function S(t,e,n){return n?t|1<<e:t&~(1<<e)}function E(t){var e=t.x.toString()+t.y.toString()+t.z.toString();return void 0!==c[e]?c[e]:(c[e]=s.length/3,s.push(t.x,t.y,t.z),c[e])}function A(t){var e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==u[e]?u[e]:(u[e]=l.length,l.push(t.getHex()),u[e])}function C(t){var e=t.x.toString()+t.y.toString();return void 0!==p[e]?p[e]:(p[e]=h.length/2,h.push(t.x,t.y),p[e])}return t.data={},t.data.vertices=i,t.data.normals=s,l.length>0&&(t.data.colors=l),h.length>0&&(t.data.uvs=[h]),t.data.faces=a,t},clone:function(){return(new Or).copy(this)},copy:function(t){var e,n,i,r,o,a;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var s=t.vertices;for(e=0,n=s.length;e<n;e++)this.vertices.push(s[e].clone());var c=t.colors;for(e=0,n=c.length;e<n;e++)this.colors.push(c[e].clone());var l=t.faces;for(e=0,n=l.length;e<n;e++)this.faces.push(l[e].clone());for(e=0,n=t.faceVertexUvs.length;e<n;e++){var u=t.faceVertexUvs[e];for(void 0===this.faceVertexUvs[e]&&(this.faceVertexUvs[e]=[]),i=0,r=u.length;i<r;i++){var h=u[i],p=[];for(o=0,a=h.length;o<a;o++){var d=h[o];p.push(d.clone())}this.faceVertexUvs[e].push(p)}}var f=t.morphTargets;for(e=0,n=f.length;e<n;e++){var m={};if(m.name=f[e].name,void 0!==f[e].vertices)for(m.vertices=[],i=0,r=f[e].vertices.length;i<r;i++)m.vertices.push(f[e].vertices[i].clone());if(void 0!==f[e].normals)for(m.normals=[],i=0,r=f[e].normals.length;i<r;i++)m.normals.push(f[e].normals[i].clone());this.morphTargets.push(m)}var g=t.morphNormals;for(e=0,n=g.length;e<n;e++){var v={};if(void 0!==g[e].vertexNormals)for(v.vertexNormals=[],i=0,r=g[e].vertexNormals.length;i<r;i++){var y=g[e].vertexNormals[i],b={};b.a=y.a.clone(),b.b=y.b.clone(),b.c=y.c.clone(),v.vertexNormals.push(b)}if(void 0!==g[e].faceNormals)for(v.faceNormals=[],i=0,r=g[e].faceNormals.length;i<r;i++)v.faceNormals.push(g[e].faceNormals[i].clone());this.morphNormals.push(v)}var x=t.skinWeights;for(e=0,n=x.length;e<n;e++)this.skinWeights.push(x[e].clone());var w=t.skinIndices;for(e=0,n=w.length;e<n;e++)this.skinIndices.push(w[e].clone());var _=t.lineDistances;for(e=0,n=_.length;e<n;e++)this.lineDistances.push(_[e]);var M=t.boundingBox;null!==M&&(this.boundingBox=M.clone());var T=t.boundingSphere;return null!==T&&(this.boundingSphere=T.clone()),this.elementsNeedUpdate=t.elementsNeedUpdate,this.verticesNeedUpdate=t.verticesNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.lineDistancesNeedUpdate=t.lineDistancesNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(Dr.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Dr.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setArray:function(t){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");return this.count=void 0!==t?t.length/this.itemSize:0,this.array=t,this},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.dynamic=t.dynamic,this},copyAt:function(t,e,n){t*=this.itemSize,n*=e.itemSize;for(var i=0,r=this.itemSize;i<r;i++)this.array[t+i]=e.array[n+i];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),o=new wr),e[n++]=o.r,e[n++]=o.g,e[n++]=o.b}return this},copyVector2sArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),o=new Ge),e[n++]=o.x,e[n++]=o.y}return this},copyVector3sArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",i),o=new je),e[n++]=o.x,e[n++]=o.y,e[n++]=o.z}return this},copyVector4sArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",i),o=new Ye),e[n++]=o.x,e[n++]=o.y,e[n++]=o.z,e[n++]=o.w}return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,e){return this.array[t*this.itemSize]=e,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,e){return this.array[t*this.itemSize+1]=e,this},getZ:function(t){return this.array[t*this.itemSize+2]},setZ:function(t,e){return this.array[t*this.itemSize+2]=e,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,e){return this.array[t*this.itemSize+3]=e,this},setXY:function(t,e,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this},setXYZ:function(t,e,n,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this},setXYZW:function(t,e,n,i,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this.array[t+3]=r,this},onUpload:function(t){return this.onUploadCallback=t,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)},toJSON:function(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized}}}),Nr.prototype=Object.create(Dr.prototype),Nr.prototype.constructor=Nr,Ir.prototype=Object.create(Dr.prototype),Ir.prototype.constructor=Ir,zr.prototype=Object.create(Dr.prototype),zr.prototype.constructor=zr,Br.prototype=Object.create(Dr.prototype),Br.prototype.constructor=Br,kr.prototype=Object.create(Dr.prototype),kr.prototype.constructor=kr,Hr.prototype=Object.create(Dr.prototype),Hr.prototype.constructor=Hr,Ur.prototype=Object.create(Dr.prototype),Ur.prototype.constructor=Ur,Gr.prototype=Object.create(Dr.prototype),Gr.prototype.constructor=Gr,Fr.prototype=Object.create(Dr.prototype),Fr.prototype.constructor=Fr,Object.assign(jr.prototype,{computeGroups:function(t){for(var e,n=[],i=void 0,r=t.faces,o=0;o<r.length;o++){var a=r[o];a.materialIndex!==i&&(i=a.materialIndex,void 0!==e&&(e.count=3*o-e.start,n.push(e)),e={start:3*o,materialIndex:i})}void 0!==e&&(e.count=3*o-e.start,n.push(e)),this.groups=n},fromGeometry:function(t){var e,n=t.faces,i=t.vertices,r=t.faceVertexUvs,o=r[0]&&r[0].length>0,a=r[1]&&r[1].length>0,s=t.morphTargets,c=s.length;if(c>0){e=[];for(var l=0;l<c;l++)e[l]={name:s[l].name,data:[]};this.morphTargets.position=e}var u,h=t.morphNormals,p=h.length;if(p>0){u=[];for(l=0;l<p;l++)u[l]={name:h[l].name,data:[]};this.morphTargets.normal=u}var d=t.skinIndices,f=t.skinWeights,m=d.length===i.length,g=f.length===i.length;i.length>0&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(l=0;l<n.length;l++){var v=n[l];this.vertices.push(i[v.a],i[v.b],i[v.c]);var y=v.vertexNormals;if(3===y.length)this.normals.push(y[0],y[1],y[2]);else{var b=v.normal;this.normals.push(b,b,b)}var x=v.vertexColors;if(3===x.length)this.colors.push(x[0],x[1],x[2]);else{var w=v.color;this.colors.push(w,w,w)}if(!0===o){var _=r[0][l];void 0!==_?this.uvs.push(_[0],_[1],_[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",l),this.uvs.push(new Ge,new Ge,new Ge))}if(!0===a){_=r[1][l];void 0!==_?this.uvs2.push(_[0],_[1],_[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",l),this.uvs2.push(new Ge,new Ge,new Ge))}for(var M=0;M<c;M++){var T=s[M].vertices;e[M].data.push(T[v.a],T[v.b],T[v.c])}for(M=0;M<p;M++){var S=h[M].vertexNormals[l];u[M].data.push(S.a,S.b,S.c)}m&&this.skinIndices.push(d[v.a],d[v.b],d[v.c]),g&&this.skinWeights.push(f[v.a],f[v.b],f[v.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this}});var Wr=1;function qr(){Object.defineProperty(this,"id",{value:Wr+=2}),this.uuid=Ue.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}function Xr(t,e,n,i,r,o){Or.call(this),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:o},this.fromBufferGeometry(new Yr(t,e,n,i,r,o)),this.mergeVertices()}function Yr(t,e,n,i,r,o){qr.call(this),this.type="BoxBufferGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:o};var a=this;t=t||1,e=e||1,n=n||1,i=Math.floor(i)||1,r=Math.floor(r)||1,o=Math.floor(o)||1;var s=[],c=[],l=[],u=[],h=0,p=0;function d(t,e,n,i,r,o,d,f,m,g,v){var y,b,x=o/m,w=d/g,_=o/2,M=d/2,T=f/2,S=m+1,E=g+1,A=0,C=0,L=new je;for(b=0;b<E;b++){var P=b*w-M;for(y=0;y<S;y++){var R=y*x-_;L[t]=R*i,L[e]=P*r,L[n]=T,c.push(L.x,L.y,L.z),L[t]=0,L[e]=0,L[n]=f>0?1:-1,l.push(L.x,L.y,L.z),u.push(y/m),u.push(1-b/g),A+=1}}for(b=0;b<g;b++)for(y=0;y<m;y++){var O=h+y+S*b,D=h+y+S*(b+1),N=h+(y+1)+S*(b+1),I=h+(y+1)+S*b;s.push(O,D,I),s.push(D,N,I),C+=6}a.addGroup(p,C,v),p+=C,h+=A}d("z","y","x",-1,-1,n,e,t,o,r,0),d("z","y","x",1,-1,n,e,-t,o,r,1),d("x","z","y",1,1,t,n,e,i,o,2),d("x","z","y",1,-1,t,n,-e,i,o,3),d("x","y","z",1,-1,t,e,n,i,r,4),d("x","y","z",-1,-1,t,e,-n,i,r,5),this.setIndex(s),this.addAttribute("position",new Gr(c,3)),this.addAttribute("normal",new Gr(l,3)),this.addAttribute("uv",new Gr(u,2))}function Jr(t,e,n,i){Or.call(this),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i},this.fromBufferGeometry(new Zr(t,e,n,i)),this.mergeVertices()}function Zr(t,e,n,i){qr.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i},t=t||1,e=e||1;var r,o,a=t/2,s=e/2,c=Math.floor(n)||1,l=Math.floor(i)||1,u=c+1,h=l+1,p=t/c,d=e/l,f=[],m=[],g=[],v=[];for(o=0;o<h;o++){var y=o*d-s;for(r=0;r<u;r++){var b=r*p-a;m.push(b,-y,0),g.push(0,0,1),v.push(r/c),v.push(1-o/l)}}for(o=0;o<l;o++)for(r=0;r<c;r++){var x=r+u*o,w=r+u*(o+1),_=r+1+u*(o+1),M=r+1+u*o;f.push(x,w,M),f.push(w,_,M)}this.setIndex(f),this.addAttribute("position",new Gr(m,3)),this.addAttribute("normal",new Gr(g,3)),this.addAttribute("uv",new Gr(v,2))}qr.prototype=Object.assign(Object.create(i.prototype),{constructor:qr,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){Array.isArray(t)?this.index=new(Vr(t)>65535?Ur:kr)(t,1):this.index=t},addAttribute:function(t,e){return e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):(this.attributes[t]=e,this):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.addAttribute(t,new Dr(arguments[1],arguments[2])))},getAttribute:function(t){return this.attributes[t]},removeAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,n){this.groups.push({start:t,count:e,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix:function(t){var e=this.attributes.position;void 0!==e&&(t.applyToBufferAttribute(e),e.needsUpdate=!0);var n=this.attributes.normal;if(void 0!==n){var i=(new Ve).getNormalMatrix(t);i.applyToBufferAttribute(n),n.needsUpdate=!0}var r=this.attributes.tangent;if(void 0!==r){i=(new Ve).getNormalMatrix(t);i.applyToBufferAttribute(r),r.needsUpdate=!0}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(){var t=new rn;return function(e){return t.makeRotationX(e),this.applyMatrix(t),this}}(),rotateY:function(){var t=new rn;return function(e){return t.makeRotationY(e),this.applyMatrix(t),this}}(),rotateZ:function(){var t=new rn;return function(e){return t.makeRotationZ(e),this.applyMatrix(t),this}}(),translate:function(){var t=new rn;return function(e,n,i){return t.makeTranslation(e,n,i),this.applyMatrix(t),this}}(),scale:function(){var t=new rn;return function(e,n,i){return t.makeScale(e,n,i),this.applyMatrix(t),this}}(),lookAt:function(){var t=new Pr;return function(e){t.lookAt(e),t.updateMatrix(),this.applyMatrix(t.matrix)}}(),center:function(){var t=new je;return function(){return this.computeBoundingBox(),this.boundingBox.getCenter(t).negate(),this.translate(t.x,t.y,t.z),this}}(),setFromObject:function(t){var e=t.geometry;if(t.isPoints||t.isLine){var n=new Gr(3*e.vertices.length,3),i=new Gr(3*e.colors.length,3);if(this.addAttribute("position",n.copyVector3sArray(e.vertices)),this.addAttribute("color",i.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){var r=new Gr(e.lineDistances.length,1);this.addAttribute("lineDistance",r.copyArray(e.lineDistances))}null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t.isMesh&&e&&e.isGeometry&&this.fromGeometry(e);return this},setFromPoints:function(t){for(var e=[],n=0,i=t.length;n<i;n++){var r=t[n];e.push(r.x,r.y,r.z||0)}return this.addAttribute("position",new Gr(e,3)),this},updateFromObject:function(t){var e,n=t.geometry;if(t.isMesh){var i=n.__directGeometry;if(!0===n.elementsNeedUpdate&&(i=void 0,n.elementsNeedUpdate=!1),void 0===i)return this.fromGeometry(n);i.verticesNeedUpdate=n.verticesNeedUpdate,i.normalsNeedUpdate=n.normalsNeedUpdate,i.colorsNeedUpdate=n.colorsNeedUpdate,i.uvsNeedUpdate=n.uvsNeedUpdate,i.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=i}return!0===n.verticesNeedUpdate&&(e=this.attributes.position,void 0!==e&&(e.copyVector3sArray(n.vertices),e.needsUpdate=!0),n.verticesNeedUpdate=!1),!0===n.normalsNeedUpdate&&(e=this.attributes.normal,void 0!==e&&(e.copyVector3sArray(n.normals),e.needsUpdate=!0),n.normalsNeedUpdate=!1),!0===n.colorsNeedUpdate&&(e=this.attributes.color,void 0!==e&&(e.copyColorsArray(n.colors),e.needsUpdate=!0),n.colorsNeedUpdate=!1),n.uvsNeedUpdate&&(e=this.attributes.uv,void 0!==e&&(e.copyVector2sArray(n.uvs),e.needsUpdate=!0),n.uvsNeedUpdate=!1),n.lineDistancesNeedUpdate&&(e=this.attributes.lineDistance,void 0!==e&&(e.copyArray(n.lineDistances),e.needsUpdate=!0),n.lineDistancesNeedUpdate=!1),n.groupsNeedUpdate&&(n.computeGroups(t.geometry),this.groups=n.groups,n.groupsNeedUpdate=!1),this},fromGeometry:function(t){return t.__directGeometry=(new jr).fromGeometry(t),this.fromDirectGeometry(t.__directGeometry)},fromDirectGeometry:function(t){var e=new Float32Array(3*t.vertices.length);if(this.addAttribute("position",new Dr(e,3).copyVector3sArray(t.vertices)),t.normals.length>0){var n=new Float32Array(3*t.normals.length);this.addAttribute("normal",new Dr(n,3).copyVector3sArray(t.normals))}if(t.colors.length>0){var i=new Float32Array(3*t.colors.length);this.addAttribute("color",new Dr(i,3).copyColorsArray(t.colors))}if(t.uvs.length>0){var r=new Float32Array(2*t.uvs.length);this.addAttribute("uv",new Dr(r,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){var o=new Float32Array(2*t.uvs2.length);this.addAttribute("uv2",new Dr(o,2).copyVector2sArray(t.uvs2))}for(var a in this.groups=t.groups,t.morphTargets){for(var s=[],c=t.morphTargets[a],l=0,u=c.length;l<u;l++){var h=c[l],p=new Gr(3*h.data.length,3);p.name=h.name,s.push(p.copyVector3sArray(h.data))}this.morphAttributes[a]=s}if(t.skinIndices.length>0){var d=new Gr(4*t.skinIndices.length,4);this.addAttribute("skinIndex",d.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){var f=new Gr(4*t.skinWeights.length,4);this.addAttribute("skinWeight",f.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){var t=new Ke;return function(){null===this.boundingBox&&(this.boundingBox=new Ke);var e=this.attributes.position,n=this.morphAttributes.position;if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),n)for(var i=0,r=n.length;i<r;i++){var o=n[i];t.setFromBufferAttribute(o),this.boundingBox.expandByPoint(t.min),this.boundingBox.expandByPoint(t.max)}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}}(),computeBoundingSphere:function(){var t=new Ke,e=new Ke,n=new je;return function(){null===this.boundingSphere&&(this.boundingSphere=new tn);var i=this.attributes.position,r=this.morphAttributes.position;if(i){var o=this.boundingSphere.center;if(t.setFromBufferAttribute(i),r)for(var a=0,s=r.length;a<s;a++){var c=r[a];e.setFromBufferAttribute(c),t.expandByPoint(e.min),t.expandByPoint(e.max)}t.getCenter(o);var l=0;for(a=0,s=i.count;a<s;a++)n.fromBufferAttribute(i,a),l=Math.max(l,o.distanceToSquared(n));if(r)for(a=0,s=r.length;a<s;a++){c=r[a];for(var u=0,h=c.count;u<h;u++)n.fromBufferAttribute(c,u),l=Math.max(l,o.distanceToSquared(n))}this.boundingSphere.radius=Math.sqrt(l),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var t=this.index,e=this.attributes;if(e.position){var n=e.position.array;if(void 0===e.normal)this.addAttribute("normal",new Dr(new Float32Array(n.length),3));else for(var i=e.normal.array,r=0,o=i.length;r<o;r++)i[r]=0;var a,s,c,l=e.normal.array,u=new je,h=new je,p=new je,d=new je,f=new je;if(t){var m=t.array;for(r=0,o=t.count;r<o;r+=3)a=3*m[r+0],s=3*m[r+1],c=3*m[r+2],u.fromArray(n,a),h.fromArray(n,s),p.fromArray(n,c),d.subVectors(p,h),f.subVectors(u,h),d.cross(f),l[a]+=d.x,l[a+1]+=d.y,l[a+2]+=d.z,l[s]+=d.x,l[s+1]+=d.y,l[s+2]+=d.z,l[c]+=d.x,l[c+1]+=d.y,l[c+2]+=d.z}else for(r=0,o=n.length;r<o;r+=9)u.fromArray(n,r),h.fromArray(n,r+3),p.fromArray(n,r+6),d.subVectors(p,h),f.subVectors(u,h),d.cross(f),l[r]=d.x,l[r+1]=d.y,l[r+2]=d.z,l[r+3]=d.x,l[r+4]=d.y,l[r+5]=d.z,l[r+6]=d.x,l[r+7]=d.y,l[r+8]=d.z;this.normalizeNormals(),e.normal.needsUpdate=!0}},merge:function(t,e){if(t&&t.isBufferGeometry){void 0===e&&(e=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var n=this.attributes;for(var i in n)if(void 0!==t.attributes[i])for(var r=n[i],o=r.array,a=t.attributes[i],s=a.array,c=a.itemSize*e,l=Math.min(s.length,o.length-c),u=0,h=c;u<l;u++,h++)o[h]=s[u];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t)},normalizeNormals:function(){var t=new je;return function(){for(var e=this.attributes.normal,n=0,i=e.count;n<i;n++)t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.normalize(),e.setXYZ(n,t.x,t.y,t.z)}}(),toNonIndexed:function(){function t(t,e){for(var n=t.array,i=t.itemSize,r=new n.constructor(e.length*i),o=0,a=0,s=0,c=e.length;s<c;s++){o=e[s]*i;for(var l=0;l<i;l++)r[a++]=n[o++]}return new Dr(r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var e=new qr,n=this.index.array,i=this.attributes;for(var r in i){var o=i[r],a=t(o,n);e.addAttribute(r,a)}var s=this.morphAttributes;for(r in s){for(var c=[],l=s[r],u=0,h=l.length;u<h;u++){o=l[u],a=t(o,n);c.push(a)}e.morphAttributes[r]=c}for(var p=this.groups,d=(u=0,p.length);u<d;u++){var f=p[u];e.addGroup(f.start,f.count,f.materialIndex)}return e},toJSON:function(){var t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){var e=this.parameters;for(var n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};var i=this.index;null!==i&&(t.data.index={type:i.array.constructor.name,array:Array.prototype.slice.call(i.array)});var r=this.attributes;for(var n in r){var o=r[n],a=o.toJSON();""!==o.name&&(a.name=o.name),t.data.attributes[n]=a}var s={},c=!1;for(var n in this.morphAttributes){for(var l=this.morphAttributes[n],u=[],h=0,p=l.length;h<p;h++){o=l[h],a=o.toJSON();""!==o.name&&(a.name=o.name),u.push(a)}u.length>0&&(s[n]=u,c=!0)}c&&(t.data.morphAttributes=s);var d=this.groups;d.length>0&&(t.data.groups=JSON.parse(JSON.stringify(d)));var f=this.boundingSphere;return null!==f&&(t.data.boundingSphere={center:f.center.toArray(),radius:f.radius}),t},clone:function(){return(new qr).copy(this)},copy:function(t){var e,n,i;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var r=t.index;null!==r&&this.setIndex(r.clone());var o=t.attributes;for(e in o){var a=o[e];this.addAttribute(e,a.clone())}var s=t.morphAttributes;for(e in s){var c=[],l=s[e];for(n=0,i=l.length;n<i;n++)c.push(l[n].clone());this.morphAttributes[e]=c}var u=t.groups;for(n=0,i=u.length;n<i;n++){var h=u[n];this.addGroup(h.start,h.count,h.materialIndex)}var p=t.boundingBox;null!==p&&(this.boundingBox=p.clone());var d=t.boundingSphere;return null!==d&&(this.boundingSphere=d.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Xr.prototype=Object.create(Or.prototype),Xr.prototype.constructor=Xr,Yr.prototype=Object.create(qr.prototype),Yr.prototype.constructor=Yr,Jr.prototype=Object.create(Or.prototype),Jr.prototype.constructor=Jr,Zr.prototype=Object.create(qr.prototype),Zr.prototype.constructor=Zr;var $r=0;function Qr(){Object.defineProperty(this,"id",{value:$r++}),this.uuid=Ue.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=S,this.side=g,this.flatShading=!1,this.vertexTangents=!1,this.vertexColors=w,this.opacity=1,this.transparent=!1,this.blendSrc=H,this.blendDst=U,this.blendEquation=P,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=J,this.depthTest=!0,this.depthWrite=!0,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.userData={},this.needsUpdate=!0}Qr.prototype=Object.assign(Object.create(i.prototype),{constructor:Qr,isMaterial:!0,onBeforeCompile:function(){},setValues:function(t){if(void 0!==t)for(var e in t){var n=t[e];if(void 0!==n)if("shading"!==e){var i=this[e];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===b;else console.warn("THREE.Material: '"+e+"' parameter is undefined.")}},toJSON:function(t){var e=void 0===t||"string"===typeof t;e&&(t={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function i(t){var e=[];for(var n in t){var i=t[n];delete i.metadata,e.push(i)}return e}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearCoat&&(n.clearCoat=this.clearCoat),void 0!==this.clearCoatRoughness&&(n.clearCoatRoughness=this.clearCoatRoughness),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,n.reflectivity=this.reflectivity,void 0!==this.combine&&(n.combine=this.combine),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==S&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),this.side!==g&&(n.side=this.side),this.vertexColors!==w&&(n.vertexColors=this.vertexColors),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),e){var r=i(t.textures),o=i(t.images);r.length>0&&(n.textures=r),o.length>0&&(n.images=o)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.lights=t.lights,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.userData=JSON.parse(JSON.stringify(t.userData)),this.clipShadows=t.clipShadows,this.clipIntersection=t.clipIntersection;var e=t.clippingPlanes,n=null;if(null!==e){var i=e.length;n=new Array(i);for(var r=0;r!==i;++r)n[r]=e[r].clone()}return this.clippingPlanes=n,this.shadowSide=t.shadowSide,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var Kr="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",to="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";function eo(t){Qr.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=Kr,this.fragmentShader=to,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,void 0!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}function no(t,e){this.origin=void 0!==t?t:new je,this.direction=void 0!==e?e:new je}function io(t,e,n){this.a=void 0!==t?t:new je,this.b=void 0!==e?e:new je,this.c=void 0!==n?n:new je}function ro(t){Qr.call(this),this.type="MeshBasicMaterial",this.color=new wr(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=tt,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.lights=!1,this.setValues(t)}function oo(t,e){Pr.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new qr,this.material=void 0!==e?e:new ro({color:16777215*Math.random()}),this.drawMode=Se,this.updateMorphTargets()}function ao(t,e,n,i){var r,o,a=new wr(0),s=0,c=null,l=0;function u(e,i,u,p){var d=i.background,f=t.vr,m=f.getSession&&f.getSession();if(m&&"additive"===m.environmentBlendMode&&(d=null),null===d?(h(a,s),c=null,l=0):d&&d.isColor&&(h(d,1),p=!0,c=null,l=0),(t.autoClear||p)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),d&&(d.isCubeTexture||d.isWebGLRenderTargetCube)){void 0===o&&(o=new oo(new Yr(1,1,1),new eo({type:"BackgroundCubeMaterial",uniforms:vr(Mr.cube.uniforms),vertexShader:Mr.cube.vertexShader,fragmentShader:Mr.cube.fragmentShader,side:v,depthTest:!1,depthWrite:!1,fog:!1})),o.geometry.removeAttribute("normal"),o.geometry.removeAttribute("uv"),o.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.tCube.value}}),n.update(o));var y=d.isWebGLRenderTargetCube?d.texture:d;o.material.uniforms.tCube.value=y,o.material.uniforms.tFlip.value=d.isWebGLRenderTargetCube?1:-1,c===d&&l===y.version||(o.material.needsUpdate=!0,c=d,l=y.version),e.unshift(o,o.geometry,o.material,0,0,null)}else d&&d.isTexture&&(void 0===r&&(r=new oo(new Zr(2,2),new eo({type:"BackgroundMaterial",uniforms:vr(Mr.background.uniforms),vertexShader:Mr.background.vertexShader,fragmentShader:Mr.background.fragmentShader,side:g,depthTest:!1,depthWrite:!1,fog:!1})),r.geometry.removeAttribute("normal"),Object.defineProperty(r.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(r)),r.material.uniforms.t2D.value=d,!0===d.matrixAutoUpdate&&d.updateMatrix(),r.material.uniforms.uvTransform.value.copy(d.matrix),c===d&&l===d.version||(r.material.needsUpdate=!0,c=d,l=d.version),e.unshift(r,r.geometry,r.material,0,0,null))}function h(t,n){e.buffers.color.setClear(t.r,t.g,t.b,n,i)}return{getClearColor:function(){return a},setClearColor:function(t,e){a.set(t),s=void 0!==e?e:1,h(a,s)},getClearAlpha:function(){return s},setClearAlpha:function(t){s=t,h(a,s)},render:u}}function so(t,e,n,i){var r;function o(t){r=t}function a(e,i){t.drawArrays(r,e,i),n.update(i,r)}function s(o,a,s){var c;if(i.isWebGL2)c=t;else if(c=e.get("ANGLE_instanced_arrays"),null===c)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");c[i.isWebGL2?"drawArraysInstanced":"drawArraysInstancedANGLE"](r,a,s,o.maxInstancedCount),n.update(s,r,o.maxInstancedCount)}this.setMode=o,this.render=a,this.renderInstances=s}function co(t,e,n){var i;function r(){if(void 0!==i)return i;var n=e.get("EXT_texture_filter_anisotropic");return i=null!==n?t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,i}function o(e){if("highp"===e){if(t.getShaderPrecisionFormat(35633,36338).precision>0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var a="undefined"!==typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext,s=void 0!==n.precision?n.precision:"highp",c=o(s);c!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",c,"instead."),s=c);var l=!0===n.logarithmicDepthBuffer,u=t.getParameter(34930),h=t.getParameter(35660),p=t.getParameter(3379),d=t.getParameter(34076),f=t.getParameter(34921),m=t.getParameter(36347),g=t.getParameter(36348),v=t.getParameter(36349),y=h>0,b=a||!!e.get("OES_texture_float"),x=y&&b,w=a?t.getParameter(36183):0;return{isWebGL2:a,getMaxAnisotropy:r,getMaxPrecision:o,precision:s,logarithmicDepthBuffer:l,maxTextures:u,maxVertexTextures:h,maxTextureSize:p,maxCubemapSize:d,maxAttributes:f,maxVertexUniforms:m,maxVaryings:g,maxFragmentUniforms:v,vertexTextures:y,floatFragmentTextures:b,floatVertexTextures:x,maxSamples:w}}function lo(){var t=this,e=null,n=0,i=!1,r=!1,o=new en,a=new Ve,s={value:null,needsUpdate:!1};function c(){s.value!==e&&(s.value=e,s.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function l(e,n,i,r){var c=null!==e?e.length:0,l=null;if(0!==c){if(l=s.value,!0!==r||null===l){var u=i+4*c,h=n.matrixWorldInverse;a.getNormalMatrix(h),(null===l||l.length<u)&&(l=new Float32Array(u));for(var p=0,d=i;p!==c;++p,d+=4)o.copy(e[p]).applyMatrix4(h,a),o.normal.toArray(l,d),l[d+3]=o.constant}s.value=l,s.needsUpdate=!0}return t.numPlanes=c,l}this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(t,r,o){var a=0!==t.length||r||0!==n||i;return i=r,e=l(t,o,0),n=t.length,a},this.beginShadows=function(){r=!0,l(null)},this.endShadows=function(){r=!1,c()},this.setState=function(t,o,a,u,h,p){if(!i||null===t||0===t.length||r&&!a)r?l(null):c();else{var d=r?0:n,f=4*d,m=h.clippingState||null;s.value=m,m=l(t,u,f,p);for(var g=0;g!==f;++g)m[g]=e[g];h.clippingState=m,this.numIntersection=o?this.numPlanes:0,this.numPlanes+=d}}}function uo(t){var e={};return{get:function(n){if(void 0!==e[n])return e[n];var i;switch(n){case"WEBGL_depth_texture":i=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=t.getExtension(n)}return null===i&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),e[n]=i,i}}}function ho(t,e,n){var i={},r={};function o(t){var a=t.target,s=i[a.id];for(var c in null!==s.index&&e.remove(s.index),s.attributes)e.remove(s.attributes[c]);a.removeEventListener("dispose",o),delete i[a.id];var l=r[s.id];l&&(e.remove(l),delete r[s.id]),n.memory.geometries--}function a(t,e){var r=i[e.id];return r||(e.addEventListener("dispose",o),e.isBufferGeometry?r=e:e.isGeometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new qr).setFromObject(t)),r=e._bufferGeometry),i[e.id]=r,n.memory.geometries++,r)}function s(t){var n=t.index,i=t.attributes;for(var r in null!==n&&e.update(n,34963),i)e.update(i[r],34962);var o=t.morphAttributes;for(var r in o)for(var a=o[r],s=0,c=a.length;s<c;s++)e.update(a[s],34962)}function c(t){var n=r[t.id];if(n)return n;var i=[],o=t.index,a=t.attributes;if(null!==o)for(var s=o.array,c=0,l=s.length;c<l;c+=3){var u=s[c+0],h=s[c+1],p=s[c+2];i.push(u,h,h,p,p,u)}else for(s=a.position.array,c=0,l=s.length/3-1;c<l;c+=3){u=c+0,h=c+1,p=c+2;i.push(u,h,h,p,p,u)}return n=new(Vr(i)>65535?Ur:kr)(i,1),e.update(n,34963),r[t.id]=n,n}return{get:a,update:s,getWireframeAttribute:c}}function po(t,e,n,i){var r,o,a;function s(t){r=t}function c(t){o=t.type,a=t.bytesPerElement}function l(e,i){t.drawElements(r,i,o,e*a),n.update(i,r)}function u(s,c,l){if(i.isWebGL2)u=t;else{var u=e.get("ANGLE_instanced_arrays");if(null===u)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")}u[i.isWebGL2?"drawElementsInstanced":"drawElementsInstancedANGLE"](r,l,o,c*a,s.maxInstancedCount),n.update(l,r,s.maxInstancedCount)}this.setMode=s,this.setIndex=c,this.render=l,this.renderInstances=u}function fo(t){var e={geometries:0,textures:0},n={frame:0,calls:0,triangles:0,points:0,lines:0};function i(t,e,i){switch(i=i||1,n.calls++,e){case 4:n.triangles+=i*(t/3);break;case 5:case 6:n.triangles+=i*(t-2);break;case 1:n.lines+=i*(t/2);break;case 3:n.lines+=i*(t-1);break;case 2:n.lines+=i*t;break;case 0:n.points+=i*t;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",e);break}}function r(){n.frame++,n.calls=0,n.triangles=0,n.points=0,n.lines=0}return{memory:e,render:n,programs:null,autoReset:!0,reset:r,update:i}}function mo(t,e){return Math.abs(e[1])-Math.abs(t[1])}function go(t){var e={},n=new Float32Array(8);function i(i,r,o,a){var s=i.morphTargetInfluences,c=s.length,l=e[r.id];if(void 0===l){l=[];for(var u=0;u<c;u++)l[u]=[u,0];e[r.id]=l}var h=o.morphTargets&&r.morphAttributes.position,p=o.morphNormals&&r.morphAttributes.normal;for(u=0;u<c;u++){var d=l[u];0!==d[1]&&(h&&r.removeAttribute("morphTarget"+u),p&&r.removeAttribute("morphNormal"+u))}for(u=0;u<c;u++){d=l[u];d[0]=u,d[1]=s[u]}l.sort(mo);for(u=0;u<8;u++){d=l[u];if(d){var f=d[0],m=d[1];if(m){h&&r.addAttribute("morphTarget"+u,h[f]),p&&r.addAttribute("morphNormal"+u,p[f]),n[u]=m;continue}}n[u]=0}a.getUniforms().setValue(t,"morphTargetInfluences",n)}return{update:i}}function vo(t,e){var n={};function i(i){var r=e.render.frame,o=i.geometry,a=t.get(i,o);return n[a.id]!==r&&(o.isGeometry&&a.updateFromObject(i),t.update(a),n[a.id]=r),a}function r(){n={}}return{update:i,dispose:r}}function yo(t,e,n,i,r,o,a,s,c,l){t=void 0!==t?t:[],e=void 0!==e?e:ut,a=void 0!==a?a:Ht,Xe.call(this,t,e,n,i,r,o,a,s,c,l),this.flipY=!1}function bo(t,e,n,i){Xe.call(this,null),this.image={data:t,width:e,height:n,depth:i},this.magFilter=xt,this.minFilter=xt,this.wrapR=yt,this.generateMipmaps=!1,this.flipY=!1}function xo(t,e,n,i){Xe.call(this,null),this.image={data:t,width:e,height:n,depth:i},this.magFilter=xt,this.minFilter=xt,this.wrapR=yt,this.generateMipmaps=!1,this.flipY=!1}eo.prototype=Object.create(Qr.prototype),eo.prototype.constructor=eo,eo.prototype.isShaderMaterial=!0,eo.prototype.copy=function(t){return Qr.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=vr(t.uniforms),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=t.extensions,this},eo.prototype.toJSON=function(t){var e=Qr.prototype.toJSON.call(this,t);for(var n in e.uniforms={},this.uniforms){var i=this.uniforms[n],r=i.value;r&&r.isTexture?e.uniforms[n]={type:"t",value:r.toJSON(t).uuid}:r&&r.isColor?e.uniforms[n]={type:"c",value:r.getHex()}:r&&r.isVector2?e.uniforms[n]={type:"v2",value:r.toArray()}:r&&r.isVector3?e.uniforms[n]={type:"v3",value:r.toArray()}:r&&r.isVector4?e.uniforms[n]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?e.uniforms[n]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?e.uniforms[n]={type:"m4",value:r.toArray()}:e.uniforms[n]={value:r}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;var o={};for(var a in this.extensions)!0===this.extensions[a]&&(o[a]=!0);return Object.keys(o).length>0&&(e.extensions=o),e},Object.assign(no.prototype,{set:function(t,e){return this.origin.copy(t),this.direction.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,e){return void 0===e&&(console.warn("THREE.Ray: .at() target is now required"),e=new je),e.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:function(){var t=new je;return function(e){return this.origin.copy(this.at(e,t)),this}}(),closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new je),e.subVectors(t,this.origin);var n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(){var t=new je;return function(e){var n=t.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(t.copy(this.direction).multiplyScalar(n).add(this.origin),t.distanceToSquared(e))}}(),distanceSqToSegment:function(){var t=new je,e=new je,n=new je;return function(i,r,o,a){t.copy(i).add(r).multiplyScalar(.5),e.copy(r).sub(i).normalize(),n.copy(this.origin).sub(t);var s,c,l,u,h=.5*i.distanceTo(r),p=-this.direction.dot(e),d=n.dot(this.direction),f=-n.dot(e),m=n.lengthSq(),g=Math.abs(1-p*p);if(g>0)if(s=p*f-d,c=p*d-f,u=h*g,s>=0)if(c>=-u)if(c<=u){var v=1/g;s*=v,c*=v,l=s*(s+p*c+2*d)+c*(p*s+c+2*f)+m}else c=h,s=Math.max(0,-(p*c+d)),l=-s*s+c*(c+2*f)+m;else c=-h,s=Math.max(0,-(p*c+d)),l=-s*s+c*(c+2*f)+m;else c<=-u?(s=Math.max(0,-(-p*h+d)),c=s>0?-h:Math.min(Math.max(-h,-f),h),l=-s*s+c*(c+2*f)+m):c<=u?(s=0,c=Math.min(Math.max(-h,-f),h),l=c*(c+2*f)+m):(s=Math.max(0,-(p*h+d)),c=s>0?h:Math.min(Math.max(-h,-f),h),l=-s*s+c*(c+2*f)+m);else c=p>0?-h:h,s=Math.max(0,-(p*c+d)),l=-s*s+c*(c+2*f)+m;return o&&o.copy(this.direction).multiplyScalar(s).add(this.origin),a&&a.copy(e).multiplyScalar(c).add(t),l}}(),intersectSphere:function(){var t=new je;return function(e,n){t.subVectors(e.center,this.origin);var i=t.dot(this.direction),r=t.dot(t)-i*i,o=e.radius*e.radius;if(r>o)return null;var a=Math.sqrt(o-r),s=i-a,c=i+a;return s<0&&c<0?null:s<0?this.at(c,n):this.at(s,n)}}(),intersectsSphere:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius},distanceToPlane:function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null},intersectPlane:function(t,e){var n=this.distanceToPlane(t);return null===n?null:this.at(n,e)},intersectsPlane:function(t){var e=t.distanceToPoint(this.origin);if(0===e)return!0;var n=t.normal.dot(this.direction);return n*e<0},intersectBox:function(t,e){var n,i,r,o,a,s,c=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,h=this.origin;return c>=0?(n=(t.min.x-h.x)*c,i=(t.max.x-h.x)*c):(n=(t.max.x-h.x)*c,i=(t.min.x-h.x)*c),l>=0?(r=(t.min.y-h.y)*l,o=(t.max.y-h.y)*l):(r=(t.max.y-h.y)*l,o=(t.min.y-h.y)*l),n>o||r>i?null:((r>n||n!==n)&&(n=r),(o<i||i!==i)&&(i=o),u>=0?(a=(t.min.z-h.z)*u,s=(t.max.z-h.z)*u):(a=(t.max.z-h.z)*u,s=(t.min.z-h.z)*u),n>s||a>i?null:((a>n||n!==n)&&(n=a),(s<i||i!==i)&&(i=s),i<0?null:this.at(n>=0?n:i,e)))},intersectsBox:function(){var t=new je;return function(e){return null!==this.intersectBox(e,t)}}(),intersectTriangle:function(){var t=new je,e=new je,n=new je,i=new je;return function(r,o,a,s,c){e.subVectors(o,r),n.subVectors(a,r),i.crossVectors(e,n);var l,u=this.direction.dot(i);if(u>0){if(s)return null;l=1}else{if(!(u<0))return null;l=-1,u=-u}t.subVectors(this.origin,r);var h=l*this.direction.dot(n.crossVectors(t,n));if(h<0)return null;var p=l*this.direction.dot(e.cross(t));if(p<0)return null;if(h+p>u)return null;var d=-l*t.dot(i);return d<0?null:this.at(d/u,c)}}(),applyMatrix4:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}}),Object.assign(io,{getNormal:function(){var t=new je;return function(e,n,i,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new je),r.subVectors(i,n),t.subVectors(e,n),r.cross(t);var o=r.lengthSq();return o>0?r.multiplyScalar(1/Math.sqrt(o)):r.set(0,0,0)}}(),getBarycoord:function(){var t=new je,e=new je,n=new je;return function(i,r,o,a,s){t.subVectors(a,r),e.subVectors(o,r),n.subVectors(i,r);var c=t.dot(t),l=t.dot(e),u=t.dot(n),h=e.dot(e),p=e.dot(n),d=c*h-l*l;if(void 0===s&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),s=new je),0===d)return s.set(-2,-1,-1);var f=1/d,m=(h*u-l*p)*f,g=(c*p-l*u)*f;return s.set(1-m-g,g,m)}}(),containsPoint:function(){var t=new je;return function(e,n,i,r){return io.getBarycoord(e,n,i,r,t),t.x>=0&&t.y>=0&&t.x+t.y<=1}}(),getUV:function(){var t=new je;return function(e,n,i,r,o,a,s,c){return this.getBarycoord(e,n,i,r,t),c.set(0,0),c.addScaledVector(o,t.x),c.addScaledVector(a,t.y),c.addScaledVector(s,t.z),c}}(),isFrontFacing:function(){var t=new je,e=new je;return function(n,i,r,o){return t.subVectors(r,i),e.subVectors(n,i),t.cross(e).dot(o)<0}}()}),Object.assign(io.prototype,{set:function(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this},setFromPointsAndIndices:function(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},getArea:function(){var t=new je,e=new je;return function(){return t.subVectors(this.c,this.b),e.subVectors(this.a,this.b),.5*t.cross(e).length()}}(),getMidpoint:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new je),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return io.getNormal(this.a,this.b,this.c,t)},getPlane:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new je),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,e){return io.getBarycoord(t,this.a,this.b,this.c,e)},getUV:function(t,e,n,i,r){return io.getUV(t,this.a,this.b,this.c,e,n,i,r)},containsPoint:function(t){return io.containsPoint(t,this.a,this.b,this.c)},isFrontFacing:function(t){return io.isFrontFacing(this.a,this.b,this.c,t)},intersectsBox:function(t){return t.intersectsTriangle(this)},closestPointToPoint:function(){var t=new je,e=new je,n=new je,i=new je,r=new je,o=new je;return function(a,s){void 0===s&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),s=new je);var c,l,u=this.a,h=this.b,p=this.c;t.subVectors(h,u),e.subVectors(p,u),i.subVectors(a,u);var d=t.dot(i),f=e.dot(i);if(d<=0&&f<=0)return s.copy(u);r.subVectors(a,h);var m=t.dot(r),g=e.dot(r);if(m>=0&&g<=m)return s.copy(h);var v=d*g-m*f;if(v<=0&&d>=0&&m<=0)return c=d/(d-m),s.copy(u).addScaledVector(t,c);o.subVectors(a,p);var y=t.dot(o),b=e.dot(o);if(b>=0&&y<=b)return s.copy(p);var x=y*f-d*b;if(x<=0&&f>=0&&b<=0)return l=f/(f-b),s.copy(u).addScaledVector(e,l);var w=m*b-y*g;if(w<=0&&g-m>=0&&y-b>=0)return n.subVectors(p,h),l=(g-m)/(g-m+(y-b)),s.copy(h).addScaledVector(n,l);var _=1/(w+x+v);return c=x*_,l=v*_,s.copy(u).addScaledVector(t,c).addScaledVector(e,l)}}(),equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}),ro.prototype=Object.create(Qr.prototype),ro.prototype.constructor=ro,ro.prototype.isMeshBasicMaterial=!0,ro.prototype.copy=function(t){return Qr.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this},oo.prototype=Object.assign(Object.create(Pr.prototype),{constructor:oo,isMesh:!0,setDrawMode:function(t){this.drawMode=t},copy:function(t){return Pr.prototype.copy.call(this,t),this.drawMode=t.drawMode,void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this},updateMorphTargets:function(){var t,e,n,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,o=Object.keys(r);if(o.length>0){var a=r[o[0]];if(void 0!==a)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=a.length;t<e;t++)n=a[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}else{var s=i.morphTargets;void 0!==s&&s.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(){var t=new rn,e=new no,n=new tn,i=new je,r=new je,o=new je,a=new je,s=new je,c=new je,l=new je,u=new je,h=new je,p=new Ge,d=new Ge,f=new Ge,m=new je,g=new je;function b(t,e,n,i,r,o,a,s){var c;if(c=e.side===v?i.intersectTriangle(a,o,r,!0,s):i.intersectTriangle(r,o,a,e.side!==y,s),null===c)return null;g.copy(s),g.applyMatrix4(t.matrixWorld);var l=n.ray.origin.distanceTo(g);return l<n.near||l>n.far?null:{distance:l,point:g.clone(),object:t}}function x(t,e,n,g,v,y,x,w,_,M){i.fromBufferAttribute(v,w),r.fromBufferAttribute(v,_),o.fromBufferAttribute(v,M);var T=t.morphTargetInfluences;if(e.morphTargets&&y&&T){l.set(0,0,0),u.set(0,0,0),h.set(0,0,0);for(var S=0,E=y.length;S<E;S++){var A=T[S],C=y[S];0!==A&&(a.fromBufferAttribute(C,w),s.fromBufferAttribute(C,_),c.fromBufferAttribute(C,M),l.addScaledVector(a.sub(i),A),u.addScaledVector(s.sub(r),A),h.addScaledVector(c.sub(o),A))}i.add(l),r.add(u),o.add(h)}var L=b(t,e,n,g,i,r,o,m);if(L){x&&(p.fromBufferAttribute(x,w),d.fromBufferAttribute(x,_),f.fromBufferAttribute(x,M),L.uv=io.getUV(m,i,r,o,p,d,f,new Ge));var P=new Er(w,_,M);io.getNormal(i,r,o,P.normal),L.face=P}return L}return function(i,r){var o,a=this.geometry,s=this.material,c=this.matrixWorld;if(void 0!==s&&(null===a.boundingSphere&&a.computeBoundingSphere(),n.copy(a.boundingSphere),n.applyMatrix4(c),!1!==i.ray.intersectsSphere(n)&&(t.getInverse(c),e.copy(i.ray).applyMatrix4(t),null===a.boundingBox||!1!==e.intersectsBox(a.boundingBox))))if(a.isBufferGeometry){var l,u,h,g,v,y,w,_,M,T,S,E=a.index,A=a.attributes.position,C=a.morphAttributes.position,L=a.attributes.uv,P=a.groups,R=a.drawRange;if(null!==E)if(Array.isArray(s))for(g=0,y=P.length;g<y;g++)for(_=P[g],M=s[_.materialIndex],T=Math.max(_.start,R.start),S=Math.min(_.start+_.count,R.start+R.count),v=T,w=S;v<w;v+=3)l=E.getX(v),u=E.getX(v+1),h=E.getX(v+2),o=x(this,M,i,e,A,C,L,l,u,h),o&&(o.faceIndex=Math.floor(v/3),o.face.materialIndex=_.materialIndex,r.push(o));else for(T=Math.max(0,R.start),S=Math.min(E.count,R.start+R.count),g=T,y=S;g<y;g+=3)l=E.getX(g),u=E.getX(g+1),h=E.getX(g+2),o=x(this,s,i,e,A,C,L,l,u,h),o&&(o.faceIndex=Math.floor(g/3),r.push(o));else if(void 0!==A)if(Array.isArray(s))for(g=0,y=P.length;g<y;g++)for(_=P[g],M=s[_.materialIndex],T=Math.max(_.start,R.start),S=Math.min(_.start+_.count,R.start+R.count),v=T,w=S;v<w;v+=3)l=v,u=v+1,h=v+2,o=x(this,M,i,e,A,C,L,l,u,h),o&&(o.faceIndex=Math.floor(v/3),o.face.materialIndex=_.materialIndex,r.push(o));else for(T=Math.max(0,R.start),S=Math.min(A.count,R.start+R.count),g=T,y=S;g<y;g+=3)l=g,u=g+1,h=g+2,o=x(this,s,i,e,A,C,L,l,u,h),o&&(o.faceIndex=Math.floor(g/3),r.push(o))}else if(a.isGeometry){var O,D,N,I,z=Array.isArray(s),B=a.vertices,k=a.faces,H=a.faceVertexUvs[0];H.length>0&&(I=H);for(var U=0,G=k.length;U<G;U++){var F=k[U],j=z?s[F.materialIndex]:s;if(void 0!==j&&(O=B[F.a],D=B[F.b],N=B[F.c],o=b(this,j,i,e,O,D,N,m),o)){if(I&&I[U]){var V=I[U];p.copy(V[0]),d.copy(V[1]),f.copy(V[2]),o.uv=io.getUV(m,O,D,N,p,d,f,new Ge)}o.face=F,o.faceIndex=U,r.push(o)}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),yo.prototype=Object.create(Xe.prototype),yo.prototype.constructor=yo,yo.prototype.isCubeTexture=!0,Object.defineProperty(yo.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}}),bo.prototype=Object.create(Xe.prototype),bo.prototype.constructor=bo,bo.prototype.isDataTexture2DArray=!0,xo.prototype=Object.create(Xe.prototype),xo.prototype.constructor=xo,xo.prototype.isDataTexture3D=!0;var wo=new Xe,_o=new bo,Mo=new xo,To=new yo,So=[],Eo=[],Ao=new Float32Array(16),Co=new Float32Array(9),Lo=new Float32Array(4);function Po(t,e,n){var i=t[0];if(i<=0||i>0)return t;var r=e*n,o=So[r];if(void 0===o&&(o=new Float32Array(r),So[r]=o),0!==e){i.toArray(o,0);for(var a=1,s=0;a!==e;++a)s+=n,t[a].toArray(o,s)}return o}function Ro(t,e){if(t.length!==e.length)return!1;for(var n=0,i=t.length;n<i;n++)if(t[n]!==e[n])return!1;return!0}function Oo(t,e){for(var n=0,i=e.length;n<i;n++)t[n]=e[n]}function Do(t,e){var n=Eo[e];void 0===n&&(n=new Int32Array(e),Eo[e]=n);for(var i=0;i!==e;++i)n[i]=t.allocateTextureUnit();return n}function No(t,e){var n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function Io(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Ro(n,e))return;t.uniform2fv(this.addr,e),Oo(n,e)}}function zo(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(void 0!==e.r)n[0]===e.r&&n[1]===e.g&&n[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(Ro(n,e))return;t.uniform3fv(this.addr,e),Oo(n,e)}}function Bo(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Ro(n,e))return;t.uniform4fv(this.addr,e),Oo(n,e)}}function ko(t,e){var n=this.cache,i=e.elements;if(void 0===i){if(Ro(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),Oo(n,e)}else{if(Ro(n,i))return;Lo.set(i),t.uniformMatrix2fv(this.addr,!1,Lo),Oo(n,i)}}function Ho(t,e){var n=this.cache,i=e.elements;if(void 0===i){if(Ro(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),Oo(n,e)}else{if(Ro(n,i))return;Co.set(i),t.uniformMatrix3fv(this.addr,!1,Co),Oo(n,i)}}function Uo(t,e){var n=this.cache,i=e.elements;if(void 0===i){if(Ro(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),Oo(n,e)}else{if(Ro(n,i))return;Ao.set(i),t.uniformMatrix4fv(this.addr,!1,Ao),Oo(n,i)}}function Go(t,e,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.safeSetTexture2D(e||wo,r)}function Fo(t,e,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture2DArray(e||_o,r)}function jo(t,e,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(e||Mo,r)}function Vo(t,e,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.safeSetTextureCube(e||To,r)}function Wo(t,e){var n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function qo(t,e){var n=this.cache;Ro(n,e)||(t.uniform2iv(this.addr,e),Oo(n,e))}function Xo(t,e){var n=this.cache;Ro(n,e)||(t.uniform3iv(this.addr,e),Oo(n,e))}function Yo(t,e){var n=this.cache;Ro(n,e)||(t.uniform4iv(this.addr,e),Oo(n,e))}function Jo(t){switch(t){case 5126:return No;case 35664:return Io;case 35665:return zo;case 35666:return Bo;case 35674:return ko;case 35675:return Ho;case 35676:return Uo;case 35678:case 36198:return Go;case 35679:return jo;case 35680:return Vo;case 36289:return Fo;case 5124:case 35670:return Wo;case 35667:case 35671:return qo;case 35668:case 35672:return Xo;case 35669:case 35673:return Yo}}function Zo(t,e){t.uniform1fv(this.addr,e)}function $o(t,e){t.uniform1iv(this.addr,e)}function Qo(t,e){t.uniform2iv(this.addr,e)}function Ko(t,e){t.uniform3iv(this.addr,e)}function ta(t,e){t.uniform4iv(this.addr,e)}function ea(t,e){var n=Po(e,this.size,2);t.uniform2fv(this.addr,n)}function na(t,e){var n=Po(e,this.size,3);t.uniform3fv(this.addr,n)}function ia(t,e){var n=Po(e,this.size,4);t.uniform4fv(this.addr,n)}function ra(t,e){var n=Po(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function oa(t,e){var n=Po(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function aa(t,e){var n=Po(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function sa(t,e,n){var i=e.length,r=Do(n,i);t.uniform1iv(this.addr,r);for(var o=0;o!==i;++o)n.safeSetTexture2D(e[o]||wo,r[o])}function ca(t,e,n){var i=e.length,r=Do(n,i);t.uniform1iv(this.addr,r);for(var o=0;o!==i;++o)n.safeSetTextureCube(e[o]||To,r[o])}function la(t){switch(t){case 5126:return Zo;case 35664:return ea;case 35665:return na;case 35666:return ia;case 35674:return ra;case 35675:return oa;case 35676:return aa;case 35678:return sa;case 35680:return ca;case 5124:case 35670:return $o;case 35667:case 35671:return Qo;case 35668:case 35672:return Ko;case 35669:case 35673:return ta}}function ua(t,e,n){this.id=t,this.addr=n,this.cache=[],this.setValue=Jo(e.type)}function ha(t,e,n){this.id=t,this.addr=n,this.cache=[],this.size=e.size,this.setValue=la(e.type)}function pa(t){this.id=t,this.seq=[],this.map={}}ha.prototype.updateCache=function(t){var e=this.cache;t instanceof Float32Array&&e.length!==t.length&&(this.cache=new Float32Array(t.length)),Oo(e,t)},pa.prototype.setValue=function(t,e,n){for(var i=this.seq,r=0,o=i.length;r!==o;++r){var a=i[r];a.setValue(t,e[a.id],n)}};var da=/([\w\d_]+)(\])?(\[|\.)?/g;function fa(t,e){t.seq.push(e),t.map[e.id]=e}function ma(t,e,n){var i=t.name,r=i.length;da.lastIndex=0;while(1){var o=da.exec(i),a=da.lastIndex,s=o[1],c="]"===o[2],l=o[3];if(c&&(s|=0),void 0===l||"["===l&&a+2===r){fa(n,void 0===l?new ua(s,t,e):new ha(s,t,e));break}var u=n.map,h=u[s];void 0===h&&(h=new pa(s),fa(n,h)),n=h}}function ga(t,e){this.seq=[],this.map={};for(var n=t.getProgramParameter(e,35718),i=0;i<n;++i){var r=t.getActiveUniform(e,i),o=t.getUniformLocation(e,r.name);ma(r,o,this)}}function va(t){for(var e=t.split("\n"),n=0;n<e.length;n++)e[n]=n+1+": "+e[n];return e.join("\n")}function ya(t,e,n,i){var r=t.createShader(e);return t.shaderSource(r,n),t.compileShader(r),!0===i&&(!1===t.getShaderParameter(r,35713)&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==t.getShaderInfoLog(r)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",35633===e?"vertex":"fragment",t.getShaderInfoLog(r),va(n))),r}ga.prototype.setValue=function(t,e,n,i){var r=this.map[e];void 0!==r&&r.setValue(t,n,i)},ga.prototype.setOptional=function(t,e,n){var i=e[n];void 0!==i&&this.setValue(t,n,i)},ga.upload=function(t,e,n,i){for(var r=0,o=e.length;r!==o;++r){var a=e[r],s=n[a.id];!1!==s.needsUpdate&&a.setValue(t,s.value,i)}},ga.seqWithValue=function(t,e){for(var n=[],i=0,r=t.length;i!==r;++i){var o=t[i];o.id in e&&n.push(o)}return n};var ba=0;function xa(t){switch(t){case Ce:return["Linear","( value )"];case Le:return["sRGB","( value )"];case Re:return["RGBE","( value )"];case De:return["RGBM","( value, 7.0 )"];case Ne:return["RGBM","( value, 16.0 )"];case Ie:return["RGBD","( value, 256.0 )"];case Pe:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+t)}}function wa(t,e){var n=xa(e);return"vec4 "+t+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function _a(t,e){var n=xa(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function Ma(t,e){var n;switch(e){case rt:n="Linear";break;case ot:n="Reinhard";break;case at:n="Uncharted2";break;case st:n="OptimizedCineon";break;case ct:n="ACESFilmic";break;default:throw new Error("unsupported toneMapping: "+e)}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function Ta(t,e,n){t=t||{};var i=[t.derivatives||e.envMapCubeUV||e.bumpMap||e.normalMap&&!e.objectSpaceNormalMap||e.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(t.fragDepth||e.logarithmicDepthBuffer)&&n.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",t.drawBuffers&&n.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(t.shaderTextureLOD||e.envMap)&&n.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""];return i.filter(Aa).join("\n")}function Sa(t){var e=[];for(var n in t){var i=t[n];!1!==i&&e.push("#define "+n+" "+i)}return e.join("\n")}function Ea(t,e){for(var n={},i=t.getProgramParameter(e,35721),r=0;r<i;r++){var o=t.getActiveAttrib(e,r),a=o.name;n[a]=t.getAttribLocation(e,a)}return n}function Aa(t){return""!==t}function Ca(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights)}function La(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}function Pa(t){var e=/^[ \t]*#include +<([\w\d./]+)>/gm;function n(t,e){var n=gr[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return Pa(n)}return t.replace(e,n)}function Ra(t){var e=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;function n(t,e,n,i){for(var r="",o=parseInt(e);o<parseInt(n);o++)r+=i.replace(/\[ i \]/g,"[ "+o+" ]");return r}return t.replace(e,n)}function Oa(t,e,n,i,r,o,a,s){var c=t.context,l=i.defines,u=r.vertexShader,h=r.fragmentShader,p="SHADOWMAP_TYPE_BASIC";o.shadowMapType===f?p="SHADOWMAP_TYPE_PCF":o.shadowMapType===m&&(p="SHADOWMAP_TYPE_PCF_SOFT");var d="ENVMAP_TYPE_CUBE",g="ENVMAP_MODE_REFLECTION",v="ENVMAP_BLENDING_MULTIPLY";if(o.envMap){switch(i.envMap.mapping){case ut:case ht:d="ENVMAP_TYPE_CUBE";break;case mt:case gt:d="ENVMAP_TYPE_CUBE_UV";break;case pt:case dt:d="ENVMAP_TYPE_EQUIREC";break;case ft:d="ENVMAP_TYPE_SPHERE";break}switch(i.envMap.mapping){case ht:case dt:g="ENVMAP_MODE_REFRACTION";break}switch(i.combine){case tt:v="ENVMAP_BLENDING_MULTIPLY";break;case et:v="ENVMAP_BLENDING_MIX";break;case nt:v="ENVMAP_BLENDING_ADD";break}}var y,b,x=t.gammaFactor>0?t.gammaFactor:1,w=a.isWebGL2?"":Ta(i.extensions,o,e),_=Sa(l),M=c.createProgram();if(i.isRawShaderMaterial?(y=[_].filter(Aa).join("\n"),y.length>0&&(y+="\n"),b=[w,_].filter(Aa).join("\n"),b.length>0&&(b+="\n")):(y=["precision "+o.precision+" float;","precision "+o.precision+" int;","#define SHADER_NAME "+r.name,_,o.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+x,"#define MAX_BONES "+o.maxBones,o.useFog&&o.fog?"#define USE_FOG":"",o.useFog&&o.fogExp?"#define FOG_EXP2":"",o.map?"#define USE_MAP":"",o.envMap?"#define USE_ENVMAP":"",o.envMap?"#define "+g:"",o.lightMap?"#define USE_LIGHTMAP":"",o.aoMap?"#define USE_AOMAP":"",o.emissiveMap?"#define USE_EMISSIVEMAP":"",o.bumpMap?"#define USE_BUMPMAP":"",o.normalMap?"#define USE_NORMALMAP":"",o.normalMap&&o.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",o.displacementMap&&o.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",o.specularMap?"#define USE_SPECULARMAP":"",o.roughnessMap?"#define USE_ROUGHNESSMAP":"",o.metalnessMap?"#define USE_METALNESSMAP":"",o.alphaMap?"#define USE_ALPHAMAP":"",o.vertexTangents?"#define USE_TANGENT":"",o.vertexColors?"#define USE_COLOR":"",o.flatShading?"#define FLAT_SHADED":"",o.skinning?"#define USE_SKINNING":"",o.useVertexTexture?"#define BONE_TEXTURE":"",o.morphTargets?"#define USE_MORPHTARGETS":"",o.morphNormals&&!1===o.flatShading?"#define USE_MORPHNORMALS":"",o.doubleSided?"#define DOUBLE_SIDED":"",o.flipSided?"#define FLIP_SIDED":"",o.shadowMapEnabled?"#define USE_SHADOWMAP":"",o.shadowMapEnabled?"#define "+p:"",o.sizeAttenuation?"#define USE_SIZEATTENUATION":"",o.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",o.logarithmicDepthBuffer&&(a.isWebGL2||e.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Aa).join("\n"),b=[w,"precision "+o.precision+" float;","precision "+o.precision+" int;","#define SHADER_NAME "+r.name,_,o.alphaTest?"#define ALPHATEST "+o.alphaTest+(o.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+x,o.useFog&&o.fog?"#define USE_FOG":"",o.useFog&&o.fogExp?"#define FOG_EXP2":"",o.map?"#define USE_MAP":"",o.matcap?"#define USE_MATCAP":"",o.envMap?"#define USE_ENVMAP":"",o.envMap?"#define "+d:"",o.envMap?"#define "+g:"",o.envMap?"#define "+v:"",o.lightMap?"#define USE_LIGHTMAP":"",o.aoMap?"#define USE_AOMAP":"",o.emissiveMap?"#define USE_EMISSIVEMAP":"",o.bumpMap?"#define USE_BUMPMAP":"",o.normalMap?"#define USE_NORMALMAP":"",o.normalMap&&o.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",o.specularMap?"#define USE_SPECULARMAP":"",o.roughnessMap?"#define USE_ROUGHNESSMAP":"",o.metalnessMap?"#define USE_METALNESSMAP":"",o.alphaMap?"#define USE_ALPHAMAP":"",o.vertexTangents?"#define USE_TANGENT":"",o.vertexColors?"#define USE_COLOR":"",o.gradientMap?"#define USE_GRADIENTMAP":"",o.flatShading?"#define FLAT_SHADED":"",o.doubleSided?"#define DOUBLE_SIDED":"",o.flipSided?"#define FLIP_SIDED":"",o.shadowMapEnabled?"#define USE_SHADOWMAP":"",o.shadowMapEnabled?"#define "+p:"",o.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",o.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",o.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",o.logarithmicDepthBuffer&&(a.isWebGL2||e.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"",o.envMap&&(a.isWebGL2||e.get("EXT_shader_texture_lod"))?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",o.toneMapping!==it?"#define TONE_MAPPING":"",o.toneMapping!==it?gr["tonemapping_pars_fragment"]:"",o.toneMapping!==it?Ma("toneMapping",o.toneMapping):"",o.dithering?"#define DITHERING":"",o.outputEncoding||o.mapEncoding||o.matcapEncoding||o.envMapEncoding||o.emissiveMapEncoding?gr["encodings_pars_fragment"]:"",o.mapEncoding?wa("mapTexelToLinear",o.mapEncoding):"",o.matcapEncoding?wa("matcapTexelToLinear",o.matcapEncoding):"",o.envMapEncoding?wa("envMapTexelToLinear",o.envMapEncoding):"",o.emissiveMapEncoding?wa("emissiveMapTexelToLinear",o.emissiveMapEncoding):"",o.outputEncoding?_a("linearToOutputTexel",o.outputEncoding):"",o.depthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter(Aa).join("\n")),u=Pa(u),u=Ca(u,o),u=La(u,o),h=Pa(h),h=Ca(h,o),h=La(h,o),u=Ra(u),h=Ra(h),a.isWebGL2&&!i.isRawShaderMaterial){var T=!1,S=/^\s*#version\s+300\s+es\s*\n/;i.isShaderMaterial&&null!==u.match(S)&&null!==h.match(S)&&(T=!0,u=u.replace(S,""),h=h.replace(S,"")),y=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+y,b=["#version 300 es\n","#define varying in",T?"":"out highp vec4 pc_fragColor;",T?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+b}var E,A,C=y+u,L=b+h,P=ya(c,35633,C,t.debug.checkShaderErrors),R=ya(c,35632,L,t.debug.checkShaderErrors);if(c.attachShader(M,P),c.attachShader(M,R),void 0!==i.index0AttributeName?c.bindAttribLocation(M,0,i.index0AttributeName):!0===o.morphTargets&&c.bindAttribLocation(M,0,"position"),c.linkProgram(M),t.debug.checkShaderErrors){var O=c.getProgramInfoLog(M).trim(),D=c.getShaderInfoLog(P).trim(),N=c.getShaderInfoLog(R).trim(),I=!0,z=!0;!1===c.getProgramParameter(M,35714)?(I=!1,console.error("THREE.WebGLProgram: shader error: ",c.getError(),"35715",c.getProgramParameter(M,35715),"gl.getProgramInfoLog",O,D,N)):""!==O?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",O):""!==D&&""!==N||(z=!1),z&&(this.diagnostics={runnable:I,material:i,programLog:O,vertexShader:{log:D,prefix:y},fragmentShader:{log:N,prefix:b}})}return c.deleteShader(P),c.deleteShader(R),this.getUniforms=function(){return void 0===E&&(E=new ga(c,M,s)),E},this.getAttributes=function(){return void 0===A&&(A=Ea(c,M)),A},this.destroy=function(){c.deleteProgram(M),this.program=void 0},Object.defineProperties(this,{uniforms:{get:function(){return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),this.getUniforms()}},attributes:{get:function(){return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),this.getAttributes()}}}),this.name=r.name,this.id=ba++,this.code=n,this.usedTimes=1,this.program=M,this.vertexShader=P,this.fragmentShader=R,this}function Da(t,e,n,i){var r=[],o={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},a=["precision","supportsVertexTextures","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexTangents","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering"];function s(t){var e=t.skeleton,i=e.bones;if(n.floatVertexTextures)return 1024;var r=n.maxVertexUniforms,o=Math.floor((r-20)/4),a=Math.min(o,i.length);return a<i.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+i.length+" bones. This GPU supports "+a+"."),0):a}function c(t,e){var n;return t?t.isTexture?n=t.encoding:t.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),n=t.texture.encoding):n=Ce,n===Ce&&e&&(n=Pe),n}this.getParameters=function(e,i,r,a,l,u,h){var p=o[e.type],d=h.isSkinnedMesh?s(h):0,f=n.precision;null!==e.precision&&(f=n.getMaxPrecision(e.precision),f!==e.precision&&console.warn("THREE.WebGLProgram.getParameters:",e.precision,"not supported, using",f,"instead."));var m=t.getRenderTarget(),g={shaderID:p,precision:f,supportsVertexTextures:n.vertexTextures,outputEncoding:c(m?m.texture:null,t.gammaOutput),map:!!e.map,mapEncoding:c(e.map,t.gammaInput),matcap:!!e.matcap,matcapEncoding:c(e.matcap,t.gammaInput),envMap:!!e.envMap,envMapMode:e.envMap&&e.envMap.mapping,envMapEncoding:c(e.envMap,t.gammaInput),envMapCubeUV:!!e.envMap&&(e.envMap.mapping===mt||e.envMap.mapping===gt),lightMap:!!e.lightMap,aoMap:!!e.aoMap,emissiveMap:!!e.emissiveMap,emissiveMapEncoding:c(e.emissiveMap,t.gammaInput),bumpMap:!!e.bumpMap,normalMap:!!e.normalMap,objectSpaceNormalMap:e.normalMapType===He,displacementMap:!!e.displacementMap,roughnessMap:!!e.roughnessMap,metalnessMap:!!e.metalnessMap,specularMap:!!e.specularMap,alphaMap:!!e.alphaMap,gradientMap:!!e.gradientMap,combine:e.combine,vertexTangents:e.normalMap&&e.vertexTangents,vertexColors:e.vertexColors,fog:!!a,useFog:e.fog,fogExp:a&&a.isFogExp2,flatShading:e.flatShading,sizeAttenuation:e.sizeAttenuation,logarithmicDepthBuffer:n.logarithmicDepthBuffer,skinning:e.skinning&&d>0,maxBones:d,useVertexTexture:n.floatVertexTextures,morphTargets:e.morphTargets,morphNormals:e.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:i.directional.length,numPointLights:i.point.length,numSpotLights:i.spot.length,numRectAreaLights:i.rectArea.length,numHemiLights:i.hemi.length,numClippingPlanes:l,numClipIntersection:u,dithering:e.dithering,shadowMapEnabled:t.shadowMap.enabled&&h.receiveShadow&&r.length>0,shadowMapType:t.shadowMap.type,toneMapping:t.toneMapping,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:e.premultipliedAlpha,alphaTest:e.alphaTest,doubleSided:e.side===y,flipSided:e.side===v,depthPacking:void 0!==e.depthPacking&&e.depthPacking};return g},this.getProgramCode=function(e,n){var i=[];if(n.shaderID?i.push(n.shaderID):(i.push(e.fragmentShader),i.push(e.vertexShader)),void 0!==e.defines)for(var r in e.defines)i.push(r),i.push(e.defines[r]);for(var o=0;o<a.length;o++)i.push(n[a[o]]);return i.push(e.onBeforeCompile.toString()),i.push(t.gammaOutput),i.push(t.gammaFactor),i.join()},this.acquireProgram=function(o,a,s,c){for(var l,u=0,h=r.length;u<h;u++){var p=r[u];if(p.code===c){l=p,++l.usedTimes;break}}return void 0===l&&(l=new Oa(t,e,c,o,a,s,n,i),r.push(l)),l},this.releaseProgram=function(t){if(0===--t.usedTimes){var e=r.indexOf(t);r[e]=r[r.length-1],r.pop(),t.destroy()}},this.programs=r}function Na(){var t=new WeakMap;function e(e){var n=t.get(e);return void 0===n&&(n={},t.set(e,n)),n}function n(e){t.delete(e)}function i(e,n,i){t.get(e)[n]=i}function r(){t=new WeakMap}return{get:e,remove:n,update:i,dispose:r}}function Ia(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program!==e.program?t.program.id-e.program.id:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function za(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function Ba(){var t=[],e=0,n=[],i=[],r={id:-1};function o(){e=0,n.length=0,i.length=0}function a(n,i,o,a,s,c){var l=t[e];return void 0===l?(l={id:n.id,object:n,geometry:i,material:o,program:o.program||r,groupOrder:a,renderOrder:n.renderOrder,z:s,group:c},t[e]=l):(l.id=n.id,l.object=n,l.geometry=i,l.material=o,l.program=o.program||r,l.groupOrder=a,l.renderOrder=n.renderOrder,l.z=s,l.group=c),e++,l}function s(t,e,r,o,s,c){var l=a(t,e,r,o,s,c);(!0===r.transparent?i:n).push(l)}function c(t,e,r,o,s,c){var l=a(t,e,r,o,s,c);(!0===r.transparent?i:n).unshift(l)}function l(){n.length>1&&n.sort(Ia),i.length>1&&i.sort(za)}return{opaque:n,transparent:i,init:o,push:s,unshift:c,sort:l}}function ka(){var t={};function e(n){var i=n.target;i.removeEventListener("dispose",e),delete t[i.id]}function n(n,i){var r,o=t[n.id];return void 0===o?(r=new Ba,t[n.id]={},t[n.id][i.id]=r,n.addEventListener("dispose",e)):(r=o[i.id],void 0===r&&(r=new Ba,o[i.id]=r)),r}function i(){t={}}return{get:n,dispose:i}}function Ha(){var t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];var n;switch(e.type){case"DirectionalLight":n={direction:new je,color:new wr,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Ge};break;case"SpotLight":n={position:new je,direction:new je,color:new wr,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Ge};break;case"PointLight":n={position:new je,color:new wr,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Ge,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":n={direction:new je,skyColor:new wr,groundColor:new wr};break;case"RectAreaLight":n={color:new wr,position:new je,halfWidth:new je,halfHeight:new je};break}return t[e.id]=n,n}}}var Ua=0;function Ga(){for(var t=new Ha,e={id:Ua++,hash:{stateID:-1,directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,shadowsLength:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},n=0;n<9;n++)e.probe.push(new je);var i=new je,r=new rn,o=new rn;function a(n,a,s){for(var c=0,l=0,u=0,h=0;h<9;h++)e.probe[h].set(0,0,0);for(var p=0,d=0,f=0,m=0,g=0,v=s.matrixWorldInverse,y=(h=0,n.length);h<y;h++){var b=n[h],x=b.color,w=b.intensity,_=b.distance,M=b.shadow&&b.shadow.map?b.shadow.map.texture:null;if(b.isAmbientLight)c+=x.r*w,l+=x.g*w,u+=x.b*w;else if(b.isLightProbe)for(var T=0;T<9;T++)e.probe[T].addScaledVector(b.sh.coefficients[T],w);else if(b.isDirectionalLight){var S=t.get(b);if(S.color.copy(b.color).multiplyScalar(b.intensity),S.direction.setFromMatrixPosition(b.matrixWorld),i.setFromMatrixPosition(b.target.matrixWorld),S.direction.sub(i),S.direction.transformDirection(v),S.shadow=b.castShadow,b.castShadow){var E=b.shadow;S.shadowBias=E.bias,S.shadowRadius=E.radius,S.shadowMapSize=E.mapSize}e.directionalShadowMap[p]=M,e.directionalShadowMatrix[p]=b.shadow.matrix,e.directional[p]=S,p++}else if(b.isSpotLight){S=t.get(b);if(S.position.setFromMatrixPosition(b.matrixWorld),S.position.applyMatrix4(v),S.color.copy(x).multiplyScalar(w),S.distance=_,S.direction.setFromMatrixPosition(b.matrixWorld),i.setFromMatrixPosition(b.target.matrixWorld),S.direction.sub(i),S.direction.transformDirection(v),S.coneCos=Math.cos(b.angle),S.penumbraCos=Math.cos(b.angle*(1-b.penumbra)),S.decay=b.decay,S.shadow=b.castShadow,b.castShadow){E=b.shadow;S.shadowBias=E.bias,S.shadowRadius=E.radius,S.shadowMapSize=E.mapSize}e.spotShadowMap[f]=M,e.spotShadowMatrix[f]=b.shadow.matrix,e.spot[f]=S,f++}else if(b.isRectAreaLight){S=t.get(b);S.color.copy(x).multiplyScalar(w),S.position.setFromMatrixPosition(b.matrixWorld),S.position.applyMatrix4(v),o.identity(),r.copy(b.matrixWorld),r.premultiply(v),o.extractRotation(r),S.halfWidth.set(.5*b.width,0,0),S.halfHeight.set(0,.5*b.height,0),S.halfWidth.applyMatrix4(o),S.halfHeight.applyMatrix4(o),e.rectArea[m]=S,m++}else if(b.isPointLight){S=t.get(b);if(S.position.setFromMatrixPosition(b.matrixWorld),S.position.applyMatrix4(v),S.color.copy(b.color).multiplyScalar(b.intensity),S.distance=b.distance,S.decay=b.decay,S.shadow=b.castShadow,b.castShadow){E=b.shadow;S.shadowBias=E.bias,S.shadowRadius=E.radius,S.shadowMapSize=E.mapSize,S.shadowCameraNear=E.camera.near,S.shadowCameraFar=E.camera.far}e.pointShadowMap[d]=M,e.pointShadowMatrix[d]=b.shadow.matrix,e.point[d]=S,d++}else if(b.isHemisphereLight){S=t.get(b);S.direction.setFromMatrixPosition(b.matrixWorld),S.direction.transformDirection(v),S.direction.normalize(),S.skyColor.copy(b.color).multiplyScalar(w),S.groundColor.copy(b.groundColor).multiplyScalar(w),e.hemi[g]=S,g++}}e.ambient[0]=c,e.ambient[1]=l,e.ambient[2]=u,e.directional.length=p,e.spot.length=f,e.rectArea.length=m,e.point.length=d,e.hemi.length=g,e.hash.stateID=e.id,e.hash.directionalLength=p,e.hash.pointLength=d,e.hash.spotLength=f,e.hash.rectAreaLength=m,e.hash.hemiLength=g,e.hash.shadowsLength=a.length}return{setup:a,state:e}}function Fa(){var t=new Ga,e=[],n=[];function i(){e.length=0,n.length=0}function r(t){e.push(t)}function o(t){n.push(t)}function a(i){t.setup(e,n,i)}var s={lightsArray:e,shadowsArray:n,lights:t};return{init:i,state:s,setupLights:a,pushLight:r,pushShadow:o}}function ja(){var t={};function e(n){var i=n.target;i.removeEventListener("dispose",e),delete t[i.id]}function n(n,i){var r;return void 0===t[n.id]?(r=new Fa,t[n.id]={},t[n.id][i.id]=r,n.addEventListener("dispose",e)):void 0===t[n.id][i.id]?(r=new Fa,t[n.id][i.id]=r):r=t[n.id][i.id],r}function i(){t={}}return{get:n,dispose:i}}function Va(t){Qr.call(this),this.type="MeshDepthMaterial",this.depthPacking=ze,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.setValues(t)}function Wa(t){Qr.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new je,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.lights=!1,this.setValues(t)}function qa(t,e,n){for(var i=new nn,r=new rn,o=new Ge,a=new Ge(n,n),s=new je,c=new je,l=1,u=2,h=1+(l|u),p=new Array(h),d=new Array(h),m={},b={0:v,1:g,2:y},x=[new je(1,0,0),new je(-1,0,0),new je(0,0,1),new je(0,0,-1),new je(0,1,0),new je(0,-1,0)],w=[new je(0,1,0),new je(0,1,0),new je(0,1,0),new je(0,1,0),new je(0,0,1),new je(0,0,-1)],_=[new Ye,new Ye,new Ye,new Ye,new Ye,new Ye],M=0;M!==h;++M){var S=0!==(M&l),E=0!==(M&u),A=new Va({depthPacking:Be,morphTargets:S,skinning:E});p[M]=A;var C=new Wa({morphTargets:S,skinning:E});d[M]=C}var L=this;function P(e,n,i,r,o,a){var s=e.geometry,c=null,h=p,f=e.customDepthMaterial;if(i&&(h=d,f=e.customDistanceMaterial),f)c=f;else{var g=!1;n.morphTargets&&(s&&s.isBufferGeometry?g=s.morphAttributes&&s.morphAttributes.position&&s.morphAttributes.position.length>0:s&&s.isGeometry&&(g=s.morphTargets&&s.morphTargets.length>0)),e.isSkinnedMesh&&!1===n.skinning&&console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e);var v=e.isSkinnedMesh&&n.skinning,y=0;g&&(y|=l),v&&(y|=u),c=h[y]}if(t.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length){var x=c.uuid,w=n.uuid,_=m[x];void 0===_&&(_={},m[x]=_);var M=_[w];void 0===M&&(M=c.clone(),_[w]=M),c=M}return c.visible=n.visible,c.wireframe=n.wireframe,c.side=null!=n.shadowSide?n.shadowSide:b[n.side],c.clipShadows=n.clipShadows,c.clippingPlanes=n.clippingPlanes,c.clipIntersection=n.clipIntersection,c.wireframeLinewidth=n.wireframeLinewidth,c.linewidth=n.linewidth,i&&c.isMeshDistanceMaterial&&(c.referencePosition.copy(r),c.nearDistance=o,c.farDistance=a),c}function R(n,r,o,a){if(!1!==n.visible){var s=n.layers.test(r.layers);if(s&&(n.isMesh||n.isLine||n.isPoints)&&n.castShadow&&(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,n.matrixWorld);var l=e.update(n),u=n.material;if(Array.isArray(u))for(var h=l.groups,p=0,d=h.length;p<d;p++){var f=h[p],m=u[f.materialIndex];if(m&&m.visible){var g=P(n,m,a,c,o.near,o.far);t.renderBufferDirect(o,null,l,g,n,f)}}else if(u.visible){g=P(n,u,a,c,o.near,o.far);t.renderBufferDirect(o,null,l,g,n,null)}}for(var v=n.children,y=0,b=v.length;y<b;y++)R(v[y],r,o,a)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=f,this.render=function(e,n,l){if(!1!==L.enabled&&(!1!==L.autoUpdate||!1!==L.needsUpdate)&&0!==e.length){var u,h=t.getRenderTarget(),p=t.getActiveCubeFace(),d=t.getActiveMipMapLevel(),f=t.state;f.setBlending(T),f.buffers.color.setClear(1,1,1,1),f.buffers.depth.setTest(!0),f.setScissorTest(!1);for(var m=0,g=e.length;m<g;m++){var v=e[m],y=v.shadow,b=v&&v.isPointLight;if(void 0!==y){var M=y.camera;if(o.copy(y.mapSize),o.min(a),b){var S=o.x,E=o.y;_[0].set(2*S,E,S,E),_[1].set(0,E,S,E),_[2].set(3*S,E,S,E),_[3].set(S,E,S,E),_[4].set(3*S,0,S,E),_[5].set(S,0,S,E),o.x*=4,o.y*=2}if(null===y.map){var A={minFilter:xt,magFilter:xt,format:Ut};y.map=new Je(o.x,o.y,A),y.map.texture.name=v.name+".shadowMap",M.updateProjectionMatrix()}y.isSpotLightShadow&&y.update(v);var C=y.map,P=y.matrix;c.setFromMatrixPosition(v.matrixWorld),M.position.copy(c),b?(u=6,P.makeTranslation(-c.x,-c.y,-c.z)):(u=1,s.setFromMatrixPosition(v.target.matrixWorld),M.lookAt(s),M.updateMatrixWorld(),P.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),P.multiply(M.projectionMatrix),P.multiply(M.matrixWorldInverse)),t.setRenderTarget(C),t.clear();for(var O=0;O<u;O++){if(b){s.copy(M.position),s.add(x[O]),M.up.copy(w[O]),M.lookAt(s),M.updateMatrixWorld();var D=_[O];f.viewport(D)}r.multiplyMatrices(M.projectionMatrix,M.matrixWorldInverse),i.setFromMatrix(r),R(n,l,M,b)}}else console.warn("THREE.WebGLShadowMap:",v,"has no shadow.")}L.needsUpdate=!1,t.setRenderTarget(h,p,d)}}}function Xa(t,e,n,i){function r(){var e=!1,n=new Ye,i=null,r=new Ye(0,0,0,0);return{setMask:function(n){i===n||e||(t.colorMask(n,n,n,n),i=n)},setLocked:function(t){e=t},setClear:function(e,i,o,a,s){!0===s&&(e*=a,i*=a,o*=a),n.set(e,i,o,a),!1===r.equals(n)&&(t.clearColor(e,i,o,a),r.copy(n))},reset:function(){e=!1,i=null,r.set(-1,0,0,0)}}}function o(){var e=!1,n=null,i=null,r=null;return{setTest:function(t){t?ht(2929):pt(2929)},setMask:function(i){n===i||e||(t.depthMask(i),n=i)},setFunc:function(e){if(i!==e){if(e)switch(e){case q:t.depthFunc(512);break;case X:t.depthFunc(519);break;case Y:t.depthFunc(513);break;case J:t.depthFunc(515);break;case Z:t.depthFunc(514);break;case $:t.depthFunc(518);break;case Q:t.depthFunc(516);break;case K:t.depthFunc(517);break;default:t.depthFunc(515)}else t.depthFunc(515);i=e}},setLocked:function(t){e=t},setClear:function(e){r!==e&&(t.clearDepth(e),r=e)},reset:function(){e=!1,n=null,i=null,r=null}}}function a(){var e=!1,n=null,i=null,r=null,o=null,a=null,s=null,c=null,l=null;return{setTest:function(t){t?ht(2960):pt(2960)},setMask:function(i){n===i||e||(t.stencilMask(i),n=i)},setFunc:function(e,n,a){i===e&&r===n&&o===a||(t.stencilFunc(e,n,a),i=e,r=n,o=a)},setOp:function(e,n,i){a===e&&s===n&&c===i||(t.stencilOp(e,n,i),a=e,s=n,c=i)},setLocked:function(t){e=t},setClear:function(e){l!==e&&(t.clearStencil(e),l=e)},reset:function(){e=!1,n=null,i=null,r=null,o=null,a=null,s=null,c=null,l=null}}}var u=new r,h=new o,p=new a,d=t.getParameter(34921),f=new Uint8Array(d),m=new Uint8Array(d),g=new Uint8Array(d),b={},x=null,w=null,_=null,M=null,R=null,O=null,D=null,N=null,I=null,z=null,B=!1,k=null,H=null,U=null,G=null,F=null,j=t.getParameter(35661),V=!1,W=0,tt=t.getParameter(7938);-1!==tt.indexOf("WebGL")?(W=parseFloat(/^WebGL\ ([0-9])/.exec(tt)[1]),V=W>=1):-1!==tt.indexOf("OpenGL ES")&&(W=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(tt)[1]),V=W>=2);var et=null,nt={},it=new Ye,rt=new Ye;function ot(e,n,i){var r=new Uint8Array(4),o=t.createTexture();t.bindTexture(e,o),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(var a=0;a<i;a++)t.texImage2D(n+a,0,6408,1,1,0,6408,5121,r);return o}var at={};function st(){for(var t=0,e=f.length;t<e;t++)f[t]=0}function ct(t){lt(t,0)}function lt(n,r){if(f[n]=1,0===m[n]&&(t.enableVertexAttribArray(n),m[n]=1),g[n]!==r){var o=i.isWebGL2?t:e.get("ANGLE_instanced_arrays");o[i.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,r),g[n]=r}}function ut(){for(var e=0,n=m.length;e!==n;++e)m[e]!==f[e]&&(t.disableVertexAttribArray(e),m[e]=0)}function ht(e){!0!==b[e]&&(t.enable(e),b[e]=!0)}function pt(e){!1!==b[e]&&(t.disable(e),b[e]=!1)}function dt(){if(null===x&&(x=[],e.get("WEBGL_compressed_texture_pvrtc")||e.get("WEBGL_compressed_texture_s3tc")||e.get("WEBGL_compressed_texture_etc1")||e.get("WEBGL_compressed_texture_astc")))for(var n=t.getParameter(34467),i=0;i<n.length;i++)x.push(n[i]);return x}function ft(e){return w!==e&&(t.useProgram(e),w=e,!0)}function mt(e,i,r,o,a,s,c,l){if(e!==T){if(_||(ht(3042),_=!0),e===L)a=a||i,s=s||r,c=c||o,i===R&&a===N||(t.blendEquationSeparate(n.convert(i),n.convert(a)),R=i,N=a),r===O&&o===D&&s===I&&c===z||(t.blendFuncSeparate(n.convert(r),n.convert(o),n.convert(s),n.convert(c)),O=r,D=o,I=s,z=c),M=e,B=null;else if(e!==M||l!==B){if(R===P&&N===P||(t.blendEquation(32774),R=P,N=P),l)switch(e){case S:t.blendFuncSeparate(1,771,1,771);break;case E:t.blendFunc(1,1);break;case A:t.blendFuncSeparate(0,0,769,771);break;case C:t.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",e);break}else switch(e){case S:t.blendFuncSeparate(770,771,1,771);break;case E:t.blendFunc(770,1);break;case A:t.blendFunc(0,769);break;case C:t.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",e);break}O=null,D=null,I=null,z=null,M=e,B=l}}else _&&(pt(3042),_=!1)}function gt(t,e){t.side===y?pt(2884):ht(2884);var n=t.side===v;e&&(n=!n),vt(n),t.blending===S&&!1===t.transparent?mt(T):mt(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),h.setFunc(t.depthFunc),h.setTest(t.depthTest),h.setMask(t.depthWrite),u.setMask(t.colorWrite),xt(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)}function vt(e){k!==e&&(e?t.frontFace(2304):t.frontFace(2305),k=e)}function yt(e){e!==s?(ht(2884),e!==H&&(e===c?t.cullFace(1029):e===l?t.cullFace(1028):t.cullFace(1032))):pt(2884),H=e}function bt(e){e!==U&&(V&&t.lineWidth(e),U=e)}function xt(e,n,i){e?(ht(32823),G===n&&F===i||(t.polygonOffset(n,i),G=n,F=i)):pt(32823)}function wt(t){t?ht(3089):pt(3089)}function _t(e){void 0===e&&(e=33984+j-1),et!==e&&(t.activeTexture(e),et=e)}function Mt(e,n){null===et&&_t();var i=nt[et];void 0===i&&(i={type:void 0,texture:void 0},nt[et]=i),i.type===e&&i.texture===n||(t.bindTexture(e,n||at[e]),i.type=e,i.texture=n)}function Tt(){try{t.compressedTexImage2D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function St(){try{t.texImage2D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function Et(){try{t.texImage3D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function At(e){!1===it.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),it.copy(e))}function Ct(e){!1===rt.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),rt.copy(e))}function Lt(){for(var e=0;e<m.length;e++)1===m[e]&&(t.disableVertexAttribArray(e),m[e]=0);b={},x=null,et=null,nt={},w=null,M=null,k=null,H=null,u.reset(),h.reset(),p.reset()}return at[3553]=ot(3553,3553,1),at[34067]=ot(34067,34069,6),u.setClear(0,0,0,1),h.setClear(1),p.setClear(0),ht(2929),h.setFunc(J),vt(!1),yt(c),ht(2884),mt(T),{buffers:{color:u,depth:h,stencil:p},initAttributes:st,enableAttribute:ct,enableAttributeAndDivisor:lt,disableUnusedAttributes:ut,enable:ht,disable:pt,getCompressedTextureFormats:dt,useProgram:ft,setBlending:mt,setMaterial:gt,setFlipSided:vt,setCullFace:yt,setLineWidth:bt,setPolygonOffset:xt,setScissorTest:wt,activeTexture:_t,bindTexture:Mt,compressedTexImage2D:Tt,texImage2D:St,texImage3D:Et,scissor:At,viewport:Ct,reset:Lt}}function Ya(t,e,n,i,r,o,a){var s,c={},l="undefined"!==typeof OffscreenCanvas;function u(t,e){return l?new OffscreenCanvas(t,e):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function h(t,e,n,i){var r=1;if((t.width>i||t.height>i)&&(r=i/Math.max(t.width,t.height)),r<1||!0===e){if("undefined"!==typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&t instanceof ImageBitmap){var o=e?Ue.floorPowerOfTwo:Math.floor,a=o(r*t.width),c=o(r*t.height);void 0===s&&(s=u(a,c));var l=n?u(a,c):s;l.width=a,l.height=c;var h=l.getContext("2d");return h.drawImage(t,0,0,a,c),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+a+"x"+c+")."),l}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function p(t){return Ue.isPowerOfTwo(t.width)&&Ue.isPowerOfTwo(t.height)}function d(t){return!r.isWebGL2&&(t.wrapS!==yt||t.wrapT!==yt||t.minFilter!==xt&&t.minFilter!==Mt)}function f(t,e){return t.generateMipmaps&&e&&t.minFilter!==xt&&t.minFilter!==Mt}function m(e,n,r,o){t.generateMipmap(e);var a=i.get(n);a.__maxMipLevel=Math.log(Math.max(r,o))*Math.LOG2E}function g(t,n){if(!r.isWebGL2)return t;var i=t;return 6403===t&&(5126===n&&(i=33326),5131===n&&(i=33325),5121===n&&(i=33321)),6407===t&&(5126===n&&(i=34837),5131===n&&(i=34843),5121===n&&(i=32849)),6408===t&&(5126===n&&(i=34836),5131===n&&(i=34842),5121===n&&(i=32856)),33325===i||33326===i||34842===i||34836===i?e.get("EXT_color_buffer_float"):34843!==i&&34837!==i||console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead."),i}function v(t){return t===xt||t===wt||t===_t?9728:9729}function y(t){var e=t.target;e.removeEventListener("dispose",y),x(e),e.isVideoTexture&&delete c[e.id],a.memory.textures--}function b(t){var e=t.target;e.removeEventListener("dispose",b),w(e),a.memory.textures--}function x(e){var n=i.get(e);void 0!==n.__webglInit&&(t.deleteTexture(n.__webglTexture),i.remove(e))}function w(e){var n=i.get(e),r=i.get(e.texture);if(e){if(void 0!==r.__webglTexture&&t.deleteTexture(r.__webglTexture),e.depthTexture&&e.depthTexture.dispose(),e.isWebGLRenderTargetCube)for(var o=0;o<6;o++)t.deleteFramebuffer(n.__webglFramebuffer[o]),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer[o]);else t.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer);i.remove(e.texture),i.remove(e)}}var _=0;function M(){_=0}function T(){var t=_;return t>=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+r.maxTextures),_+=1,t}function S(t,e){var r=i.get(t);if(t.isVideoTexture&&G(t),t.version>0&&r.__version!==t.version){var o=t.image;if(void 0===o)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==o.complete)return void O(r,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+e),n.bindTexture(3553,r.__webglTexture)}function E(t,e){var r=i.get(t);t.version>0&&r.__version!==t.version?O(r,t,e):(n.activeTexture(33984+e),n.bindTexture(35866,r.__webglTexture))}function A(t,e){var r=i.get(t);t.version>0&&r.__version!==t.version?O(r,t,e):(n.activeTexture(33984+e),n.bindTexture(32879,r.__webglTexture))}function C(e,a){var s=i.get(e);if(6===e.image.length)if(e.version>0&&s.__version!==e.version){R(s,e),n.activeTexture(33984+a),n.bindTexture(34067,s.__webglTexture),t.pixelStorei(37440,e.flipY);for(var c=e&&e.isCompressedTexture,l=e.image[0]&&e.image[0].isDataTexture,u=[],d=0;d<6;d++)u[d]=c||l?l?e.image[d].image:e.image[d]:h(e.image[d],!1,!0,r.maxCubemapSize);var v=u[0],y=p(v)||r.isWebGL2,b=o.convert(e.format),x=o.convert(e.type),w=g(b,x);P(34067,e,y);for(d=0;d<6;d++)if(c)for(var _,M=u[d].mipmaps,T=0,S=M.length;T<S;T++)_=M[T],e.format!==Ut&&e.format!==Ht?n.getCompressedTextureFormats().indexOf(b)>-1?n.compressedTexImage2D(34069+d,T,w,_.width,_.height,0,_.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(34069+d,T,w,_.width,_.height,0,b,x,_.data);else l?n.texImage2D(34069+d,0,w,u[d].width,u[d].height,0,b,x,u[d].data):n.texImage2D(34069+d,0,w,b,x,u[d]);s.__maxMipLevel=c?M.length-1:0,f(e,y)&&m(34067,e,v.width,v.height),s.__version=e.version,e.onUpdate&&e.onUpdate(e)}else n.activeTexture(33984+a),n.bindTexture(34067,s.__webglTexture)}function L(t,e){n.activeTexture(33984+e),n.bindTexture(34067,i.get(t).__webglTexture)}function P(n,a,s){var c;if(s?(t.texParameteri(n,10242,o.convert(a.wrapS)),t.texParameteri(n,10243,o.convert(a.wrapT)),32879!==n&&35866!==n||t.texParameteri(n,32882,o.convert(a.wrapR)),t.texParameteri(n,10240,o.convert(a.magFilter)),t.texParameteri(n,10241,o.convert(a.minFilter))):(t.texParameteri(n,10242,33071),t.texParameteri(n,10243,33071),32879!==n&&35866!==n||t.texParameteri(n,32882,33071),a.wrapS===yt&&a.wrapT===yt||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(n,10240,v(a.magFilter)),t.texParameteri(n,10241,v(a.minFilter)),a.minFilter!==xt&&a.minFilter!==Mt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),c=e.get("EXT_texture_filter_anisotropic"),c){if(a.type===Ot&&null===e.get("OES_texture_float_linear"))return;if(a.type===Dt&&null===(r.isWebGL2||e.get("OES_texture_half_float_linear")))return;(a.anisotropy>1||i.get(a).__currentAnisotropy)&&(t.texParameterf(n,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,r.getMaxAnisotropy())),i.get(a).__currentAnisotropy=a.anisotropy)}}function R(e,n){void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",y),e.__webglTexture=t.createTexture(),a.memory.textures++)}function O(e,i,a){var s=3553;i.isDataTexture2DArray&&(s=35866),i.isDataTexture3D&&(s=32879),R(e,i),n.activeTexture(33984+a),n.bindTexture(s,e.__webglTexture),t.pixelStorei(37440,i.flipY),t.pixelStorei(37441,i.premultiplyAlpha),t.pixelStorei(3317,i.unpackAlignment);var c=d(i)&&!1===p(i.image),l=h(i.image,c,!1,r.maxTextureSize),u=p(l)||r.isWebGL2,v=o.convert(i.format),y=o.convert(i.type),b=g(v,y);P(s,i,u);var x,w=i.mipmaps;if(i.isDepthTexture){if(b=6402,i.type===Ot){if(!r.isWebGL2)throw new Error("Float Depth Texture only supported in WebGL2.0");b=36012}else r.isWebGL2&&(b=33189);i.format===Vt&&6402===b&&i.type!==Lt&&i.type!==Rt&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),i.type=Lt,y=o.convert(i.type)),i.format===Wt&&(b=34041,i.type!==Bt&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),i.type=Bt,y=o.convert(i.type))),n.texImage2D(3553,0,b,l.width,l.height,0,v,y,null)}else if(i.isDataTexture)if(w.length>0&&u){for(var _=0,M=w.length;_<M;_++)x=w[_],n.texImage2D(3553,_,b,x.width,x.height,0,v,y,x.data);i.generateMipmaps=!1,e.__maxMipLevel=w.length-1}else n.texImage2D(3553,0,b,l.width,l.height,0,v,y,l.data),e.__maxMipLevel=0;else if(i.isCompressedTexture){for(_=0,M=w.length;_<M;_++)x=w[_],i.format!==Ut&&i.format!==Ht?n.getCompressedTextureFormats().indexOf(v)>-1?n.compressedTexImage2D(3553,_,b,x.width,x.height,0,x.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(3553,_,b,x.width,x.height,0,v,y,x.data);e.__maxMipLevel=w.length-1}else if(i.isDataTexture2DArray)n.texImage3D(35866,0,b,l.width,l.height,l.depth,0,v,y,l.data),e.__maxMipLevel=0;else if(i.isDataTexture3D)n.texImage3D(32879,0,b,l.width,l.height,l.depth,0,v,y,l.data),e.__maxMipLevel=0;else if(w.length>0&&u){for(_=0,M=w.length;_<M;_++)x=w[_],n.texImage2D(3553,_,b,v,y,x);i.generateMipmaps=!1,e.__maxMipLevel=w.length-1}else n.texImage2D(3553,0,b,v,y,l),e.__maxMipLevel=0;f(i,u)&&m(3553,i,l.width,l.height),e.__version=i.version,i.onUpdate&&i.onUpdate(i)}function D(e,r,a,s){var c=o.convert(r.texture.format),l=o.convert(r.texture.type),u=g(c,l);n.texImage2D(s,0,u,r.width,r.height,0,c,l,null),t.bindFramebuffer(36160,e),t.framebufferTexture2D(36160,a,s,i.get(r.texture).__webglTexture,0),t.bindFramebuffer(36160,null)}function N(e,n,i){if(t.bindRenderbuffer(36161,e),n.depthBuffer&&!n.stencilBuffer){if(i){var r=U(n);t.renderbufferStorageMultisample(36161,r,33189,n.width,n.height)}else t.renderbufferStorage(36161,33189,n.width,n.height);t.framebufferRenderbuffer(36160,36096,36161,e)}else if(n.depthBuffer&&n.stencilBuffer){if(i){r=U(n);t.renderbufferStorageMultisample(36161,r,34041,n.width,n.height)}else t.renderbufferStorage(36161,34041,n.width,n.height);t.framebufferRenderbuffer(36160,33306,36161,e)}else{var a=o.convert(n.texture.format),s=o.convert(n.texture.type),c=g(a,s);if(i){r=U(n);t.renderbufferStorageMultisample(36161,r,c,n.width,n.height)}else t.renderbufferStorage(36161,c,n.width,n.height)}t.bindRenderbuffer(36161,null)}function I(e,n){var r=n&&n.isWebGLRenderTargetCube;if(r)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,e),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");i.get(n.depthTexture).__webglTexture&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),S(n.depthTexture,0);var o=i.get(n.depthTexture).__webglTexture;if(n.depthTexture.format===Vt)t.framebufferTexture2D(36160,36096,3553,o,0);else{if(n.depthTexture.format!==Wt)throw new Error("Unknown depthTexture format");t.framebufferTexture2D(36160,33306,3553,o,0)}}function z(e){var n=i.get(e),r=!0===e.isWebGLRenderTargetCube;if(e.depthTexture){if(r)throw new Error("target.depthTexture not supported in Cube render targets");I(n.__webglFramebuffer,e)}else if(r){n.__webglDepthbuffer=[];for(var o=0;o<6;o++)t.bindFramebuffer(36160,n.__webglFramebuffer[o]),n.__webglDepthbuffer[o]=t.createRenderbuffer(),N(n.__webglDepthbuffer[o],e)}else t.bindFramebuffer(36160,n.__webglFramebuffer),n.__webglDepthbuffer=t.createRenderbuffer(),N(n.__webglDepthbuffer,e);t.bindFramebuffer(36160,null)}function B(e){var s=i.get(e),c=i.get(e.texture);e.addEventListener("dispose",b),c.__webglTexture=t.createTexture(),a.memory.textures++;var l=!0===e.isWebGLRenderTargetCube,u=!0===e.isWebGLMultisampleRenderTarget,h=p(e)||r.isWebGL2;if(l){s.__webglFramebuffer=[];for(var d=0;d<6;d++)s.__webglFramebuffer[d]=t.createFramebuffer()}else if(s.__webglFramebuffer=t.createFramebuffer(),u)if(r.isWebGL2){s.__webglMultisampledFramebuffer=t.createFramebuffer(),s.__webglColorRenderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,s.__webglColorRenderbuffer);var v=o.convert(e.texture.format),y=o.convert(e.texture.type),x=g(v,y),w=U(e);t.renderbufferStorageMultisample(36161,w,x,e.width,e.height),t.bindFramebuffer(36160,s.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064,36161,s.__webglColorRenderbuffer),t.bindRenderbuffer(36161,null),e.depthBuffer&&(s.__webglDepthRenderbuffer=t.createRenderbuffer(),N(s.__webglDepthRenderbuffer,e,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(l){n.bindTexture(34067,c.__webglTexture),P(34067,e.texture,h);for(d=0;d<6;d++)D(s.__webglFramebuffer[d],e,36064,34069+d);f(e.texture,h)&&m(34067,e.texture,e.width,e.height),n.bindTexture(34067,null)}else n.bindTexture(3553,c.__webglTexture),P(3553,e.texture,h),D(s.__webglFramebuffer,e,36064,3553),f(e.texture,h)&&m(3553,e.texture,e.width,e.height),n.bindTexture(3553,null);e.depthBuffer&&z(e)}function k(t){var e=t.texture,o=p(t)||r.isWebGL2;if(f(e,o)){var a=t.isWebGLRenderTargetCube?34067:3553,s=i.get(e).__webglTexture;n.bindTexture(a,s),m(a,e,t.width,t.height),n.bindTexture(a,null)}}function H(e){if(e.isWebGLMultisampleRenderTarget)if(r.isWebGL2){var n=i.get(e);t.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,n.__webglFramebuffer);var o=e.width,a=e.height,s=16384;e.depthBuffer&&(s|=256),e.stencilBuffer&&(s|=1024),t.blitFramebuffer(0,0,o,a,0,0,o,a,s,9728)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")}function U(t){return r.isWebGL2&&t.isWebGLMultisampleRenderTarget?Math.min(r.maxSamples,t.samples):0}function G(t){var e=t.id,n=a.render.frame;c[e]!==n&&(c[e]=n,t.update())}var F=!1,j=!1;function V(t,e){t&&t.isWebGLRenderTarget&&(!1===F&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),F=!0),t=t.texture),S(t,e)}function W(t,e){t&&t.isWebGLRenderTargetCube&&(!1===j&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),j=!0),t=t.texture),t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?C(t,e):L(t,e)}this.allocateTextureUnit=T,this.resetTextureUnits=M,this.setTexture2D=S,this.setTexture2DArray=E,this.setTexture3D=A,this.setTextureCube=C,this.setTextureCubeDynamic=L,this.setupRenderTarget=B,this.updateRenderTargetMipmap=k,this.updateMultisampleRenderTarget=H,this.safeSetTexture2D=V,this.safeSetTextureCube=W}function Ja(t,e,n){function i(t){var i;if(t===vt)return 10497;if(t===yt)return 33071;if(t===bt)return 33648;if(t===xt)return 9728;if(t===wt)return 9984;if(t===_t)return 9986;if(t===Mt)return 9729;if(t===Tt)return 9985;if(t===St)return 9987;if(t===Et)return 5121;if(t===Nt)return 32819;if(t===It)return 32820;if(t===zt)return 33635;if(t===At)return 5120;if(t===Ct)return 5122;if(t===Lt)return 5123;if(t===Pt)return 5124;if(t===Rt)return 5125;if(t===Ot)return 5126;if(t===Dt){if(n.isWebGL2)return 5131;if(i=e.get("OES_texture_half_float"),null!==i)return i.HALF_FLOAT_OES}if(t===kt)return 6406;if(t===Ht)return 6407;if(t===Ut)return 6408;if(t===Gt)return 6409;if(t===Ft)return 6410;if(t===Vt)return 6402;if(t===Wt)return 34041;if(t===qt)return 6403;if(t===P)return 32774;if(t===R)return 32778;if(t===O)return 32779;if(t===I)return 0;if(t===z)return 1;if(t===B)return 768;if(t===k)return 769;if(t===H)return 770;if(t===U)return 771;if(t===G)return 772;if(t===F)return 773;if(t===j)return 774;if(t===V)return 775;if(t===W)return 776;if((t===Xt||t===Yt||t===Jt||t===Zt)&&(i=e.get("WEBGL_compressed_texture_s3tc"),null!==i)){if(t===Xt)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===Yt)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===Jt)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===Zt)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((t===$t||t===Qt||t===Kt||t===te)&&(i=e.get("WEBGL_compressed_texture_pvrtc"),null!==i)){if(t===$t)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===Qt)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===Kt)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===te)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(t===ee&&(i=e.get("WEBGL_compressed_texture_etc1"),null!==i))return i.COMPRESSED_RGB_ETC1_WEBGL;if((t===ne||t===ie||t===re||t===oe||t===ae||t===se||t===ce||t===le||t===ue||t===he||t===pe||t===de||t===fe||t===me)&&(i=e.get("WEBGL_compressed_texture_astc"),null!==i))return t;if(t===D||t===N){if(n.isWebGL2){if(t===D)return 32775;if(t===N)return 32776}if(i=e.get("EXT_blend_minmax"),null!==i){if(t===D)return i.MIN_EXT;if(t===N)return i.MAX_EXT}}if(t===Bt){if(n.isWebGL2)return 34042;if(i=e.get("WEBGL_depth_texture"),null!==i)return i.UNSIGNED_INT_24_8_WEBGL}return 0}return{convert:i}}function Za(){Pr.call(this),this.type="Group"}function $a(){Pr.call(this),this.type="Camera",this.matrixWorldInverse=new rn,this.projectionMatrix=new rn,this.projectionMatrixInverse=new rn}function Qa(t,e,n,i){$a.call(this),this.type="PerspectiveCamera",this.fov=void 0!==t?t:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==i?i:2e3,this.focus=10,this.aspect=void 0!==e?e:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function Ka(t){Qa.call(this),this.cameras=t||[]}Va.prototype=Object.create(Qr.prototype),Va.prototype.constructor=Va,Va.prototype.isMeshDepthMaterial=!0,Va.prototype.copy=function(t){return Qr.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},Wa.prototype=Object.create(Qr.prototype),Wa.prototype.constructor=Wa,Wa.prototype.isMeshDistanceMaterial=!0,Wa.prototype.copy=function(t){return Qr.prototype.copy.call(this,t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this},Za.prototype=Object.assign(Object.create(Pr.prototype),{constructor:Za,isGroup:!0}),$a.prototype=Object.assign(Object.create(Pr.prototype),{constructor:$a,isCamera:!0,copy:function(t,e){return Pr.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new je),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){Pr.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),Qa.prototype=Object.assign(Object.create($a.prototype),{constructor:Qa,isPerspectiveCamera:!0,copy:function(t,e){return $a.prototype.copy.call(this,t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){var e=.5*this.getFilmHeight()/t;this.fov=2*Ue.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*Ue.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*Ue.RAD2DEG*Math.atan(Math.tan(.5*Ue.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,e,n,i,r,o){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.near,e=t*Math.tan(.5*Ue.DEG2RAD*this.fov)/this.zoom,n=2*e,i=this.aspect*n,r=-.5*i,o=this.view;if(null!==this.view&&this.view.enabled){var a=o.fullWidth,s=o.fullHeight;r+=o.offsetX*i/a,e-=o.offsetY*n/s,i*=o.width/a,n*=o.height/s}var c=this.filmOffset;0!==c&&(r+=t*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,e,e-n,t,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=Pr.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}),Ka.prototype=Object.assign(Object.create(Qa.prototype),{constructor:Ka,isArrayCamera:!0});var ts,es=new je,ns=new je;function is(t,e,n){es.setFromMatrixPosition(e.matrixWorld),ns.setFromMatrixPosition(n.matrixWorld);var i=es.distanceTo(ns),r=e.projectionMatrix.elements,o=n.projectionMatrix.elements,a=r[14]/(r[10]-1),s=r[14]/(r[10]+1),c=(r[9]+1)/r[5],l=(r[9]-1)/r[5],u=(r[8]-1)/r[0],h=(o[8]+1)/o[0],p=a*u,d=a*h,f=i/(-u+h),m=f*-u;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(m),t.translateZ(f),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var g=a+f,v=s+f,y=p-m,b=d+(i-m),x=c*s/v*g,w=l*s/v*g;t.projectionMatrix.makePerspective(y,b,x,w,g,v)}function rs(t){var e,n,i=this,r=null,o=null,a=null,s=[],c=new rn,l=new rn,u=1,h="local-floor";"undefined"!==typeof window&&"VRFrameData"in window&&(o=new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",w,!1));var p=new rn,d=new Fe,f=new je,m=new Qa;m.viewport=new Ye,m.layers.enable(1);var g=new Qa;g.viewport=new Ye,g.layers.enable(2);var v=new Ka([m,g]);function y(){return null!==r&&!0===r.isPresenting}v.layers.enable(1),v.layers.enable(2);var b,x=new Ge;function w(){if(y()){var o=r.getEyeParameters("left");e=2*o.renderWidth*u,n=o.renderHeight*u,b=t.getPixelRatio(),t.getSize(x),t.setDrawingBufferSize(e,n,1),m.viewport.set(0,0,e/2,n),g.viewport.set(e/2,0,e/2,n),E.start()}else i.enabled&&t.setDrawingBufferSize(x.width,x.height,b),E.stop()}var _=[];function M(t){for(var e=navigator.getGamepads&&navigator.getGamepads(),n=0,i=0,r=e.length;n<r;n++){var o=e[n];if(o&&("Daydream Controller"===o.id||"Gear VR Controller"===o.id||"Oculus Go Controller"===o.id||"OpenVR Gamepad"===o.id||o.id.startsWith("Oculus Touch")||o.id.startsWith("Spatial Controller"))){if(i===t)return o;i++}}}function T(){for(var t=0;t<s.length;t++){var e=s[t],n=M(t);if(void 0!==n&&void 0!==n.pose){if(null===n.pose)return;var i=n.pose;!1===i.hasPosition&&e.position.set(.2,-.6,-.05),null!==i.position&&e.position.fromArray(i.position),null!==i.orientation&&e.quaternion.fromArray(i.orientation),e.matrix.compose(e.position,e.quaternion,e.scale),e.matrix.premultiply(c),e.matrix.decompose(e.position,e.quaternion,e.scale),e.matrixWorldNeedsUpdate=!0,e.visible=!0;var r="Daydream Controller"===n.id?0:1;void 0===_[t]&&(_[t]=!1),_[t]!==n.buttons[r].pressed&&(_[t]=n.buttons[r].pressed,!0===_[t]?e.dispatchEvent({type:"selectstart"}):(e.dispatchEvent({type:"selectend"}),e.dispatchEvent({type:"select"})))}else e.visible=!1}}function S(t,i){null!==i&&4===i.length&&t.set(i[0]*e,i[1]*n,i[2]*e,i[3]*n)}this.enabled=!1,this.getController=function(t){var e=s[t];return void 0===e&&(e=new Za,e.matrixAutoUpdate=!1,e.visible=!1,s[t]=e),e},this.getDevice=function(){return r},this.setDevice=function(t){void 0!==t&&(r=t),E.setContext(t)},this.setFramebufferScaleFactor=function(t){u=t},this.setReferenceSpaceType=function(t){h=t},this.setPoseTarget=function(t){void 0!==t&&(a=t)},this.getCamera=function(t){var e="local-floor"===h?1.6:0;if(!1===y())return t.position.set(0,e,0),t.rotation.set(0,0,0),t;if(r.depthNear=t.near,r.depthFar=t.far,r.getFrameData(o),"local-floor"===h){var n=r.stageParameters;n?c.fromArray(n.sittingToStandingTransform):c.makeTranslation(0,e,0)}var i=o.pose,s=null!==a?a:t;s.matrix.copy(c),s.matrix.decompose(s.position,s.quaternion,s.scale),null!==i.orientation&&(d.fromArray(i.orientation),s.quaternion.multiply(d)),null!==i.position&&(d.setFromRotationMatrix(c),f.fromArray(i.position),f.applyQuaternion(d),s.position.add(f)),s.updateMatrixWorld(),m.near=t.near,g.near=t.near,m.far=t.far,g.far=t.far,m.matrixWorldInverse.fromArray(o.leftViewMatrix),g.matrixWorldInverse.fromArray(o.rightViewMatrix),l.getInverse(c),"local-floor"===h&&(m.matrixWorldInverse.multiply(l),g.matrixWorldInverse.multiply(l));var u=s.parent;null!==u&&(p.getInverse(u.matrixWorld),m.matrixWorldInverse.multiply(p),g.matrixWorldInverse.multiply(p)),m.matrixWorld.getInverse(m.matrixWorldInverse),g.matrixWorld.getInverse(g.matrixWorldInverse),m.projectionMatrix.fromArray(o.leftProjectionMatrix),g.projectionMatrix.fromArray(o.rightProjectionMatrix),is(v,m,g);var b=r.getLayers();if(b.length){var x=b[0];S(m.viewport,x.leftBounds),S(g.viewport,x.rightBounds)}return T(),v},this.getStandingMatrix=function(){return c},this.isPresenting=y;var E=new Tr;this.setAnimationLoop=function(t){E.setAnimationLoop(t),y()&&E.start()},this.submitFrame=function(){y()&&r.submitFrame()},this.dispose=function(){"undefined"!==typeof window&&window.removeEventListener("vrdisplaypresentchange",w)},this.setFrameOfReferenceType=function(){console.warn("THREE.WebVRManager: setFrameOfReferenceType() has been deprecated.")}}function os(t){var e=t.context,n=null,i=null,r="local-floor",o=null,a=[],s=[];function c(){return null!==n&&null!==i}var l=new Qa;l.layers.enable(1),l.viewport=new Ye;var u=new Qa;u.layers.enable(2),u.viewport=new Ye;var h=new Ka([l,u]);function p(t){for(var e=0;e<a.length;e++)s[e]===t.inputSource&&a[e].dispatchEvent({type:t.type})}function d(){t.setFramebuffer(null),t.setRenderTarget(t.getRenderTarget()),y.stop()}function f(t){i=t,y.setContext(n),y.start()}function m(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)}h.layers.enable(1),h.layers.enable(2),this.enabled=!1,this.getController=function(t){var e=a[t];return void 0===e&&(e=new Za,e.matrixAutoUpdate=!1,e.visible=!1,a[t]=e),e},this.setFramebufferScaleFactor=function(t){},this.setReferenceSpaceType=function(t){r=t},this.getSession=function(){return n},this.setSession=function(t){n=t,null!==n&&(n.addEventListener("select",p),n.addEventListener("selectstart",p),n.addEventListener("selectend",p),n.addEventListener("end",d),n.updateRenderState({baseLayer:new XRWebGLLayer(n,e)}),n.requestReferenceSpace(r).then(f),s=n.inputSources,n.addEventListener("inputsourceschange",(function(){s=n.inputSources,console.log(s);for(var t=0;t<a.length;t++){var e=a[t];e.userData.inputSource=s[t]}})))},this.getCamera=function(t){if(c()){var e=t.parent,n=h.cameras;m(h,e);for(var i=0;i<n.length;i++)m(n[i],e);t.matrixWorld.copy(h.matrixWorld);for(var r=t.children,o=(i=0,r.length);i<o;i++)r[i].updateMatrixWorld(!0);return is(h,l,u),h}return t},this.isPresenting=c;var g=null;function v(e,r){if(o=r.getViewerPose(i),null!==o){var c=o.views,l=n.renderState.baseLayer;t.setFramebuffer(l.framebuffer);for(var u=0;u<c.length;u++){var p=c[u],d=l.getViewport(p),f=p.transform.inverse.matrix,m=h.cameras[u];m.matrix.fromArray(f).getInverse(m.matrix),m.projectionMatrix.fromArray(p.projectionMatrix),m.viewport.set(d.x,d.y,d.width,d.height),0===u&&h.matrix.copy(m.matrix)}}for(u=0;u<a.length;u++){var v=a[u],y=s[u];if(y){var b=r.getPose(y.targetRaySpace,i);if(null!==b){v.matrix.fromArray(b.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.visible=!0;continue}}v.visible=!1}g&&g(e)}var y=new Tr;y.setAnimationLoop(v),this.setAnimationLoop=function(t){g=t},this.dispose=function(){},this.getStandingMatrix=function(){return console.warn("THREE.WebXRManager: getStandingMatrix() is no longer needed."),new rn},this.getDevice=function(){console.warn("THREE.WebXRManager: getDevice() has been deprecated.")},this.setDevice=function(){console.warn("THREE.WebXRManager: setDevice() has been deprecated.")},this.setFrameOfReferenceType=function(){console.warn("THREE.WebXRManager: setFrameOfReferenceType() has been deprecated.")},this.submitFrame=function(){}}function as(t){console.log("THREE.WebGLRenderer",o),t=t||{};var e=void 0!==t.canvas?t.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),n=void 0!==t.context?t.context:null,i=void 0!==t.alpha&&t.alpha,r=void 0===t.depth||t.depth,a=void 0===t.stencil||t.stencil,s=void 0!==t.antialias&&t.antialias,c=void 0===t.premultipliedAlpha||t.premultipliedAlpha,l=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,u=void 0!==t.powerPreference?t.powerPreference:"default",h=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat,p=null,d=null;this.domElement=e,this.context=null,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.gammaInput=!1,this.gammaOutput=!1,this.physicallyCorrectLights=!1,this.toneMapping=rt,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var f,m,g,y,b,x,w,_,M,T,S,E,A,C,L,P,R,O,D=this,N=!1,I=null,z=0,B=0,k=null,H=null,U=-1,G={geometry:null,program:null,wireframe:!1},F=null,j=null,V=new Ye,W=new Ye,q=null,X=e.width,Y=e.height,J=1,Z=new Ye(0,0,X,Y),$=new Ye(0,0,X,Y),Q=!1,K=new nn,tt=new lo,et=!1,nt=!1,it=new rn,ot=new je;function at(){return null===k?J:1}try{var st={alpha:i,depth:r,stencil:a,antialias:s,premultipliedAlpha:c,preserveDrawingBuffer:l,powerPreference:u,failIfMajorPerformanceCaveat:h,xrCompatible:!0};if(e.addEventListener("webglcontextlost",ht,!1),e.addEventListener("webglcontextrestored",pt,!1),f=n||e.getContext("webgl",st)||e.getContext("experimental-webgl",st),null===f)throw null!==e.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===f.getShaderPrecisionFormat&&(f.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(qt){throw console.error("THREE.WebGLRenderer: "+qt.message),qt}function ct(){m=new uo(f),g=new co(f,m,t),g.isWebGL2||(m.get("WEBGL_depth_texture"),m.get("OES_texture_float"),m.get("OES_texture_half_float"),m.get("OES_texture_half_float_linear"),m.get("OES_standard_derivatives"),m.get("OES_element_index_uint"),m.get("ANGLE_instanced_arrays")),m.get("OES_texture_float_linear"),O=new Ja(f,m,g),y=new Xa(f,m,O,g),y.scissor(W.copy($).multiplyScalar(J)),y.viewport(V.copy(Z).multiplyScalar(J)),b=new fo(f),x=new Na,w=new Ya(f,m,y,x,g,O,b),_=new Sr(f),M=new ho(f,_,b),T=new vo(M,b),L=new go(f),S=new Da(D,m,g,w),E=new ka,A=new ja,C=new ao(D,y,T,c),P=new so(f,m,b,g),R=new po(f,m,b,g),b.programs=S.programs,D.context=f,D.capabilities=g,D.extensions=m,D.properties=x,D.renderLists=E,D.state=y,D.info=b}ct();var lt="undefined"!==typeof navigator&&"xr"in navigator&&"supportsSession"in navigator.xr?new os(D):new rs(D);this.vr=lt;var ut=new qa(D,T,g.maxTextureSize);function ht(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),N=!0}function pt(){console.log("THREE.WebGLRenderer: Context Restored."),N=!1,ct()}function dt(t){var e=t.target;e.removeEventListener("dispose",dt),ft(e)}function ft(t){mt(t),x.remove(t)}function mt(t){var e=x.get(t).program;t.program=void 0,void 0!==e&&S.releaseProgram(e)}function gt(t,e){t.render((function(t){D.renderBufferImmediate(t,e)}))}function vt(t,e,n){if(n&&n.isInstancedBufferGeometry&&!g.isWebGL2&&null===m.get("ANGLE_instanced_arrays"))console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");else{y.initAttributes();var i=n.attributes,r=e.getAttributes(),o=t.defaultAttributeValues;for(var a in r){var s=r[a];if(s>=0){var c=i[a];if(void 0!==c){var l=c.normalized,u=c.itemSize,h=_.get(c);if(void 0===h)continue;var p=h.buffer,d=h.type,v=h.bytesPerElement;if(c.isInterleavedBufferAttribute){var b=c.data,x=b.stride,w=c.offset;b&&b.isInstancedInterleavedBuffer?(y.enableAttributeAndDivisor(s,b.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=b.meshPerAttribute*b.count)):y.enableAttribute(s),f.bindBuffer(34962,p),f.vertexAttribPointer(s,u,d,l,x*v,w*v)}else c.isInstancedBufferAttribute?(y.enableAttributeAndDivisor(s,c.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=c.meshPerAttribute*c.count)):y.enableAttribute(s),f.bindBuffer(34962,p),f.vertexAttribPointer(s,u,d,l,0,0)}else if(void 0!==o){var M=o[a];if(void 0!==M)switch(M.length){case 2:f.vertexAttrib2fv(s,M);break;case 3:f.vertexAttrib3fv(s,M);break;case 4:f.vertexAttrib4fv(s,M);break;default:f.vertexAttrib1fv(s,M)}}}}y.disableUnusedAttributes()}}this.shadowMap=ut,this.getContext=function(){return f},this.getContextAttributes=function(){return f.getContextAttributes()},this.forceContextLoss=function(){var t=m.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){var t=m.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return J},this.setPixelRatio=function(t){void 0!==t&&(J=t,this.setSize(X,Y,!1))},this.getSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),t=new Ge),t.set(X,Y)},this.setSize=function(t,n,i){lt.isPresenting()?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(X=t,Y=n,e.width=t*J,e.height=n*J,!1!==i&&(e.style.width=t+"px",e.style.height=n+"px"),this.setViewport(0,0,t,n))},this.getDrawingBufferSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),t=new Ge),t.set(X*J,Y*J)},this.setDrawingBufferSize=function(t,n,i){X=t,Y=n,J=i,e.width=t*i,e.height=n*i,this.setViewport(0,0,t,n)},this.getCurrentViewport=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),t=new Ye),t.copy(V)},this.getViewport=function(t){return t.copy(Z)},this.setViewport=function(t,e,n,i){t.isVector4?Z.set(t.x,t.y,t.z,t.w):Z.set(t,e,n,i),y.viewport(V.copy(Z).multiplyScalar(J))},this.getScissor=function(t){return t.copy($)},this.setScissor=function(t,e,n,i){t.isVector4?$.set(t.x,t.y,t.z,t.w):$.set(t,e,n,i),y.scissor(W.copy($).multiplyScalar(J))},this.getScissorTest=function(){return Q},this.setScissorTest=function(t){y.setScissorTest(Q=t)},this.getClearColor=function(){return C.getClearColor()},this.setClearColor=function(){C.setClearColor.apply(C,arguments)},this.getClearAlpha=function(){return C.getClearAlpha()},this.setClearAlpha=function(){C.setClearAlpha.apply(C,arguments)},this.clear=function(t,e,n){var i=0;(void 0===t||t)&&(i|=16384),(void 0===e||e)&&(i|=256),(void 0===n||n)&&(i|=1024),f.clear(i)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",ht,!1),e.removeEventListener("webglcontextrestored",pt,!1),E.dispose(),A.dispose(),x.dispose(),T.dispose(),lt.dispose(),xt.stop()},this.renderBufferImmediate=function(t,e){y.initAttributes();var n=x.get(t);t.hasPositions&&!n.position&&(n.position=f.createBuffer()),t.hasNormals&&!n.normal&&(n.normal=f.createBuffer()),t.hasUvs&&!n.uv&&(n.uv=f.createBuffer()),t.hasColors&&!n.color&&(n.color=f.createBuffer());var i=e.getAttributes();t.hasPositions&&(f.bindBuffer(34962,n.position),f.bufferData(34962,t.positionArray,35048),y.enableAttribute(i.position),f.vertexAttribPointer(i.position,3,5126,!1,0,0)),t.hasNormals&&(f.bindBuffer(34962,n.normal),f.bufferData(34962,t.normalArray,35048),y.enableAttribute(i.normal),f.vertexAttribPointer(i.normal,3,5126,!1,0,0)),t.hasUvs&&(f.bindBuffer(34962,n.uv),f.bufferData(34962,t.uvArray,35048),y.enableAttribute(i.uv),f.vertexAttribPointer(i.uv,2,5126,!1,0,0)),t.hasColors&&(f.bindBuffer(34962,n.color),f.bufferData(34962,t.colorArray,35048),y.enableAttribute(i.color),f.vertexAttribPointer(i.color,3,5126,!1,0,0)),y.disableUnusedAttributes(),f.drawArrays(4,0,t.count),t.count=0},this.renderBufferDirect=function(t,e,n,i,r,o){var a=r.isMesh&&r.matrixWorld.determinant()<0;y.setMaterial(i,a);var s=St(t,e,i,r),c=!1;G.geometry===n.id&&G.program===s.id&&G.wireframe===(!0===i.wireframe)||(G.geometry=n.id,G.program=s.id,G.wireframe=!0===i.wireframe,c=!0),r.morphTargetInfluences&&(L.update(r,n,i,s),c=!0);var l,u=n.index,h=n.attributes.position,p=1;!0===i.wireframe&&(u=M.getWireframeAttribute(n),p=2);var d=P;null!==u&&(l=_.get(u),d=R,d.setIndex(l)),c&&(vt(i,s,n),null!==u&&f.bindBuffer(34963,l.buffer));var m=1/0;null!==u?m=u.count:void 0!==h&&(m=h.count);var g=n.drawRange.start*p,v=n.drawRange.count*p,b=null!==o?o.start*p:0,x=null!==o?o.count*p:1/0,w=Math.max(g,b),T=Math.min(m,g+v,b+x)-1,S=Math.max(0,T-w+1);if(0!==S){if(r.isMesh)if(!0===i.wireframe)y.setLineWidth(i.wireframeLinewidth*at()),d.setMode(1);else switch(r.drawMode){case Se:d.setMode(4);break;case Ee:d.setMode(5);break;case Ae:d.setMode(6);break}else if(r.isLine){var E=i.linewidth;void 0===E&&(E=1),y.setLineWidth(E*at()),r.isLineSegments?d.setMode(1):r.isLineLoop?d.setMode(2):d.setMode(3)}else r.isPoints?d.setMode(0):r.isSprite&&d.setMode(4);n&&n.isInstancedBufferGeometry?n.maxInstancedCount>0&&d.renderInstances(n,w,S):d.render(w,S)}},this.compile=function(t,e){d=A.get(t,e),d.init(),t.traverse((function(t){t.isLight&&(d.pushLight(t),t.castShadow&&d.pushShadow(t))})),d.setupLights(e),t.traverse((function(e){if(e.material)if(Array.isArray(e.material))for(var n=0;n<e.material.length;n++)Tt(e.material[n],t.fog,e);else Tt(e.material,t.fog,e)}))};var yt=null;function bt(t){lt.isPresenting()||yt&&yt(t)}var xt=new Tr;function wt(t,e,n,i){if(!1!==t.visible){var r=t.layers.test(e.layers);if(r)if(t.isGroup)n=t.renderOrder;else if(t.isLight)d.pushLight(t),t.castShadow&&d.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||K.intersectsSprite(t)){i&&ot.setFromMatrixPosition(t.matrixWorld).applyMatrix4(it);var o=T.update(t),a=t.material;a.visible&&p.push(t,o,a,n,ot.z,null)}}else if(t.isImmediateRenderObject)i&&ot.setFromMatrixPosition(t.matrixWorld).applyMatrix4(it),p.push(t,null,t.material,n,ot.z,null);else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.update(),!t.frustumCulled||K.intersectsObject(t))){i&&ot.setFromMatrixPosition(t.matrixWorld).applyMatrix4(it);o=T.update(t),a=t.material;if(Array.isArray(a))for(var s=o.groups,c=0,l=s.length;c<l;c++){var u=s[c],h=a[u.materialIndex];h&&h.visible&&p.push(t,o,h,n,ot.z,u)}else a.visible&&p.push(t,o,a,n,ot.z,null)}var f=t.children;for(c=0,l=f.length;c<l;c++)wt(f[c],e,n,i)}}function _t(t,e,n,i){for(var r=0,o=t.length;r<o;r++){var a=t[r],s=a.object,c=a.geometry,l=void 0===i?a.material:i,u=a.group;if(n.isArrayCamera){j=n;for(var h=n.cameras,p=0,f=h.length;p<f;p++){var m=h[p];s.layers.test(m.layers)&&(y.viewport(V.copy(m.viewport)),d.setupLights(m),Mt(s,e,m,c,l,u))}}else j=null,Mt(s,e,n,c,l,u)}}function Mt(t,e,n,i,r,o){if(t.onBeforeRender(D,e,n,i,r,o),d=A.get(e,j||n),t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject){y.setMaterial(r);var a=St(n,e.fog,r,t);G.geometry=null,G.program=null,G.wireframe=!1,gt(t,a)}else D.renderBufferDirect(n,e.fog,i,r,t,o);t.onAfterRender(D,e,n,i,r,o),d=A.get(e,j||n)}function Tt(t,e,n){var i=x.get(t),r=d.state.lights,o=d.state.shadowsArray,a=i.lightsHash,s=r.state.hash,c=S.getParameters(t,r.state,o,e,tt.numPlanes,tt.numIntersection,n),l=S.getProgramCode(t,c),u=i.program,h=!0;if(void 0===u)t.addEventListener("dispose",dt);else if(u.code!==l)mt(t);else if(a.stateID!==s.stateID||a.directionalLength!==s.directionalLength||a.pointLength!==s.pointLength||a.spotLength!==s.spotLength||a.rectAreaLength!==s.rectAreaLength||a.hemiLength!==s.hemiLength||a.shadowsLength!==s.shadowsLength)a.stateID=s.stateID,a.directionalLength=s.directionalLength,a.pointLength=s.pointLength,a.spotLength=s.spotLength,a.rectAreaLength=s.rectAreaLength,a.hemiLength=s.hemiLength,a.shadowsLength=s.shadowsLength,h=!1;else{if(void 0!==c.shaderID)return;h=!1}if(h){if(c.shaderID){var p=Mr[c.shaderID];i.shader={name:t.type,uniforms:vr(p.uniforms),vertexShader:p.vertexShader,fragmentShader:p.fragmentShader}}else i.shader={name:t.type,uniforms:t.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader};t.onBeforeCompile(i.shader,D),l=S.getProgramCode(t,c),u=S.acquireProgram(t,i.shader,c,l),i.program=u,t.program=u}var f=u.getAttributes();if(t.morphTargets){t.numSupportedMorphTargets=0;for(var m=0;m<D.maxMorphTargets;m++)f["morphTarget"+m]>=0&&t.numSupportedMorphTargets++}if(t.morphNormals){t.numSupportedMorphNormals=0;for(m=0;m<D.maxMorphNormals;m++)f["morphNormal"+m]>=0&&t.numSupportedMorphNormals++}var g=i.shader.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(i.numClippingPlanes=tt.numPlanes,i.numIntersection=tt.numIntersection,g.clippingPlanes=tt.uniform),i.fog=e,void 0===a&&(i.lightsHash=a={}),a.stateID=s.stateID,a.directionalLength=s.directionalLength,a.pointLength=s.pointLength,a.spotLength=s.spotLength,a.rectAreaLength=s.rectAreaLength,a.hemiLength=s.hemiLength,a.shadowsLength=s.shadowsLength,t.lights&&(g.ambientLightColor.value=r.state.ambient,g.lightProbe.value=r.state.probe,g.directionalLights.value=r.state.directional,g.spotLights.value=r.state.spot,g.rectAreaLights.value=r.state.rectArea,g.pointLights.value=r.state.point,g.hemisphereLights.value=r.state.hemi,g.directionalShadowMap.value=r.state.directionalShadowMap,g.directionalShadowMatrix.value=r.state.directionalShadowMatrix,g.spotShadowMap.value=r.state.spotShadowMap,g.spotShadowMatrix.value=r.state.spotShadowMatrix,g.pointShadowMap.value=r.state.pointShadowMap,g.pointShadowMatrix.value=r.state.pointShadowMatrix);var v=i.program.getUniforms(),y=ga.seqWithValue(v.seq,g);i.uniformsList=y}function St(t,e,n,i){w.resetTextureUnits();var r=x.get(n),o=d.state.lights,a=r.lightsHash,s=o.state.hash;if(et&&(nt||t!==F)){var c=t===F&&n.id===U;tt.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,t,r,c)}!1===n.needsUpdate&&(void 0===r.program?n.needsUpdate=!0:n.fog&&r.fog!==e?n.needsUpdate=!0:(!n.lights||a.stateID===s.stateID&&a.directionalLength===s.directionalLength&&a.pointLength===s.pointLength&&a.spotLength===s.spotLength&&a.rectAreaLength===s.rectAreaLength&&a.hemiLength===s.hemiLength&&a.shadowsLength===s.shadowsLength)&&(void 0===r.numClippingPlanes||r.numClippingPlanes===tt.numPlanes&&r.numIntersection===tt.numIntersection)||(n.needsUpdate=!0)),n.needsUpdate&&(Tt(n,e,i),n.needsUpdate=!1);var l=!1,u=!1,h=!1,p=r.program,m=p.getUniforms(),v=r.shader.uniforms;if(y.useProgram(p.program)&&(l=!0,u=!0,h=!0),n.id!==U&&(U=n.id,u=!0),l||F!==t){if(m.setValue(f,"projectionMatrix",t.projectionMatrix),g.logarithmicDepthBuffer&&m.setValue(f,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),F!==t&&(F=t,u=!0,h=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshStandardMaterial||n.envMap){var b=m.map.cameraPosition;void 0!==b&&b.setValue(f,ot.setFromMatrixPosition(t.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&m.setValue(f,"viewMatrix",t.matrixWorldInverse)}if(n.skinning){m.setOptional(f,i,"bindMatrix"),m.setOptional(f,i,"bindMatrixInverse");var _=i.skeleton;if(_){var M=_.bones;if(g.floatVertexTextures){if(void 0===_.boneTexture){var T=Math.sqrt(4*M.length);T=Ue.ceilPowerOfTwo(T),T=Math.max(T,4);var S=new Float32Array(T*T*4);S.set(_.boneMatrices);var E=new Qe(S,T,T,Ut,Ot);E.needsUpdate=!0,_.boneMatrices=S,_.boneTexture=E,_.boneTextureSize=T}m.setValue(f,"boneTexture",_.boneTexture,w),m.setValue(f,"boneTextureSize",_.boneTextureSize)}else m.setOptional(f,_,"boneMatrices")}}return u&&(m.setValue(f,"toneMappingExposure",D.toneMappingExposure),m.setValue(f,"toneMappingWhitePoint",D.toneMappingWhitePoint),n.lights&&Wt(v,h),e&&n.fog&&Nt(v,e),n.isMeshBasicMaterial?At(v,n):n.isMeshLambertMaterial?(At(v,n),It(v,n)):n.isMeshPhongMaterial?(At(v,n),n.isMeshToonMaterial?Bt(v,n):zt(v,n)):n.isMeshStandardMaterial?(At(v,n),n.isMeshPhysicalMaterial?Ht(v,n):kt(v,n)):n.isMeshMatcapMaterial?(At(v,n),Gt(v,n)):n.isMeshDepthMaterial?(At(v,n),Ft(v,n)):n.isMeshDistanceMaterial?(At(v,n),jt(v,n)):n.isMeshNormalMaterial?(At(v,n),Vt(v,n)):n.isLineBasicMaterial?(Ct(v,n),n.isLineDashedMaterial&&Lt(v,n)):n.isPointsMaterial?Pt(v,n):n.isSpriteMaterial?Rt(v,n):n.isShadowMaterial&&(v.color.value.copy(n.color),v.opacity.value=n.opacity),void 0!==v.ltc_1&&(v.ltc_1.value=_r.LTC_1),void 0!==v.ltc_2&&(v.ltc_2.value=_r.LTC_2),ga.upload(f,r.uniformsList,v,w)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(ga.upload(f,r.uniformsList,v,w),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&m.setValue(f,"center",i.center),m.setValue(f,"modelViewMatrix",i.modelViewMatrix),m.setValue(f,"normalMatrix",i.normalMatrix),m.setValue(f,"modelMatrix",i.matrixWorld),p}function At(t,e){var n;t.opacity.value=e.opacity,e.color&&t.diffuse.value.copy(e.color),e.emissive&&t.emissive.value.copy(e.emissive).multiplyScalar(e.emissiveIntensity),e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.specularMap&&(t.specularMap.value=e.specularMap),e.envMap&&(t.envMap.value=e.envMap,t.flipEnvMap.value=e.envMap.isCubeTexture?-1:1,t.reflectivity.value=e.reflectivity,t.refractionRatio.value=e.refractionRatio,t.maxMipLevel.value=x.get(e.envMap).__maxMipLevel),e.lightMap&&(t.lightMap.value=e.lightMap,t.lightMapIntensity.value=e.lightMapIntensity),e.aoMap&&(t.aoMap.value=e.aoMap,t.aoMapIntensity.value=e.aoMapIntensity),e.map?n=e.map:e.specularMap?n=e.specularMap:e.displacementMap?n=e.displacementMap:e.normalMap?n=e.normalMap:e.bumpMap?n=e.bumpMap:e.roughnessMap?n=e.roughnessMap:e.metalnessMap?n=e.metalnessMap:e.alphaMap?n=e.alphaMap:e.emissiveMap&&(n=e.emissiveMap),void 0!==n&&(n.isWebGLRenderTarget&&(n=n.texture),!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}function Ct(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity}function Lt(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}function Pt(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*J,t.scale.value=.5*Y,t.map.value=e.map,null!==e.map&&(!0===e.map.matrixAutoUpdate&&e.map.updateMatrix(),t.uvTransform.value.copy(e.map.matrix))}function Rt(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,t.map.value=e.map,null!==e.map&&(!0===e.map.matrixAutoUpdate&&e.map.updateMatrix(),t.uvTransform.value.copy(e.map.matrix))}function Nt(t,e){t.fogColor.value.copy(e.color),e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)}function It(t,e){e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}function zt(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===v&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===v&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function Bt(t,e){zt(t,e),e.gradientMap&&(t.gradientMap.value=e.gradientMap)}function kt(t,e){t.roughness.value=e.roughness,t.metalness.value=e.metalness,e.roughnessMap&&(t.roughnessMap.value=e.roughnessMap),e.metalnessMap&&(t.metalnessMap.value=e.metalnessMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===v&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===v&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),e.envMap&&(t.envMapIntensity.value=e.envMapIntensity)}function Ht(t,e){kt(t,e),t.reflectivity.value=e.reflectivity,t.clearCoat.value=e.clearCoat,t.clearCoatRoughness.value=e.clearCoatRoughness}function Gt(t,e){e.matcap&&(t.matcap.value=e.matcap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===v&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===v&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function Ft(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function jt(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}function Vt(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===v&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===v&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function Wt(t,e){t.ambientLightColor.needsUpdate=e,t.lightProbe.needsUpdate=e,t.directionalLights.needsUpdate=e,t.pointLights.needsUpdate=e,t.spotLights.needsUpdate=e,t.rectAreaLights.needsUpdate=e,t.hemisphereLights.needsUpdate=e}xt.setAnimationLoop(bt),"undefined"!==typeof window&&xt.setContext(window),this.setAnimationLoop=function(t){yt=t,lt.setAnimationLoop(t),xt.start()},this.render=function(t,e){var n,i;if(void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),n=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),i=arguments[3]),e&&e.isCamera){if(!N){G.geometry=null,G.program=null,G.wireframe=!1,U=-1,F=null,!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),lt.enabled&&(e=lt.getCamera(e)),d=A.get(t,e),d.init(),t.onBeforeRender(D,t,e,n||k),it.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),K.setFromMatrix(it),nt=this.localClippingEnabled,et=tt.init(this.clippingPlanes,nt,e),p=E.get(t,e),p.init(),wt(t,e,0,D.sortObjects),!0===D.sortObjects&&p.sort(),et&&tt.beginShadows();var r=d.state.shadowsArray;ut.render(r,t,e),d.setupLights(e),et&&tt.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==n&&this.setRenderTarget(n),C.render(p,t,e,i);var o=p.opaque,a=p.transparent;if(t.overrideMaterial){var s=t.overrideMaterial;o.length&&_t(o,t,e,s),a.length&&_t(a,t,e,s)}else o.length&&_t(o,t,e),a.length&&_t(a,t,e);t.onAfterRender(D,t,e),null!==k&&(w.updateRenderTargetMipmap(k),w.updateMultisampleRenderTarget(k)),y.buffers.depth.setTest(!0),y.buffers.depth.setMask(!0),y.buffers.color.setMask(!0),y.setPolygonOffset(!1),lt.enabled&<.submitFrame(),p=null,d=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(t){I!==t&&f.bindFramebuffer(36160,t),I=t},this.getActiveCubeFace=function(){return z},this.getActiveMipMapLevel=function(){return B},this.getRenderTarget=function(){return k},this.setRenderTarget=function(t,e,n){k=t,z=e,B=n,t&&void 0===x.get(t).__webglFramebuffer&&w.setupRenderTarget(t);var i=I,r=!1;if(t){var o=x.get(t).__webglFramebuffer;t.isWebGLRenderTargetCube?(i=o[e||0],r=!0):i=t.isWebGLMultisampleRenderTarget?x.get(t).__webglMultisampledFramebuffer:o,V.copy(t.viewport),W.copy(t.scissor),q=t.scissorTest}else V.copy(Z).multiplyScalar(J),W.copy($).multiplyScalar(J),q=Q;if(H!==i&&(f.bindFramebuffer(36160,i),H=i),y.viewport(V),y.scissor(W),y.setScissorTest(q),r){var a=x.get(t.texture);f.framebufferTexture2D(36160,36064,34069+(e||0),a.__webglTexture,n||0)}},this.readRenderTargetPixels=function(t,e,n,i,r,o,a){if(t&&t.isWebGLRenderTarget){var s=x.get(t).__webglFramebuffer;if(t.isWebGLRenderTargetCube&&void 0!==a&&(s=s[a]),s){var c=!1;s!==H&&(f.bindFramebuffer(36160,s),c=!0);try{var l=t.texture,u=l.format,h=l.type;if(u!==Ut&&O.convert(u)!==f.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(h!==Et&&O.convert(h)!==f.getParameter(35738)&&(h!==Ot||!(g.isWebGL2||m.get("OES_texture_float")||m.get("WEBGL_color_buffer_float")))&&(h!==Dt||(g.isWebGL2?!m.get("EXT_color_buffer_float"):!m.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===f.checkFramebufferStatus(36160)?e>=0&&e<=t.width-i&&n>=0&&n<=t.height-r&&f.readPixels(e,n,i,r,O.convert(u),O.convert(h),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{c&&f.bindFramebuffer(36160,H)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(t,e,n){var i=e.image.width,r=e.image.height,o=O.convert(e.format);w.setTexture2D(e,0),f.copyTexImage2D(3553,n||0,o,t.x,t.y,i,r,0)},this.copyTextureToTexture=function(t,e,n,i){var r=e.image.width,o=e.image.height,a=O.convert(n.format),s=O.convert(n.type);w.setTexture2D(n,0),e.isDataTexture?f.texSubImage2D(3553,i||0,t.x,t.y,r,o,a,s,e.image.data):f.texSubImage2D(3553,i||0,t.x,t.y,a,s,e.image)}}function ss(t,e){this.name="",this.color=new wr(t),this.density=void 0!==e?e:25e-5}function cs(t,e,n){this.name="",this.color=new wr(t),this.near=void 0!==e?e:1,this.far=void 0!==n?n:1e3}function ls(){Pr.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function us(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0}function hs(t,e,n,i){this.data=t,this.itemSize=e,this.offset=n,this.normalized=!0===i}function ps(t){Qr.call(this),this.type="SpriteMaterial",this.color=new wr(16777215),this.map=null,this.rotation=0,this.sizeAttenuation=!0,this.lights=!1,this.transparent=!0,this.setValues(t)}function ds(t){if(Pr.call(this),this.type="Sprite",void 0===ts){ts=new qr;var e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new us(e,5);ts.setIndex([0,1,2,0,2,3]),ts.addAttribute("position",new hs(n,3,0,!1)),ts.addAttribute("uv",new hs(n,2,3,!1))}this.geometry=ts,this.material=void 0!==t?t:new ps,this.center=new Ge(.5,.5)}function fs(){Pr.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function ms(t,e){t&&t.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),oo.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new rn,this.bindMatrixInverse=new rn}function gs(t,e){if(t=t||[],this.bones=t.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),void 0===e)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new rn)}}function vs(){Pr.call(this),this.type="Bone"}function ys(t){Qr.call(this),this.type="LineBasicMaterial",this.color=new wr(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.lights=!1,this.setValues(t)}function bs(t,e,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),Pr.call(this),this.type="Line",this.geometry=void 0!==t?t:new qr,this.material=void 0!==e?e:new ys({color:16777215*Math.random()})}function xs(t,e){bs.call(this,t,e),this.type="LineSegments"}function ws(t,e){bs.call(this,t,e),this.type="LineLoop"}function _s(t){Qr.call(this),this.type="PointsMaterial",this.color=new wr(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.lights=!1,this.setValues(t)}function Ms(t,e){Pr.call(this),this.type="Points",this.geometry=void 0!==t?t:new qr,this.material=void 0!==e?e:new _s({color:16777215*Math.random()})}function Ts(t,e,n,i,r,o,a,s,c){Xe.call(this,t,e,n,i,r,o,a,s,c),this.format=void 0!==a?a:Ht,this.minFilter=void 0!==o?o:Mt,this.magFilter=void 0!==r?r:Mt,this.generateMipmaps=!1}function Ss(t,e,n,i,r,o,a,s,c,l,u,h){Xe.call(this,null,o,a,s,c,l,i,r,u,h),this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function Es(t,e,n,i,r,o,a,s,c){Xe.call(this,t,e,n,i,r,o,a,s,c),this.needsUpdate=!0}function As(t,e,n,i,r,o,a,s,c,l){if(l=void 0!==l?l:Vt,l!==Vt&&l!==Wt)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&l===Vt&&(n=Lt),void 0===n&&l===Wt&&(n=Bt),Xe.call(this,null,i,r,o,a,s,l,n,c),this.image={width:t,height:e},this.magFilter=void 0!==a?a:xt,this.minFilter=void 0!==s?s:xt,this.flipY=!1,this.generateMipmaps=!1}function Cs(t){qr.call(this),this.type="WireframeGeometry";var e,n,i,r,o,a,s,c,l,u,h=[],p=[0,0],d={},f=["a","b","c"];if(t&&t.isGeometry){var m=t.faces;for(e=0,i=m.length;e<i;e++){var g=m[e];for(n=0;n<3;n++)s=g[f[n]],c=g[f[(n+1)%3]],p[0]=Math.min(s,c),p[1]=Math.max(s,c),l=p[0]+","+p[1],void 0===d[l]&&(d[l]={index1:p[0],index2:p[1]})}for(l in d)a=d[l],u=t.vertices[a.index1],h.push(u.x,u.y,u.z),u=t.vertices[a.index2],h.push(u.x,u.y,u.z)}else if(t&&t.isBufferGeometry){var v,y,b,x,w,_,M,T;if(u=new je,null!==t.index){for(v=t.attributes.position,y=t.index,b=t.groups,0===b.length&&(b=[{start:0,count:y.count,materialIndex:0}]),r=0,o=b.length;r<o;++r)for(x=b[r],w=x.start,_=x.count,e=w,i=w+_;e<i;e+=3)for(n=0;n<3;n++)s=y.getX(e+n),c=y.getX(e+(n+1)%3),p[0]=Math.min(s,c),p[1]=Math.max(s,c),l=p[0]+","+p[1],void 0===d[l]&&(d[l]={index1:p[0],index2:p[1]});for(l in d)a=d[l],u.fromBufferAttribute(v,a.index1),h.push(u.x,u.y,u.z),u.fromBufferAttribute(v,a.index2),h.push(u.x,u.y,u.z)}else for(v=t.attributes.position,e=0,i=v.count/3;e<i;e++)for(n=0;n<3;n++)M=3*e+n,u.fromBufferAttribute(v,M),h.push(u.x,u.y,u.z),T=3*e+(n+1)%3,u.fromBufferAttribute(v,T),h.push(u.x,u.y,u.z)}this.addAttribute("position",new Gr(h,3))}function Ls(t,e,n){Or.call(this),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:n},this.fromBufferGeometry(new Ps(t,e,n)),this.mergeVertices()}function Ps(t,e,n){qr.call(this),this.type="ParametricBufferGeometry",this.parameters={func:t,slices:e,stacks:n};var i,r,o=[],a=[],s=[],c=[],l=1e-5,u=new je,h=new je,p=new je,d=new je,f=new je;t.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var m=e+1;for(i=0;i<=n;i++){var g=i/n;for(r=0;r<=e;r++){var v=r/e;t(v,g,h),a.push(h.x,h.y,h.z),v-l>=0?(t(v-l,g,p),d.subVectors(h,p)):(t(v+l,g,p),d.subVectors(p,h)),g-l>=0?(t(v,g-l,p),f.subVectors(h,p)):(t(v,g+l,p),f.subVectors(p,h)),u.crossVectors(d,f).normalize(),s.push(u.x,u.y,u.z),c.push(v,g)}}for(i=0;i<n;i++)for(r=0;r<e;r++){var y=i*m+r,b=i*m+r+1,x=(i+1)*m+r+1,w=(i+1)*m+r;o.push(y,b,w),o.push(b,x,w)}this.setIndex(o),this.addAttribute("position",new Gr(a,3)),this.addAttribute("normal",new Gr(s,3)),this.addAttribute("uv",new Gr(c,2))}function Rs(t,e,n,i){Or.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:i},this.fromBufferGeometry(new Os(t,e,n,i)),this.mergeVertices()}function Os(t,e,n,i){qr.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:i},n=n||1,i=i||0;var r=[],o=[];function a(t){for(var n=new je,i=new je,r=new je,o=0;o<e.length;o+=3)p(e[o+0],n),p(e[o+1],i),p(e[o+2],r),s(n,i,r,t)}function s(t,e,n,i){var r,o,a=Math.pow(2,i),s=[];for(r=0;r<=a;r++){s[r]=[];var c=t.clone().lerp(n,r/a),l=e.clone().lerp(n,r/a),u=a-r;for(o=0;o<=u;o++)s[r][o]=0===o&&r===a?c:c.clone().lerp(l,o/u)}for(r=0;r<a;r++)for(o=0;o<2*(a-r)-1;o++){var p=Math.floor(o/2);o%2===0?(h(s[r][p+1]),h(s[r+1][p]),h(s[r][p])):(h(s[r][p+1]),h(s[r+1][p+1]),h(s[r+1][p]))}}function c(t){for(var e=new je,n=0;n<r.length;n+=3)e.x=r[n+0],e.y=r[n+1],e.z=r[n+2],e.normalize().multiplyScalar(t),r[n+0]=e.x,r[n+1]=e.y,r[n+2]=e.z}function l(){for(var t=new je,e=0;e<r.length;e+=3){t.x=r[e+0],t.y=r[e+1],t.z=r[e+2];var n=m(t)/2/Math.PI+.5,i=g(t)/Math.PI+.5;o.push(n,1-i)}d(),u()}function u(){for(var t=0;t<o.length;t+=6){var e=o[t+0],n=o[t+2],i=o[t+4],r=Math.max(e,n,i),a=Math.min(e,n,i);r>.9&&a<.1&&(e<.2&&(o[t+0]+=1),n<.2&&(o[t+2]+=1),i<.2&&(o[t+4]+=1))}}function h(t){r.push(t.x,t.y,t.z)}function p(e,n){var i=3*e;n.x=t[i+0],n.y=t[i+1],n.z=t[i+2]}function d(){for(var t=new je,e=new je,n=new je,i=new je,a=new Ge,s=new Ge,c=new Ge,l=0,u=0;l<r.length;l+=9,u+=6){t.set(r[l+0],r[l+1],r[l+2]),e.set(r[l+3],r[l+4],r[l+5]),n.set(r[l+6],r[l+7],r[l+8]),a.set(o[u+0],o[u+1]),s.set(o[u+2],o[u+3]),c.set(o[u+4],o[u+5]),i.copy(t).add(e).add(n).divideScalar(3);var h=m(i);f(a,u+0,t,h),f(s,u+2,e,h),f(c,u+4,n,h)}}function f(t,e,n,i){i<0&&1===t.x&&(o[e]=t.x-1),0===n.x&&0===n.z&&(o[e]=i/2/Math.PI+.5)}function m(t){return Math.atan2(t.z,-t.x)}function g(t){return Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))}a(i),c(n),l(),this.addAttribute("position",new Gr(r,3)),this.addAttribute("normal",new Gr(r.slice(),3)),this.addAttribute("uv",new Gr(o,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}function Ds(t,e){Or.call(this),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Ns(t,e)),this.mergeVertices()}function Ns(t,e){var n=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],i=[2,1,0,0,3,2,1,3,0,2,3,1];Os.call(this,n,i,t,e),this.type="TetrahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Is(t,e){Or.call(this),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new zs(t,e)),this.mergeVertices()}function zs(t,e){var n=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],i=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];Os.call(this,n,i,t,e),this.type="OctahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Bs(t,e){Or.call(this),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new ks(t,e)),this.mergeVertices()}function ks(t,e){var n=(1+Math.sqrt(5))/2,i=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],r=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];Os.call(this,i,r,t,e),this.type="IcosahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Hs(t,e){Or.call(this),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Us(t,e)),this.mergeVertices()}function Us(t,e){var n=(1+Math.sqrt(5))/2,i=1/n,r=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i],o=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];Os.call(this,r,o,t,e),this.type="DodecahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Gs(t,e,n,i,r,o){Or.call(this),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:i,closed:r},void 0!==o&&console.warn("THREE.TubeGeometry: taper has been removed.");var a=new Fs(t,e,n,i,r);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals,this.fromBufferGeometry(a),this.mergeVertices()}function Fs(t,e,n,i,r){qr.call(this),this.type="TubeBufferGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:i,closed:r},e=e||64,n=n||1,i=i||8,r=r||!1;var o=t.computeFrenetFrames(e,r);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;var a,s,c=new je,l=new je,u=new Ge,h=new je,p=[],d=[],f=[],m=[];function g(){for(a=0;a<e;a++)v(a);v(!1===r?e:0),b(),y()}function v(r){h=t.getPointAt(r/e,h);var a=o.normals[r],u=o.binormals[r];for(s=0;s<=i;s++){var f=s/i*Math.PI*2,m=Math.sin(f),g=-Math.cos(f);l.x=g*a.x+m*u.x,l.y=g*a.y+m*u.y,l.z=g*a.z+m*u.z,l.normalize(),d.push(l.x,l.y,l.z),c.x=h.x+n*l.x,c.y=h.y+n*l.y,c.z=h.z+n*l.z,p.push(c.x,c.y,c.z)}}function y(){for(s=1;s<=e;s++)for(a=1;a<=i;a++){var t=(i+1)*(s-1)+(a-1),n=(i+1)*s+(a-1),r=(i+1)*s+a,o=(i+1)*(s-1)+a;m.push(t,n,o),m.push(n,r,o)}}function b(){for(a=0;a<=e;a++)for(s=0;s<=i;s++)u.x=a/e,u.y=s/i,f.push(u.x,u.y)}g(),this.setIndex(m),this.addAttribute("position",new Gr(p,3)),this.addAttribute("normal",new Gr(d,3)),this.addAttribute("uv",new Gr(f,2))}function js(t,e,n,i,r,o,a){Or.call(this),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:i,p:r,q:o},void 0!==a&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new Vs(t,e,n,i,r,o)),this.mergeVertices()}function Vs(t,e,n,i,r,o){qr.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:i,p:r,q:o},t=t||1,e=e||.4,n=Math.floor(n)||64,i=Math.floor(i)||8,r=r||2,o=o||3;var a,s,c=[],l=[],u=[],h=[],p=new je,d=new je,f=new je,m=new je,g=new je,v=new je,y=new je;for(a=0;a<=n;++a){var b=a/n*r*Math.PI*2;for(A(b,r,o,t,f),A(b+.01,r,o,t,m),v.subVectors(m,f),y.addVectors(m,f),g.crossVectors(v,y),y.crossVectors(g,v),g.normalize(),y.normalize(),s=0;s<=i;++s){var x=s/i*Math.PI*2,w=-e*Math.cos(x),_=e*Math.sin(x);p.x=f.x+(w*y.x+_*g.x),p.y=f.y+(w*y.y+_*g.y),p.z=f.z+(w*y.z+_*g.z),l.push(p.x,p.y,p.z),d.subVectors(p,f).normalize(),u.push(d.x,d.y,d.z),h.push(a/n),h.push(s/i)}}for(s=1;s<=n;s++)for(a=1;a<=i;a++){var M=(i+1)*(s-1)+(a-1),T=(i+1)*s+(a-1),S=(i+1)*s+a,E=(i+1)*(s-1)+a;c.push(M,T,E),c.push(T,S,E)}function A(t,e,n,i,r){var o=Math.cos(t),a=Math.sin(t),s=n/e*t,c=Math.cos(s);r.x=i*(2+c)*.5*o,r.y=i*(2+c)*a*.5,r.z=i*Math.sin(s)*.5}this.setIndex(c),this.addAttribute("position",new Gr(l,3)),this.addAttribute("normal",new Gr(u,3)),this.addAttribute("uv",new Gr(h,2))}function Ws(t,e,n,i,r){Or.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:i,arc:r},this.fromBufferGeometry(new qs(t,e,n,i,r)),this.mergeVertices()}function qs(t,e,n,i,r){qr.call(this),this.type="TorusBufferGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:i,arc:r},t=t||1,e=e||.4,n=Math.floor(n)||8,i=Math.floor(i)||6,r=r||2*Math.PI;var o,a,s=[],c=[],l=[],u=[],h=new je,p=new je,d=new je;for(o=0;o<=n;o++)for(a=0;a<=i;a++){var f=a/i*r,m=o/n*Math.PI*2;p.x=(t+e*Math.cos(m))*Math.cos(f),p.y=(t+e*Math.cos(m))*Math.sin(f),p.z=e*Math.sin(m),c.push(p.x,p.y,p.z),h.x=t*Math.cos(f),h.y=t*Math.sin(f),d.subVectors(p,h).normalize(),l.push(d.x,d.y,d.z),u.push(a/i),u.push(o/n)}for(o=1;o<=n;o++)for(a=1;a<=i;a++){var g=(i+1)*o+a-1,v=(i+1)*(o-1)+a-1,y=(i+1)*(o-1)+a,b=(i+1)*o+a;s.push(g,v,b),s.push(v,y,b)}this.setIndex(s),this.addAttribute("position",new Gr(c,3)),this.addAttribute("normal",new Gr(l,3)),this.addAttribute("uv",new Gr(u,2))}Object.assign(ss.prototype,{isFogExp2:!0,clone:function(){return new ss(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),Object.assign(cs.prototype,{isFog:!0,clone:function(){return new cs(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),ls.prototype=Object.assign(Object.create(Pr.prototype),{constructor:ls,isScene:!0,copy:function(t,e){return Pr.prototype.copy.call(this,t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},toJSON:function(t){var e=Pr.prototype.toJSON.call(this,t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(us.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(us.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setArray:function(t){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");return this.count=void 0!==t?t.length/this.stride:0,this.array=t,this},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.dynamic=t.dynamic,this},copyAt:function(t,e,n){t*=this.stride,n*=e.stride;for(var i=0,r=this.stride;i<r;i++)this.array[t+i]=e.array[n+i];return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(t){return this.onUploadCallback=t,this}}),Object.defineProperties(hs.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(hs.prototype,{isInterleavedBufferAttribute:!0,setX:function(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this},setY:function(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this},setZ:function(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this},setW:function(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this},getX:function(t){return this.data.array[t*this.data.stride+this.offset]},getY:function(t){return this.data.array[t*this.data.stride+this.offset+1]},getZ:function(t){return this.data.array[t*this.data.stride+this.offset+2]},getW:function(t){return this.data.array[t*this.data.stride+this.offset+3]},setXY:function(t,e,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this},setXYZ:function(t,e,n,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this},setXYZW:function(t,e,n,i,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this.data.array[t+3]=r,this}}),ps.prototype=Object.create(Qr.prototype),ps.prototype.constructor=ps,ps.prototype.isSpriteMaterial=!0,ps.prototype.copy=function(t){return Qr.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this},ds.prototype=Object.assign(Object.create(Pr.prototype),{constructor:ds,isSprite:!0,raycast:function(){var t=new je,e=new je,n=new je,i=new Ge,r=new Ge,o=new rn,a=new je,s=new je,c=new je,l=new Ge,u=new Ge,h=new Ge;function p(t,e,n,a,s,c){i.subVectors(t,n).addScalar(.5).multiply(a),void 0!==s?(r.x=c*i.x-s*i.y,r.y=s*i.x+c*i.y):r.copy(i),t.copy(e),t.x+=r.x,t.y+=r.y,t.applyMatrix4(o)}return function(i,r){e.setFromMatrixScale(this.matrixWorld),o.getInverse(this.modelViewMatrix).premultiply(this.matrixWorld),n.setFromMatrixPosition(this.modelViewMatrix);var d,f,m=this.material.rotation;0!==m&&(f=Math.cos(m),d=Math.sin(m));var g=this.center;p(a.set(-.5,-.5,0),n,g,e,d,f),p(s.set(.5,-.5,0),n,g,e,d,f),p(c.set(.5,.5,0),n,g,e,d,f),l.set(0,0),u.set(1,0),h.set(1,1);var v=i.ray.intersectTriangle(a,s,c,!1,t);if(null!==v||(p(s.set(-.5,.5,0),n,g,e,d,f),u.set(0,1),v=i.ray.intersectTriangle(a,c,s,!1,t),null!==v)){var y=i.ray.origin.distanceTo(t);y<i.near||y>i.far||r.push({distance:y,point:t.clone(),uv:io.getUV(t,a,s,c,l,u,h,new Ge),face:null,object:this})}}}(),clone:function(){return new this.constructor(this.material).copy(this)},copy:function(t){return Pr.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this}}),fs.prototype=Object.assign(Object.create(Pr.prototype),{constructor:fs,isLOD:!0,copy:function(t){Pr.prototype.copy.call(this,t,!1);for(var e=t.levels,n=0,i=e.length;n<i;n++){var r=e[n];this.addLevel(r.object.clone(),r.distance)}return this},addLevel:function(t,e){void 0===e&&(e=0),e=Math.abs(e);for(var n=this.levels,i=0;i<n.length;i++)if(e<n[i].distance)break;return n.splice(i,0,{distance:e,object:t}),this.add(t),this},getObjectForDistance:function(t){for(var e=this.levels,n=1,i=e.length;n<i;n++)if(t<e[n].distance)break;return e[n-1].object},raycast:function(){var t=new je;return function(e,n){t.setFromMatrixPosition(this.matrixWorld);var i=e.ray.origin.distanceTo(t);this.getObjectForDistance(i).raycast(e,n)}}(),update:function(){var t=new je,e=new je;return function(n){var i=this.levels;if(i.length>1){t.setFromMatrixPosition(n.matrixWorld),e.setFromMatrixPosition(this.matrixWorld);var r=t.distanceTo(e);i[0].object.visible=!0;for(var o=1,a=i.length;o<a;o++){if(!(r>=i[o].distance))break;i[o-1].object.visible=!1,i[o].object.visible=!0}for(;o<a;o++)i[o].object.visible=!1}}}(),toJSON:function(t){var e=Pr.prototype.toJSON.call(this,t);e.object.levels=[];for(var n=this.levels,i=0,r=n.length;i<r;i++){var o=n[i];e.object.levels.push({object:o.object.uuid,distance:o.distance})}return e}}),ms.prototype=Object.assign(Object.create(oo.prototype),{constructor:ms,isSkinnedMesh:!0,bind:function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.getInverse(e)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var t=new Ye,e=this.geometry.attributes.skinWeight,n=0,i=e.count;n<i;n++){t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.w=e.getW(n);var r=1/t.manhattanLength();r!==1/0?t.multiplyScalar(r):t.set(1,0,0,0),e.setXYZW(n,t.x,t.y,t.z,t.w)}},updateMatrixWorld:function(t){oo.prototype.updateMatrixWorld.call(this,t),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Object.assign(gs.prototype,{calculateInverses:function(){this.boneInverses=[];for(var t=0,e=this.bones.length;t<e;t++){var n=new rn;this.bones[t]&&n.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(n)}},pose:function(){var t,e,n;for(e=0,n=this.bones.length;e<n;e++)t=this.bones[e],t&&t.matrixWorld.getInverse(this.boneInverses[e]);for(e=0,n=this.bones.length;e<n;e++)t=this.bones[e],t&&(t.parent&&t.parent.isBone?(t.matrix.getInverse(t.parent.matrixWorld),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))},update:function(){var t=new rn,e=new rn;return function(){for(var n=this.bones,i=this.boneInverses,r=this.boneMatrices,o=this.boneTexture,a=0,s=n.length;a<s;a++){var c=n[a]?n[a].matrixWorld:e;t.multiplyMatrices(c,i[a]),t.toArray(r,16*a)}void 0!==o&&(o.needsUpdate=!0)}}(),clone:function(){return new gs(this.bones,this.boneInverses)},getBoneByName:function(t){for(var e=0,n=this.bones.length;e<n;e++){var i=this.bones[e];if(i.name===t)return i}}}),vs.prototype=Object.assign(Object.create(Pr.prototype),{constructor:vs,isBone:!0}),ys.prototype=Object.create(Qr.prototype),ys.prototype.constructor=ys,ys.prototype.isLineBasicMaterial=!0,ys.prototype.copy=function(t){return Qr.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this},bs.prototype=Object.assign(Object.create(Pr.prototype),{constructor:bs,isLine:!0,computeLineDistances:function(){var t=new je,e=new je;return function(){var n=this.geometry;if(n.isBufferGeometry)if(null===n.index){for(var i=n.attributes.position,r=[0],o=1,a=i.count;o<a;o++)t.fromBufferAttribute(i,o-1),e.fromBufferAttribute(i,o),r[o]=r[o-1],r[o]+=t.distanceTo(e);n.addAttribute("lineDistance",new Gr(r,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(n.isGeometry){var s=n.vertices;r=n.lineDistances;r[0]=0;for(o=1,a=s.length;o<a;o++)r[o]=r[o-1],r[o]+=s[o-1].distanceTo(s[o])}return this}}(),raycast:function(){var t=new rn,e=new no,n=new tn;return function(i,r){var o=i.linePrecision,a=this.geometry,s=this.matrixWorld;if(null===a.boundingSphere&&a.computeBoundingSphere(),n.copy(a.boundingSphere),n.applyMatrix4(s),n.radius+=o,!1!==i.ray.intersectsSphere(n)){t.getInverse(s),e.copy(i.ray).applyMatrix4(t);var c=o/((this.scale.x+this.scale.y+this.scale.z)/3),l=c*c,u=new je,h=new je,p=new je,d=new je,f=this&&this.isLineSegments?2:1;if(a.isBufferGeometry){var m=a.index,g=a.attributes,v=g.position.array;if(null!==m)for(var y=m.array,b=0,x=y.length-1;b<x;b+=f){var w=y[b],_=y[b+1];u.fromArray(v,3*w),h.fromArray(v,3*_);var M=e.distanceSqToSegment(u,h,d,p);if(!(M>l)){d.applyMatrix4(this.matrixWorld);var T=i.ray.origin.distanceTo(d);T<i.near||T>i.far||r.push({distance:T,point:p.clone().applyMatrix4(this.matrixWorld),index:b,face:null,faceIndex:null,object:this})}}else for(b=0,x=v.length/3-1;b<x;b+=f){u.fromArray(v,3*b),h.fromArray(v,3*b+3);M=e.distanceSqToSegment(u,h,d,p);if(!(M>l)){d.applyMatrix4(this.matrixWorld);T=i.ray.origin.distanceTo(d);T<i.near||T>i.far||r.push({distance:T,point:p.clone().applyMatrix4(this.matrixWorld),index:b,face:null,faceIndex:null,object:this})}}}else if(a.isGeometry){var S=a.vertices,E=S.length;for(b=0;b<E-1;b+=f){M=e.distanceSqToSegment(S[b],S[b+1],d,p);if(!(M>l)){d.applyMatrix4(this.matrixWorld);T=i.ray.origin.distanceTo(d);T<i.near||T>i.far||r.push({distance:T,point:p.clone().applyMatrix4(this.matrixWorld),index:b,face:null,faceIndex:null,object:this})}}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),xs.prototype=Object.assign(Object.create(bs.prototype),{constructor:xs,isLineSegments:!0,computeLineDistances:function(){var t=new je,e=new je;return function(){var n=this.geometry;if(n.isBufferGeometry)if(null===n.index){for(var i=n.attributes.position,r=[],o=0,a=i.count;o<a;o+=2)t.fromBufferAttribute(i,o),e.fromBufferAttribute(i,o+1),r[o]=0===o?0:r[o-1],r[o+1]=r[o]+t.distanceTo(e);n.addAttribute("lineDistance",new Gr(r,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(n.isGeometry){var s=n.vertices;for(r=n.lineDistances,o=0,a=s.length;o<a;o+=2)t.copy(s[o]),e.copy(s[o+1]),r[o]=0===o?0:r[o-1],r[o+1]=r[o]+t.distanceTo(e)}return this}}()}),ws.prototype=Object.assign(Object.create(bs.prototype),{constructor:ws,isLineLoop:!0}),_s.prototype=Object.create(Qr.prototype),_s.prototype.constructor=_s,_s.prototype.isPointsMaterial=!0,_s.prototype.copy=function(t){return Qr.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.morphTargets=t.morphTargets,this},Ms.prototype=Object.assign(Object.create(Pr.prototype),{constructor:Ms,isPoints:!0,raycast:function(){var t=new rn,e=new no,n=new tn;return function(i,r){var o=this,a=this.geometry,s=this.matrixWorld,c=i.params.Points.threshold;if(null===a.boundingSphere&&a.computeBoundingSphere(),n.copy(a.boundingSphere),n.applyMatrix4(s),n.radius+=c,!1!==i.ray.intersectsSphere(n)){t.getInverse(s),e.copy(i.ray).applyMatrix4(t);var l=c/((this.scale.x+this.scale.y+this.scale.z)/3),u=l*l,h=new je,p=new je;if(a.isBufferGeometry){var d=a.index,f=a.attributes,m=f.position.array;if(null!==d)for(var g=d.array,v=0,y=g.length;v<y;v++){var b=g[v];h.fromArray(m,3*b),_(h,b)}else{v=0;for(var x=m.length/3;v<x;v++)h.fromArray(m,3*v),_(h,v)}}else{var w=a.vertices;for(v=0,x=w.length;v<x;v++)_(w[v],v)}}function _(t,n){var a=e.distanceSqToPoint(t);if(a<u){e.closestPointToPoint(t,p),p.applyMatrix4(s);var c=i.ray.origin.distanceTo(p);if(c<i.near||c>i.far)return;r.push({distance:c,distanceToRay:Math.sqrt(a),point:p.clone(),index:n,face:null,object:o})}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Ts.prototype=Object.assign(Object.create(Xe.prototype),{constructor:Ts,isVideoTexture:!0,update:function(){var t=this.image;t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),Ss.prototype=Object.create(Xe.prototype),Ss.prototype.constructor=Ss,Ss.prototype.isCompressedTexture=!0,Es.prototype=Object.create(Xe.prototype),Es.prototype.constructor=Es,Es.prototype.isCanvasTexture=!0,As.prototype=Object.create(Xe.prototype),As.prototype.constructor=As,As.prototype.isDepthTexture=!0,Cs.prototype=Object.create(qr.prototype),Cs.prototype.constructor=Cs,Ls.prototype=Object.create(Or.prototype),Ls.prototype.constructor=Ls,Ps.prototype=Object.create(qr.prototype),Ps.prototype.constructor=Ps,Rs.prototype=Object.create(Or.prototype),Rs.prototype.constructor=Rs,Os.prototype=Object.create(qr.prototype),Os.prototype.constructor=Os,Ds.prototype=Object.create(Or.prototype),Ds.prototype.constructor=Ds,Ns.prototype=Object.create(Os.prototype),Ns.prototype.constructor=Ns,Is.prototype=Object.create(Or.prototype),Is.prototype.constructor=Is,zs.prototype=Object.create(Os.prototype),zs.prototype.constructor=zs,Bs.prototype=Object.create(Or.prototype),Bs.prototype.constructor=Bs,ks.prototype=Object.create(Os.prototype),ks.prototype.constructor=ks,Hs.prototype=Object.create(Or.prototype),Hs.prototype.constructor=Hs,Us.prototype=Object.create(Os.prototype),Us.prototype.constructor=Us,Gs.prototype=Object.create(Or.prototype),Gs.prototype.constructor=Gs,Fs.prototype=Object.create(qr.prototype),Fs.prototype.constructor=Fs,Fs.prototype.toJSON=function(){var t=qr.prototype.toJSON.call(this);return t.path=this.parameters.path.toJSON(),t},js.prototype=Object.create(Or.prototype),js.prototype.constructor=js,Vs.prototype=Object.create(qr.prototype),Vs.prototype.constructor=Vs,Ws.prototype=Object.create(Or.prototype),Ws.prototype.constructor=Ws,qs.prototype=Object.create(qr.prototype),qs.prototype.constructor=qs;var Xs={triangulate:function(t,e,n){n=n||2;var i,r,o,a,s,c,l,u=e&&e.length,h=u?e[0]*n:t.length,p=Ys(t,0,h,n,!0),d=[];if(!p)return d;if(u&&(p=ec(t,e,p,n)),t.length>80*n){i=o=t[0],r=a=t[1];for(var f=n;f<h;f+=n)s=t[f],c=t[f+1],s<i&&(i=s),c<r&&(r=c),s>o&&(o=s),c>a&&(a=c);l=Math.max(o-i,a-r),l=0!==l?1/l:0}return Zs(p,d,n,i,r,l),d}};function Ys(t,e,n,i,r){var o,a;if(r===wc(t,e,n,i)>0)for(o=e;o<n;o+=i)a=yc(o,t[o],t[o+1],a);else for(o=n-i;o>=e;o-=i)a=yc(o,t[o],t[o+1],a);return a&&pc(a,a.next)&&(bc(a),a=a.next),a}function Js(t,e){if(!t)return t;e||(e=t);var n,i=t;do{if(n=!1,i.steiner||!pc(i,i.next)&&0!==hc(i.prev,i,i.next))i=i.next;else{if(bc(i),i=e=i.prev,i===i.next)break;n=!0}}while(n||i!==e);return e}function Zs(t,e,n,i,r,o,a){if(t){!a&&o&&oc(t,i,r,o);var s,c,l=t;while(t.prev!==t.next)if(s=t.prev,c=t.next,o?Qs(t,i,r,o):$s(t))e.push(s.i/n),e.push(t.i/n),e.push(c.i/n),bc(t),t=c.next,l=c.next;else if(t=c,t===l){a?1===a?(t=Ks(t,e,n),Zs(t,e,n,i,r,o,2)):2===a&&tc(t,e,n,i,r,o):Zs(Js(t),e,n,i,r,o,1);break}}}function $s(t){var e=t.prev,n=t,i=t.next;if(hc(e,n,i)>=0)return!1;var r=t.next.next;while(r!==t.prev){if(lc(e.x,e.y,n.x,n.y,i.x,i.y,r.x,r.y)&&hc(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function Qs(t,e,n,i){var r=t.prev,o=t,a=t.next;if(hc(r,o,a)>=0)return!1;var s=r.x<o.x?r.x<a.x?r.x:a.x:o.x<a.x?o.x:a.x,c=r.y<o.y?r.y<a.y?r.y:a.y:o.y<a.y?o.y:a.y,l=r.x>o.x?r.x>a.x?r.x:a.x:o.x>a.x?o.x:a.x,u=r.y>o.y?r.y>a.y?r.y:a.y:o.y>a.y?o.y:a.y,h=sc(s,c,e,n,i),p=sc(l,u,e,n,i),d=t.nextZ;while(d&&d.z<=p){if(d!==t.prev&&d!==t.next&&lc(r.x,r.y,o.x,o.y,a.x,a.y,d.x,d.y)&&hc(d.prev,d,d.next)>=0)return!1;d=d.nextZ}d=t.prevZ;while(d&&d.z>=h){if(d!==t.prev&&d!==t.next&&lc(r.x,r.y,o.x,o.y,a.x,a.y,d.x,d.y)&&hc(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function Ks(t,e,n){var i=t;do{var r=i.prev,o=i.next.next;!pc(r,o)&&dc(r,i,i.next,o)&&mc(r,o)&&mc(o,r)&&(e.push(r.i/n),e.push(i.i/n),e.push(o.i/n),bc(i),bc(i.next),i=t=o),i=i.next}while(i!==t);return i}function tc(t,e,n,i,r,o){var a=t;do{var s=a.next.next;while(s!==a.prev){if(a.i!==s.i&&uc(a,s)){var c=vc(a,s);return a=Js(a,a.next),c=Js(c,c.next),Zs(a,e,n,i,r,o),void Zs(c,e,n,i,r,o)}s=s.next}a=a.next}while(a!==t)}function ec(t,e,n,i){var r,o,a,s,c,l=[];for(r=0,o=e.length;r<o;r++)a=e[r]*i,s=r<o-1?e[r+1]*i:t.length,c=Ys(t,a,s,i,!1),c===c.next&&(c.steiner=!0),l.push(cc(c));for(l.sort(nc),r=0;r<l.length;r++)ic(l[r],n),n=Js(n,n.next);return n}function nc(t,e){return t.x-e.x}function ic(t,e){if(e=rc(t,e),e){var n=vc(e,t);Js(n,n.next)}}function rc(t,e){var n,i=e,r=t.x,o=t.y,a=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&s>a){if(a=s,s===r){if(o===i.y)return i;if(o===i.next.y)return i.next}n=i.x<i.next.x?i:i.next}}i=i.next}while(i!==e);if(!n)return null;if(r===a)return n.prev;var c,l=n,u=n.x,h=n.y,p=1/0;i=n.next;while(i!==l)r>=i.x&&i.x>=u&&r!==i.x&&lc(o<h?r:a,o,u,h,o<h?a:r,o,i.x,i.y)&&(c=Math.abs(o-i.y)/(r-i.x),(c<p||c===p&&i.x>n.x)&&mc(i,t)&&(n=i,p=c)),i=i.next;return n}function oc(t,e,n,i){var r=t;do{null===r.z&&(r.z=sc(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,ac(r)}function ac(t){var e,n,i,r,o,a,s,c,l=1;do{n=t,t=null,o=null,a=0;while(n){for(a++,i=n,s=0,e=0;e<l;e++)if(s++,i=i.nextZ,!i)break;c=l;while(s>0||c>0&&i)0!==s&&(0===c||!i||n.z<=i.z)?(r=n,n=n.nextZ,s--):(r=i,i=i.nextZ,c--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;n=i}o.nextZ=null,l*=2}while(a>1);return t}function sc(t,e,n,i,r){return t=32767*(t-n)*r,e=32767*(e-i)*r,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function cc(t){var e=t,n=t;do{e.x<n.x&&(n=e),e=e.next}while(e!==t);return n}function lc(t,e,n,i,r,o,a,s){return(r-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(i-s)-(n-a)*(e-s)>=0&&(n-a)*(o-s)-(r-a)*(i-s)>=0}function uc(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!fc(t,e)&&mc(t,e)&&mc(e,t)&&gc(t,e)}function hc(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function pc(t,e){return t.x===e.x&&t.y===e.y}function dc(t,e,n,i){return!!(pc(t,e)&&pc(n,i)||pc(t,i)&&pc(n,e))||hc(t,e,n)>0!==hc(t,e,i)>0&&hc(n,i,t)>0!==hc(n,i,e)>0}function fc(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&dc(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function mc(t,e){return hc(t.prev,t,t.next)<0?hc(t,e,t.next)>=0&&hc(t,t.prev,e)>=0:hc(t,e,t.prev)<0||hc(t,t.next,e)<0}function gc(t,e){var n=t,i=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!==n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}function vc(t,e){var n=new xc(t.i,t.x,t.y),i=new xc(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function yc(t,e,n,i){var r=new xc(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function bc(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function xc(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function wc(t,e,n,i){for(var r=0,o=e,a=n-i;o<n;o+=i)r+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return r}var _c={area:function(t){for(var e=t.length,n=0,i=e-1,r=0;r<e;i=r++)n+=t[i].x*t[r].y-t[r].x*t[i].y;return.5*n},isClockWise:function(t){return _c.area(t)<0},triangulateShape:function(t,e){var n=[],i=[],r=[];Mc(t),Tc(n,t);var o=t.length;e.forEach(Mc);for(var a=0;a<e.length;a++)i.push(o),o+=e[a].length,Tc(n,e[a]);var s=Xs.triangulate(n,i);for(a=0;a<s.length;a+=3)r.push(s.slice(a,a+3));return r}};function Mc(t){var e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function Tc(t,e){for(var n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y)}function Sc(t,e){Or.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},this.fromBufferGeometry(new Ec(t,e)),this.mergeVertices()}function Ec(t,e){qr.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];for(var n=this,i=[],r=[],o=0,a=t.length;o<a;o++){var s=t[o];c(s)}function c(t){var o=[],a=void 0!==e.curveSegments?e.curveSegments:12,s=void 0!==e.steps?e.steps:1,c=void 0!==e.depth?e.depth:100,l=void 0===e.bevelEnabled||e.bevelEnabled,u=void 0!==e.bevelThickness?e.bevelThickness:6,h=void 0!==e.bevelSize?e.bevelSize:u-2,p=void 0!==e.bevelOffset?e.bevelOffset:0,d=void 0!==e.bevelSegments?e.bevelSegments:3,f=e.extrudePath,m=void 0!==e.UVGenerator?e.UVGenerator:Ac;void 0!==e.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),c=e.amount);var g,v,y,b,x,w,_,M,T=!1;f&&(g=f.getSpacedPoints(s),T=!0,l=!1,v=f.computeFrenetFrames(s,!1),y=new je,b=new je,x=new je),l||(d=0,u=0,h=0,p=0);var S=t.extractPoints(a),E=S.shape,A=S.holes,C=!_c.isClockWise(E);if(C)for(E=E.reverse(),_=0,M=A.length;_<M;_++)w=A[_],_c.isClockWise(w)&&(A[_]=w.reverse());var L=_c.triangulateShape(E,A),P=E;for(_=0,M=A.length;_<M;_++)w=A[_],E=E.concat(w);function R(t,e,n){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(n).add(t)}var O,D,N,I,z,B,k=E.length,H=L.length;function U(t,e,n){var i,r,o,a=t.x-e.x,s=t.y-e.y,c=n.x-t.x,l=n.y-t.y,u=a*a+s*s,h=a*l-s*c;if(Math.abs(h)>Number.EPSILON){var p=Math.sqrt(u),d=Math.sqrt(c*c+l*l),f=e.x-s/p,m=e.y+a/p,g=n.x-l/d,v=n.y+c/d,y=((g-f)*l-(v-m)*c)/(a*l-s*c);i=f+a*y-t.x,r=m+s*y-t.y;var b=i*i+r*r;if(b<=2)return new Ge(i,r);o=Math.sqrt(b/2)}else{var x=!1;a>Number.EPSILON?c>Number.EPSILON&&(x=!0):a<-Number.EPSILON?c<-Number.EPSILON&&(x=!0):Math.sign(s)===Math.sign(l)&&(x=!0),x?(i=-s,r=a,o=Math.sqrt(u)):(i=a,r=s,o=Math.sqrt(u/2))}return new Ge(i/o,r/o)}for(var G=[],F=0,j=P.length,V=j-1,W=F+1;F<j;F++,V++,W++)V===j&&(V=0),W===j&&(W=0),G[F]=U(P[F],P[V],P[W]);var q,X,Y=[],J=G.concat();for(_=0,M=A.length;_<M;_++){for(w=A[_],q=[],F=0,j=w.length,V=j-1,W=F+1;F<j;F++,V++,W++)V===j&&(V=0),W===j&&(W=0),q[F]=U(w[F],w[V],w[W]);Y.push(q),J=J.concat(q)}for(O=0;O<d;O++){for(N=O/d,I=u*Math.cos(N*Math.PI/2),D=h*Math.sin(N*Math.PI/2)+p,F=0,j=P.length;F<j;F++)z=R(P[F],G[F],D),K(z.x,z.y,-I);for(_=0,M=A.length;_<M;_++)for(w=A[_],q=Y[_],F=0,j=w.length;F<j;F++)z=R(w[F],q[F],D),K(z.x,z.y,-I)}for(D=h+p,F=0;F<k;F++)z=l?R(E[F],J[F],D):E[F],T?(b.copy(v.normals[0]).multiplyScalar(z.x),y.copy(v.binormals[0]).multiplyScalar(z.y),x.copy(g[0]).add(b).add(y),K(x.x,x.y,x.z)):K(z.x,z.y,0);for(X=1;X<=s;X++)for(F=0;F<k;F++)z=l?R(E[F],J[F],D):E[F],T?(b.copy(v.normals[X]).multiplyScalar(z.x),y.copy(v.binormals[X]).multiplyScalar(z.y),x.copy(g[X]).add(b).add(y),K(x.x,x.y,x.z)):K(z.x,z.y,c/s*X);for(O=d-1;O>=0;O--){for(N=O/d,I=u*Math.cos(N*Math.PI/2),D=h*Math.sin(N*Math.PI/2)+p,F=0,j=P.length;F<j;F++)z=R(P[F],G[F],D),K(z.x,z.y,c+I);for(_=0,M=A.length;_<M;_++)for(w=A[_],q=Y[_],F=0,j=w.length;F<j;F++)z=R(w[F],q[F],D),T?K(z.x,z.y+g[s-1].y,g[s-1].x+I):K(z.x,z.y,c+I)}function Z(){var t=i.length/3;if(l){var e=0,r=k*e;for(F=0;F<H;F++)B=L[F],tt(B[2]+r,B[1]+r,B[0]+r);for(e=s+2*d,r=k*e,F=0;F<H;F++)B=L[F],tt(B[0]+r,B[1]+r,B[2]+r)}else{for(F=0;F<H;F++)B=L[F],tt(B[2],B[1],B[0]);for(F=0;F<H;F++)B=L[F],tt(B[0]+k*s,B[1]+k*s,B[2]+k*s)}n.addGroup(t,i.length/3-t,0)}function $(){var t=i.length/3,e=0;for(Q(P,e),e+=P.length,_=0,M=A.length;_<M;_++)w=A[_],Q(w,e),e+=w.length;n.addGroup(t,i.length/3-t,1)}function Q(t,e){var n,i;F=t.length;while(--F>=0){n=F,i=F-1,i<0&&(i=t.length-1);var r=0,o=s+2*d;for(r=0;r<o;r++){var a=k*r,c=k*(r+1),l=e+n+a,u=e+i+a,h=e+i+c,p=e+n+c;et(l,u,h,p)}}}function K(t,e,n){o.push(t),o.push(e),o.push(n)}function tt(t,e,r){nt(t),nt(e),nt(r);var o=i.length/3,a=m.generateTopUV(n,i,o-3,o-2,o-1);it(a[0]),it(a[1]),it(a[2])}function et(t,e,r,o){nt(t),nt(e),nt(o),nt(e),nt(r),nt(o);var a=i.length/3,s=m.generateSideWallUV(n,i,a-6,a-3,a-2,a-1);it(s[0]),it(s[1]),it(s[3]),it(s[1]),it(s[2]),it(s[3])}function nt(t){i.push(o[3*t+0]),i.push(o[3*t+1]),i.push(o[3*t+2])}function it(t){r.push(t.x),r.push(t.y)}Z(),$()}this.addAttribute("position",new Gr(i,3)),this.addAttribute("uv",new Gr(r,2)),this.computeVertexNormals()}Sc.prototype=Object.create(Or.prototype),Sc.prototype.constructor=Sc,Sc.prototype.toJSON=function(){var t=Or.prototype.toJSON.call(this),e=this.parameters.shapes,n=this.parameters.options;return Cc(e,n,t)},Ec.prototype=Object.create(qr.prototype),Ec.prototype.constructor=Ec,Ec.prototype.toJSON=function(){var t=qr.prototype.toJSON.call(this),e=this.parameters.shapes,n=this.parameters.options;return Cc(e,n,t)};var Ac={generateTopUV:function(t,e,n,i,r){var o=e[3*n],a=e[3*n+1],s=e[3*i],c=e[3*i+1],l=e[3*r],u=e[3*r+1];return[new Ge(o,a),new Ge(s,c),new Ge(l,u)]},generateSideWallUV:function(t,e,n,i,r,o){var a=e[3*n],s=e[3*n+1],c=e[3*n+2],l=e[3*i],u=e[3*i+1],h=e[3*i+2],p=e[3*r],d=e[3*r+1],f=e[3*r+2],m=e[3*o],g=e[3*o+1],v=e[3*o+2];return Math.abs(s-u)<.01?[new Ge(a,1-c),new Ge(l,1-h),new Ge(p,1-f),new Ge(m,1-v)]:[new Ge(s,1-c),new Ge(u,1-h),new Ge(d,1-f),new Ge(g,1-v)]}};function Cc(t,e,n){if(n.shapes=[],Array.isArray(t))for(var i=0,r=t.length;i<r;i++){var o=t[i];n.shapes.push(o.uuid)}else n.shapes.push(t.uuid);return void 0!==e.extrudePath&&(n.options.extrudePath=e.extrudePath.toJSON()),n}function Lc(t,e){Or.call(this),this.type="TextGeometry",this.parameters={text:t,parameters:e},this.fromBufferGeometry(new Pc(t,e)),this.mergeVertices()}function Pc(t,e){e=e||{};var n=e.font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new Or;var i=n.generateShapes(t,e.size);e.depth=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),Ec.call(this,i,e),this.type="TextBufferGeometry"}function Rc(t,e,n,i,r,o,a){Or.call(this),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:i,phiLength:r,thetaStart:o,thetaLength:a},this.fromBufferGeometry(new Oc(t,e,n,i,r,o,a)),this.mergeVertices()}function Oc(t,e,n,i,r,o,a){qr.call(this),this.type="SphereBufferGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:i,phiLength:r,thetaStart:o,thetaLength:a},t=t||1,e=Math.max(3,Math.floor(e)||8),n=Math.max(2,Math.floor(n)||6),i=void 0!==i?i:0,r=void 0!==r?r:2*Math.PI,o=void 0!==o?o:0,a=void 0!==a?a:Math.PI;var s,c,l=Math.min(o+a,Math.PI),u=0,h=[],p=new je,d=new je,f=[],m=[],g=[],v=[];for(c=0;c<=n;c++){var y=[],b=c/n,x=0;for(0==c&&0==o?x=.5/e:c==n&&l==Math.PI&&(x=-.5/e),s=0;s<=e;s++){var w=s/e;p.x=-t*Math.cos(i+w*r)*Math.sin(o+b*a),p.y=t*Math.cos(o+b*a),p.z=t*Math.sin(i+w*r)*Math.sin(o+b*a),m.push(p.x,p.y,p.z),d.copy(p).normalize(),g.push(d.x,d.y,d.z),v.push(w+x,1-b),y.push(u++)}h.push(y)}for(c=0;c<n;c++)for(s=0;s<e;s++){var _=h[c][s+1],M=h[c][s],T=h[c+1][s],S=h[c+1][s+1];(0!==c||o>0)&&f.push(_,M,S),(c!==n-1||l<Math.PI)&&f.push(M,T,S)}this.setIndex(f),this.addAttribute("position",new Gr(m,3)),this.addAttribute("normal",new Gr(g,3)),this.addAttribute("uv",new Gr(v,2))}function Dc(t,e,n,i,r,o){Or.call(this),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:o},this.fromBufferGeometry(new Nc(t,e,n,i,r,o)),this.mergeVertices()}function Nc(t,e,n,i,r,o){qr.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:o},t=t||.5,e=e||1,r=void 0!==r?r:0,o=void 0!==o?o:2*Math.PI,n=void 0!==n?Math.max(3,n):8,i=void 0!==i?Math.max(1,i):1;var a,s,c,l=[],u=[],h=[],p=[],d=t,f=(e-t)/i,m=new je,g=new Ge;for(s=0;s<=i;s++){for(c=0;c<=n;c++)a=r+c/n*o,m.x=d*Math.cos(a),m.y=d*Math.sin(a),u.push(m.x,m.y,m.z),h.push(0,0,1),g.x=(m.x/e+1)/2,g.y=(m.y/e+1)/2,p.push(g.x,g.y);d+=f}for(s=0;s<i;s++){var v=s*(n+1);for(c=0;c<n;c++){a=c+v;var y=a,b=a+n+1,x=a+n+2,w=a+1;l.push(y,b,w),l.push(b,x,w)}}this.setIndex(l),this.addAttribute("position",new Gr(u,3)),this.addAttribute("normal",new Gr(h,3)),this.addAttribute("uv",new Gr(p,2))}function Ic(t,e,n,i){Or.call(this),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:i},this.fromBufferGeometry(new zc(t,e,n,i)),this.mergeVertices()}function zc(t,e,n,i){qr.call(this),this.type="LatheBufferGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:i},e=Math.floor(e)||12,n=n||0,i=i||2*Math.PI,i=Ue.clamp(i,0,2*Math.PI);var r,o,a,s=[],c=[],l=[],u=1/e,h=new je,p=new Ge;for(o=0;o<=e;o++){var d=n+o*u*i,f=Math.sin(d),m=Math.cos(d);for(a=0;a<=t.length-1;a++)h.x=t[a].x*f,h.y=t[a].y,h.z=t[a].x*m,c.push(h.x,h.y,h.z),p.x=o/e,p.y=a/(t.length-1),l.push(p.x,p.y)}for(o=0;o<e;o++)for(a=0;a<t.length-1;a++){r=a+o*t.length;var g=r,v=r+t.length,y=r+t.length+1,b=r+1;s.push(g,v,b),s.push(v,y,b)}if(this.setIndex(s),this.addAttribute("position",new Gr(c,3)),this.addAttribute("uv",new Gr(l,2)),this.computeVertexNormals(),i===2*Math.PI){var x=this.attributes.normal.array,w=new je,_=new je,M=new je;for(r=e*t.length*3,o=0,a=0;o<t.length;o++,a+=3)w.x=x[a+0],w.y=x[a+1],w.z=x[a+2],_.x=x[r+a+0],_.y=x[r+a+1],_.z=x[r+a+2],M.addVectors(w,_).normalize(),x[a+0]=x[r+a+0]=M.x,x[a+1]=x[r+a+1]=M.y,x[a+2]=x[r+a+2]=M.z}}function Bc(t,e){Or.call(this),this.type="ShapeGeometry","object"===typeof e&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),e=e.curveSegments),this.parameters={shapes:t,curveSegments:e},this.fromBufferGeometry(new kc(t,e)),this.mergeVertices()}function kc(t,e){qr.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:t,curveSegments:e},e=e||12;var n=[],i=[],r=[],o=[],a=0,s=0;if(!1===Array.isArray(t))l(t);else for(var c=0;c<t.length;c++)l(t[c]),this.addGroup(a,s,c),a+=s,s=0;function l(t){var a,c,l,u=i.length/3,h=t.extractPoints(e),p=h.shape,d=h.holes;for(!1===_c.isClockWise(p)&&(p=p.reverse()),a=0,c=d.length;a<c;a++)l=d[a],!0===_c.isClockWise(l)&&(d[a]=l.reverse());var f=_c.triangulateShape(p,d);for(a=0,c=d.length;a<c;a++)l=d[a],p=p.concat(l);for(a=0,c=p.length;a<c;a++){var m=p[a];i.push(m.x,m.y,0),r.push(0,0,1),o.push(m.x,m.y)}for(a=0,c=f.length;a<c;a++){var g=f[a],v=g[0]+u,y=g[1]+u,b=g[2]+u;n.push(v,y,b),s+=3}}this.setIndex(n),this.addAttribute("position",new Gr(i,3)),this.addAttribute("normal",new Gr(r,3)),this.addAttribute("uv",new Gr(o,2))}function Hc(t,e){if(e.shapes=[],Array.isArray(t))for(var n=0,i=t.length;n<i;n++){var r=t[n];e.shapes.push(r.uuid)}else e.shapes.push(t.uuid);return e}function Uc(t,e){qr.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:e},e=void 0!==e?e:1;var n,i,r,o,a=[],s=Math.cos(Ue.DEG2RAD*e),c=[0,0],l={},u=["a","b","c"];t.isBufferGeometry?(o=new Or,o.fromBufferGeometry(t)):o=t.clone(),o.mergeVertices(),o.computeFaceNormals();for(var h=o.vertices,p=o.faces,d=0,f=p.length;d<f;d++)for(var m=p[d],g=0;g<3;g++)n=m[u[g]],i=m[u[(g+1)%3]],c[0]=Math.min(n,i),c[1]=Math.max(n,i),r=c[0]+","+c[1],void 0===l[r]?l[r]={index1:c[0],index2:c[1],face1:d,face2:void 0}:l[r].face2=d;for(r in l){var v=l[r];if(void 0===v.face2||p[v.face1].normal.dot(p[v.face2].normal)<=s){var y=h[v.index1];a.push(y.x,y.y,y.z),y=h[v.index2],a.push(y.x,y.y,y.z)}}this.addAttribute("position",new Gr(a,3))}function Gc(t,e,n,i,r,o,a,s){Or.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:i,heightSegments:r,openEnded:o,thetaStart:a,thetaLength:s},this.fromBufferGeometry(new Fc(t,e,n,i,r,o,a,s)),this.mergeVertices()}function Fc(t,e,n,i,r,o,a,s){qr.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:i,heightSegments:r,openEnded:o,thetaStart:a,thetaLength:s};var c=this;t=void 0!==t?t:1,e=void 0!==e?e:1,n=n||1,i=Math.floor(i)||8,r=Math.floor(r)||1,o=void 0!==o&&o,a=void 0!==a?a:0,s=void 0!==s?s:2*Math.PI;var l=[],u=[],h=[],p=[],d=0,f=[],m=n/2,g=0;function v(){var o,v,y=new je,b=new je,x=0,w=(e-t)/n;for(v=0;v<=r;v++){var _=[],M=v/r,T=M*(e-t)+t;for(o=0;o<=i;o++){var S=o/i,E=S*s+a,A=Math.sin(E),C=Math.cos(E);b.x=T*A,b.y=-M*n+m,b.z=T*C,u.push(b.x,b.y,b.z),y.set(A,w,C).normalize(),h.push(y.x,y.y,y.z),p.push(S,1-M),_.push(d++)}f.push(_)}for(o=0;o<i;o++)for(v=0;v<r;v++){var L=f[v][o],P=f[v+1][o],R=f[v+1][o+1],O=f[v][o+1];l.push(L,P,O),l.push(P,R,O),x+=6}c.addGroup(g,x,0),g+=x}function y(n){var r,o,f,v=new Ge,y=new je,b=0,x=!0===n?t:e,w=!0===n?1:-1;for(o=d,r=1;r<=i;r++)u.push(0,m*w,0),h.push(0,w,0),p.push(.5,.5),d++;for(f=d,r=0;r<=i;r++){var _=r/i,M=_*s+a,T=Math.cos(M),S=Math.sin(M);y.x=x*S,y.y=m*w,y.z=x*T,u.push(y.x,y.y,y.z),h.push(0,w,0),v.x=.5*T+.5,v.y=.5*S*w+.5,p.push(v.x,v.y),d++}for(r=0;r<i;r++){var E=o+r,A=f+r;!0===n?l.push(A,A+1,E):l.push(A+1,A,E),b+=3}c.addGroup(g,b,!0===n?1:2),g+=b}v(),!1===o&&(t>0&&y(!0),e>0&&y(!1)),this.setIndex(l),this.addAttribute("position",new Gr(u,3)),this.addAttribute("normal",new Gr(h,3)),this.addAttribute("uv",new Gr(p,2))}function jc(t,e,n,i,r,o,a){Gc.call(this,0,t,e,n,i,r,o,a),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:o,thetaLength:a}}function Vc(t,e,n,i,r,o,a){Fc.call(this,0,t,e,n,i,r,o,a),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:o,thetaLength:a}}function Wc(t,e,n,i){Or.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:i},this.fromBufferGeometry(new qc(t,e,n,i)),this.mergeVertices()}function qc(t,e,n,i){qr.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:i},t=t||1,e=void 0!==e?Math.max(3,e):8,n=void 0!==n?n:0,i=void 0!==i?i:2*Math.PI;var r,o,a=[],s=[],c=[],l=[],u=new je,h=new Ge;for(s.push(0,0,0),c.push(0,0,1),l.push(.5,.5),o=0,r=3;o<=e;o++,r+=3){var p=n+o/e*i;u.x=t*Math.cos(p),u.y=t*Math.sin(p),s.push(u.x,u.y,u.z),c.push(0,0,1),h.x=(s[r]/t+1)/2,h.y=(s[r+1]/t+1)/2,l.push(h.x,h.y)}for(r=1;r<=e;r++)a.push(r,r+1,0);this.setIndex(a),this.addAttribute("position",new Gr(s,3)),this.addAttribute("normal",new Gr(c,3)),this.addAttribute("uv",new Gr(l,2))}Lc.prototype=Object.create(Or.prototype),Lc.prototype.constructor=Lc,Pc.prototype=Object.create(Ec.prototype),Pc.prototype.constructor=Pc,Rc.prototype=Object.create(Or.prototype),Rc.prototype.constructor=Rc,Oc.prototype=Object.create(qr.prototype),Oc.prototype.constructor=Oc,Dc.prototype=Object.create(Or.prototype),Dc.prototype.constructor=Dc,Nc.prototype=Object.create(qr.prototype),Nc.prototype.constructor=Nc,Ic.prototype=Object.create(Or.prototype),Ic.prototype.constructor=Ic,zc.prototype=Object.create(qr.prototype),zc.prototype.constructor=zc,Bc.prototype=Object.create(Or.prototype),Bc.prototype.constructor=Bc,Bc.prototype.toJSON=function(){var t=Or.prototype.toJSON.call(this),e=this.parameters.shapes;return Hc(e,t)},kc.prototype=Object.create(qr.prototype),kc.prototype.constructor=kc,kc.prototype.toJSON=function(){var t=qr.prototype.toJSON.call(this),e=this.parameters.shapes;return Hc(e,t)},Uc.prototype=Object.create(qr.prototype),Uc.prototype.constructor=Uc,Gc.prototype=Object.create(Or.prototype),Gc.prototype.constructor=Gc,Fc.prototype=Object.create(qr.prototype),Fc.prototype.constructor=Fc,jc.prototype=Object.create(Gc.prototype),jc.prototype.constructor=jc,Vc.prototype=Object.create(Fc.prototype),Vc.prototype.constructor=Vc,Wc.prototype=Object.create(Or.prototype),Wc.prototype.constructor=Wc,qc.prototype=Object.create(qr.prototype),qc.prototype.constructor=qc;var Xc=Object.freeze({WireframeGeometry:Cs,ParametricGeometry:Ls,ParametricBufferGeometry:Ps,TetrahedronGeometry:Ds,TetrahedronBufferGeometry:Ns,OctahedronGeometry:Is,OctahedronBufferGeometry:zs,IcosahedronGeometry:Bs,IcosahedronBufferGeometry:ks,DodecahedronGeometry:Hs,DodecahedronBufferGeometry:Us,PolyhedronGeometry:Rs,PolyhedronBufferGeometry:Os,TubeGeometry:Gs,TubeBufferGeometry:Fs,TorusKnotGeometry:js,TorusKnotBufferGeometry:Vs,TorusGeometry:Ws,TorusBufferGeometry:qs,TextGeometry:Lc,TextBufferGeometry:Pc,SphereGeometry:Rc,SphereBufferGeometry:Oc,RingGeometry:Dc,RingBufferGeometry:Nc,PlaneGeometry:Jr,PlaneBufferGeometry:Zr,LatheGeometry:Ic,LatheBufferGeometry:zc,ShapeGeometry:Bc,ShapeBufferGeometry:kc,ExtrudeGeometry:Sc,ExtrudeBufferGeometry:Ec,EdgesGeometry:Uc,ConeGeometry:jc,ConeBufferGeometry:Vc,CylinderGeometry:Gc,CylinderBufferGeometry:Fc,CircleGeometry:Wc,CircleBufferGeometry:qc,BoxGeometry:Xr,BoxBufferGeometry:Yr});function Yc(t){Qr.call(this),this.type="ShadowMaterial",this.color=new wr(0),this.transparent=!0,this.setValues(t)}function Jc(t){eo.call(this,t),this.type="RawShaderMaterial"}function Zc(t){Qr.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new wr(16777215),this.roughness=.5,this.metalness=.5,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new wr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ke,this.normalScale=new Ge(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function $c(t){Zc.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoat=0,this.clearCoatRoughness=0,this.setValues(t)}function Qc(t){Qr.call(this),this.type="MeshPhongMaterial",this.color=new wr(16777215),this.specular=new wr(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new wr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ke,this.normalScale=new Ge(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=tt,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Kc(t){Qc.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(t)}function tl(t){Qr.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ke,this.normalScale=new Ge(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function el(t){Qr.call(this),this.type="MeshLambertMaterial",this.color=new wr(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new wr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=tt,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function nl(t){Qr.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new wr(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ke,this.normalScale=new Ge(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.lights=!1,this.setValues(t)}function il(t){ys.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}Yc.prototype=Object.create(Qr.prototype),Yc.prototype.constructor=Yc,Yc.prototype.isShadowMaterial=!0,Yc.prototype.copy=function(t){return Qr.prototype.copy.call(this,t),this.color.copy(t.color),this},Jc.prototype=Object.create(eo.prototype),Jc.prototype.constructor=Jc,Jc.prototype.isRawShaderMaterial=!0,Zc.prototype=Object.create(Qr.prototype),Zc.prototype.constructor=Zc,Zc.prototype.isMeshStandardMaterial=!0,Zc.prototype.copy=function(t){return Qr.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},$c.prototype=Object.create(Zc.prototype),$c.prototype.constructor=$c,$c.prototype.isMeshPhysicalMaterial=!0,$c.prototype.copy=function(t){return Zc.prototype.copy.call(this,t),this.defines={PHYSICAL:""},this.reflectivity=t.reflectivity,this.clearCoat=t.clearCoat,this.clearCoatRoughness=t.clearCoatRoughness,this},Qc.prototype=Object.create(Qr.prototype),Qc.prototype.constructor=Qc,Qc.prototype.isMeshPhongMaterial=!0,Qc.prototype.copy=function(t){return Qr.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Kc.prototype=Object.create(Qc.prototype),Kc.prototype.constructor=Kc,Kc.prototype.isMeshToonMaterial=!0,Kc.prototype.copy=function(t){return Qc.prototype.copy.call(this,t),this.gradientMap=t.gradientMap,this},tl.prototype=Object.create(Qr.prototype),tl.prototype.constructor=tl,tl.prototype.isMeshNormalMaterial=!0,tl.prototype.copy=function(t){return Qr.prototype.copy.call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},el.prototype=Object.create(Qr.prototype),el.prototype.constructor=el,el.prototype.isMeshLambertMaterial=!0,el.prototype.copy=function(t){return Qr.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},nl.prototype=Object.create(Qr.prototype),nl.prototype.constructor=nl,nl.prototype.isMeshMatcapMaterial=!0,nl.prototype.copy=function(t){return Qr.prototype.copy.call(this,t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},il.prototype=Object.create(ys.prototype),il.prototype.constructor=il,il.prototype.isLineDashedMaterial=!0,il.prototype.copy=function(t){return ys.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var rl=Object.freeze({ShadowMaterial:Yc,SpriteMaterial:ps,RawShaderMaterial:Jc,ShaderMaterial:eo,PointsMaterial:_s,MeshPhysicalMaterial:$c,MeshStandardMaterial:Zc,MeshPhongMaterial:Qc,MeshToonMaterial:Kc,MeshNormalMaterial:tl,MeshLambertMaterial:el,MeshDepthMaterial:Va,MeshDistanceMaterial:Wa,MeshBasicMaterial:ro,MeshMatcapMaterial:nl,LineDashedMaterial:il,LineBasicMaterial:ys,Material:Qr}),ol={arraySlice:function(t,e,n){return ol.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==n?n:t.length)):t.slice(e,n)},convertArray:function(t,e,n){return!t||!n&&t.constructor===e?t:"number"===typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){function e(e,n){return t[e]-t[n]}for(var n=t.length,i=new Array(n),r=0;r!==n;++r)i[r]=r;return i.sort(e),i},sortedArray:function(t,e,n){for(var i=t.length,r=new t.constructor(i),o=0,a=0;a!==i;++o)for(var s=n[o]*e,c=0;c!==e;++c)r[a++]=t[s+c];return r},flattenJSON:function(t,e,n,i){var r=1,o=t[0];while(void 0!==o&&void 0===o[i])o=t[r++];if(void 0!==o){var a=o[i];if(void 0!==a)if(Array.isArray(a))do{a=o[i],void 0!==a&&(e.push(o.time),n.push.apply(n,a)),o=t[r++]}while(void 0!==o);else if(void 0!==a.toArray)do{a=o[i],void 0!==a&&(e.push(o.time),a.toArray(n,n.length)),o=t[r++]}while(void 0!==o);else do{a=o[i],void 0!==a&&(e.push(o.time),n.push(a)),o=t[r++]}while(void 0!==o)}}};function al(t,e,n,i){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new e.constructor(n),this.sampleValues=e,this.valueSize=n}function sl(t,e,n,i){al.call(this,t,e,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function cl(t,e,n,i){al.call(this,t,e,n,i)}function ll(t,e,n,i){al.call(this,t,e,n,i)}function ul(t,e,n,i){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=ol.convertArray(e,this.TimeBufferType),this.values=ol.convertArray(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}function hl(t,e,n){ul.call(this,t,e,n)}function pl(t,e,n,i){ul.call(this,t,e,n,i)}function dl(t,e,n,i){ul.call(this,t,e,n,i)}function fl(t,e,n,i){al.call(this,t,e,n,i)}function ml(t,e,n,i){ul.call(this,t,e,n,i)}function gl(t,e,n,i){ul.call(this,t,e,n,i)}function vl(t,e,n,i){ul.call(this,t,e,n,i)}function yl(t,e,n){this.name=t,this.tracks=n,this.duration=void 0!==e?e:-1,this.uuid=Ue.generateUUID(),this.duration<0&&this.resetDuration()}function bl(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return dl;case"vector":case"vector2":case"vector3":case"vector4":return vl;case"color":return pl;case"quaternion":return ml;case"bool":case"boolean":return hl;case"string":return gl}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}function xl(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var e=bl(t.type);if(void 0===t.times){var n=[],i=[];ol.flattenJSON(t.keys,n,i,"value"),t.times=n,t.values=i}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}Object.assign(al.prototype,{evaluate:function(t){var e=this.parameterPositions,n=this._cachedIndex,i=e[n],r=e[n-1];t:{e:{var o;n:{i:if(!(t<i)){for(var a=n+2;;){if(void 0===i){if(t<r)break i;return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,t,r)}if(n===a)break;if(r=i,i=e[++n],t<i)break e}o=e.length;break n}if(t>=r)break t;var s=e[1];t<s&&(n=2,r=s);for(a=n-2;;){if(void 0===r)return this._cachedIndex=0,this.beforeStart_(0,t,i);if(n===a)break;if(i=r,r=e[--n-1],t>=r)break e}o=n,n=0}while(n<o){var c=n+o>>>1;t<e[c]?o=c:n=c+1}if(i=e[n],r=e[n-1],void 0===r)return this._cachedIndex=0,this.beforeStart_(0,t,i);if(void 0===i)return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,r,t)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,t,i)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){for(var e=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=t*i,o=0;o!==i;++o)e[o]=n[r+o];return e},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(al.prototype,{beforeStart_:al.prototype.copySampleValue_,afterEnd_:al.prototype.copySampleValue_}),sl.prototype=Object.assign(Object.create(al.prototype),{constructor:sl,DefaultSettings_:{endingStart:_e,endingEnd:_e},intervalChanged_:function(t,e,n){var i=this.parameterPositions,r=t-2,o=t+1,a=i[r],s=i[o];if(void 0===a)switch(this.getSettings_().endingStart){case Me:r=t,a=2*e-n;break;case Te:r=i.length-2,a=e+i[r]-i[r+1];break;default:r=t,a=n}if(void 0===s)switch(this.getSettings_().endingEnd){case Me:o=t,s=2*n-e;break;case Te:o=1,s=n+i[1]-i[0];break;default:o=t-1,s=e}var c=.5*(n-e),l=this.valueSize;this._weightPrev=c/(e-a),this._weightNext=c/(s-n),this._offsetPrev=r*l,this._offsetNext=o*l},interpolate_:function(t,e,n,i){for(var r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,c=s-a,l=this._offsetPrev,u=this._offsetNext,h=this._weightPrev,p=this._weightNext,d=(n-e)/(i-e),f=d*d,m=f*d,g=-h*m+2*h*f-h*d,v=(1+h)*m+(-1.5-2*h)*f+(-.5+h)*d+1,y=(-1-p)*m+(1.5+p)*f+.5*d,b=p*m-p*f,x=0;x!==a;++x)r[x]=g*o[l+x]+v*o[c+x]+y*o[s+x]+b*o[u+x];return r}}),cl.prototype=Object.assign(Object.create(al.prototype),{constructor:cl,interpolate_:function(t,e,n,i){for(var r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,c=s-a,l=(n-e)/(i-e),u=1-l,h=0;h!==a;++h)r[h]=o[c+h]*u+o[s+h]*l;return r}}),ll.prototype=Object.assign(Object.create(al.prototype),{constructor:ll,interpolate_:function(t){return this.copySampleValue_(t-1)}}),Object.assign(ul,{toJSON:function(t){var e,n=t.constructor;if(void 0!==n.toJSON)e=n.toJSON(t);else{e={name:t.name,times:ol.convertArray(t.times,Array),values:ol.convertArray(t.values,Array)};var i=t.getInterpolation();i!==t.DefaultInterpolation&&(e.interpolation=i)}return e.type=t.ValueTypeName,e}}),Object.assign(ul.prototype,{constructor:ul,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:xe,InterpolantFactoryMethodDiscrete:function(t){return new ll(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new cl(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new sl(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var e;switch(t){case be:e=this.InterpolantFactoryMethodDiscrete;break;case xe:e=this.InterpolantFactoryMethodLinear;break;case we:e=this.InterpolantFactoryMethodSmooth;break}if(void 0===e){var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=e,this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return be;case this.InterpolantFactoryMethodLinear:return xe;case this.InterpolantFactoryMethodSmooth:return we}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t)for(var e=this.times,n=0,i=e.length;n!==i;++n)e[n]+=t;return this},scale:function(t){if(1!==t)for(var e=this.times,n=0,i=e.length;n!==i;++n)e[n]*=t;return this},trim:function(t,e){var n=this.times,i=n.length,r=0,o=i-1;while(r!==i&&n[r]<t)++r;while(-1!==o&&n[o]>e)--o;if(++o,0!==r||o!==i){r>=o&&(o=Math.max(o,1),r=o-1);var a=this.getValueSize();this.times=ol.arraySlice(n,r,o),this.values=ol.arraySlice(this.values,r*a,o*a)}return this},validate:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);var n=this.times,i=this.values,r=n.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);for(var o=null,a=0;a!==r;a++){var s=n[a];if("number"===typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,s),t=!1;break}if(null!==o&&o>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,s,o),t=!1;break}o=s}if(void 0!==i&&ol.isTypedArray(i)){a=0;for(var c=i.length;a!==c;++a){var l=i[a];if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,l),t=!1;break}}}return t},optimize:function(){for(var t=this.times,e=this.values,n=this.getValueSize(),i=this.getInterpolation()===we,r=1,o=t.length-1,a=1;a<o;++a){var s=!1,c=t[a],l=t[a+1];if(c!==l&&(1!==a||c!==c[0]))if(i)s=!0;else for(var u=a*n,h=u-n,p=u+n,d=0;d!==n;++d){var f=e[u+d];if(f!==e[h+d]||f!==e[p+d]){s=!0;break}}if(s){if(a!==r){t[r]=t[a];var m=a*n,g=r*n;for(d=0;d!==n;++d)e[g+d]=e[m+d]}++r}}if(o>0){t[r]=t[o];for(m=o*n,g=r*n,d=0;d!==n;++d)e[g+d]=e[m+d];++r}return r!==t.length&&(this.times=ol.arraySlice(t,0,r),this.values=ol.arraySlice(e,0,r*n)),this},clone:function(){var t=ol.arraySlice(this.times,0),e=ol.arraySlice(this.values,0),n=this.constructor,i=new n(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}}),hl.prototype=Object.assign(Object.create(ul.prototype),{constructor:hl,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:be,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),pl.prototype=Object.assign(Object.create(ul.prototype),{constructor:pl,ValueTypeName:"color"}),dl.prototype=Object.assign(Object.create(ul.prototype),{constructor:dl,ValueTypeName:"number"}),fl.prototype=Object.assign(Object.create(al.prototype),{constructor:fl,interpolate_:function(t,e,n,i){for(var r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,c=(n-e)/(i-e),l=s+a;s!==l;s+=4)Fe.slerpFlat(r,0,o,s-a,o,s,c);return r}}),ml.prototype=Object.assign(Object.create(ul.prototype),{constructor:ml,ValueTypeName:"quaternion",DefaultInterpolation:xe,InterpolantFactoryMethodLinear:function(t){return new fl(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),gl.prototype=Object.assign(Object.create(ul.prototype),{constructor:gl,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:be,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),vl.prototype=Object.assign(Object.create(ul.prototype),{constructor:vl,ValueTypeName:"vector"}),Object.assign(yl,{parse:function(t){for(var e=[],n=t.tracks,i=1/(t.fps||1),r=0,o=n.length;r!==o;++r)e.push(xl(n[r]).scale(i));return new yl(t.name,t.duration,e)},toJSON:function(t){for(var e=[],n=t.tracks,i={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid},r=0,o=n.length;r!==o;++r)e.push(ul.toJSON(n[r]));return i},CreateFromMorphTargetSequence:function(t,e,n,i){for(var r=e.length,o=[],a=0;a<r;a++){var s=[],c=[];s.push((a+r-1)%r,a,(a+1)%r),c.push(0,1,0);var l=ol.getKeyframeOrder(s);s=ol.sortedArray(s,1,l),c=ol.sortedArray(c,1,l),i||0!==s[0]||(s.push(r),c.push(c[0])),o.push(new dl(".morphTargetInfluences["+e[a].name+"]",s,c).scale(1/n))}return new yl(t,-1,o)},findByName:function(t,e){var n=t;if(!Array.isArray(t)){var i=t;n=i.geometry&&i.geometry.animations||i.animations}for(var r=0;r<n.length;r++)if(n[r].name===e)return n[r];return null},CreateClipsFromMorphTargetSequences:function(t,e,n){for(var i={},r=/^([\w-]*?)([\d]+)$/,o=0,a=t.length;o<a;o++){var s=t[o],c=s.name.match(r);if(c&&c.length>1){var l=c[1],u=i[l];u||(i[l]=u=[]),u.push(s)}}var h=[];for(var l in i)h.push(yl.CreateFromMorphTargetSequence(l,i[l],e,n));return h},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(t,e,n,i,r){if(0!==n.length){var o=[],a=[];ol.flattenJSON(n,o,a,i),0!==o.length&&r.push(new t(e,o,a))}},i=[],r=t.name||"default",o=t.length||-1,a=t.fps||30,s=t.hierarchy||[],c=0;c<s.length;c++){var l=s[c].keys;if(l&&0!==l.length)if(l[0].morphTargets){for(var u={},h=0;h<l.length;h++)if(l[h].morphTargets)for(var p=0;p<l[h].morphTargets.length;p++)u[l[h].morphTargets[p]]=-1;for(var d in u){var f=[],m=[];for(p=0;p!==l[h].morphTargets.length;++p){var g=l[h];f.push(g.time),m.push(g.morphTarget===d?1:0)}i.push(new dl(".morphTargetInfluence["+d+"]",f,m))}o=u.length*(a||1)}else{var v=".bones["+e[c].name+"]";n(vl,v+".position",l,"pos",i),n(ml,v+".quaternion",l,"rot",i),n(vl,v+".scale",l,"scl",i)}}if(0===i.length)return null;var y=new yl(r,o,i);return y}}),Object.assign(yl.prototype,{resetDuration:function(){for(var t=this.tracks,e=0,n=0,i=t.length;n!==i;++n){var r=this.tracks[n];e=Math.max(e,r.times[r.times.length-1])}return this.duration=e,this},trim:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},validate:function(){for(var t=!0,e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t},optimize:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this},clone:function(){for(var t=[],e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new yl(this.name,this.duration,t)}});var wl={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};function _l(t,e,n){var i=this,r=!1,o=0,a=0,s=void 0;this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){a++,!1===r&&void 0!==i.onStart&&i.onStart(t,o,a),r=!0},this.itemEnd=function(t){o++,void 0!==i.onProgress&&i.onProgress(t,o,a),o===a&&(r=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(t){void 0!==i.onError&&i.onError(t)},this.resolveURL=function(t){return s?s(t):t},this.setURLModifier=function(t){return s=t,this}}var Ml=new _l,Tl={};function Sl(t){this.manager=void 0!==t?t:Ml}function El(t){this.manager=void 0!==t?t:Ml}function Al(t){this.manager=void 0!==t?t:Ml,this._parser=null}function Cl(t){this.manager=void 0!==t?t:Ml,this._parser=null}function Ll(t){this.manager=void 0!==t?t:Ml}function Pl(t){this.manager=void 0!==t?t:Ml}function Rl(t){this.manager=void 0!==t?t:Ml}function Ol(){this.type="Curve",this.arcLengthDivisions=200}function Dl(t,e,n,i,r,o,a,s){Ol.call(this),this.type="EllipseCurve",this.aX=t||0,this.aY=e||0,this.xRadius=n||1,this.yRadius=i||1,this.aStartAngle=r||0,this.aEndAngle=o||2*Math.PI,this.aClockwise=a||!1,this.aRotation=s||0}function Nl(t,e,n,i,r,o){Dl.call(this,t,e,n,n,i,r,o),this.type="ArcCurve"}function Il(){var t=0,e=0,n=0,i=0;function r(r,o,a,s){t=r,e=a,n=-3*r+3*o-2*a-s,i=2*r-2*o+a+s}return{initCatmullRom:function(t,e,n,i,o){r(e,n,o*(n-t),o*(i-e))},initNonuniformCatmullRom:function(t,e,n,i,o,a,s){var c=(e-t)/o-(n-t)/(o+a)+(n-e)/a,l=(n-e)/a-(i-e)/(a+s)+(i-n)/s;c*=a,l*=a,r(e,n,c,l)},calc:function(r){var o=r*r,a=o*r;return t+e*r+n*o+i*a}}}Object.assign(Sl.prototype,{load:function(t,e,n,i){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var r=this,o=wl.get(t);if(void 0!==o)return r.manager.itemStart(t),setTimeout((function(){e&&e(o),r.manager.itemEnd(t)}),0),o;if(void 0===Tl[t]){var a=/^data:(.*?)(;base64)?,(.*)$/,s=t.match(a);if(s){var c=s[1],l=!!s[2],u=s[3];u=decodeURIComponent(u),l&&(u=atob(u));try{var h,p=(this.responseType||"").toLowerCase();switch(p){case"arraybuffer":case"blob":for(var d=new Uint8Array(u.length),f=0;f<u.length;f++)d[f]=u.charCodeAt(f);h="blob"===p?new Blob([d.buffer],{type:c}):d.buffer;break;case"document":var m=new DOMParser;h=m.parseFromString(u,c);break;case"json":h=JSON.parse(u);break;default:h=u;break}setTimeout((function(){e&&e(h),r.manager.itemEnd(t)}),0)}catch(y){setTimeout((function(){i&&i(y),r.manager.itemError(t),r.manager.itemEnd(t)}),0)}}else{Tl[t]=[],Tl[t].push({onLoad:e,onProgress:n,onError:i});var g=new XMLHttpRequest;for(var v in g.open("GET",t,!0),g.addEventListener("load",(function(e){var n=this.response;wl.add(t,n);var i=Tl[t];if(delete Tl[t],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received.");for(var o=0,a=i.length;o<a;o++){var s=i[o];s.onLoad&&s.onLoad(n)}r.manager.itemEnd(t)}else{for(o=0,a=i.length;o<a;o++){s=i[o];s.onError&&s.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)}}),!1),g.addEventListener("progress",(function(e){for(var n=Tl[t],i=0,r=n.length;i<r;i++){var o=n[i];o.onProgress&&o.onProgress(e)}}),!1),g.addEventListener("error",(function(e){var n=Tl[t];delete Tl[t];for(var i=0,o=n.length;i<o;i++){var a=n[i];a.onError&&a.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)}),!1),g.addEventListener("abort",(function(e){var n=Tl[t];delete Tl[t];for(var i=0,o=n.length;i<o;i++){var a=n[i];a.onError&&a.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)}),!1),void 0!==this.responseType&&(g.responseType=this.responseType),void 0!==this.withCredentials&&(g.withCredentials=this.withCredentials),g.overrideMimeType&&g.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)g.setRequestHeader(v,this.requestHeader[v]);g.send(null)}return r.manager.itemStart(t),g}Tl[t].push({onLoad:e,onProgress:n,onError:i})},setPath:function(t){return this.path=t,this},setResponseType:function(t){return this.responseType=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setMimeType:function(t){return this.mimeType=t,this},setRequestHeader:function(t){return this.requestHeader=t,this}}),Object.assign(El.prototype,{load:function(t,e,n,i){var r=this,o=new Sl(r.manager);o.setPath(r.path),o.load(t,(function(t){e(r.parse(JSON.parse(t)))}),n,i)},parse:function(t){for(var e=[],n=0;n<t.length;n++){var i=yl.parse(t[n]);e.push(i)}return e},setPath:function(t){return this.path=t,this}}),Object.assign(Al.prototype,{load:function(t,e,n,i){var r=this,o=[],a=new Ss;a.image=o;var s=new Sl(this.manager);function c(c){s.load(t[c],(function(t){var n=r._parser(t,!0);o[c]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},l+=1,6===l&&(1===n.mipmapCount&&(a.minFilter=Mt),a.format=n.format,a.needsUpdate=!0,e&&e(a))}),n,i)}if(s.setPath(this.path),s.setResponseType("arraybuffer"),Array.isArray(t))for(var l=0,u=0,h=t.length;u<h;++u)c(u);else s.load(t,(function(t){var n=r._parser(t,!0);if(n.isCubemap)for(var i=n.mipmaps.length/n.mipmapCount,s=0;s<i;s++){o[s]={mipmaps:[]};for(var c=0;c<n.mipmapCount;c++)o[s].mipmaps.push(n.mipmaps[s*n.mipmapCount+c]),o[s].format=n.format,o[s].width=n.width,o[s].height=n.height}else a.image.width=n.width,a.image.height=n.height,a.mipmaps=n.mipmaps;1===n.mipmapCount&&(a.minFilter=Mt),a.format=n.format,a.needsUpdate=!0,e&&e(a)}),n,i);return a},setPath:function(t){return this.path=t,this}}),Object.assign(Cl.prototype,{load:function(t,e,n,i){var r=this,o=new Qe,a=new Sl(this.manager);return a.setResponseType("arraybuffer"),a.setPath(this.path),a.load(t,(function(t){var n=r._parser(t);n&&(void 0!==n.image?o.image=n.image:void 0!==n.data&&(o.image.width=n.width,o.image.height=n.height,o.image.data=n.data),o.wrapS=void 0!==n.wrapS?n.wrapS:yt,o.wrapT=void 0!==n.wrapT?n.wrapT:yt,o.magFilter=void 0!==n.magFilter?n.magFilter:Mt,o.minFilter=void 0!==n.minFilter?n.minFilter:St,o.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.format&&(o.format=n.format),void 0!==n.type&&(o.type=n.type),void 0!==n.mipmaps&&(o.mipmaps=n.mipmaps),1===n.mipmapCount&&(o.minFilter=Mt),o.needsUpdate=!0,e&&e(o,n))}),n,i),o},setPath:function(t){return this.path=t,this}}),Object.assign(Ll.prototype,{crossOrigin:"anonymous",load:function(t,e,n,i){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var r=this,o=wl.get(t);if(void 0!==o)return r.manager.itemStart(t),setTimeout((function(){e&&e(o),r.manager.itemEnd(t)}),0),o;var a=document.createElementNS("http://www.w3.org/1999/xhtml","img");function s(){a.removeEventListener("load",s,!1),a.removeEventListener("error",c,!1),wl.add(t,this),e&&e(this),r.manager.itemEnd(t)}function c(e){a.removeEventListener("load",s,!1),a.removeEventListener("error",c,!1),i&&i(e),r.manager.itemError(t),r.manager.itemEnd(t)}return a.addEventListener("load",s,!1),a.addEventListener("error",c,!1),"data:"!==t.substr(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),r.manager.itemStart(t),a.src=t,a},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(Pl.prototype,{crossOrigin:"anonymous",load:function(t,e,n,i){var r=new yo,o=new Ll(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);var a=0;function s(n){o.load(t[n],(function(t){r.images[n]=t,a++,6===a&&(r.needsUpdate=!0,e&&e(r))}),void 0,i)}for(var c=0;c<t.length;++c)s(c);return r},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(Rl.prototype,{crossOrigin:"anonymous",load:function(t,e,n,i){var r=new Xe,o=new Ll(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(t,(function(n){r.image=n;var i=t.search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/);r.format=i?Ht:Ut,r.needsUpdate=!0,void 0!==e&&e(r)}),n,i),r},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(Ol.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,e){var n=this.getUtoTmapping(t);return this.getPoint(n,e)},getPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return e},getSpacedPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,n,i=[],r=this.getPoint(0),o=0;for(i.push(0),n=1;n<=t;n++)e=this.getPoint(n/t),o+=e.distanceTo(r),i.push(o),r=e;return this.cacheArcLengths=i,i},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){var n,i=this.getLengths(),r=0,o=i.length;n=e||t*i[o-1];var a,s=0,c=o-1;while(s<=c)if(r=Math.floor(s+(c-s)/2),a=i[r]-n,a<0)s=r+1;else{if(!(a>0)){c=r;break}c=r-1}if(r=c,i[r]===n)return r/(o-1);var l=i[r],u=i[r+1],h=u-l,p=(n-l)/h,d=(r+p)/(o-1);return d},getTangent:function(t){var e=1e-4,n=t-e,i=t+e;n<0&&(n=0),i>1&&(i=1);var r=this.getPoint(n),o=this.getPoint(i),a=o.clone().sub(r);return a.normalize()},getTangentAt:function(t){var e=this.getUtoTmapping(t);return this.getTangent(e)},computeFrenetFrames:function(t,e){var n,i,r,o=new je,a=[],s=[],c=[],l=new je,u=new rn;for(n=0;n<=t;n++)i=n/t,a[n]=this.getTangentAt(i),a[n].normalize();s[0]=new je,c[0]=new je;var h=Number.MAX_VALUE,p=Math.abs(a[0].x),d=Math.abs(a[0].y),f=Math.abs(a[0].z);for(p<=h&&(h=p,o.set(1,0,0)),d<=h&&(h=d,o.set(0,1,0)),f<=h&&o.set(0,0,1),l.crossVectors(a[0],o).normalize(),s[0].crossVectors(a[0],l),c[0].crossVectors(a[0],s[0]),n=1;n<=t;n++)s[n]=s[n-1].clone(),c[n]=c[n-1].clone(),l.crossVectors(a[n-1],a[n]),l.length()>Number.EPSILON&&(l.normalize(),r=Math.acos(Ue.clamp(a[n-1].dot(a[n]),-1,1)),s[n].applyMatrix4(u.makeRotationAxis(l,r))),c[n].crossVectors(a[n],s[n]);if(!0===e)for(r=Math.acos(Ue.clamp(s[0].dot(s[t]),-1,1)),r/=t,a[0].dot(l.crossVectors(s[0],s[t]))>0&&(r=-r),n=1;n<=t;n++)s[n].applyMatrix4(u.makeRotationAxis(a[n],r*n)),c[n].crossVectors(a[n],s[n]);return{tangents:a,normals:s,binormals:c}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},toJSON:function(){var t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t},fromJSON:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),Dl.prototype=Object.create(Ol.prototype),Dl.prototype.constructor=Dl,Dl.prototype.isEllipseCurve=!0,Dl.prototype.getPoint=function(t,e){var n=e||new Ge,i=2*Math.PI,r=this.aEndAngle-this.aStartAngle,o=Math.abs(r)<Number.EPSILON;while(r<0)r+=i;while(r>i)r-=i;r<Number.EPSILON&&(r=o?0:i),!0!==this.aClockwise||o||(r===i?r=-i:r-=i);var a=this.aStartAngle+t*r,s=this.aX+this.xRadius*Math.cos(a),c=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){var l=Math.cos(this.aRotation),u=Math.sin(this.aRotation),h=s-this.aX,p=c-this.aY;s=h*l-p*u+this.aX,c=h*u+p*l+this.aY}return n.set(s,c)},Dl.prototype.copy=function(t){return Ol.prototype.copy.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},Dl.prototype.toJSON=function(){var t=Ol.prototype.toJSON.call(this);return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t},Dl.prototype.fromJSON=function(t){return Ol.prototype.fromJSON.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},Nl.prototype=Object.create(Dl.prototype),Nl.prototype.constructor=Nl,Nl.prototype.isArcCurve=!0;var zl=new je,Bl=new Il,kl=new Il,Hl=new Il;function Ul(t,e,n,i){Ol.call(this),this.type="CatmullRomCurve3",this.points=t||[],this.closed=e||!1,this.curveType=n||"centripetal",this.tension=i||.5}function Gl(t,e,n,i,r){var o=.5*(i-e),a=.5*(r-n),s=t*t,c=t*s;return(2*n-2*i+o+a)*c+(-3*n+3*i-2*o-a)*s+o*t+n}function Fl(t,e){var n=1-t;return n*n*e}function jl(t,e){return 2*(1-t)*t*e}function Vl(t,e){return t*t*e}function Wl(t,e,n,i){return Fl(t,e)+jl(t,n)+Vl(t,i)}function ql(t,e){var n=1-t;return n*n*n*e}function Xl(t,e){var n=1-t;return 3*n*n*t*e}function Yl(t,e){return 3*(1-t)*t*t*e}function Jl(t,e){return t*t*t*e}function Zl(t,e,n,i,r){return ql(t,e)+Xl(t,n)+Yl(t,i)+Jl(t,r)}function $l(t,e,n,i){Ol.call(this),this.type="CubicBezierCurve",this.v0=t||new Ge,this.v1=e||new Ge,this.v2=n||new Ge,this.v3=i||new Ge}function Ql(t,e,n,i){Ol.call(this),this.type="CubicBezierCurve3",this.v0=t||new je,this.v1=e||new je,this.v2=n||new je,this.v3=i||new je}function Kl(t,e){Ol.call(this),this.type="LineCurve",this.v1=t||new Ge,this.v2=e||new Ge}function tu(t,e){Ol.call(this),this.type="LineCurve3",this.v1=t||new je,this.v2=e||new je}function eu(t,e,n){Ol.call(this),this.type="QuadraticBezierCurve",this.v0=t||new Ge,this.v1=e||new Ge,this.v2=n||new Ge}function nu(t,e,n){Ol.call(this),this.type="QuadraticBezierCurve3",this.v0=t||new je,this.v1=e||new je,this.v2=n||new je}function iu(t){Ol.call(this),this.type="SplineCurve",this.points=t||[]}Ul.prototype=Object.create(Ol.prototype),Ul.prototype.constructor=Ul,Ul.prototype.isCatmullRomCurve3=!0,Ul.prototype.getPoint=function(t,e){var n,i,r,o,a=e||new je,s=this.points,c=s.length,l=(c-(this.closed?0:1))*t,u=Math.floor(l),h=l-u;if(this.closed?u+=u>0?0:(Math.floor(Math.abs(u)/c)+1)*c:0===h&&u===c-1&&(u=c-2,h=1),this.closed||u>0?n=s[(u-1)%c]:(zl.subVectors(s[0],s[1]).add(s[0]),n=zl),i=s[u%c],r=s[(u+1)%c],this.closed||u+2<c?o=s[(u+2)%c]:(zl.subVectors(s[c-1],s[c-2]).add(s[c-1]),o=zl),"centripetal"===this.curveType||"chordal"===this.curveType){var p="chordal"===this.curveType?.5:.25,d=Math.pow(n.distanceToSquared(i),p),f=Math.pow(i.distanceToSquared(r),p),m=Math.pow(r.distanceToSquared(o),p);f<1e-4&&(f=1),d<1e-4&&(d=f),m<1e-4&&(m=f),Bl.initNonuniformCatmullRom(n.x,i.x,r.x,o.x,d,f,m),kl.initNonuniformCatmullRom(n.y,i.y,r.y,o.y,d,f,m),Hl.initNonuniformCatmullRom(n.z,i.z,r.z,o.z,d,f,m)}else"catmullrom"===this.curveType&&(Bl.initCatmullRom(n.x,i.x,r.x,o.x,this.tension),kl.initCatmullRom(n.y,i.y,r.y,o.y,this.tension),Hl.initCatmullRom(n.z,i.z,r.z,o.z,this.tension));return a.set(Bl.calc(h),kl.calc(h),Hl.calc(h)),a},Ul.prototype.copy=function(t){Ol.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push(i.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},Ul.prototype.toJSON=function(){var t=Ol.prototype.toJSON.call(this);t.points=[];for(var e=0,n=this.points.length;e<n;e++){var i=this.points[e];t.points.push(i.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t},Ul.prototype.fromJSON=function(t){Ol.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push((new je).fromArray(i))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},$l.prototype=Object.create(Ol.prototype),$l.prototype.constructor=$l,$l.prototype.isCubicBezierCurve=!0,$l.prototype.getPoint=function(t,e){var n=e||new Ge,i=this.v0,r=this.v1,o=this.v2,a=this.v3;return n.set(Zl(t,i.x,r.x,o.x,a.x),Zl(t,i.y,r.y,o.y,a.y)),n},$l.prototype.copy=function(t){return Ol.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},$l.prototype.toJSON=function(){var t=Ol.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},$l.prototype.fromJSON=function(t){return Ol.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},Ql.prototype=Object.create(Ol.prototype),Ql.prototype.constructor=Ql,Ql.prototype.isCubicBezierCurve3=!0,Ql.prototype.getPoint=function(t,e){var n=e||new je,i=this.v0,r=this.v1,o=this.v2,a=this.v3;return n.set(Zl(t,i.x,r.x,o.x,a.x),Zl(t,i.y,r.y,o.y,a.y),Zl(t,i.z,r.z,o.z,a.z)),n},Ql.prototype.copy=function(t){return Ol.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},Ql.prototype.toJSON=function(){var t=Ol.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},Ql.prototype.fromJSON=function(t){return Ol.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},Kl.prototype=Object.create(Ol.prototype),Kl.prototype.constructor=Kl,Kl.prototype.isLineCurve=!0,Kl.prototype.getPoint=function(t,e){var n=e||new Ge;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},Kl.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},Kl.prototype.getTangent=function(){var t=this.v2.clone().sub(this.v1);return t.normalize()},Kl.prototype.copy=function(t){return Ol.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Kl.prototype.toJSON=function(){var t=Ol.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Kl.prototype.fromJSON=function(t){return Ol.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},tu.prototype=Object.create(Ol.prototype),tu.prototype.constructor=tu,tu.prototype.isLineCurve3=!0,tu.prototype.getPoint=function(t,e){var n=e||new je;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},tu.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},tu.prototype.copy=function(t){return Ol.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},tu.prototype.toJSON=function(){var t=Ol.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},tu.prototype.fromJSON=function(t){return Ol.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},eu.prototype=Object.create(Ol.prototype),eu.prototype.constructor=eu,eu.prototype.isQuadraticBezierCurve=!0,eu.prototype.getPoint=function(t,e){var n=e||new Ge,i=this.v0,r=this.v1,o=this.v2;return n.set(Wl(t,i.x,r.x,o.x),Wl(t,i.y,r.y,o.y)),n},eu.prototype.copy=function(t){return Ol.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},eu.prototype.toJSON=function(){var t=Ol.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},eu.prototype.fromJSON=function(t){return Ol.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},nu.prototype=Object.create(Ol.prototype),nu.prototype.constructor=nu,nu.prototype.isQuadraticBezierCurve3=!0,nu.prototype.getPoint=function(t,e){var n=e||new je,i=this.v0,r=this.v1,o=this.v2;return n.set(Wl(t,i.x,r.x,o.x),Wl(t,i.y,r.y,o.y),Wl(t,i.z,r.z,o.z)),n},nu.prototype.copy=function(t){return Ol.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},nu.prototype.toJSON=function(){var t=Ol.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},nu.prototype.fromJSON=function(t){return Ol.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},iu.prototype=Object.create(Ol.prototype),iu.prototype.constructor=iu,iu.prototype.isSplineCurve=!0,iu.prototype.getPoint=function(t,e){var n=e||new Ge,i=this.points,r=(i.length-1)*t,o=Math.floor(r),a=r-o,s=i[0===o?o:o-1],c=i[o],l=i[o>i.length-2?i.length-1:o+1],u=i[o>i.length-3?i.length-1:o+2];return n.set(Gl(a,s.x,c.x,l.x,u.x),Gl(a,s.y,c.y,l.y,u.y)),n},iu.prototype.copy=function(t){Ol.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push(i.clone())}return this},iu.prototype.toJSON=function(){var t=Ol.prototype.toJSON.call(this);t.points=[];for(var e=0,n=this.points.length;e<n;e++){var i=this.points[e];t.points.push(i.toArray())}return t},iu.prototype.fromJSON=function(t){Ol.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push((new Ge).fromArray(i))}return this};var ru=Object.freeze({ArcCurve:Nl,CatmullRomCurve3:Ul,CubicBezierCurve:$l,CubicBezierCurve3:Ql,EllipseCurve:Dl,LineCurve:Kl,LineCurve3:tu,QuadraticBezierCurve:eu,QuadraticBezierCurve3:nu,SplineCurve:iu});function ou(){Ol.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function au(t){ou.call(this),this.type="Path",this.currentPoint=new Ge,t&&this.setFromPoints(t)}function su(t){au.call(this,t),this.uuid=Ue.generateUUID(),this.type="Shape",this.holes=[]}function cu(t,e){Pr.call(this),this.type="Light",this.color=new wr(t),this.intensity=void 0!==e?e:1,this.receiveShadow=void 0}function lu(t,e,n){cu.call(this,t,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(Pr.DefaultUp),this.updateMatrix(),this.groundColor=new wr(e)}function uu(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new Ge(512,512),this.map=null,this.matrix=new rn}function hu(){uu.call(this,new Qa(50,1,.5,500))}function pu(t,e,n,i,r,o){cu.call(this,t,e),this.type="SpotLight",this.position.copy(Pr.DefaultUp),this.updateMatrix(),this.target=new Pr,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(t){this.intensity=t/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==i?i:Math.PI/3,this.penumbra=void 0!==r?r:0,this.decay=void 0!==o?o:1,this.shadow=new hu}function du(t,e,n,i){cu.call(this,t,e),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(t){this.intensity=t/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==i?i:1,this.shadow=new uu(new Qa(90,1,.5,500))}function fu(t,e,n,i,r,o){$a.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==t?t:-1,this.right=void 0!==e?e:1,this.top=void 0!==n?n:1,this.bottom=void 0!==i?i:-1,this.near=void 0!==r?r:.1,this.far=void 0!==o?o:2e3,this.updateProjectionMatrix()}function mu(){uu.call(this,new fu(-5,5,5,-5,.5,500))}function gu(t,e){cu.call(this,t,e),this.type="DirectionalLight",this.position.copy(Pr.DefaultUp),this.updateMatrix(),this.target=new Pr,this.shadow=new mu}function vu(t,e){cu.call(this,t,e),this.type="AmbientLight",this.castShadow=void 0}function yu(t,e,n,i){cu.call(this,t,e),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==i?i:10}function bu(t){this.manager=void 0!==t?t:Ml,this.textures={}}ou.prototype=Object.assign(Object.create(Ol.prototype),{constructor:ou,add:function(t){this.curves.push(t)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new Kl(e,t))},getPoint:function(t){var e=t*this.getLength(),n=this.getCurveLengths(),i=0;while(i<n.length){if(n[i]>=e){var r=n[i]-e,o=this.curves[i],a=o.getLength(),s=0===a?0:1-r/a;return o.getPointAt(s)}i++}return null},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,n=0,i=this.curves.length;n<i;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t,t},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return this.autoClose&&e.push(e[0]),e},getPoints:function(t){t=t||12;for(var e,n=[],i=0,r=this.curves;i<r.length;i++)for(var o=r[i],a=o&&o.isEllipseCurve?2*t:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?t*o.points.length:t,s=o.getPoints(a),c=0;c<s.length;c++){var l=s[c];e&&e.equals(l)||(n.push(l),e=l)}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(t){Ol.prototype.copy.call(this,t),this.curves=[];for(var e=0,n=t.curves.length;e<n;e++){var i=t.curves[e];this.curves.push(i.clone())}return this.autoClose=t.autoClose,this},toJSON:function(){var t=Ol.prototype.toJSON.call(this);t.autoClose=this.autoClose,t.curves=[];for(var e=0,n=this.curves.length;e<n;e++){var i=this.curves[e];t.curves.push(i.toJSON())}return t},fromJSON:function(t){Ol.prototype.fromJSON.call(this,t),this.autoClose=t.autoClose,this.curves=[];for(var e=0,n=t.curves.length;e<n;e++){var i=t.curves[e];this.curves.push((new ru[i.type]).fromJSON(i))}return this}}),au.prototype=Object.assign(Object.create(ou.prototype),{constructor:au,setFromPoints:function(t){this.moveTo(t[0].x,t[0].y);for(var e=1,n=t.length;e<n;e++)this.lineTo(t[e].x,t[e].y)},moveTo:function(t,e){this.currentPoint.set(t,e)},lineTo:function(t,e){var n=new Kl(this.currentPoint.clone(),new Ge(t,e));this.curves.push(n),this.currentPoint.set(t,e)},quadraticCurveTo:function(t,e,n,i){var r=new eu(this.currentPoint.clone(),new Ge(t,e),new Ge(n,i));this.curves.push(r),this.currentPoint.set(n,i)},bezierCurveTo:function(t,e,n,i,r,o){var a=new $l(this.currentPoint.clone(),new Ge(t,e),new Ge(n,i),new Ge(r,o));this.curves.push(a),this.currentPoint.set(r,o)},splineThru:function(t){var e=[this.currentPoint.clone()].concat(t),n=new iu(e);this.curves.push(n),this.currentPoint.copy(t[t.length-1])},arc:function(t,e,n,i,r,o){var a=this.currentPoint.x,s=this.currentPoint.y;this.absarc(t+a,e+s,n,i,r,o)},absarc:function(t,e,n,i,r,o){this.absellipse(t,e,n,n,i,r,o)},ellipse:function(t,e,n,i,r,o,a,s){var c=this.currentPoint.x,l=this.currentPoint.y;this.absellipse(t+c,e+l,n,i,r,o,a,s)},absellipse:function(t,e,n,i,r,o,a,s){var c=new Dl(t,e,n,i,r,o,a,s);if(this.curves.length>0){var l=c.getPoint(0);l.equals(this.currentPoint)||this.lineTo(l.x,l.y)}this.curves.push(c);var u=c.getPoint(1);this.currentPoint.copy(u)},copy:function(t){return ou.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){var t=ou.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return ou.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),su.prototype=Object.assign(Object.create(au.prototype),{constructor:su,getPointsHoles:function(t){for(var e=[],n=0,i=this.holes.length;n<i;n++)e[n]=this.holes[n].getPoints(t);return e},extractPoints:function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}},copy:function(t){au.prototype.copy.call(this,t),this.holes=[];for(var e=0,n=t.holes.length;e<n;e++){var i=t.holes[e];this.holes.push(i.clone())}return this},toJSON:function(){var t=au.prototype.toJSON.call(this);t.uuid=this.uuid,t.holes=[];for(var e=0,n=this.holes.length;e<n;e++){var i=this.holes[e];t.holes.push(i.toJSON())}return t},fromJSON:function(t){au.prototype.fromJSON.call(this,t),this.uuid=t.uuid,this.holes=[];for(var e=0,n=t.holes.length;e<n;e++){var i=t.holes[e];this.holes.push((new au).fromJSON(i))}return this}}),cu.prototype=Object.assign(Object.create(Pr.prototype),{constructor:cu,isLight:!0,copy:function(t){return Pr.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},toJSON:function(t){var e=Pr.prototype.toJSON.call(this,t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}),lu.prototype=Object.assign(Object.create(cu.prototype),{constructor:lu,isHemisphereLight:!0,copy:function(t){return cu.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}),Object.assign(uu.prototype,{copy:function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t={};return 0!==this.bias&&(t.bias=this.bias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}),hu.prototype=Object.assign(Object.create(uu.prototype),{constructor:hu,isSpotLightShadow:!0,update:function(t){var e=this.camera,n=2*Ue.RAD2DEG*t.angle,i=this.mapSize.width/this.mapSize.height,r=t.distance||e.far;n===e.fov&&i===e.aspect&&r===e.far||(e.fov=n,e.aspect=i,e.far=r,e.updateProjectionMatrix())}}),pu.prototype=Object.assign(Object.create(cu.prototype),{constructor:pu,isSpotLight:!0,copy:function(t){return cu.prototype.copy.call(this,t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),du.prototype=Object.assign(Object.create(cu.prototype),{constructor:du,isPointLight:!0,copy:function(t){return cu.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),fu.prototype=Object.assign(Object.create($a.prototype),{constructor:fu,isOrthographicCamera:!0,copy:function(t,e){return $a.prototype.copy.call(this,t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this},setViewOffset:function(t,e,n,i,r,o){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,r=n-t,o=n+t,a=i+e,s=i-e;if(null!==this.view&&this.view.enabled){var c=this.zoom/(this.view.width/this.view.fullWidth),l=this.zoom/(this.view.height/this.view.fullHeight),u=(this.right-this.left)/this.view.width,h=(this.top-this.bottom)/this.view.height;r+=u*(this.view.offsetX/c),o=r+u*(this.view.width/c),a-=h*(this.view.offsetY/l),s=a-h*(this.view.height/l)}this.projectionMatrix.makeOrthographic(r,o,a,s,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=Pr.prototype.toJSON.call(this,t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}),mu.prototype=Object.assign(Object.create(uu.prototype),{constructor:mu}),gu.prototype=Object.assign(Object.create(cu.prototype),{constructor:gu,isDirectionalLight:!0,copy:function(t){return cu.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),vu.prototype=Object.assign(Object.create(cu.prototype),{constructor:vu,isAmbientLight:!0}),yu.prototype=Object.assign(Object.create(cu.prototype),{constructor:yu,isRectAreaLight:!0,copy:function(t){return cu.prototype.copy.call(this,t),this.width=t.width,this.height=t.height,this},toJSON:function(t){var e=cu.prototype.toJSON.call(this,t);return e.object.width=this.width,e.object.height=this.height,e}}),Object.assign(bu.prototype,{load:function(t,e,n,i){var r=this,o=new Sl(r.manager);o.setPath(r.path),o.load(t,(function(t){e(r.parse(JSON.parse(t)))}),n,i)},parse:function(t){var e=this.textures;function n(t){return void 0===e[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),e[t]}var i=new rl[t.type];if(void 0!==t.uuid&&(i.uuid=t.uuid),void 0!==t.name&&(i.name=t.name),void 0!==t.color&&i.color.setHex(t.color),void 0!==t.roughness&&(i.roughness=t.roughness),void 0!==t.metalness&&(i.metalness=t.metalness),void 0!==t.emissive&&i.emissive.setHex(t.emissive),void 0!==t.specular&&i.specular.setHex(t.specular),void 0!==t.shininess&&(i.shininess=t.shininess),void 0!==t.clearCoat&&(i.clearCoat=t.clearCoat),void 0!==t.clearCoatRoughness&&(i.clearCoatRoughness=t.clearCoatRoughness),void 0!==t.vertexColors&&(i.vertexColors=t.vertexColors),void 0!==t.fog&&(i.fog=t.fog),void 0!==t.flatShading&&(i.flatShading=t.flatShading),void 0!==t.blending&&(i.blending=t.blending),void 0!==t.combine&&(i.combine=t.combine),void 0!==t.side&&(i.side=t.side),void 0!==t.opacity&&(i.opacity=t.opacity),void 0!==t.transparent&&(i.transparent=t.transparent),void 0!==t.alphaTest&&(i.alphaTest=t.alphaTest),void 0!==t.depthTest&&(i.depthTest=t.depthTest),void 0!==t.depthWrite&&(i.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(i.colorWrite=t.colorWrite),void 0!==t.wireframe&&(i.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(i.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(i.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(i.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(i.rotation=t.rotation),1!==t.linewidth&&(i.linewidth=t.linewidth),void 0!==t.dashSize&&(i.dashSize=t.dashSize),void 0!==t.gapSize&&(i.gapSize=t.gapSize),void 0!==t.scale&&(i.scale=t.scale),void 0!==t.polygonOffset&&(i.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(i.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(i.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.skinning&&(i.skinning=t.skinning),void 0!==t.morphTargets&&(i.morphTargets=t.morphTargets),void 0!==t.dithering&&(i.dithering=t.dithering),void 0!==t.visible&&(i.visible=t.visible),void 0!==t.userData&&(i.userData=t.userData),void 0!==t.uniforms)for(var r in t.uniforms){var o=t.uniforms[r];switch(i.uniforms[r]={},o.type){case"t":i.uniforms[r].value=n(o.value);break;case"c":i.uniforms[r].value=(new wr).setHex(o.value);break;case"v2":i.uniforms[r].value=(new Ge).fromArray(o.value);break;case"v3":i.uniforms[r].value=(new je).fromArray(o.value);break;case"v4":i.uniforms[r].value=(new Ye).fromArray(o.value);break;case"m3":i.uniforms[r].value=(new Ve).fromArray(o.value);case"m4":i.uniforms[r].value=(new rn).fromArray(o.value);break;default:i.uniforms[r].value=o.value}}if(void 0!==t.defines&&(i.defines=t.defines),void 0!==t.vertexShader&&(i.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(i.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(var a in t.extensions)i.extensions[a]=t.extensions[a];if(void 0!==t.shading&&(i.flatShading=1===t.shading),void 0!==t.size&&(i.size=t.size),void 0!==t.sizeAttenuation&&(i.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(i.map=n(t.map)),void 0!==t.matcap&&(i.matcap=n(t.matcap)),void 0!==t.alphaMap&&(i.alphaMap=n(t.alphaMap),i.transparent=!0),void 0!==t.bumpMap&&(i.bumpMap=n(t.bumpMap)),void 0!==t.bumpScale&&(i.bumpScale=t.bumpScale),void 0!==t.normalMap&&(i.normalMap=n(t.normalMap)),void 0!==t.normalMapType&&(i.normalMapType=t.normalMapType),void 0!==t.normalScale){var s=t.normalScale;!1===Array.isArray(s)&&(s=[s,s]),i.normalScale=(new Ge).fromArray(s)}return void 0!==t.displacementMap&&(i.displacementMap=n(t.displacementMap)),void 0!==t.displacementScale&&(i.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(i.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(i.roughnessMap=n(t.roughnessMap)),void 0!==t.metalnessMap&&(i.metalnessMap=n(t.metalnessMap)),void 0!==t.emissiveMap&&(i.emissiveMap=n(t.emissiveMap)),void 0!==t.emissiveIntensity&&(i.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(i.specularMap=n(t.specularMap)),void 0!==t.envMap&&(i.envMap=n(t.envMap)),void 0!==t.envMapIntensity&&(i.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(i.reflectivity=t.reflectivity),void 0!==t.lightMap&&(i.lightMap=n(t.lightMap)),void 0!==t.lightMapIntensity&&(i.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(i.aoMap=n(t.aoMap)),void 0!==t.aoMapIntensity&&(i.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(i.gradientMap=n(t.gradientMap)),i},setPath:function(t){return this.path=t,this},setTextures:function(t){return this.textures=t,this}});var xu={decodeText:function(t){if("undefined"!==typeof TextDecoder)return(new TextDecoder).decode(t);for(var e="",n=0,i=t.length;n<i;n++)e+=String.fromCharCode(t[n]);try{return decodeURIComponent(escape(e))}catch(r){return e}},extractUrlBase:function(t){var e=t.lastIndexOf("/");return-1===e?"./":t.substr(0,e+1)}};function wu(){qr.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function _u(t,e,n,i){"number"===typeof n&&(i=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),Dr.call(this,t,e,n),this.meshPerAttribute=i||1}function Mu(t){this.manager=void 0!==t?t:Ml}wu.prototype=Object.assign(Object.create(qr.prototype),{constructor:wu,isInstancedBufferGeometry:!0,copy:function(t){return qr.prototype.copy.call(this,t),this.maxInstancedCount=t.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t=qr.prototype.toJSON.call(this);return t.maxInstancedCount=this.maxInstancedCount,t.isInstancedBufferGeometry=!0,t}}),_u.prototype=Object.assign(Object.create(Dr.prototype),{constructor:_u,isInstancedBufferAttribute:!0,copy:function(t){return Dr.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},toJSON:function(){var t=Dr.prototype.toJSON.call(this);return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}),Object.assign(Mu.prototype,{load:function(t,e,n,i){var r=this,o=new Sl(r.manager);o.setPath(r.path),o.load(t,(function(t){e(r.parse(JSON.parse(t)))}),n,i)},parse:function(t){var e=t.isInstancedBufferGeometry?new wu:new qr,n=t.data.index;if(void 0!==n){var i=new Tu[n.type](n.array);e.setIndex(new Dr(i,1))}var r=t.data.attributes;for(var o in r){var a=r[o],s=(i=new Tu[a.type](a.array),a.isInstancedBufferAttribute?_u:Dr),c=new s(i,a.itemSize,a.normalized);void 0!==a.name&&(c.name=a.name),e.addAttribute(o,c)}var l=t.data.morphAttributes;if(l)for(var o in l){for(var u=l[o],h=[],p=0,d=u.length;p<d;p++){a=u[p],i=new Tu[a.type](a.array),c=new Dr(i,a.itemSize,a.normalized);void 0!==a.name&&(c.name=a.name),h.push(c)}e.morphAttributes[o]=h}var f=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==f){p=0;for(var m=f.length;p!==m;++p){var g=f[p];e.addGroup(g.start,g.count,g.materialIndex)}}var v=t.data.boundingSphere;if(void 0!==v){var y=new je;void 0!==v.center&&y.fromArray(v.center),e.boundingSphere=new tn(y,v.radius)}return t.name&&(e.name=t.name),t.userData&&(e.userData=t.userData),e},setPath:function(t){return this.path=t,this}});var Tu={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!==typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function Su(t){this.manager=void 0!==t?t:Ml,this.resourcePath=""}Object.assign(Su.prototype,{crossOrigin:"anonymous",load:function(t,e,n,i){var r=this,o=void 0===this.path?xu.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||o;var a=new Sl(r.manager);a.setPath(this.path),a.load(t,(function(n){var o=null;try{o=JSON.parse(n)}catch(s){return void 0!==i&&i(s),void console.error("THREE:ObjectLoader: Can't parse "+t+".",s.message)}var a=o.metadata;void 0!==a&&void 0!==a.type&&"geometry"!==a.type.toLowerCase()?r.parse(o,e):console.error("THREE.ObjectLoader: Can't load "+t)}),n,i)},setPath:function(t){return this.path=t,this},setResourcePath:function(t){return this.resourcePath=t,this},setCrossOrigin:function(t){return this.crossOrigin=t,this},parse:function(t,e){var n=this.parseShape(t.shapes),i=this.parseGeometries(t.geometries,n),r=this.parseImages(t.images,(function(){void 0!==e&&e(s)})),o=this.parseTextures(t.textures,r),a=this.parseMaterials(t.materials,o),s=this.parseObject(t.object,i,a);return t.animations&&(s.animations=this.parseAnimations(t.animations)),void 0!==t.images&&0!==t.images.length||void 0!==e&&e(s),s},parseShape:function(t){var e={};if(void 0!==t)for(var n=0,i=t.length;n<i;n++){var r=(new su).fromJSON(t[n]);e[r.uuid]=r}return e},parseGeometries:function(t,e){var n={};if(void 0!==t)for(var i=new Mu,r=0,o=t.length;r<o;r++){var a,s=t[r];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":a=new Xc[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":a=new Xc[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":a=new Xc[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":a=new Xc[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":a=new Xc[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":a=new Xc[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":a=new Xc[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":a=new Xc[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":a=new Xc[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":a=new Xc[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"TubeGeometry":case"TubeBufferGeometry":a=new Xc[s.type]((new ru[s.path.type]).fromJSON(s.path),s.tubularSegments,s.radius,s.radialSegments,s.closed);break;case"LatheGeometry":case"LatheBufferGeometry":a=new Xc[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":a=new Xc[s.type](s.vertices,s.indices,s.radius,s.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":for(var c=[],l=0,u=s.shapes.length;l<u;l++){var h=e[s.shapes[l]];c.push(h)}a=new Xc[s.type](c,s.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(c=[],l=0,u=s.shapes.length;l<u;l++){h=e[s.shapes[l]];c.push(h)}var p=s.options.extrudePath;void 0!==p&&(s.options.extrudePath=(new ru[p.type]).fromJSON(p)),a=new Xc[s.type](c,s.options);break;case"BufferGeometry":case"InstancedBufferGeometry":a=i.parse(s);break;case"Geometry":if("THREE"in window&&"LegacyJSONLoader"in THREE){var d=new THREE.LegacyJSONLoader;a=d.parse(s,this.resourcePath).geometry}else console.error('THREE.ObjectLoader: You have to import LegacyJSONLoader in order load geometry data of type "Geometry".');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}a.uuid=s.uuid,void 0!==s.name&&(a.name=s.name),!0===a.isBufferGeometry&&void 0!==s.userData&&(a.userData=s.userData),n[s.uuid]=a}return n},parseMaterials:function(t,e){var n={},i={};if(void 0!==t){var r=new bu;r.setTextures(e);for(var o=0,a=t.length;o<a;o++){var s=t[o];if("MultiMaterial"===s.type){for(var c=[],l=0;l<s.materials.length;l++){var u=s.materials[l];void 0===n[u.uuid]&&(n[u.uuid]=r.parse(u)),c.push(n[u.uuid])}i[s.uuid]=c}else void 0===n[s.uuid]&&(n[s.uuid]=r.parse(s)),i[s.uuid]=n[s.uuid]}}return i},parseAnimations:function(t){for(var e=[],n=0;n<t.length;n++){var i=t[n],r=yl.parse(i);void 0!==i.uuid&&(r.uuid=i.uuid),e.push(r)}return e},parseImages:function(t,e){var n=this,i={};function r(t){return n.manager.itemStart(t),a.load(t,(function(){n.manager.itemEnd(t)}),void 0,(function(){n.manager.itemError(t),n.manager.itemEnd(t)}))}if(void 0!==t&&t.length>0){var o=new _l(e),a=new Ll(o);a.setCrossOrigin(this.crossOrigin);for(var s=0,c=t.length;s<c;s++){var l=t[s],u=l.url;if(Array.isArray(u)){i[l.uuid]=[];for(var h=0,p=u.length;h<p;h++){var d=u[h],f=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(d)?d:n.resourcePath+d;i[l.uuid].push(r(f))}}else{f=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l.url)?l.url:n.resourcePath+l.url;i[l.uuid]=r(f)}}}return i},parseTextures:function(t,e){function n(t,e){return"number"===typeof t?t:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",t),e[t])}var i={};if(void 0!==t)for(var r=0,o=t.length;r<o;r++){var a,s=t[r];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===e[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image),a=Array.isArray(e[s.image])?new yo(e[s.image]):new Xe(e[s.image]),a.needsUpdate=!0,a.uuid=s.uuid,void 0!==s.name&&(a.name=s.name),void 0!==s.mapping&&(a.mapping=n(s.mapping,Au)),void 0!==s.offset&&a.offset.fromArray(s.offset),void 0!==s.repeat&&a.repeat.fromArray(s.repeat),void 0!==s.center&&a.center.fromArray(s.center),void 0!==s.rotation&&(a.rotation=s.rotation),void 0!==s.wrap&&(a.wrapS=n(s.wrap[0],Cu),a.wrapT=n(s.wrap[1],Cu)),void 0!==s.format&&(a.format=s.format),void 0!==s.type&&(a.type=s.type),void 0!==s.encoding&&(a.encoding=s.encoding),void 0!==s.minFilter&&(a.minFilter=n(s.minFilter,Lu)),void 0!==s.magFilter&&(a.magFilter=n(s.magFilter,Lu)),void 0!==s.anisotropy&&(a.anisotropy=s.anisotropy),void 0!==s.flipY&&(a.flipY=s.flipY),void 0!==s.premultiplyAlpha&&(a.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(a.unpackAlignment=s.unpackAlignment),i[s.uuid]=a}return i},parseObject:function(t,e,n){var i;function r(t){return void 0===e[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),e[t]}function o(t){if(void 0!==t){if(Array.isArray(t)){for(var e=[],i=0,r=t.length;i<r;i++){var o=t[i];void 0===n[o]&&console.warn("THREE.ObjectLoader: Undefined material",o),e.push(n[o])}return e}return void 0===n[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),n[t]}}switch(t.type){case"Scene":i=new ls,void 0!==t.background&&Number.isInteger(t.background)&&(i.background=new wr(t.background)),void 0!==t.fog&&("Fog"===t.fog.type?i.fog=new cs(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(i.fog=new ss(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":i=new Qa(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(i.focus=t.focus),void 0!==t.zoom&&(i.zoom=t.zoom),void 0!==t.filmGauge&&(i.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(i.filmOffset=t.filmOffset),void 0!==t.view&&(i.view=Object.assign({},t.view));break;case"OrthographicCamera":i=new fu(t.left,t.right,t.top,t.bottom,t.near,t.far),void 0!==t.zoom&&(i.zoom=t.zoom),void 0!==t.view&&(i.view=Object.assign({},t.view));break;case"AmbientLight":i=new vu(t.color,t.intensity);break;case"DirectionalLight":i=new gu(t.color,t.intensity);break;case"PointLight":i=new du(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":i=new yu(t.color,t.intensity,t.width,t.height);break;case"SpotLight":i=new pu(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":i=new lu(t.color,t.groundColor,t.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var a=r(t.geometry),s=o(t.material);i=a.bones&&a.bones.length>0?new ms(a,s):new oo(a,s),void 0!==t.drawMode&&i.setDrawMode(t.drawMode);break;case"LOD":i=new fs;break;case"Line":i=new bs(r(t.geometry),o(t.material),t.mode);break;case"LineLoop":i=new ws(r(t.geometry),o(t.material));break;case"LineSegments":i=new xs(r(t.geometry),o(t.material));break;case"PointCloud":case"Points":i=new Ms(r(t.geometry),o(t.material));break;case"Sprite":i=new ds(o(t.material));break;case"Group":i=new Za;break;default:i=new Pr}if(i.uuid=t.uuid,void 0!==t.name&&(i.name=t.name),void 0!==t.matrix?(i.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(i.matrixAutoUpdate=t.matrixAutoUpdate),i.matrixAutoUpdate&&i.matrix.decompose(i.position,i.quaternion,i.scale)):(void 0!==t.position&&i.position.fromArray(t.position),void 0!==t.rotation&&i.rotation.fromArray(t.rotation),void 0!==t.quaternion&&i.quaternion.fromArray(t.quaternion),void 0!==t.scale&&i.scale.fromArray(t.scale)),void 0!==t.castShadow&&(i.castShadow=t.castShadow),void 0!==t.receiveShadow&&(i.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(i.shadow.bias=t.shadow.bias),void 0!==t.shadow.radius&&(i.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&i.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(i.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(i.visible=t.visible),void 0!==t.frustumCulled&&(i.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(i.renderOrder=t.renderOrder),void 0!==t.userData&&(i.userData=t.userData),void 0!==t.layers&&(i.layers.mask=t.layers),void 0!==t.children)for(var c=t.children,l=0;l<c.length;l++)i.add(this.parseObject(c[l],e,n));if("LOD"===t.type)for(var u=t.levels,h=0;h<u.length;h++){var p=u[h],d=i.getObjectByProperty("uuid",p.object);void 0!==d&&i.addLevel(d,p.distance)}return i}});var Eu,Au={UVMapping:lt,CubeReflectionMapping:ut,CubeRefractionMapping:ht,EquirectangularReflectionMapping:pt,EquirectangularRefractionMapping:dt,SphericalReflectionMapping:ft,CubeUVReflectionMapping:mt,CubeUVRefractionMapping:gt},Cu={RepeatWrapping:vt,ClampToEdgeWrapping:yt,MirroredRepeatWrapping:bt},Lu={NearestFilter:xt,NearestMipMapNearestFilter:wt,NearestMipMapLinearFilter:_t,LinearFilter:Mt,LinearMipMapNearestFilter:Tt,LinearMipMapLinearFilter:St};function Pu(t){"undefined"===typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"===typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.manager=void 0!==t?t:Ml,this.options=void 0}function Ru(){this.type="ShapePath",this.color=new wr,this.subPaths=[],this.currentPath=null}function Ou(t){this.type="Font",this.data=t}function Du(t,e,n){for(var i=Array.from?Array.from(t):String(t).split(""),r=e/n.resolution,o=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*r,a=[],s=0,c=0,l=0;l<i.length;l++){var u=i[l];if("\n"===u)s=0,c-=o;else{var h=Nu(u,r,s,c,n);s+=h.offsetX,a.push(h.path)}}return a}function Nu(t,e,n,i,r){var o=r.glyphs[t]||r.glyphs["?"];if(o){var a,s,c,l,u,h,p,d,f=new Ru;if(o.o)for(var m=o._cachedOutline||(o._cachedOutline=o.o.split(" ")),g=0,v=m.length;g<v;){var y=m[g++];switch(y){case"m":a=m[g++]*e+n,s=m[g++]*e+i,f.moveTo(a,s);break;case"l":a=m[g++]*e+n,s=m[g++]*e+i,f.lineTo(a,s);break;case"q":c=m[g++]*e+n,l=m[g++]*e+i,u=m[g++]*e+n,h=m[g++]*e+i,f.quadraticCurveTo(u,h,c,l);break;case"b":c=m[g++]*e+n,l=m[g++]*e+i,u=m[g++]*e+n,h=m[g++]*e+i,p=m[g++]*e+n,d=m[g++]*e+i,f.bezierCurveTo(u,h,p,d,c,l);break}}return{offsetX:o.ha*e,path:f}}}function Iu(t){this.manager=void 0!==t?t:Ml}function zu(){}Pu.prototype={constructor:Pu,setOptions:function(t){return this.options=t,this},load:function(t,e,n,i){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var r=this,o=wl.get(t);if(void 0!==o)return r.manager.itemStart(t),setTimeout((function(){e&&e(o),r.manager.itemEnd(t)}),0),o;fetch(t).then((function(t){return t.blob()})).then((function(t){return void 0===r.options?createImageBitmap(t):createImageBitmap(t,r.options)})).then((function(n){wl.add(t,n),e&&e(n),r.manager.itemEnd(t)})).catch((function(e){i&&i(e),r.manager.itemError(t),r.manager.itemEnd(t)})),r.manager.itemStart(t)},setCrossOrigin:function(){return this},setPath:function(t){return this.path=t,this}},Object.assign(Ru.prototype,{moveTo:function(t,e){this.currentPath=new au,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e)},lineTo:function(t,e){this.currentPath.lineTo(t,e)},quadraticCurveTo:function(t,e,n,i){this.currentPath.quadraticCurveTo(t,e,n,i)},bezierCurveTo:function(t,e,n,i,r,o){this.currentPath.bezierCurveTo(t,e,n,i,r,o)},splineThru:function(t){this.currentPath.splineThru(t)},toShapes:function(t,e){function n(t){for(var e=[],n=0,i=t.length;n<i;n++){var r=t[n],o=new su;o.curves=r.curves,e.push(o)}return e}function i(t,e){for(var n=e.length,i=!1,r=n-1,o=0;o<n;r=o++){var a=e[r],s=e[o],c=s.x-a.x,l=s.y-a.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(a=e[o],c=-c,s=e[r],l=-l),t.y<a.y||t.y>s.y)continue;if(t.y===a.y){if(t.x===a.x)return!0}else{var u=l*(t.x-a.x)-c*(t.y-a.y);if(0===u)return!0;if(u<0)continue;i=!i}}else{if(t.y!==a.y)continue;if(s.x<=t.x&&t.x<=a.x||a.x<=t.x&&t.x<=s.x)return!0}}return i}var r=_c.isClockWise,o=this.subPaths;if(0===o.length)return[];if(!0===e)return n(o);var a,s,c,l=[];if(1===o.length)return s=o[0],c=new su,c.curves=s.curves,l.push(c),l;var u=!r(o[0].getPoints());u=t?!u:u;var h,p,d=[],f=[],m=[],g=0;f[g]=void 0,m[g]=[];for(var v=0,y=o.length;v<y;v++)s=o[v],h=s.getPoints(),a=r(h),a=t?!a:a,a?(!u&&f[g]&&g++,f[g]={s:new su,p:h},f[g].s.curves=s.curves,u&&g++,m[g]=[]):m[g].push({h:s,p:h[0]});if(!f[0])return n(o);if(f.length>1){for(var b=!1,x=[],w=0,_=f.length;w<_;w++)d[w]=[];for(w=0,_=f.length;w<_;w++)for(var M=m[w],T=0;T<M.length;T++){for(var S=M[T],E=!0,A=0;A<f.length;A++)i(S.p,f[A].p)&&(w!==A&&x.push({froms:w,tos:A,hole:T}),E?(E=!1,d[A].push(S)):b=!0);E&&d[w].push(S)}x.length>0&&(b||(m=d))}v=0;for(var C=f.length;v<C;v++){c=f[v].s,l.push(c),p=m[v];for(var L=0,P=p.length;L<P;L++)c.holes.push(p[L].h)}return l}}),Object.assign(Ou.prototype,{isFont:!0,generateShapes:function(t,e){void 0===e&&(e=100);for(var n=[],i=Du(t,e,this.data),r=0,o=i.length;r<o;r++)Array.prototype.push.apply(n,i[r].toShapes());return n}}),Object.assign(Iu.prototype,{load:function(t,e,n,i){var r=this,o=new Sl(this.manager);o.setPath(this.path),o.load(t,(function(t){var n;try{n=JSON.parse(t)}catch(o){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(t.substring(65,t.length-2))}var i=r.parse(n);e&&e(i)}),n,i)},parse:function(t){return new Ou(t)},setPath:function(t){return this.path=t,this}}),zu.Handlers={handlers:[],add:function(t,e){this.handlers.push(t,e)},get:function(t){for(var e=this.handlers,n=0,i=e.length;n<i;n+=2){var r=e[n],o=e[n+1];if(r.test(t))return o}return null}},Object.assign(zu.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(t,e,n){for(var i=[],r=0;r<t.length;++r)i[r]=this.createMaterial(t[r],e,n);return i},createMaterial:function(){var t={NoBlending:T,NormalBlending:S,AdditiveBlending:E,SubtractiveBlending:A,MultiplyBlending:C,CustomBlending:L},e=new wr,n=new Rl,i=new bu;return function(r,o,a){var s={};function c(t,e,i,r,c){var l,u=o+t,h=zu.Handlers.get(u);null!==h?l=h.load(u):(n.setCrossOrigin(a),l=n.load(u)),void 0!==e&&(l.repeat.fromArray(e),1!==e[0]&&(l.wrapS=vt),1!==e[1]&&(l.wrapT=vt)),void 0!==i&&l.offset.fromArray(i),void 0!==r&&("repeat"===r[0]&&(l.wrapS=vt),"mirror"===r[0]&&(l.wrapS=bt),"repeat"===r[1]&&(l.wrapT=vt),"mirror"===r[1]&&(l.wrapT=bt)),void 0!==c&&(l.anisotropy=c);var p=Ue.generateUUID();return s[p]=l,p}var l={uuid:Ue.generateUUID(),type:"MeshLambertMaterial"};for(var u in r){var h=r[u];switch(u){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":l.name=h;break;case"blending":l.blending=t[h];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",u,"is no longer supported.");break;case"colorDiffuse":l.color=e.fromArray(h).getHex();break;case"colorSpecular":l.specular=e.fromArray(h).getHex();break;case"colorEmissive":l.emissive=e.fromArray(h).getHex();break;case"specularCoef":l.shininess=h;break;case"shading":"basic"===h.toLowerCase()&&(l.type="MeshBasicMaterial"),"phong"===h.toLowerCase()&&(l.type="MeshPhongMaterial"),"standard"===h.toLowerCase()&&(l.type="MeshStandardMaterial");break;case"mapDiffuse":l.map=c(h,r.mapDiffuseRepeat,r.mapDiffuseOffset,r.mapDiffuseWrap,r.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":l.emissiveMap=c(h,r.mapEmissiveRepeat,r.mapEmissiveOffset,r.mapEmissiveWrap,r.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":l.lightMap=c(h,r.mapLightRepeat,r.mapLightOffset,r.mapLightWrap,r.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":l.aoMap=c(h,r.mapAORepeat,r.mapAOOffset,r.mapAOWrap,r.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":l.bumpMap=c(h,r.mapBumpRepeat,r.mapBumpOffset,r.mapBumpWrap,r.mapBumpAnisotropy);break;case"mapBumpScale":l.bumpScale=h;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":l.normalMap=c(h,r.mapNormalRepeat,r.mapNormalOffset,r.mapNormalWrap,r.mapNormalAnisotropy);break;case"mapNormalFactor":l.normalScale=h;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":l.specularMap=c(h,r.mapSpecularRepeat,r.mapSpecularOffset,r.mapSpecularWrap,r.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":l.metalnessMap=c(h,r.mapMetalnessRepeat,r.mapMetalnessOffset,r.mapMetalnessWrap,r.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":l.roughnessMap=c(h,r.mapRoughnessRepeat,r.mapRoughnessOffset,r.mapRoughnessWrap,r.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":l.alphaMap=c(h,r.mapAlphaRepeat,r.mapAlphaOffset,r.mapAlphaWrap,r.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":l.side=v;break;case"doubleSided":l.side=y;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),l.opacity=h;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":l[u]=h;break;case"vertexColors":!0===h&&(l.vertexColors=M),"face"===h&&(l.vertexColors=_);break;default:console.error("THREE.Loader.createMaterial: Unsupported",u,h);break}}return"MeshBasicMaterial"===l.type&&delete l.emissive,"MeshPhongMaterial"!==l.type&&delete l.specular,l.opacity<1&&(l.transparent=!0),i.setTextures(s),i.parse(l)}}()});var Bu={getContext:function(){return void 0===Eu&&(Eu=new(window.AudioContext||window.webkitAudioContext)),Eu},setContext:function(t){Eu=t}};function ku(t){this.manager=void 0!==t?t:Ml}function Hu(){this.coefficients=[];for(var t=0;t<9;t++)this.coefficients.push(new je)}function Uu(t,e){cu.call(this,void 0,e),this.sh=void 0!==t?t:new Hu}function Gu(t,e,n){Uu.call(this,void 0,n);var i=(new wr).set(t),r=(new wr).set(e),o=new je(i.r,i.g,i.b),a=new je(r.r,r.g,r.b),s=Math.sqrt(Math.PI),c=s*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(a).multiplyScalar(s),this.sh.coefficients[1].copy(o).sub(a).multiplyScalar(c)}function Fu(t,e){Uu.call(this,void 0,e);var n=(new wr).set(t);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}function ju(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Qa,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Qa,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}Object.assign(ku.prototype,{load:function(t,e,n,i){var r=new Sl(this.manager);r.setResponseType("arraybuffer"),r.setPath(this.path),r.load(t,(function(t){var n=t.slice(0),i=Bu.getContext();i.decodeAudioData(n,(function(t){e(t)}))}),n,i)},setPath:function(t){return this.path=t,this}}),Object.assign(Hu.prototype,{isSphericalHarmonics3:!0,set:function(t){for(var e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this},zero:function(){for(var t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this},getAt:function(t,e){var n=t.x,i=t.y,r=t.z,o=this.coefficients;return e=.282095*o[0],e+=.488603*o[1]*i,e+=.488603*o[2]*r,e+=.488603*o[3]*n,e+=1.092548*o[4]*(n*i),e+=1.092548*o[5]*(i*r),e+=.315392*o[6]*(3*r*r-1),e+=1.092548*o[7]*(n*r),e+=.546274*o[8]*(n*n-i*i),e},getIrradianceAt:function(t,e){var n=t.x,i=t.y,r=t.z,o=this.coefficients;return e=.886227*o[0],e+=2*o[1]*.511664*i,e+=2*o[2]*.511664*r,e+=2*o[3]*.511664*n,e+=2*o[4]*.429043*n*i,e+=2*o[5]*.429043*i*r,e+=o[6]*(.743125*r*r-.247708),e+=2*o[7]*.429043*n*r,e+=.429043*o[8]*(n*n-i*i),e},add:function(t){for(var e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this},scale:function(t){for(var e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this},lerp:function(t,e){for(var n=0;n<9;n++)this.coefficients[n].lerp(t.coefficients[n],e);return this},equals:function(t){for(var e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0},copy:function(t){return this.set(t.coefficients)},clone:function(){return(new this.constructor).copy(this)},fromArray:function(t){for(var e=this.coefficients,n=0;n<9;n++)e[n].fromArray(t,3*n);return this},toArray:function(){for(var t=[],e=this.coefficients,n=0;n<9;n++)e[n].toArray(t,3*n);return t}}),Object.assign(Hu,{getBasisAt:function(t,e){var n=t.x,i=t.y,r=t.z;e[0]=.282095,e[1]=.488603*i,e[2]=.488603*r,e[3]=.488603*n,e[4]=1.092548*n*i,e[5]=1.092548*i*r,e[6]=.315392*(3*r*r-1),e[7]=1.092548*n*r,e[8]=.546274*(n*n-i*i)}}),Uu.prototype=Object.assign(Object.create(cu.prototype),{constructor:Uu,isLightProbe:!0,copy:function(t){return cu.prototype.copy.call(this,t),this.sh.copy(t.sh),this.intensity=t.intensity,this},toJSON:function(t){var e=cu.prototype.toJSON.call(this,t);return e}}),Gu.prototype=Object.assign(Object.create(Uu.prototype),{constructor:Gu,isHemisphereLightProbe:!0,copy:function(t){return Uu.prototype.copy.call(this,t),this},toJSON:function(t){var e=Uu.prototype.toJSON.call(this,t);return e}}),Fu.prototype=Object.assign(Object.create(Uu.prototype),{constructor:Fu,isAmbientLightProbe:!0,copy:function(t){return Uu.prototype.copy.call(this,t),this},toJSON:function(t){var e=Uu.prototype.toJSON.call(this,t);return e}}),Object.assign(ju.prototype,{update:function(){var t,e,n,i,r,o,a,s,c=new rn,l=new rn;return function(u){var h=t!==this||e!==u.focus||n!==u.fov||i!==u.aspect*this.aspect||r!==u.near||o!==u.far||a!==u.zoom||s!==this.eyeSep;if(h){t=this,e=u.focus,n=u.fov,i=u.aspect*this.aspect,r=u.near,o=u.far,a=u.zoom;var p=u.projectionMatrix.clone();s=this.eyeSep/2;var d,f,m=s*r/e,g=r*Math.tan(Ue.DEG2RAD*n*.5)/a;l.elements[12]=-s,c.elements[12]=s,d=-g*i+m,f=g*i+m,p.elements[0]=2*r/(f-d),p.elements[8]=(f+d)/(f-d),this.cameraL.projectionMatrix.copy(p),d=-g*i-m,f=g*i-m,p.elements[0]=2*r/(f-d),p.elements[8]=(f+d)/(f-d),this.cameraR.projectionMatrix.copy(p)}this.cameraL.matrixWorld.copy(u.matrixWorld).multiply(l),this.cameraR.matrixWorld.copy(u.matrixWorld).multiply(c)}}()});var Vu=90,Wu=1;function qu(t,e,n,i){Pr.call(this),this.type="CubeCamera";var r=new Qa(Vu,Wu,t,e);r.up.set(0,-1,0),r.lookAt(new je(1,0,0)),this.add(r);var o=new Qa(Vu,Wu,t,e);o.up.set(0,-1,0),o.lookAt(new je(-1,0,0)),this.add(o);var a=new Qa(Vu,Wu,t,e);a.up.set(0,0,1),a.lookAt(new je(0,1,0)),this.add(a);var s=new Qa(Vu,Wu,t,e);s.up.set(0,0,-1),s.lookAt(new je(0,-1,0)),this.add(s);var c=new Qa(Vu,Wu,t,e);c.up.set(0,-1,0),c.lookAt(new je(0,0,1)),this.add(c);var l=new Qa(Vu,Wu,t,e);l.up.set(0,-1,0),l.lookAt(new je(0,0,-1)),this.add(l),i=i||{format:Ht,magFilter:Mt,minFilter:Mt},this.renderTarget=new $e(n,n,i),this.renderTarget.texture.name="CubeCamera",this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();var n=t.getRenderTarget(),i=this.renderTarget,u=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,t.setRenderTarget(i,0),t.render(e,r),t.setRenderTarget(i,1),t.render(e,o),t.setRenderTarget(i,2),t.render(e,a),t.setRenderTarget(i,3),t.render(e,s),t.setRenderTarget(i,4),t.render(e,c),i.texture.generateMipmaps=u,t.setRenderTarget(i,5),t.render(e,l),t.setRenderTarget(n)},this.clear=function(t,e,n,i){for(var r=t.getRenderTarget(),o=this.renderTarget,a=0;a<6;a++)t.setRenderTarget(o,a),t.clear(e,n,i);t.setRenderTarget(r)}}function Xu(t){this.autoStart=void 0===t||t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}function Yu(){Pr.call(this),this.type="AudioListener",this.context=Bu.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0}function Ju(t){Pr.call(this),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.startTime=0,this.offset=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filters=[]}function Zu(t){Ju.call(this,t),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}function $u(t,e){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=void 0!==e?e:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}function Qu(t,e,n){this.binding=t,this.valueSize=n;var i,r=Float64Array;switch(e){case"quaternion":i=this._slerp;break;case"string":case"bool":r=Array,i=this._select;break;default:i=this._lerp}this.buffer=new r(4*n),this._mixBufferRegion=i,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}qu.prototype=Object.create(Pr.prototype),qu.prototype.constructor=qu,Object.assign(Xu.prototype,{start:function(){this.startTime=("undefined"===typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var e=("undefined"===typeof performance?Date:performance).now();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}),Yu.prototype=Object.assign(Object.create(Pr.prototype),{constructor:Yu,getInput:function(){return this.gain},removeFilter:function(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this},getFilter:function(){return this.filter},setFilter:function(t){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this},updateMatrixWorld:function(){var t=new je,e=new Fe,n=new je,i=new je,r=new Xu;return function(o){Pr.prototype.updateMatrixWorld.call(this,o);var a=this.context.listener,s=this.up;if(this.timeDelta=r.getDelta(),this.matrixWorld.decompose(t,e,n),i.set(0,0,-1).applyQuaternion(e),a.positionX){var c=this.context.currentTime+this.timeDelta;a.positionX.linearRampToValueAtTime(t.x,c),a.positionY.linearRampToValueAtTime(t.y,c),a.positionZ.linearRampToValueAtTime(t.z,c),a.forwardX.linearRampToValueAtTime(i.x,c),a.forwardY.linearRampToValueAtTime(i.y,c),a.forwardZ.linearRampToValueAtTime(i.z,c),a.upX.linearRampToValueAtTime(s.x,c),a.upY.linearRampToValueAtTime(s.y,c),a.upZ.linearRampToValueAtTime(s.z,c)}else a.setPosition(t.x,t.y,t.z),a.setOrientation(i.x,i.y,i.z,s.x,s.y,s.z)}}()}),Ju.prototype=Object.assign(Object.create(Pr.prototype),{constructor:Ju,getOutput:function(){return this.gain},setNodeSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this},setMediaElementSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this},setBuffer:function(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(){if(!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){var t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.onended=this.onEnded.bind(this),this.startTime=this.context.currentTime,t.start(this.startTime,this.offset),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")},pause:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this.source.stop(),this.source.onended=null,this.offset+=(this.context.currentTime-this.startTime)*this.playbackRate,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")},stop:function(){if(!1!==this.hasPlaybackControl)return this.source.stop(),this.source.onended=null,this.offset=0,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(t){return t||(t=[]),!0===this.isPlaying?(this.disconnect(),this.filters=t,this.connect()):this.filters=t,this},setDetune:function(t){if(this.detune=t,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this},getDetune:function(){return this.detune},getFilter:function(){return this.getFilters()[0]},setFilter:function(t){return this.setFilters(t?[t]:[])},setPlaybackRate:function(t){if(!1!==this.hasPlaybackControl)return this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(t){if(!1!==this.hasPlaybackControl)return this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")},getVolume:function(){return this.gain.gain.value},setVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}}),Zu.prototype=Object.assign(Object.create(Ju.prototype),{constructor:Zu,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(t){return this.panner.refDistance=t,this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(t){return this.panner.rolloffFactor=t,this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(t){return this.panner.distanceModel=t,this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(t){return this.panner.maxDistance=t,this},setDirectionalCone:function(t,e,n){return this.panner.coneInnerAngle=t,this.panner.coneOuterAngle=e,this.panner.coneOuterGain=n,this},updateMatrixWorld:function(){var t=new je,e=new Fe,n=new je,i=new je;return function(r){if(Pr.prototype.updateMatrixWorld.call(this,r),!0!==this.hasPlaybackControl||!1!==this.isPlaying){this.matrixWorld.decompose(t,e,n),i.set(0,0,1).applyQuaternion(e);var o=this.panner;if(o.positionX){var a=this.context.currentTime+this.listener.timeDelta;o.positionX.linearRampToValueAtTime(t.x,a),o.positionY.linearRampToValueAtTime(t.y,a),o.positionZ.linearRampToValueAtTime(t.z,a),o.orientationX.linearRampToValueAtTime(i.x,a),o.orientationY.linearRampToValueAtTime(i.y,a),o.orientationZ.linearRampToValueAtTime(i.z,a)}else o.setPosition(t.x,t.y,t.z),o.setOrientation(i.x,i.y,i.z)}}}()}),Object.assign($u.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var t=0,e=this.getFrequencyData(),n=0;n<e.length;n++)t+=e[n];return t/e.length}}),Object.assign(Qu.prototype,{accumulate:function(t,e){var n=this.buffer,i=this.valueSize,r=t*i+i,o=this.cumulativeWeight;if(0===o){for(var a=0;a!==i;++a)n[r+a]=n[a];o=e}else{o+=e;var s=e/o;this._mixBufferRegion(n,r,0,s,i)}this.cumulativeWeight=o},apply:function(t){var e=this.valueSize,n=this.buffer,i=t*e+e,r=this.cumulativeWeight,o=this.binding;if(this.cumulativeWeight=0,r<1){var a=3*e;this._mixBufferRegion(n,i,a,1-r,e)}for(var s=e,c=e+e;s!==c;++s)if(n[s]!==n[s+e]){o.setValue(n,i);break}},saveOriginalState:function(){var t=this.binding,e=this.buffer,n=this.valueSize,i=3*n;t.getValue(e,i);for(var r=n,o=i;r!==o;++r)e[r]=e[i+r%n];this.cumulativeWeight=0},restoreOriginalState:function(){var t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_select:function(t,e,n,i,r){if(i>=.5)for(var o=0;o!==r;++o)t[e+o]=t[n+o]},_slerp:function(t,e,n,i){Fe.slerpFlat(t,e,t,e,t,n,i)},_lerp:function(t,e,n,i,r){for(var o=1-i,a=0;a!==r;++a){var s=e+a;t[s]=t[s]*o+t[n+a]*i}}});var Ku,th,eh="\\[\\]\\.:\\/";function nh(t,e,n){var i=n||ih.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,i)}function ih(t,e,n){this.path=e,this.parsedPath=n||ih.parseTrackName(e),this.node=ih.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function rh(){this.uuid=Ue.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var t={};this._indicesByUUID=t;for(var e=0,n=arguments.length;e!==n;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var i=this;this.stats={objects:{get total(){return i._objects.length},get inUse(){return this.total-i.nCachedObjects_}},get bindingsPerObject(){return i._bindings.length}}}function oh(t,e,n){this._mixer=t,this._clip=e,this._localRoot=n||null;for(var i=e.tracks,r=i.length,o=new Array(r),a={endingStart:_e,endingEnd:_e},s=0;s!==r;++s){var c=i[s].createInterpolant(null);o[s]=c,c.settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(r),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=ve,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function ah(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function sh(t){"string"===typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}function ch(t,e,n){us.call(this,t,e),this.meshPerAttribute=n||1}function lh(t,e,n,i){this.ray=new no(t,e),this.near=n||0,this.far=i||1/0,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function uh(t,e){return t.distance-e.distance}function hh(t,e,n,i){if(!1!==t.visible&&(t.raycast(e,n),!0===i))for(var r=t.children,o=0,a=r.length;o<a;o++)hh(r[o],e,n,!0)}function ph(t,e,n){return this.radius=void 0!==t?t:1,this.phi=void 0!==e?e:0,this.theta=void 0!==n?n:0,this}function dh(t,e,n){return this.radius=void 0!==t?t:1,this.theta=void 0!==e?e:0,this.y=void 0!==n?n:0,this}function fh(t,e){this.min=void 0!==t?t:new Ge(1/0,1/0),this.max=void 0!==e?e:new Ge(-1/0,-1/0)}function mh(t,e){this.start=void 0!==t?t:new je,this.end=void 0!==e?e:new je}function gh(t){Pr.call(this),this.material=t,this.render=function(){}}function vh(t,e,n,i){this.object=t,this.size=void 0!==e?e:1;var r=void 0!==n?n:16711680,o=void 0!==i?i:1,a=0,s=this.object.geometry;s&&s.isGeometry?a=3*s.faces.length:s&&s.isBufferGeometry&&(a=s.attributes.normal.count);var c=new qr,l=new Gr(2*a*3,3);c.addAttribute("position",l),xs.call(this,c,new ys({color:r,linewidth:o})),this.matrixAutoUpdate=!1,this.update()}function yh(t,e){Pr.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;for(var n=new qr,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],r=0,o=1,a=32;r<a;r++,o++){var s=r/a*Math.PI*2,c=o/a*Math.PI*2;i.push(Math.cos(s),Math.sin(s),1,Math.cos(c),Math.sin(c),1)}n.addAttribute("position",new Gr(i,3));var l=new ys({fog:!1});this.cone=new xs(n,l),this.add(this.cone),this.update()}function bh(t){var e=[];t&&t.isBone&&e.push(t);for(var n=0;n<t.children.length;n++)e.push.apply(e,bh(t.children[n]));return e}function xh(t){for(var e=bh(t),n=new qr,i=[],r=[],o=new wr(0,0,1),a=new wr(0,1,0),s=0;s<e.length;s++){var c=e[s];c.parent&&c.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),r.push(o.r,o.g,o.b),r.push(a.r,a.g,a.b))}n.addAttribute("position",new Gr(i,3)),n.addAttribute("color",new Gr(r,3));var l=new ys({vertexColors:M,depthTest:!1,depthWrite:!1,transparent:!0});xs.call(this,n,l),this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}function wh(t,e,n){this.light=t,this.light.updateMatrixWorld(),this.color=n;var i=new Oc(e,4,2),r=new ro({wireframe:!0,fog:!1});oo.call(this,i,r),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function _h(t,e){this.type="RectAreaLightHelper",this.light=t,this.color=e;var n=[1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],i=new qr;i.addAttribute("position",new Gr(n,3)),i.computeBoundingSphere();var r=new ys({fog:!1});bs.call(this,i,r);var o=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],a=new qr;a.addAttribute("position",new Gr(o,3)),a.computeBoundingSphere(),this.add(new oo(a,new ro({side:v,fog:!1}))),this.update()}function Mh(t,e,n){Pr.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var i=new zs(e);i.rotateY(.5*Math.PI),this.material=new ro({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=M);var r=i.getAttribute("position"),o=new Float32Array(3*r.count);i.addAttribute("color",new Dr(o,3)),this.add(new oo(i,this.material)),this.update()}function Th(t,e){this.lightProbe=t,this.size=e;var n={GAMMA_OUTPUT:""},i=new eo({defines:n,uniforms:{sh:{value:this.lightProbe.sh.coefficients},intensity:{value:this.lightProbe.intensity}},vertexShader:["varying vec3 vNormal;","void main() {","\tvNormal = normalize( normalMatrix * normal );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define RECIPROCAL_PI 0.318309886","vec3 inverseTransformDirection( in vec3 normal, in mat4 matrix ) {","\t// matrix is assumed to be orthogonal","\treturn normalize( ( vec4( normal, 0.0 ) * matrix ).xyz );","}","vec3 linearToOutput( in vec3 a ) {","\t#ifdef GAMMA_OUTPUT","\t\treturn pow( a, vec3( 1.0 / float( GAMMA_FACTOR ) ) );","\t#else","\t\treturn a;","\t#endif","}","// source: https://graphics.stanford.edu/papers/envmap/envmap.pdf","vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {","\t// normal is assumed to have unit length","\tfloat x = normal.x, y = normal.y, z = normal.z;","\t// band 0","\tvec3 result = shCoefficients[ 0 ] * 0.886227;","\t// band 1","\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;","\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;","\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;","\t// band 2","\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;","\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;","\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );","\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;","\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );","\treturn result;","}","uniform vec3 sh[ 9 ]; // sh coefficients","uniform float intensity; // light probe intensity","varying vec3 vNormal;","void main() {","\tvec3 normal = normalize( vNormal );","\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );","\tvec3 irradiance = shGetIrradianceAt( worldNormal, sh );","\tvec3 outgoingLight = RECIPROCAL_PI * irradiance * intensity;","\toutgoingLight = linearToOutput( outgoingLight );","\tgl_FragColor = vec4( outgoingLight, 1.0 );","}"].join("\n")}),r=new Oc(1,32,16);oo.call(this,r,i),this.onBeforeRender()}function Sh(t,e,n,i){t=t||10,e=e||10,n=new wr(void 0!==n?n:4473924),i=new wr(void 0!==i?i:8947848);for(var r=e/2,o=t/e,a=t/2,s=[],c=[],l=0,u=0,h=-a;l<=e;l++,h+=o){s.push(-a,0,h,a,0,h),s.push(h,0,-a,h,0,a);var p=l===r?n:i;p.toArray(c,u),u+=3,p.toArray(c,u),u+=3,p.toArray(c,u),u+=3,p.toArray(c,u),u+=3}var d=new qr;d.addAttribute("position",new Gr(s,3)),d.addAttribute("color",new Gr(c,3));var f=new ys({vertexColors:M});xs.call(this,d,f)}function Eh(t,e,n,i,r,o){t=t||10,e=e||16,n=n||8,i=i||64,r=new wr(void 0!==r?r:4473924),o=new wr(void 0!==o?o:8947848);var a,s,c,l,u,h,p,d=[],f=[];for(l=0;l<=e;l++)c=l/e*(2*Math.PI),a=Math.sin(c)*t,s=Math.cos(c)*t,d.push(0,0,0),d.push(a,0,s),p=1&l?r:o,f.push(p.r,p.g,p.b),f.push(p.r,p.g,p.b);for(l=0;l<=n;l++)for(p=1&l?r:o,h=t-t/n*l,u=0;u<i;u++)c=u/i*(2*Math.PI),a=Math.sin(c)*h,s=Math.cos(c)*h,d.push(a,0,s),f.push(p.r,p.g,p.b),c=(u+1)/i*(2*Math.PI),a=Math.sin(c)*h,s=Math.cos(c)*h,d.push(a,0,s),f.push(p.r,p.g,p.b);var m=new qr;m.addAttribute("position",new Gr(d,3)),m.addAttribute("color",new Gr(f,3));var g=new ys({vertexColors:M});xs.call(this,m,g)}function Ah(t,e,n,i){this.audio=t,this.range=e||1,this.divisionsInnerAngle=n||16,this.divisionsOuterAngle=i||2;var r=new qr,o=this.divisionsInnerAngle+2*this.divisionsOuterAngle,a=new Float32Array(3*(3*o+3));r.addAttribute("position",new Dr(a,3));var s=new ys({color:65280}),c=new ys({color:16776960});bs.call(this,r,[c,s]),this.update()}function Ch(t,e,n,i){this.object=t,this.size=void 0!==e?e:1;var r=void 0!==n?n:16776960,o=void 0!==i?i:1,a=0,s=this.object.geometry;s&&s.isGeometry?a=s.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");var c=new qr,l=new Gr(2*a*3,3);c.addAttribute("position",l),xs.call(this,c,new ys({color:r,linewidth:o})),this.matrixAutoUpdate=!1,this.update()}function Lh(t,e,n){Pr.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===e&&(e=1);var i=new qr;i.addAttribute("position",new Gr([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));var r=new ys({fog:!1});this.lightPlane=new bs(i,r),this.add(this.lightPlane),i=new qr,i.addAttribute("position",new Gr([0,0,0,0,0,1],3)),this.targetLine=new bs(i,r),this.add(this.targetLine),this.update()}function Ph(t){var e=new qr,n=new ys({color:16777215,vertexColors:_}),i=[],r=[],o={},a=new wr(16755200),s=new wr(16711680),c=new wr(43775),l=new wr(16777215),u=new wr(3355443);function h(t,e,n){p(t,n),p(e,n)}function p(t,e){i.push(0,0,0),r.push(e.r,e.g,e.b),void 0===o[t]&&(o[t]=[]),o[t].push(i.length/3-1)}h("n1","n2",a),h("n2","n4",a),h("n4","n3",a),h("n3","n1",a),h("f1","f2",a),h("f2","f4",a),h("f4","f3",a),h("f3","f1",a),h("n1","f1",a),h("n2","f2",a),h("n3","f3",a),h("n4","f4",a),h("p","n1",s),h("p","n2",s),h("p","n3",s),h("p","n4",s),h("u1","u2",c),h("u2","u3",c),h("u3","u1",c),h("c","t",l),h("p","c",u),h("cn1","cn2",u),h("cn3","cn4",u),h("cf1","cf2",u),h("cf3","cf4",u),e.addAttribute("position",new Gr(i,3)),e.addAttribute("color",new Gr(r,3)),xs.call(this,e,n),this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}function Rh(t,e){this.object=t,void 0===e&&(e=16776960);var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(24),r=new qr;r.setIndex(new Dr(n,1)),r.addAttribute("position",new Dr(i,3)),xs.call(this,r,new ys({color:e})),this.matrixAutoUpdate=!1,this.update()}function Oh(t,e){this.type="Box3Helper",this.box=t;var n=void 0!==e?e:16776960,i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],o=new qr;o.setIndex(new Dr(i,1)),o.addAttribute("position",new Gr(r,3)),xs.call(this,o,new ys({color:n})),this.geometry.computeBoundingSphere()}function Dh(t,e,n){this.type="PlaneHelper",this.plane=t,this.size=void 0===e?1:e;var i=void 0!==n?n:16776960,r=[1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],o=new qr;o.addAttribute("position",new Gr(r,3)),o.computeBoundingSphere(),bs.call(this,o,new ys({color:i}));var a=[1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],s=new qr;s.addAttribute("position",new Gr(a,3)),s.computeBoundingSphere(),this.add(new oo(s,new ro({color:i,opacity:.2,transparent:!0,depthWrite:!1})))}function Nh(t,e,n,i,r,o){Pr.call(this),void 0===t&&(t=new je(0,0,1)),void 0===e&&(e=new je(0,0,0)),void 0===n&&(n=1),void 0===i&&(i=16776960),void 0===r&&(r=.2*n),void 0===o&&(o=.2*r),void 0===Ku&&(Ku=new qr,Ku.addAttribute("position",new Gr([0,0,0,0,1,0],3)),th=new Fc(0,.5,1,5,1),th.translate(0,-.5,0)),this.position.copy(e),this.line=new bs(Ku,new ys({color:i})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new oo(th,new ro({color:i})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(n,r,o)}function Ih(t){t=t||1;var e=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],i=new qr;i.addAttribute("position",new Gr(e,3)),i.addAttribute("color",new Gr(n,3));var r=new ys({vertexColors:M});xs.call(this,i,r)}function zh(t,e,n,i,r,o,a){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new Er(t,e,n,r,o,a)}Object.assign(nh.prototype,{getValue:function(t,e){this.bind();var n=this._targetGroup.nCachedObjects_,i=this._bindings[n];void 0!==i&&i.getValue(t,e)},setValue:function(t,e){for(var n=this._bindings,i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(t,e)},bind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()},unbind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}}),Object.assign(ih,{Composite:nh,create:function(t,e,n){return t&&t.isAnimationObjectGroup?new ih.Composite(t,e,n):new ih(t,e,n)},sanitizeNodeName:function(){var t=new RegExp("["+eh+"]","g");return function(e){return e.replace(/\s/g,"_").replace(t,"")}}(),parseTrackName:function(){var t="[^"+eh+"]",e="[^"+eh.replace("\\.","")+"]",n=/((?:WC+[\/:])*)/.source.replace("WC",t),i=/(WCOD+)?/.source.replace("WCOD",e),r=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",t),o=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",t),a=new RegExp("^"+n+i+r+o+"$"),s=["material","materials","bones"];return function(t){var e=a.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);var n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){var r=n.nodeName.substring(i+1);-1!==s.indexOf(r)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=r)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}}(),findNode:function(t,e){if(!e||""===e||"root"===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){var n=t.skeleton.getBoneByName(e);if(void 0!==n)return n}if(t.children){var i=function(t){for(var n=0;n<t.length;n++){var r=t[n];if(r.name===e||r.uuid===e)return r;var o=i(r.children);if(o)return o}return null},r=i(t.children);if(r)return r}return null}}),Object.assign(ih.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(t,e){t[e]=this.node[this.propertyName]},function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)t[e++]=n[i]},function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]},function(t,e){this.resolvedProperty.toArray(t,e)}],SetterByBindingTypeAndVersioning:[[function(t,e){this.targetObject[this.propertyName]=t[e]},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=t[e++]},function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=t[e++];this.targetObject.needsUpdate=!0},function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty.fromArray(t,e)},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(t,e){this.bind(),this.getValue(t,e)},setValue:function(t,e){this.bind(),this.setValue(t,e)},bind:function(){var t=this.node,e=this.parsedPath,n=e.objectName,i=e.propertyName,r=e.propertyIndex;if(t||(t=ih.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,t){if(n){var o=e.objectIndex;switch(n){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(var a=0;a<t.length;a++)if(t[a].name===o){o=a;break}break;default:if(void 0===t[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[n]}if(void 0!==o){if(void 0===t[o])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[o]}}var s=t[i];if(void 0!==s){var c=this.Versioning.None;this.targetObject=t,void 0!==t.needsUpdate?c=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(c=this.Versioning.MatrixWorldNeedsUpdate);var l=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===i){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(t.geometry.isBufferGeometry){if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(a=0;a<this.node.geometry.morphAttributes.position.length;a++)if(t.geometry.morphAttributes.position[a].name===r){r=a;break}}else{if(!t.geometry.morphTargets)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(a=0;a<this.node.geometry.morphTargets.length;a++)if(t.geometry.morphTargets[a].name===r){r=a;break}}}l=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=r}else void 0!==s.fromArray&&void 0!==s.toArray?(l=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(l=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=i;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][c]}else{var u=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+i+" but it wasn't found.",t)}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(ih.prototype,{_getValue_unbound:ih.prototype.getValue,_setValue_unbound:ih.prototype.setValue}),Object.assign(rh.prototype,{isAnimationObjectGroup:!0,add:function(){for(var t=this._objects,e=t.length,n=this.nCachedObjects_,i=this._indicesByUUID,r=this._paths,o=this._parsedPaths,a=this._bindings,s=a.length,c=void 0,l=0,u=arguments.length;l!==u;++l){var h=arguments[l],p=h.uuid,d=i[p];if(void 0===d){d=e++,i[p]=d,t.push(h);for(var f=0,m=s;f!==m;++f)a[f].push(new ih(h,r[f],o[f]))}else if(d<n){c=t[d];var g=--n,v=t[g];i[v.uuid]=d,t[d]=v,i[p]=g,t[g]=h;for(f=0,m=s;f!==m;++f){var y=a[f],b=y[g],x=y[d];y[d]=b,void 0===x&&(x=new ih(h,r[f],o[f])),y[g]=x}}else t[d]!==c&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=n},remove:function(){for(var t=this._objects,e=this.nCachedObjects_,n=this._indicesByUUID,i=this._bindings,r=i.length,o=0,a=arguments.length;o!==a;++o){var s=arguments[o],c=s.uuid,l=n[c];if(void 0!==l&&l>=e){var u=e++,h=t[u];n[h.uuid]=l,t[l]=h,n[c]=u,t[u]=s;for(var p=0,d=r;p!==d;++p){var f=i[p],m=f[u],g=f[l];f[l]=m,f[u]=g}}}this.nCachedObjects_=e},uncache:function(){for(var t=this._objects,e=t.length,n=this.nCachedObjects_,i=this._indicesByUUID,r=this._bindings,o=r.length,a=0,s=arguments.length;a!==s;++a){var c=arguments[a],l=c.uuid,u=i[l];if(void 0!==u)if(delete i[l],u<n){var h=--n,p=t[h],d=--e,f=t[d];i[p.uuid]=u,t[u]=p,i[f.uuid]=h,t[h]=f,t.pop();for(var m=0,g=o;m!==g;++m){var v=r[m],y=v[h],b=v[d];v[u]=y,v[h]=b,v.pop()}}else{d=--e,f=t[d];i[f.uuid]=u,t[u]=f,t.pop();for(m=0,g=o;m!==g;++m){v=r[m];v[u]=v[d],v.pop()}}}this.nCachedObjects_=n},subscribe_:function(t,e){var n=this._bindingsIndicesByPath,i=n[t],r=this._bindings;if(void 0!==i)return r[i];var o=this._paths,a=this._parsedPaths,s=this._objects,c=s.length,l=this.nCachedObjects_,u=new Array(c);i=r.length,n[t]=i,o.push(t),a.push(e),r.push(u);for(var h=l,p=s.length;h!==p;++h){var d=s[h];u[h]=new ih(d,t,e)}return u},unsubscribe_:function(t){var e=this._bindingsIndicesByPath,n=e[t];if(void 0!==n){var i=this._paths,r=this._parsedPaths,o=this._bindings,a=o.length-1,s=o[a],c=t[a];e[c]=n,o[n]=s,o.pop(),r[n]=r[a],r.pop(),i[n]=i[a],i.pop()}}}),Object.assign(oh.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(t){return this._startTime=t,this},setLoop:function(t,e){return this.loop=t,this.repetitions=e,this},setEffectiveWeight:function(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(t){return this._scheduleFading(t,0,1)},fadeOut:function(t){return this._scheduleFading(t,1,0)},crossFadeFrom:function(t,e,n){if(t.fadeOut(e),this.fadeIn(e),n){var i=this._clip.duration,r=t._clip.duration,o=r/i,a=i/r;t.warp(1,o,e),this.warp(a,1,e)}return this},crossFadeTo:function(t,e,n){return t.crossFadeFrom(this,e,n)},stopFading:function(){var t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},setEffectiveTimeScale:function(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(t){return this.timeScale=this._clip.duration/t,this.stopWarping()},syncWith:function(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()},halt:function(t){return this.warp(this._effectiveTimeScale,0,t)},warp:function(t,e,n){var i=this._mixer,r=i.time,o=this._timeScaleInterpolant,a=this.timeScale;null===o&&(o=i._lendControlInterpolant(),this._timeScaleInterpolant=o);var s=o.parameterPositions,c=o.sampleValues;return s[0]=r,s[1]=r+n,c[0]=t/a,c[1]=e/a,this},stopWarping:function(){var t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(t,e,n,i){if(this.enabled){var r=this._startTime;if(null!==r){var o=(t-r)*n;if(o<0||0===n)return;this._startTime=null,e=n*o}e*=this._updateTimeScale(t);var a=this._updateTime(e),s=this._updateWeight(t);if(s>0)for(var c=this._interpolants,l=this._propertyBindings,u=0,h=c.length;u!==h;++u)c[u].evaluate(a),l[u].accumulate(i,s)}else this._updateWeight(t)},_updateWeight:function(t){var e=0;if(this.enabled){e=this.weight;var n=this._weightInterpolant;if(null!==n){var i=n.evaluate(t)[0];e*=i,t>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=e,e},_updateTimeScale:function(t){var e=0;if(!this.paused){e=this.timeScale;var n=this._timeScaleInterpolant;if(null!==n){var i=n.evaluate(t)[0];e*=i,t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e},_updateTime:function(t){var e=this.time+t,n=this._clip.duration,i=this.loop,r=this._loopCount,o=i===ye;if(0===t)return-1===r?e:o&&1===(1&r)?n-e:e;if(i===ge){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(e>=n)e=n;else{if(!(e<0)){this.time=e;break t}e=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=e,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),e>=n||e<0){var a=Math.floor(e/n);e-=n*a,r+=Math.abs(a);var s=this.repetitions-r;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,e=t>0?n:0,this.time=e,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===s){var c=t<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=r,this.time=e,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=e;if(o&&1===(1&r))return n-e}return e},_setEndings:function(t,e,n){var i=this._interpolantSettings;n?(i.endingStart=Me,i.endingEnd=Me):(i.endingStart=t?this.zeroSlopeAtStart?Me:_e:Te,i.endingEnd=e?this.zeroSlopeAtEnd?Me:_e:Te)},_scheduleFading:function(t,e,n){var i=this._mixer,r=i.time,o=this._weightInterpolant;null===o&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);var a=o.parameterPositions,s=o.sampleValues;return a[0]=r,s[0]=e,a[1]=r+t,s[1]=n,this}}),ah.prototype=Object.assign(Object.create(i.prototype),{constructor:ah,_bindAction:function(t,e){var n=t._localRoot||this._root,i=t._clip.tracks,r=i.length,o=t._propertyBindings,a=t._interpolants,s=n.uuid,c=this._bindingsByRootAndName,l=c[s];void 0===l&&(l={},c[s]=l);for(var u=0;u!==r;++u){var h=i[u],p=h.name,d=l[p];if(void 0!==d)o[u]=d;else{if(d=o[u],void 0!==d){null===d._cacheIndex&&(++d.referenceCount,this._addInactiveBinding(d,s,p));continue}var f=e&&e._propertyBindings[u].binding.parsedPath;d=new Qu(ih.create(n,p,f),h.ValueTypeName,h.getValueSize()),++d.referenceCount,this._addInactiveBinding(d,s,p),o[u]=d}a[u].resultBuffer=d.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,n=t._clip.uuid,i=this._actionsByClip[n];this._bindAction(t,i&&i.knownActions[0]),this._addInactiveAction(t,n,e)}for(var r=t._propertyBindings,o=0,a=r.length;o!==a;++o){var s=r[o];0===s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,n=0,i=e.length;n!==i;++n){var r=e[n];0===--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){var e=t._cacheIndex;return null!==e&&e<this._nActiveActions},_addInactiveAction:function(t,e,n){var i=this._actions,r=this._actionsByClip,o=r[e];if(void 0===o)o={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,r[e]=o;else{var a=o.knownActions;t._byClipCacheIndex=a.length,a.push(t)}t._cacheIndex=i.length,i.push(t),o.actionByRoot[n]=t},_removeInactiveAction:function(t){var e=this._actions,n=e[e.length-1],i=t._cacheIndex;n._cacheIndex=i,e[i]=n,e.pop(),t._cacheIndex=null;var r=t._clip.uuid,o=this._actionsByClip,a=o[r],s=a.knownActions,c=s[s.length-1],l=t._byClipCacheIndex;c._byClipCacheIndex=l,s[l]=c,s.pop(),t._byClipCacheIndex=null;var u=a.actionByRoot,h=(t._localRoot||this._root).uuid;delete u[h],0===s.length&&delete o[r],this._removeInactiveBindingsForAction(t)},_removeInactiveBindingsForAction:function(t){for(var e=t._propertyBindings,n=0,i=e.length;n!==i;++n){var r=e[n];0===--r.referenceCount&&this._removeInactiveBinding(r)}},_lendAction:function(t){var e=this._actions,n=t._cacheIndex,i=this._nActiveActions++,r=e[i];t._cacheIndex=i,e[i]=t,r._cacheIndex=n,e[n]=r},_takeBackAction:function(t){var e=this._actions,n=t._cacheIndex,i=--this._nActiveActions,r=e[i];t._cacheIndex=i,e[i]=t,r._cacheIndex=n,e[n]=r},_addInactiveBinding:function(t,e,n){var i=this._bindingsByRootAndName,r=i[e],o=this._bindings;void 0===r&&(r={},i[e]=r),r[n]=t,t._cacheIndex=o.length,o.push(t)},_removeInactiveBinding:function(t){var e=this._bindings,n=t.binding,i=n.rootNode.uuid,r=n.path,o=this._bindingsByRootAndName,a=o[i],s=e[e.length-1],c=t._cacheIndex;s._cacheIndex=c,e[c]=s,e.pop(),delete a[r];t:{for(var l in a)break t;delete o[i]}},_lendBinding:function(t){var e=this._bindings,n=t._cacheIndex,i=this._nActiveBindings++,r=e[i];t._cacheIndex=i,e[i]=t,r._cacheIndex=n,e[n]=r},_takeBackBinding:function(t){var e=this._bindings,n=t._cacheIndex,i=--this._nActiveBindings,r=e[i];t._cacheIndex=i,e[i]=t,r._cacheIndex=n,e[n]=r},_lendControlInterpolant:function(){var t=this._controlInterpolants,e=this._nActiveControlInterpolants++,n=t[e];return void 0===n&&(n=new cl(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),n.__cacheIndex=e,t[e]=n),n},_takeBackControlInterpolant:function(t){var e=this._controlInterpolants,n=t.__cacheIndex,i=--this._nActiveControlInterpolants,r=e[i];t.__cacheIndex=i,e[i]=t,r.__cacheIndex=n,e[n]=r},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(t,e){var n=e||this._root,i=n.uuid,r="string"===typeof t?yl.findByName(n,t):t,o=null!==r?r.uuid:t,a=this._actionsByClip[o],s=null;if(void 0!==a){var c=a.actionByRoot[i];if(void 0!==c)return c;s=a.knownActions[0],null===r&&(r=s._clip)}if(null===r)return null;var l=new oh(this,r,e);return this._bindAction(l,s),this._addInactiveAction(l,o,i),l},existingAction:function(t,e){var n=e||this._root,i=n.uuid,r="string"===typeof t?yl.findByName(n,t):t,o=r?r.uuid:t,a=this._actionsByClip[o];return void 0!==a&&a.actionByRoot[i]||null},stopAllAction:function(){var t=this._actions,e=this._nActiveActions,n=this._bindings,i=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var r=0;r!==e;++r)t[r].reset();for(r=0;r!==i;++r)n[r].useCount=0;return this},update:function(t){t*=this.timeScale;for(var e=this._actions,n=this._nActiveActions,i=this.time+=t,r=Math.sign(t),o=this._accuIndex^=1,a=0;a!==n;++a){var s=e[a];s._update(i,t,r,o)}var c=this._bindings,l=this._nActiveBindings;for(a=0;a!==l;++a)c[a].apply(o);return this},getRoot:function(){return this._root},uncacheClip:function(t){var e=this._actions,n=t.uuid,i=this._actionsByClip,r=i[n];if(void 0!==r){for(var o=r.knownActions,a=0,s=o.length;a!==s;++a){var c=o[a];this._deactivateAction(c);var l=c._cacheIndex,u=e[e.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,u._cacheIndex=l,e[l]=u,e.pop(),this._removeInactiveBindingsForAction(c)}delete i[n]}},uncacheRoot:function(t){var e=t.uuid,n=this._actionsByClip;for(var i in n){var r=n[i].actionByRoot,o=r[e];void 0!==o&&(this._deactivateAction(o),this._removeInactiveAction(o))}var a=this._bindingsByRootAndName,s=a[e];if(void 0!==s)for(var c in s){var l=s[c];l.restoreOriginalState(),this._removeInactiveBinding(l)}},uncacheAction:function(t,e){var n=this.existingAction(t,e);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}),sh.prototype.clone=function(){return new sh(void 0===this.value.clone?this.value:this.value.clone())},ch.prototype=Object.assign(Object.create(us.prototype),{constructor:ch,isInstancedInterleavedBuffer:!0,copy:function(t){return us.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),Object.assign(lh.prototype,{linePrecision:1,set:function(t,e){this.ray.set(t,e)},setFromCamera:function(t,e){e&&e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize()):e&&e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld)):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(t,e,n){var i=n||[];return hh(t,this,i,e),i.sort(uh),i},intersectObjects:function(t,e,n){var i=n||[];if(!1===Array.isArray(t))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),i;for(var r=0,o=t.length;r<o;r++)hh(t[r],this,i,e);return i.sort(uh),i}}),Object.assign(ph.prototype,{set:function(t,e,n){return this.radius=t,this.phi=e,this.theta=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this},makeSafe:function(){var t=1e-6;return this.phi=Math.max(t,Math.min(Math.PI-t,this.phi)),this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,n){return this.radius=Math.sqrt(t*t+e*e+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,n),this.phi=Math.acos(Ue.clamp(e/this.radius,-1,1))),this}}),Object.assign(dh.prototype,{set:function(t,e,n){return this.radius=t,this.theta=e,this.y=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,n){return this.radius=Math.sqrt(t*t+n*n),this.theta=Math.atan2(t,n),this.y=e,this}}),Object.assign(fh.prototype,{set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(){var t=new Ge;return function(e,n){var i=t.copy(n).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(t){return void 0===t&&(console.warn("THREE.Box2: .getCenter() target is now required"),t=new Ge),this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box2: .getSize() target is now required"),t=new Ge),this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new Ge),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new Ge),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new Ge;return function(e){var n=t.copy(e).clamp(this.min,this.max);return n.sub(e).length()}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}),Object.assign(mh.prototype,{set:function(t,e){return this.start.copy(t),this.end.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},getCenter:function(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new je),t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new je),t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){return void 0===e&&(console.warn("THREE.Line3: .at() target is now required"),e=new je),this.delta(e).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(){var t=new je,e=new je;return function(n,i){t.subVectors(n,this.start),e.subVectors(this.end,this.start);var r=e.dot(e),o=e.dot(t),a=o/r;return i&&(a=Ue.clamp(a,0,1)),a}}(),closestPointToPoint:function(t,e,n){var i=this.closestPointToPointParameter(t,e);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new je),this.delta(n).multiplyScalar(i).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}}),gh.prototype=Object.create(Pr.prototype),gh.prototype.constructor=gh,gh.prototype.isImmediateRenderObject=!0,vh.prototype=Object.create(xs.prototype),vh.prototype.constructor=vh,vh.prototype.update=function(){var t=new je,e=new je,n=new Ve;return function(){var i=["a","b","c"];this.object.updateMatrixWorld(!0),n.getNormalMatrix(this.object.matrixWorld);var r=this.object.matrixWorld,o=this.geometry.attributes.position,a=this.object.geometry;if(a&&a.isGeometry)for(var s=a.vertices,c=a.faces,l=0,u=0,h=c.length;u<h;u++)for(var p=c[u],d=0,f=p.vertexNormals.length;d<f;d++){var m=s[p[i[d]]],g=p.vertexNormals[d];t.copy(m).applyMatrix4(r),e.copy(g).applyMatrix3(n).normalize().multiplyScalar(this.size).add(t),o.setXYZ(l,t.x,t.y,t.z),l+=1,o.setXYZ(l,e.x,e.y,e.z),l+=1}else if(a&&a.isBufferGeometry){var v=a.attributes.position,y=a.attributes.normal;for(l=0,d=0,f=v.count;d<f;d++)t.set(v.getX(d),v.getY(d),v.getZ(d)).applyMatrix4(r),e.set(y.getX(d),y.getY(d),y.getZ(d)),e.applyMatrix3(n).normalize().multiplyScalar(this.size).add(t),o.setXYZ(l,t.x,t.y,t.z),l+=1,o.setXYZ(l,e.x,e.y,e.z),l+=1}o.needsUpdate=!0}}(),yh.prototype=Object.create(Pr.prototype),yh.prototype.constructor=yh,yh.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},yh.prototype.update=function(){var t=new je;return function(){this.light.updateMatrixWorld();var e=this.light.distance?this.light.distance:1e3,n=e*Math.tan(this.light.angle);this.cone.scale.set(n,n,e),t.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(t),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}(),xh.prototype=Object.create(xs.prototype),xh.prototype.constructor=xh,xh.prototype.updateMatrixWorld=function(){var t=new je,e=new rn,n=new rn;return function(i){var r=this.bones,o=this.geometry,a=o.getAttribute("position");n.getInverse(this.root.matrixWorld);for(var s=0,c=0;s<r.length;s++){var l=r[s];l.parent&&l.parent.isBone&&(e.multiplyMatrices(n,l.matrixWorld),t.setFromMatrixPosition(e),a.setXYZ(c,t.x,t.y,t.z),e.multiplyMatrices(n,l.parent.matrixWorld),t.setFromMatrixPosition(e),a.setXYZ(c+1,t.x,t.y,t.z),c+=2)}o.getAttribute("position").needsUpdate=!0,Pr.prototype.updateMatrixWorld.call(this,i)}}(),wh.prototype=Object.create(oo.prototype),wh.prototype.constructor=wh,wh.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},wh.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)},_h.prototype=Object.create(bs.prototype),_h.prototype.constructor=_h,_h.prototype.update=function(){if(this.scale.set(.5*this.light.width,.5*this.light.height,1),void 0!==this.color)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);var t=this.material.color,e=Math.max(t.r,t.g,t.b);e>1&&t.multiplyScalar(1/e),this.children[0].material.color.copy(this.material.color)}},_h.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()},Mh.prototype=Object.create(Pr.prototype),Mh.prototype.constructor=Mh,Mh.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},Mh.prototype.update=function(){var t=new je,e=new wr,n=new wr;return function(){var i=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var r=i.geometry.getAttribute("color");e.copy(this.light.color),n.copy(this.light.groundColor);for(var o=0,a=r.count;o<a;o++){var s=o<a/2?e:n;r.setXYZ(o,s.r,s.g,s.b)}r.needsUpdate=!0}i.lookAt(t.setFromMatrixPosition(this.light.matrixWorld).negate())}}(),Th.prototype=Object.create(oo.prototype),Th.prototype.constructor=Th,Th.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},Th.prototype.onBeforeRender=function(){return function(){this.position.copy(this.lightProbe.position),this.scale.set(1,1,1).multiplyScalar(this.size),this.material.uniforms.intensity.value=this.lightProbe.intensity}}(),Sh.prototype=Object.assign(Object.create(xs.prototype),{constructor:Sh,copy:function(t){return xs.prototype.copy.call(this,t),this.geometry.copy(t.geometry),this.material.copy(t.material),this},clone:function(){return(new this.constructor).copy(this)}}),Eh.prototype=Object.create(xs.prototype),Eh.prototype.constructor=Eh,Ah.prototype=Object.create(bs.prototype),Ah.prototype.constructor=Ah,Ah.prototype.update=function(){var t,e,n=this.audio,i=this.range,r=this.divisionsInnerAngle,o=this.divisionsOuterAngle,a=Ue.degToRad(n.panner.coneInnerAngle),s=Ue.degToRad(n.panner.coneOuterAngle),c=a/2,l=s/2,u=0,h=0,p=this.geometry,d=p.attributes.position;function f(n,r,o,a){var s=(r-n)/o;for(d.setXYZ(u,0,0,0),h++,t=n;t<r;t+=s)e=u+h,d.setXYZ(e,Math.sin(t)*i,0,Math.cos(t)*i),d.setXYZ(e+1,Math.sin(Math.min(t+s,r))*i,0,Math.cos(Math.min(t+s,r))*i),d.setXYZ(e+2,0,0,0),h+=3;p.addGroup(u,h,a),u+=h,h=0}p.clearGroups(),f(-l,-c,o,0),f(-c,c,r,1),f(c,l,o,0),d.needsUpdate=!0,a===s&&(this.material[0].visible=!1)},Ah.prototype.dispose=function(){this.geometry.dispose(),this.material[0].dispose(),this.material[1].dispose()},Ch.prototype=Object.create(xs.prototype),Ch.prototype.constructor=Ch,Ch.prototype.update=function(){var t=new je,e=new je,n=new Ve;return function(){this.object.updateMatrixWorld(!0),n.getNormalMatrix(this.object.matrixWorld);for(var i=this.object.matrixWorld,r=this.geometry.attributes.position,o=this.object.geometry,a=o.vertices,s=o.faces,c=0,l=0,u=s.length;l<u;l++){var h=s[l],p=h.normal;t.copy(a[h.a]).add(a[h.b]).add(a[h.c]).divideScalar(3).applyMatrix4(i),e.copy(p).applyMatrix3(n).normalize().multiplyScalar(this.size).add(t),r.setXYZ(c,t.x,t.y,t.z),c+=1,r.setXYZ(c,e.x,e.y,e.z),c+=1}r.needsUpdate=!0}}(),Lh.prototype=Object.create(Pr.prototype),Lh.prototype.constructor=Lh,Lh.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},Lh.prototype.update=function(){var t=new je,e=new je,n=new je;return function(){t.setFromMatrixPosition(this.light.matrixWorld),e.setFromMatrixPosition(this.light.target.matrixWorld),n.subVectors(e,t),this.lightPlane.lookAt(e),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(e),this.targetLine.scale.z=n.length()}}(),Ph.prototype=Object.create(xs.prototype),Ph.prototype.constructor=Ph,Ph.prototype.update=function(){var t,e,n=new je,i=new $a;function r(r,o,a,s){n.set(o,a,s).unproject(i);var c=e[r];if(void 0!==c)for(var l=t.getAttribute("position"),u=0,h=c.length;u<h;u++)l.setXYZ(c[u],n.x,n.y,n.z)}return function(){t=this.geometry,e=this.pointMap;var n=1,o=1;i.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),r("c",0,0,-1),r("t",0,0,1),r("n1",-n,-o,-1),r("n2",n,-o,-1),r("n3",-n,o,-1),r("n4",n,o,-1),r("f1",-n,-o,1),r("f2",n,-o,1),r("f3",-n,o,1),r("f4",n,o,1),r("u1",.7*n,1.1*o,-1),r("u2",.7*-n,1.1*o,-1),r("u3",0,2*o,-1),r("cf1",-n,0,1),r("cf2",n,0,1),r("cf3",0,-o,1),r("cf4",0,o,1),r("cn1",-n,0,-1),r("cn2",n,0,-1),r("cn3",0,-o,-1),r("cn4",0,o,-1),t.getAttribute("position").needsUpdate=!0}}(),Rh.prototype=Object.create(xs.prototype),Rh.prototype.constructor=Rh,Rh.prototype.update=function(){var t=new Ke;return function(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&t.setFromObject(this.object),!t.isEmpty()){var n=t.min,i=t.max,r=this.geometry.attributes.position,o=r.array;o[0]=i.x,o[1]=i.y,o[2]=i.z,o[3]=n.x,o[4]=i.y,o[5]=i.z,o[6]=n.x,o[7]=n.y,o[8]=i.z,o[9]=i.x,o[10]=n.y,o[11]=i.z,o[12]=i.x,o[13]=i.y,o[14]=n.z,o[15]=n.x,o[16]=i.y,o[17]=n.z,o[18]=n.x,o[19]=n.y,o[20]=n.z,o[21]=i.x,o[22]=n.y,o[23]=n.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}}}(),Rh.prototype.setFromObject=function(t){return this.object=t,this.update(),this},Rh.prototype.copy=function(t){return xs.prototype.copy.call(this,t),this.object=t.object,this},Rh.prototype.clone=function(){return(new this.constructor).copy(this)},Oh.prototype=Object.create(xs.prototype),Oh.prototype.constructor=Oh,Oh.prototype.updateMatrixWorld=function(t){var e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),Pr.prototype.updateMatrixWorld.call(this,t))},Dh.prototype=Object.create(bs.prototype),Dh.prototype.constructor=Dh,Dh.prototype.updateMatrixWorld=function(t){var e=-this.plane.constant;Math.abs(e)<1e-8&&(e=1e-8),this.scale.set(.5*this.size,.5*this.size,e),this.children[0].material.side=e<0?v:g,this.lookAt(this.plane.normal),Pr.prototype.updateMatrixWorld.call(this,t)},Nh.prototype=Object.create(Pr.prototype),Nh.prototype.constructor=Nh,Nh.prototype.setDirection=function(){var t,e=new je;return function(n){n.y>.99999?this.quaternion.set(0,0,0,1):n.y<-.99999?this.quaternion.set(1,0,0,0):(e.set(n.z,0,-n.x).normalize(),t=Math.acos(n.y),this.quaternion.setFromAxisAngle(e,t))}}(),Nh.prototype.setLength=function(t,e,n){void 0===e&&(e=.2*t),void 0===n&&(n=.2*e),this.line.scale.set(1,Math.max(0,t-e),1),this.line.updateMatrix(),this.cone.scale.set(n,e,n),this.cone.position.y=t,this.cone.updateMatrix()},Nh.prototype.setColor=function(t){this.line.material.color.copy(t),this.cone.material.color.copy(t)},Nh.prototype.copy=function(t){return Pr.prototype.copy.call(this,t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this},Nh.prototype.clone=function(){return(new this.constructor).copy(this)},Ih.prototype=Object.create(xs.prototype),Ih.prototype.constructor=Ih;var Bh=0,kh=1;function Hh(t){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),t}function Uh(t){return void 0===t&&(t=[]),console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),t.isMultiMaterial=!0,t.materials=t,t.clone=function(){return t.slice()},t}function Gh(t,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new Ms(t,e)}function Fh(t){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new ds(t)}function jh(t,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new Ms(t,e)}function Vh(t){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new _s(t)}function Wh(t){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new _s(t)}function qh(t){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new _s(t)}function Xh(t,e,n){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new je(t,e,n)}function Yh(t,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),new Dr(t,e).setDynamic(!0)}function Jh(t,e){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new Nr(t,e)}function Zh(t,e){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new Ir(t,e)}function $h(t,e){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new zr(t,e)}function Qh(t,e){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new Br(t,e)}function Kh(t,e){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new kr(t,e)}function tp(t,e){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new Hr(t,e)}function ep(t,e){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new Ur(t,e)}function np(t,e){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new Gr(t,e)}function ip(t,e){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Fr(t,e)}function rp(t){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Ul.call(this,t),this.type="catmullrom",this.closed=!0}function op(t){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Ul.call(this,t),this.type="catmullrom"}function ap(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Ul.call(this,t),this.type="catmullrom"}function sp(t){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new Ih(t)}function cp(t,e){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new Rh(t,e)}function lp(t,e){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new xs(new Uc(t.geometry),new ys({color:void 0!==e?e:16777215}))}function up(t,e){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new xs(new Cs(t.geometry),new ys({color:void 0!==e?e:16777215}))}function hp(t){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new Sl(t)}function pp(t){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new Cl(t)}Ol.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(Ol.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},Object.assign(ou.prototype,{createPointsGeometry:function(t){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getPoints(t);return this.createGeometry(e)},createSpacedPointsGeometry:function(t){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getSpacedPoints(t);return this.createGeometry(e)},createGeometry:function(t){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var e=new Or,n=0,i=t.length;n<i;n++){var r=t[n];e.vertices.push(new je(r.x,r.y,r.z||0))}return e}}),Object.assign(au.prototype,{fromPoints:function(t){console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)}}),rp.prototype=Object.create(Ul.prototype),op.prototype=Object.create(Ul.prototype),ap.prototype=Object.create(Ul.prototype),Object.assign(ap.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),Sh.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},xh.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(zu.prototype,{extractUrlBase:function(t){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),xu.extractUrlBase(t)}}),Object.assign(Su.prototype,{setTexturePath:function(t){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(t)}}),Object.assign(fh.prototype,{center:function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},size:function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(Ke.prototype,{center:function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionSphere:function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},size:function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)}}),mh.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},Object.assign(Ue,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(t){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),Ue.floorPowerOfTwo(t)},nextPowerOfTwo:function(t){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),Ue.ceilPowerOfTwo(t)}}),Object.assign(Ve.prototype,{flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},multiplyVector3:function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBuffer:function(t){return console.warn("THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(t)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(rn.prototype,{extractPosition:function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},getPosition:function(){var t;return function(){return void 0===t&&(t=new je),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),t.setFromMatrixColumn(this,3)}}(),setRotationFromQuaternion:function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector4:function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},crossVector:function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBuffer:function(t){return console.warn("THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(t)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(t,e,n,i,r,o){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,i,n,r,o)}}),en.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},Fe.prototype.multiplyVector3=function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},Object.assign(no.prototype,{isIntersectionBox:function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionPlane:function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},isIntersectionSphere:function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}),Object.assign(io.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(t,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(t,e)},midpoint:function(t){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(t)},normal:function(t){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(t)},plane:function(t){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(t)}}),Object.assign(io,{barycoordFromPoint:function(t,e,n,i,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),io.getBarycoord(t,e,n,i,r)},normal:function(t,e,n,i){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),io.getNormal(t,e,n,i)}}),Object.assign(su.prototype,{extractAllPoints:function(t){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(t)},extrude:function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Sc(this,t)},makeGeometry:function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Bc(this,t)}}),Object.assign(Ge.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(je.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},applyProjection:function(t){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(t)},fromAttribute:function(t,e,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Ye.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Or.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}}),Object.assign(Pr.prototype,{getChildByName:function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")}}),Object.defineProperties(Pr.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.defineProperties(fs.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(gs.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),ms.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(Ol.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(t){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=t}}),Qa.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(cu.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(Dr.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")}}),Object.assign(qr.prototype,{addIndex:function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},addDrawCall:function(t,e,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")}}),Object.defineProperties(qr.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.assign(Ec.prototype,{getArrays:function(){console.error("THREE.ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeBufferGeometry: .addShape() has been removed.")}}),Object.defineProperties(sh.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(Qr.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new wr}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=t===b}}}),Object.defineProperties(Qc.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(eo.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),Object.assign(as.prototype,{clearTarget:function(t,e,n,i){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(t),this.clear(e,n,i)},animate:function(t){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(t)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")}}),Object.defineProperties(as.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(qa.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties($e.prototype,{activeCubeFace:{set:function(){console.warn("THREE.WebGLRenderTargetCube: .activeCubeFace has been removed. It is now the second parameter of WebGLRenderer.setRenderTarget().")}},activeMipMapLevel:{set:function(){console.warn("THREE.WebGLRenderTargetCube: .activeMipMapLevel has been removed. It is now the third parameter of WebGLRenderer.setRenderTarget().")}}}),Object.defineProperties(Je.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),Object.defineProperties(rs.prototype,{standing:{set:function(){console.warn("THREE.WebVRManager: .standing has been removed.")}},userHeight:{set:function(){console.warn("THREE.WebVRManager: .userHeight has been removed.")}}}),Ju.prototype.load=function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var e=this,n=new ku;return n.load(t,(function(t){e.setBuffer(t)})),this},$u.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},qu.prototype.updateCubeMap=function(t,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(t,e)};var dp={merge:function(t,e,n){var i;console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),e.isMesh&&(e.matrixAutoUpdate&&e.updateMatrix(),i=e.matrix,e=e.geometry),t.merge(e,i,n)},center:function(t){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),t.center()}};function fp(){console.error("THREE.CanvasRenderer has been removed")}function mp(){console.error("THREE.JSONLoader has been removed.")}We.crossOrigin=void 0,We.loadTexture=function(t,e,n,i){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var r=new Rl;r.setCrossOrigin(this.crossOrigin);var o=r.load(t,n,void 0,i);return e&&(o.mapping=e),o},We.loadTextureCube=function(t,e,n,i){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var r=new Pl;r.setCrossOrigin(this.crossOrigin);var o=r.load(t,n,void 0,i);return e&&(o.mapping=e),o},We.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},We.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};var gp={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")}};function vp(){console.error("THREE.LensFlare has been moved to /examples/js/objects/Lensflare.js")}},"5c6c":function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},"65f0":function(t,e,n){var i=n("861d"),r=n("e8b5"),o=n("b622"),a=o("species");t.exports=function(t,e){var n;return r(t)&&(n=t.constructor,"function"!=typeof n||n!==Array&&!r(n.prototype)?i(n)&&(n=n[a],null===n&&(n=void 0)):n=void 0),new(void 0===n?Array:n)(0===e?0:e)}},6740:function(t,e,n){n("3084"),n("4c72"),n("ed45"),n("8869"),n("3ff8"),n("916d")},"67b6":function(t,e,n){var i=n("4d4c").THREE,r=function(){this.currentName="",this.currentSystem="",this.currentPart="",this.currentSpecies="",this.metaURL="",this.viewURL="",this.groups=[],this.currentTime=0,this.timeVarying=!1,this.nerveMap=void 0,this.nerveMapIsActive=!1},o=function(t){n("7a89").RendererModule.call(this);var e=void 0,o=void 0;this.sceneData=new r;var a=new Array,c=new Array,l=new Array,u=new Array,h=t,p=this;p.typeName="Organ Viewer",this.getSceneData=function(){return p.sceneData},this.updateTime=function(t){p.sceneData.nerveMapIsActive?o&&(o.setMorphsTime(30*t),p.sceneData.nerveMap&&p.sceneData.nerveMap.additionalReader&&p.sceneData.nerveMap.additionalReader.setTime(t/100)):(e&&e.setMorphsTime(30*t),p.scene&&p.scene.setMorphsTime(30*t)),p.sceneData.currentTime=t};var d=function(){for(var t=p.zincRenderer.getCurrentTime(),n=0;n<a.length;n++)a[n](t);!p.sceneData.nerveMapIsActive&&e&&e.setMorphsTime(t),p.sceneData.nerveMap&&p.sceneData.nerveMap.additionalReader&&p.sceneData.nerveMap.additionalReader.setTime(t/3e3),p.sceneData.currentTime=t/30},f=function(){return function(){d()}};this.addTimeChangedCallback=function(t){a.push(t)},this.setTexturePos=function(t){p.sceneData.nerveMap&&p.sceneData.nerveMap.additionalReader&&p.sceneData.nerveMap.additionalReader.setSliderPos(t)},this.addLayoutUpdateRequiredCallback=function(t){layoutUpdateRequiredCallbacphysiomeportal,src,s.push(t)},this.addSceneChangedCallback=function(t){c.push(t)},this.addOrganPartAddedCallback=function(t){l.push(t)};var m=function(){return function(t,e,n){var i=p.getIntersectedObject(t);void 0!==i?i.object.name&&(void 0!==p.toolTip&&(p.toolTip.setText(i.object.name),p.toolTip.show(e,n)),p.displayMessage(i.object.name+" selected."),p.setSelectedByObjects([i.object],!0)):(void 0!==p.toolTip&&p.toolTip.hide(),p.setSelectedByObjects([],!0))}},g=function(){return function(t,e,n){var i=p.getIntersectedObject(t);if(void 0!==i){if(i.object.name)return p.displayArea.style.cursor="pointer",void 0!==p.toolTip&&(p.toolTip.setText(i.object.name),p.toolTip.show(e,n)),void p.setHighlightedByObjects([i.object],!0)}else void 0!==p.toolTip&&p.toolTip.hide(),p.displayArea.style.cursor="auto",p.setHighlightedByObjects([],!0)}},v=function(t,e,n){for(var i=t.findGeometriesWithGroupName(e),r=0;r<i.length;r++)i[r].setVisibility(n);var o=t.findGlyphsetsWithGroupName(e);for(r=0;r<o.length;r++)o[r].setVisibility(n);var a=t.findPointsetsWithGroupName(e);for(r=0;r<a.length;r++)a[r].setVisibility(n);var s=t.findLinesWithGroupName(e);for(r=0;r<s.length;r++)s[r].setVisibility(n)};this.changeOrganPartsVisibility=function(t,n){v(p.scene,t,n),e&&v(e,t,n)},this.changeOrganPartsVisibilityCallback=function(t){return function(e){p.changeOrganPartsVisibility(t,e)}};var y=function(t){return function(e){e.groupName=t,imageCombiner&&e.morph&&e.morph.material.map&&(e.morph.material.map=new i.Texture(imageCombiner.getCombinedImage()),e.morph.material.map.needsUpdate=!0,e.morph.material.needsUpdate=!0)}},b=function(){var t=p.sceneData.currentName+"_nervemap";if(o=p.zincRenderer.getSceneByName(t),void 0==o){var e=h.getOrgansDirectoryPrefix()+"/"+p.sceneData.nerveMap.threed.meta;o=p.zincRenderer.createScene(t),o.loadMetadataURL(e,y("threed")),void 0!==p.sceneData.nerveMap.threed.view?o.loadViewURL(h.getOrgansDirectoryPrefix()+"/"+p.sceneData.nerveMap.threed.view):o.loadViewURL(h.getBodyDirectoryPrefix()+"/body_view.json"),o.ambient.intensity=8,o.directionalLight.intensity=0;var i=o.getZincCameraControls();i.setMouseButtonAction("AUXILIARY","ZOOM"),i.setMouseButtonAction("SECONDARY","PAN"),p.sceneData.nerveMap.additionalReader=new(n("6fd2").VaryingTexCoordsReader)(o);var r=[h.getOrgansDirectoryPrefix()+"/digestive/stomach/nerve_map/3d/xi1_time_0.json",h.getOrgansDirectoryPrefix()+"/digestive/stomach/nerve_map/3d/xi1_time_1.json",h.getOrgansDirectoryPrefix()+"/digestive/stomach/nerve_map/3d/xi0_time_0.json"];p.sceneData.nerveMap.additionalReader.loadURLsIntoBufferGeometry(r)}p.zincRenderer.setCurrentScene(o),p.graphicsHighlight.reset()},x=function(){for(var t=0;t<u.length;t++)u[t](!1,!0)};this.changeNerveMapVisibility=function(){p.sceneData.nerveMapIsActive=!p.sceneData.nerveMapIsActive,p.sceneData.nerveMapIsActive?b():(p.zincRenderer.setCurrentScene(p.scene),p.graphicsHighlight.reset()),x()},this.changeBackgroundColour=function(t){var e=new i.Color(t);if(p.zincRenderer){var n=p.zincRenderer.getThreeJSRenderer();n.setClearColor(e,1)}};var w=function(t,e,i,r){if(r.groupName){for(var o=0;o<l.length;o++)l[o](r.groupName,p.scene.isTimeVarying());i&&h.setGeometryColour(r,t,e),p.sceneData.groups.includes(r.groupName)||p.sceneData.groups.push(r.groupName),p.displayMessage(r.groupName+" loaded.")}else p.displayMessage("Resource loaded.");var a=new(n("a0d7").annotation);a.data={species:p.sceneData.currentSpecies,system:t,part:e,group:r.groupName},r.userData=[a]},_=function(t,e,n){return function(i){w(t,e,n,i)}},M=function(){return function(){p.settingsChanged(),p.scene.viewAll(),p.sceneData.timeVarying=p.scene.isTimeVarying(),p.displayMessage("All resources loaded.")}};this.updateFieldvisibility=function(t,e){for(var n=0;n<t.length;n++)if(e!=n){var i=t[n].PartName;p.changeOrganPartsVisibility(i,!1)}if(e>-1){var r=t[e].PartName;if(p.scene.findGeometriesWithGroupName(r).length>0||p.scene.findGlyphsetsWithGroupName(r).length>0)p.changeOrganPartsVisibility(r,!0);else{var o=getOrganDetails(t[e].SystemName,r);void 0!=o&&p.scene.loadMetadataURL(h.getOrgansDirectoryPrefix()+"/"+o.meta)}}},this.getAvailableSpecies=function(t,e,n){var i=new Array;i.push("none");var r=Object.keys(organsFileMap);for(index in r){var o=r[index];o!=t&&organsFileMap[o].hasOwnProperty(e)&&organsFileMap[o][e].hasOwnProperty(n)&&i.push(o)}return i};var T=function(t,e,n,i){p.sceneData.nerveMapIsActive=!1,p.sceneData.nerveMap=void 0,p.sceneData.metaURL="",p.sceneData.viewURL="",p.sceneData.currentSpecies=t,p.sceneData.currentSystem=e,p.sceneData.currentPart=n,p.sceneData.currentTime=0,p.sceneData.groups.splice(0),p.sceneData.timeVarying=!1;var r="";t&&(r=t+"/"),e&&(r=e+"/"),n&&(r=n),p.sceneData.currentName=r};this.loadOrgansFromURL=function(t,e,n,i,r){if(p.zincRenderer&&i&&p.sceneData.metaURL!==t){T(e,n,i,void 0);var o=p.sceneData.currentName,a=p.zincRenderer.getSceneByName(o);a?a.clearAll():a=p.zincRenderer.createScene(o);for(var s=0;s<c.length;s++)c[s](p.sceneData);r&&""!=r?(p.sceneData.viewURL=r,a.loadViewURL(p.sceneData.viewURL)):p.sceneData.viewURL=void 0,p.sceneData.metaURL=t,p.displayMessage("Downloading..."),a.loadMetadataURL(t,_(n,i,!1),M()),p.scene=a,p.zincRenderer.setCurrentScene(a),p.graphicsHighlight.reset();var l=a.getZincCameraControls();l.enableRaycaster(a,m(),g()),l.setMouseButtonAction("AUXILIARY","ZOOM"),l.setMouseButtonAction("SECONDARY","PAN")}},this.alignCameraWithSelectedObject=function(t){var e=p.graphicsHighlight.getSelected();e&&e[0]&&e[0].userData&&p.scene.alignObjectToCameraView(e[0].userData,t)},this.exportSettings=function(){var t={};return t.name=p.instanceName,p.sceneData.currentSystem&&(t.system=p.sceneData.currentSystem),p.sceneData.currentSpecies&&(t.species=p.sceneData.currentSpecies),p.sceneData.currentPart&&(t.part=p.sceneData.currentPart),t.metaURL=p.sceneData.metaURL,p.sceneData.viewURL&&(t.viewURL=p.sceneData.viewURL),t.dialog="Organ Viewer",t},this.importSettings=function(t){return!(!t||t.dialog!=this.typeName)&&(p.setName(t.name),void 0!==t.metaURL&&""!=t.metaURL?p.loadOrgansFromURL(t.metaURL,t.species,t.system,t.part,t.viewURL):p.loadOrgans(t.species,t.system,t.part),!0)};var S=function(){p.initialiseRenderer(void 0),p.zincRenderer&&p.zincRenderer.addPreRenderCallbackFunction(f())};S()};o.prototype=Object.create(n("7a89").RendererModule.prototype),e.OrgansViewer=o},"69f3":function(t,e,n){var i,r,o,a=n("7f9a"),s=n("da84"),c=n("861d"),l=n("9112"),u=n("5135"),h=n("f772"),p=n("d012"),d=s.WeakMap,f=function(t){return o(t)?r(t):i(t,{})},m=function(t){return function(e){var n;if(!c(e)||(n=r(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}};if(a){var g=new d,v=g.get,y=g.has,b=g.set;i=function(t,e){return b.call(g,t,e),e},r=function(t){return v.call(g,t)||{}},o=function(t){return y.call(g,t)}}else{var x=h("state");p[x]=!0,i=function(t,e){return l(t,x,e),e},r=function(t){return u(t,x)?t[x]:{}},o=function(t){return u(t,x)}}t.exports={set:i,get:r,has:o,enforce:f,getterFor:m}},"6a51":function(t,e,n){var i,r,o;(function(a){r=[n("1157"),n("4309")],i=a,o="function"===typeof i?i.apply(e,r):i,void 0===o||(t.exports=o)})((function(t){return t.ui.plugin={add:function(e,n,i){var r,o=t.ui[e].prototype;for(r in i)o.plugins[r]=o.plugins[r]||[],o.plugins[r].push([n,i[r]])},call:function(t,e,n,i){var r,o=t.plugins[e];if(o&&(i||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(r=0;r<o.length;r++)t.options[o[r][0]]&&o[r][1].apply(t.element,n)}}}))},"6eeb":function(t,e,n){var i=n("da84"),r=n("5692"),o=n("9112"),a=n("5135"),s=n("ce4e"),c=n("9e81"),l=n("69f3"),u=l.get,h=l.enforce,p=String(c).split("toString");r("inspectSource",(function(t){return c.call(t)})),(t.exports=function(t,e,n,r){var c=!!r&&!!r.unsafe,l=!!r&&!!r.enumerable,u=!!r&&!!r.noTargetGet;"function"==typeof n&&("string"!=typeof e||a(n,"name")||o(n,"name",e),h(n).source=p.join("string"==typeof e?e:"")),t!==i?(c?!u&&t[e]&&(l=!0):delete t[e],l?t[e]=n:o(t,e,n)):l?t[e]=n:s(e,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&u(this).source||c.call(this)}))},"6f5b":function(t,e,n){var i,r,o;
|
|
92
|
-
/*!
|
|
93
|
-
* jQuery UI Button 1.12.1
|
|
94
|
-
* http://jqueryui.com
|
|
95
|
-
*
|
|
96
|
-
* Copyright jQuery Foundation and other contributors
|
|
97
|
-
* Released under the MIT license.
|
|
98
|
-
* http://jquery.org/license
|
|
99
|
-
*/(function(a){r=[n("1157"),n("bb50"),n("5130"),n("bc1c"),n("3084")],i=a,o="function"===typeof i?i.apply(e,r):i,void 0===o||(t.exports=o)})((function(t){return t.widget("ui.button",{version:"1.12.1",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var t,e=this._super()||{};return this.isInput=this.element.is("input"),t=this.element[0].disabled,null!=t&&(e.disabled=t),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(e.label=this.originalLabel),e},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(e){e.keyCode===t.ui.keyCode.SPACE&&(e.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(e,n){var i="iconPosition"!==e,r=i?this.options.iconPosition:n,o="top"===r||"bottom"===r;this.icon?i&&this._removeClass(this.icon,null,this.options.icon):(this.icon=t("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),i&&this._addClass(this.icon,null,n),this._attachIcon(r),o?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconSpace||(this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(r))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(t){this.icon[/^(?:end|bottom)/.test(t)?"before":"after"](this.iconSpace)},_attachIcon:function(t){this.element[/^(?:end|bottom)/.test(t)?"append":"prepend"](this.icon)},_setOptions:function(t){var e=void 0===t.showLabel?this.options.showLabel:t.showLabel,n=void 0===t.icon?this.options.icon:t.icon;e||n||(t.showLabel=!0),this._super(t)},_setOption:function(t,e){"icon"===t&&(e?this._updateIcon(t,e):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===t&&this._updateIcon(t,e),"showLabel"===t&&(this._toggleClass("ui-button-icon-only",null,!e),this._updateTooltip()),"label"===t&&(this.isInput?this.element.val(e):(this.element.html(e),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(t,e),"disabled"===t&&(this._toggleClass(null,"ui-state-disabled",e),this.element[0].disabled=e,e&&this.element.blur())},refresh:function(){var t=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOptions({disabled:t}),this._updateTooltip()}}),!1!==t.uiBackCompat&&(t.widget("ui.button",t.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(t,e){"text"!==t?("showLabel"===t&&(this.options.text=e),"icon"===t&&(this.options.icons.primary=e),"icons"===t&&(e.primary?(this._super("icon",e.primary),this._super("iconPosition","beginning")):e.secondary&&(this._super("icon",e.secondary),this._super("iconPosition","end"))),this._superApply(arguments)):this._super("showLabel",e)}}),t.fn.button=function(e){return function(){return!this.length||this.length&&"INPUT"!==this[0].tagName||this.length&&"INPUT"===this[0].tagName&&"checkbox"!==this.attr("type")&&"radio"!==this.attr("type")?e.apply(this,arguments):(t.ui.checkboxradio||t.error("Checkboxradio widget missing"),0===arguments.length?this.checkboxradio({icon:!1}):this.checkboxradio.apply(this,arguments))}}(t.fn.button),t.fn.buttonset=function(){return t.ui.controlgroup||t.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"===typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))}),t.ui.button}))},"6fd2":function(t,e,n){var i=n("4d4c").THREE;e.VaryingTexCoordsReader=function(t){var e=void 0,r=void 0,o=void 0,a=0,s=0,c=t,l=new i.TextureLoader,u=new l.load("models/organsViewerModels/digestive/stomach/nerve_map/texture/ratstomach_innervation_square.png");u.wrapS=i.RepeatWrapping,u.wrapT=i.RepeatWrapping,u.format=i.RGBFormat;var h=i.UniformsUtils.merge([{ambient:{type:"c",value:new i.Color(0)},diffuse:{type:"c",value:new i.Color(16777215)},emissive:{type:"c",value:new i.Color(12303291)},specular:{type:"c",value:new i.Color(1118481)},shininess:{type:"f",value:100},opacity:{type:"f",value:1},ambientLightColor:{type:"c",value:new i.Color(15790320)},directionalLightColor:{type:"c",value:new i.Color(5592405)},directionalLightDirection:{type:"v3",value:new i.Vector3},offsetRepeat:{value:new i.Vector4(0,0,1,1)},time:{type:"f",value:0},slide_pos:{type:"f",value:1},myTex:{type:"t",value:null}}]),p=function(t,e){var n=3*e.faces.length*3,o=new Float32Array(n),a=(new Float32Array(n),new Float32Array(n)),s=new Float32Array(3*e.faces.length*2);if(void 0===r&&(r=new i.BufferGeometry),e.faces.forEach((function(t,n){o[9*n+0]=e.vertices[t.a].x,o[9*n+1]=e.vertices[t.a].y,o[9*n+2]=e.vertices[t.a].z,o[9*n+3]=e.vertices[t.b].x,o[9*n+4]=e.vertices[t.b].y,o[9*n+5]=e.vertices[t.b].z,o[9*n+6]=e.vertices[t.c].x,o[9*n+7]=e.vertices[t.c].y,o[9*n+8]=e.vertices[t.c].z,a[9*n+0]=t.vertexNormals[0].x,a[9*n+1]=t.vertexNormals[0].y,a[9*n+2]=t.vertexNormals[0].z,a[9*n+3]=t.vertexNormals[1].x,a[9*n+4]=t.vertexNormals[1].y,a[9*n+5]=t.vertexNormals[1].z,a[9*n+6]=t.vertexNormals[2].x,a[9*n+7]=t.vertexNormals[2].y,a[9*n+8]=t.vertexNormals[2].z,s[6*n+0]=e.faceVertexUvs[0][n][0].x,s[6*n+1]=e.faceVertexUvs[0][n][0].y,s[6*n+2]=e.faceVertexUvs[0][n][1].x,s[6*n+3]=e.faceVertexUvs[0][n][1].y,s[6*n+4]=e.faceVertexUvs[0][n][2].x,s[6*n+5]=e.faceVertexUvs[0][n][2].y})),0==t)r.addAttribute("position",new i.BufferAttribute(o,3)),r.addAttribute("normal",new i.BufferAttribute(a,3)),r.addAttribute("uv",new i.BufferAttribute(s,2));else{var c="position_"+t,l="normal_"+t,u="uv_"+t;r.addAttribute(c,new i.BufferAttribute(o,3)),r.addAttribute(l,new i.BufferAttribute(a,3)),r.addAttribute(u,new i.BufferAttribute(s,2))}},d=function(t,e,n){var r=new i.RawShaderMaterial({vertexShader:e[0],fragmentShader:e[1],uniforms:h});r.uniforms.myTex.value=u,r.side=i.DoubleSide,r.depthTest=!0,r.needsUpdate=!0,r.map=u,r.uniforms.myTex.value.needsUpdate=!0,r.opacity=1,o=c.addZincGeometry(t,30001,void 0,void 0,!1,!1,!0,void 0,r),o.groupName="varyingTexture"},f=function(t,n){return function(i,o){var c=0;p(t,i),s++,s==a&&(d(r,n,c),void 0!=e&&"function"==typeof e&&e(r))}};this.setSliderPos=function(t){o&&(o.morph.material.uniforms.slide_pos.value=t)},this.setTime=function(t){o&&(o.morph.material.uniforms.time.value=t)},this.setTexture=function(t){o&&(o.morph.material.uniforms.myTex.value=t,o.morph.material.uniforms.myTex.value.needsUpdate=!0)},this.loadURLsIntoBufferGeometry=function(t,r,o,s){var c=new i.JSONLoader(!0);a=t.length,e=r;for(var l=[n("1823"),n("4e8a")],u=0;u<a;u++)c.load(t[u],f(u,l),o,s)}}},"721b":function(t,e,n){var i,r,o;
|
|
100
|
-
/*!
|
|
101
|
-
* jQuery UI Draggable 1.12.1
|
|
102
|
-
* http://jqueryui.com
|
|
103
|
-
*
|
|
104
|
-
* Copyright jQuery Foundation and other contributors
|
|
105
|
-
* Released under the MIT license.
|
|
106
|
-
* http://jquery.org/license
|
|
107
|
-
*/(function(a){r=[n("1157"),n("8869"),n("0ae9"),n("6a51"),n("cb0d"),n("c8cf"),n("f088"),n("4309"),n("3084")],i=a,o="function"===typeof i?i.apply(e,r):i,void 0===o||(t.exports=o)})((function(t){return t.widget("ui.draggable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){(this.helper||this.element).is(".ui-draggable-dragging")?this.destroyOnClear=!0:(this._removeHandleClassName(),this._mouseDestroy())},_mouseCapture:function(e){var n=this.options;return!(this.helper||n.disabled||t(e.target).closest(".ui-resizable-handle").length>0)&&(this.handle=this._getHandle(e),!!this.handle&&(this._blurActiveElement(e),this._blockFrames(!0===n.iframeFix?"iframe":n.iframeFix),!0))},_blockFrames:function(e){this.iframeBlocks=this.document.find(e).map((function(){var e=t(this);return t("<div>").css("position","absolute").appendTo(e.parent()).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).offset(e.offset())[0]}))},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(e){var n=t.ui.safeActiveElement(this.document[0]),i=t(e.target);i.closest(n).length||t.ui.safeBlur(n)},_mouseStart:function(e){var n=this.options;return this.helper=this._createHelper(e),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter((function(){return"fixed"===t(this).css("position")})).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(e),this.originalPosition=this.position=this._generatePosition(e,!1),this.originalPageX=e.pageX,this.originalPageY=e.pageY,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),this._setContainment(),!1===this._trigger("start",e)?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!n.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(e,n){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e,!0),this.positionAbs=this._convertPositionTo("absolute"),!n){var i=this._uiHash();if(!1===this._trigger("drag",e,i))return this._mouseUp(new t.Event("mouseup",e)),!1;this.position=i.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var n=this,i=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(i=t.ui.ddmanager.drop(this,e)),this.dropped&&(i=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!i||"valid"===this.options.revert&&i||!0===this.options.revert||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,i)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),(function(){!1!==n._trigger("stop",e)&&n._clear()})):!1!==this._trigger("stop",e)&&this._clear(),!1},_mouseUp:function(e){return this._unblockFrames(),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),this.handleElement.is(e.target)&&this.element.trigger("focus"),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new t.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(e){return!this.options.handle||!!t(e.target).closest(this.element.find(this.options.handle)).length},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(e){var n=this.options,i=t.isFunction(n.helper),r=i?t(n.helper.apply(this.element[0],[e])):"clone"===n.helper?this.element.clone().removeAttr("id"):this.element;return r.parents("body").length||r.appendTo("parent"===n.appendTo?this.element[0].parentNode:n.appendTo),i&&r[0]===this.element[0]&&this._setPositionRelative(),r[0]===this.element[0]||/(fixed|absolute)/.test(r.css("position"))||r.css("position","absolute"),r},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(e){"string"===typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var e=this.offsetParent.offset(),n=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==n&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,n,i,r=this.options,o=this.document[0];this.relativeContainer=null,r.containment?"window"!==r.containment?"document"!==r.containment?r.containment.constructor!==Array?("parent"===r.containment&&(r.containment=this.helper[0].parentNode),n=t(r.containment),i=n[0],i&&(e=/(scroll|auto)/.test(n.css("overflow")),this.containment=[(parseInt(n.css("borderLeftWidth"),10)||0)+(parseInt(n.css("paddingLeft"),10)||0),(parseInt(n.css("borderTopWidth"),10)||0)+(parseInt(n.css("paddingTop"),10)||0),(e?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(n.css("borderRightWidth"),10)||0)-(parseInt(n.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(i.scrollHeight,i.offsetHeight):i.offsetHeight)-(parseInt(n.css("borderBottomWidth"),10)||0)-(parseInt(n.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=n)):this.containment=r.containment:this.containment=[0,0,t(o).width()-this.helperProportions.width-this.margins.left,(t(o).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=null},_convertPositionTo:function(t,e){e||(e=this.position);var n="absolute"===t?1:-1,i=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*n+this.offset.parent.top*n-("fixed"===this.cssPosition?-this.offset.scroll.top:i?0:this.offset.scroll.top)*n,left:e.left+this.offset.relative.left*n+this.offset.parent.left*n-("fixed"===this.cssPosition?-this.offset.scroll.left:i?0:this.offset.scroll.left)*n}},_generatePosition:function(t,e){var n,i,r,o,a=this.options,s=this._isRootNode(this.scrollParent[0]),c=t.pageX,l=t.pageY;return s&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),e&&(this.containment&&(this.relativeContainer?(i=this.relativeContainer.offset(),n=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]):n=this.containment,t.pageX-this.offset.click.left<n[0]&&(c=n[0]+this.offset.click.left),t.pageY-this.offset.click.top<n[1]&&(l=n[1]+this.offset.click.top),t.pageX-this.offset.click.left>n[2]&&(c=n[2]+this.offset.click.left),t.pageY-this.offset.click.top>n[3]&&(l=n[3]+this.offset.click.top)),a.grid&&(r=a.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/a.grid[1])*a.grid[1]:this.originalPageY,l=n?r-this.offset.click.top>=n[1]||r-this.offset.click.top>n[3]?r:r-this.offset.click.top>=n[1]?r-a.grid[1]:r+a.grid[1]:r,o=a.grid[0]?this.originalPageX+Math.round((c-this.originalPageX)/a.grid[0])*a.grid[0]:this.originalPageX,c=n?o-this.offset.click.left>=n[0]||o-this.offset.click.left>n[2]?o:o-this.offset.click.left>=n[0]?o-a.grid[0]:o+a.grid[0]:o),"y"===a.axis&&(c=this.originalPageX),"x"===a.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top),left:c-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(e,n,i){return i=i||this._uiHash(),t.ui.plugin.call(this,e,[n,i,this],!0),/^(drag|start|stop)/.test(e)&&(this.positionAbs=this._convertPositionTo("absolute"),i.offset=this.positionAbs),t.Widget.prototype._trigger.call(this,e,n,i)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,n,i){var r=t.extend({},n,{item:i.element});i.sortables=[],t(i.options.connectToSortable).each((function(){var n=t(this).sortable("instance");n&&!n.options.disabled&&(i.sortables.push(n),n.refreshPositions(),n._trigger("activate",e,r))}))},stop:function(e,n,i){var r=t.extend({},n,{item:i.element});i.cancelHelperRemoval=!1,t.each(i.sortables,(function(){var t=this;t.isOver?(t.isOver=0,i.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,r))}))},drag:function(e,n,i){t.each(i.sortables,(function(){var r=!1,o=this;o.positionAbs=i.positionAbs,o.helperProportions=i.helperProportions,o.offset.click=i.offset.click,o._intersectsWith(o.containerCache)&&(r=!0,t.each(i.sortables,(function(){return this.positionAbs=i.positionAbs,this.helperProportions=i.helperProportions,this.offset.click=i.offset.click,this!==o&&this._intersectsWith(this.containerCache)&&t.contains(o.element[0],this.element[0])&&(r=!1),r}))),r?(o.isOver||(o.isOver=1,i._parent=n.helper.parent(),o.currentItem=n.helper.appendTo(o.element).data("ui-sortable-item",!0),o.options._helper=o.options.helper,o.options.helper=function(){return n.helper[0]},e.target=o.currentItem[0],o._mouseCapture(e,!0),o._mouseStart(e,!0,!0),o.offset.click.top=i.offset.click.top,o.offset.click.left=i.offset.click.left,o.offset.parent.left-=i.offset.parent.left-o.offset.parent.left,o.offset.parent.top-=i.offset.parent.top-o.offset.parent.top,i._trigger("toSortable",e),i.dropped=o.element,t.each(i.sortables,(function(){this.refreshPositions()})),i.currentItem=i.element,o.fromOutside=i),o.currentItem&&(o._mouseDrag(e),n.position=o.position)):o.isOver&&(o.isOver=0,o.cancelHelperRemoval=!0,o.options._revert=o.options.revert,o.options.revert=!1,o._trigger("out",e,o._uiHash(o)),o._mouseStop(e,!0),o.options.revert=o.options._revert,o.options.helper=o.options._helper,o.placeholder&&o.placeholder.remove(),n.helper.appendTo(i._parent),i._refreshOffsets(e),n.position=i._generatePosition(e,!0),i._trigger("fromSortable",e),i.dropped=!1,t.each(i.sortables,(function(){this.refreshPositions()})))}))}}),t.ui.plugin.add("draggable","cursor",{start:function(e,n,i){var r=t("body"),o=i.options;r.css("cursor")&&(o._cursor=r.css("cursor")),r.css("cursor",o.cursor)},stop:function(e,n,i){var r=i.options;r._cursor&&t("body").css("cursor",r._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,n,i){var r=t(n.helper),o=i.options;r.css("opacity")&&(o._opacity=r.css("opacity")),r.css("opacity",o.opacity)},stop:function(e,n,i){var r=i.options;r._opacity&&t(n.helper).css("opacity",r._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(t,e,n){n.scrollParentNotHidden||(n.scrollParentNotHidden=n.helper.scrollParent(!1)),n.scrollParentNotHidden[0]!==n.document[0]&&"HTML"!==n.scrollParentNotHidden[0].tagName&&(n.overflowOffset=n.scrollParentNotHidden.offset())},drag:function(e,n,i){var r=i.options,o=!1,a=i.scrollParentNotHidden[0],s=i.document[0];a!==s&&"HTML"!==a.tagName?(r.axis&&"x"===r.axis||(i.overflowOffset.top+a.offsetHeight-e.pageY<r.scrollSensitivity?a.scrollTop=o=a.scrollTop+r.scrollSpeed:e.pageY-i.overflowOffset.top<r.scrollSensitivity&&(a.scrollTop=o=a.scrollTop-r.scrollSpeed)),r.axis&&"y"===r.axis||(i.overflowOffset.left+a.offsetWidth-e.pageX<r.scrollSensitivity?a.scrollLeft=o=a.scrollLeft+r.scrollSpeed:e.pageX-i.overflowOffset.left<r.scrollSensitivity&&(a.scrollLeft=o=a.scrollLeft-r.scrollSpeed))):(r.axis&&"x"===r.axis||(e.pageY-t(s).scrollTop()<r.scrollSensitivity?o=t(s).scrollTop(t(s).scrollTop()-r.scrollSpeed):t(window).height()-(e.pageY-t(s).scrollTop())<r.scrollSensitivity&&(o=t(s).scrollTop(t(s).scrollTop()+r.scrollSpeed))),r.axis&&"y"===r.axis||(e.pageX-t(s).scrollLeft()<r.scrollSensitivity?o=t(s).scrollLeft(t(s).scrollLeft()-r.scrollSpeed):t(window).width()-(e.pageX-t(s).scrollLeft())<r.scrollSensitivity&&(o=t(s).scrollLeft(t(s).scrollLeft()+r.scrollSpeed)))),!1!==o&&t.ui.ddmanager&&!r.dropBehaviour&&t.ui.ddmanager.prepareOffsets(i,e)}}),t.ui.plugin.add("draggable","snap",{start:function(e,n,i){var r=i.options;i.snapElements=[],t(r.snap.constructor!==String?r.snap.items||":data(ui-draggable)":r.snap).each((function(){var e=t(this),n=e.offset();this!==i.element[0]&&i.snapElements.push({item:this,width:e.outerWidth(),height:e.outerHeight(),top:n.top,left:n.left})}))},drag:function(e,n,i){var r,o,a,s,c,l,u,h,p,d,f=i.options,m=f.snapTolerance,g=n.offset.left,v=g+i.helperProportions.width,y=n.offset.top,b=y+i.helperProportions.height;for(p=i.snapElements.length-1;p>=0;p--)c=i.snapElements[p].left-i.margins.left,l=c+i.snapElements[p].width,u=i.snapElements[p].top-i.margins.top,h=u+i.snapElements[p].height,v<c-m||g>l+m||b<u-m||y>h+m||!t.contains(i.snapElements[p].item.ownerDocument,i.snapElements[p].item)?(i.snapElements[p].snapping&&i.options.snap.release&&i.options.snap.release.call(i.element,e,t.extend(i._uiHash(),{snapItem:i.snapElements[p].item})),i.snapElements[p].snapping=!1):("inner"!==f.snapMode&&(r=Math.abs(u-b)<=m,o=Math.abs(h-y)<=m,a=Math.abs(c-v)<=m,s=Math.abs(l-g)<=m,r&&(n.position.top=i._convertPositionTo("relative",{top:u-i.helperProportions.height,left:0}).top),o&&(n.position.top=i._convertPositionTo("relative",{top:h,left:0}).top),a&&(n.position.left=i._convertPositionTo("relative",{top:0,left:c-i.helperProportions.width}).left),s&&(n.position.left=i._convertPositionTo("relative",{top:0,left:l}).left)),d=r||o||a||s,"outer"!==f.snapMode&&(r=Math.abs(u-y)<=m,o=Math.abs(h-b)<=m,a=Math.abs(c-g)<=m,s=Math.abs(l-v)<=m,r&&(n.position.top=i._convertPositionTo("relative",{top:u,left:0}).top),o&&(n.position.top=i._convertPositionTo("relative",{top:h-i.helperProportions.height,left:0}).top),a&&(n.position.left=i._convertPositionTo("relative",{top:0,left:c}).left),s&&(n.position.left=i._convertPositionTo("relative",{top:0,left:l-i.helperProportions.width}).left)),!i.snapElements[p].snapping&&(r||o||a||s||d)&&i.options.snap.snap&&i.options.snap.snap.call(i.element,e,t.extend(i._uiHash(),{snapItem:i.snapElements[p].item})),i.snapElements[p].snapping=r||o||a||s||d)}}),t.ui.plugin.add("draggable","stack",{start:function(e,n,i){var r,o=i.options,a=t.makeArray(t(o.stack)).sort((function(e,n){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(n).css("zIndex"),10)||0)}));a.length&&(r=parseInt(t(a[0]).css("zIndex"),10)||0,t(a).each((function(e){t(this).css("zIndex",r+e)})),this.css("zIndex",r+a.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,n,i){var r=t(n.helper),o=i.options;r.css("zIndex")&&(o._zIndex=r.css("zIndex")),r.css("zIndex",o.zIndex)},stop:function(e,n,i){var r=i.options;r._zIndex&&t(n.helper).css("zIndex",r._zIndex)}}),t.ui.draggable}))},7418:function(t,e){e.f=Object.getOwnPropertySymbols},7675:function(t,e,n){},"76bf":function(t,e,n){n("b723"),e.ToolTip=function(t){var e=void 0,n=void 0,i=void 0,r='<div class="mptooltip" id="tip"><span class="mptooltiptext" id="tiptext"> Tooltip text</span></div>';this.show=function(t,r){e.style.left=t+"px",e.style.top=r-20+"px",n.style.visibility="visible",n.style.opacity=1,i.style.visibility="visible",i.style.opacity=1},this.hide=function(){n.style.visibility="hidden",n.style.opacity=0,i.style.visibility="hidden",i.style.opacity=0},this.setText=function(t){i.innerHTML=t};var o=function(){e=document.createElement("div"),e.id="tooltipcontainer",e.innerHTML=r,n=e.querySelector("#tip"),i=e.querySelector("#tiptext"),t.appendChild(e)};o()}},7839:function(t,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"7a89":function(t,e,n){var i=n("4d4c").THREE,r=function(){n("3966").BaseModule.call(this),this.scene=void 0,this.toolTip=void 0,this.rendererContainer=void 0,this.displayArea=void 0,this.graphicsHighlight=new(n("8cec").GraphicsHighlight),this.zincRenderer=null};r.prototype=Object.create(n("3966").BaseModule.prototype),r.prototype.getIntersectedObject=function(t){if(t){for(var e=void 0,n=0;n<t.length;n++)if(void 0!==t[n]&&t[n].object&&t[n].object.name&&(void 0===e&&(e=t[n]),t[n].object.userData&&void 0!==t[n].object.userData.isGlyph))return t[n];return e}},r.prototype.getAnnotationsFromObjects=function(t){for(var e=[],n=0;n<t.length;n++){var i=t[n].userData,r=void 0;i&&(i.isGlyph?(r=i.getGlyphset().userData?i.getGlyphset().userData[0]:void 0,r&&r.data&&(r.data.id=t[n].name)):(r=i.userData?i.userData[0]:void 0,r&&r.data&&(r.data.id=t[n].name))),e[n]=r}return e},r.prototype.setHighlightedByObjects=function(t,e){var i=this.graphicsHighlight.setHighlighted(t);if(i&&e){var r=n("549c").EVENT_TYPE.HIGHLIGHTED,o=this.getAnnotationsFromObjects(t);this.publishChanges(o,r)}return i},r.prototype.setSelectedByObjects=function(t,e){var i=this.graphicsHighlight.setSelected(t);if(i&&e){var r=n("549c").EVENT_TYPE.SELECTED,o=this.getAnnotationsFromObjects(t);this.publishChanges(o,r)}return i};var o=function(t){return function(e){t.push(e.getMesh())}};r.prototype.findObjectsByGroupName=function(t){for(var e=this.scene.findGeometriesWithGroupName(t),n=[],i=0;i<e.length;i++)n.push(e[i].morph);var r=this.scene.findGlyphsetsWithGroupName(t);for(i=0;i<r.length;i++)r[i].forEachGlyph(o(n));return n},r.prototype.setHighlightedByGroupName=function(t,e){var n=this.findObjectsByGroupName(t);return this.setHighlightedByObjects(n,e)},r.prototype.setSelectedByGroupName=function(t,e){var n=this.findObjectsByGroupName(t);return this.setSelectedByObjects(n,e)},r.prototype.changeBackgroundColour=function(t){var e=new i.Color(t);if(this.zincRenderer){var n=this.zincRenderer.getThreeJSRenderer();n.setClearColor(e,1)}},r.prototype.resetView=function(){this.zincRenderer&&this.zincRenderer.resetView()},r.prototype.viewAll=function(){this.zincRenderer&&this.zincRenderer.viewAll()},r.prototype.playAnimation=function(t){this.zincRenderer&&(this.zincRenderer.playAnimation=t)},r.prototype.setPlayRate=function(t){this.zincRenderer&&this.zincRenderer.setPlayRate(t)},r.prototype.getPlayRate=function(t){return this.zincRenderer?this.zincRenderer.getPlayRate():0},r.prototype.initialiseRenderer=function(t){if(void 0===this.zincRenderer||void 0===this.rendererContainer){var e=n("5694").createRenderer();this.zincRenderer=e["renderer"],this.rendererContainer=e["container"]}t&&(this.displayArea=t,this.displayArea.appendChild(this.rendererContainer),this.zincRenderer&&(this.zincRenderer.animate(),void 0===this.toolTip&&(this.toolTip=new(n("76bf").ToolTip)(this.displayArea))))},r.prototype.destroy=function(){this.zincRenderer&&(this.zincRenderer.dispose(),this.zincRenderer.getThreeJSRenderer().dispose(),this.zincRenderer=void 0),n("3966").BaseModule.prototype.destroy.call(this)},e.RendererModule=r},"7b0b":function(t,e,n){var i=n("1d80");t.exports=function(t){return Object(i(t))}},"7f9a":function(t,e,n){var i=n("da84"),r=n("9e81"),o=i.WeakMap;t.exports="function"===typeof o&&/native code/.test(r.call(o))},"825a":function(t,e,n){var i=n("861d");t.exports=function(t){if(!i(t))throw TypeError(String(t)+" is not an object");return t}},"83ab":function(t,e,n){var i=n("d039");t.exports=!i((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},"83ef":function(t,e,n){var i,r,o;
|
|
108
|
-
/*!
|
|
109
|
-
* jQuery UI Selectable 1.12.1
|
|
110
|
-
* http://jqueryui.com
|
|
111
|
-
*
|
|
112
|
-
* Copyright jQuery Foundation and other contributors
|
|
113
|
-
* Released under the MIT license.
|
|
114
|
-
* http://jquery.org/license
|
|
115
|
-
*/(function(a){r=[n("1157"),n("8869"),n("4309"),n("3084")],i=a,o="function"===typeof i?i.apply(e,r):i,void 0===o||(t.exports=o)})((function(t){return t.widget("ui.selectable",t.ui.mouse,{version:"1.12.1",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var e=this;this._addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){e.elementPos=t(e.element[0]).offset(),e.selectees=t(e.options.filter,e.element[0]),e._addClass(e.selectees,"ui-selectee"),e.selectees.each((function(){var n=t(this),i=n.offset(),r={left:i.left-e.elementPos.left,top:i.top-e.elementPos.top};t.data(this,"selectable-item",{element:this,$element:n,left:r.left,top:r.top,right:r.left+n.outerWidth(),bottom:r.top+n.outerHeight(),startselected:!1,selected:n.hasClass("ui-selected"),selecting:n.hasClass("ui-selecting"),unselecting:n.hasClass("ui-unselecting")})}))},this.refresh(),this._mouseInit(),this.helper=t("<div>"),this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item"),this._mouseDestroy()},_mouseStart:function(e){var n=this,i=this.options;this.opos=[e.pageX,e.pageY],this.elementPos=t(this.element[0]).offset(),this.options.disabled||(this.selectees=t(i.filter,this.element[0]),this._trigger("start",e),t(i.appendTo).append(this.helper),this.helper.css({left:e.pageX,top:e.pageY,width:0,height:0}),i.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each((function(){var i=t.data(this,"selectable-item");i.startselected=!0,e.metaKey||e.ctrlKey||(n._removeClass(i.$element,"ui-selected"),i.selected=!1,n._addClass(i.$element,"ui-unselecting"),i.unselecting=!0,n._trigger("unselecting",e,{unselecting:i.element}))})),t(e.target).parents().addBack().each((function(){var i,r=t.data(this,"selectable-item");if(r)return i=!e.metaKey&&!e.ctrlKey||!r.$element.hasClass("ui-selected"),n._removeClass(r.$element,i?"ui-unselecting":"ui-selected")._addClass(r.$element,i?"ui-selecting":"ui-unselecting"),r.unselecting=!i,r.selecting=i,r.selected=i,i?n._trigger("selecting",e,{selecting:r.element}):n._trigger("unselecting",e,{unselecting:r.element}),!1})))},_mouseDrag:function(e){if(this.dragged=!0,!this.options.disabled){var n,i=this,r=this.options,o=this.opos[0],a=this.opos[1],s=e.pageX,c=e.pageY;return o>s&&(n=s,s=o,o=n),a>c&&(n=c,c=a,a=n),this.helper.css({left:o,top:a,width:s-o,height:c-a}),this.selectees.each((function(){var n=t.data(this,"selectable-item"),l=!1,u={};n&&n.element!==i.element[0]&&(u.left=n.left+i.elementPos.left,u.right=n.right+i.elementPos.left,u.top=n.top+i.elementPos.top,u.bottom=n.bottom+i.elementPos.top,"touch"===r.tolerance?l=!(u.left>s||u.right<o||u.top>c||u.bottom<a):"fit"===r.tolerance&&(l=u.left>o&&u.right<s&&u.top>a&&u.bottom<c),l?(n.selected&&(i._removeClass(n.$element,"ui-selected"),n.selected=!1),n.unselecting&&(i._removeClass(n.$element,"ui-unselecting"),n.unselecting=!1),n.selecting||(i._addClass(n.$element,"ui-selecting"),n.selecting=!0,i._trigger("selecting",e,{selecting:n.element}))):(n.selecting&&((e.metaKey||e.ctrlKey)&&n.startselected?(i._removeClass(n.$element,"ui-selecting"),n.selecting=!1,i._addClass(n.$element,"ui-selected"),n.selected=!0):(i._removeClass(n.$element,"ui-selecting"),n.selecting=!1,n.startselected&&(i._addClass(n.$element,"ui-unselecting"),n.unselecting=!0),i._trigger("unselecting",e,{unselecting:n.element}))),n.selected&&(e.metaKey||e.ctrlKey||n.startselected||(i._removeClass(n.$element,"ui-selected"),n.selected=!1,i._addClass(n.$element,"ui-unselecting"),n.unselecting=!0,i._trigger("unselecting",e,{unselecting:n.element})))))})),!1}},_mouseStop:function(e){var n=this;return this.dragged=!1,t(".ui-unselecting",this.element[0]).each((function(){var i=t.data(this,"selectable-item");n._removeClass(i.$element,"ui-unselecting"),i.unselecting=!1,i.startselected=!1,n._trigger("unselected",e,{unselected:i.element})})),t(".ui-selecting",this.element[0]).each((function(){var i=t.data(this,"selectable-item");n._removeClass(i.$element,"ui-selecting")._addClass(i.$element,"ui-selected"),i.selecting=!1,i.selected=!0,i.startselected=!0,n._trigger("selected",e,{selected:i.element})})),this._trigger("stop",e),this.helper.remove(),!1}})}))},8501:function(t,e,n){n("3084"),n("0ae9"),n("4c72"),n("f088"),n("36fa"),n("8869"),n("3ff8"),n("21a3")},"861d":function(t,e){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},8869:function(t,e,n){var i,r,o;
|
|
116
|
-
/*!
|
|
117
|
-
* jQuery UI Mouse 1.12.1
|
|
118
|
-
* http://jqueryui.com
|
|
119
|
-
*
|
|
120
|
-
* Copyright jQuery Foundation and other contributors
|
|
121
|
-
* Released under the MIT license.
|
|
122
|
-
* http://jquery.org/license
|
|
123
|
-
*/(function(a){r=[n("1157"),n("3478"),n("4309"),n("3084")],i=a,o="function"===typeof i?i.apply(e,r):i,void 0===o||(t.exports=o)})((function(t){var e=!1;return t(document).on("mouseup",(function(){e=!1})),t.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,(function(t){return e._mouseDown(t)})).on("click."+this.widgetName,(function(n){if(!0===t.data(n.target,e.widgetName+".preventClickEvent"))return t.removeData(n.target,e.widgetName+".preventClickEvent"),n.stopImmediatePropagation(),!1})),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(n){if(!e){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(n),this._mouseDownEvent=n;var i=this,r=1===n.which,o=!("string"!==typeof this.options.cancel||!n.target.nodeName)&&t(n.target).closest(this.options.cancel).length;return!(r&&!o&&this._mouseCapture(n))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout((function(){i.mouseDelayMet=!0}),this.options.delay)),this._mouseDistanceMet(n)&&this._mouseDelayMet(n)&&(this._mouseStarted=!1!==this._mouseStart(n),!this._mouseStarted)?(n.preventDefault(),!0):(!0===t.data(n.target,this.widgetName+".preventClickEvent")&&t.removeData(n.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return i._mouseMove(t)},this._mouseUpDelegate=function(t){return i._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),n.preventDefault(),e=!0,!0))}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||document.documentMode<9)&&!e.button)return this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,e),this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(n){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,n.target===this._mouseDownEvent.target&&t.data(n.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(n)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,e=!1,n.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})}))},"8bbf":function(e,n){e.exports=t},"8cec":function(t,e,n){var i=n("4d4c").THREE;e.GraphicsHighlight=function(){var t=[],e=[];this.highlightColour=255,this.selectColour=65280,this.originalColour=0;var n=this,r=function(t,e){if(0==t.length&&0==e.length)return!1;for(var n=0;n<t.length;n++){for(var i=!1,r=0;r<e.length;r++)t[n]===e[r]&&(i=!0);if(!i)return!0}for(n=0;n<e.length;n++){for(i=!1,r=0;r<t.length;r++)e[n]===t[r]&&(i=!0);if(!i)return!0}return!1},o=function(t,e){var n=[];if(0==e.length)return t;for(var i=0;i<t.length;i++){for(var r=!1,o=0;o<e.length;o++)t[i]===e[o]&&(r=!0);r||n.push(t[i])}return n};this.setHighlighted=function(i){var a=t;n.resetHighlighted();for(var s=o(i,e),c=0;c<s.length;c++)s[c]&&s[c].material&&s[c].material.emissive&&s[c].material.emissive.setHex(n.highlightColour);return t=s,r(t,a)},this.resetHighlighted=function(){for(var e=0;e<t.length;e++)t[e].material.emissive&&t[e].material.emissive.setHex(n.originalColour),t[e].material.depthFunc&&(t[e].material.depthFunc=i.LessEqualDepth);t=[]},this.resetSelected=function(){for(var t=0;t<e.length;t++)e[t]&&e[t].material&&(e[t].material.emissive&&e[t].material.emissive.setHex(n.originalColour),e[t].material.depthFunc&&(e[t].material.depthFunc=i.LessEqualDepth));e=[]},this.setSelected=function(i){var a=e,s=o(t,i);t=s,n.resetSelected();for(var c=0;c<i.length;c++)i[c]&&i[c].material&&i[c].material.emissive&&i[c].material.emissive.setHex(n.selectColour);return e=i,r(e,a)},this.getSelected=function(){return e},this.reset=function(){n.resetSelected(),n.resetHighlighted()}}},9025:function(t,e,n){var i,r,o;
|
|
124
|
-
/*!
|
|
125
|
-
* jQuery UI Droppable 1.12.1
|
|
126
|
-
* http://jqueryui.com
|
|
127
|
-
*
|
|
128
|
-
* Copyright jQuery Foundation and other contributors
|
|
129
|
-
* Released under the MIT license.
|
|
130
|
-
* http://jquery.org/license
|
|
131
|
-
*/(function(a){r=[n("1157"),n("721b"),n("8869"),n("4309"),n("3084")],i=a,o="function"===typeof i?i.apply(e,r):i,void 0===o||(t.exports=o)})((function(t){t.widget("ui.droppable",{version:"1.12.1",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e,n=this.options,i=n.accept;this.isover=!1,this.isout=!0,this.accept=t.isFunction(i)?i:function(t){return t.is(i)},this.proportions=function(){if(!arguments.length)return e||(e={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight});e=arguments[0]},this._addToManager(n.scope),n.addClasses&&this._addClass("ui-droppable")},_addToManager:function(e){t.ui.ddmanager.droppables[e]=t.ui.ddmanager.droppables[e]||[],t.ui.ddmanager.droppables[e].push(this)},_splice:function(t){for(var e=0;e<t.length;e++)t[e]===this&&t.splice(e,1)},_destroy:function(){var e=t.ui.ddmanager.droppables[this.options.scope];this._splice(e)},_setOption:function(e,n){if("accept"===e)this.accept=t.isFunction(n)?n:function(t){return t.is(n)};else if("scope"===e){var i=t.ui.ddmanager.droppables[this.options.scope];this._splice(i),this._addToManager(n)}this._super(e,n)},_activate:function(e){var n=t.ui.ddmanager.current;this._addActiveClass(),n&&this._trigger("activate",e,this.ui(n))},_deactivate:function(e){var n=t.ui.ddmanager.current;this._removeActiveClass(),n&&this._trigger("deactivate",e,this.ui(n))},_over:function(e){var n=t.ui.ddmanager.current;n&&(n.currentItem||n.element)[0]!==this.element[0]&&this.accept.call(this.element[0],n.currentItem||n.element)&&(this._addHoverClass(),this._trigger("over",e,this.ui(n)))},_out:function(e){var n=t.ui.ddmanager.current;n&&(n.currentItem||n.element)[0]!==this.element[0]&&this.accept.call(this.element[0],n.currentItem||n.element)&&(this._removeHoverClass(),this._trigger("out",e,this.ui(n)))},_drop:function(n,i){var r=i||t.ui.ddmanager.current,o=!1;return!(!r||(r.currentItem||r.element)[0]===this.element[0])&&(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each((function(){var i=t(this).droppable("instance");if(i.options.greedy&&!i.options.disabled&&i.options.scope===r.options.scope&&i.accept.call(i.element[0],r.currentItem||r.element)&&e(r,t.extend(i,{offset:i.element.offset()}),i.options.tolerance,n))return o=!0,!1})),!o&&(!!this.accept.call(this.element[0],r.currentItem||r.element)&&(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",n,this.ui(r)),this.element)))},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}});var e=t.ui.intersect=function(){function t(t,e,n){return t>=e&&t<e+n}return function(e,n,i,r){if(!n.offset)return!1;var o=(e.positionAbs||e.position.absolute).left+e.margins.left,a=(e.positionAbs||e.position.absolute).top+e.margins.top,s=o+e.helperProportions.width,c=a+e.helperProportions.height,l=n.offset.left,u=n.offset.top,h=l+n.proportions().width,p=u+n.proportions().height;switch(i){case"fit":return l<=o&&s<=h&&u<=a&&c<=p;case"intersect":return l<o+e.helperProportions.width/2&&s-e.helperProportions.width/2<h&&u<a+e.helperProportions.height/2&&c-e.helperProportions.height/2<p;case"pointer":return t(r.pageY,u,n.proportions().height)&&t(r.pageX,l,n.proportions().width);case"touch":return(a>=u&&a<=p||c>=u&&c<=p||a<u&&c>p)&&(o>=l&&o<=h||s>=l&&s<=h||o<l&&s>h);default:return!1}}}();return t.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(e,n){var i,r,o=t.ui.ddmanager.droppables[e.options.scope]||[],a=n?n.type:null,s=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();t:for(i=0;i<o.length;i++)if(!(o[i].options.disabled||e&&!o[i].accept.call(o[i].element[0],e.currentItem||e.element))){for(r=0;r<s.length;r++)if(s[r]===o[i].element[0]){o[i].proportions().height=0;continue t}o[i].visible="none"!==o[i].element.css("display"),o[i].visible&&("mousedown"===a&&o[i]._activate.call(o[i],n),o[i].offset=o[i].element.offset(),o[i].proportions({width:o[i].element[0].offsetWidth,height:o[i].element[0].offsetHeight}))}},drop:function(n,i){var r=!1;return t.each((t.ui.ddmanager.droppables[n.options.scope]||[]).slice(),(function(){this.options&&(!this.options.disabled&&this.visible&&e(n,this,this.options.tolerance,i)&&(r=this._drop.call(this,i)||r),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],n.currentItem||n.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))})),r},dragStart:function(e,n){e.element.parentsUntil("body").on("scroll.droppable",(function(){e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,n)}))},drag:function(n,i){n.options.refreshPositions&&t.ui.ddmanager.prepareOffsets(n,i),t.each(t.ui.ddmanager.droppables[n.options.scope]||[],(function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var r,o,a,s=e(n,this,this.options.tolerance,i),c=!s&&this.isover?"isout":s&&!this.isover?"isover":null;c&&(this.options.greedy&&(o=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter((function(){return t(this).droppable("instance").options.scope===o})),a.length&&(r=t(a[0]).droppable("instance"),r.greedyChild="isover"===c)),r&&"isover"===c&&(r.isover=!1,r.isout=!0,r._out.call(r,i)),this[c]=!0,this["isout"===c?"isover":"isout"]=!1,this["isover"===c?"_over":"_out"].call(this,i),r&&"isout"===c&&(r.isout=!1,r.isover=!0,r._over.call(r,i)))}}))},dragStop:function(e,n){e.element.parentsUntil("body").off("scroll.droppable"),e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,n)}},!1!==t.uiBackCompat&&t.widget("ui.droppable",t.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super(),this.options.activeClass&&this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super(),this.options.activeClass&&this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super(),this.options.hoverClass&&this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super(),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass)}}),t.ui.droppable}))},"90e3":function(t,e){var n=0,i=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++n+i).toString(36)}},9112:function(t,e,n){var i=n("83ab"),r=n("9bf2"),o=n("5c6c");t.exports=i?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},"916d":function(t,e,n){},"94ca":function(t,e,n){var i=n("d039"),r=/#|\.prototype\./,o=function(t,e){var n=s[a(t)];return n==l||n!=c&&("function"==typeof e?i(e):!!e)},a=o.normalize=function(t){return String(t).replace(r,".").toLowerCase()},s=o.data={},c=o.NATIVE="N",l=o.POLYFILL="P";t.exports=o},"9bf2":function(t,e,n){var i=n("83ab"),r=n("0cfb"),o=n("825a"),a=n("c04e"),s=Object.defineProperty;e.f=i?s:function(t,e,n){if(o(t),e=a(e,!0),o(n),r)try{return s(t,e,n)}catch(i){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},"9e81":function(t,e,n){var i=n("5692");t.exports=i("native-function-to-string",Function.toString)},a0d7:function(t,e){e.annotation=function(){this.type="anatomical",this.data=void 0,this.isAnnotation=!0}},a5a8:function(t,e,n){n("3084"),n("0ae9"),n("f088"),n("721b"),n("8869"),n("3ff8"),n("0773")},a691:function(t,e){var n=Math.ceil,i=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?i:n)(t)}},ae69:function(t,e,n){function i(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.i=function(t){return t},n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n.oe=function(t){throw console.error(t),t};var i=n(n.s=ENTRY_MODULE);return i.default||i}var r="[\\.|\\-|\\+|\\w|/|@]+",o="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+r+").*?\\)";function a(t){return(t+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function s(t){return!isNaN(1*t)}function c(t,e,i){var c={};c[i]=[];var l=e.toString(),u=l.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!u)return c;var h,p=u[1],d=new RegExp("(\\\\n|\\W)"+a(p)+o,"g");while(h=d.exec(l))"dll-reference"!==h[3]&&c[i].push(h[3]);d=new RegExp("\\("+a(p)+'\\("(dll-reference\\s('+r+'))"\\)\\)'+o,"g");while(h=d.exec(l))t[h[2]]||(c[i].push(h[1]),t[h[2]]=n(h[1]).m),c[h[2]]=c[h[2]]||[],c[h[2]].push(h[4]);for(var f=Object.keys(c),m=0;m<f.length;m++)for(var g=0;g<c[f[m]].length;g++)s(c[f[m]][g])&&(c[f[m]][g]=1*c[f[m]][g]);return c}function l(t){var e=Object.keys(t);return e.reduce((function(e,n){return e||t[n].length>0}),!1)}function u(t,e){var n={main:[e]},i={main:[]},r={main:{}};while(l(n))for(var o=Object.keys(n),a=0;a<o.length;a++){var s=o[a],u=n[s],h=u.pop();if(r[s]=r[s]||{},!r[s][h]&&t[s][h]){r[s][h]=!0,i[s]=i[s]||[],i[s].push(h);for(var p=c(t,t[s][h],s),d=Object.keys(p),f=0;f<d.length;f++)n[d[f]]=n[d[f]]||[],n[d[f]]=n[d[f]].concat(p[d[f]])}}return i}t.exports=function(t,e){e=e||{};var r={main:n.m},o=e.all?{main:Object.keys(r.main)}:u(r,t),a="";Object.keys(o).filter((function(t){return"main"!==t})).forEach((function(t){var e=0;while(o[t][e])e++;o[t].push(e),r[t][e]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",a=a+"var "+t+" = ("+i.toString().replace("ENTRY_MODULE",JSON.stringify(e))+")({"+o[t].map((function(e){return JSON.stringify(e)+": "+r[t][e].toString()})).join(",")+"});\n"})),a=a+"new (("+i.toString().replace("ENTRY_MODULE",JSON.stringify(t))+")({"+o.main.map((function(t){return JSON.stringify(t)+": "+r.main[t].toString()})).join(",")+"}))(self);";var s=new window.Blob([a],{type:"text/javascript"});if(e.bare)return s;var c=window.URL||window.webkitURL||window.mozURL||window.msURL,l=c.createObjectURL(s),h=new window.Worker(l);return h.objectURL=l,h}},af5e:function(t,e,n){var i,r,o;
|
|
132
|
-
/*!
|
|
133
|
-
* jQuery UI Labels 1.12.1
|
|
134
|
-
* http://jqueryui.com
|
|
135
|
-
*
|
|
136
|
-
* Copyright jQuery Foundation and other contributors
|
|
137
|
-
* Released under the MIT license.
|
|
138
|
-
* http://jquery.org/license
|
|
139
|
-
*/(function(a){r=[n("1157"),n("4309"),n("182f")],i=a,o="function"===typeof i?i.apply(e,r):i,void 0===o||(t.exports=o)})((function(t){return t.fn.labels=function(){var e,n,i,r,o;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(r=this.eq(0).parents("label"),i=this.attr("id"),i&&(e=this.eq(0).parents().last(),o=e.add(e.length?e.siblings():this.siblings()),n="label[for='"+t.ui.escapeSelector(i)+"']",r=r.add(o.find(n).addBack(n))),this.pushStack(r))}}))},b301:function(t,e,n){"use strict";var i=n("d039");t.exports=function(t,e){var n=[][t];return!n||!i((function(){n.call(null,e||function(){throw 1},1)}))}},b622:function(t,e,n){var i=n("da84"),r=n("5692"),o=n("90e3"),a=n("4930"),s=i.Symbol,c=r("wks");t.exports=function(t){return c[t]||(c[t]=a&&s[t]||(a?s:o)("Symbol."+t))}},b64b:function(t,e,n){var i=n("23e7"),r=n("7b0b"),o=n("df75"),a=n("d039"),s=a((function(){o(1)}));i({target:"Object",stat:!0,forced:s},{keys:function(t){return o(r(t))}})},b723:function(t,e,n){},b727:function(t,e,n){var i=n("f8c2"),r=n("44ad"),o=n("7b0b"),a=n("50c4"),s=n("65f0"),c=[].push,l=function(t){var e=1==t,n=2==t,l=3==t,u=4==t,h=6==t,p=5==t||h;return function(d,f,m,g){for(var v,y,b=o(d),x=r(b),w=i(f,m,3),_=a(x.length),M=0,T=g||s,S=e?T(d,_):n?T(d,0):void 0;_>M;M++)if((p||M in x)&&(v=x[M],y=w(v,M,b),t))if(e)S[M]=y;else if(y)switch(t){case 3:return!0;case 5:return v;case 6:return M;case 2:c.call(S,v)}else if(u)return!1;return h?-1:l||u?u:S}};t.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6)}},bb50:function(t,e,n){var i,r,o;
|
|
140
|
-
/*!
|
|
141
|
-
* jQuery UI Controlgroup 1.12.1
|
|
142
|
-
* http://jqueryui.com
|
|
143
|
-
*
|
|
144
|
-
* Copyright jQuery Foundation and other contributors
|
|
145
|
-
* Released under the MIT license.
|
|
146
|
-
* http://jquery.org/license
|
|
147
|
-
*/(function(a){r=[n("1157"),n("3084")],i=a,o="function"===typeof i?i.apply(e,r):i,void 0===o||(t.exports=o)})((function(t){var e=/ui-corner-([a-z]){2,6}/g;return t.widget("ui.controlgroup",{version:"1.12.1",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var e=this,n=[];t.each(this.options.items,(function(i,r){var o,a={};if(r)return"controlgroupLabel"===i?(o=e.element.find(r),o.each((function(){var e=t(this);e.children(".ui-controlgroup-label-contents").length||e.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")})),e._addClass(o,null,"ui-widget ui-widget-content ui-state-default"),void(n=n.concat(o.get()))):void(t.fn[i]&&(a=e["_"+i+"Options"]?e["_"+i+"Options"]("middle"):{classes:{}},e.element.find(r).each((function(){var r=t(this),o=r[i]("instance"),s=t.widget.extend({},a);if("button"!==i||!r.parent(".ui-spinner").length){o||(o=r[i]()[i]("instance")),o&&(s.classes=e._resolveClassesValues(s.classes,o)),r[i](s);var c=r[i]("widget");t.data(c[0],"ui-controlgroup-data",o||r[i]("instance")),n.push(c[0])}}))))})),this.childWidgets=t(t.unique(n)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each((function(){var n=t(this),i=n.data("ui-controlgroup-data");i&&i[e]&&i[e]()}))},_updateCornerClass:function(t,e){var n="ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all",i=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,n),this._addClass(t,null,i)},_buildSimpleOptions:function(t,e){var n="vertical"===this.options.direction,i={classes:{}};return i.classes[e]={middle:"",first:"ui-corner-"+(n?"top":"left"),last:"ui-corner-"+(n?"bottom":"right"),only:"ui-corner-all"}[t],i},_spinnerOptions:function(t){var e=this._buildSimpleOptions(t,"ui-spinner");return e.classes["ui-spinner-up"]="",e.classes["ui-spinner-down"]="",e},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e="vertical"===this.options.direction;return{width:!!e&&"auto",classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(n,i){var r={};return t.each(n,(function(o){var a=i.options.classes[o]||"";a=t.trim(a.replace(e,"")),r[o]=(a+" "+n[o]).replace(/\s+/g," ")})),r},_setOption:function(t,e){"direction"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(t,e),"disabled"!==t?this.refresh():this._callChildMethod(e?"disable":"enable")},refresh:function(){var e,n=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),e=this.childWidgets,this.options.onlyVisible&&(e=e.filter(":visible")),e.length&&(t.each(["first","last"],(function(t,i){var r=e[i]().data("ui-controlgroup-data");if(r&&n["_"+r.widgetName+"Options"]){var o=n["_"+r.widgetName+"Options"](1===e.length?"only":i);o.classes=n._resolveClassesValues(o.classes,r),r.element[r.widgetName](o)}else n._updateCornerClass(e[i](),i)})),this._callChildMethod("refresh"))}})}))},bc1c:function(t,e,n){var i,r,o;
|
|
148
|
-
/*!
|
|
149
|
-
* jQuery UI Keycode 1.12.1
|
|
150
|
-
* http://jqueryui.com
|
|
151
|
-
*
|
|
152
|
-
* Copyright jQuery Foundation and other contributors
|
|
153
|
-
* Released under the MIT license.
|
|
154
|
-
* http://jquery.org/license
|
|
155
|
-
*/(function(a){r=[n("1157"),n("4309")],i=a,o="function"===typeof i?i.apply(e,r):i,void 0===o||(t.exports=o)})((function(t){return t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}))},c04e:function(t,e,n){var i=n("861d");t.exports=function(t,e){if(!i(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!i(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},c430:function(t,e){t.exports=!1},c6b6:function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},c6cd:function(t,e,n){var i=n("da84"),r=n("ce4e"),o="__core-js_shared__",a=i[o]||r(o,{});t.exports=a},c8ba:function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(i){"object"===typeof window&&(n=window)}t.exports=n},c8cf:function(t,e,n){var i,r,o;(function(a){r=[n("1157"),n("4309")],i=a,o="function"===typeof i?i.apply(e,r):i,void 0===o||(t.exports=o)})((function(t){return t.ui.safeBlur=function(e){e&&"body"!==e.nodeName.toLowerCase()&&t(e).trigger("blur")}}))},c9bc:function(t,e,n){var i,r,o;
|
|
156
|
-
/*!
|
|
157
|
-
* jQuery UI Focusable 1.12.1
|
|
158
|
-
* http://jqueryui.com
|
|
159
|
-
*
|
|
160
|
-
* Copyright jQuery Foundation and other contributors
|
|
161
|
-
* Released under the MIT license.
|
|
162
|
-
* http://jquery.org/license
|
|
163
|
-
*/(function(a){r=[n("1157"),n("4309")],i=a,o="function"===typeof i?i.apply(e,r):i,void 0===o||(t.exports=o)})((function(t){function e(t){var e=t.css("visibility");while("inherit"===e)t=t.parent(),e=t.css("visibility");return"hidden"!==e}return t.ui.focusable=function(n,i){var r,o,a,s,c,l=n.nodeName.toLowerCase();return"area"===l?(r=n.parentNode,o=r.name,!(!n.href||!o||"map"!==r.nodeName.toLowerCase())&&(a=t("img[usemap='#"+o+"']"),a.length>0&&a.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(l)?(s=!n.disabled,s&&(c=t(n).closest("fieldset")[0],c&&(s=!c.disabled))):s="a"===l&&n.href||i,s&&t(n).is(":visible")&&e(t(n)))},t.extend(t.expr[":"],{focusable:function(e){return t.ui.focusable(e,null!=t.attr(e,"tabindex"))}}),t.ui.focusable}))},ca84:function(t,e,n){var i=n("5135"),r=n("fc6a"),o=n("4d64").indexOf,a=n("d012");t.exports=function(t,e){var n,s=r(t),c=0,l=[];for(n in s)!i(a,n)&&i(s,n)&&l.push(n);while(e.length>c)i(s,n=e[c++])&&(~o(l,n)||l.push(n));return l}},cb0d:function(t,e,n){var i,r,o;(function(a){r=[n("1157"),n("4309")],i=a,o="function"===typeof i?i.apply(e,r):i,void 0===o||(t.exports=o)})((function(t){return t.ui.safeActiveElement=function(t){var e;try{e=t.activeElement}catch(n){e=t.body}return e||(e=t.body),e.nodeName||(e=t.body),e}}))},cb1e:function(t,e,n){n("3084"),n("25c8"),n("0ae9"),n("4c72"),n("c9bc"),n("37a7"),n("bc1c"),n("af5e"),n("f088"),n("449c"),n("cba7"),n("721b"),n("ed45"),n("6f5b"),n("5130"),n("bb50"),n("da70"),n("8869"),n("3ff8"),n("0773"),n("916d"),n("2431"),n("5732"),n("7675"),n("354d")},cba7:function(t,e,n){var i,r,o;
|
|
164
|
-
/*!
|
|
165
|
-
* jQuery UI Unique ID 1.12.1
|
|
166
|
-
* http://jqueryui.com
|
|
167
|
-
*
|
|
168
|
-
* Copyright jQuery Foundation and other contributors
|
|
169
|
-
* Released under the MIT license.
|
|
170
|
-
* http://jquery.org/license
|
|
171
|
-
*/(function(a){r=[n("1157"),n("4309")],i=a,o="function"===typeof i?i.apply(e,r):i,void 0===o||(t.exports=o)})((function(t){return t.fn.extend({uniqueId:function(){var t=0;return function(){return this.each((function(){this.id||(this.id="ui-id-"+ ++t)}))}}(),removeUniqueId:function(){return this.each((function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")}))}})}))},cc12:function(t,e,n){var i=n("da84"),r=n("861d"),o=i.document,a=r(o)&&r(o.createElement);t.exports=function(t){return a?o.createElement(t):{}}},ce4e:function(t,e,n){var i=n("da84"),r=n("9112");t.exports=function(t,e){try{r(i,t,e)}catch(n){i[t]=e}return e}},d012:function(t,e){t.exports={}},d039:function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},d066:function(t,e,n){var i=n("428f"),r=n("da84"),o=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?o(i[t])||o(r[t]):i[t]&&i[t][e]||r[t]&&r[t][e]}},d1e7:function(t,e,n){"use strict";var i={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!i.call({1:2},1);e.f=o?function(t){var e=r(this,t);return!!e&&e.enumerable}:i},d76d:function(t,e,n){var i,r,o;(function(a){r=[n("1157"),n("4309")],i=a,o="function"===typeof i?i.apply(e,r):i,void 0===o||(t.exports=o)})((function(t){return t.fn.form=function(){return"string"===typeof this[0].form?this.closest("form"):t(this[0].form)}}))},da70:function(t,e,n){var i,r,o;
|
|
172
|
-
/*!
|
|
173
|
-
* jQuery UI Dialog 1.12.1
|
|
174
|
-
* http://jqueryui.com
|
|
175
|
-
*
|
|
176
|
-
* Copyright jQuery Foundation and other contributors
|
|
177
|
-
* Released under the MIT license.
|
|
178
|
-
* http://jquery.org/license
|
|
179
|
-
*/(function(a){r=[n("1157"),n("6f5b"),n("721b"),n("8869"),n("ed45"),n("c9bc"),n("bc1c"),n("25c8"),n("cb0d"),n("c8cf"),n("449c"),n("cba7"),n("4309"),n("3084")],i=a,o="function"===typeof i?i.apply(e,r):i,void 0===o||(t.exports=o)})((function(t){return t.widget("ui.dialog",{version:"1.12.1",options:{appendTo:"body",autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(e){var n=t(this).css(e).offset().top;n<0&&t(this).css("top",e.top-n)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle),this.options.disabled&&(this.options.disabled=!1),this._createWrapper(),this.element.show().removeAttr("title").appendTo(this.uiDialog),this._addClass("ui-dialog-content","ui-widget-content"),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&t.fn.draggable&&this._makeDraggable(),this.options.resizable&&t.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var e=this.options.appendTo;return e&&(e.jquery||e.nodeType)?t(e):this.document.find(e||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().css(this.originalCss).detach(),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),t=e.parent.children().eq(e.index),t.length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},disable:t.noop,enable:t.noop,close:function(e){var n=this;this._isOpen&&!1!==this._trigger("beforeClose",e)&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||t.ui.safeBlur(t.ui.safeActiveElement(this.document[0])),this._hide(this.uiDialog,this.options.hide,(function(){n._trigger("close",e)})))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(e,n){var i=!1,r=this.uiDialog.siblings(".ui-front:visible").map((function(){return+t(this).css("z-index")})).get(),o=Math.max.apply(null,r);return o>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",o+1),i=!0),i&&!n&&this._trigger("focus",e),i},open:function(){var e=this;this._isOpen?this._moveToTop()&&this._focusTabbable():(this._isOpen=!0,this.opener=t(t.ui.safeActiveElement(this.document[0])),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,(function(){e._focusTabbable(),e._trigger("focus")})),this._makeFocusTarget(),this._trigger("open"))},_focusTabbable:function(){var t=this._focusedElement;t||(t=this.element.find("[autofocus]")),t.length||(t=this.element.find(":tabbable")),t.length||(t=this.uiDialogButtonPane.find(":tabbable")),t.length||(t=this.uiDialogTitlebarClose.filter(":tabbable")),t.length||(t=this.uiDialog),t.eq(0).trigger("focus")},_keepFocus:function(e){function n(){var e=t.ui.safeActiveElement(this.document[0]),n=this.uiDialog[0]===e||t.contains(this.uiDialog[0],e);n||this._focusTabbable()}e.preventDefault(),n.call(this),this._delay(n)},_createWrapper:function(){this.uiDialog=t("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(e){if(this.options.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===t.ui.keyCode.ESCAPE)return e.preventDefault(),void this.close(e);if(e.keyCode===t.ui.keyCode.TAB&&!e.isDefaultPrevented()){var n=this.uiDialog.find(":tabbable"),i=n.filter(":first"),r=n.filter(":last");e.target!==r[0]&&e.target!==this.uiDialog[0]||e.shiftKey?e.target!==i[0]&&e.target!==this.uiDialog[0]||!e.shiftKey||(this._delay((function(){r.trigger("focus")})),e.preventDefault()):(this._delay((function(){i.trigger("focus")})),e.preventDefault())}},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var e;this.uiDialogTitlebar=t("<div>"),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(e){t(e.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=t("<button type='button'></button>").button({label:t("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),e=t("<span>").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(e,"ui-dialog-title"),this._title(e),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":e.attr("id")})},_title:function(t){this.options.title?t.text(this.options.title):t.html(" ")},_createButtonPane:function(){this.uiDialogButtonPane=t("<div>"),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=t("<div>").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var e=this,n=this.options.buttons;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),t.isEmptyObject(n)||t.isArray(n)&&!n.length?this._removeClass(this.uiDialog,"ui-dialog-buttons"):(t.each(n,(function(n,i){var r,o;i=t.isFunction(i)?{click:i,text:n}:i,i=t.extend({type:"button"},i),r=i.click,o={icon:i.icon,iconPosition:i.iconPosition,showLabel:i.showLabel,icons:i.icons,text:i.text},delete i.click,delete i.icon,delete i.iconPosition,delete i.showLabel,delete i.icons,"boolean"===typeof i.text&&delete i.text,t("<button></button>",i).button(o).appendTo(e.uiButtonSet).on("click",(function(){r.apply(e.element[0],arguments)}))})),this._addClass(this.uiDialog,"ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog))},_makeDraggable:function(){var e=this,n=this.options;function i(t){return{position:t.position,offset:t.offset}}this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(n,r){e._addClass(t(this),"ui-dialog-dragging"),e._blockFrames(),e._trigger("dragStart",n,i(r))},drag:function(t,n){e._trigger("drag",t,i(n))},stop:function(r,o){var a=o.offset.left-e.document.scrollLeft(),s=o.offset.top-e.document.scrollTop();n.position={my:"left top",at:"left"+(a>=0?"+":"")+a+" top"+(s>=0?"+":"")+s,of:e.window},e._removeClass(t(this),"ui-dialog-dragging"),e._unblockFrames(),e._trigger("dragStop",r,i(o))}})},_makeResizable:function(){var e=this,n=this.options,i=n.resizable,r=this.uiDialog.css("position"),o="string"===typeof i?i:"n,e,s,w,se,sw,ne,nw";function a(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:n.maxWidth,maxHeight:n.maxHeight,minWidth:n.minWidth,minHeight:this._minHeight(),handles:o,start:function(n,i){e._addClass(t(this),"ui-dialog-resizing"),e._blockFrames(),e._trigger("resizeStart",n,a(i))},resize:function(t,n){e._trigger("resize",t,a(n))},stop:function(i,r){var o=e.uiDialog.offset(),s=o.left-e.document.scrollLeft(),c=o.top-e.document.scrollTop();n.height=e.uiDialog.height(),n.width=e.uiDialog.width(),n.position={my:"left top",at:"left"+(s>=0?"+":"")+s+" top"+(c>=0?"+":"")+c,of:e.window},e._removeClass(t(this),"ui-dialog-resizing"),e._unblockFrames(),e._trigger("resizeStop",i,a(r))}}).css("position",r)},_trackFocus:function(){this._on(this.widget(),{focusin:function(e){this._makeFocusTarget(),this._focusedElement=t(e.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var e=this._trackingInstances(),n=t.inArray(this,e);-1!==n&&e.splice(n,1)},_trackingInstances:function(){var t=this.document.data("ui-dialog-instances");return t||(t=[],this.document.data("ui-dialog-instances",t)),t},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(e){var n=this,i=!1,r={};t.each(e,(function(t,e){n._setOption(t,e),t in n.sizeRelatedOptions&&(i=!0),t in n.resizableRelatedOptions&&(r[t]=e)})),i&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",r)},_setOption:function(e,n){var i,r,o=this.uiDialog;"disabled"!==e&&(this._super(e,n),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:t("<a>").text(""+this.options.closeText).html()}),"draggable"===e&&(i=o.is(":data(ui-draggable)"),i&&!n&&o.draggable("destroy"),!i&&n&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(r=o.is(":data(ui-resizable)"),r&&!n&&o.resizable("destroy"),r&&"string"===typeof n&&o.resizable("option","handles",n),r||!1===n||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,e,n,i=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),i.minWidth>i.width&&(i.width=i.minWidth),t=this.uiDialog.css({height:"auto",width:i.width}).outerHeight(),e=Math.max(0,i.minHeight-t),n="number"===typeof i.maxHeight?Math.max(0,i.maxHeight-t):"none","auto"===i.height?this.element.css({minHeight:e,maxHeight:n,height:"auto"}):this.element.height(Math.max(0,i.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map((function(){var e=t(this);return t("<div>").css({position:"absolute",width:e.outerWidth(),height:e.outerHeight()}).appendTo(e.parent()).offset(e.offset())[0]}))},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(e){return!!t(e.target).closest(".ui-dialog").length||!!t(e.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var e=!0;this._delay((function(){e=!1})),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(t){e||this._allowInteraction(t)||(t.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=t("<div>").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var t=this.document.data("ui-dialog-overlays")-1;t?this.document.data("ui-dialog-overlays",t):(this._off(this.document,"focusin"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null}}}),!1!==t.uiBackCompat&&t.widget("ui.dialog",t.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(t,e){"dialogClass"===t&&this.uiDialog.removeClass(this.options.dialogClass).addClass(e),this._superApply(arguments)}}),t.ui.dialog}))},da84:function(t,e,n){(function(e){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||Function("return this")()}).call(this,n("c8ba"))},df75:function(t,e,n){var i=n("ca84"),r=n("7839");t.exports=Object.keys||function(t){return i(t,r)}},df7c:function(t,e,n){(function(t){function n(t,e){for(var n=0,i=t.length-1;i>=0;i--){var r=t[i];"."===r?t.splice(i,1):".."===r?(t.splice(i,1),n++):n&&(t.splice(i,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function i(t){"string"!==typeof t&&(t+="");var e,n=0,i=-1,r=!0;for(e=t.length-1;e>=0;--e)if(47===t.charCodeAt(e)){if(!r){n=e+1;break}}else-1===i&&(r=!1,i=e+1);return-1===i?"":t.slice(n,i)}function r(t,e){if(t.filter)return t.filter(e);for(var n=[],i=0;i<t.length;i++)e(t[i],i,t)&&n.push(t[i]);return n}e.resolve=function(){for(var e="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var a=o>=0?arguments[o]:t.cwd();if("string"!==typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(e=a+"/"+e,i="/"===a.charAt(0))}return e=n(r(e.split("/"),(function(t){return!!t})),!i).join("/"),(i?"/":"")+e||"."},e.normalize=function(t){var i=e.isAbsolute(t),a="/"===o(t,-1);return t=n(r(t.split("/"),(function(t){return!!t})),!i).join("/"),t||i||(t="."),t&&a&&(t+="/"),(i?"/":"")+t},e.isAbsolute=function(t){return"/"===t.charAt(0)},e.join=function(){var t=Array.prototype.slice.call(arguments,0);return e.normalize(r(t,(function(t,e){if("string"!==typeof t)throw new TypeError("Arguments to path.join must be strings");return t})).join("/"))},e.relative=function(t,n){function i(t){for(var e=0;e<t.length;e++)if(""!==t[e])break;for(var n=t.length-1;n>=0;n--)if(""!==t[n])break;return e>n?[]:t.slice(e,n-e+1)}t=e.resolve(t).substr(1),n=e.resolve(n).substr(1);for(var r=i(t.split("/")),o=i(n.split("/")),a=Math.min(r.length,o.length),s=a,c=0;c<a;c++)if(r[c]!==o[c]){s=c;break}var l=[];for(c=s;c<r.length;c++)l.push("..");return l=l.concat(o.slice(s)),l.join("/")},e.sep="/",e.delimiter=":",e.dirname=function(t){if("string"!==typeof t&&(t+=""),0===t.length)return".";for(var e=t.charCodeAt(0),n=47===e,i=-1,r=!0,o=t.length-1;o>=1;--o)if(e=t.charCodeAt(o),47===e){if(!r){i=o;break}}else r=!1;return-1===i?n?"/":".":n&&1===i?"/":t.slice(0,i)},e.basename=function(t,e){var n=i(t);return e&&n.substr(-1*e.length)===e&&(n=n.substr(0,n.length-e.length)),n},e.extname=function(t){"string"!==typeof t&&(t+="");for(var e=-1,n=0,i=-1,r=!0,o=0,a=t.length-1;a>=0;--a){var s=t.charCodeAt(a);if(47!==s)-1===i&&(r=!1,i=a+1),46===s?-1===e?e=a:1!==o&&(o=1):-1!==e&&(o=-1);else if(!r){n=a+1;break}}return-1===e||-1===i||0===o||1===o&&e===i-1&&e===n+1?"":t.slice(e,i)};var o="b"==="ab".substr(-1)?function(t,e,n){return t.substr(e,n)}:function(t,e,n){return e<0&&(e=t.length+e),t.substr(e,n)}}).call(this,n("4362"))},e893:function(t,e,n){var i=n("5135"),r=n("56ef"),o=n("06cf"),a=n("9bf2");t.exports=function(t,e){for(var n=r(e),s=a.f,c=o.f,l=0;l<n.length;l++){var u=n[l];i(t,u)||s(t,u,c(e,u))}}},e8b5:function(t,e,n){var i=n("c6b6");t.exports=Array.isArray||function(t){return"Array"==i(t)}},ed45:function(t,e,n){var i,r,o;
|
|
180
|
-
/*!
|
|
181
|
-
* jQuery UI Resizable 1.12.1
|
|
182
|
-
* http://jqueryui.com
|
|
183
|
-
*
|
|
184
|
-
* Copyright jQuery Foundation and other contributors
|
|
185
|
-
* Released under the MIT license.
|
|
186
|
-
* http://jquery.org/license
|
|
187
|
-
*/(function(a){r=[n("1157"),n("8869"),n("4c72"),n("6a51"),n("4309"),n("3084")],i=a,o="function"===typeof i?i.apply(e,r):i,void 0===o||(t.exports=o)})((function(t){return t.widget("ui.resizable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(e,n){if("hidden"===t(e).css("overflow"))return!1;var i=n&&"left"===n?"scrollLeft":"scrollTop",r=!1;return e[i]>0||(e[i]=1,r=e[i]>0,e[i]=0,r)},_create:function(){var e,n=this.options,i=this;this._addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!n.aspectRatio,aspectRatio:n.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:n.helper||n.ghost||n.animate?n.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(t("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,e={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(e),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(e),this._proportionallyResize()),this._setupHandles(),n.autoHide&&t(this.element).on("mouseenter",(function(){n.disabled||(i._removeClass("ui-resizable-autohide"),i._handles.show())})).on("mouseleave",(function(){n.disabled||i.resizing||(i._addClass("ui-resizable-autohide"),i._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,n=function(e){t(e).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(n(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),n(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;default:break}},_setupHandles:function(){var e,n,i,r,o,a=this.options,s=this;if(this.handles=a.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=t(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),i=this.handles.split(","),this.handles={},n=0;n<i.length;n++)e=t.trim(i[n]),r="ui-resizable-"+e,o=t("<div>"),this._addClass(o,"ui-resizable-handle "+r),o.css({zIndex:a.zIndex}),this.handles[e]=".ui-resizable-"+e,this.element.append(o);this._renderAxis=function(e){var n,i,r,o;for(n in e=e||this.element,this.handles)this.handles[n].constructor===String?this.handles[n]=this.element.children(this.handles[n]).first().show():(this.handles[n].jquery||this.handles[n].nodeType)&&(this.handles[n]=t(this.handles[n]),this._on(this.handles[n],{mousedown:s._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(i=t(this.handles[n],this.element),o=/sw|ne|nw|se|n|s/.test(n)?i.outerHeight():i.outerWidth(),r=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join(""),e.css(r,o),this._proportionallyResize()),this._handles=this._handles.add(this.handles[n])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",(function(){s.resizing||(this.className&&(o=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),s.axis=o&&o[1]?o[1]:"se")})),a.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(e){var n,i,r=!1;for(n in this.handles)i=t(this.handles[n])[0],(i===e.target||t.contains(i,e.target))&&(r=!0);return!this.options.disabled&&r},_mouseStart:function(e){var n,i,r,o=this.options,a=this.element;return this.resizing=!0,this._renderProxy(),n=this._num(this.helper.css("left")),i=this._num(this.helper.css("top")),o.containment&&(n+=t(o.containment).scrollLeft()||0,i+=t(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:n,top:i},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:a.width(),height:a.height()},this.originalSize=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.sizeDiff={width:a.outerWidth()-a.width(),height:a.outerHeight()-a.height()},this.originalPosition={left:n,top:i},this.originalMousePosition={left:e.pageX,top:e.pageY},this.aspectRatio="number"===typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,r=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===r?this.axis+"-resize":r),this._addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(e){var n,i,r=this.originalMousePosition,o=this.axis,a=e.pageX-r.left||0,s=e.pageY-r.top||0,c=this._change[o];return this._updatePrevProperties(),!!c&&(n=c.apply(this,[e,a,s]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(n=this._updateRatio(n,e)),n=this._respectSize(n,e),this._updateCache(n),this._propagate("resize",e),i=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(i)||(this._updatePrevProperties(),this._trigger("resize",e,this.ui()),this._applyChanges()),!1)},_mouseStop:function(e){this.resizing=!1;var n,i,r,o,a,s,c,l=this.options,u=this;return this._helper&&(n=this._proportionallyResizeElements,i=n.length&&/textarea/i.test(n[0].nodeName),r=i&&this._hasScroll(n[0],"left")?0:u.sizeDiff.height,o=i?0:u.sizeDiff.width,a={width:u.helper.width()-o,height:u.helper.height()-r},s=parseFloat(u.element.css("left"))+(u.position.left-u.originalPosition.left)||null,c=parseFloat(u.element.css("top"))+(u.position.top-u.originalPosition.top)||null,l.animate||this.element.css(t.extend(a,{top:c,left:s})),u.helper.height(u.size.height),u.helper.width(u.size.width),this._helper&&!l.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,n,i,r,o,a=this.options;o={minWidth:this._isNumber(a.minWidth)?a.minWidth:0,maxWidth:this._isNumber(a.maxWidth)?a.maxWidth:1/0,minHeight:this._isNumber(a.minHeight)?a.minHeight:0,maxHeight:this._isNumber(a.maxHeight)?a.maxHeight:1/0},(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,i=o.minWidth/this.aspectRatio,n=o.maxHeight*this.aspectRatio,r=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),i>o.minHeight&&(o.minHeight=i),n<o.maxWidth&&(o.maxWidth=n),r<o.maxHeight&&(o.maxHeight=r)),this._vBoundaries=o},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,n=this.size,i=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===i&&(t.left=e.left+(n.width-t.width),t.top=null),"nw"===i&&(t.top=e.top+(n.height-t.height),t.left=e.left+(n.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,n=this.axis,i=this._isNumber(t.width)&&e.maxWidth&&e.maxWidth<t.width,r=this._isNumber(t.height)&&e.maxHeight&&e.maxHeight<t.height,o=this._isNumber(t.width)&&e.minWidth&&e.minWidth>t.width,a=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,s=this.originalPosition.left+this.originalSize.width,c=this.originalPosition.top+this.originalSize.height,l=/sw|nw|w/.test(n),u=/nw|ne|n/.test(n);return o&&(t.width=e.minWidth),a&&(t.height=e.minHeight),i&&(t.width=e.maxWidth),r&&(t.height=e.maxHeight),o&&l&&(t.left=s-e.minWidth),i&&l&&(t.left=s-e.maxWidth),a&&u&&(t.top=c-e.minHeight),r&&u&&(t.top=c-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,n=[],i=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],r=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];e<4;e++)n[e]=parseFloat(i[e])||0,n[e]+=parseFloat(r[e])||0;return{height:n[0]+n[2],width:n[1]+n[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,n=this.helper||this.element;e<this._proportionallyResizeElements.length;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:n.height()-this.outerDimensions.height||0,width:n.width()-this.outerDimensions.width||0})},_renderProxy:function(){var e=this.element,n=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("<div style='overflow:hidden;'></div>"),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++n.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var n=this.originalSize,i=this.originalPosition;return{left:i.left+e,width:n.width-e}},n:function(t,e,n){var i=this.originalSize,r=this.originalPosition;return{top:r.top+n,height:i.height-n}},s:function(t,e,n){return{height:this.originalSize.height+n}},se:function(e,n,i){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,n,i]))},sw:function(e,n,i){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,n,i]))},ne:function(e,n,i){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,n,i]))},nw:function(e,n,i){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,n,i]))}},_propagate:function(e,n){t.ui.plugin.call(this,e,[n,this.ui()]),"resize"!==e&&this._trigger(e,n,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var n=t(this).resizable("instance"),i=n.options,r=n._proportionallyResizeElements,o=r.length&&/textarea/i.test(r[0].nodeName),a=o&&n._hasScroll(r[0],"left")?0:n.sizeDiff.height,s=o?0:n.sizeDiff.width,c={width:n.size.width-s,height:n.size.height-a},l=parseFloat(n.element.css("left"))+(n.position.left-n.originalPosition.left)||null,u=parseFloat(n.element.css("top"))+(n.position.top-n.originalPosition.top)||null;n.element.animate(t.extend(c,u&&l?{top:u,left:l}:{}),{duration:i.animateDuration,easing:i.animateEasing,step:function(){var i={width:parseFloat(n.element.css("width")),height:parseFloat(n.element.css("height")),top:parseFloat(n.element.css("top")),left:parseFloat(n.element.css("left"))};r&&r.length&&t(r[0]).css({width:i.width,height:i.height}),n._updateCache(i),n._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var e,n,i,r,o,a,s,c=t(this).resizable("instance"),l=c.options,u=c.element,h=l.containment,p=h instanceof t?h.get(0):/parent/.test(h)?u.parent().get(0):h;p&&(c.containerElement=t(p),/document/.test(h)||h===document?(c.containerOffset={left:0,top:0},c.containerPosition={left:0,top:0},c.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(e=t(p),n=[],t(["Top","Right","Left","Bottom"]).each((function(t,i){n[t]=c._num(e.css("padding"+i))})),c.containerOffset=e.offset(),c.containerPosition=e.position(),c.containerSize={height:e.innerHeight()-n[3],width:e.innerWidth()-n[1]},i=c.containerOffset,r=c.containerSize.height,o=c.containerSize.width,a=c._hasScroll(p,"left")?p.scrollWidth:o,s=c._hasScroll(p)?p.scrollHeight:r,c.parentData={element:p,left:i.left,top:i.top,width:a,height:s}))},resize:function(e){var n,i,r,o,a=t(this).resizable("instance"),s=a.options,c=a.containerOffset,l=a.position,u=a._aspectRatio||e.shiftKey,h={top:0,left:0},p=a.containerElement,d=!0;p[0]!==document&&/static/.test(p.css("position"))&&(h=c),l.left<(a._helper?c.left:0)&&(a.size.width=a.size.width+(a._helper?a.position.left-c.left:a.position.left-h.left),u&&(a.size.height=a.size.width/a.aspectRatio,d=!1),a.position.left=s.helper?c.left:0),l.top<(a._helper?c.top:0)&&(a.size.height=a.size.height+(a._helper?a.position.top-c.top:a.position.top),u&&(a.size.width=a.size.height*a.aspectRatio,d=!1),a.position.top=a._helper?c.top:0),r=a.containerElement.get(0)===a.element.parent().get(0),o=/relative|absolute/.test(a.containerElement.css("position")),r&&o?(a.offset.left=a.parentData.left+a.position.left,a.offset.top=a.parentData.top+a.position.top):(a.offset.left=a.element.offset().left,a.offset.top=a.element.offset().top),n=Math.abs(a.sizeDiff.width+(a._helper?a.offset.left-h.left:a.offset.left-c.left)),i=Math.abs(a.sizeDiff.height+(a._helper?a.offset.top-h.top:a.offset.top-c.top)),n+a.size.width>=a.parentData.width&&(a.size.width=a.parentData.width-n,u&&(a.size.height=a.size.width/a.aspectRatio,d=!1)),i+a.size.height>=a.parentData.height&&(a.size.height=a.parentData.height-i,u&&(a.size.width=a.size.height*a.aspectRatio,d=!1)),d||(a.position.left=a.prevPosition.left,a.position.top=a.prevPosition.top,a.size.width=a.prevSize.width,a.size.height=a.prevSize.height)},stop:function(){var e=t(this).resizable("instance"),n=e.options,i=e.containerOffset,r=e.containerPosition,o=e.containerElement,a=t(e.helper),s=a.offset(),c=a.outerWidth()-e.sizeDiff.width,l=a.outerHeight()-e.sizeDiff.height;e._helper&&!n.animate&&/relative/.test(o.css("position"))&&t(this).css({left:s.left-r.left-i.left,width:c,height:l}),e._helper&&!n.animate&&/static/.test(o.css("position"))&&t(this).css({left:s.left-r.left-i.left,width:c,height:l})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).resizable("instance"),n=e.options;t(n.alsoResize).each((function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseFloat(e.width()),height:parseFloat(e.height()),left:parseFloat(e.css("left")),top:parseFloat(e.css("top"))})}))},resize:function(e,n){var i=t(this).resizable("instance"),r=i.options,o=i.originalSize,a=i.originalPosition,s={height:i.size.height-o.height||0,width:i.size.width-o.width||0,top:i.position.top-a.top||0,left:i.position.left-a.left||0};t(r.alsoResize).each((function(){var e=t(this),i=t(this).data("ui-resizable-alsoresize"),r={},o=e.parents(n.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(o,(function(t,e){var n=(i[e]||0)+(s[e]||0);n&&n>=0&&(r[e]=n||null)})),e.css(r)}))},stop:function(){t(this).removeData("ui-resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).resizable("instance"),n=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:n.height,width:n.width,margin:0,left:0,top:0}),e._addClass(e.ghost,"ui-resizable-ghost"),!1!==t.uiBackCompat&&"string"===typeof e.options.ghost&&e.ghost.addClass(this.options.ghost),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).resizable("instance");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).resizable("instance");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e,n=t(this).resizable("instance"),i=n.options,r=n.size,o=n.originalSize,a=n.originalPosition,s=n.axis,c="number"===typeof i.grid?[i.grid,i.grid]:i.grid,l=c[0]||1,u=c[1]||1,h=Math.round((r.width-o.width)/l)*l,p=Math.round((r.height-o.height)/u)*u,d=o.width+h,f=o.height+p,m=i.maxWidth&&i.maxWidth<d,g=i.maxHeight&&i.maxHeight<f,v=i.minWidth&&i.minWidth>d,y=i.minHeight&&i.minHeight>f;i.grid=c,v&&(d+=l),y&&(f+=u),m&&(d-=l),g&&(f-=u),/^(se|s|e)$/.test(s)?(n.size.width=d,n.size.height=f):/^(ne)$/.test(s)?(n.size.width=d,n.size.height=f,n.position.top=a.top-p):/^(sw)$/.test(s)?(n.size.width=d,n.size.height=f,n.position.left=a.left-h):((f-u<=0||d-l<=0)&&(e=n._getPaddingPlusBorderDimensions(this)),f-u>0?(n.size.height=f,n.position.top=a.top-p):(f=u-e.height,n.size.height=f,n.position.top=a.top+o.height-f),d-l>0?(n.size.width=d,n.position.left=a.left-h):(d=l-e.width,n.size.width=d,n.position.left=a.left+o.width-d))}}),t.ui.resizable}))},f088:function(t,e,n){var i,r,o;
|
|
188
|
-
/*!
|
|
189
|
-
* jQuery UI Scroll Parent 1.12.1
|
|
190
|
-
* http://jqueryui.com
|
|
191
|
-
*
|
|
192
|
-
* Copyright jQuery Foundation and other contributors
|
|
193
|
-
* Released under the MIT license.
|
|
194
|
-
* http://jquery.org/license
|
|
195
|
-
*/(function(a){r=[n("1157"),n("4309")],i=a,o="function"===typeof i?i.apply(e,r):i,void 0===o||(t.exports=o)})((function(t){return t.fn.scrollParent=function(e){var n=this.css("position"),i="absolute"===n,r=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter((function(){var e=t(this);return(!i||"static"!==e.css("position"))&&r.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))})).eq(0);return"fixed"!==n&&o.length?o:t(this[0].ownerDocument||document)}}))},f6fd:function(t,e){(function(t){var e="currentScript",n=t.getElementsByTagName("script");e in t||Object.defineProperty(t,e,{get:function(){try{throw new Error}catch(i){var t,e=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(i.stack)||[!1])[1];for(t in n)if(n[t].src==e||"interactive"==n[t].readyState)return n[t];return null}}})})(document)},f772:function(t,e,n){var i=n("5692"),r=n("90e3"),o=i("keys");t.exports=function(t){return o[t]||(o[t]=r(t))}},f8c2:function(t,e,n){var i=n("1c0b");t.exports=function(t,e,n){if(i(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,r){return t.call(e,n,i,r)}}return function(){return t.apply(e,arguments)}}},fb15:function(t,e,n){"use strict";var i;(n.r(e),"undefined"!==typeof window)&&(n("f6fd"),(i=window.document.currentScript)&&(i=i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(n.p=i[1]));n("4160"),n("b64b"),n("159b");var r=n("8bbf"),o=n.n(r),a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"scaffold-container"},[n("div",{ref:"display",staticStyle:{height:"100%",width:"100%"},attrs:{id:"organsDisplayArea"}}),n("div",{attrs:{id:"check-list"}},[n("button",{on:{click:t.viewAll}},[t._v("View all")]),t._l(t.sceneData.groups,(function(e){return n("div",{key:e},[n("input",{attrs:{type:"checkbox",id:e,checked:""},domProps:{value:e},on:{change:function(n){return t.visibilityToggle(e,n)}}}),n("label",{attrs:{for:e}},[t._v(t._s(e))])])})),t.isPlaying?n("button",{on:{click:function(e){return t.play(!1)}}},[t._v("Stop")]):n("button",{on:{click:function(e){return t.play(!0)}}},[t._v("Play")])],2),t.sceneData.timeVarying?n("input",{attrs:{id:"timeSlider",type:"range",min:"0",max:"100",step:"0.1"},domProps:{value:t.sceneData.currentTime},on:{input:function(e){return t.timeChange(e)}}}):t._e()])},s=[],c=n("67b6").OrgansViewer,l=n("549c").EventNotifier,u=function(t){return function(e){1==e.eventType?t.$emit("scaffold-selected",e.identifiers):2==e.eventType&&t.$emit("scaffold-highlighted",e.identifiers)}},h={name:"ScaffoldVuer",beforeCreate:function(){var t=new l;t.subscribe(this,u(this)),this.$module=new c,this.$module.addNotifier(t)},methods:{viewAll:function(){this.$module.viewAll()},visibilityToggle:function(t,e){this.$module.changeOrganPartsVisibility(t,e.srcElement.checked)},timeChange:function(t){this.$module.updateTime(t.srcElement.value)},play:function(t){this.$module.playAnimation(t),this.isPlaying=t}},props:["url"],data:function(){return{sceneData:this.$module.sceneData,isPlaying:!1}},mounted:function(){this.$module.loadOrgansFromURL(this.url,void 0,void 0,"Overlay",void 0),this.$module.initialiseRenderer(this.$refs.display)}},p=h;n("0772");function d(t,e,n,i,r,o,a,s){var c,l="function"===typeof t?t.options:t;if(e&&(l.render=e,l.staticRenderFns=n,l._compiled=!0),i&&(l.functional=!0),o&&(l._scopeId="data-v-"+o),a?(c=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},l._ssrRegister=c):r&&(c=s?function(){r.call(this,this.$root.$options.shadowRoot)}:r),c)if(l.functional){l._injectStyles=c;var u=l.render;l.render=function(t,e){return c.call(e),u(t,e)}}else{var h=l.beforeCreate;l.beforeCreate=h?[].concat(h,c):[c]}return{exports:t,options:l}}var f=d(p,a,s,!1,null,"0babbf44",null),m=f.exports,g={ScaffoldVuer:m};Object.keys(g).forEach((function(t){o.a.component(t,g[t])}));var v=g;e["default"]=v},fc6a:function(t,e,n){var i=n("44ad"),r=n("1d80");t.exports=function(t){return i(r(t))}},fdbc:function(t,e){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}}})}));
|
|
1
|
+
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["scaffoldvuer"]=t():e["scaffoldvuer"]=t()})("undefined"!==typeof self?self:this,(function(){return function(e){var t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s="fae3")}({"02ac":function(e,t){e.exports=require("core-js/modules/es.symbol.iterator")},"0607":function(e,t){e.exports=require("element-ui/lib/checkbox-group")},"0cf4":function(e,t){e.exports=require("element-ui/lib/theme-chalk/checkbox-group.css")},"0de2":function(e,t){e.exports=require("element-ui/lib/select")},"0fe2":function(e,t){e.exports=require("element-ui/lib/theme-chalk/select.css")},"139f":function(e,t){e.exports=require("core-js/modules/es.array.for-each")},"18d2":function(e,t){e.exports=require("core-js/modules/es.array.concat")},"1ac9":function(e,t){e.exports=require("element-ui/lib/container")},"1ce0":function(e,t){e.exports=require("core-js/modules/web.dom-collections.iterator")},"1fe8":function(e,t){e.exports=require("element-ui/lib/main")},2175:function(e,t){e.exports=require("core-js/modules/es.object.keys")},"21a1":function(e,t,i){"use strict";i("5810")},"22c1":function(e,t,i){},"27fc":function(e,t,i){"use strict";i("22c1")},"2a6f":function(e,t){e.exports=require("core-js/modules/web.url")},"2c1b":function(e,t){e.exports=require("element-ui/lib/theme-chalk/loading.css")},"2de2":function(e,t){e.exports=require("element-ui/lib/header")},3170:function(e,t){e.exports=require("element-ui/lib/theme-chalk/tabs.css")},"319f":function(e,t){e.exports=require("core-js/modules/es.number.to-fixed")},"31fb":function(e,t){e.exports=require("element-ui/lib/tab-pane")},3666:function(e,t){e.exports=require("element-ui/lib/theme-chalk/color-picker.css")},"373b":function(e,t){e.exports=require("element-ui/lib/drawer")},"429c":function(e,t){e.exports=require("@abi-software/svg-sprite")},4914:function(e,t){e.exports=require("element-ui/lib/color-picker")},"4c89":function(e,t){e.exports=require("element-ui/lib/theme-chalk/drawer.css")},"4e2d":function(e,t){e.exports=require("lodash/uniq")},"51c7":function(e,t){e.exports=require("element-ui/lib/theme-chalk/header.css")},"51e9":function(e,t){e.exports=require("core-js/modules/es.symbol.description")},"51f7":function(e,t){e.exports=require("core-js/modules/es.regexp.exec")},"53d7":function(e,t,i){i("ab7e"),i("7c81"),i("bcd8"),i("2175"),i("fd48");var n=i("7037"),r=i("9206").THREE,o=function(){this.currentName="",this.currentSystem="",this.currentPart="",this.currentSpecies="",this.metaURL="",this.viewURL="",this.geometries=[],this.lines=[],this.glyphsets=[],this.pointsets=[],this.currentTime=0,this.timeVarying=!1},s=function(e){i("8278").RendererModule.call(this);var t=this,s=void 0;this.sceneData=new o;var a=new Array,c=new Array,l=new Array,u=void 0,d=e;t.typeName="Organ Viewer",this.getSceneData=function(){return t.sceneData},this.updateTime=function(e){var i=6e3;t.scene&&(i=t.scene.getDuration());var n=e/100*i;t.sceneData.nerveMapIsActive||(s&&s.setMorphsTime(n),t.scene&&t.scene.setMorphsTime(n)),t.sceneData.currentTime=e};var h=function(){var e=3e3;t.scene&&(e=t.scene.getDuration());for(var i=t.zincRenderer.getCurrentTime(),n=0;n<a.length;n++)a[n](i);!t.sceneData.nerveMapIsActive&&s&&s.setMorphsTime(i),t.sceneData.nerveMap&&t.sceneData.nerveMap.additionalReader&&t.sceneData.nerveMap.additionalReader.setTime(i/e),t.sceneData.currentTime=i/e*100},p=function(){if(t.selectedCenter){var e=new r.Vector3;e.copy(t.selectedCenter);var i=t.scene.vectorToScreenXY(e);t.selectedScreenCoordinates.x=i.x,t.selectedScreenCoordinates.y=i.y}},f=function(){return function(){h()}},m=function(){return function(){p()}};this.addTimeChangedCallback=function(e){n("function"===e)&&a.push(e)},this.setTexturePos=function(e){t.sceneData.nerveMap&&t.sceneData.nerveMap.additionalReader&&t.sceneData.nerveMap.additionalReader.setSliderPos(e)},this.addSceneChangedCallback=function(e){n("function"===e)&&c.push(e)},this.addOrganPartAddedCallback=function(e){n("function"===e)&&l.push(e)},this.setFinishDownloadCallback=function(e){n("function"===e)&&(u=e)},this.unsetFinishDownloadCallback=function(){u=void 0},this.getNamedObjectsToScreenCoordinates=function(e,t){var i=new r.Vector3;i.setFromMatrixPosition(obj.matrixWorld);var n=width/2,o=height/2;return i.project(t),i.x=i.x*n+n,i.y=-i.y*o+o,i};var v=function(e){var i=void 0,n=void 0;if(void 0!==e&&(n=e.object.userData&&e.object.userData.isMarker?e.object.userData.parent.morph:e.object,n))if(n.name)i=n.name;else{var r=t.getAnnotationsFromObjects([n]);r&&r[0]&&(i=r[0].data.group)}return{id:i,object:n}},g=function(){return function(e,i,n){var r=t.getIntersectedObject(e),o=v(r);o.id?o.object.userData.isGlyph?o.object.name?t.setSelectedByObjects([o.object],!0):t.setSelectedByZincObject(o.object.userData.getGlyphset(),!0):t.setSelectedByObjects([o.object],!0):t.setSelectedByObjects([],!0)}},b=function(){return function(e,i,n){var r=t.getIntersectedObject(e),o=v(r);if(o.id)return t.displayArea.style.cursor="pointer",void t.setHighlightedByObjects([o.object],!0);t.displayArea.style.cursor="auto",t.setHighlightedByObjects([],!0)}},y=function(e,t,i,n){if("all"==n||"geometries"==n)for(var r=e.findGeometriesWithGroupName(t),o=0;o<r.length;o++)r[o].setVisibility(i);if("all"==n||"glyphsets"==n)for(var s=e.findGlyphsetsWithGroupName(t),a=0;a<s.length;a++)s[a].setVisibility(i);if("all"==n||"pointsets"==n)for(var c=e.findPointsetsWithGroupName(t),l=0;l<c.length;l++)c[l].setVisibility(i);if("all"==n||"lines"==n)for(var u=e.findLinesWithGroupName(t),d=0;d<u.length;d++)u[d].setVisibility(i)};this.changeGeometriesVisibility=function(e,i){y(t.scene,e,i,"geometries"),s&&y(s,e,i,"geometries")},this.changeGlyphsetsVisibility=function(e,i){y(t.scene,e,i,"glyphsets"),s&&y(s,e,i,"glyphsets")},this.changeLinesVisibility=function(e,i){y(t.scene,e,i,"lines"),s&&y(s,e,i,"lines")},this.changePointsetsVisibility=function(e,i){y(t.scene,e,i,"pointsets"),s&&y(s,e,i,"pointsets")},this.changeOrganPartsVisibility=function(e,i,n){var r="all";void 0!==n&&(r=n),y(t.scene,e,i,r),s&&y(s,e,i,r)},this.changeOrganPartsVisibilityCallback=function(e){return function(i){t.changeOrganPartsVisibility(e,i)}},this.changeBackgroundColour=function(e){var i=new r.Color(e);if(t.zincRenderer){var n=t.zincRenderer.getThreeJSRenderer();n.setClearColor(i,1)}};var C=function(e){e.groupName&&(e.isGeometry?t.sceneData.geometries.includes(e.groupName)||t.sceneData.geometries.push(e.groupName):e.isGlyphset?t.sceneData.glyphsets.includes(e.groupName)||t.sceneData.glyphsets.push(e.groupName):e.isLines?t.sceneData.lines.includes(e.groupName)||t.sceneData.lines.push(e.groupName):e.isPointset&&(t.sceneData.pointsets.includes(e.groupName)||t.sceneData.pointsets.push(e.groupName)))},w=function(e,n,r,o){for(var s=0;s<l.length;s++)l[s](o.groupName,t.scene.isTimeVarying(),o);r&&d.setGeometryColour(o,e,n),C(o);var a=new(i("984d").annotation);a.data={species:t.sceneData.currentSpecies,system:e,part:n,group:o.groupName},o.userData=[a]},k=function(e,t,i){return function(n){w(e,t,i,n)}},x=function(){return function(){t.settingsChanged(),t.sceneData.timeVarying=t.scene.isTimeVarying(),u&&u()}};this.updateFieldvisibility=function(e,i){for(var n=0;n<e.length;n++)if(i!=n){var r=e[n].PartName;t.changeOrganPartsVisibility(r,!1)}if(i>-1){var o=e[i].PartName;if(t.scene.findGeometriesWithGroupName(o).length>0||t.scene.findGlyphsetsWithGroupName(o).length>0)t.changeOrganPartsVisibility(o,!0);else{var s=getOrganDetails(e[i].SystemName,o);void 0!=s&&t.scene.loadMetadataURL(d.getOrgansDirectoryPrefix()+"/"+s.meta)}}},this.getAvailableSpecies=function(e,t,i){var n=new Array;n.push("none");var r=Object.keys(organsFileMap);for(index in r){var o=r[index];o!=e&&organsFileMap[o].hasOwnProperty(t)&&organsFileMap[o][t].hasOwnProperty(i)&&n.push(o)}return n};var R=function(e,i,n,r){t.sceneData.nerveMapIsActive=!1,t.sceneData.nerveMap=void 0,t.sceneData.metaURL="",t.sceneData.viewURL="",t.sceneData.currentSpecies=e,t.sceneData.currentSystem=i,t.sceneData.currentPart=n,t.sceneData.currentTime=0,t.sceneData.geometries.splice(0),t.sceneData.lines.splice(0),t.sceneData.glyphsets.splice(0),t.sceneData.pointsets.splice(0),t.sceneData.timeVarying=!1;var o="";e&&(o=e+"/"),i&&(o=i+"/"),n&&(o=n),t.sceneData.currentName=o};this.loadOrgansFromURL=function(e,i,n,r,o){if(t.zincRenderer&&r&&t.sceneData.metaURL!==e){R(i,n,r,void 0);var s=t.sceneData.currentName,a=t.zincRenderer.getSceneByName(s);a?a.clearAll():a=t.zincRenderer.createScene(s);for(var l=0;l<c.length;l++)c[l](t.sceneData);o&&""!=o?(t.sceneData.viewURL=o,a.loadViewURL(t.sceneData.viewURL)):t.sceneData.viewURL=void 0,t.sceneData.metaURL=e,a.loadMetadataURL(e,k(n,r,!1),x()),t.scene=a,t.zincRenderer.setCurrentScene(a),t.graphicsHighlight.reset();var u=a.getZincCameraControls();u.enableRaycaster(a,g(),b()),u.setMouseButtonAction("AUXILIARY","ZOOM"),u.setMouseButtonAction("SECONDARY","PAN")}},this.alignCameraWithSelectedObject=function(e){var i=t.graphicsHighlight.getSelected();i&&i[0]&&i[0].userData&&t.scene.alignObjectToCameraView(i[0].userData,e)},this.exportSettings=function(){var e={};return e.name=t.instanceName,t.sceneData.currentSystem&&(e.system=t.sceneData.currentSystem),t.sceneData.currentSpecies&&(e.species=t.sceneData.currentSpecies),t.sceneData.currentPart&&(e.part=t.sceneData.currentPart),e.metaURL=t.sceneData.metaURL,t.sceneData.viewURL&&(e.viewURL=t.sceneData.viewURL),e.dialog="Organ Viewer",e},this.importSettings=function(e){return!(!e||e.dialog!=this.typeName)&&(t.setName(e.name),void 0!==e.metaURL&&""!=e.metaURL?t.loadOrgansFromURL(e.metaURL,e.species,e.system,e.part,e.viewURL):t.loadOrgans(e.species,e.system,e.part),!0)};var S=function(){t.initialiseRenderer(void 0),t.zincRenderer&&(t.zincRenderer.addPreRenderCallbackFunction(f()),t.zincRenderer.addPostRenderCallbackFunction(m()))};S()};s.prototype=Object.create(i("8278").RendererModule.prototype),t.OrgansViewer=s},"55ee":function(e,t){e.exports=require("element-ui/lib/theme-chalk/checkbox.css")},5810:function(e,t,i){},"5ec5":function(e,t,i){var n=i("9206").THREE;t.GraphicsHighlight=function(){var e=[],t=[];this.highlightColour=255,this.selectColour=65280,this.originalColour=0;var i=this,r=function(e,t){if(0==e.length&&0==t.length)return!1;for(var i=0;i<e.length;i++){for(var n=!1,r=0;r<t.length;r++)e[i]===t[r]&&(n=!0);if(!n)return!0}for(var o=0;o<t.length;o++){for(var s=!1,a=0;a<e.length;a++)t[o]===e[a]&&(s=!0);if(!s)return!0}return!1},o=function(e,t){var i=[];if(0==t.length)return e;for(var n=0;n<e.length;n++){for(var r=!1,o=0;o<t.length;o++)e[n]===t[o]&&(r=!0);r||i.push(e[n])}return i};this.setHighlighted=function(n){var a=e;i.resetHighlighted();for(var c=o(n,t),l=s(c),u=0;u<l.length;u++)l[u]&&l[u].material&&l[u].material.emissive&&l[u].material.emissive.setHex(i.highlightColour);return e=c,r(e,a)},this.setSelected=function(n){var a=t,c=o(e,n);e=c,i.resetSelected();for(var l=s(n),u=0;u<l.length;u++)l[u]&&l[u].material&&l[u].material.emissive&&l[u].material.emissive.setHex(i.selectColour);return t=n,r(t,a)};var s=function(e){for(var t=[],i=0;i<e.length;i++)e[i].material&&t.push(e[i]);return t};this.resetHighlighted=function(){for(var t=s(e),r=0;r<t.length;r++)t[r]&&t[r].material&&(t[r].material.emissive&&t[r].material.emissive.setHex(i.originalColour),t[r].material.depthFunc&&(t[r].material.depthFunc=n.LessEqualDepth));e=[]},this.resetSelected=function(){for(var e=s(t),r=0;r<e.length;r++)e[r]&&e[r].material&&(e[r].material.emissive&&e[r].material.emissive.setHex(i.originalColour),e[r].material.depthFunc&&(e[r].material.depthFunc=n.LessEqualDepth));t=[]},this.getSelected=function(){return t},this.reset=function(){i.resetSelected(),i.resetHighlighted()}}},"5fef":function(e,t){e.exports=require("core-js/modules/es.regexp.to-string")},6049:function(e,t){e.exports=require("core-js/modules/es.symbol")},"642d":function(e,t,i){"use strict";i("7d9b")},6579:function(e,t){e.exports=require("core-js/modules/es.array.slice")},6814:function(e,t){e.exports=require("lodash/orderBy")},"6aa6":function(e,t,i){i("ab7e"),i("6bb1"),i("6579"),i("7c81"),i("bcd8"),i("fd48");var n={ALL:0,DESTROYED:1,NAME_CHANGED:2,SETTINGS_CHANGED:3},r=function(){this.typeName="Base Module",this.instanceName="default",this.onChangedCallbacks=[],this.eventNotifiers=[]};r.prototype.setName=function(e){if(e&&this.instanceName!==e){this.instanceName=e;for(var t=this.onChangedCallbacks.slice(),i=0;i<t.length;i++)t[i](this,n.NAME_CHANGED)}},r.prototype.settingsChanged=function(){for(var e=this.onChangedCallbacks.slice(),t=0;t<e.length;t++)e[t](this,n.SETTINGS_CHANGED)},r.prototype.exportSettings=function(){var e={};return e.dialog=this.typeName,e.name=this.instanceName,e},r.prototype.importSettings=function(e){return e.dialog==this.typeName&&(this.setName(e.name),!0)},r.prototype.publishChanges=function(e,t){for(var i=0;i<this.eventNotifiers.length;i++)this.eventNotifiers[i].publish(this,t,e)},r.prototype.getName=function(){return this.instanceName},r.prototype.destroy=function(){for(var e=this.onChangedCallbacks.slice(),t=0;t<e.length;t++)e[t](this,n.DESTROYED)},r.prototype.addChangedCallback=function(e){0==this.onChangedCallbacks.includes(e)&&this.onChangedCallbacks.push(e)},r.prototype.removeChangedCallback=function(e){var t=this.onChangedCallbacks.indexOf(e);t>-1&&this.onChangedCallbacks.splice(t,1)},r.prototype.addNotifier=function(e){this.eventNotifiers.push(e)},t.BaseModule=r,t.MODULE_CHANGE=n},"6bb1":function(e,t){e.exports=require("core-js/modules/es.array.index-of")},"6bfd":function(e,t){e.exports=require("element-ui/lib/locale/lang/en")},"6ea3":function(e,t){e.exports=require("element-ui/lib/row")},7037:function(e,t,i){function n(t){return"function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}i("6049"),i("51e9"),i("02ac"),i("8c84"),i("850c"),i("907b"),i("1ce0"),e.exports=n},"703d":function(e,t){e.exports=require("element-ui/lib/theme-chalk/col.css")},"73ef":function(e,t){e.exports=require("element-ui/lib/theme-chalk/main.css")},"7c81":function(e,t){e.exports=require("core-js/modules/es.array.splice")},"7d9b":function(e,t,i){},"7f9f":function(e,t){e.exports=require("element-ui/lib/locale")},"80c4":function(e,t){e.exports=require("element-ui/lib/theme-chalk/option.css")},8278:function(e,t,i){i("bcd8");var n=i("da60"),r=i("9206").THREE,o=function(){var e=i("cf41").WEBGL,t=document.createElement("div"),n=void 0;if(t.style.height="100%",e.isWebGLAvailable()){var r=i("9206");n=new r.Renderer(t,window),r.defaultMaterialColor=16777116,n.initialiseVisualisation(),n.playAnimation=!1}else{var o=e.getWebGLErrorMessage();t.appendChild(o)}return{renderer:n,container:t}},s=function(){i("6aa6").BaseModule.call(this),this.scene=void 0,this.rendererContainer=void 0,this.displayArea=void 0,this.graphicsHighlight=new(i("5ec5").GraphicsHighlight),this.zincRenderer=null,this.selectedScreenCoordinates=new r.Vector3,this.selectedCenter=void 0};s.prototype=Object.create(i("6aa6").BaseModule.prototype),s.prototype.getIntersectedObject=function(e){if(e)for(var t=0;t<e.length;t++)if(void 0!==e[t]&&e[t].object&&e[t].object.userData&&e[t].object.userData.isZincObject&&(e[t].object.name||e[t].object.userData.isMarker))return e[t]},s.prototype.getAnnotationsFromObjects=function(e){for(var t=[],i=0;i<e.length;i++){var r=e[i].userData,o=void 0;if(r)if(r.isGlyph||r.isGlyphset){var s=r;r.isGlyph&&(n("glyphset"),s=r.getGlyphset()),o=s.userData?s.userData[0]:void 0,o&&o.data&&(e[i].name&&""!=e[i].name?o.data.id=e[i].name:o.data.id=s.groupName)}else o=r.userData?r.userData[0]:void 0,o&&o.data&&(o.data.id=e[i].name);t[i]=o}return t},s.prototype.setHighlightedByObjects=function(e,t){var n=this.graphicsHighlight.setHighlighted(e);if(n&&t){var r=i("9b21").EVENT_TYPE.HIGHLIGHTED,o=this.getAnnotationsFromObjects(e);this.publishChanges(o,r)}return n},s.prototype.setHighlightedByZincObject=function(e,t){return this.setHighlightedByObjects([e?e.morph:void 0],t)},s.prototype.setupLiveCoordinates=function(e){if(e&&e.length>0){var t=this.scene.getBoundingBoxOfZincObjects(e),i=new r.Vector3;t.getCenter(i),void 0==this.selectedCenter?this.selectedCenter=i:(this.selectedCenter.x=i.x,this.selectedCenter.y=i.y)}else this.selectedCenter=void 0},s.prototype.objectsToZincObjects=function(e){for(var t=[],i=0;i<e.length;i++){var n=e[i].userData;if(n)if(n.isGlyph||n.isGlyphset){var r=n;n.isGlyph&&(r=n.getGlyphset()),t.push(r)}else t.push(n)}return t},s.prototype.setSelectedByObjects=function(e,t){var n=this.graphicsHighlight.setSelected(e);if(n){var r=this.objectsToZincObjects(e);if(this.setupLiveCoordinates(r),t){var o=i("9b21").EVENT_TYPE.SELECTED,s=this.getAnnotationsFromObjects(e);this.publishChanges(s,o)}}return n},s.prototype.setSelectedByZincObject=function(e,t){return this.setSelectedByObjects([e?e.morph:void 0],t)};var a=function(e){return function(t){e.push(t.getMesh())}};s.prototype.findObjectsByGroupName=function(e){for(var t=this.scene.findGeometriesWithGroupName(e),i=[],n=0;n<t.length;n++)i.push(t[n].morph);for(var r=this.scene.findGlyphsetsWithGroupName(e),o=0;o<r.length;o++)r[o].forEachGlyph(a(i));return i},s.prototype.setHighlightedByGroupName=function(e,t){var i=this.findObjectsByGroupName(e);return this.setHighlightedByObjects(i,t)},s.prototype.setSelectedByGroupName=function(e,t){var i=this.findObjectsByGroupName(e);return this.setSelectedByObjects(i,t)},s.prototype.changeBackgroundColour=function(e){var t=new r.Color(e);if(this.zincRenderer){var i=this.zincRenderer.getThreeJSRenderer();i.setClearColor(t,1)}},s.prototype.resetView=function(){this.zincRenderer&&this.zincRenderer.resetView()},s.prototype.viewAll=function(){this.zincRenderer&&this.zincRenderer.viewAll()},s.prototype.playAnimation=function(e){this.zincRenderer&&(this.zincRenderer.playAnimation=e)},s.prototype.setPlayRate=function(e){this.zincRenderer&&this.zincRenderer.setPlayRate(e)},s.prototype.getPlayRate=function(e){return this.zincRenderer?this.zincRenderer.getPlayRate():0},s.prototype.initialiseRenderer=function(e){if(void 0===this.zincRenderer||void 0===this.rendererContainer){var t=o();this.zincRenderer=t["renderer"],this.rendererContainer=t["container"]}e&&(this.displayArea=e,this.displayArea.appendChild(this.rendererContainer),this.zincRenderer&&this.zincRenderer.animate())},s.prototype.destroy=function(){this.zincRenderer&&(this.zincRenderer.dispose(),this.zincRenderer.getThreeJSRenderer().dispose(),this.zincRenderer=void 0),i("6aa6").BaseModule.prototype.destroy.call(this)},t.RendererModule=s},"850c":function(e,t){e.exports=require("core-js/modules/es.object.to-string")},"8bbf":function(e,t){e.exports=require("vue")},"8c29":function(e,t){e.exports=require("element-ui/lib/tabs")},"8c84":function(e,t){e.exports=require("core-js/modules/es.array.iterator")},"8f11":function(e,t){e.exports=require("element-ui/lib/theme-chalk/icon.css")},"907b":function(e,t){e.exports=require("core-js/modules/es.string.iterator")},9206:function(e,t){e.exports=require("zincjs")},"920c":function(e,t,i){"use strict";i("dd89")},"93e6":function(e,t){e.exports=require("element-ui/lib/popover")},9776:function(e,t){e.exports=require("element-ui/lib/theme-chalk/slider.css")},"984d":function(e,t){t.annotation=function(){this.type="anatomical",this.data=void 0,this.isAnnotation=!0}},9985:function(e,t){e.exports=require("element-ui/lib/theme-chalk/tab-pane.css")},"9a25":function(e,t){e.exports=require("element-ui/lib/theme-chalk/base.css")},"9b21":function(e,t,i){i("7c81");var n={ALL:0,SELECTED:1,HIGHLIGHTED:2},r=function(e,t){this.eventType=e,this.identifiers=t},o=function(e,t,i){this.targetedID=[];var o=e,s=t;this.targetEventType=i;var a=this;void 0===i&&(this.targetEventType=n.ALL),this.getEventType=function(){return i},this.notify=function(e,t,i){if(e!==o&&(a.targetEventType===n.ALL||a.targetEventType===t)){var c=new r(t,i);s(c)}}};t.EventNotifier=function(){var e=[];this.publish=function(t,i,n){for(var r=0;r<e.length;r++)e[r].notify(t,i,n)},this.subscribe=function(t,i,n){if("function"===typeof i){var r=new o(t,i,n);return e.push(r),r}},this.unsubscribe=function(t){for(var i=0;i<e.length;i++)if(t===e[i])return void e.splice(i,1)}},t.EVENT_TYPE=n},"9bb0":function(e,t){e.exports=require("@soda/get-current-script")},a497:function(e,t){e.exports=require("element-ui/lib/col")},a525:function(e,t){e.exports=require("element-ui/lib/theme-chalk/popover.css")},a7bf:function(e,t){e.exports=require("element-ui/lib/slider")},ab7e:function(e,t){e.exports=require("core-js/modules/es.array.includes")},ab87:function(e,t){e.exports=require("element-ui/lib/loading")},add8:function(e,t,i){"use strict";i("e8d1")},b0e3:function(e,t){e.exports=require("element-ui/lib/theme-chalk/container.css")},b2f4:function(e,t){e.exports=require("element-ui/lib/icon")},b777:function(e,t){e.exports=require("element-ui/lib/checkbox")},bcd8:function(e,t){e.exports=require("core-js/modules/es.function.name")},bcda:function(e,t){e.exports=require("core-js/modules/web.dom-collections.for-each")},bfab:function(e,t){e.exports=require("core-js/modules/es.string.replace")},c11a:function(e,t){e.exports=require("element-ui/lib/option")},cf41:function(e,t,i){i("51f7"),i("bfab"),t.WEBGL={isWebGLAvailable:function(){try{var e=document.createElement("canvas");return!(!window.WebGLRenderingContext||!e.getContext("webgl")&&!e.getContext("experimental-webgl"))}catch(t){return!1}},isWebGL2Available:function(){try{var e=document.createElement("canvas");return!(!window.WebGL2RenderingContext||!e.getContext("webgl2"))}catch(t){return!1}},getWebGLErrorMessage:function(){return this.getErrorMessage(1)},getWebGL2ErrorMessage:function(){return this.getErrorMessage(2)},getErrorMessage:function(e){var t={1:"WebGL",2:"WebGL 2"},i={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext},n='This module requires <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#008">$1</a> support but your $0 does not seem to support it.',r=document.createElement("div");return r.id="webglmessage",r.style.fontFamily="monospace",r.style.fontSize="20px",r.style.fontWeight="normal",r.style.textAlign="center",r.style.background="#fff",r.style.color="#000",r.style.padding="1.5em",r.style.width="400px",r.style.margin="5em auto 0",n=i[e]?n.replace("$0","graphics card"):n.replace("$0","browser"),n=n.replace("$1",t[e]),r.innerHTML=n,r}}},da60:function(e,t){function i(e){throw new Error('"'+e+'" is read-only')}e.exports=i},dd89:function(e,t,i){},e42b:function(e,t){e.exports=require("core-js/modules/es.array.from")},e8d1:function(e,t,i){},fae3:function(e,t,i){"use strict";if(i.r(t),i.d(t,"ScaffoldVuer",(function(){return we})),"undefined"!==typeof window){var n=window.document.currentScript,r=i("9bb0");n=r(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:r});var o=n&&n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);o&&(i.p=o[1])}var s=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],ref:"scaffoldContainer",staticClass:"scaffold-container",attrs:{"element-loading-text":"Loading...","element-loading-spinner":"el-icon-loading","element-loading-background":"rgba(0, 0, 0, 0.3)"}},[i("SvgSpriteColor"),i("div",{ref:"display",staticStyle:{height:"100%",width:"100%"},attrs:{id:"organsDisplayArea",tabindex:"-1"},on:{keydown:function(t){return t.type.indexOf("key")||66===t.keyCode?e.backgroundChangeCallback(t):null}}}),i("div",{directives:[{name:"show",rawName:"v-show",value:e.displayUI&&!e.isTransitioning,expression:"displayUI && !isTransitioning"}]},[e.displayWarning?i("el-popover",{ref:"warningPopover",attrs:{content:e.warningMessage,placement:"right","append-to-body":!1,trigger:"manual","popper-class":"warning-popper right-popper non-selectable"},model:{value:e.hoverVisabilities[6].value,callback:function(t){e.$set(e.hoverVisabilities[6],"value",t)},expression:"hoverVisabilities[6].value"}}):e._e(),e.displayWarning?i("i",{directives:[{name:"popover",rawName:"v-popover:warningPopover",arg:"warningPopover"}],staticClass:"el-icon-warning warning-icon",on:{mouseover:function(t){return e.showToolitip(6)},mouseout:function(t){return e.hideToolitip(6)}}},[i("span",{staticClass:"warning-text"},[e._v("Beta")])]):e._e(),i("el-popover",{ref:"checkBoxPopover",attrs:{content:"Change region visibility",placement:"right","append-to-body":!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable"},model:{value:e.hoverVisabilities[5].value,callback:function(t){e.$set(e.hoverVisabilities[5],"value",t)},expression:"hoverVisabilities[5].value"}}),i("TraditionalControls",{directives:[{name:"popover",rawName:"v-popover:checkBoxPopover",arg:"checkBoxPopover"}],ref:"traditionalControl",attrs:{"help-mode":e.helpMode,module:e.$module,"show-colour-picker":e.showColourPicker},on:{"object-selected":e.objectSelected,"object-hovered":e.objectHovered,"drawer-toggled":e.drawerToggled}}),i("div",{staticClass:"opacity-box"},[i("OpacityControls",{ref:"opacityControl"})],1),e.sceneData.timeVarying?i("el-popover",{ref:"sliderPopover",attrs:{content:"Move the slider to animate the region",placement:"top","append-to-body":!1,trigger:"manual","popper-class":"scaffold-popper top-popper non-selectable"},model:{value:e.hoverVisabilities[4].value,callback:function(t){e.$set(e.hoverVisabilities[4],"value",t)},expression:"hoverVisabilities[4].value"}}):e._e(),e.sceneData.timeVarying?i("div",{directives:[{name:"popover",rawName:"v-popover:sliderPopover",arg:"sliderPopover"}],staticClass:"time-slider-container",class:[e.minimisedSlider?"minimised":"",e.sliderPosition]},[i("el-tabs",{attrs:{type:"card"}},[i("el-tab-pane",{attrs:{label:"Animate scaffold"}},[i("el-row",{staticClass:"tab-content"},[e.isPlaying?i("SvgIcon",{staticClass:"icon-button video-button",attrs:{icon:"pause"},nativeOn:{click:function(t){return e.play(!1)}}}):i("SvgIcon",{staticClass:"video-button icon-button",attrs:{icon:"play"},nativeOn:{click:function(t){return e.play(!0)}}}),i("el-slider",{staticClass:"slider",attrs:{min:0,max:e.timeMax,value:e.sceneData.currentTime/100*e.timeMax,step:.1,"tooltip-class":"time-slider-tooltip","format-tooltip":e.formatTooltip,marks:e.timeStamps},on:{input:function(t){return e.timeChange(t)}}})],1)],1),i("el-tab-pane",{attrs:{label:"Animation data"}},[i("el-row",{staticClass:"tab-content"},[i("div",{staticClass:"animation-data"},[e._v(" Original duration: "),i("div",{staticClass:"purple"},[e._v(" "+e._s(e.orginalDuration)+" ")])]),i("div",{staticClass:"animation-data"},[e._v(" Animation duration: "),i("div",{staticClass:"purple"},[e._v(" "+e._s(e.animateDuration)+" ")])]),i("div",{staticClass:"animation-data"},[e._v(" Playback speed "),i("el-select",{staticClass:"select-box",attrs:{"popper-append-to-body":!0,value:e.currentSpeed,placeholder:"Select","popper-class":"scaffold_viewer_dropdown"},on:{change:function(t){return e.speedChanged(t)}}},e._l(e.playSpeed,(function(e){return i("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)])],1)],1)],1):e._e(),i("div",{staticClass:"bottom-right-control"},[i("el-popover",{attrs:{content:"Zoom in",placement:"left","append-to-body":!1,trigger:"manual","popper-class":"scaffold-popper left-popper non-selectable"},model:{value:e.hoverVisabilities[0].value,callback:function(t){e.$set(e.hoverVisabilities[0],"value",t)},expression:"hoverVisabilities[0].value"}},[i("SvgIcon",{staticClass:"icon-button zoomIn",attrs:{slot:"reference",icon:"zoomIn"},nativeOn:{click:function(t){return e.zoomIn()},mouseover:function(t){return e.showToolitip(0)},mouseout:function(t){return e.hideToolitip(0)}},slot:"reference"})],1),i("el-popover",{attrs:{content:"Zoom out",placement:"top-end","append-to-body":!1,trigger:"manual","popper-class":"scaffold-popper popper-zoomout non-selectable"},model:{value:e.hoverVisabilities[1].value,callback:function(t){e.$set(e.hoverVisabilities[1],"value",t)},expression:"hoverVisabilities[1].value"}},[i("SvgIcon",{staticClass:"icon-button zoomOut",attrs:{slot:"reference",icon:"zoomOut"},nativeOn:{click:function(t){return e.zoomOut()},mouseover:function(t){return e.showToolitip(1)},mouseout:function(t){return e.hideToolitip(1)}},slot:"reference"})],1),i("el-popover",{attrs:{placement:"top","append-to-body":!1,trigger:"manual","popper-class":"scaffold-popper non-selectable"},model:{value:e.hoverVisabilities[2].value,callback:function(t){e.$set(e.hoverVisabilities[2],"value",t)},expression:"hoverVisabilities[2].value"}},[i("div",[e._v(" Fit to "),i("br"),e._v(" window ")]),i("SvgIcon",{staticClass:"icon-button fitWindow",attrs:{slot:"reference",icon:"fitWindow"},nativeOn:{click:function(t){return e.fitWindow()},mouseover:function(t){return e.showToolitip(2)},mouseout:function(t){return e.hideToolitip(2)}},slot:"reference"})],1)],1),i("el-popover",{ref:"backgroundPopover",attrs:{placement:"top-start",width:"128","append-to-body":!1,trigger:"click","popper-class":"background-popper non-selectable"}},[i("el-row",{staticClass:"backgroundText"},[e._v(" Change background ")]),i("el-row",{staticClass:"backgroundChooser"},e._l(e.availableBackground,(function(t){return i("div",{key:t,class:["backgroundChoice",t,t==e.currentBackground?"active":""],on:{click:function(i){return e.backgroundChangeCallback(t)}}})})),0)],1),i("el-popover",{attrs:{content:"Change background color",placement:"right","append-to-body":!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable"},model:{value:e.hoverVisabilities[3].value,callback:function(t){e.$set(e.hoverVisabilities[3],"value",t)},expression:"hoverVisabilities[3].value"}},[i("SvgIcon",{directives:[{name:"popover",rawName:"v-popover:backgroundPopover",arg:"backgroundPopover"}],staticClass:"icon-button background-colour",class:{open:e.drawerOpen,close:!e.drawerOpen},attrs:{slot:"reference",icon:"changeBckgd"},nativeOn:{mouseover:function(t){return e.showToolitip(3)},mouseout:function(t){return e.hideToolitip(3)}},slot:"reference"})],1)],1)],1)},a=[],c=(i("139f"),i("8c84"),i("319f"),i("2175"),i("850c"),i("907b"),i("bcda"),i("1ce0"),i("2a6f"),i("3170"),i("9a25"),i("8c29")),l=i.n(c),u=(i("9985"),i("31fb")),d=i.n(u),h=(i("9776"),i("a7bf")),p=i.n(h),f=(i("0fe2"),i("0de2")),m=i.n(f),v=(i("fd9c"),i("6ea3")),g=i.n(v),b=(i("a525"),i("93e6")),y=i.n(b),C=(i("80c4"),i("c11a")),w=i.n(C),k=(i("2c1b"),i("ab87")),x=i.n(k),R=(i("703d"),i("a497")),S=i.n(R),O=i("8bbf"),j=i.n(O),D=function(){var e=this,t=e.$createElement,i=e._self._c||t;return void 0!=e.material?i("div",{ref:"control",staticClass:"opacity-control"},[i("el-drawer",{staticClass:"drawer-content",attrs:{"custom-class":"my-drawer",visible:e.drawerOpen,"append-to-body":!1,"modal-append-to-body":!1,size:"300","with-header":!1,"wrapper-closable":!1,modal:!1},on:{"update:visible":function(t){e.drawerOpen=t}}},[e.drawerOpen?i("div",{staticClass:"tab-button close",on:{click:e.toggleDrawer}},[i("i",{staticClass:"el-icon-arrow-right"})]):e._e(),i("el-container",{staticClass:"opacity-container"},[i("el-header",{staticClass:"header",attrs:{height:"37px"}},[i("div",[e._v("Opacity")])]),i("el-main",{staticClass:"main"},[i("div",{staticClass:"block"},[i("span",{staticClass:"display"},[e._v(e._s(e.displayString))]),i("el-slider",{staticClass:"my-slider",attrs:{step:.01,min:0,max:1,"format-tooltip":e.formatTooltip,"show-tooltip":!1},model:{value:e.material.opacity,callback:function(t){e.$set(e.material,"opacity",t)},expression:"material.opacity"}})],1)])],1)],1),e.drawerOpen?e._e():i("div",{staticClass:"tab-button open",on:{click:e.toggleDrawer}},[i("i",{staticClass:"el-icon-arrow-left"})])],1):e._e()},$=[],T=(i("73ef"),i("1fe8")),L=i.n(T),N=(i("8f11"),i("b2f4")),A=i.n(N),P=(i("51c7"),i("2de2")),G=i.n(P),_=(i("4c89"),i("373b")),M=i.n(_),B=(i("b0e3"),i("1ac9")),V=i.n(B),E=i("6bfd"),q=i.n(E),U=i("7f9f"),H=i.n(U);H.a.use(q.a),j.a.use(V.a),j.a.use(M.a),j.a.use(G.a),j.a.use(A.a),j.a.use(L.a),j.a.use(p.a);var I={name:"OpacityControls",data:function(){return{displayString:"100%",material:void 0,drawerOpen:!0}},watch:{"material.opacity":function(){this.material&&this._zincobject.setAlpha(this.material.opacity)}},mounted:function(){this._zincobject=void 0},methods:{formatTooltip:function(e){return this.displayString=Math.floor(100*e+.5)+"%",this.displayString},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},setObject:function(e){this.material=e?e.morph.material:void 0,this._zincobject=e}}},z=I;i("21a1");function F(e,t,i,n,r,o,s,a){var c,l="function"===typeof e?e.options:e;if(t&&(l.render=t,l.staticRenderFns=i,l._compiled=!0),n&&(l.functional=!0),o&&(l._scopeId="data-v-"+o),s?(c=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},l._ssrRegister=c):r&&(c=a?function(){r.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:r),c)if(l.functional){l._injectStyles=c;var u=l.render;l.render=function(e,t){return c.call(t),u(e,t)}}else{var d=l.beforeCreate;l.beforeCreate=d?[].concat(d,c):[c]}return{exports:e,options:l}}var W=F(z,D,$,!1,null,"4c00a30f",null),Z=W.exports,Y=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"traditional-location",class:{open:e.drawerOpen,close:!e.drawerOpen}},[i("div",{staticClass:"traditional-container"},[i("el-row",[i("el-col",{attrs:{span:12}},[i("div",{staticClass:"regions-display-text"},[e._v(" Regions ")])]),i("el-col",{attrs:{span:12}},[i("el-checkbox",{staticClass:"all-checkbox",attrs:{indeterminate:e.isIndeterminate},on:{change:e.handleCheckAllChange},model:{value:e.checkAll,callback:function(t){e.checkAll=t},expression:"checkAll"}},[e._v(" Display all ")])],1)],1),i("el-checkbox-group",{staticClass:"checkbox-group",attrs:{size:"small"},on:{change:e.handleCheckedItemsChange},model:{value:e.checkedItems,callback:function(t){e.checkedItems=t},expression:"checkedItems"}},[i("div",{staticClass:"checkbox-group-inner"},e._l(e.sortedPrimitiveGroups,(function(t){return i("el-row",{key:t,attrs:{label:t}},[i("div",{staticClass:"checkbox-container"},[i("el-checkbox",{staticClass:"my-checkbox",class:{activeItem:e.activeRegion===t,hoverItem:e.hoverRegion===t},attrs:{label:t,checked:!0},on:{change:function(i){return e.visibilityToggle(t,i)}},nativeOn:{click:function(i){return e.itemClicked(t,i)},mouseover:function(i){return e.checkboxHover(t)}}},[i("el-color-picker",{class:{"show-picker":e.showColourPicker},attrs:{value:e.getColour(t),size:"small","popper-class":e.myPopperClass},on:{change:function(i){return e.setColour(t,i)}}}),e._v(" "+e._s(t)+" ")],1)],1)])})),1)])],1),i("div",{staticClass:"drawer-button",class:{open:e.drawerOpen,close:!e.drawerOpen},on:{click:e.toggleDrawer}},[i("i",{staticClass:"el-icon-arrow-left"})])])},J=[];i("18d2"),i("ab7e"),i("6bb1"),i("7c81"),i("51f7"),i("fd48"),i("bfab");function X(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function K(e){if(Array.isArray(e))return X(e)}i("6049"),i("51e9"),i("02ac"),i("e42b");function Q(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}i("6579"),i("bcd8"),i("5fef");function ee(e,t){if(e){if("string"===typeof e)return X(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(i):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?X(e,t):void 0}}function te(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ie(e){return K(e)||Q(e)||ee(e)||te()}i("3666");var ne=i("4914"),re=i.n(ne),oe=(i("0cf4"),i("0607")),se=i.n(oe),ae=(i("55ee"),i("b777")),ce=i.n(ae),le=i("6814"),ue=i("4e2d");H.a.use(q.a),j.a.use(ce.a),j.a.use(se.a),j.a.use(re.a),j.a.use(g.a);var de={name:"TraditionalControls",props:{module:{type:Object,default:void 0},showColourPicker:Boolean},data:function(){return{checkAll:!0,isIndeterminate:!1,checkedItems:[],sortedPrimitiveGroups:[],activeRegion:"",hoverRegion:"",myPopperClass:"hide-scaffold-colour-popup",drawerOpen:!0}},watch:{showColourPicker:{immediate:!0,handler:function(){this.showColourPicker?this.myPopperClass="showPicker":this.myPopperClass="hide-scaffold-colour-popup"}}},created:function(){var e=this.module.sceneData.geometries.concat(this.module.sceneData.lines);e=e.concat(this.module.sceneData.glyphsets),e=ue(e.concat(this.module.sceneData.pointset)),this.sortedPrimitiveGroups=le(e),this.module.addOrganPartAddedCallback(this.organsAdded),this.module.graphicsHighlight.selectColour=4473924},destroyed:function(){this.sortedPrimitiveGroups=void 0},methods:{organsAdded:function(e){if(e&&""!=e){var t=ue(this.sortedPrimitiveGroups.concat([e]));t=le(t);var i=t.indexOf(void 0);i>-1&&t.splice(i,1),this.sortedPrimitiveGroups=t}},changeActiveByName:function(e,t){var i=this.getFirstZincObjectWithGroupName(e);i&&i.getVisibility()?(this.activeRegion=e,this.$emit("object-selected",i,t)):this.removeActive(t),this.removeHover(t)},changeHoverByName:function(e,t){var i=this.getFirstZincObjectWithGroupName(e);i?(this.hoverRegion=e,this.$emit("object-hovered",i,t)):this.removeHover(t)},removeActive:function(e){this.activeRegion="",this.$emit("object-selected",void 0,e)},removeHover:function(e){this.hoverRegion="",this.$emit("object-hovered",void 0,e)},clear:function(){this.sortedPrimitiveGroups=[],this.checkedItems=[],this.checkAll=!0,this.isIndeterminate=!1,this.activeRegion="",this.hoverRegion="",this.$emit("object-selected",void 0)},getFirstZincObjectWithGroupName:function(e){if(this.module&&this.module.scene){var t=this.module.scene.findGeometriesWithGroupName(e);if(t.length>0)return t[0];if(t=this.module.scene.findGlyphsetsWithGroupName(e),t.length>0)return t[0];if(t=this.module.scene.findLinesWithGroupName(e),t.length>0)return t[0];if(t=this.module.scene.findPointsetsWithGroupName(e),t.length>0)return t[0]}},getColour:function(e){var t=this.getFirstZincObjectWithGroupName(e);if(t){var i=t.getColourHex();if(i)return"#"+i}return"#FFFFFF"},setColour:function(e,t){var i=this.getFirstZincObjectWithGroupName(e);if(i){var n=t.replace("#","0x");i.setColourHex(n)}},checkboxHover:function(e){this.changeHoverByName(e,!0)},itemClicked:function(e,t){t.target.classList.contains("el-checkbox__inner")||t.target.classList.contains("el-checkbox__original")||(this.changeActiveByName(e,!0),t.preventDefault())},handleCheckedItemsChange:function(){var e=!!this.checkedItems.includes(void 0),t=this.checkedItems.length;e&&t--,this.checkAll=t===this.sortedPrimitiveGroups.length,this.isIndeterminate=t>0&&t<this.sortedPrimitiveGroups.length},handleCheckAllChange:function(e){this.checkedItems=e?ie(this.sortedPrimitiveGroups):[],this.isIndeterminate=!1;for(var t=0;t<this.sortedPrimitiveGroups.length;t++)this.visibilityToggle(this.sortedPrimitiveGroups[t],this.checkAll)},viewAll:function(){this.module.viewAll()},visibilityToggle:function(e,t){this.module.changeOrganPartsVisibility(e,t),0==t&&(this.activeRegion===e&&this.removeActive(!0),this.hoverRegion===e&&this.removeHover(!0))},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen,this.$emit("drawer-toggled",this.drawerOpen)},getState:function(){if(this.checkAll)return{checkAll:!0};var e=ie(this.checkedItems),t=e.indexOf(void 0);return t>-1&&e.splice(t,1),{checkedItems:e}},setState:function(e){if(e)if(e.checkAll){this.checkedItems=ie(this.sortedPrimitiveGroups);for(var t=0;t<this.sortedPrimitiveGroups.length;t++)this.module.changeOrganPartsVisibility(this.sortedPrimitiveGroups[t],!0)}else if(e.checkedItems){this.checkedItems=ie(e.checkedItems);for(var i=0;i<this.sortedPrimitiveGroups.length;i++){var n=this.checkedItems.includes(this.sortedPrimitiveGroups[i]);this.module.changeOrganPartsVisibility(this.sortedPrimitiveGroups[i],n)}}this.handleCheckedItemsChange()}}},he=de,pe=(i("920c"),i("add8"),F(he,Y,J,!1,null,"b0ace276",null)),fe=pe.exports,me=i("429c");H.a.use(q.a),j.a.use(S.a),j.a.use(x.a.directive),j.a.use(w.a),j.a.use(y.a),j.a.use(g.a),j.a.use(m.a),j.a.use(p.a),j.a.use(d.a),j.a.use(l.a);var ve=i("53d7").OrgansViewer,ge=i("9b21").EventNotifier,be={name:"ScaffoldVuer",components:{OpacityControls:Z,SvgIcon:me["SvgIcon"],SvgSpriteColor:me["SvgSpriteColor"],TraditionalControls:fe},props:{url:{type:String,default:""},showColourPicker:{type:Boolean,default:!1},displayUI:{type:Boolean,default:!0},displayAtStartUp:{type:Boolean,default:!0},helpMode:{type:Boolean,default:!1},displayWarning:{type:Boolean,default:!0},warningMessage:{type:String,default:"Beta feature - under active development"},displayMarkers:{type:Boolean,default:!0},displayMinimap:{type:Boolean,default:!1},minimapSettings:{type:Object,default:function(){return{x_offset:16,y_offset:16,width:128,height:128,align:"top-right"}}},state:{type:Object,default:void 0},region:{type:String,default:""},viewURL:{type:String,default:""},render:{type:Boolean,default:!0}},data:function(){return{sceneData:this.$module.sceneData,isPlaying:!1,isTransitioning:!1,tooltipAppendToBody:!1,hoverVisabilities:[{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1}],inHelp:!1,loading:!1,duration:3e3,drawerOpen:!0,currentBackground:"white",availableBackground:["white","lightskyblue","black"],minimisedSlider:!1,sliderPosition:"",timeMax:100,orginalDuration:"",animateDuration:"6secs",playSpeed:[{value:.1,label:"0.1x"},{value:.5,label:"0.5x"},{value:1,label:"1x"},{value:2,label:"2x"},{value:5,label:"5x"},{value:10,label:"10x"}],currentSpeed:1,timeStamps:{}}},watch:{url:{handler:function(e){void 0!==this.state&&void 0!==this.state.url||this.setURL(e)},immediate:!0},region:{handler:function(e){this.state||this.viewURL||this.setFocusedRegion(e)},immediate:!0},state:{handler:function(e){this.setState(e)},immediate:!0,deep:!0},viewURL:{handler:function(e){this.updateViewURL(e)},immediate:!0},helpMode:function(e){this.setHelpMode(e)},displayMarkers:function(e){this.$module.scene.displayMarkers=e},displayMinimap:function(e){this.$module.scene.displayMinimap=e},"sceneData.currentTime":function(){this.$emit("timeChanged",this.sceneData.currentTime)},duration:function(){this.$module.scene.setDuration(this.duration)},minimapSettings:{deep:!0,handler:"updateMinimapScissor"},render:function(e){this.toggleRendering(e)}},beforeCreate:function(){this.$module=new ve,this.isReady=!1,this.selectedObject=void 0,this.hoveredObject=void 0,this.currentBackground="white",this._currentURL=void 0,this.availableBackground=["white","black","lightskyblue"]},mounted:function(){var e=new ge;e.subscribe(this,this.eventNotifierCallback),this.$module.addNotifier(e),this.$module.addOrganPartAddedCallback(this.organsAdded),this.$module.initialiseRenderer(this.$refs.display),this.toggleRendering(this.render),this.ro=new ResizeObserver(this.adjustLayout).observe(this.$refs.scaffoldContainer),this.defaultRate=this.$module.getPlayRate()},beforeDestroy:function(){this.ro&&this.ro.disconnect(),this.$module.destroy(),this.$module=void 0},methods:{organsAdded:function(){this.loading=!1},backgroundChangeCallback:function(e){this.currentBackground=e,this.$module.zincRenderer.getThreeJSRenderer().setClearColor(this.currentBackground,1)},captureScreenshotCallback:function(){this.$module.zincRenderer.removePostRenderCallbackFunction(this.captureID);var e=this.$module.zincRenderer.getThreeJSRenderer().domElement.toDataURL("image/png"),t=document.createElement("a");document.body.append(t),this.captureFilename?t.download=this.captureFilename:t.download="screenshot.png",t.href=e,t.click(),t.remove()},captureScreenshot:function(e){this.captureFilename=e,this.captureID=this.$module.zincRenderer.addPostRenderCallbackFunction(this.captureScreenshotCallback)},formatTooltip:function(e){if(this.timeMax>=1e3&&e){var t=(e%6e4/1e3).toFixed(2)+"s",i=e>6e4?(e/6e4).toFixed(0)+"m ":"";return i+t}return e?e.toFixed(2)+" ms":"0 ms"},fitWindow:function(){this.$module.scene&&this.$module.scene.viewAll()},zoomIn:function(){this.$module.scene&&this.$module.scene.changeZoomByScrollRateUnit(-1)},zoomOut:function(){this.$module.scene&&this.$module.scene.changeZoomByScrollRateUnit(1)},speedChanged:function(e){this.currentSpeed=e,this.$module.setPlayRate(this.defaultRate*this.currentSpeed)},stopFreeSpin:function(){var e=this.$module.scene.getZincCameraControls();e.stopAutoTumble(),this.isTransitioning=!1},viewRegion:function(e){if(e&&""!=e&&this.$module.scene){var t=this.$module.scene.findObjectsWithGroupName(e),i=this.$module.scene.getBoundingBoxOfZincObjects(t);i&&this.$module.scene.viewAllWithBoundingBox(i)}},setFocusedRegion:function(e){e&&(this.isReady?this.viewRegion(e):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({region:e})))},updateViewURL:function(e){if(e)if(this.isReady){var t=new URL(e,this.url);this.$module.scene.loadViewURL(t)}else this.$module.setFinishDownloadCallback(this.setURLFinishCallback({viewURL:e}))},getRendererInfo:function(){if(this.$module.zincRenderer)return this.$module.zincRenderer.getThreeJSRenderer().info},freeSpin:function(){if(this.$module.scene){var e=this.$module.scene.getZincCameraControls();this.isTransitioning=!0,e.enableAutoTumble(),e.autoTumble([1,0],Math.PI,!0),setTimeout(this.stopFreeSpin,4e3)}},eventNotifierCallback:function(e){if(1==e.eventType){if(this.$refs.traditionalControl)if(e.identifiers[0]){var t=e.identifiers[0].data.id?e.identifiers[0].data.id:e.identifiers[0].data.group;this.$refs.traditionalControl.changeActiveByName(t,!0)}else this.$refs.traditionalControl.removeActive(!0);this.$emit("scaffold-selected",e.identifiers)}else if(2==e.eventType){if(this.$refs.traditionalControl)if(e.identifiers[0]){var i=e.identifiers[0].data.id?e.identifiers[0].data.id:e.identifiers[0].data.group;this.$refs.traditionalControl.changeHoverByName(i,!0)}else this.$refs.traditionalControl.removeHover(!0);this.$emit("scaffold-highlighted",e.identifiers)}},getCoordinatesOfSelected:function(){if(this.selectedObject)return this.$module.scene.getObjectsScreenXY([this.selectedObject])},getDynamicSelectedCoordinates:function(){return this.$module.selectedScreenCoordinates},timeChange:function(e){var t=e/this.timeMax*100;t!=this.sceneData.currentTime&&this.$module.updateTime(t)},objectSelected:function(e,t){e!==this.selectedObject&&(this.selectedObject=e,this.$refs.opacityControl.setObject(this.selectedObject),e?this.$module.setSelectedByZincObject(e,t):this.$module.setSelectedByObjects([],t))},objectHovered:function(e,t){e!==this.hoveredObject&&(this.hoveredObject=e,e?this.$module.setHighlightedByZincObject(e,t):this.$module.setHighlightedByObjects([],t))},changeActiveByName:function(e,t){void 0===e?this.$refs.traditionalControl.removeActive(t):this.$refs.traditionalControl.changeActiveByName(e,t)},changeHighlightedByName:function(e,t){void 0===e?this.$refs.traditionalControl.removeHover(t):this.$refs.traditionalControl.changeHoverByName(e,t)},play:function(e){this.$module.playAnimation(e),this.isPlaying=e},setHelpMode:function(e){e?(this.inHelp=!0,this.hoverVisabilities.forEach((function(e){e.value=!0}))):(this.inHelp=!1,this.hoverVisabilities.forEach((function(e){e.value=!1})))},showToolitip:function(e){var t=this;this.inHelp||(this.tooltipWait=setTimeout((function(){t.hoverVisabilities[e].value=!0}),500))},hideToolitip:function(e){this.inHelp||(this.hoverVisabilities[e].value=!1,clearTimeout(this.tooltipWait))},updateMinimapScissor:function(){var e=this;Object.keys(this.minimapSettings).forEach((function(t){e.$module.scene.minimapScissor[t]=e.minimapSettings[t]})),this.$module.scene.minimapScissor.updateRequired=!0},updateSettingsfromScene:function(){this.currentSpeed=1,this.$module.setPlayRate(this.defaultRate),this.orginalDuration=this.$module.scene.getMetadataTag("OriginalDuration"),this.animateDuration=this.$module.scene.getMetadataTag("Duration");var e=this.$module.scene.getMetadataTag("TimeStamps");for(var t in this.timeStamps={},e)this.timeStamps[e[t]]=t;this.timeMax=this.$module.scene.getDuration()},setURLFinishCallback:function(e){var t=this;return function(){if(e){if(e.viewport)t.$module.scene.getZincCameraControls().setCurrentCameraSettings(e.viewport);else if(e.viewURL&&""!==e.viewURL){var i=new URL(e.viewURL,t.url);t.$module.scene.loadViewURL(i)}else e.region&&""!==e.region&&t.viewRegion(e.region);e.visibility&&t.$nextTick((function(){t.$refs.traditionalControl.setState(e.visibility)}))}t.updateSettingsfromScene(),t.$module.updateTime(.01),t.$module.updateTime(0),t.$module.unsetFinishDownloadCallback(),t.isReady=!0}},getState:function(){var e={url:this._currentURL,viewport:void 0,visibility:void 0};if(this.$refs.traditionalControl&&(e.visibility=this.$refs.traditionalControl.getState()),this.$module.scene){var t=this.$module.scene.getZincCameraControls();e.viewport=t.getCurrentViewport()}return e},setState:function(e){e&&(e.url&&e.url!==this._currentURL?this.setURLAndState(e.url,{viewport:e.viewport,visibility:e.visibility}):(e.viewport||e.visibility)&&(this.isReady&&this.$module.scene?(e.viewport&&this.$module.scene.getZincCameraControls().setCurrentCameraSettings(e.viewport),e.visibility&&this.$refs.traditionalControl.setState(e.visibility)):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({viewport:e.viewport,visibility:e.visibility}))))},exportGLTF:function(e){return this.$module.scene.exportGLTF(e)},setURLAndState:function(e,t){if(e!=this._currentURL){var i=t&&t.viewport?t.viewport:void 0,n=t&&t.visibility?t.visibility:void 0;this._currentURL=e,this.$refs.traditionalControl&&this.$refs.traditionalControl.clear(),this.loading=!0,this.isReady=!1,this.$module.setFinishDownloadCallback(this.setURLFinishCallback({viewport:i,region:this.region,viewURL:this.viewURL,visibility:n})),this.$module.loadOrgansFromURL(e,void 0,void 0,"scene",void 0),this.$module.scene.displayMarkers=this.displayMarkers,this.$module.scene.displayMinimap=this.displayMinimap,this.updateMinimapScissor()}},setURL:function(e){this.setURLAndState(e,void 0)},drawerToggled:function(e){this.drawerOpen=e,this.adjustLayout()},adjustLayout:function(){var e=this.$refs.scaffoldContainer.clientWidth;this.minimisedSlider=e<812,this.minimisedSlider?this.sliderPosition=this.drawerOpen?"right":"left":this.sliderPosition=""},toggleRendering:function(e){this.$module.zincRenderer&&(e?this.$module.zincRenderer.animate():this.$module.zincRenderer.stopAnimate())},forceResize:function(){this.$module.zincRenderer&&this.$module.zincRenderer.onWindowResize()}}},ye=be,Ce=(i("27fc"),i("642d"),F(ye,s,a,!1,null,"3d37f502",null)),we=Ce.exports},fd48:function(e,t){e.exports=require("core-js/modules/es.string.includes")},fd9c:function(e,t){e.exports=require("element-ui/lib/theme-chalk/row.css")}})}));
|
|
196
2
|
//# sourceMappingURL=scaffoldvuer.umd.min.js.map
|