diff --git a/dist/index.js b/dist/index.js
index f3b89a6..2461bd2 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -1,4 +1,4 @@
-!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.gltfBoundingBox=n():t.gltfBoundingBox=n()}(this,function(){return function(t){var n={};function r(e){if(n[e])return n[e].exports;var i=n[e]={i:e,l:!1,exports:{}};return t[e].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=n,r.d=function(t,n,e){r.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:e})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,n){if(1&n&&(t=r(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(r.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var i in t)r.d(e,i,function(n){return t[n]}.bind(null,i));return e},r.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(n,"a",n),n},r.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},r.p="",r(r.s=6)}([function(t,n,r){"use strict";n.Matrix=r(8)},function(t,n,r){(function(t,e){var i;
+!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.gltfBoundingBox=e():t.gltfBoundingBox=e()}(this,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},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=7)}([function(t,e,n){"use strict";e.Matrix=n(9)},function(t,e,n){(function(t,r){var i;
/**
* @license
* Lodash
@@ -6,12 +6,16 @@
* Released under MIT license
* Based on Underscore.js 1.8.3
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- */(function(){var u,o=200,f="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",c="__lodash_hash_undefined__",s=500,l="__lodash_placeholder__",h=1,p=2,v=4,g=1,_=2,y=1,d=2,w=4,m=8,b=16,A=32,x=64,E=128,R=256,B=512,P=30,j="...",O=800,I=16,S=1,T=2,M=1/0,U=9007199254740991,L=1.7976931348623157e308,k=NaN,D=4294967295,C=D-1,z=D>>>1,Y=[["ary",E],["bind",y],["bindKey",d],["curry",m],["curryRight",b],["flip",B],["partial",A],["partialRight",x],["rearg",R]],N="[object Arguments]",W="[object Array]",F="[object AsyncFunction]",$="[object Boolean]",q="[object Date]",V="[object DOMException]",Z="[object Error]",K="[object Function]",G="[object GeneratorFunction]",J="[object Map]",H="[object Number]",X="[object Null]",Q="[object Object]",tt="[object Proxy]",nt="[object RegExp]",rt="[object Set]",et="[object String]",it="[object Symbol]",ut="[object Undefined]",ot="[object WeakMap]",ft="[object WeakSet]",at="[object ArrayBuffer]",ct="[object DataView]",st="[object Float32Array]",lt="[object Float64Array]",ht="[object Int8Array]",pt="[object Int16Array]",vt="[object Int32Array]",gt="[object Uint8Array]",_t="[object Uint8ClampedArray]",yt="[object Uint16Array]",dt="[object Uint32Array]",wt=/\b__p \+= '';/g,mt=/\b(__p \+=) '' \+/g,bt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,At=/&(?:amp|lt|gt|quot|#39);/g,xt=/[&<>"']/g,Et=RegExp(At.source),Rt=RegExp(xt.source),Bt=/<%-([\s\S]+?)%>/g,Pt=/<%([\s\S]+?)%>/g,jt=/<%=([\s\S]+?)%>/g,Ot=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,It=/^\w*$/,St=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Tt=/[\\^$.*+?()[\]{}|]/g,Mt=RegExp(Tt.source),Ut=/^\s+|\s+$/g,Lt=/^\s+/,kt=/\s+$/,Dt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ct=/\{\n\/\* \[wrapped with (.+)\] \*/,zt=/,? & /,Yt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Nt=/\\(\\)?/g,Wt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ft=/\w*$/,$t=/^[-+]0x[0-9a-f]+$/i,qt=/^0b[01]+$/i,Vt=/^\[object .+?Constructor\]$/,Zt=/^0o[0-7]+$/i,Kt=/^(?:0|[1-9]\d*)$/,Gt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Jt=/($^)/,Ht=/['\n\r\u2028\u2029\\]/g,Xt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Qt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",tn="[\\ud800-\\udfff]",nn="["+Qt+"]",rn="["+Xt+"]",en="\\d+",un="[\\u2700-\\u27bf]",on="[a-z\\xdf-\\xf6\\xf8-\\xff]",fn="[^\\ud800-\\udfff"+Qt+en+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",an="\\ud83c[\\udffb-\\udfff]",cn="[^\\ud800-\\udfff]",sn="(?:\\ud83c[\\udde6-\\uddff]){2}",ln="[\\ud800-\\udbff][\\udc00-\\udfff]",hn="[A-Z\\xc0-\\xd6\\xd8-\\xde]",pn="(?:"+on+"|"+fn+")",vn="(?:"+hn+"|"+fn+")",gn="(?:"+rn+"|"+an+")"+"?",_n="[\\ufe0e\\ufe0f]?"+gn+("(?:\\u200d(?:"+[cn,sn,ln].join("|")+")[\\ufe0e\\ufe0f]?"+gn+")*"),yn="(?:"+[un,sn,ln].join("|")+")"+_n,dn="(?:"+[cn+rn+"?",rn,sn,ln,tn].join("|")+")",wn=RegExp("['’]","g"),mn=RegExp(rn,"g"),bn=RegExp(an+"(?="+an+")|"+dn+_n,"g"),An=RegExp([hn+"?"+on+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[nn,hn,"$"].join("|")+")",vn+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[nn,hn+pn,"$"].join("|")+")",hn+"?"+pn+"+(?:['’](?:d|ll|m|re|s|t|ve))?",hn+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",en,yn].join("|"),"g"),xn=RegExp("[\\u200d\\ud800-\\udfff"+Xt+"\\ufe0e\\ufe0f]"),En=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Rn=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Bn=-1,Pn={};Pn[st]=Pn[lt]=Pn[ht]=Pn[pt]=Pn[vt]=Pn[gt]=Pn[_t]=Pn[yt]=Pn[dt]=!0,Pn[N]=Pn[W]=Pn[at]=Pn[$]=Pn[ct]=Pn[q]=Pn[Z]=Pn[K]=Pn[J]=Pn[H]=Pn[Q]=Pn[nt]=Pn[rt]=Pn[et]=Pn[ot]=!1;var jn={};jn[N]=jn[W]=jn[at]=jn[ct]=jn[$]=jn[q]=jn[st]=jn[lt]=jn[ht]=jn[pt]=jn[vt]=jn[J]=jn[H]=jn[Q]=jn[nt]=jn[rt]=jn[et]=jn[it]=jn[gt]=jn[_t]=jn[yt]=jn[dt]=!0,jn[Z]=jn[K]=jn[ot]=!1;var On={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},In=parseFloat,Sn=parseInt,Tn="object"==typeof t&&t&&t.Object===Object&&t,Mn="object"==typeof self&&self&&self.Object===Object&&self,Un=Tn||Mn||Function("return this")(),Ln="object"==typeof n&&n&&!n.nodeType&&n,kn=Ln&&"object"==typeof e&&e&&!e.nodeType&&e,Dn=kn&&kn.exports===Ln,Cn=Dn&&Tn.process,zn=function(){try{var t=kn&&kn.require&&kn.require("util").types;return t||Cn&&Cn.binding&&Cn.binding("util")}catch(t){}}(),Yn=zn&&zn.isArrayBuffer,Nn=zn&&zn.isDate,Wn=zn&&zn.isMap,Fn=zn&&zn.isRegExp,$n=zn&&zn.isSet,qn=zn&&zn.isTypedArray;function Vn(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}function Zn(t,n,r,e){for(var i=-1,u=null==t?0:t.length;++i-1}function Qn(t,n,r){for(var e=-1,i=null==t?0:t.length;++e-1;);return r}function br(t,n){for(var r=t.length;r--&&ar(n,t[r],0)>-1;);return r}var Ar=pr({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),xr=pr({"&":"&","<":"<",">":">",'"':""","'":"'"});function Er(t){return"\\"+On[t]}function Rr(t){return xn.test(t)}function Br(t){var n=-1,r=Array(t.size);return t.forEach(function(t,e){r[++n]=[e,t]}),r}function Pr(t,n){return function(r){return t(n(r))}}function jr(t,n){for(var r=-1,e=t.length,i=0,u=[];++r",""":'"',"'":"'"});var Lr=function t(n){var r=(n=null==n?Un:Lr.defaults(Un.Object(),n,Lr.pick(Un,Rn))).Array,e=n.Date,i=n.Error,Xt=n.Function,Qt=n.Math,tn=n.Object,nn=n.RegExp,rn=n.String,en=n.TypeError,un=r.prototype,on=Xt.prototype,fn=tn.prototype,an=n["__core-js_shared__"],cn=on.toString,sn=fn.hasOwnProperty,ln=0,hn=function(){var t=/[^.]+$/.exec(an&&an.keys&&an.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),pn=fn.toString,vn=cn.call(tn),gn=Un._,_n=nn("^"+cn.call(sn).replace(Tt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),yn=Dn?n.Buffer:u,dn=n.Symbol,bn=n.Uint8Array,xn=yn?yn.allocUnsafe:u,On=Pr(tn.getPrototypeOf,tn),Tn=tn.create,Mn=fn.propertyIsEnumerable,Ln=un.splice,kn=dn?dn.isConcatSpreadable:u,Cn=dn?dn.iterator:u,zn=dn?dn.toStringTag:u,ur=function(){try{var t=Cu(tn,"defineProperty");return t({},"",{}),t}catch(t){}}(),pr=n.clearTimeout!==Un.clearTimeout&&n.clearTimeout,kr=e&&e.now!==Un.Date.now&&e.now,Dr=n.setTimeout!==Un.setTimeout&&n.setTimeout,Cr=Qt.ceil,zr=Qt.floor,Yr=tn.getOwnPropertySymbols,Nr=yn?yn.isBuffer:u,Wr=n.isFinite,Fr=un.join,$r=Pr(tn.keys,tn),qr=Qt.max,Vr=Qt.min,Zr=e.now,Kr=n.parseInt,Gr=Qt.random,Jr=un.reverse,Hr=Cu(n,"DataView"),Xr=Cu(n,"Map"),Qr=Cu(n,"Promise"),te=Cu(n,"Set"),ne=Cu(n,"WeakMap"),re=Cu(tn,"create"),ee=ne&&new ne,ie={},ue=co(Hr),oe=co(Xr),fe=co(Qr),ae=co(te),ce=co(ne),se=dn?dn.prototype:u,le=se?se.valueOf:u,he=se?se.toString:u;function pe(t){if(jf(t)&&!yf(t)&&!(t instanceof ye)){if(t instanceof _e)return t;if(sn.call(t,"__wrapped__"))return so(t)}return new _e(t)}var ve=function(){function t(){}return function(n){if(!Pf(n))return{};if(Tn)return Tn(n);t.prototype=n;var r=new t;return t.prototype=u,r}}();function ge(){}function _e(t,n){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=u}function ye(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=D,this.__views__=[]}function de(t){var n=-1,r=null==t?0:t.length;for(this.clear();++n=n?t:n)),t}function Le(t,n,r,e,i,o){var f,a=n&h,c=n&p,s=n&v;if(r&&(f=i?r(t,e,i,o):r(t)),f!==u)return f;if(!Pf(t))return t;var l=yf(t);if(l){if(f=function(t){var n=t.length,r=new t.constructor(n);return n&&"string"==typeof t[0]&&sn.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!a)return ru(t,f)}else{var g=Nu(t),_=g==K||g==G;if(bf(t))return Ji(t,a);if(g==Q||g==N||_&&!i){if(f=c||_?{}:Fu(t),!a)return c?function(t,n){return eu(t,Yu(t),n)}(t,function(t,n){return t&&eu(n,ua(n),t)}(f,t)):function(t,n){return eu(t,zu(t),n)}(t,Se(f,t))}else{if(!jn[g])return i?t:{};f=function(t,n,r){var e=t.constructor;switch(n){case at:return Hi(t);case $:case q:return new e(+t);case ct:return function(t,n){var r=n?Hi(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case st:case lt:case ht:case pt:case vt:case gt:case _t:case yt:case dt:return Xi(t,r);case J:return new e;case H:case et:return new e(t);case nt:return function(t){var n=new t.constructor(t.source,Ft.exec(t));return n.lastIndex=t.lastIndex,n}(t);case rt:return new e;case it:return function(t){return le?tn(le.call(t)):{}}(t)}}(t,g,a)}}o||(o=new Ae);var y=o.get(t);if(y)return y;if(o.set(t,f),Mf(t))return t.forEach(function(e){f.add(Le(e,n,r,e,t,o))}),f;if(Of(t))return t.forEach(function(e,i){f.set(i,Le(e,n,r,i,t,o))}),f;var d=l?u:(s?c?Su:Iu:c?ua:ia)(t);return Kn(d||t,function(e,i){d&&(e=t[i=e]),je(f,i,Le(e,n,r,i,t,o))}),f}function ke(t,n,r){var e=r.length;if(null==t)return!e;for(t=tn(t);e--;){var i=r[e],o=n[i],f=t[i];if(f===u&&!(i in t)||!o(f))return!1}return!0}function De(t,n,r){if("function"!=typeof t)throw new en(a);return ro(function(){t.apply(u,r)},n)}function Ce(t,n,r,e){var i=-1,u=Xn,f=!0,a=t.length,c=[],s=n.length;if(!a)return c;r&&(n=tr(n,yr(r))),e?(u=Qn,f=!1):n.length>=o&&(u=wr,f=!1,n=new be(n));t:for(;++i-1},we.prototype.set=function(t,n){var r=this.__data__,e=Oe(r,t);return e<0?(++this.size,r.push([t,n])):r[e][1]=n,this},me.prototype.clear=function(){this.size=0,this.__data__={hash:new de,map:new(Xr||we),string:new de}},me.prototype.delete=function(t){var n=ku(this,t).delete(t);return this.size-=n?1:0,n},me.prototype.get=function(t){return ku(this,t).get(t)},me.prototype.has=function(t){return ku(this,t).has(t)},me.prototype.set=function(t,n){var r=ku(this,t),e=r.size;return r.set(t,n),this.size+=r.size==e?0:1,this},be.prototype.add=be.prototype.push=function(t){return this.__data__.set(t,c),this},be.prototype.has=function(t){return this.__data__.has(t)},Ae.prototype.clear=function(){this.__data__=new we,this.size=0},Ae.prototype.delete=function(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r},Ae.prototype.get=function(t){return this.__data__.get(t)},Ae.prototype.has=function(t){return this.__data__.has(t)},Ae.prototype.set=function(t,n){var r=this.__data__;if(r instanceof we){var e=r.__data__;if(!Xr||e.length0&&r(f)?n>1?$e(f,n-1,r,e,i):nr(i,f):e||(i[i.length]=f)}return i}var qe=fu(),Ve=fu(!0);function Ze(t,n){return t&&qe(t,n,ia)}function Ke(t,n){return t&&Ve(t,n,ia)}function Ge(t,n){return Hn(n,function(n){return Ef(t[n])})}function Je(t,n){for(var r=0,e=(n=Vi(n,t)).length;null!=t&&rn}function ti(t,n){return null!=t&&sn.call(t,n)}function ni(t,n){return null!=t&&n in tn(t)}function ri(t,n,e){for(var i=e?Qn:Xn,o=t[0].length,f=t.length,a=f,c=r(f),s=1/0,l=[];a--;){var h=t[a];a&&n&&(h=tr(h,yr(n))),s=Vr(h.length,s),c[a]=!e&&(n||o>=120&&h.length>=120)?new be(a&&h):u}h=t[0];var p=-1,v=c[0];t:for(;++p=f)return a;var c=r[e];return a*("desc"==c?-1:1)}}return t.index-n.index}(t,n,r)})}function di(t,n,r){for(var e=-1,i=n.length,u={};++e-1;)f!==t&&Ln.call(f,a,1),Ln.call(t,a,1);return t}function mi(t,n){for(var r=t?n.length:0,e=r-1;r--;){var i=n[r];if(r==e||i!==u){var u=i;qu(i)?Ln.call(t,i,1):Ci(t,i)}}return t}function bi(t,n){return t+zr(Gr()*(n-t+1))}function Ai(t,n){var r="";if(!t||n<1||n>U)return r;do{n%2&&(r+=t),(n=zr(n/2))&&(t+=t)}while(n);return r}function xi(t,n){return eo(Qu(t,n,Ia),t+"")}function Ei(t){return Ee(pa(t))}function Ri(t,n){var r=pa(t);return oo(r,Ue(n,0,r.length))}function Bi(t,n,r,e){if(!Pf(t))return t;for(var i=-1,o=(n=Vi(n,t)).length,f=o-1,a=t;null!=a&&++iu?0:u+n),(e=e>u?u:e)<0&&(e+=u),u=n>e?0:e-n>>>0,n>>>=0;for(var o=r(u);++i>>1,o=t[u];null!==o&&!Lf(o)&&(r?o<=n:o=o){var s=n?null:Au(t);if(s)return Ir(s);f=!1,i=wr,c=new be}else c=n?[]:a;t:for(;++e=e?t:Ii(t,n,r)}var Gi=pr||function(t){return Un.clearTimeout(t)};function Ji(t,n){if(n)return t.slice();var r=t.length,e=xn?xn(r):new t.constructor(r);return t.copy(e),e}function Hi(t){var n=new t.constructor(t.byteLength);return new bn(n).set(new bn(t)),n}function Xi(t,n){var r=n?Hi(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Qi(t,n){if(t!==n){var r=t!==u,e=null===t,i=t==t,o=Lf(t),f=n!==u,a=null===n,c=n==n,s=Lf(n);if(!a&&!s&&!o&&t>n||o&&f&&c&&!a&&!s||e&&f&&c||!r&&c||!i)return 1;if(!e&&!o&&!s&&t1?r[i-1]:u,f=i>2?r[2]:u;for(o=t.length>3&&"function"==typeof o?(i--,o):u,f&&Vu(r[0],r[1],f)&&(o=i<3?u:o,i=1),n=tn(n);++e-1?i[o?n[f]:f]:u}}function hu(t){return Ou(function(n){var r=n.length,e=r,i=_e.prototype.thru;for(t&&n.reverse();e--;){var o=n[e];if("function"!=typeof o)throw new en(a);if(i&&!f&&"wrapper"==Mu(o))var f=new _e([],!0)}for(e=f?e:r;++e1&&m.reverse(),h&&sa))return!1;var s=o.get(t);if(s&&o.get(n))return s==n;var l=-1,h=!0,p=r&_?new be:u;for(o.set(t,n),o.set(n,t);++l-1&&t%1==0&&t1?"& ":"")+n[e],n=n.join(r>2?", ":" "),t.replace(Dt,"{\n/* [wrapped with "+n+"] */\n")}(e,function(t,n){return Kn(Y,function(r){var e="_."+r[0];n&r[1]&&!Xn(t,e)&&t.push(e)}),t.sort()}(function(t){var n=t.match(Ct);return n?n[1].split(zt):[]}(e),r)))}function uo(t){var n=0,r=0;return function(){var e=Zr(),i=I-(e-r);if(r=e,i>0){if(++n>=O)return arguments[0]}else n=0;return t.apply(u,arguments)}}function oo(t,n){var r=-1,e=t.length,i=e-1;for(n=n===u?e:n;++r1?t[n-1]:u;return So(t,r="function"==typeof r?(t.pop(),r):u)});function Co(t){var n=pe(t);return n.__chain__=!0,n}function zo(t,n){return n(t)}var Yo=Ou(function(t){var n=t.length,r=n?t[0]:0,e=this.__wrapped__,i=function(n){return Me(n,t)};return!(n>1||this.__actions__.length)&&e instanceof ye&&qu(r)?((e=e.slice(r,+r+(n?1:0))).__actions__.push({func:zo,args:[i],thisArg:u}),new _e(e,this.__chain__).thru(function(t){return n&&!t.length&&t.push(u),t})):this.thru(i)});var No=iu(function(t,n,r){sn.call(t,r)?++t[r]:Te(t,r,1)});var Wo=lu(vo),Fo=lu(go);function $o(t,n){return(yf(t)?Kn:ze)(t,Lu(n,3))}function qo(t,n){return(yf(t)?Gn:Ye)(t,Lu(n,3))}var Vo=iu(function(t,n,r){sn.call(t,r)?t[r].push(n):Te(t,r,[n])});var Zo=xi(function(t,n,e){var i=-1,u="function"==typeof n,o=wf(t)?r(t.length):[];return ze(t,function(t){o[++i]=u?Vn(n,t,e):ei(t,n,e)}),o}),Ko=iu(function(t,n,r){Te(t,r,n)});function Go(t,n){return(yf(t)?tr:hi)(t,Lu(n,3))}var Jo=iu(function(t,n,r){t[r?0:1].push(n)},function(){return[[],[]]});var Ho=xi(function(t,n){if(null==t)return[];var r=n.length;return r>1&&Vu(t,n[0],n[1])?n=[]:r>2&&Vu(n[0],n[1],n[2])&&(n=[n[0]]),yi(t,$e(n,1),[])}),Xo=kr||function(){return Un.Date.now()};function Qo(t,n,r){return n=r?u:n,n=t&&null==n?t.length:n,Eu(t,E,u,u,u,u,n)}function tf(t,n){var r;if("function"!=typeof n)throw new en(a);return t=Nf(t),function(){return--t>0&&(r=n.apply(this,arguments)),t<=1&&(n=u),r}}var nf=xi(function(t,n,r){var e=y;if(r.length){var i=jr(r,Uu(nf));e|=A}return Eu(t,e,n,r,i)}),rf=xi(function(t,n,r){var e=y|d;if(r.length){var i=jr(r,Uu(rf));e|=A}return Eu(n,e,t,r,i)});function ef(t,n,r){var e,i,o,f,c,s,l=0,h=!1,p=!1,v=!0;if("function"!=typeof t)throw new en(a);function g(n){var r=e,o=i;return e=i=u,l=n,f=t.apply(o,r)}function _(t){var r=t-s;return s===u||r>=n||r<0||p&&t-l>=o}function y(){var t=Xo();if(_(t))return d(t);c=ro(y,function(t){var r=n-(t-s);return p?Vr(r,o-(t-l)):r}(t))}function d(t){return c=u,v&&e?g(t):(e=i=u,f)}function w(){var t=Xo(),r=_(t);if(e=arguments,i=this,s=t,r){if(c===u)return function(t){return l=t,c=ro(y,n),h?g(t):f}(s);if(p)return c=ro(y,n),g(s)}return c===u&&(c=ro(y,n)),f}return n=Ff(n)||0,Pf(r)&&(h=!!r.leading,o=(p="maxWait"in r)?qr(Ff(r.maxWait)||0,n):o,v="trailing"in r?!!r.trailing:v),w.cancel=function(){c!==u&&Gi(c),l=0,e=s=i=c=u},w.flush=function(){return c===u?f:d(Xo())},w}var uf=xi(function(t,n){return De(t,1,n)}),of=xi(function(t,n,r){return De(t,Ff(n)||0,r)});function ff(t,n){if("function"!=typeof t||null!=n&&"function"!=typeof n)throw new en(a);var r=function(){var e=arguments,i=n?n.apply(this,e):e[0],u=r.cache;if(u.has(i))return u.get(i);var o=t.apply(this,e);return r.cache=u.set(i,o)||u,o};return r.cache=new(ff.Cache||me),r}function af(t){if("function"!=typeof t)throw new en(a);return function(){var n=arguments;switch(n.length){case 0:return!t.call(this);case 1:return!t.call(this,n[0]);case 2:return!t.call(this,n[0],n[1]);case 3:return!t.call(this,n[0],n[1],n[2])}return!t.apply(this,n)}}ff.Cache=me;var cf=Zi(function(t,n){var r=(n=1==n.length&&yf(n[0])?tr(n[0],yr(Lu())):tr($e(n,1),yr(Lu()))).length;return xi(function(e){for(var i=-1,u=Vr(e.length,r);++i=n}),_f=ii(function(){return arguments}())?ii:function(t){return jf(t)&&sn.call(t,"callee")&&!Mn.call(t,"callee")},yf=r.isArray,df=Yn?yr(Yn):function(t){return jf(t)&&Xe(t)==at};function wf(t){return null!=t&&Bf(t.length)&&!Ef(t)}function mf(t){return jf(t)&&wf(t)}var bf=Nr||Fa,Af=Nn?yr(Nn):function(t){return jf(t)&&Xe(t)==q};function xf(t){if(!jf(t))return!1;var n=Xe(t);return n==Z||n==V||"string"==typeof t.message&&"string"==typeof t.name&&!Sf(t)}function Ef(t){if(!Pf(t))return!1;var n=Xe(t);return n==K||n==G||n==F||n==tt}function Rf(t){return"number"==typeof t&&t==Nf(t)}function Bf(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=U}function Pf(t){var n=typeof t;return null!=t&&("object"==n||"function"==n)}function jf(t){return null!=t&&"object"==typeof t}var Of=Wn?yr(Wn):function(t){return jf(t)&&Nu(t)==J};function If(t){return"number"==typeof t||jf(t)&&Xe(t)==H}function Sf(t){if(!jf(t)||Xe(t)!=Q)return!1;var n=On(t);if(null===n)return!0;var r=sn.call(n,"constructor")&&n.constructor;return"function"==typeof r&&r instanceof r&&cn.call(r)==vn}var Tf=Fn?yr(Fn):function(t){return jf(t)&&Xe(t)==nt};var Mf=$n?yr($n):function(t){return jf(t)&&Nu(t)==rt};function Uf(t){return"string"==typeof t||!yf(t)&&jf(t)&&Xe(t)==et}function Lf(t){return"symbol"==typeof t||jf(t)&&Xe(t)==it}var kf=qn?yr(qn):function(t){return jf(t)&&Bf(t.length)&&!!Pn[Xe(t)]};var Df=wu(li),Cf=wu(function(t,n){return t<=n});function zf(t){if(!t)return[];if(wf(t))return Uf(t)?Mr(t):ru(t);if(Cn&&t[Cn])return function(t){for(var n,r=[];!(n=t.next()).done;)r.push(n.value);return r}(t[Cn]());var n=Nu(t);return(n==J?Br:n==rt?Ir:pa)(t)}function Yf(t){return t?(t=Ff(t))===M||t===-M?(t<0?-1:1)*L:t==t?t:0:0===t?t:0}function Nf(t){var n=Yf(t),r=n%1;return n==n?r?n-r:n:0}function Wf(t){return t?Ue(Nf(t),0,D):0}function Ff(t){if("number"==typeof t)return t;if(Lf(t))return k;if(Pf(t)){var n="function"==typeof t.valueOf?t.valueOf():t;t=Pf(n)?n+"":n}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(Ut,"");var r=qt.test(t);return r||Zt.test(t)?Sn(t.slice(2),r?2:8):$t.test(t)?k:+t}function $f(t){return eu(t,ua(t))}function qf(t){return null==t?"":ki(t)}var Vf=uu(function(t,n){if(Ju(n)||wf(n))eu(n,ia(n),t);else for(var r in n)sn.call(n,r)&&je(t,r,n[r])}),Zf=uu(function(t,n){eu(n,ua(n),t)}),Kf=uu(function(t,n,r,e){eu(n,ua(n),t,e)}),Gf=uu(function(t,n,r,e){eu(n,ia(n),t,e)}),Jf=Ou(Me);var Hf=xi(function(t,n){t=tn(t);var r=-1,e=n.length,i=e>2?n[2]:u;for(i&&Vu(n[0],n[1],i)&&(e=1);++r1),n}),eu(t,Su(t),r),e&&(r=Le(r,h|p|v,Pu));for(var i=n.length;i--;)Ci(r,n[i]);return r});var ca=Ou(function(t,n){return null==t?{}:function(t,n){return di(t,n,function(n,r){return ta(t,r)})}(t,n)});function sa(t,n){if(null==t)return{};var r=tr(Su(t),function(t){return[t]});return n=Lu(n),di(t,r,function(t,r){return n(t,r[0])})}var la=xu(ia),ha=xu(ua);function pa(t){return null==t?[]:dr(t,ia(t))}var va=cu(function(t,n,r){return n=n.toLowerCase(),t+(r?ga(n):n)});function ga(t){return xa(qf(t).toLowerCase())}function _a(t){return(t=qf(t))&&t.replace(Gt,Ar).replace(mn,"")}var ya=cu(function(t,n,r){return t+(r?"-":"")+n.toLowerCase()}),da=cu(function(t,n,r){return t+(r?" ":"")+n.toLowerCase()}),wa=au("toLowerCase");var ma=cu(function(t,n,r){return t+(r?"_":"")+n.toLowerCase()});var ba=cu(function(t,n,r){return t+(r?" ":"")+xa(n)});var Aa=cu(function(t,n,r){return t+(r?" ":"")+n.toUpperCase()}),xa=au("toUpperCase");function Ea(t,n,r){return t=qf(t),(n=r?u:n)===u?function(t){return En.test(t)}(t)?function(t){return t.match(An)||[]}(t):function(t){return t.match(Yt)||[]}(t):t.match(n)||[]}var Ra=xi(function(t,n){try{return Vn(t,u,n)}catch(t){return xf(t)?t:new i(t)}}),Ba=Ou(function(t,n){return Kn(n,function(n){n=ao(n),Te(t,n,nf(t[n],t))}),t});function Pa(t){return function(){return t}}var ja=hu(),Oa=hu(!0);function Ia(t){return t}function Sa(t){return ai("function"==typeof t?t:Le(t,h))}var Ta=xi(function(t,n){return function(r){return ei(r,t,n)}}),Ma=xi(function(t,n){return function(r){return ei(t,r,n)}});function Ua(t,n,r){var e=ia(n),i=Ge(n,e);null!=r||Pf(n)&&(i.length||!e.length)||(r=n,n=t,t=this,i=Ge(n,ia(n)));var u=!(Pf(r)&&"chain"in r&&!r.chain),o=Ef(t);return Kn(i,function(r){var e=n[r];t[r]=e,o&&(t.prototype[r]=function(){var n=this.__chain__;if(u||n){var r=t(this.__wrapped__);return(r.__actions__=ru(this.__actions__)).push({func:e,args:arguments,thisArg:t}),r.__chain__=n,r}return e.apply(t,nr([this.value()],arguments))})}),t}function La(){}var ka=_u(tr),Da=_u(Jn),Ca=_u(ir);function za(t){return Zu(t)?hr(ao(t)):function(t){return function(n){return Je(n,t)}}(t)}var Ya=du(),Na=du(!0);function Wa(){return[]}function Fa(){return!1}var $a=gu(function(t,n){return t+n},0),qa=bu("ceil"),Va=gu(function(t,n){return t/n},1),Za=bu("floor");var Ka=gu(function(t,n){return t*n},1),Ga=bu("round"),Ja=gu(function(t,n){return t-n},0);return pe.after=function(t,n){if("function"!=typeof n)throw new en(a);return t=Nf(t),function(){if(--t<1)return n.apply(this,arguments)}},pe.ary=Qo,pe.assign=Vf,pe.assignIn=Zf,pe.assignInWith=Kf,pe.assignWith=Gf,pe.at=Jf,pe.before=tf,pe.bind=nf,pe.bindAll=Ba,pe.bindKey=rf,pe.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return yf(t)?t:[t]},pe.chain=Co,pe.chunk=function(t,n,e){n=(e?Vu(t,n,e):n===u)?1:qr(Nf(n),0);var i=null==t?0:t.length;if(!i||n<1)return[];for(var o=0,f=0,a=r(Cr(i/n));oi?0:i+r),(e=e===u||e>i?i:Nf(e))<0&&(e+=i),e=r>e?0:Wf(e);r>>0)?(t=qf(t))&&("string"==typeof n||null!=n&&!Tf(n))&&!(n=ki(n))&&Rr(t)?Ki(Mr(t),0,r):t.split(n,r):[]},pe.spread=function(t,n){if("function"!=typeof t)throw new en(a);return n=null==n?0:qr(Nf(n),0),xi(function(r){var e=r[n],i=Ki(r,0,n);return e&&nr(i,e),Vn(t,this,i)})},pe.tail=function(t){var n=null==t?0:t.length;return n?Ii(t,1,n):[]},pe.take=function(t,n,r){return t&&t.length?Ii(t,0,(n=r||n===u?1:Nf(n))<0?0:n):[]},pe.takeRight=function(t,n,r){var e=null==t?0:t.length;return e?Ii(t,(n=e-(n=r||n===u?1:Nf(n)))<0?0:n,e):[]},pe.takeRightWhile=function(t,n){return t&&t.length?Yi(t,Lu(n,3),!1,!0):[]},pe.takeWhile=function(t,n){return t&&t.length?Yi(t,Lu(n,3)):[]},pe.tap=function(t,n){return n(t),t},pe.throttle=function(t,n,r){var e=!0,i=!0;if("function"!=typeof t)throw new en(a);return Pf(r)&&(e="leading"in r?!!r.leading:e,i="trailing"in r?!!r.trailing:i),ef(t,n,{leading:e,maxWait:n,trailing:i})},pe.thru=zo,pe.toArray=zf,pe.toPairs=la,pe.toPairsIn=ha,pe.toPath=function(t){return yf(t)?tr(t,ao):Lf(t)?[t]:ru(fo(qf(t)))},pe.toPlainObject=$f,pe.transform=function(t,n,r){var e=yf(t),i=e||bf(t)||kf(t);if(n=Lu(n,4),null==r){var u=t&&t.constructor;r=i?e?new u:[]:Pf(t)&&Ef(u)?ve(On(t)):{}}return(i?Kn:Ze)(t,function(t,e,i){return n(r,t,e,i)}),r},pe.unary=function(t){return Qo(t,1)},pe.union=Po,pe.unionBy=jo,pe.unionWith=Oo,pe.uniq=function(t){return t&&t.length?Di(t):[]},pe.uniqBy=function(t,n){return t&&t.length?Di(t,Lu(n,2)):[]},pe.uniqWith=function(t,n){return n="function"==typeof n?n:u,t&&t.length?Di(t,u,n):[]},pe.unset=function(t,n){return null==t||Ci(t,n)},pe.unzip=Io,pe.unzipWith=So,pe.update=function(t,n,r){return null==t?t:zi(t,n,qi(r))},pe.updateWith=function(t,n,r,e){return e="function"==typeof e?e:u,null==t?t:zi(t,n,qi(r),e)},pe.values=pa,pe.valuesIn=function(t){return null==t?[]:dr(t,ua(t))},pe.without=To,pe.words=Ea,pe.wrap=function(t,n){return sf(qi(n),t)},pe.xor=Mo,pe.xorBy=Uo,pe.xorWith=Lo,pe.zip=ko,pe.zipObject=function(t,n){return Fi(t||[],n||[],je)},pe.zipObjectDeep=function(t,n){return Fi(t||[],n||[],Bi)},pe.zipWith=Do,pe.entries=la,pe.entriesIn=ha,pe.extend=Zf,pe.extendWith=Kf,Ua(pe,pe),pe.add=$a,pe.attempt=Ra,pe.camelCase=va,pe.capitalize=ga,pe.ceil=qa,pe.clamp=function(t,n,r){return r===u&&(r=n,n=u),r!==u&&(r=(r=Ff(r))==r?r:0),n!==u&&(n=(n=Ff(n))==n?n:0),Ue(Ff(t),n,r)},pe.clone=function(t){return Le(t,v)},pe.cloneDeep=function(t){return Le(t,h|v)},pe.cloneDeepWith=function(t,n){return Le(t,h|v,n="function"==typeof n?n:u)},pe.cloneWith=function(t,n){return Le(t,v,n="function"==typeof n?n:u)},pe.conformsTo=function(t,n){return null==n||ke(t,n,ia(n))},pe.deburr=_a,pe.defaultTo=function(t,n){return null==t||t!=t?n:t},pe.divide=Va,pe.endsWith=function(t,n,r){t=qf(t),n=ki(n);var e=t.length,i=r=r===u?e:Ue(Nf(r),0,e);return(r-=n.length)>=0&&t.slice(r,i)==n},pe.eq=pf,pe.escape=function(t){return(t=qf(t))&&Rt.test(t)?t.replace(xt,xr):t},pe.escapeRegExp=function(t){return(t=qf(t))&&Mt.test(t)?t.replace(Tt,"\\$&"):t},pe.every=function(t,n,r){var e=yf(t)?Jn:Ne;return r&&Vu(t,n,r)&&(n=u),e(t,Lu(n,3))},pe.find=Wo,pe.findIndex=vo,pe.findKey=function(t,n){return or(t,Lu(n,3),Ze)},pe.findLast=Fo,pe.findLastIndex=go,pe.findLastKey=function(t,n){return or(t,Lu(n,3),Ke)},pe.floor=Za,pe.forEach=$o,pe.forEachRight=qo,pe.forIn=function(t,n){return null==t?t:qe(t,Lu(n,3),ua)},pe.forInRight=function(t,n){return null==t?t:Ve(t,Lu(n,3),ua)},pe.forOwn=function(t,n){return t&&Ze(t,Lu(n,3))},pe.forOwnRight=function(t,n){return t&&Ke(t,Lu(n,3))},pe.get=Qf,pe.gt=vf,pe.gte=gf,pe.has=function(t,n){return null!=t&&Wu(t,n,ti)},pe.hasIn=ta,pe.head=yo,pe.identity=Ia,pe.includes=function(t,n,r,e){t=wf(t)?t:pa(t),r=r&&!e?Nf(r):0;var i=t.length;return r<0&&(r=qr(i+r,0)),Uf(t)?r<=i&&t.indexOf(n,r)>-1:!!i&&ar(t,n,r)>-1},pe.indexOf=function(t,n,r){var e=null==t?0:t.length;if(!e)return-1;var i=null==r?0:Nf(r);return i<0&&(i=qr(e+i,0)),ar(t,n,i)},pe.inRange=function(t,n,r){return n=Yf(n),r===u?(r=n,n=0):r=Yf(r),function(t,n,r){return t>=Vr(n,r)&&t=-U&&t<=U},pe.isSet=Mf,pe.isString=Uf,pe.isSymbol=Lf,pe.isTypedArray=kf,pe.isUndefined=function(t){return t===u},pe.isWeakMap=function(t){return jf(t)&&Nu(t)==ot},pe.isWeakSet=function(t){return jf(t)&&Xe(t)==ft},pe.join=function(t,n){return null==t?"":Fr.call(t,n)},pe.kebabCase=ya,pe.last=Ao,pe.lastIndexOf=function(t,n,r){var e=null==t?0:t.length;if(!e)return-1;var i=e;return r!==u&&(i=(i=Nf(r))<0?qr(e+i,0):Vr(i,e-1)),n==n?function(t,n,r){for(var e=r+1;e--;)if(t[e]===n)return e;return e}(t,n,i):fr(t,sr,i,!0)},pe.lowerCase=da,pe.lowerFirst=wa,pe.lt=Df,pe.lte=Cf,pe.max=function(t){return t&&t.length?We(t,Ia,Qe):u},pe.maxBy=function(t,n){return t&&t.length?We(t,Lu(n,2),Qe):u},pe.mean=function(t){return lr(t,Ia)},pe.meanBy=function(t,n){return lr(t,Lu(n,2))},pe.min=function(t){return t&&t.length?We(t,Ia,li):u},pe.minBy=function(t,n){return t&&t.length?We(t,Lu(n,2),li):u},pe.stubArray=Wa,pe.stubFalse=Fa,pe.stubObject=function(){return{}},pe.stubString=function(){return""},pe.stubTrue=function(){return!0},pe.multiply=Ka,pe.nth=function(t,n){return t&&t.length?_i(t,Nf(n)):u},pe.noConflict=function(){return Un._===this&&(Un._=gn),this},pe.noop=La,pe.now=Xo,pe.pad=function(t,n,r){t=qf(t);var e=(n=Nf(n))?Tr(t):0;if(!n||e>=n)return t;var i=(n-e)/2;return yu(zr(i),r)+t+yu(Cr(i),r)},pe.padEnd=function(t,n,r){t=qf(t);var e=(n=Nf(n))?Tr(t):0;return n&&en){var e=t;t=n,n=e}if(r||t%1||n%1){var i=Gr();return Vr(t+i*(n-t+In("1e-"+((i+"").length-1))),n)}return bi(t,n)},pe.reduce=function(t,n,r){var e=yf(t)?rr:vr,i=arguments.length<3;return e(t,Lu(n,4),r,i,ze)},pe.reduceRight=function(t,n,r){var e=yf(t)?er:vr,i=arguments.length<3;return e(t,Lu(n,4),r,i,Ye)},pe.repeat=function(t,n,r){return n=(r?Vu(t,n,r):n===u)?1:Nf(n),Ai(qf(t),n)},pe.replace=function(){var t=arguments,n=qf(t[0]);return t.length<3?n:n.replace(t[1],t[2])},pe.result=function(t,n,r){var e=-1,i=(n=Vi(n,t)).length;for(i||(i=1,t=u);++eU)return[];var r=D,e=Vr(t,D);n=Lu(n),t-=D;for(var i=_r(e,n);++r=o)return t;var a=r-Tr(e);if(a<1)return e;var c=f?Ki(f,0,a).join(""):t.slice(0,a);if(i===u)return c+e;if(f&&(a+=c.length-a),Tf(i)){if(t.slice(a).search(i)){var s,l=c;for(i.global||(i=nn(i.source,qf(Ft.exec(i))+"g")),i.lastIndex=0;s=i.exec(l);)var h=s.index;c=c.slice(0,h===u?a:h)}}else if(t.indexOf(ki(i),a)!=a){var p=c.lastIndexOf(i);p>-1&&(c=c.slice(0,p))}return c+e},pe.unescape=function(t){return(t=qf(t))&&Et.test(t)?t.replace(At,Ur):t},pe.uniqueId=function(t){var n=++ln;return qf(t)+n},pe.upperCase=Aa,pe.upperFirst=xa,pe.each=$o,pe.eachRight=qo,pe.first=yo,Ua(pe,function(){var t={};return Ze(pe,function(n,r){sn.call(pe.prototype,r)||(t[r]=n)}),t}(),{chain:!1}),pe.VERSION="4.17.10",Kn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){pe[t].placeholder=pe}),Kn(["drop","take"],function(t,n){ye.prototype[t]=function(r){r=r===u?1:qr(Nf(r),0);var e=this.__filtered__&&!n?new ye(this):this.clone();return e.__filtered__?e.__takeCount__=Vr(r,e.__takeCount__):e.__views__.push({size:Vr(r,D),type:t+(e.__dir__<0?"Right":"")}),e},ye.prototype[t+"Right"]=function(n){return this.reverse()[t](n).reverse()}}),Kn(["filter","map","takeWhile"],function(t,n){var r=n+1,e=r==S||3==r;ye.prototype[t]=function(t){var n=this.clone();return n.__iteratees__.push({iteratee:Lu(t,3),type:r}),n.__filtered__=n.__filtered__||e,n}}),Kn(["head","last"],function(t,n){var r="take"+(n?"Right":"");ye.prototype[t]=function(){return this[r](1).value()[0]}}),Kn(["initial","tail"],function(t,n){var r="drop"+(n?"":"Right");ye.prototype[t]=function(){return this.__filtered__?new ye(this):this[r](1)}}),ye.prototype.compact=function(){return this.filter(Ia)},ye.prototype.find=function(t){return this.filter(t).head()},ye.prototype.findLast=function(t){return this.reverse().find(t)},ye.prototype.invokeMap=xi(function(t,n){return"function"==typeof t?new ye(this):this.map(function(r){return ei(r,t,n)})}),ye.prototype.reject=function(t){return this.filter(af(Lu(t)))},ye.prototype.slice=function(t,n){t=Nf(t);var r=this;return r.__filtered__&&(t>0||n<0)?new ye(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),n!==u&&(r=(n=Nf(n))<0?r.dropRight(-n):r.take(n-t)),r)},ye.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},ye.prototype.toArray=function(){return this.take(D)},Ze(ye.prototype,function(t,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),e=/^(?:head|last)$/.test(n),i=pe[e?"take"+("last"==n?"Right":""):n],o=e||/^find/.test(n);i&&(pe.prototype[n]=function(){var n=this.__wrapped__,f=e?[1]:arguments,a=n instanceof ye,c=f[0],s=a||yf(n),l=function(t){var n=i.apply(pe,nr([t],f));return e&&h?n[0]:n};s&&r&&"function"==typeof c&&1!=c.length&&(a=s=!1);var h=this.__chain__,p=!!this.__actions__.length,v=o&&!h,g=a&&!p;if(!o&&s){n=g?n:new ye(this);var _=t.apply(n,f);return _.__actions__.push({func:zo,args:[l],thisArg:u}),new _e(_,h)}return v&&g?t.apply(this,f):(_=this.thru(l),v?e?_.value()[0]:_.value():_)})}),Kn(["pop","push","shift","sort","splice","unshift"],function(t){var n=un[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",e=/^(?:pop|shift)$/.test(t);pe.prototype[t]=function(){var t=arguments;if(e&&!this.__chain__){var i=this.value();return n.apply(yf(i)?i:[],t)}return this[r](function(r){return n.apply(yf(r)?r:[],t)})}}),Ze(ye.prototype,function(t,n){var r=pe[n];if(r){var e=r.name+"";(ie[e]||(ie[e]=[])).push({name:n,func:r})}}),ie[pu(u,d).name]=[{name:"wrapper",func:u}],ye.prototype.clone=function(){var t=new ye(this.__wrapped__);return t.__actions__=ru(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=ru(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=ru(this.__views__),t},ye.prototype.reverse=function(){if(this.__filtered__){var t=new ye(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},ye.prototype.value=function(){var t=this.__wrapped__.value(),n=this.__dir__,r=yf(t),e=n<0,i=r?t.length:0,u=function(t,n,r){for(var e=-1,i=r.length;++e=this.__values__.length;return{done:t,value:t?u:this.__values__[this.__index__++]}},pe.prototype.plant=function(t){for(var n,r=this;r instanceof ge;){var e=so(r);e.__index__=0,e.__values__=u,n?i.__wrapped__=e:n=e;var i=e;r=r.__wrapped__}return i.__wrapped__=t,n},pe.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof ye){var n=t;return this.__actions__.length&&(n=new ye(this)),(n=n.reverse()).__actions__.push({func:zo,args:[Bo],thisArg:u}),new _e(n,this.__chain__)}return this.thru(Bo)},pe.prototype.toJSON=pe.prototype.valueOf=pe.prototype.value=function(){return Ni(this.__wrapped__,this.__actions__)},pe.prototype.first=pe.prototype.head,Cn&&(pe.prototype[Cn]=function(){return this}),pe}();Un._=Lr,(i=function(){return Lr}.call(n,r,n,e))===u||(e.exports=i)}).call(this)}).call(this,r(2),r(10)(t))},function(t,n){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,n,r){"use strict";(function(r){Object.defineProperty(n,"__esModule",{value:!0});var e={loadPositions:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=t.meshes[n];if(0===(i.primitives?i.primitives.length:0))return console.error("gltfReader: Mesh has no primitive."),null;var u=[];return i.primitives.forEach(function(n){n.attributes&&(u=u.concat(e._loadAccessor(t,n.attributes.POSITION,r)))}),u},_loadAccessor:function(t,n,r){if(void 0===n)return null;var i=t.accessors[n],u=i.byteOffset||0,o=e._loadBufferView(t,i.bufferView,u,r),f=[];switch(i.componentType){case 5123:for(var a=0;a1&&void 0!==arguments[1]?arguments[1]:0;return e._operation(Math.ceil,t,n)},_operation:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(0===r)return t(n);var e=Math.pow(10,r);return t(n*e)/e}};n.default=e,t.exports=n.default},function(t,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var e=r(0),i=r(1),u=r(3),o=function(t){return t&&t.__esModule?t:{default:t}}(r(4));function f(t){if(Array.isArray(t)){for(var n=0,r=Array(t.length);n1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},e=r.precision,i=r.ceilDimensions,u=this.getMeshesTransformMatrices(t.nodes,t,n).reduce(function(t,n){return t.min=t.min.map(function(t,r){return tn[r]?t:n[r]}),t},{min:[1/0,1/0,1/0],max:[-1/0,-1/0,-1/0]}),f=i?o.default.ceil:o.default.round;return{dimensions:{width:f(u.max[0]-u.min[0],e),depth:f(u.max[2]-u.min[2],e),height:f(u.max[1]-u.min[1],e)},center:{x:o.default.round((u.max[0]+u.min[0])/2,e+1),y:o.default.round((u.max[2]+u.min[2])/2,e+1),z:o.default.round((u.max[1]+u.min[1])/2,e+1)}}},getMeshesTransformMatrices:function(t,n,r){var i=this;return t.forEach(function(t,n){return t.index=n}),t.filter(function(t){return void 0!==t.mesh}).reduce(function(o,a){var c=i.getParentNodesMatrices(a,t).map(function(t){return new e.Matrix(4,4,!1).setData(t)}),s=e.Matrix.multiply.apply(e.Matrix,f(c)),l=i.getPointsFromArray((0,u.loadPositions)(n,a.mesh,r)).map(function(t){return e.Matrix.multiply(t,s)});return o.concat(l)},[])},getParentNodesMatrices:function(t,n){var r=n.find(function(n){return n.children&&(0,i.includes)(n.children,t.index)}),e=t.matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return void 0!==r?[e].concat(f(this.getParentNodesMatrices(r,n))).filter(function(t){return t}):[e]},getPointsFromArray:function(t){for(var n=[],r=0;r1&&void 0!==arguments[1]?arguments[1]:[],r=arguments[2];if(r=Object.assign({precision:0,ceilDimensions:!1},r),Boolean(t.readUInt32LE)){if(2===t.readUInt32LE(4))return u.default.computeBoundings(t,r);throw new Error("gltf-bounding-box only currently handles glTF1 and glTF/glb2.")}if(1==+t.asset.version)return e.default.computeBoundings(t,r);if(2==+t.asset.version)return i.default.computeBoundings(t,n,r);throw new Error("gltf-bounding-box only currently handles glTF1 and glTF/glb2.")}};n.default=f,t.exports=n.default},function(t,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var e=r(0),i=r(1),u=r(3),o=function(t){return t&&t.__esModule?t:{default:t}}(r(4));function f(t){if(Array.isArray(t)){for(var n=0,r=Array(t.length);n1&&void 0!==arguments[1]?arguments[1]:{},r=n.precision,e=n.ceilDimensions,i=this.getMeshesTransformMatrices(t.nodes,t).reduce(function(t,n){return t.min=t.min.map(function(t,r){return tn[r]?t:n[r]}),t},{min:[1/0,1/0,1/0],max:[-1/0,-1/0,-1/0]}),u=!0===e?o.default.ceil:o.default.round;return{dimensions:{width:u(i.max[0]-i.min[0],r),depth:u(i.max[2]-i.min[2],r),height:u(i.max[1]-i.min[1],r)},center:{x:o.default.round((i.max[0]+i.min[0])/2,r+1),y:o.default.round((i.max[2]+i.min[2])/2,r+1),z:o.default.round((i.max[1]+i.min[1])/2,r+1)}}},getMeshesTransformMatrices:function(t,n){var r=this;return Object.keys(t).filter(function(n){return t[n].meshes}).reduce(function(n,r){return[].concat(f(n),f(t[r].meshes.map(function(t){return{mesh:t,nodeName:r}})))},[]).reduce(function(i,o){var a=o.mesh,c=o.nodeName,s=r.getParentNodesMatrices(c,t).map(function(t){return new e.Matrix(4,4,!1).setData(t)}),l=e.Matrix.multiply.apply(e.Matrix,f(s)),h=r.getPointsFromArray((0,u.loadPositions)(n,a)).map(function(t){return e.Matrix.multiply(t,l)});return i.concat(h)},[])},getParentNodesMatrices:function(t,n){var r=Object.keys(n).find(function(r){return n[r].children&&(0,i.includes)(n[r].children,t)}),e=n[t].matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return r?[e].concat(f(this.getParentNodesMatrices(r,n))).filter(function(t){return t}):[e]},getPointsFromArray:function(t){for(var n=[],r=0;r=4){for(var g=0,_=this._cache||(this._cache={}),y=_.tempMatrix||(_.tempMatrix=new i(this.rows,this.cols,!1)),d=0;d>>1,F=[["ary",E],["bind",v],["bindKey",y],["curry",b],["curryRight",_],["flip",T],["partial",w],["partialRight",M],["rearg",S]],H="[object Arguments]",k="[object Array]",j="[object AsyncFunction]",V="[object Boolean]",W="[object Date]",q="[object DOMException]",Y="[object Error]",X="[object Function]",J="[object GeneratorFunction]",Z="[object Map]",Q="[object Number]",K="[object Null]",$="[object Object]",tt="[object Proxy]",et="[object RegExp]",nt="[object Set]",rt="[object String]",it="[object Symbol]",ot="[object Undefined]",at="[object WeakMap]",st="[object WeakSet]",ut="[object ArrayBuffer]",ct="[object DataView]",lt="[object Float32Array]",ht="[object Float64Array]",ft="[object Int8Array]",pt="[object Int16Array]",dt="[object Int32Array]",mt="[object Uint8Array]",gt="[object Uint8ClampedArray]",vt="[object Uint16Array]",yt="[object Uint32Array]",xt=/\b__p \+= '';/g,bt=/\b(__p \+=) '' \+/g,_t=/(__e\(.*?\)|\b__t\)) \+\n'';/g,wt=/&(?:amp|lt|gt|quot|#39);/g,Mt=/[&<>"']/g,Et=RegExp(wt.source),St=RegExp(Mt.source),Tt=/<%-([\s\S]+?)%>/g,At=/<%([\s\S]+?)%>/g,Lt=/<%=([\s\S]+?)%>/g,Rt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Pt=/^\w*$/,Ct=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ot=/[\\^$.*+?()[\]{}|]/g,It=RegExp(Ot.source),Dt=/^\s+|\s+$/g,Bt=/^\s+/,Nt=/\s+$/,Ut=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,zt=/\{\n\/\* \[wrapped with (.+)\] \*/,Gt=/,? & /,Ft=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Ht=/\\(\\)?/g,kt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,jt=/\w*$/,Vt=/^[-+]0x[0-9a-f]+$/i,Wt=/^0b[01]+$/i,qt=/^\[object .+?Constructor\]$/,Yt=/^0o[0-7]+$/i,Xt=/^(?:0|[1-9]\d*)$/,Jt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Zt=/($^)/,Qt=/['\n\r\u2028\u2029\\]/g,Kt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",$t="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",te="[\\ud800-\\udfff]",ee="["+$t+"]",ne="["+Kt+"]",re="\\d+",ie="[\\u2700-\\u27bf]",oe="[a-z\\xdf-\\xf6\\xf8-\\xff]",ae="[^\\ud800-\\udfff"+$t+re+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",se="\\ud83c[\\udffb-\\udfff]",ue="[^\\ud800-\\udfff]",ce="(?:\\ud83c[\\udde6-\\uddff]){2}",le="[\\ud800-\\udbff][\\udc00-\\udfff]",he="[A-Z\\xc0-\\xd6\\xd8-\\xde]",fe="(?:"+oe+"|"+ae+")",pe="(?:"+he+"|"+ae+")",de="(?:"+ne+"|"+se+")"+"?",me="[\\ufe0e\\ufe0f]?"+de+("(?:\\u200d(?:"+[ue,ce,le].join("|")+")[\\ufe0e\\ufe0f]?"+de+")*"),ge="(?:"+[ie,ce,le].join("|")+")"+me,ve="(?:"+[ue+ne+"?",ne,ce,le,te].join("|")+")",ye=RegExp("['’]","g"),xe=RegExp(ne,"g"),be=RegExp(se+"(?="+se+")|"+ve+me,"g"),_e=RegExp([he+"?"+oe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ee,he,"$"].join("|")+")",pe+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ee,he+fe,"$"].join("|")+")",he+"?"+fe+"+(?:['’](?:d|ll|m|re|s|t|ve))?",he+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",re,ge].join("|"),"g"),we=RegExp("[\\u200d\\ud800-\\udfff"+Kt+"\\ufe0e\\ufe0f]"),Me=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ee=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Se=-1,Te={};Te[lt]=Te[ht]=Te[ft]=Te[pt]=Te[dt]=Te[mt]=Te[gt]=Te[vt]=Te[yt]=!0,Te[H]=Te[k]=Te[ut]=Te[V]=Te[ct]=Te[W]=Te[Y]=Te[X]=Te[Z]=Te[Q]=Te[$]=Te[et]=Te[nt]=Te[rt]=Te[at]=!1;var Ae={};Ae[H]=Ae[k]=Ae[ut]=Ae[ct]=Ae[V]=Ae[W]=Ae[lt]=Ae[ht]=Ae[ft]=Ae[pt]=Ae[dt]=Ae[Z]=Ae[Q]=Ae[$]=Ae[et]=Ae[nt]=Ae[rt]=Ae[it]=Ae[mt]=Ae[gt]=Ae[vt]=Ae[yt]=!0,Ae[Y]=Ae[X]=Ae[at]=!1;var Le={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Re=parseFloat,Pe=parseInt,Ce="object"==typeof t&&t&&t.Object===Object&&t,Oe="object"==typeof self&&self&&self.Object===Object&&self,Ie=Ce||Oe||Function("return this")(),De="object"==typeof e&&e&&!e.nodeType&&e,Be=De&&"object"==typeof r&&r&&!r.nodeType&&r,Ne=Be&&Be.exports===De,Ue=Ne&&Ce.process,ze=function(){try{var t=Be&&Be.require&&Be.require("util").types;return t||Ue&&Ue.binding&&Ue.binding("util")}catch(t){}}(),Ge=ze&&ze.isArrayBuffer,Fe=ze&&ze.isDate,He=ze&&ze.isMap,ke=ze&&ze.isRegExp,je=ze&&ze.isSet,Ve=ze&&ze.isTypedArray;function We(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function qe(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i-1}function Ke(t,e,n){for(var r=-1,i=null==t?0:t.length;++r-1;);return n}function _n(t,e){for(var n=t.length;n--&&un(e,t[n],0)>-1;);return n}var wn=pn({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Mn=pn({"&":"&","<":"<",">":">",'"':""","'":"'"});function En(t){return"\\"+Le[t]}function Sn(t){return we.test(t)}function Tn(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}function An(t,e){return function(n){return t(e(n))}}function Ln(t,e){for(var n=-1,r=t.length,i=0,o=[];++n",""":'"',"'":"'"});var Bn=function t(e){var n=(e=null==e?Ie:Bn.defaults(Ie.Object(),e,Bn.pick(Ie,Ee))).Array,r=e.Date,i=e.Error,Kt=e.Function,$t=e.Math,te=e.Object,ee=e.RegExp,ne=e.String,re=e.TypeError,ie=n.prototype,oe=Kt.prototype,ae=te.prototype,se=e["__core-js_shared__"],ue=oe.toString,ce=ae.hasOwnProperty,le=0,he=function(){var t=/[^.]+$/.exec(se&&se.keys&&se.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),fe=ae.toString,pe=ue.call(te),de=Ie._,me=ee("^"+ue.call(ce).replace(Ot,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ge=Ne?e.Buffer:o,ve=e.Symbol,be=e.Uint8Array,we=ge?ge.allocUnsafe:o,Le=An(te.getPrototypeOf,te),Ce=te.create,Oe=ae.propertyIsEnumerable,De=ie.splice,Be=ve?ve.isConcatSpreadable:o,Ue=ve?ve.iterator:o,ze=ve?ve.toStringTag:o,on=function(){try{var t=Go(te,"defineProperty");return t({},"",{}),t}catch(t){}}(),pn=e.clearTimeout!==Ie.clearTimeout&&e.clearTimeout,Nn=r&&r.now!==Ie.Date.now&&r.now,Un=e.setTimeout!==Ie.setTimeout&&e.setTimeout,zn=$t.ceil,Gn=$t.floor,Fn=te.getOwnPropertySymbols,Hn=ge?ge.isBuffer:o,kn=e.isFinite,jn=ie.join,Vn=An(te.keys,te),Wn=$t.max,qn=$t.min,Yn=r.now,Xn=e.parseInt,Jn=$t.random,Zn=ie.reverse,Qn=Go(e,"DataView"),Kn=Go(e,"Map"),$n=Go(e,"Promise"),tr=Go(e,"Set"),er=Go(e,"WeakMap"),nr=Go(te,"create"),rr=er&&new er,ir={},or=la(Qn),ar=la(Kn),sr=la($n),ur=la(tr),cr=la(er),lr=ve?ve.prototype:o,hr=lr?lr.valueOf:o,fr=lr?lr.toString:o;function pr(t){if(As(t)&&!gs(t)&&!(t instanceof vr)){if(t instanceof gr)return t;if(ce.call(t,"__wrapped__"))return ha(t)}return new gr(t)}var dr=function(){function t(){}return function(e){if(!Ts(e))return{};if(Ce)return Ce(e);t.prototype=e;var n=new t;return t.prototype=o,n}}();function mr(){}function gr(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=o}function vr(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=U,this.__views__=[]}function yr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function Br(t,e,n,r,i,a){var s,u=e&f,c=e&p,l=e&d;if(n&&(s=i?n(t,r,i,a):n(t)),s!==o)return s;if(!Ts(t))return t;var h=gs(t);if(h){if(s=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&ce.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!u)return no(t,s)}else{var m=ko(t),g=m==X||m==J;if(bs(t))return Zi(t,u);if(m==$||m==H||g&&!i){if(s=c||g?{}:Vo(t),!u)return c?function(t,e){return ro(t,Ho(t),e)}(t,function(t,e){return t&&ro(e,iu(e),t)}(s,t)):function(t,e){return ro(t,Fo(t),e)}(t,Cr(s,t))}else{if(!Ae[m])return i?t:{};s=function(t,e,n){var r=t.constructor;switch(e){case ut:return Qi(t);case V:case W:return new r(+t);case ct:return function(t,e){var n=e?Qi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case lt:case ht:case ft:case pt:case dt:case mt:case gt:case vt:case yt:return Ki(t,n);case Z:return new r;case Q:case rt:return new r(t);case et:return function(t){var e=new t.constructor(t.source,jt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case nt:return new r;case it:return function(t){return hr?te(hr.call(t)):{}}(t)}}(t,m,u)}}a||(a=new wr);var v=a.get(t);if(v)return v;if(a.set(t,s),Os(t))return t.forEach(function(r){s.add(Br(r,e,n,r,t,a))}),s;if(Ls(t))return t.forEach(function(r,i){s.set(i,Br(r,e,n,i,t,a))}),s;var y=h?o:(l?c?Oo:Co:c?iu:ru)(t);return Ye(y||t,function(r,i){y&&(r=t[i=r]),Lr(s,i,Br(r,e,n,i,t,a))}),s}function Nr(t,e,n){var r=n.length;if(null==t)return!r;for(t=te(t);r--;){var i=n[r],a=e[i],s=t[i];if(s===o&&!(i in t)||!a(s))return!1}return!0}function Ur(t,e,n){if("function"!=typeof t)throw new re(u);return ra(function(){t.apply(o,n)},e)}function zr(t,e,n,r){var i=-1,o=Qe,s=!0,u=t.length,c=[],l=e.length;if(!u)return c;n&&(e=$e(e,vn(n))),r?(o=Ke,s=!1):e.length>=a&&(o=xn,s=!1,e=new _r(e));t:for(;++i-1},xr.prototype.set=function(t,e){var n=this.__data__,r=Rr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},br.prototype.clear=function(){this.size=0,this.__data__={hash:new yr,map:new(Kn||xr),string:new yr}},br.prototype.delete=function(t){var e=Uo(this,t).delete(t);return this.size-=e?1:0,e},br.prototype.get=function(t){return Uo(this,t).get(t)},br.prototype.has=function(t){return Uo(this,t).has(t)},br.prototype.set=function(t,e){var n=Uo(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},_r.prototype.add=_r.prototype.push=function(t){return this.__data__.set(t,c),this},_r.prototype.has=function(t){return this.__data__.has(t)},wr.prototype.clear=function(){this.__data__=new xr,this.size=0},wr.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},wr.prototype.get=function(t){return this.__data__.get(t)},wr.prototype.has=function(t){return this.__data__.has(t)},wr.prototype.set=function(t,e){var n=this.__data__;if(n instanceof xr){var r=n.__data__;if(!Kn||r.length0&&n(s)?e>1?Vr(s,e-1,n,r,i):tn(i,s):r||(i[i.length]=s)}return i}var Wr=so(),qr=so(!0);function Yr(t,e){return t&&Wr(t,e,ru)}function Xr(t,e){return t&&qr(t,e,ru)}function Jr(t,e){return Ze(e,function(e){return Ms(t[e])})}function Zr(t,e){for(var n=0,r=(e=qi(e,t)).length;null!=t&&ne}function ti(t,e){return null!=t&&ce.call(t,e)}function ei(t,e){return null!=t&&e in te(t)}function ni(t,e,r){for(var i=r?Ke:Qe,a=t[0].length,s=t.length,u=s,c=n(s),l=1/0,h=[];u--;){var f=t[u];u&&e&&(f=$e(f,vn(e))),l=qn(f.length,l),c[u]=!r&&(e||a>=120&&f.length>=120)?new _r(u&&f):o}f=t[0];var p=-1,d=c[0];t:for(;++p=s)return u;var c=n[r];return u*("desc"==c?-1:1)}}return t.index-e.index}(t,e,n)})}function yi(t,e,n){for(var r=-1,i=e.length,o={};++r-1;)s!==t&&De.call(s,u,1),De.call(t,u,1);return t}function bi(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;qo(i)?De.call(t,i,1):zi(t,i)}}return t}function _i(t,e){return t+Gn(Jn()*(e-t+1))}function wi(t,e){var n="";if(!t||e<1||e>D)return n;do{e%2&&(n+=t),(e=Gn(e/2))&&(t+=t)}while(e);return n}function Mi(t,e){return ia(ta(t,e,Ru),t+"")}function Ei(t){return Er(fu(t))}function Si(t,e){var n=fu(t);return sa(n,Dr(e,0,n.length))}function Ti(t,e,n,r){if(!Ts(t))return t;for(var i=-1,a=(e=qi(e,t)).length,s=a-1,u=t;null!=u&&++io?0:o+e),(r=r>o?o:r)<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var a=n(o);++i>>1,a=t[o];null!==a&&!Ds(a)&&(n?a<=e:a=a){var l=e?null:Mo(t);if(l)return Pn(l);s=!1,i=xn,c=new _r}else c=e?[]:u;t:for(;++r=r?t:Pi(t,e,n)}var Ji=pn||function(t){return Ie.clearTimeout(t)};function Zi(t,e){if(e)return t.slice();var n=t.length,r=we?we(n):new t.constructor(n);return t.copy(r),r}function Qi(t){var e=new t.constructor(t.byteLength);return new be(e).set(new be(t)),e}function Ki(t,e){var n=e?Qi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function $i(t,e){if(t!==e){var n=t!==o,r=null===t,i=t==t,a=Ds(t),s=e!==o,u=null===e,c=e==e,l=Ds(e);if(!u&&!l&&!a&&t>e||a&&s&&c&&!u&&!l||r&&s&&c||!n&&c||!i)return 1;if(!r&&!a&&!l&&t1?n[i-1]:o,s=i>2?n[2]:o;for(a=t.length>3&&"function"==typeof a?(i--,a):o,s&&Yo(n[0],n[1],s)&&(a=i<3?o:a,i=1),e=te(e);++r-1?i[a?e[s]:s]:o}}function fo(t){return Po(function(e){var n=e.length,r=n,i=gr.prototype.thru;for(t&&e.reverse();r--;){var a=e[r];if("function"!=typeof a)throw new re(u);if(i&&!s&&"wrapper"==Do(a))var s=new gr([],!0)}for(r=s?r:n;++r1&&b.reverse(),f&&lu))return!1;var l=a.get(t);if(l&&a.get(e))return l==e;var h=-1,f=!0,p=n&g?new _r:o;for(a.set(t,e),a.set(e,t);++h-1&&t%1==0&&t1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(Ut,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Ye(F,function(n){var r="_."+n[0];e&n[1]&&!Qe(t,r)&&t.push(r)}),t.sort()}(function(t){var e=t.match(zt);return e?e[1].split(Gt):[]}(r),n)))}function aa(t){var e=0,n=0;return function(){var r=Yn(),i=P-(r-n);if(n=r,i>0){if(++e>=R)return arguments[0]}else e=0;return t.apply(o,arguments)}}function sa(t,e){var n=-1,r=t.length,i=r-1;for(e=e===o?r:e;++n1?t[e-1]:o;return Ca(t,n="function"==typeof n?(t.pop(),n):o)});function za(t){var e=pr(t);return e.__chain__=!0,e}function Ga(t,e){return e(t)}var Fa=Po(function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(e){return Ir(e,t)};return!(e>1||this.__actions__.length)&&r instanceof vr&&qo(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:Ga,args:[i],thisArg:o}),new gr(r,this.__chain__).thru(function(t){return e&&!t.length&&t.push(o),t})):this.thru(i)});var Ha=io(function(t,e,n){ce.call(t,n)?++t[n]:Or(t,n,1)});var ka=ho(ma),ja=ho(ga);function Va(t,e){return(gs(t)?Ye:Gr)(t,No(e,3))}function Wa(t,e){return(gs(t)?Xe:Fr)(t,No(e,3))}var qa=io(function(t,e,n){ce.call(t,n)?t[n].push(e):Or(t,n,[e])});var Ya=Mi(function(t,e,r){var i=-1,o="function"==typeof e,a=ys(t)?n(t.length):[];return Gr(t,function(t){a[++i]=o?We(e,t,r):ri(t,e,r)}),a}),Xa=io(function(t,e,n){Or(t,n,e)});function Ja(t,e){return(gs(t)?$e:fi)(t,No(e,3))}var Za=io(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]});var Qa=Mi(function(t,e){if(null==t)return[];var n=e.length;return n>1&&Yo(t,e[0],e[1])?e=[]:n>2&&Yo(e[0],e[1],e[2])&&(e=[e[0]]),vi(t,Vr(e,1),[])}),Ka=Nn||function(){return Ie.Date.now()};function $a(t,e,n){return e=n?o:e,e=t&&null==e?t.length:e,So(t,E,o,o,o,o,e)}function ts(t,e){var n;if("function"!=typeof e)throw new re(u);return t=Fs(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=o),n}}var es=Mi(function(t,e,n){var r=v;if(n.length){var i=Ln(n,Bo(es));r|=w}return So(t,r,e,n,i)}),ns=Mi(function(t,e,n){var r=v|y;if(n.length){var i=Ln(n,Bo(ns));r|=w}return So(e,r,t,n,i)});function rs(t,e,n){var r,i,a,s,c,l,h=0,f=!1,p=!1,d=!0;if("function"!=typeof t)throw new re(u);function m(e){var n=r,a=i;return r=i=o,h=e,s=t.apply(a,n)}function g(t){var n=t-l;return l===o||n>=e||n<0||p&&t-h>=a}function v(){var t=Ka();if(g(t))return y(t);c=ra(v,function(t){var n=e-(t-l);return p?qn(n,a-(t-h)):n}(t))}function y(t){return c=o,d&&r?m(t):(r=i=o,s)}function x(){var t=Ka(),n=g(t);if(r=arguments,i=this,l=t,n){if(c===o)return function(t){return h=t,c=ra(v,e),f?m(t):s}(l);if(p)return c=ra(v,e),m(l)}return c===o&&(c=ra(v,e)),s}return e=ks(e)||0,Ts(n)&&(f=!!n.leading,a=(p="maxWait"in n)?Wn(ks(n.maxWait)||0,e):a,d="trailing"in n?!!n.trailing:d),x.cancel=function(){c!==o&&Ji(c),h=0,r=l=i=c=o},x.flush=function(){return c===o?s:y(Ka())},x}var is=Mi(function(t,e){return Ur(t,1,e)}),os=Mi(function(t,e,n){return Ur(t,ks(e)||0,n)});function as(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new re(u);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(as.Cache||br),n}function ss(t){if("function"!=typeof t)throw new re(u);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}as.Cache=br;var us=Yi(function(t,e){var n=(e=1==e.length&&gs(e[0])?$e(e[0],vn(No())):$e(Vr(e,1),vn(No()))).length;return Mi(function(r){for(var i=-1,o=qn(r.length,n);++i=e}),ms=ii(function(){return arguments}())?ii:function(t){return As(t)&&ce.call(t,"callee")&&!Oe.call(t,"callee")},gs=n.isArray,vs=Ge?vn(Ge):function(t){return As(t)&&Kr(t)==ut};function ys(t){return null!=t&&Ss(t.length)&&!Ms(t)}function xs(t){return As(t)&&ys(t)}var bs=Hn||ku,_s=Fe?vn(Fe):function(t){return As(t)&&Kr(t)==W};function ws(t){if(!As(t))return!1;var e=Kr(t);return e==Y||e==q||"string"==typeof t.message&&"string"==typeof t.name&&!Ps(t)}function Ms(t){if(!Ts(t))return!1;var e=Kr(t);return e==X||e==J||e==j||e==tt}function Es(t){return"number"==typeof t&&t==Fs(t)}function Ss(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=D}function Ts(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function As(t){return null!=t&&"object"==typeof t}var Ls=He?vn(He):function(t){return As(t)&&ko(t)==Z};function Rs(t){return"number"==typeof t||As(t)&&Kr(t)==Q}function Ps(t){if(!As(t)||Kr(t)!=$)return!1;var e=Le(t);if(null===e)return!0;var n=ce.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&ue.call(n)==pe}var Cs=ke?vn(ke):function(t){return As(t)&&Kr(t)==et};var Os=je?vn(je):function(t){return As(t)&&ko(t)==nt};function Is(t){return"string"==typeof t||!gs(t)&&As(t)&&Kr(t)==rt}function Ds(t){return"symbol"==typeof t||As(t)&&Kr(t)==it}var Bs=Ve?vn(Ve):function(t){return As(t)&&Ss(t.length)&&!!Te[Kr(t)]};var Ns=bo(hi),Us=bo(function(t,e){return t<=e});function zs(t){if(!t)return[];if(ys(t))return Is(t)?In(t):no(t);if(Ue&&t[Ue])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Ue]());var e=ko(t);return(e==Z?Tn:e==nt?Pn:fu)(t)}function Gs(t){return t?(t=ks(t))===I||t===-I?(t<0?-1:1)*B:t==t?t:0:0===t?t:0}function Fs(t){var e=Gs(t),n=e%1;return e==e?n?e-n:e:0}function Hs(t){return t?Dr(Fs(t),0,U):0}function ks(t){if("number"==typeof t)return t;if(Ds(t))return N;if(Ts(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Ts(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(Dt,"");var n=Wt.test(t);return n||Yt.test(t)?Pe(t.slice(2),n?2:8):Vt.test(t)?N:+t}function js(t){return ro(t,iu(t))}function Vs(t){return null==t?"":Ni(t)}var Ws=oo(function(t,e){if(Qo(e)||ys(e))ro(e,ru(e),t);else for(var n in e)ce.call(e,n)&&Lr(t,n,e[n])}),qs=oo(function(t,e){ro(e,iu(e),t)}),Ys=oo(function(t,e,n,r){ro(e,iu(e),t,r)}),Xs=oo(function(t,e,n,r){ro(e,ru(e),t,r)}),Js=Po(Ir);var Zs=Mi(function(t,e){t=te(t);var n=-1,r=e.length,i=r>2?e[2]:o;for(i&&Yo(e[0],e[1],i)&&(r=1);++n1),e}),ro(t,Oo(t),n),r&&(n=Br(n,f|p|d,Lo));for(var i=e.length;i--;)zi(n,e[i]);return n});var uu=Po(function(t,e){return null==t?{}:function(t,e){return yi(t,e,function(e,n){return $s(t,n)})}(t,e)});function cu(t,e){if(null==t)return{};var n=$e(Oo(t),function(t){return[t]});return e=No(e),yi(t,n,function(t,n){return e(t,n[0])})}var lu=Eo(ru),hu=Eo(iu);function fu(t){return null==t?[]:yn(t,ru(t))}var pu=co(function(t,e,n){return e=e.toLowerCase(),t+(n?du(e):e)});function du(t){return wu(Vs(t).toLowerCase())}function mu(t){return(t=Vs(t))&&t.replace(Jt,wn).replace(xe,"")}var gu=co(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),vu=co(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),yu=uo("toLowerCase");var xu=co(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()});var bu=co(function(t,e,n){return t+(n?" ":"")+wu(e)});var _u=co(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}),wu=uo("toUpperCase");function Mu(t,e,n){return t=Vs(t),(e=n?o:e)===o?function(t){return Me.test(t)}(t)?function(t){return t.match(_e)||[]}(t):function(t){return t.match(Ft)||[]}(t):t.match(e)||[]}var Eu=Mi(function(t,e){try{return We(t,o,e)}catch(t){return ws(t)?t:new i(t)}}),Su=Po(function(t,e){return Ye(e,function(e){e=ca(e),Or(t,e,es(t[e],t))}),t});function Tu(t){return function(){return t}}var Au=fo(),Lu=fo(!0);function Ru(t){return t}function Pu(t){return ui("function"==typeof t?t:Br(t,f))}var Cu=Mi(function(t,e){return function(n){return ri(n,t,e)}}),Ou=Mi(function(t,e){return function(n){return ri(t,n,e)}});function Iu(t,e,n){var r=ru(e),i=Jr(e,r);null!=n||Ts(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=Jr(e,ru(e)));var o=!(Ts(n)&&"chain"in n&&!n.chain),a=Ms(t);return Ye(i,function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__);return(n.__actions__=no(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,tn([this.value()],arguments))})}),t}function Du(){}var Bu=vo($e),Nu=vo(Je),Uu=vo(rn);function zu(t){return Xo(t)?fn(ca(t)):function(t){return function(e){return Zr(e,t)}}(t)}var Gu=xo(),Fu=xo(!0);function Hu(){return[]}function ku(){return!1}var ju=go(function(t,e){return t+e},0),Vu=wo("ceil"),Wu=go(function(t,e){return t/e},1),qu=wo("floor");var Yu=go(function(t,e){return t*e},1),Xu=wo("round"),Ju=go(function(t,e){return t-e},0);return pr.after=function(t,e){if("function"!=typeof e)throw new re(u);return t=Fs(t),function(){if(--t<1)return e.apply(this,arguments)}},pr.ary=$a,pr.assign=Ws,pr.assignIn=qs,pr.assignInWith=Ys,pr.assignWith=Xs,pr.at=Js,pr.before=ts,pr.bind=es,pr.bindAll=Su,pr.bindKey=ns,pr.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return gs(t)?t:[t]},pr.chain=za,pr.chunk=function(t,e,r){e=(r?Yo(t,e,r):e===o)?1:Wn(Fs(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var a=0,s=0,u=n(zn(i/e));ai?0:i+n),(r=r===o||r>i?i:Fs(r))<0&&(r+=i),r=n>r?0:Hs(r);n>>0)?(t=Vs(t))&&("string"==typeof e||null!=e&&!Cs(e))&&!(e=Ni(e))&&Sn(t)?Xi(In(t),0,n):t.split(e,n):[]},pr.spread=function(t,e){if("function"!=typeof t)throw new re(u);return e=null==e?0:Wn(Fs(e),0),Mi(function(n){var r=n[e],i=Xi(n,0,e);return r&&tn(i,r),We(t,this,i)})},pr.tail=function(t){var e=null==t?0:t.length;return e?Pi(t,1,e):[]},pr.take=function(t,e,n){return t&&t.length?Pi(t,0,(e=n||e===o?1:Fs(e))<0?0:e):[]},pr.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?Pi(t,(e=r-(e=n||e===o?1:Fs(e)))<0?0:e,r):[]},pr.takeRightWhile=function(t,e){return t&&t.length?Fi(t,No(e,3),!1,!0):[]},pr.takeWhile=function(t,e){return t&&t.length?Fi(t,No(e,3)):[]},pr.tap=function(t,e){return e(t),t},pr.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new re(u);return Ts(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),rs(t,e,{leading:r,maxWait:e,trailing:i})},pr.thru=Ga,pr.toArray=zs,pr.toPairs=lu,pr.toPairsIn=hu,pr.toPath=function(t){return gs(t)?$e(t,ca):Ds(t)?[t]:no(ua(Vs(t)))},pr.toPlainObject=js,pr.transform=function(t,e,n){var r=gs(t),i=r||bs(t)||Bs(t);if(e=No(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:Ts(t)&&Ms(o)?dr(Le(t)):{}}return(i?Ye:Yr)(t,function(t,r,i){return e(n,t,r,i)}),n},pr.unary=function(t){return $a(t,1)},pr.union=Aa,pr.unionBy=La,pr.unionWith=Ra,pr.uniq=function(t){return t&&t.length?Ui(t):[]},pr.uniqBy=function(t,e){return t&&t.length?Ui(t,No(e,2)):[]},pr.uniqWith=function(t,e){return e="function"==typeof e?e:o,t&&t.length?Ui(t,o,e):[]},pr.unset=function(t,e){return null==t||zi(t,e)},pr.unzip=Pa,pr.unzipWith=Ca,pr.update=function(t,e,n){return null==t?t:Gi(t,e,Wi(n))},pr.updateWith=function(t,e,n,r){return r="function"==typeof r?r:o,null==t?t:Gi(t,e,Wi(n),r)},pr.values=fu,pr.valuesIn=function(t){return null==t?[]:yn(t,iu(t))},pr.without=Oa,pr.words=Mu,pr.wrap=function(t,e){return cs(Wi(e),t)},pr.xor=Ia,pr.xorBy=Da,pr.xorWith=Ba,pr.zip=Na,pr.zipObject=function(t,e){return ji(t||[],e||[],Lr)},pr.zipObjectDeep=function(t,e){return ji(t||[],e||[],Ti)},pr.zipWith=Ua,pr.entries=lu,pr.entriesIn=hu,pr.extend=qs,pr.extendWith=Ys,Iu(pr,pr),pr.add=ju,pr.attempt=Eu,pr.camelCase=pu,pr.capitalize=du,pr.ceil=Vu,pr.clamp=function(t,e,n){return n===o&&(n=e,e=o),n!==o&&(n=(n=ks(n))==n?n:0),e!==o&&(e=(e=ks(e))==e?e:0),Dr(ks(t),e,n)},pr.clone=function(t){return Br(t,d)},pr.cloneDeep=function(t){return Br(t,f|d)},pr.cloneDeepWith=function(t,e){return Br(t,f|d,e="function"==typeof e?e:o)},pr.cloneWith=function(t,e){return Br(t,d,e="function"==typeof e?e:o)},pr.conformsTo=function(t,e){return null==e||Nr(t,e,ru(e))},pr.deburr=mu,pr.defaultTo=function(t,e){return null==t||t!=t?e:t},pr.divide=Wu,pr.endsWith=function(t,e,n){t=Vs(t),e=Ni(e);var r=t.length,i=n=n===o?r:Dr(Fs(n),0,r);return(n-=e.length)>=0&&t.slice(n,i)==e},pr.eq=fs,pr.escape=function(t){return(t=Vs(t))&&St.test(t)?t.replace(Mt,Mn):t},pr.escapeRegExp=function(t){return(t=Vs(t))&&It.test(t)?t.replace(Ot,"\\$&"):t},pr.every=function(t,e,n){var r=gs(t)?Je:Hr;return n&&Yo(t,e,n)&&(e=o),r(t,No(e,3))},pr.find=ka,pr.findIndex=ma,pr.findKey=function(t,e){return an(t,No(e,3),Yr)},pr.findLast=ja,pr.findLastIndex=ga,pr.findLastKey=function(t,e){return an(t,No(e,3),Xr)},pr.floor=qu,pr.forEach=Va,pr.forEachRight=Wa,pr.forIn=function(t,e){return null==t?t:Wr(t,No(e,3),iu)},pr.forInRight=function(t,e){return null==t?t:qr(t,No(e,3),iu)},pr.forOwn=function(t,e){return t&&Yr(t,No(e,3))},pr.forOwnRight=function(t,e){return t&&Xr(t,No(e,3))},pr.get=Ks,pr.gt=ps,pr.gte=ds,pr.has=function(t,e){return null!=t&&jo(t,e,ti)},pr.hasIn=$s,pr.head=ya,pr.identity=Ru,pr.includes=function(t,e,n,r){t=ys(t)?t:fu(t),n=n&&!r?Fs(n):0;var i=t.length;return n<0&&(n=Wn(i+n,0)),Is(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&un(t,e,n)>-1},pr.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:Fs(n);return i<0&&(i=Wn(r+i,0)),un(t,e,i)},pr.inRange=function(t,e,n){return e=Gs(e),n===o?(n=e,e=0):n=Gs(n),function(t,e,n){return t>=qn(e,n)&&t=-D&&t<=D},pr.isSet=Os,pr.isString=Is,pr.isSymbol=Ds,pr.isTypedArray=Bs,pr.isUndefined=function(t){return t===o},pr.isWeakMap=function(t){return As(t)&&ko(t)==at},pr.isWeakSet=function(t){return As(t)&&Kr(t)==st},pr.join=function(t,e){return null==t?"":jn.call(t,e)},pr.kebabCase=gu,pr.last=wa,pr.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r;return n!==o&&(i=(i=Fs(n))<0?Wn(r+i,0):qn(i,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,i):sn(t,ln,i,!0)},pr.lowerCase=vu,pr.lowerFirst=yu,pr.lt=Ns,pr.lte=Us,pr.max=function(t){return t&&t.length?kr(t,Ru,$r):o},pr.maxBy=function(t,e){return t&&t.length?kr(t,No(e,2),$r):o},pr.mean=function(t){return hn(t,Ru)},pr.meanBy=function(t,e){return hn(t,No(e,2))},pr.min=function(t){return t&&t.length?kr(t,Ru,hi):o},pr.minBy=function(t,e){return t&&t.length?kr(t,No(e,2),hi):o},pr.stubArray=Hu,pr.stubFalse=ku,pr.stubObject=function(){return{}},pr.stubString=function(){return""},pr.stubTrue=function(){return!0},pr.multiply=Yu,pr.nth=function(t,e){return t&&t.length?gi(t,Fs(e)):o},pr.noConflict=function(){return Ie._===this&&(Ie._=de),this},pr.noop=Du,pr.now=Ka,pr.pad=function(t,e,n){t=Vs(t);var r=(e=Fs(e))?On(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return yo(Gn(i),n)+t+yo(zn(i),n)},pr.padEnd=function(t,e,n){t=Vs(t);var r=(e=Fs(e))?On(t):0;return e&&re){var r=t;t=e,e=r}if(n||t%1||e%1){var i=Jn();return qn(t+i*(e-t+Re("1e-"+((i+"").length-1))),e)}return _i(t,e)},pr.reduce=function(t,e,n){var r=gs(t)?en:dn,i=arguments.length<3;return r(t,No(e,4),n,i,Gr)},pr.reduceRight=function(t,e,n){var r=gs(t)?nn:dn,i=arguments.length<3;return r(t,No(e,4),n,i,Fr)},pr.repeat=function(t,e,n){return e=(n?Yo(t,e,n):e===o)?1:Fs(e),wi(Vs(t),e)},pr.replace=function(){var t=arguments,e=Vs(t[0]);return t.length<3?e:e.replace(t[1],t[2])},pr.result=function(t,e,n){var r=-1,i=(e=qi(e,t)).length;for(i||(i=1,t=o);++rD)return[];var n=U,r=qn(t,U);e=No(e),t-=U;for(var i=gn(r,e);++n=a)return t;var u=n-On(r);if(u<1)return r;var c=s?Xi(s,0,u).join(""):t.slice(0,u);if(i===o)return c+r;if(s&&(u+=c.length-u),Cs(i)){if(t.slice(u).search(i)){var l,h=c;for(i.global||(i=ee(i.source,Vs(jt.exec(i))+"g")),i.lastIndex=0;l=i.exec(h);)var f=l.index;c=c.slice(0,f===o?u:f)}}else if(t.indexOf(Ni(i),u)!=u){var p=c.lastIndexOf(i);p>-1&&(c=c.slice(0,p))}return c+r},pr.unescape=function(t){return(t=Vs(t))&&Et.test(t)?t.replace(wt,Dn):t},pr.uniqueId=function(t){var e=++le;return Vs(t)+e},pr.upperCase=_u,pr.upperFirst=wu,pr.each=Va,pr.eachRight=Wa,pr.first=ya,Iu(pr,function(){var t={};return Yr(pr,function(e,n){ce.call(pr.prototype,n)||(t[n]=e)}),t}(),{chain:!1}),pr.VERSION="4.17.10",Ye(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){pr[t].placeholder=pr}),Ye(["drop","take"],function(t,e){vr.prototype[t]=function(n){n=n===o?1:Wn(Fs(n),0);var r=this.__filtered__&&!e?new vr(this):this.clone();return r.__filtered__?r.__takeCount__=qn(n,r.__takeCount__):r.__views__.push({size:qn(n,U),type:t+(r.__dir__<0?"Right":"")}),r},vr.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}}),Ye(["filter","map","takeWhile"],function(t,e){var n=e+1,r=n==C||3==n;vr.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:No(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}}),Ye(["head","last"],function(t,e){var n="take"+(e?"Right":"");vr.prototype[t]=function(){return this[n](1).value()[0]}}),Ye(["initial","tail"],function(t,e){var n="drop"+(e?"":"Right");vr.prototype[t]=function(){return this.__filtered__?new vr(this):this[n](1)}}),vr.prototype.compact=function(){return this.filter(Ru)},vr.prototype.find=function(t){return this.filter(t).head()},vr.prototype.findLast=function(t){return this.reverse().find(t)},vr.prototype.invokeMap=Mi(function(t,e){return"function"==typeof t?new vr(this):this.map(function(n){return ri(n,t,e)})}),vr.prototype.reject=function(t){return this.filter(ss(No(t)))},vr.prototype.slice=function(t,e){t=Fs(t);var n=this;return n.__filtered__&&(t>0||e<0)?new vr(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==o&&(n=(e=Fs(e))<0?n.dropRight(-e):n.take(e-t)),n)},vr.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},vr.prototype.toArray=function(){return this.take(U)},Yr(vr.prototype,function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=pr[r?"take"+("last"==e?"Right":""):e],a=r||/^find/.test(e);i&&(pr.prototype[e]=function(){var e=this.__wrapped__,s=r?[1]:arguments,u=e instanceof vr,c=s[0],l=u||gs(e),h=function(t){var e=i.apply(pr,tn([t],s));return r&&f?e[0]:e};l&&n&&"function"==typeof c&&1!=c.length&&(u=l=!1);var f=this.__chain__,p=!!this.__actions__.length,d=a&&!f,m=u&&!p;if(!a&&l){e=m?e:new vr(this);var g=t.apply(e,s);return g.__actions__.push({func:Ga,args:[h],thisArg:o}),new gr(g,f)}return d&&m?t.apply(this,s):(g=this.thru(h),d?r?g.value()[0]:g.value():g)})}),Ye(["pop","push","shift","sort","splice","unshift"],function(t){var e=ie[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);pr.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(gs(i)?i:[],t)}return this[n](function(n){return e.apply(gs(n)?n:[],t)})}}),Yr(vr.prototype,function(t,e){var n=pr[e];if(n){var r=n.name+"";(ir[r]||(ir[r]=[])).push({name:e,func:n})}}),ir[po(o,y).name]=[{name:"wrapper",func:o}],vr.prototype.clone=function(){var t=new vr(this.__wrapped__);return t.__actions__=no(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=no(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=no(this.__views__),t},vr.prototype.reverse=function(){if(this.__filtered__){var t=new vr(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},vr.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=gs(t),r=e<0,i=n?t.length:0,o=function(t,e,n){for(var r=-1,i=n.length;++r=this.__values__.length;return{done:t,value:t?o:this.__values__[this.__index__++]}},pr.prototype.plant=function(t){for(var e,n=this;n instanceof mr;){var r=ha(n);r.__index__=0,r.__values__=o,e?i.__wrapped__=r:e=r;var i=r;n=n.__wrapped__}return i.__wrapped__=t,e},pr.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof vr){var e=t;return this.__actions__.length&&(e=new vr(this)),(e=e.reverse()).__actions__.push({func:Ga,args:[Ta],thisArg:o}),new gr(e,this.__chain__)}return this.thru(Ta)},pr.prototype.toJSON=pr.prototype.valueOf=pr.prototype.value=function(){return Hi(this.__wrapped__,this.__actions__)},pr.prototype.first=pr.prototype.head,Ue&&(pr.prototype[Ue]=function(){return this}),pr}();Ie._=Bn,(i=function(){return Bn}.call(e,n,e,r))===o||(r.exports=i)}).call(this)}).call(this,n(2),n(11)(t))},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";(function(n){Object.defineProperty(e,"__esModule",{value:!0});var r={loadPositions:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=t.meshes[e];if(0===(i.primitives?i.primitives.length:0))return console.error("gltfReader: Mesh has no primitive."),null;var o=[];return i.primitives.forEach(function(e){e.attributes&&(o=o.concat(r._loadAccessor(t,e.attributes.POSITION,n)))}),o},_loadAccessor:function(t,e,n){if(void 0===e)return null;var i=t.accessors[e],o=i.byteOffset||0,a=r._loadBufferView(t,i.bufferView,o,n),s=[];switch(i.componentType){case 5123:for(var u=0;u1&&void 0!==arguments[1]?arguments[1]:0;return r._operation(Math.ceil,t,e)},_operation:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(0===n)return t(e);var r=Math.pow(10,n);return t(e*r)/r}};e.default=r,t.exports=e.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(16),i={getTRSMatrix:function(t){var e=t.translation,n=t.rotation,r=t.scale,o=e?i._affineT(e):i._I(),a=n?i._affineR(n):i._I(),s=r?i._affineS(r):i._I();return o.multiply(a).multiply(s).toArray()},_affineT:function(t){return i._affine({t:t})},_affineR:function(t){return i._affine({r:t})},_affineS:function(t){return i._affine({s:t})},_I:function(){return(new r.Matrix4).identity()},_affine:function(t){var e=t.t,n=t.r,i=t.s;return e?(new r.Matrix4).makeTranslation(e[0],e[1],e[2]):n?(new r.Matrix4).makeRotationFromQuaternion(new r.Quaternion(n[0],n[1],n[2],n[3])):i?(new r.Matrix4).makeScale(i[0],i[1],i[2]):void 0}};e.default=i,t.exports=e.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=n(1),o=n(3),a=u(n(4)),s=u(n(5));function u(t){return t&&t.__esModule?t:{default:t}}function c(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.precision,i=n.ceilDimensions,o=this.getMeshesTransformMatrices(t.nodes,t,e).reduce(function(t,e){return t.min=t.min.map(function(t,n){return te[n]?t:e[n]}),t},{min:[1/0,1/0,1/0],max:[-1/0,-1/0,-1/0]}),s=i?a.default.ceil:a.default.round;return{dimensions:{width:s(o.max[0]-o.min[0],r),depth:s(o.max[2]-o.min[2],r),height:s(o.max[1]-o.min[1],r)},center:{x:a.default.round((o.max[0]+o.min[0])/2,r+1),y:a.default.round((o.max[2]+o.min[2])/2,r+1),z:a.default.round((o.max[1]+o.min[1])/2,r+1)}}},getMeshesTransformMatrices:function(t,e,n){var i=this;return t.forEach(function(t,e){return t.index=e}),t.filter(function(t){return void 0!==t.mesh}).reduce(function(a,s){var u=i.getParentNodesMatrices(s,t).map(function(t){return new r.Matrix(4,4,!1).setData(t)}),l=r.Matrix.multiply.apply(r.Matrix,c(u)),h=i.getPointsFromArray((0,o.loadPositions)(e,s.mesh,n)).map(function(t){return r.Matrix.multiply(t,l)});return a.concat(h)},[])},getParentNodesMatrices:function(t,e){var n=e.find(function(e){return e.children&&(0,i.includes)(e.children,t.index)}),r=t.matrix||s.default.getTRSMatrix(t);return"Cylinder"===t.name&&console.log(r),void 0!==n?[r].concat(c(this.getParentNodesMatrices(n,e))).filter(function(t){return t}):[r]},getPointsFromArray:function(t){for(var e=[],n=0;n1&&void 0!==arguments[1]?arguments[1]:[],n=arguments[2];if(n=Object.assign({precision:0,ceilDimensions:!1},n),Boolean(t.readUInt32LE)){if(2===t.readUInt32LE(4))return o.default.computeBoundings(t,n);throw new Error("gltf-bounding-box only currently handles glTF1 and glTF/glb2.")}if(1==+t.asset.version)return r.default.computeBoundings(t,n);if(2==+t.asset.version)return i.default.computeBoundings(t,e,n);throw new Error("gltf-bounding-box only currently handles glTF1 and glTF/glb2.")}};e.default=s,t.exports=e.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=n(1),o=n(3),a=u(n(4)),s=u(n(5));function u(t){return t&&t.__esModule?t:{default:t}}function c(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e1&&void 0!==arguments[1]?arguments[1]:{},n=e.precision,r=e.ceilDimensions,i=this.getMeshesTransformMatrices(t.nodes,t).reduce(function(t,e){return t.min=t.min.map(function(t,n){return te[n]?t:e[n]}),t},{min:[1/0,1/0,1/0],max:[-1/0,-1/0,-1/0]}),o=!0===r?a.default.ceil:a.default.round;return{dimensions:{width:o(i.max[0]-i.min[0],n),depth:o(i.max[2]-i.min[2],n),height:o(i.max[1]-i.min[1],n)},center:{x:a.default.round((i.max[0]+i.min[0])/2,n+1),y:a.default.round((i.max[2]+i.min[2])/2,n+1),z:a.default.round((i.max[1]+i.min[1])/2,n+1)}}},getMeshesTransformMatrices:function(t,e){var n=this;return Object.keys(t).filter(function(e){return t[e].meshes}).reduce(function(e,n){return[].concat(c(e),c(t[n].meshes.map(function(t){return{mesh:t,nodeName:n}})))},[]).reduce(function(i,a){var s=a.mesh,u=a.nodeName,l=n.getParentNodesMatrices(u,t).map(function(t){return new r.Matrix(4,4,!1).setData(t)}),h=r.Matrix.multiply.apply(r.Matrix,c(l)),f=n.getPointsFromArray((0,o.loadPositions)(e,s)).map(function(t){return r.Matrix.multiply(t,h)});return i.concat(f)},[])},getParentNodesMatrices:function(t,e){var n=Object.keys(e).find(function(n){return e[n].children&&(0,i.includes)(e[n].children,t)}),r=e[t].matrix||s.default.getTRSMatrix(e[t]);return n?[r].concat(c(this.getParentNodesMatrices(n,e))).filter(function(t){return t}):[r]},getPointsFromArray:function(t){for(var e=[],n=0;n=4){for(var m=0,g=this._cache||(this._cache={}),v=g.tempMatrix||(g.tempMatrix=new i(this.rows,this.cols,!1)),y=0;y
* @license MIT
*/
-var e=r(12),i=r(13),u=r(14);function o(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(t,n){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function v(t,n){if(a.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var e=!1;;)switch(n){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Y(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return N(t).length;default:if(e)return Y(t).length;n=(""+n).toLowerCase(),e=!0}}function g(t,n,r){var e=t[n];t[n]=t[r],t[r]=e}function _(t,n,r,e,i){if(0===t.length)return-1;if("string"==typeof r?(e=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof n&&(n=a.from(n,e)),a.isBuffer(n))return 0===n.length?-1:y(t,n,r,e,i);if("number"==typeof n)return n&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,n,r):Uint8Array.prototype.lastIndexOf.call(t,n,r):y(t,[n],r,e,i);throw new TypeError("val must be string, number or Buffer")}function y(t,n,r,e,i){var u,o=1,f=t.length,a=n.length;if(void 0!==e&&("ucs2"===(e=String(e).toLowerCase())||"ucs-2"===e||"utf16le"===e||"utf-16le"===e)){if(t.length<2||n.length<2)return-1;o=2,f/=2,a/=2,r/=2}function c(t,n){return 1===o?t[n]:t.readUInt16BE(n*o)}if(i){var s=-1;for(u=r;uf&&(r=f-a),u=r;u>=0;u--){for(var l=!0,h=0;hi&&(e=i):e=i;var u=n.length;if(u%2!=0)throw new TypeError("Invalid hex string");e>u/2&&(e=u/2);for(var o=0;o>8,i=r%256,u.push(i),u.push(e);return u}(n,t.length-r),t,r,e)}function E(t,n,r){return 0===n&&r===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(n,r))}function R(t,n,r){r=Math.min(t.length,r);for(var e=[],i=n;i239?4:c>223?3:c>191?2:1;if(i+l<=r)switch(l){case 1:c<128&&(s=c);break;case 2:128==(192&(u=t[i+1]))&&(a=(31&c)<<6|63&u)>127&&(s=a);break;case 3:u=t[i+1],o=t[i+2],128==(192&u)&&128==(192&o)&&(a=(15&c)<<12|(63&u)<<6|63&o)>2047&&(a<55296||a>57343)&&(s=a);break;case 4:u=t[i+1],o=t[i+2],f=t[i+3],128==(192&u)&&128==(192&o)&&128==(192&f)&&(a=(15&c)<<18|(63&u)<<12|(63&o)<<6|63&f)>65535&&a<1114112&&(s=a)}null===s?(s=65533,l=1):s>65535&&(s-=65536,e.push(s>>>10&1023|55296),s=56320|1023&s),e.push(s),i+=l}return function(t){var n=t.length;if(n<=B)return String.fromCharCode.apply(String,t);var r="",e=0;for(;ethis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(n>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return O(this,n,r);case"utf8":case"utf-8":return R(this,n,r);case"ascii":return P(this,n,r);case"latin1":case"binary":return j(this,n,r);case"base64":return E(this,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,n,r);default:if(e)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),e=!0}}.apply(this,arguments)},a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){var t="",r=n.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},a.prototype.compare=function(t,n,r,e,i){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===n&&(n=0),void 0===r&&(r=t?t.length:0),void 0===e&&(e=0),void 0===i&&(i=this.length),n<0||r>t.length||e<0||i>this.length)throw new RangeError("out of range index");if(e>=i&&n>=r)return 0;if(e>=i)return-1;if(n>=r)return 1;if(n>>>=0,r>>>=0,e>>>=0,i>>>=0,this===t)return 0;for(var u=i-e,o=r-n,f=Math.min(u,o),c=this.slice(e,i),s=t.slice(n,r),l=0;li)&&(r=i),t.length>0&&(r<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");e||(e="utf8");for(var u=!1;;)switch(e){case"hex":return d(this,t,n,r);case"utf8":case"utf-8":return w(this,t,n,r);case"ascii":return m(this,t,n,r);case"latin1":case"binary":return b(this,t,n,r);case"base64":return A(this,t,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,n,r);default:if(u)throw new TypeError("Unknown encoding: "+e);e=(""+e).toLowerCase(),u=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var B=4096;function P(t,n,r){var e="";r=Math.min(t.length,r);for(var i=n;ie)&&(r=e);for(var i="",u=n;ur)throw new RangeError("Trying to access beyond buffer length")}function T(t,n,r,e,i,u){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>i||nt.length)throw new RangeError("Index out of range")}function M(t,n,r,e){n<0&&(n=65535+n+1);for(var i=0,u=Math.min(t.length-r,2);i>>8*(e?i:1-i)}function U(t,n,r,e){n<0&&(n=4294967295+n+1);for(var i=0,u=Math.min(t.length-r,4);i>>8*(e?i:3-i)&255}function L(t,n,r,e,i,u){if(r+e>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function k(t,n,r,e,u){return u||L(t,0,r,4),i.write(t,n,r,e,23,4),r+4}function D(t,n,r,e,u){return u||L(t,0,r,8),i.write(t,n,r,e,52,8),r+8}a.prototype.slice=function(t,n){var r,e=this.length;if(t=~~t,n=void 0===n?e:~~n,t<0?(t+=e)<0&&(t=0):t>e&&(t=e),n<0?(n+=e)<0&&(n=0):n>e&&(n=e),n0&&(i*=256);)e+=this[t+--n]*i;return e},a.prototype.readUInt8=function(t,n){return n||S(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,n){return n||S(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,n){return n||S(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,n){return n||S(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,n){return n||S(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,n,r){t|=0,n|=0,r||S(t,n,this.length);for(var e=this[t],i=1,u=0;++u=(i*=128)&&(e-=Math.pow(2,8*n)),e},a.prototype.readIntBE=function(t,n,r){t|=0,n|=0,r||S(t,n,this.length);for(var e=n,i=1,u=this[t+--e];e>0&&(i*=256);)u+=this[t+--e]*i;return u>=(i*=128)&&(u-=Math.pow(2,8*n)),u},a.prototype.readInt8=function(t,n){return n||S(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,n){n||S(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,n){n||S(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,n){return n||S(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,n){return n||S(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,n){return n||S(t,4,this.length),i.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,n){return n||S(t,4,this.length),i.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,n){return n||S(t,8,this.length),i.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,n){return n||S(t,8,this.length),i.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,n,r,e){(t=+t,n|=0,r|=0,e)||T(this,t,n,r,Math.pow(2,8*r)-1,0);var i=1,u=0;for(this[n]=255&t;++u=0&&(u*=256);)this[n+i]=t/u&255;return n+r},a.prototype.writeUInt8=function(t,n,r){return t=+t,n|=0,r||T(this,t,n,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[n]=255&t,n+1},a.prototype.writeUInt16LE=function(t,n,r){return t=+t,n|=0,r||T(this,t,n,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[n]=255&t,this[n+1]=t>>>8):M(this,t,n,!0),n+2},a.prototype.writeUInt16BE=function(t,n,r){return t=+t,n|=0,r||T(this,t,n,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[n]=t>>>8,this[n+1]=255&t):M(this,t,n,!1),n+2},a.prototype.writeUInt32LE=function(t,n,r){return t=+t,n|=0,r||T(this,t,n,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[n+3]=t>>>24,this[n+2]=t>>>16,this[n+1]=t>>>8,this[n]=255&t):U(this,t,n,!0),n+4},a.prototype.writeUInt32BE=function(t,n,r){return t=+t,n|=0,r||T(this,t,n,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=255&t):U(this,t,n,!1),n+4},a.prototype.writeIntLE=function(t,n,r,e){if(t=+t,n|=0,!e){var i=Math.pow(2,8*r-1);T(this,t,n,r,i-1,-i)}var u=0,o=1,f=0;for(this[n]=255&t;++u>0)-f&255;return n+r},a.prototype.writeIntBE=function(t,n,r,e){if(t=+t,n|=0,!e){var i=Math.pow(2,8*r-1);T(this,t,n,r,i-1,-i)}var u=r-1,o=1,f=0;for(this[n+u]=255&t;--u>=0&&(o*=256);)t<0&&0===f&&0!==this[n+u+1]&&(f=1),this[n+u]=(t/o>>0)-f&255;return n+r},a.prototype.writeInt8=function(t,n,r){return t=+t,n|=0,r||T(this,t,n,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[n]=255&t,n+1},a.prototype.writeInt16LE=function(t,n,r){return t=+t,n|=0,r||T(this,t,n,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[n]=255&t,this[n+1]=t>>>8):M(this,t,n,!0),n+2},a.prototype.writeInt16BE=function(t,n,r){return t=+t,n|=0,r||T(this,t,n,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[n]=t>>>8,this[n+1]=255&t):M(this,t,n,!1),n+2},a.prototype.writeInt32LE=function(t,n,r){return t=+t,n|=0,r||T(this,t,n,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[n]=255&t,this[n+1]=t>>>8,this[n+2]=t>>>16,this[n+3]=t>>>24):U(this,t,n,!0),n+4},a.prototype.writeInt32BE=function(t,n,r){return t=+t,n|=0,r||T(this,t,n,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=255&t):U(this,t,n,!1),n+4},a.prototype.writeFloatLE=function(t,n,r){return k(this,t,n,!0,r)},a.prototype.writeFloatBE=function(t,n,r){return k(this,t,n,!1,r)},a.prototype.writeDoubleLE=function(t,n,r){return D(this,t,n,!0,r)},a.prototype.writeDoubleBE=function(t,n,r){return D(this,t,n,!1,r)},a.prototype.copy=function(t,n,r,e){if(r||(r=0),e||0===e||(e=this.length),n>=t.length&&(n=t.length),n||(n=0),e>0&&e=this.length)throw new RangeError("sourceStart out of bounds");if(e<0)throw new RangeError("sourceEnd out of bounds");e>this.length&&(e=this.length),t.length-n=0;--i)t[i+n]=this[i+r];else if(u<1e3||!a.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(u=n;u55295&&r<57344){if(!i){if(r>56319){(n-=3)>-1&&u.push(239,191,189);continue}if(o+1===e){(n-=3)>-1&&u.push(239,191,189);continue}i=r;continue}if(r<56320){(n-=3)>-1&&u.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(n-=3)>-1&&u.push(239,191,189);if(i=null,r<128){if((n-=1)<0)break;u.push(r)}else if(r<2048){if((n-=2)<0)break;u.push(r>>6|192,63&r|128)}else if(r<65536){if((n-=3)<0)break;u.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((n-=4)<0)break;u.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return u}function N(t){return e.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(C,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function W(t,n,r,e){for(var i=0;i=n.length||i>=t.length);++i)n[i+r]=t[i];return i}}).call(this,r(2))},function(t,n,r){"use strict";n.byteLength=function(t){var n=c(t),r=n[0],e=n[1];return 3*(r+e)/4-e},n.toByteArray=function(t){for(var n,r=c(t),e=r[0],o=r[1],f=new u(function(t,n,r){return 3*(n+r)/4-r}(0,e,o)),a=0,s=o>0?e-4:e,l=0;l>16&255,f[a++]=n>>8&255,f[a++]=255&n;2===o&&(n=i[t.charCodeAt(l)]<<2|i[t.charCodeAt(l+1)]>>4,f[a++]=255&n);1===o&&(n=i[t.charCodeAt(l)]<<10|i[t.charCodeAt(l+1)]<<4|i[t.charCodeAt(l+2)]>>2,f[a++]=n>>8&255,f[a++]=255&n);return f},n.fromByteArray=function(t){for(var n,r=t.length,i=r%3,u=[],o=0,f=r-i;of?f:o+16383));1===i?(n=t[r-1],u.push(e[n>>2]+e[n<<4&63]+"==")):2===i&&(n=(t[r-2]<<8)+t[r-1],u.push(e[n>>10]+e[n>>4&63]+e[n<<2&63]+"="));return u.join("")};for(var e=[],i=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,a=o.length;f0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=n),[r,r===n?0:4-r%4]}function s(t){return e[t>>18&63]+e[t>>12&63]+e[t>>6&63]+e[63&t]}function l(t,n,r){for(var e,i=[],u=n;u>1,s=-7,l=r?i-1:0,h=r?-1:1,p=t[n+l];for(l+=h,u=p&(1<<-s)-1,p>>=-s,s+=f;s>0;u=256*u+t[n+l],l+=h,s-=8);for(o=u&(1<<-s)-1,u>>=-s,s+=e;s>0;o=256*o+t[n+l],l+=h,s-=8);if(0===u)u=1-c;else{if(u===a)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,e),u-=c}return(p?-1:1)*o*Math.pow(2,u-e)},n.write=function(t,n,r,e,i,u){var o,f,a,c=8*u-i-1,s=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=e?0:u-1,v=e?1:-1,g=n<0||0===n&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(f=isNaN(n)?1:0,o=s):(o=Math.floor(Math.log(n)/Math.LN2),n*(a=Math.pow(2,-o))<1&&(o--,a*=2),(n+=o+l>=1?h/a:h*Math.pow(2,1-l))*a>=2&&(o++,a/=2),o+l>=s?(f=0,o=s):o+l>=1?(f=(n*a-1)*Math.pow(2,i),o+=l):(f=n*Math.pow(2,l-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&f,p+=v,f/=256,i-=8);for(o=o<0;t[r+p]=255&o,p+=v,o/=256,c-=8);t[r+p-v]|=128*g}},function(t,n){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var e=function(t){return t&&t.__esModule?t:{default:t}}(r(5));var i={computeBoundings:function(t,n){var r=t.readUInt32LE(12),i=t.slice(20,20+r),u=JSON.parse(i.toString()),o=20+r,f=t.readUInt32LE(o),a=t.slice(o+8,o+8+f);return e.default.computeBoundings(u,[a],n)}};n.default=i,t.exports=n.default}])});
+var r=n(13),i=n(14),o=n(15);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function d(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return F(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return H(t).length;default:if(r)return F(t).length;e=(""+e).toLowerCase(),r=!0}}function m(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function g(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=u.from(e,r)),u.isBuffer(e))return 0===e.length?-1:v(t,e,n,r,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):v(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,n,r,i){var o,a=1,s=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var l=-1;for(o=n;os&&(n=s-u),o=n;o>=0;o--){for(var h=!0,f=0;fi&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function E(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function S(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i239?4:c>223?3:c>191?2:1;if(i+h<=n)switch(h){case 1:c<128&&(l=c);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,h=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=h}return function(t){var e=t.length;if(e<=T)return String.fromCharCode.apply(String,t);var n="",r=0;for(;rthis.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,n);case"utf8":case"utf-8":return S(this,e,n);case"ascii":return A(this,e,n);case"latin1":case"binary":return L(this,e,n);case"base64":return E(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),""},u.prototype.compare=function(t,e,n,r,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,r>>>=0,i>>>=0,this===t)return 0;for(var o=i-r,a=n-e,s=Math.min(o,a),c=this.slice(r,i),l=t.slice(e,n),h=0;hi)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return y(this,t,e,n);case"utf8":case"utf-8":return x(this,t,e,n);case"ascii":return b(this,t,e,n);case"latin1":case"binary":return _(this,t,e,n);case"base64":return w(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function A(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;ir)&&(n=r);for(var i="",o=e;on)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,n,r,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function I(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i>>8*(r?i:1-i)}function D(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i>>8*(r?i:3-i)&255}function B(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function N(t,e,n,r,o){return o||B(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function U(t,e,n,r,o){return o||B(t,0,n,8),i.write(t,e,n,r,52,8),n+8}u.prototype.slice=function(t,e){var n,r=this.length;if(t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e0&&(i*=256);)r+=this[t+--e]*i;return r},u.prototype.readUInt8=function(t,e){return e||C(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||C(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||C(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||C(t,e,this.length);for(var r=this[t],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*e)),r},u.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||C(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||C(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(t,e){e||C(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(t,e){return e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||C(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||C(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||C(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||C(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||O(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+i]=t/o&255;return e+n},u.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):D(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);O(this,t,e,n,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+n},u.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);O(this,t,e,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n},u.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):D(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||O(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,n){return N(this,t,e,!0,n)},u.prototype.writeFloatBE=function(t,e,n){return N(this,t,e,!1,n)},u.prototype.writeDoubleLE=function(t,e,n){return U(this,t,e,!0,n)},u.prototype.writeDoubleBE=function(t,e,n){return U(this,t,e,!1,n)},u.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e=0;--i)t[i+e]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function H(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(z,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function k(t,e,n,r){for(var i=0;i=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(this,n(2))},function(t,e,n){"use strict";e.byteLength=function(t){var e=c(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){for(var e,n=c(t),r=n[0],a=n[1],s=new o(function(t,e,n){return 3*(e+n)/4-n}(0,r,a)),u=0,l=a>0?r-4:r,h=0;h>16&255,s[u++]=e>>8&255,s[u++]=255&e;2===a&&(e=i[t.charCodeAt(h)]<<2|i[t.charCodeAt(h+1)]>>4,s[u++]=255&e);1===a&&(e=i[t.charCodeAt(h)]<<10|i[t.charCodeAt(h+1)]<<4|i[t.charCodeAt(h+2)]>>2,s[u++]=e>>8&255,s[u++]=255&e);return s},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],a=0,s=n-i;as?s:a+16383));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function l(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function h(t,e,n){for(var r,i=[],o=e;o>1,l=-7,h=n?i-1:0,f=n?-1:1,p=t[e+h];for(h+=f,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+t[e+h],h+=f,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+t[e+h],h+=f,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=c}return(p?-1:1)*a*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?f/u:f*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=l?(s=0,a=l):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[n+p]=255&s,p+=d,s/=256,i-=8);for(a=a<0;t[n+p]=255&a,p+=d,a/=256,c-=8);t[n+p-d]|=128*m}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){"use strict";function r(){}n.r(e),n.d(e,"WebGLMultisampleRenderTarget",function(){return Ze}),n.d(e,"WebGLRenderTargetCube",function(){return Qe}),n.d(e,"WebGLRenderTarget",function(){return Je}),n.d(e,"WebGLRenderer",function(){return _i}),n.d(e,"ShaderLib",function(){return fn}),n.d(e,"UniformsLib",function(){return hn}),n.d(e,"UniformsUtils",function(){return un}),n.d(e,"ShaderChunk",function(){return on}),n.d(e,"FogExp2",function(){return wi}),n.d(e,"Fog",function(){return Mi}),n.d(e,"Scene",function(){return Ei}),n.d(e,"Sprite",function(){return Li}),n.d(e,"LOD",function(){return Ri}),n.d(e,"SkinnedMesh",function(){return Pi}),n.d(e,"Skeleton",function(){return Ci}),n.d(e,"Bone",function(){return Oi}),n.d(e,"Mesh",function(){return Xn}),n.d(e,"LineSegments",function(){return Bi}),n.d(e,"LineLoop",function(){return Ni}),n.d(e,"Line",function(){return Di}),n.d(e,"Points",function(){return zi}),n.d(e,"Group",function(){return fi}),n.d(e,"VideoTexture",function(){return Gi}),n.d(e,"DataTexture",function(){return Ke}),n.d(e,"DataTexture2DArray",function(){return Qn}),n.d(e,"DataTexture3D",function(){return Kn}),n.d(e,"CompressedTexture",function(){return Fi}),n.d(e,"CubeTexture",function(){return Zn}),n.d(e,"CanvasTexture",function(){return Hi}),n.d(e,"DepthTexture",function(){return ki}),n.d(e,"Texture",function(){return Ye}),n.d(e,"AnimationLoader",function(){return Da}),n.d(e,"CompressedTextureLoader",function(){return Ba}),n.d(e,"DataTextureLoader",function(){return Na}),n.d(e,"CubeTextureLoader",function(){return za}),n.d(e,"TextureLoader",function(){return Ga}),n.d(e,"ObjectLoader",function(){return Es}),n.d(e,"MaterialLoader",function(){return bs}),n.d(e,"BufferGeometryLoader",function(){return ws}),n.d(e,"DefaultLoadingManager",function(){return Ca}),n.d(e,"LoadingManager",function(){return Pa}),n.d(e,"ImageLoader",function(){return Ua}),n.d(e,"ImageBitmapLoader",function(){return Rs}),n.d(e,"FontLoader",function(){return Is}),n.d(e,"FileLoader",function(){return Ia}),n.d(e,"Loader",function(){return Ds}),n.d(e,"LoaderUtils",function(){return _s}),n.d(e,"Cache",function(){return Ra}),n.d(e,"AudioLoader",function(){return Ns}),n.d(e,"SpotLightShadow",function(){return fs}),n.d(e,"SpotLight",function(){return ps}),n.d(e,"PointLight",function(){return ds}),n.d(e,"RectAreaLight",function(){return xs}),n.d(e,"HemisphereLight",function(){return ls}),n.d(e,"DirectionalLightShadow",function(){return gs}),n.d(e,"DirectionalLight",function(){return vs}),n.d(e,"AmbientLight",function(){return ys}),n.d(e,"LightShadow",function(){return hs}),n.d(e,"Light",function(){return cs}),n.d(e,"StereoCamera",function(){return Us}),n.d(e,"PerspectiveCamera",function(){return di}),n.d(e,"OrthographicCamera",function(){return ms}),n.d(e,"CubeCamera",function(){return zs}),n.d(e,"ArrayCamera",function(){return mi}),n.d(e,"Camera",function(){return pi}),n.d(e,"AudioListener",function(){return Fs}),n.d(e,"PositionalAudio",function(){return ks}),n.d(e,"AudioContext",function(){return Bs}),n.d(e,"AudioAnalyser",function(){return js}),n.d(e,"Audio",function(){return Hs}),n.d(e,"VectorKeyframeTrack",function(){return Ta}),n.d(e,"StringKeyframeTrack",function(){return Sa}),n.d(e,"QuaternionKeyframeTrack",function(){return Ea}),n.d(e,"NumberKeyframeTrack",function(){return wa}),n.d(e,"ColorKeyframeTrack",function(){return _a}),n.d(e,"BooleanKeyframeTrack",function(){return ba}),n.d(e,"PropertyMixer",function(){return Vs}),n.d(e,"PropertyBinding",function(){return Xs}),n.d(e,"KeyframeTrack",function(){return xa}),n.d(e,"AnimationUtils",function(){return da}),n.d(e,"AnimationObjectGroup",function(){return Js}),n.d(e,"AnimationMixer",function(){return Qs}),n.d(e,"AnimationClip",function(){return Aa}),n.d(e,"Uniform",function(){return Ks}),n.d(e,"InstancedBufferGeometry",function(){return $s}),n.d(e,"BufferGeometry",function(){return Bn}),n.d(e,"Geometry",function(){return _n}),n.d(e,"InterleavedBufferAttribute",function(){return Ti}),n.d(e,"InstancedInterleavedBuffer",function(){return tu}),n.d(e,"InterleavedBuffer",function(){return Si}),n.d(e,"InstancedBufferAttribute",function(){return eu}),n.d(e,"Face3",function(){return mn}),n.d(e,"Object3D",function(){return xn}),n.d(e,"Raycaster",function(){return nu}),n.d(e,"Layers",function(){return vn}),n.d(e,"EventDispatcher",function(){return r}),n.d(e,"Clock",function(){return Gs}),n.d(e,"QuaternionLinearInterpolant",function(){return Ma}),n.d(e,"LinearInterpolant",function(){return va}),n.d(e,"DiscreteInterpolant",function(){return ya}),n.d(e,"CubicInterpolant",function(){return ga}),n.d(e,"Interpolant",function(){return ma}),n.d(e,"Triangle",function(){return qn}),n.d(e,"Math",function(){return Fe}),n.d(e,"Spherical",function(){return ou}),n.d(e,"Cylindrical",function(){return au}),n.d(e,"Plane",function(){return en}),n.d(e,"Frustum",function(){return nn}),n.d(e,"Sphere",function(){return tn}),n.d(e,"Ray",function(){return Wn}),n.d(e,"Matrix4",function(){return rn}),n.d(e,"Matrix3",function(){return Ve}),n.d(e,"Box3",function(){return $e}),n.d(e,"Box2",function(){return su}),n.d(e,"Line3",function(){return uu}),n.d(e,"Euler",function(){return gn}),n.d(e,"Vector4",function(){return Xe}),n.d(e,"Vector3",function(){return je}),n.d(e,"Vector2",function(){return He}),n.d(e,"Quaternion",function(){return ke}),n.d(e,"Color",function(){return ln}),n.d(e,"ImmediateRenderObject",function(){return cu}),n.d(e,"VertexNormalsHelper",function(){return lu}),n.d(e,"SpotLightHelper",function(){return hu}),n.d(e,"SkeletonHelper",function(){return fu}),n.d(e,"PointLightHelper",function(){return pu}),n.d(e,"RectAreaLightHelper",function(){return du}),n.d(e,"HemisphereLightHelper",function(){return mu}),n.d(e,"GridHelper",function(){return gu}),n.d(e,"PolarGridHelper",function(){return vu}),n.d(e,"PositionalAudioHelper",function(){return yu}),n.d(e,"FaceNormalsHelper",function(){return xu}),n.d(e,"DirectionalLightHelper",function(){return bu}),n.d(e,"CameraHelper",function(){return _u}),n.d(e,"BoxHelper",function(){return wu}),n.d(e,"Box3Helper",function(){return Mu}),n.d(e,"PlaneHelper",function(){return Eu}),n.d(e,"ArrowHelper",function(){return Su}),n.d(e,"AxesHelper",function(){return Tu}),n.d(e,"Shape",function(){return us}),n.d(e,"Path",function(){return ss}),n.d(e,"ShapePath",function(){return Ps}),n.d(e,"Font",function(){return Cs}),n.d(e,"CurvePath",function(){return as}),n.d(e,"Curve",function(){return Fa}),n.d(e,"ImageUtils",function(){return We}),n.d(e,"ShapeUtils",function(){return Co}),n.d(e,"WebGLUtils",function(){return hi}),n.d(e,"WireframeGeometry",function(){return ji}),n.d(e,"ParametricGeometry",function(){return Vi}),n.d(e,"ParametricBufferGeometry",function(){return Wi}),n.d(e,"TetrahedronGeometry",function(){return Xi}),n.d(e,"TetrahedronBufferGeometry",function(){return Ji}),n.d(e,"OctahedronGeometry",function(){return Zi}),n.d(e,"OctahedronBufferGeometry",function(){return Qi}),n.d(e,"IcosahedronGeometry",function(){return Ki}),n.d(e,"IcosahedronBufferGeometry",function(){return $i}),n.d(e,"DodecahedronGeometry",function(){return to}),n.d(e,"DodecahedronBufferGeometry",function(){return eo}),n.d(e,"PolyhedronGeometry",function(){return qi}),n.d(e,"PolyhedronBufferGeometry",function(){return Yi}),n.d(e,"TubeGeometry",function(){return no}),n.d(e,"TubeBufferGeometry",function(){return ro}),n.d(e,"TorusKnotGeometry",function(){return io}),n.d(e,"TorusKnotBufferGeometry",function(){return oo}),n.d(e,"TorusGeometry",function(){return ao}),n.d(e,"TorusBufferGeometry",function(){return so}),n.d(e,"TextGeometry",function(){return zo}),n.d(e,"TextBufferGeometry",function(){return Go}),n.d(e,"SphereGeometry",function(){return Fo}),n.d(e,"SphereBufferGeometry",function(){return Ho}),n.d(e,"RingGeometry",function(){return ko}),n.d(e,"RingBufferGeometry",function(){return jo}),n.d(e,"PlaneGeometry",function(){return zn}),n.d(e,"PlaneBufferGeometry",function(){return Gn}),n.d(e,"LatheGeometry",function(){return Vo}),n.d(e,"LatheBufferGeometry",function(){return Wo}),n.d(e,"ShapeGeometry",function(){return qo}),n.d(e,"ShapeBufferGeometry",function(){return Yo}),n.d(e,"ExtrudeGeometry",function(){return Do}),n.d(e,"ExtrudeBufferGeometry",function(){return Bo}),n.d(e,"EdgesGeometry",function(){return Jo}),n.d(e,"ConeGeometry",function(){return Ko}),n.d(e,"ConeBufferGeometry",function(){return $o}),n.d(e,"CylinderGeometry",function(){return Zo}),n.d(e,"CylinderBufferGeometry",function(){return Qo}),n.d(e,"CircleGeometry",function(){return ta}),n.d(e,"CircleBufferGeometry",function(){return ea}),n.d(e,"BoxGeometry",function(){return Nn}),n.d(e,"CubeGeometry",function(){return Nn}),n.d(e,"BoxBufferGeometry",function(){return Un}),n.d(e,"ShadowMaterial",function(){return ra}),n.d(e,"SpriteMaterial",function(){return Ai}),n.d(e,"RawShaderMaterial",function(){return ia}),n.d(e,"ShaderMaterial",function(){return Vn}),n.d(e,"PointsMaterial",function(){return Ui}),n.d(e,"MeshPhysicalMaterial",function(){return aa}),n.d(e,"MeshStandardMaterial",function(){return oa}),n.d(e,"MeshPhongMaterial",function(){return sa}),n.d(e,"MeshToonMaterial",function(){return ua}),n.d(e,"MeshNormalMaterial",function(){return ca}),n.d(e,"MeshLambertMaterial",function(){return la}),n.d(e,"MeshDepthMaterial",function(){return si}),n.d(e,"MeshDistanceMaterial",function(){return ui}),n.d(e,"MeshBasicMaterial",function(){return Yn}),n.d(e,"MeshMatcapMaterial",function(){return ha}),n.d(e,"LineDashedMaterial",function(){return fa}),n.d(e,"LineBasicMaterial",function(){return Ii}),n.d(e,"Material",function(){return Hn}),n.d(e,"Float64BufferAttribute",function(){return Cn}),n.d(e,"Float32BufferAttribute",function(){return Pn}),n.d(e,"Uint32BufferAttribute",function(){return Rn}),n.d(e,"Int32BufferAttribute",function(){return Ln}),n.d(e,"Uint16BufferAttribute",function(){return An}),n.d(e,"Int16BufferAttribute",function(){return Tn}),n.d(e,"Uint8ClampedBufferAttribute",function(){return Sn}),n.d(e,"Uint8BufferAttribute",function(){return En}),n.d(e,"Int8BufferAttribute",function(){return Mn}),n.d(e,"BufferAttribute",function(){return wn}),n.d(e,"ArcCurve",function(){return ka}),n.d(e,"CatmullRomCurve3",function(){return Xa}),n.d(e,"CubicBezierCurve",function(){return Ka}),n.d(e,"CubicBezierCurve3",function(){return $a}),n.d(e,"EllipseCurve",function(){return Ha}),n.d(e,"LineCurve",function(){return ts}),n.d(e,"LineCurve3",function(){return es}),n.d(e,"QuadraticBezierCurve",function(){return ns}),n.d(e,"QuadraticBezierCurve3",function(){return rs}),n.d(e,"SplineCurve",function(){return is}),n.d(e,"REVISION",function(){return o}),n.d(e,"MOUSE",function(){return a}),n.d(e,"CullFaceNone",function(){return s}),n.d(e,"CullFaceBack",function(){return u}),n.d(e,"CullFaceFront",function(){return c}),n.d(e,"CullFaceFrontBack",function(){return l}),n.d(e,"FrontFaceDirectionCW",function(){return h}),n.d(e,"FrontFaceDirectionCCW",function(){return f}),n.d(e,"BasicShadowMap",function(){return p}),n.d(e,"PCFShadowMap",function(){return d}),n.d(e,"PCFSoftShadowMap",function(){return m}),n.d(e,"FrontSide",function(){return g}),n.d(e,"BackSide",function(){return v}),n.d(e,"DoubleSide",function(){return y}),n.d(e,"FlatShading",function(){return x}),n.d(e,"SmoothShading",function(){return b}),n.d(e,"NoColors",function(){return _}),n.d(e,"FaceColors",function(){return w}),n.d(e,"VertexColors",function(){return M}),n.d(e,"NoBlending",function(){return E}),n.d(e,"NormalBlending",function(){return S}),n.d(e,"AdditiveBlending",function(){return T}),n.d(e,"SubtractiveBlending",function(){return A}),n.d(e,"MultiplyBlending",function(){return L}),n.d(e,"CustomBlending",function(){return R}),n.d(e,"AddEquation",function(){return P}),n.d(e,"SubtractEquation",function(){return C}),n.d(e,"ReverseSubtractEquation",function(){return O}),n.d(e,"MinEquation",function(){return I}),n.d(e,"MaxEquation",function(){return D}),n.d(e,"ZeroFactor",function(){return B}),n.d(e,"OneFactor",function(){return N}),n.d(e,"SrcColorFactor",function(){return U}),n.d(e,"OneMinusSrcColorFactor",function(){return z}),n.d(e,"SrcAlphaFactor",function(){return G}),n.d(e,"OneMinusSrcAlphaFactor",function(){return F}),n.d(e,"DstAlphaFactor",function(){return H}),n.d(e,"OneMinusDstAlphaFactor",function(){return k}),n.d(e,"DstColorFactor",function(){return j}),n.d(e,"OneMinusDstColorFactor",function(){return V}),n.d(e,"SrcAlphaSaturateFactor",function(){return W}),n.d(e,"NeverDepth",function(){return q}),n.d(e,"AlwaysDepth",function(){return Y}),n.d(e,"LessDepth",function(){return X}),n.d(e,"LessEqualDepth",function(){return J}),n.d(e,"EqualDepth",function(){return Z}),n.d(e,"GreaterEqualDepth",function(){return Q}),n.d(e,"GreaterDepth",function(){return K}),n.d(e,"NotEqualDepth",function(){return $}),n.d(e,"MultiplyOperation",function(){return tt}),n.d(e,"MixOperation",function(){return et}),n.d(e,"AddOperation",function(){return nt}),n.d(e,"NoToneMapping",function(){return rt}),n.d(e,"LinearToneMapping",function(){return it}),n.d(e,"ReinhardToneMapping",function(){return ot}),n.d(e,"Uncharted2ToneMapping",function(){return at}),n.d(e,"CineonToneMapping",function(){return st}),n.d(e,"ACESFilmicToneMapping",function(){return ut}),n.d(e,"UVMapping",function(){return ct}),n.d(e,"CubeReflectionMapping",function(){return lt}),n.d(e,"CubeRefractionMapping",function(){return ht}),n.d(e,"EquirectangularReflectionMapping",function(){return ft}),n.d(e,"EquirectangularRefractionMapping",function(){return pt}),n.d(e,"SphericalReflectionMapping",function(){return dt}),n.d(e,"CubeUVReflectionMapping",function(){return mt}),n.d(e,"CubeUVRefractionMapping",function(){return gt}),n.d(e,"RepeatWrapping",function(){return vt}),n.d(e,"ClampToEdgeWrapping",function(){return yt}),n.d(e,"MirroredRepeatWrapping",function(){return xt}),n.d(e,"NearestFilter",function(){return bt}),n.d(e,"NearestMipMapNearestFilter",function(){return _t}),n.d(e,"NearestMipMapLinearFilter",function(){return wt}),n.d(e,"LinearFilter",function(){return Mt}),n.d(e,"LinearMipMapNearestFilter",function(){return Et}),n.d(e,"LinearMipMapLinearFilter",function(){return St}),n.d(e,"UnsignedByteType",function(){return Tt}),n.d(e,"ByteType",function(){return At}),n.d(e,"ShortType",function(){return Lt}),n.d(e,"UnsignedShortType",function(){return Rt}),n.d(e,"IntType",function(){return Pt}),n.d(e,"UnsignedIntType",function(){return Ct}),n.d(e,"FloatType",function(){return Ot}),n.d(e,"HalfFloatType",function(){return It}),n.d(e,"UnsignedShort4444Type",function(){return Dt}),n.d(e,"UnsignedShort5551Type",function(){return Bt}),n.d(e,"UnsignedShort565Type",function(){return Nt}),n.d(e,"UnsignedInt248Type",function(){return Ut}),n.d(e,"AlphaFormat",function(){return zt}),n.d(e,"RGBFormat",function(){return Gt}),n.d(e,"RGBAFormat",function(){return Ft}),n.d(e,"LuminanceFormat",function(){return Ht}),n.d(e,"LuminanceAlphaFormat",function(){return kt}),n.d(e,"RGBEFormat",function(){return jt}),n.d(e,"DepthFormat",function(){return Vt}),n.d(e,"DepthStencilFormat",function(){return Wt}),n.d(e,"RedFormat",function(){return qt}),n.d(e,"RGB_S3TC_DXT1_Format",function(){return Yt}),n.d(e,"RGBA_S3TC_DXT1_Format",function(){return Xt}),n.d(e,"RGBA_S3TC_DXT3_Format",function(){return Jt}),n.d(e,"RGBA_S3TC_DXT5_Format",function(){return Zt}),n.d(e,"RGB_PVRTC_4BPPV1_Format",function(){return Qt}),n.d(e,"RGB_PVRTC_2BPPV1_Format",function(){return Kt}),n.d(e,"RGBA_PVRTC_4BPPV1_Format",function(){return $t}),n.d(e,"RGBA_PVRTC_2BPPV1_Format",function(){return te}),n.d(e,"RGB_ETC1_Format",function(){return ee}),n.d(e,"RGBA_ASTC_4x4_Format",function(){return ne}),n.d(e,"RGBA_ASTC_5x4_Format",function(){return re}),n.d(e,"RGBA_ASTC_5x5_Format",function(){return ie}),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 ue}),n.d(e,"RGBA_ASTC_8x8_Format",function(){return ce}),n.d(e,"RGBA_ASTC_10x5_Format",function(){return le}),n.d(e,"RGBA_ASTC_10x6_Format",function(){return he}),n.d(e,"RGBA_ASTC_10x8_Format",function(){return fe}),n.d(e,"RGBA_ASTC_10x10_Format",function(){return pe}),n.d(e,"RGBA_ASTC_12x10_Format",function(){return de}),n.d(e,"RGBA_ASTC_12x12_Format",function(){return me}),n.d(e,"LoopOnce",function(){return ge}),n.d(e,"LoopRepeat",function(){return ve}),n.d(e,"LoopPingPong",function(){return ye}),n.d(e,"InterpolateDiscrete",function(){return xe}),n.d(e,"InterpolateLinear",function(){return be}),n.d(e,"InterpolateSmooth",function(){return _e}),n.d(e,"ZeroCurvatureEnding",function(){return we}),n.d(e,"ZeroSlopeEnding",function(){return Me}),n.d(e,"WrapAroundEnding",function(){return Ee}),n.d(e,"TrianglesDrawMode",function(){return Se}),n.d(e,"TriangleStripDrawMode",function(){return Te}),n.d(e,"TriangleFanDrawMode",function(){return Ae}),n.d(e,"LinearEncoding",function(){return Le}),n.d(e,"sRGBEncoding",function(){return Re}),n.d(e,"GammaEncoding",function(){return Pe}),n.d(e,"RGBEEncoding",function(){return Ce}),n.d(e,"LogLuvEncoding",function(){return Oe}),n.d(e,"RGBM7Encoding",function(){return Ie}),n.d(e,"RGBM16Encoding",function(){return De}),n.d(e,"RGBDEncoding",function(){return Be}),n.d(e,"BasicDepthPacking",function(){return Ne}),n.d(e,"RGBADepthPacking",function(){return Ue}),n.d(e,"TangentSpaceNormalMap",function(){return ze}),n.d(e,"ObjectSpaceNormalMap",function(){return Ge}),n.d(e,"Face4",function(){return Au}),n.d(e,"LineStrip",function(){return Lu}),n.d(e,"LinePieces",function(){return Ru}),n.d(e,"MeshFaceMaterial",function(){return Pu}),n.d(e,"MultiMaterial",function(){return Cu}),n.d(e,"PointCloud",function(){return Ou}),n.d(e,"Particle",function(){return Iu}),n.d(e,"ParticleSystem",function(){return Du}),n.d(e,"PointCloudMaterial",function(){return Bu}),n.d(e,"ParticleBasicMaterial",function(){return Nu}),n.d(e,"ParticleSystemMaterial",function(){return Uu}),n.d(e,"Vertex",function(){return zu}),n.d(e,"DynamicBufferAttribute",function(){return Gu}),n.d(e,"Int8Attribute",function(){return Fu}),n.d(e,"Uint8Attribute",function(){return Hu}),n.d(e,"Uint8ClampedAttribute",function(){return ku}),n.d(e,"Int16Attribute",function(){return ju}),n.d(e,"Uint16Attribute",function(){return Vu}),n.d(e,"Int32Attribute",function(){return Wu}),n.d(e,"Uint32Attribute",function(){return qu}),n.d(e,"Float32Attribute",function(){return Yu}),n.d(e,"Float64Attribute",function(){return Xu}),n.d(e,"ClosedSplineCurve3",function(){return Ju}),n.d(e,"SplineCurve3",function(){return Zu}),n.d(e,"Spline",function(){return Qu}),n.d(e,"AxisHelper",function(){return Ku}),n.d(e,"BoundingBoxHelper",function(){return $u}),n.d(e,"EdgesHelper",function(){return tc}),n.d(e,"WireframeHelper",function(){return ec}),n.d(e,"XHRLoader",function(){return nc}),n.d(e,"BinaryTextureLoader",function(){return rc}),n.d(e,"GeometryUtils",function(){return ic}),n.d(e,"Projector",function(){return oc}),n.d(e,"CanvasRenderer",function(){return ac}),n.d(e,"JSONLoader",function(){return sc}),n.d(e,"SceneUtils",function(){return uc}),n.d(e,"LensFlare",function(){return cc}),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&&(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>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&r|128]+t[r>>8&255]+"-"+t[r>>16&255]+t[r>>24&255]+t[255&i]+t[i>>8&255]+t[i>>16&255]+t[i>>24&255]).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,r,i){return r+(t-e)*(i-r)/(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*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*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*Fe.DEG2RAD},radToDeg:function(t){return t*Fe.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 He(t,e){this.x=t||0,this.y=e||0}function ke(t,e,n,r){this._x=t||0,this._y=e||0,this._z=n||0,this._w=void 0!==r?r: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(He.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(He.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,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6],this.y=r[1]*e+r[4]*n+r[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(){var t=new He,e=new He;return function(n,r){return t.set(n,n),e.set(r,r),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},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),r=Math.sin(e),i=this.x-t.x,o=this.y-t.y;return this.x=i*n-o*r+t.x,this.y=i*r+o*n+t.y,this}}),Object.assign(ke,{slerp:function(t,e,n,r){return n.copy(t).slerp(e,r)},slerpFlat:function(t,e,n,r,i,o,a){var s=n[r+0],u=n[r+1],c=n[r+2],l=n[r+3],h=i[o+0],f=i[o+1],p=i[o+2],d=i[o+3];if(l!==d||s!==h||u!==f||c!==p){var m=1-a,g=s*h+u*f+c*p+l*d,v=g>=0?1:-1,y=1-g*g;if(y>Number.EPSILON){var x=Math.sqrt(y),b=Math.atan2(x,g*v);m=Math.sin(m*b)/x,a=Math.sin(a*b)/x}var _=a*v;if(s=s*m+h*_,u=u*m+f*_,c=c*m+p*_,l=l*m+d*_,m===1-a){var w=1/Math.sqrt(s*s+u*u+c*c+l*l);s*=w,u*=w,c*=w,l*=w}}t[e]=s,t[e+1]=u,t[e+2]=c,t[e+3]=l}}),Object.defineProperties(ke.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(ke.prototype,{isQuaternion:!0,set:function(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._w=r,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,r=t._y,i=t._z,o=t.order,a=Math.cos,s=Math.sin,u=a(n/2),c=a(r/2),l=a(i/2),h=s(n/2),f=s(r/2),p=s(i/2);return"XYZ"===o?(this._x=h*c*l+u*f*p,this._y=u*f*l-h*c*p,this._z=u*c*p+h*f*l,this._w=u*c*l-h*f*p):"YXZ"===o?(this._x=h*c*l+u*f*p,this._y=u*f*l-h*c*p,this._z=u*c*p-h*f*l,this._w=u*c*l+h*f*p):"ZXY"===o?(this._x=h*c*l-u*f*p,this._y=u*f*l+h*c*p,this._z=u*c*p+h*f*l,this._w=u*c*l-h*f*p):"ZYX"===o?(this._x=h*c*l-u*f*p,this._y=u*f*l+h*c*p,this._z=u*c*p-h*f*l,this._w=u*c*l+h*f*p):"YZX"===o?(this._x=h*c*l+u*f*p,this._y=u*f*l+h*c*p,this._z=u*c*p-h*f*l,this._w=u*c*l-h*f*p):"XZY"===o&&(this._x=h*c*l-u*f*p,this._y=u*f*l-h*c*p,this._z=u*c*p+h*f*l,this._w=u*c*l+h*f*p),!1!==e&&this.onChangeCallback(),this},setFromAxisAngle:function(t,e){var n=e/2,r=Math.sin(n);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(n),this.onChangeCallback(),this},setFromRotationMatrix:function(t){var e,n=t.elements,r=n[0],i=n[4],o=n[8],a=n[1],s=n[5],u=n[9],c=n[2],l=n[6],h=n[10],f=r+s+h;return f>0?(e=.5/Math.sqrt(f+1),this._w=.25/e,this._x=(l-u)*e,this._y=(o-c)*e,this._z=(a-i)*e):r>s&&r>h?(e=2*Math.sqrt(1+r-s-h),this._w=(l-u)/e,this._x=.25*e,this._y=(i+a)/e,this._z=(o+c)/e):s>h?(e=2*Math.sqrt(1+s-r-h),this._w=(o-c)/e,this._x=(i+a)/e,this._y=.25*e,this._z=(u+l)/e):(e=2*Math.sqrt(1+h-r-s),this._w=(a-i)/e,this._x=(o+c)/e,this._y=(u+l)/e,this._z=.25*e),this.onChangeCallback(),this},setFromUnitVectors:function(t,e){var n=t.dot(e)+1;return n<1e-6?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(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=n),this.normalize()},angleTo:function(t){return 2*Math.acos(Math.abs(Fe.clamp(this.dot(t),-1,1)))},rotateTowards:function(t,e){var n=this.angleTo(t);if(0===n)return this;var r=Math.min(1,e/n);return this.slerp(t,r),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,r=t._y,i=t._z,o=t._w,a=e._x,s=e._y,u=e._z,c=e._w;return this._x=n*c+o*a+r*u-i*s,this._y=r*c+o*s+i*a-n*u,this._z=i*c+o*u+n*s-r*a,this._w=o*c-n*a-r*s-i*u,this.onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var n=this._x,r=this._y,i=this._z,o=this._w,a=o*t._w+n*t._x+r*t._y+i*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=r,this._z=i,this;var s=1-a*a;if(s<=Number.EPSILON){var u=1-e;return this._w=u*o+e*this._w,this._x=u*n+e*this._x,this._y=u*r+e*this._y,this._z=u*i+e*this._z,this.normalize()}var c=Math.sqrt(s),l=Math.atan2(c,a),h=Math.sin((1-e)*l)/c,f=Math.sin(e*l)/c;return this._w=o*h+this._w*f,this._x=n*h+this._x*f,this._y=r*h+this._y*f,this._z=i*h+this._z*f,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 ke;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 ke;return function(e,n){return this.applyQuaternion(t.setFromAxisAngle(e,n))}}(),applyMatrix3:function(t){var e=this.x,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6]*r,this.y=i[1]*e+i[4]*n+i[7]*r,this.z=i[2]*e+i[5]*n+i[8]*r,this},applyMatrix4:function(t){var e=this.x,n=this.y,r=this.z,i=t.elements,o=1/(i[3]*e+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*e+i[4]*n+i[8]*r+i[12])*o,this.y=(i[1]*e+i[5]*n+i[9]*r+i[13])*o,this.z=(i[2]*e+i[6]*n+i[10]*r+i[14])*o,this},applyQuaternion:function(t){var e=this.x,n=this.y,r=this.z,i=t.x,o=t.y,a=t.z,s=t.w,u=s*e+o*r-a*n,c=s*n+a*e-i*r,l=s*r+i*n-o*e,h=-i*e-o*n-a*r;return this.x=u*s+h*-i+c*-a-l*-o,this.y=c*s+h*-o+l*-i-u*-a,this.z=l*s+h*-a+u*-o-c*-i,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,r=this.z,i=t.elements;return this.x=i[0]*e+i[4]*n+i[8]*r,this.y=i[1]*e+i[5]*n+i[9]*r,this.z=i[2]*e+i[6]*n+i[10]*r,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(){var t=new je,e=new je;return function(n,r){return t.set(n,n,n),e.set(r,r,r),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},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,r=t.y,i=t.z,o=e.x,a=e.y,s=e.z;return this.x=r*s-i*a,this.y=i*o-n*s,this.z=n*a-r*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(Fe.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,r=this.z-t.z;return e*e+n*n+r*r},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 r=Math.sin(e)*t;return this.x=r*Math.sin(n),this.y=Math.cos(e)*t,this.z=r*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(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=r,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,r,i,o,a,s,u){var c=this.elements;return c[0]=t,c[1]=r,c[2]=a,c[3]=e,c[4]=i,c[5]=s,c[6]=n,c[7]=o,c[8]=u,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,r=e.count;n2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}},qe=0;function Ye(t,e,n,r,i,o,a,s,u,c){Object.defineProperty(this,"id",{value:qe++}),this.uuid=Fe.generateUUID(),this.name="",this.image=void 0!==t?t:Ye.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:Ye.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:yt,this.wrapT=void 0!==r?r:yt,this.magFilter=void 0!==i?i:Mt,this.minFilter=void 0!==o?o:St,this.anisotropy=void 0!==u?u:1,this.format=void 0!==a?a:Ft,this.type=void 0!==s?s:Tt,this.offset=new He(0,0),this.repeat=new He(1,1),this.center=new He(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!==c?c:Le,this.version=0,this.onUpdate=null}function Xe(t,e,n,r){this.x=t||0,this.y=e||0,this.z=n||0,this.w=void 0!==r?r:1}function Je(t,e,n){this.width=t,this.height=e,this.scissor=new Xe(0,0,t,e),this.scissorTest=!1,this.viewport=new Xe(0,0,t,e),n=n||{},this.texture=new Ye(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 Qe(t,e,n){Je.call(this,t,e,n)}function Ke(t,e,n,r,i,o,a,s,u,c,l,h){Ye.call(this,null,o,a,s,u,c,r,i,l,h),this.image={data:t,width:e,height:n},this.magFilter=void 0!==u?u:bt,this.minFilter=void 0!==c?c:bt,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function $e(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,r,i,o){this.planes=[void 0!==t?t:new en,void 0!==e?e:new en,void 0!==n?n:new en,void 0!==r?r:new en,void 0!==i?i: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.")}Ye.DEFAULT_IMAGE=void 0,Ye.DEFAULT_MAPPING=ct,Ye.prototype=Object.assign(Object.create(r.prototype),{constructor:Ye,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 r=this.image;if(void 0===r.uuid&&(r.uuid=Fe.generateUUID()),!e&&void 0===t.images[r.uuid]){var i;if(Array.isArray(r)){i=[];for(var o=0,a=r.length;o1)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 xt:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}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 xt:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}}),Object.defineProperty(Ye.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Xe.prototype,{isVector4:!0,set:function(t,e,n,r){return this.x=t,this.y=e,this.z=n,this.w=r,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,r=this.z,i=this.w,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*r+o[12]*i,this.y=o[1]*e+o[5]*n+o[9]*r+o[13]*i,this.z=o[2]*e+o[6]*n+o[10]*r+o[14]*i,this.w=o[3]*e+o[7]*n+o[11]*r+o[15]*i,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,r,i,o=t.elements,a=o[0],s=o[4],u=o[8],c=o[1],l=o[5],h=o[9],f=o[2],p=o[6],d=o[10];if(Math.abs(s-c)<.01&&Math.abs(u-f)<.01&&Math.abs(h-p)<.01){if(Math.abs(s+c)<.1&&Math.abs(u+f)<.1&&Math.abs(h+p)<.1&&Math.abs(a+l+d-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;var m=(a+1)/2,g=(l+1)/2,v=(d+1)/2,y=(s+c)/4,x=(u+f)/4,b=(h+p)/4;return m>g&&m>v?m<.01?(n=0,r=.707106781,i=.707106781):(r=y/(n=Math.sqrt(m)),i=x/n):g>v?g<.01?(n=.707106781,r=0,i=.707106781):(n=y/(r=Math.sqrt(g)),i=b/r):v<.01?(n=.707106781,r=.707106781,i=0):(n=x/(i=Math.sqrt(v)),r=b/i),this.set(n,r,i,e),this}var _=Math.sqrt((p-h)*(p-h)+(u-f)*(u-f)+(c-s)*(c-s));return Math.abs(_)<.001&&(_=1),this.x=(p-h)/_,this.y=(u-f)/_,this.z=(c-s)/_,this.w=Math.acos((a+l+d-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,r){return void 0===t&&(t=new Xe,e=new Xe),t.set(n,n,n,n),e.set(r,r,r,r),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(r.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}}),Qe.prototype=Object.create(Je.prototype),Qe.prototype.constructor=Qe,Qe.prototype.isWebGLRenderTargetCube=!0,Ke.prototype=Object.create(Ye.prototype),Ke.prototype.constructor=Ke,Ke.prototype.isDataTexture=!0,Object.assign($e.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,r=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,u=t.length;si&&(i=c),l>o&&(o=l),h>a&&(a=h)}return this.min.set(e,n,r),this.max.set(i,o,a),this},setFromBufferAttribute:function(t){for(var e=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,u=t.count;si&&(i=c),l>o&&(o=l),h>a&&(a=h)}return this.min.set(e,n,r),this.max.set(i,o,a),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,n=t.length;ethis.max.x||t.ythis.max.y||t.zthis.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.xthis.max.x||t.max.ythis.max.y||t.max.zthis.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,r=new je,i=new je,o=new je,a=new je,s=new je,u=new je,c=new je;function l(r){var i,o;for(i=0,o=r.length-3;i<=o;i+=3){a.fromArray(r,i);var s=u.x*Math.abs(a.x)+u.y*Math.abs(a.y)+u.z*Math.abs(a.z),c=t.dot(a),l=e.dot(a),h=n.dot(a);if(Math.max(-Math.max(c,l,h),Math.min(c,l,h))>s)return!1}return!0}return function(a){if(this.isEmpty())return!1;this.getCenter(s),u.subVectors(this.max,s),t.subVectors(a.a,s),e.subVectors(a.b,s),n.subVectors(a.c,s),r.subVectors(e,t),i.subVectors(n,e),o.subVectors(t,n);var h=[0,-r.z,r.y,0,-i.z,i.y,0,-o.z,o.y,r.z,0,-r.x,i.z,0,-i.x,o.z,0,-o.x,-r.y,r.x,0,-i.y,i.x,0,-o.y,o.x,0];return!!l(h)&&(!!l(h=[1,0,0,0,1,0,0,0,1])&&(c.crossVectors(r,i),l(h=[c.x,c.y,c.z])))}}(),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){return t.copy(e).clamp(this.min,this.max).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 $e;return function(e,n){var r=this.center;void 0!==n?r.copy(n):t.setFromPoints(e).getCenter(r);for(var i=0,o=0,a=e.length;othis.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 $e),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,r){return this.normal.set(t,e,n),this.constant=r,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,r,i){var o=t.subVectors(i,r).cross(e.subVectors(n,r)).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 r=e.delta(t),i=this.normal.dot(r);if(0===i)return 0===this.distanceToPoint(e.start)?n.copy(e.start):void 0;var o=-(e.start.dot(this.normal)+this.constant)/i;return o<0||o>1?void 0:n.copy(r).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,r){var i=r||e.getNormalMatrix(n),o=this.coplanarPoint(t).applyMatrix4(n),a=this.normal.applyMatrix3(i).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,r,i,o){var a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(r),a[4].copy(i),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,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],c=n[6],l=n[7],h=n[8],f=n[9],p=n[10],d=n[11],m=n[12],g=n[13],v=n[14],y=n[15];return e[0].setComponents(a-r,l-s,d-h,y-m).normalize(),e[1].setComponents(a+r,l+s,d+h,y+m).normalize(),e[2].setComponents(a+i,l+u,d+f,y+g).normalize(),e[3].setComponents(a-i,l-u,d-f,y-g).normalize(),e[4].setComponents(a-o,l-c,d-p,y-v).normalize(),e[5].setComponents(a+o,l+c,d+p,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,r=-t.radius,i=0;i<6;i++){if(e[i].distanceToPoint(n)0?e.max.x:e.min.x,t.y=i.normal.y>0?e.max.y:e.min.y,t.z=i.normal.z>0?e.max.z:e.min.z,i.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,r,i,o,a,s,u,c,l,h,f,p,d,m){var g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=r,g[1]=i,g[5]=o,g[9]=a,g[13]=s,g[2]=u,g[6]=c,g[10]=l,g[14]=h,g[3]=f,g[7]=p,g[11]=d,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,r=e.elements,i=1/t.setFromMatrixColumn(e,0).length(),o=1/t.setFromMatrixColumn(e,1).length(),a=1/t.setFromMatrixColumn(e,2).length();return n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[3]=0,n[4]=r[4]*o,n[5]=r[5]*o,n[6]=r[6]*o,n[7]=0,n[8]=r[8]*a,n[9]=r[9]*a,n[10]=r[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,r=t.y,i=t.z,o=Math.cos(n),a=Math.sin(n),s=Math.cos(r),u=Math.sin(r),c=Math.cos(i),l=Math.sin(i);if("XYZ"===t.order){var h=o*c,f=o*l,p=a*c,d=a*l;e[0]=s*c,e[4]=-s*l,e[8]=u,e[1]=f+p*u,e[5]=h-d*u,e[9]=-a*s,e[2]=d-h*u,e[6]=p+f*u,e[10]=o*s}else if("YXZ"===t.order){var m=s*c,g=s*l,v=u*c,y=u*l;e[0]=m+y*a,e[4]=v*a-g,e[8]=o*u,e[1]=o*l,e[5]=o*c,e[9]=-a,e[2]=g*a-v,e[6]=y+m*a,e[10]=o*s}else if("ZXY"===t.order){m=s*c,g=s*l,v=u*c,y=u*l;e[0]=m-y*a,e[4]=-o*l,e[8]=v+g*a,e[1]=g+v*a,e[5]=o*c,e[9]=y-m*a,e[2]=-o*u,e[6]=a,e[10]=o*s}else if("ZYX"===t.order){h=o*c,f=o*l,p=a*c,d=a*l;e[0]=s*c,e[4]=p*u-f,e[8]=h*u+d,e[1]=s*l,e[5]=d*u+h,e[9]=f*u-p,e[2]=-u,e[6]=a*s,e[10]=o*s}else if("YZX"===t.order){var x=o*s,b=o*u,_=a*s,w=a*u;e[0]=s*c,e[4]=w-x*l,e[8]=_*l+b,e[1]=l,e[5]=o*c,e[9]=-a*c,e[2]=-u*c,e[6]=b*l+_,e[10]=x-w*l}else if("XZY"===t.order){x=o*s,b=o*u,_=a*s,w=a*u;e[0]=s*c,e[4]=-l,e[8]=u*c,e[1]=x*l+w,e[5]=o*c,e[9]=b*l-_,e[2]=_*l-b,e[6]=a*c,e[10]=w*l+x}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(r,i,o){var a=this.elements;return n.subVectors(r,i),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,r=e.elements,i=this.elements,o=n[0],a=n[4],s=n[8],u=n[12],c=n[1],l=n[5],h=n[9],f=n[13],p=n[2],d=n[6],m=n[10],g=n[14],v=n[3],y=n[7],x=n[11],b=n[15],_=r[0],w=r[4],M=r[8],E=r[12],S=r[1],T=r[5],A=r[9],L=r[13],R=r[2],P=r[6],C=r[10],O=r[14],I=r[3],D=r[7],B=r[11],N=r[15];return i[0]=o*_+a*S+s*R+u*I,i[4]=o*w+a*T+s*P+u*D,i[8]=o*M+a*A+s*C+u*B,i[12]=o*E+a*L+s*O+u*N,i[1]=c*_+l*S+h*R+f*I,i[5]=c*w+l*T+h*P+f*D,i[9]=c*M+l*A+h*C+f*B,i[13]=c*E+l*L+h*O+f*N,i[2]=p*_+d*S+m*R+g*I,i[6]=p*w+d*T+m*P+g*D,i[10]=p*M+d*A+m*C+g*B,i[14]=p*E+d*L+m*O+g*N,i[3]=v*_+y*S+x*R+b*I,i[7]=v*w+y*T+x*P+b*D,i[11]=v*M+y*A+x*C+b*B,i[15]=v*E+y*L+x*O+b*N,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,r=e.count;n 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}\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( specularColor, dotNV );\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}",bumpmap_pars_fragment:"#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",clipping_planes_fragment:"#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",clipping_planes_pars_fragment:"#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",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvarying vec3 vViewPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#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}",cube_uv_reflection_fragment:"#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",defaultnormal_vertex:"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",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\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}",envmap_fragment:"#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",envmap_pars_fragment:"#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",envmap_pars_vertex:"#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",envmap_physical_pars_fragment:"#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",envmap_vertex:"#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",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#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",fog_pars_fragment:"#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",gradientmap_pars_fragment:"#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",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"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",lights_pars_begin:"uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t\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",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\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)",lights_physical_fragment:"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",lights_physical_pars_fragment:"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;\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}",lights_fragment_begin:"\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\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",lights_fragment_maps:"#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",lights_fragment_end:"#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",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n#endif",logdepthbuf_pars_vertex:"#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",logdepthbuf_vertex:"#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",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#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",map_particle_pars_fragment:"#ifdef USE_MAP\n\tuniform mat3 uvTransform;\n\tuniform sampler2D map;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#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",morphtarget_pars_vertex:"#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",morphtarget_vertex:"#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",normal_fragment_begin:"#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",normal_fragment_maps:"#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",normalmap_pars_fragment:"#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",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\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}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#if defined( DITHERING )\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#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",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#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",shadowmap_pars_vertex:"#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",shadowmap_vertex:"#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",shadowmask_pars_fragment:"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}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\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",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n\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}",uv_pars_fragment:"#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",uv_pars_vertex:"#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",uv_vertex:"#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",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#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}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \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 \n\t#include \n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include