....................................../////.===Shadow-Here===./////................................................ > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < ------------------------------------------------------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// RIFF¤ WEBPVP8 ˜ ðÑ *ôô>‘HŸK¥¤"§£±¨àð enü¹%½_F‘åè¿2ºQú³íªú`N¿­3ÿƒügµJžaÿ¯ÿ°~¼ÎùnúîÞÖô•òíôÁÉß®Sm¥Ü/ ‡ó˜f£Ùà<˜„xëJ¢Ù€SO3x<ªÔ©4¿+ç¶A`q@Ì“Úñè™ÍÿJÌ´ª-˜ÆtÊÛL]Ïq*‘Ý”ì#ŸÌÏãY]@ê`¿ /ªfkØB4·®£ó z—Üw¥Pxù–ÞLШKÇN¾AkÙTf½è'‰g gÆv›Øuh~ a˜Z— ïj*á¥t d£“uÒ ¨`K˜¹ßþ]b>˜]_ÏÔ6W—è2r4x•íÖ…"ƒÖNîä!¦å Ú}ýxGøÌ —@ ;ÆÚŠ=ɾ1ý8lªË¥ô ^yf®Œ¢u&2©nÙÇ›ñÂñŒ³ aPo['½»øFùà­+4ê“$!lövlüÞ=;N®3ð‚õ›DÉKòÞ>ÄÍ ¥ˆuߤ#ˆ$6ù™¥îЇy’ÍB¼ çxÛ;X"WL£R÷͝*ó-¶Zu}º.s¸sšXqù–DþÿvªhüïwyŸ ¯é³lÀ:KCûÄ£Ëá\…­ ~—ýóî ¼ûûÜTÓüÇy…ŽÆvc»¾×U ñ¸žþоP÷¦ó:Ò¨¨5;Ð#&#ÖúñläÿÁœ GxÉ­/ñ‡áQðìYÉtÒw޼GÔ´zàÒò ð*ëzƒ•4~H]Ø‹f ñÓÈñ`NåWçs'ÆÏW^ø¹!XžµmQ5ÃËoLœÎ: ÞËÍ¥J ù…î èo£ßPÎñ¶ž8.Œ]ʵ~5›ÙË-ù*8ÙÖß±~ ©¹rÓê‚j¶d¸{^Q'˜±Crß ÚH—#¥¥QlÀ×ëã‡DÜ«èî þ&Çæžî;ŽÏºò6ÒLÃXy&ZŒ'j‚¢Ù€IßÚù+–MGi‰*jE€‘JcÜ ÓÌ EÏÚj]o˜ Þr <¾U ûŪæÍ/šÝH¥˜b”¼ ÁñßX GP›ï2›4WŠÏà×£…íÓk†¦H·ÅíMh–*nó÷à]ÁjCº€b7<ب‹¨5車bp2:Á[UªM„QŒçiNMa#<5›áËó¸HýÊ"…×Éw¹¦ì2º–x<›»a±¸3Weü®FÝ⑱ö–î–³|LPÈ~çð~Çå‡|º kD¢µÏàÆAI %1À% ¹Ò – ”ϝS¦‰4&¶£°à Öý”û_Ò Áw°A«Å€?mÇÛgHÉ/8)á¾ÛìáöŽP í¨PŸNÙµº¦‡§Ùš"ÿ«>+ªÕ`Ê÷‡‚ß Õû˜þãÇ-PÍ.¾XV‘€ dÜ"þ4¹ ±Oú‘©t¥¦FªÄÃÄ•b‚znýu½—#cDs˜ÃiÑOˆñ×QO=*IAÊ,¶ŽZƒ;‡wøXè%EÐk:F±Ú” .Ѽ+Áu&Ç`."pÈÉw o&¿dE6‘’EqTuK@Ì¥ã™À(Êk(h‰,H}RÀIXÛš3µ1©_OqÚÒJAñ$ÊÙÜ;D3çŒ[þùœh¬Ã³™ö6ç†NY".Ú‰ï[ªŸŒ '²Ð öø_¨ÂÉ9ué¶³ÒŠõTàîMØ#û¯gN‡bÙ놚X„ö …ÉeüÌ^J ‹€.œ$Æ)βÄeæW#óüßĺŸ€ ÀzwV 9oä»f4V*uB «Ë†¹ì¯žR霓æHXa=&“I4K;¯ç‹h×·"UŠ~<•╪Vêª&ÍSÃÆÅ?ÔqÎ*mTM ˜›µwêd#[C¡©§‘D<©àb†–ÁœøvH/,í:¯( ²£|4-„Æövv„Yͼ™^Á$ˆ„¢Û[6yB.åH*V¨æ?$=˜Ñ€•ñ·­(VlŸ‘ nÀt8W÷´Bûba?q9ú¶Xƒl«ÿ\ù¶’þòUÐj/õ¢Ìµ³g$ƒÎR!¸»|Oߍë’BhîÚÑ¢ñåŒJ„®„£2Ð3•ô02Nt…!£Í]Ïc½Qÿ?ˆ<&ÃA¾Ú,JˆijÌ#5yz„‰Î|ÊŽ5QÏ:‹ÐaóVÔxW—CpeÏzÐïíçôÿÅ_[hãsÐ_/ŽTÝ?BîˆííV$<¿i>²F¬_Eß¿ †bÊŒº­ÿ®Z H“C}”¬,Mp ý/Bá£w>˜YV°aƒúh+cŠ- r/[%|üUMHäQ°X»|û/@|°¥Ð !BÔ Ç¢Ä©š+Õì D«7ìN¶ŽðÔ " ƶ’ÖçtA‰Û×}{tþz­¾GÍ›k¹OEJR$ Â׃ «ëÁ"oÉôž$oUK(Ä)Ãz³Ê-‹êN[Ò3Œñbï8P 4ƒ×q¢bo|?<ÛX¬òÄͰL–±›(™ûG?ýË©ÚÄ–ÂDØÐ_Ç¡ô ¾–ÄÏø ×e8Ë©$ÄF¹Å‹ì[©óìl:F¾f´‹‹Xì²ï®\¬ôùƒ ÿat¥óèÒùHß0äe‚;ü×h:ÆWðHž=Ã8骣"kœ'Y?³}Tûè€>?0l›e1Lòñ„aæKÆw…hÖŠùW…ÈÆÄ0ši·›[pcwËþñiêíY/~-Á5˜!¿†A›™Mÿþ(±“t@â“ö2­´TG5yé]çå僳 .·ÍïçÝ7UÚ±Ð/Nè»,_Ï ùdj7\ï Wì4›„»c¸àešg#ÒÊ⥭áØo5‘?ÌdÝô¯ ¹kzsƒ=´#ëÉK›Ø´±-¥eW?‡çßtòTã…$Ý+qÿ±ƒ÷_3Ô¥í÷:æ–ž<·Ö‡‰Å¢ š‡%Ô—utÌÈìðžgÖÀz²À—ï÷Óîäõ{K'´È÷³yaÏÁjƒô}ž§®æÊydÕÈë5¯èˆõvÕ©ã*çD„ “z„Ó‡^^xÂ3M§A´JG‚öï 3W'ˆ.OvXè¡ÊÕª?5º7†˜(˜Ç¶#çê’¶!ÌdZK§æ 0fãaN]òY³RV ™î$®K2R¨`W!1Ôó\;Ý ýB%qæK•&ÓÈe9È0êI±žeŸß -ú@žQr¦ ö4»M¼Áè¹µmw 9 EÆE_°2ó„ŸXKWÁ×Hóì^´²GѝF©óäR†¦‰ç"V»eØ<3ùd3ÿÚ¤Žú“Gi" —‘_ÙËÎ~Üö¯¥½Î»üŸEÚŽåmÞþí ;ÞólËΦMzA"Âf(´òá;Éï(/7½ûñÌ­cïÕçлþÝz¾-ÍvÑ“pH­–ðÓj$¸Äû¤‚‘ãUBË-n“2åPkS5&‹Â|+g^œ®Ì͆d!OïäîU«c;{Û!ÅŽ«ëZ9Ókóˆ]¯ƒ›né `ÇÒ+tÆš (ØKá¾—=3œ®•vuMñg²\ï Ec€ 05±d™‡×iÇ×›UúvÌ¢£Èþ¡ÕØô¶ßÎA"ß±#Ö²ˆÊŸ¦*Ä~ij|àø.-¼'»Ú¥£h ofº¦‡VsR=N½„Î v˜Z*SÌ{=jÑB‹tê…;’HžH¯8–îDù8ñ¢|Q•bÛçš–‹m³“ê¨ åÏ^m¬Žãþ©ïêO‡½6] µÆ„Ooòü ²x}N¦Ë3ïé¿»€›HA˜m%çÞ/¿í7Fø“‹léUk)É°Œµ8Q8›:ÀŠeT*šõ~ôڝG6 ¢}`ùH­–”¡k ‰P1>š†®9z11!X wKfmÁ¦xÑ,N1Q”–æB¶M…ÒÃv6SMˆhU¬ÊPŽï‘öj=·CŒ¯u¹ƒVIЃsx4’ömÛýcå¡¶7ßŠß 57^\wÒÐÆ k§h,Œý î«q^R½3]J¸ÇðN ‚çU¬ôº^Áì} ³f©Õœ§ˆã:FÄÈ‚é(€™?àýÓüè1Gô£¼éj‚OÅñ  #>×—ßtà 0G¥Åa뀐kßhc™À_ÉñÞ#±)GD" YîäË-ÿÙ̪ ¹™a¯´¢E\ÝÒö‚;™„ë]_ p8‰o¡ñ+^÷ 3‘'dT4œŽ ðVë½° :¬víÑ«£tßÚS-3¶“þ2 †üüʨòrš¹M{É_¤`Û¨0ìjœøJ‡:÷ÃáZ˜†@GP&œÑDGÏs¡þ¦þDGú‘1Yá9Ôþ¼ ûø…§÷8&–ÜÑnÄ_m®^üÆ`;ÉVÁJ£?â€-ßê}suÍ2sõA NÌúA磸‘îÿÚ»ƒìö·á¿±tÑÐ"Tÿü˜[@/äj¬€uüªìù¥Ý˜á8Ý´sõj 8@rˆð äþZÇD®ÿUÏ2ùôõrBzÆÏÞž>Ì™xœ“ wiÎ×7_… ¸ \#€MɁV¶¥üÕÿPÔ9Z‡ø§É8#H:ƒ5ÀÝå9ÍIŒ5åKÙŠ÷qÄ>1AÈøžj"µÂд/ªnÀ qªã}"iŸBå˜ÓÛŽ¦…&ݧ;G@—³b¯“•"´4í¨ôM¨åñC‹ïùÉó¯ÓsSH2Ý@ßáM‡ˆKÀªÛUeø/4\gnm¥‹ŸŒ qÄ b9ÞwÒNÏ_4Ég³ú=܆‚´ •â¥õeíþkjz>éÚyU«Íӝ݃6"8/ø{=Ô¢»G¥ äUw°W«,ô—¿ãㆅү¢³xŠUû™yŒ (øSópÐ 9\åTâ»—*oG$/×ÍT†Y¿1¤Þ¢_‡ ¼ „±ÍçèSaÓ 3ÛMÁBkxs‰’R/¡¤ˆÙçª(*õ„üXÌ´ƒ E§´¬EF"Ù”R/ÐNyÆÂ^°?™6¡œïJ·±$§?º>ÖüœcNÌù¯G ‹ñ2ЁBB„^·úìaz¨k:#¨Æ¨8LÎõލ£^§S&cŒÐU€ü(‡F±Š¼&P>8ÙÁ ‰ p5?0ÊÆƒZl¸aô š¼¡}gÿ¶zÆC²¹¬ÎÖG*HB¡O<º2#ñŒAƒ–¡B˜´É$¥›É:FÀÔx¾u?XÜÏÓvN©RS{2ʈãk9rmP¼Qq̳ è¼ÐFׄ^¡Öì fE“F4A…!ì/…¦Lƒ… … $%´¾yã@CI¬ á—3PþBÏNÿ<ý°4Ü ËÃ#ØÍ~âW«rEñw‹eùMMHß²`¬Öó½íf³:‹k˜¯÷}Z!ã¿<¥,\#öµÀ¯aÒNÆIé,Ћ–lŽ#Àæ9ÀÒS·I’½-Ïp Äz¤Š Â* ­íÄ9­< h>׍3ZkËU¹§˜ŒŠ±f­’¤º³Q ÏB?‹#µíÃ¥®@(Gs«†vI¥Mµ‹Á©e~2ú³ÁP4ìÕi‚²Ê^ö@-DþÓàlÜOÍ]n"µã:žpsŽ¢:! Aõ.ç~ÓBûH÷JCÌ]õVƒd «ú´QÙEA–¯¯Œ!.ˆˆëQ±ù œ·Ì!Õâ )ùL„ÅÀlÚè5@B…o´Æ¸XÓ&Û…O«˜”_#‡ƒ„ûÈt!¤ÁÏ›ÎÝŠ?c9 â\>lÓÁVÄÑ™£eØY]:fÝ–—ù+p{™ðè û³”g±OƒÚSù£áÁÊ„ä,ï7š²G ÕÌBk)~ÑiCµ|h#u¤¶îK¨² #²vݯGãeÖ϶ú…¾múÀ¶þÔñ‚Š9'^($¤§ò “š½{éúp÷J›ušS¹áªCÂubÃH9™D™/ZöØÁ‡¦ÝÙŸ·kð*_”.C‹{áXó€‡c¡c€§/šò/&éš÷,àéJþ‰X›fµ“C¨œ®r¬"kL‰Â_q…Z–.ÉL~O µ›zn‚¹À¦Öª7\àHµšÖ %»ÇníV[¥*Õ;ƒ#½¾HK-ÖIÊdÏEÚ#=o÷Óò³´Š: Ç?{¾+9›–‘OEáU·S€˜j"ÄaÜ ŒÛWt› á–c#a»pÔZÞdŽtWê=9éöÊ¢µ~ ë ;Öe‡Œ®:bî3±ýê¢wà¼îpêñ¹¾4 zc¾ðÖÿzdêŒÑÒŝÀ‰s6¤í³ÎÙB¿OZ”+F¤á‡3@Ñëäg©·Ž ˆèª<ù@É{&S„œÕúÀA)‰h:YÀ5^ÂÓŒ°õäU\ ùËÍû#²?Xe¬tu‰^zÒÔãë¼ÛWtEtû …‚g¶Úüâî*moGè¨7%u!]PhÏd™Ý%Îx: VÒ¦ôÊD3ÀŽKÛËãvÆî…N¯ä>Eró–ð`5 Œ%u5XkñÌ*NU%¶áœÊ:Qÿú»“úzyÏ6å-၇¾ ´ ÒÊ]y žO‘w2Äøæ…H’²f±ÎÇ.ª|¥'gîV•Ü .̘¯€šòü¤U~Ù†*¢!?ò wý,}´°ÔÞnïoKq5µb!áÓ3"vAßH¡³¡·G(ÐÎ0Îò¼MG!/ài®@—¬04*`…«é8ªøøló“ˆÊ”èù¤…ßÊoÿé'ËuÌÖ5×È¡§ˆˆfŽë9}hìâ_!!¯  B&Ëö¶‰ÀAÙNVŸ Wh›¸®XÑJì¨ú“¿÷3uj²˜¨ÍÎìë±aúŠÝå¯ð*Ó¨ôJ“yºØ)m°WýOè68†ŸÏ2—‰Ïüꪫٚ¥‹l1 ø ÏÄFjêµvÌbü¦èÝx:X±¢H=MÐß—,ˆÉÇ´(9ú¾^ÅÚ4¿m‡$âX‘å%(AlZo@½¨UOÌÕ”1ø¸jÎÀÃÃ_ µ‘Ü.œº¦Ut: Æï’!=¯uwû#,“pþÇúŒø(é@?³ü¥‘Mo §—s@Œ#)§ŒùkL}NOÆêA›¸~r½¼ÙA—HJ«eˆÖ´*¡ÓpÌŸö.m<-"³ûÈ$¬_6­åf£ïÚâj1y§ÕJ½@dÞÁr&Í\Z%D£Íñ·AZ Û³øüd/ªAi†/Й~  ‡âĮҮÏh§°b—›Û«mJžòG'[ÈYýŒ¦9psl ýÁ ®±f¦x,‰½tN ‚Xª9 ÙÖH.«Lo0×?͹m¡å†Ѽ+›2ƒF ±Ê8 7Hցϓ²Æ–m9…òŸï]Â1äN†VLâCˆU .ÿ‰Ts +ÅÎx(%¦u]6AF Š ØF鈄‘ |¢¶c±soŒ/t[a¾–û:s·`i햍ê›ËchÈ…8ßÀUÜewŒðNOƒõD%q#éû\9¤x¹&UE×G¥ Í—™$ð E6-‡¼!ýpãÔM˜ Âsìe¯ñµK¢Ç¡ùôléœ4Ö£”À Š®Ðc ^¨À}ÙËŸ§›ºê{ÊuÉC ×Sr€¤’fÉ*j!úÓ’Gsùìoîßîn%ò· àc Wp÷$¨˜)û»H ×8ŽÒ€Zj¤3ÀÙºY'Ql¦py{-6íÔCeiØp‘‡XÊîÆUߢ܂ž£Xé¼Y8þ©ëgñß}é.ÎógÒ„ÃØËø¯»™§Xýy M%@NŠ À(~áÐvu7&•,Ù˜ó€uP‡^^®=_E„jt’ 403WebShell
403Webshell
Server IP : 185.95.0.122  /  Your IP : 216.73.216.151
Web Server : Microsoft-IIS/10.0
System : Windows NT CALION 10.0 build 14393 (Windows Server 2016) AMD64
User : IWPD_83(serin.com.t) ( 0)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Inetpub/vhosts/serin.com.tr/httpdocs/Ebook/assets/js/libs/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Inetpub/vhosts/serin.com.tr/httpdocs/Ebook/assets/js/libs/three.js
"use strict";var THREE={REVISION:"73"};if(typeof define==="function"&&define.amd){define("three",THREE)}else if("undefined"!==typeof exports&&"undefined"!==typeof module){module.exports=THREE}if(self.requestAnimationFrame===undefined||self.cancelAnimationFrame===undefined){(function(){var e=0;var t=["ms","moz","webkit","o"];for(var r=0;r<t.length&&!self.requestAnimationFrame;++r){self.requestAnimationFrame=self[t[r]+"RequestAnimationFrame"];self.cancelAnimationFrame=self[t[r]+"CancelAnimationFrame"]||self[t[r]+"CancelRequestAnimationFrame"]}if(self.requestAnimationFrame===undefined&&self.setTimeout!==undefined){self.requestAnimationFrame=function(t){var r=Date.now(),i=Math.max(0,16-(r-e));var n=self.setTimeout(function(){t(r+i)},i);e=r+i;return n}}if(self.cancelAnimationFrame===undefined&&self.clearTimeout!==undefined){self.cancelAnimationFrame=function(e){self.clearTimeout(e)}}})()}if(self.performance===undefined){self.performance={}}if(self.performance.now===undefined){(function(){var e=Date.now();self.performance.now=function(){return Date.now()-e}})()}if(Number.EPSILON===undefined){Number.EPSILON=Math.pow(2,-52)}if(Math.sign===undefined){Math.sign=function(e){return e<0?-1:e>0?1:+e}}if(Function.prototype.name===undefined&&Object.defineProperty!==undefined){Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]}})}THREE.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2};THREE.CullFaceNone=0;THREE.CullFaceBack=1;THREE.CullFaceFront=2;THREE.CullFaceFrontBack=3;THREE.FrontFaceDirectionCW=0;THREE.FrontFaceDirectionCCW=1;THREE.BasicShadowMap=0;THREE.PCFShadowMap=1;THREE.PCFSoftShadowMap=2;THREE.FrontSide=0;THREE.BackSide=1;THREE.DoubleSide=2;THREE.FlatShading=1;THREE.SmoothShading=2;THREE.NoColors=0;THREE.FaceColors=1;THREE.VertexColors=2;THREE.NoBlending=0;THREE.NormalBlending=1;THREE.AdditiveBlending=2;THREE.SubtractiveBlending=3;THREE.MultiplyBlending=4;THREE.CustomBlending=5;THREE.AddEquation=100;THREE.SubtractEquation=101;THREE.ReverseSubtractEquation=102;THREE.MinEquation=103;THREE.MaxEquation=104;THREE.ZeroFactor=200;THREE.OneFactor=201;THREE.SrcColorFactor=202;THREE.OneMinusSrcColorFactor=203;THREE.SrcAlphaFactor=204;THREE.OneMinusSrcAlphaFactor=205;THREE.DstAlphaFactor=206;THREE.OneMinusDstAlphaFactor=207;THREE.DstColorFactor=208;THREE.OneMinusDstColorFactor=209;THREE.SrcAlphaSaturateFactor=210;THREE.NeverDepth=0;THREE.AlwaysDepth=1;THREE.LessDepth=2;THREE.LessEqualDepth=3;THREE.EqualDepth=4;THREE.GreaterEqualDepth=5;THREE.GreaterDepth=6;THREE.NotEqualDepth=7;THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.AddOperation=2;THREE.UVMapping=300;THREE.CubeReflectionMapping=301;THREE.CubeRefractionMapping=302;THREE.EquirectangularReflectionMapping=303;THREE.EquirectangularRefractionMapping=304;THREE.SphericalReflectionMapping=305;THREE.RepeatWrapping=1e3;THREE.ClampToEdgeWrapping=1001;THREE.MirroredRepeatWrapping=1002;THREE.NearestFilter=1003;THREE.NearestMipMapNearestFilter=1004;THREE.NearestMipMapLinearFilter=1005;THREE.LinearFilter=1006;THREE.LinearMipMapNearestFilter=1007;THREE.LinearMipMapLinearFilter=1008;THREE.UnsignedByteType=1009;THREE.ByteType=1010;THREE.ShortType=1011;THREE.UnsignedShortType=1012;THREE.IntType=1013;THREE.UnsignedIntType=1014;THREE.FloatType=1015;THREE.HalfFloatType=1025;THREE.UnsignedShort4444Type=1016;THREE.UnsignedShort5551Type=1017;THREE.UnsignedShort565Type=1018;THREE.AlphaFormat=1019;THREE.RGBFormat=1020;THREE.RGBAFormat=1021;THREE.LuminanceFormat=1022;THREE.LuminanceAlphaFormat=1023;THREE.RGBEFormat=THREE.RGBAFormat;THREE.RGB_S3TC_DXT1_Format=2001;THREE.RGBA_S3TC_DXT1_Format=2002;THREE.RGBA_S3TC_DXT3_Format=2003;THREE.RGBA_S3TC_DXT5_Format=2004;THREE.RGB_PVRTC_4BPPV1_Format=2100;THREE.RGB_PVRTC_2BPPV1_Format=2101;THREE.RGBA_PVRTC_4BPPV1_Format=2102;THREE.RGBA_PVRTC_2BPPV1_Format=2103;THREE.LoopOnce=2200;THREE.LoopRepeat=2201;THREE.LoopPingPong=2202;THREE.Projector=function(){console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js.");this.projectVector=function(e,t){console.warn("THREE.Projector: .projectVector() is now vector.project().");e.project(t)};this.unprojectVector=function(e,t){console.warn("THREE.Projector: .unprojectVector() is now vector.unproject().");e.unproject(t)};this.pickingRay=function(e,t){console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}};THREE.CanvasRenderer=function(){console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js");this.domElement=document.createElement("canvas");this.clear=function(){};this.render=function(){};this.setClearColor=function(){};this.setSize=function(){}};THREE.Color=function(e){if(arguments.length===3){return this.fromArray(arguments)}return this.set(e)};THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,set:function(e){if(e instanceof THREE.Color){this.copy(e)}else if(typeof e==="number"){this.setHex(e)}else if(typeof e==="string"){this.setStyle(e)}return this},setHex:function(e){e=Math.floor(e);this.r=(e>>16&255)/255;this.g=(e>>8&255)/255;this.b=(e&255)/255;return this},setRGB:function(e,t,r){this.r=e;this.g=t;this.b=r;return this},setHSL:function(){function e(e,t,r){if(r<0)r+=1;if(r>1)r-=1;if(r<1/6)return e+(t-e)*6*r;if(r<1/2)return t;if(r<2/3)return e+(t-e)*6*(2/3-r);return e}return function(t,r,i){t=THREE.Math.euclideanModulo(t,1);r=THREE.Math.clamp(r,0,1);i=THREE.Math.clamp(i,0,1);if(r===0){this.r=this.g=this.b=i}else{var n=i<=.5?i*(1+r):i+r-i*r;var a=2*i-n;this.r=e(a,n,t+1/3);this.g=e(a,n,t);this.b=e(a,n,t-1/3)}return this}}(),setStyle:function(e){function t(t){if(t===undefined)return;if(parseFloat(t)<1){console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}}var r;if(r=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var i;var n=r[1];var a=r[2];switch(n){case"rgb":case"rgba":if(i=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){this.r=Math.min(255,parseInt(i[1],10))/255;this.g=Math.min(255,parseInt(i[2],10))/255;this.b=Math.min(255,parseInt(i[3],10))/255;t(i[5]);return this}if(i=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){this.r=Math.min(100,parseInt(i[1],10))/100;this.g=Math.min(100,parseInt(i[2],10))/100;this.b=Math.min(100,parseInt(i[3],10))/100;t(i[5]);return this}break;case"hsl":case"hsla":if(i=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(i[1])/360;var s=parseInt(i[2],10)/100;var h=parseInt(i[3],10)/100;t(i[5]);return this.setHSL(o,s,h)}break}}else if(r=/^\#([A-Fa-f0-9]+)$/.exec(e)){var u=r[1];var c=u.length;if(c===3){this.r=parseInt(u.charAt(0)+u.charAt(0),16)/255;this.g=parseInt(u.charAt(1)+u.charAt(1),16)/255;this.b=parseInt(u.charAt(2)+u.charAt(2),16)/255;return this}else if(c===6){this.r=parseInt(u.charAt(0)+u.charAt(1),16)/255;this.g=parseInt(u.charAt(2)+u.charAt(3),16)/255;this.b=parseInt(u.charAt(4)+u.charAt(5),16)/255;return this}}if(e&&e.length>0){var u=THREE.ColorKeywords[e];if(u!==undefined){this.setHex(u)}else{console.warn("THREE.Color: Unknown color "+e)}}return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(e){this.r=e.r;this.g=e.g;this.b=e.b;return this},copyGammaToLinear:function(e,t){if(t===undefined)t=2;this.r=Math.pow(e.r,t);this.g=Math.pow(e.g,t);this.b=Math.pow(e.b,t);return this},copyLinearToGamma:function(e,t){if(t===undefined)t=2;var r=t>0?1/t:1;this.r=Math.pow(e.r,r);this.g=Math.pow(e.g,r);this.b=Math.pow(e.b,r);return this},convertGammaToLinear:function(){var e=this.r,t=this.g,r=this.b;this.r=e*e;this.g=t*t;this.b=r*r;return this},convertLinearToGamma:function(){this.r=Math.sqrt(this.r);this.g=Math.sqrt(this.g);this.b=Math.sqrt(this.b);return this},getHex:function(){return this.r*255<<16^this.g*255<<8^this.b*255<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(e){var t=e||{h:0,s:0,l:0};var r=this.r,i=this.g,n=this.b;var a=Math.max(r,i,n);var o=Math.min(r,i,n);var s,h;var u=(o+a)/2;if(o===a){s=0;h=0}else{var c=a-o;h=u<=.5?c/(a+o):c/(2-a-o);switch(a){case r:s=(i-n)/c+(i<n?6:0);break;case i:s=(n-r)/c+2;break;case n:s=(r-i)/c+4;break}s/=6}t.h=s;t.s=h;t.l=u;return t},getStyle:function(){return"rgb("+(this.r*255|0)+","+(this.g*255|0)+","+(this.b*255|0)+")"},offsetHSL:function(e,t,r){var i=this.getHSL();i.h+=e;i.s+=t;i.l+=r;this.setHSL(i.h,i.s,i.l);return this},add:function(e){this.r+=e.r;this.g+=e.g;this.b+=e.b;return this},addColors:function(e,t){this.r=e.r+t.r;this.g=e.g+t.g;this.b=e.b+t.b;return this},addScalar:function(e){this.r+=e;this.g+=e;this.b+=e;return this},multiply:function(e){this.r*=e.r;this.g*=e.g;this.b*=e.b;return this},multiplyScalar:function(e){this.r*=e;this.g*=e;this.b*=e;return this},lerp:function(e,t){this.r+=(e.r-this.r)*t;this.g+=(e.g-this.g)*t;this.b+=(e.b-this.b)*t;return this},equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},fromArray:function(e,t){if(t===undefined)t=0;this.r=e[t];this.g=e[t+1];this.b=e[t+2];return this},toArray:function(e,t){if(e===undefined)e=[];if(t===undefined)t=0;e[t]=this.r;e[t+1]=this.g;e[t+2]=this.b;return e}};THREE.ColorKeywords={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};THREE.Quaternion=function(e,t,r,i){this._x=e||0;this._y=t||0;this._z=r||0;this._w=i!==undefined?i:1};THREE.Quaternion.prototype={constructor:THREE.Quaternion,get x(){return this._x},set x(e){this._x=e;this.onChangeCallback()},get y(){return this._y},set y(e){this._y=e;this.onChangeCallback()},get z(){return this._z},set z(e){this._z=e;this.onChangeCallback()},get w(){return this._w},set w(e){this._w=e;this.onChangeCallback()},set:function(e,t,r,i){this._x=e;this._y=t;this._z=r;this._w=i;this.onChangeCallback();return this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){this._x=e.x;this._y=e.y;this._z=e.z;this._w=e.w;this.onChangeCallback();return this},setFromEuler:function(e,t){if(e instanceof THREE.Euler===false){throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.")}var r=Math.cos(e._x/2);var i=Math.cos(e._y/2);var n=Math.cos(e._z/2);var a=Math.sin(e._x/2);var o=Math.sin(e._y/2);var s=Math.sin(e._z/2);var h=e.order;if(h==="XYZ"){this._x=a*i*n+r*o*s;this._y=r*o*n-a*i*s;this._z=r*i*s+a*o*n;this._w=r*i*n-a*o*s}else if(h==="YXZ"){this._x=a*i*n+r*o*s;this._y=r*o*n-a*i*s;this._z=r*i*s-a*o*n;this._w=r*i*n+a*o*s}else if(h==="ZXY"){this._x=a*i*n-r*o*s;this._y=r*o*n+a*i*s;this._z=r*i*s+a*o*n;this._w=r*i*n-a*o*s}else if(h==="ZYX"){this._x=a*i*n-r*o*s;this._y=r*o*n+a*i*s;this._z=r*i*s-a*o*n;this._w=r*i*n+a*o*s}else if(h==="YZX"){this._x=a*i*n+r*o*s;this._y=r*o*n+a*i*s;this._z=r*i*s-a*o*n;this._w=r*i*n-a*o*s}else if(h==="XZY"){this._x=a*i*n-r*o*s;this._y=r*o*n-a*i*s;this._z=r*i*s+a*o*n;this._w=r*i*n+a*o*s}if(t!==false)this.onChangeCallback();return this},setFromAxisAngle:function(e,t){var r=t/2,i=Math.sin(r);this._x=e.x*i;this._y=e.y*i;this._z=e.z*i;this._w=Math.cos(r);this.onChangeCallback();return this},setFromRotationMatrix:function(e){var t=e.elements,r=t[0],i=t[4],n=t[8],a=t[1],o=t[5],s=t[9],h=t[2],u=t[6],c=t[10],l=r+o+c,f;if(l>0){f=.5/Math.sqrt(l+1);this._w=.25/f;this._x=(u-s)*f;this._y=(n-h)*f;this._z=(a-i)*f}else if(r>o&&r>c){f=2*Math.sqrt(1+r-o-c);this._w=(u-s)/f;this._x=.25*f;this._y=(i+a)/f;this._z=(n+h)/f}else if(o>c){f=2*Math.sqrt(1+o-r-c);this._w=(n-h)/f;this._x=(i+a)/f;this._y=.25*f;this._z=(s+u)/f}else{f=2*Math.sqrt(1+c-r-o);this._w=(a-i)/f;this._x=(n+h)/f;this._y=(s+u)/f;this._z=.25*f}this.onChangeCallback();return this},setFromUnitVectors:function(){var e,t;var r=1e-6;return function(i,n){if(e===undefined)e=new THREE.Vector3;t=i.dot(n)+1;if(t<r){t=0;if(Math.abs(i.x)>Math.abs(i.z)){e.set(-i.y,i.x,0)}else{e.set(0,-i.z,i.y)}}else{e.crossVectors(i,n)}this._x=e.x;this._y=e.y;this._z=e.z;this._w=t;this.normalize();return this}}(),inverse:function(){this.conjugate().normalize();return this},conjugate:function(){this._x*=-1;this._y*=-1;this._z*=-1;this.onChangeCallback();return this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._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 e=this.length();if(e===0){this._x=0;this._y=0;this._z=0;this._w=1}else{e=1/e;this._x=this._x*e;this._y=this._y*e;this._z=this._z*e;this._w=this._w*e}this.onChangeCallback();return this},multiply:function(e,t){if(t!==undefined){console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.");return this.multiplyQuaternions(e,t)}return this.multiplyQuaternions(this,e)},multiplyQuaternions:function(e,t){var r=e._x,i=e._y,n=e._z,a=e._w;var o=t._x,s=t._y,h=t._z,u=t._w;this._x=r*u+a*o+i*h-n*s;this._y=i*u+a*s+n*o-r*h;this._z=n*u+a*h+r*s-i*o;this._w=a*u-r*o-i*s-n*h;this.onChangeCallback();return this},multiplyVector3:function(e){console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.");return e.applyQuaternion(this)},slerp:function(e,t){if(t===0)return this;if(t===1)return this.copy(e);var r=this._x,i=this._y,n=this._z,a=this._w;var o=a*e._w+r*e._x+i*e._y+n*e._z;if(o<0){this._w=-e._w;this._x=-e._x;this._y=-e._y;this._z=-e._z;o=-o}else{this.copy(e)}if(o>=1){this._w=a;this._x=r;this._y=i;this._z=n;return this}var s=Math.acos(o);var h=Math.sqrt(1-o*o);if(Math.abs(h)<.001){this._w=.5*(a+this._w);this._x=.5*(r+this._x);this._y=.5*(i+this._y);this._z=.5*(n+this._z);return this}var u=Math.sin((1-t)*s)/h,c=Math.sin(t*s)/h;this._w=a*u+this._w*c;this._x=r*u+this._x*c;this._y=i*u+this._y*c;this._z=n*u+this._z*c;this.onChangeCallback();return this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){if(t===undefined)t=0;this._x=e[t];this._y=e[t+1];this._z=e[t+2];this._w=e[t+3];this.onChangeCallback();return this},toArray:function(e,t){if(e===undefined)e=[];if(t===undefined)t=0;e[t]=this._x;e[t+1]=this._y;e[t+2]=this._z;e[t+3]=this._w;return e},onChange:function(e){this.onChangeCallback=e;return this},onChangeCallback:function(){}};THREE.Quaternion.slerp=function(e,t,r,i){return r.copy(e).slerp(t,i)};THREE.Vector2=function(e,t){this.x=e||0;this.y=t||0};THREE.Vector2.prototype={constructor:THREE.Vector2,get width(){return this.x},set width(e){this.x=e},get height(){return this.y},set height(e){this.y=e},set:function(e,t){this.x=e;this.y=t;return this},setX:function(e){this.x=e;return this},setY:function(e){this.y=e;return this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(e){this.x=e.x;this.y=e.y;return this},add:function(e,t){if(t!==undefined){console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.");return this.addVectors(e,t)}this.x+=e.x;this.y+=e.y;return this},addScalar:function(e){this.x+=e;this.y+=e;return this},addVectors:function(e,t){this.x=e.x+t.x;this.y=e.y+t.y;return this},addScaledVector:function(e,t){this.x+=e.x*t;this.y+=e.y*t;return this},sub:function(e,t){if(t!==undefined){console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.");return this.subVectors(e,t)}this.x-=e.x;this.y-=e.y;return this},subScalar:function(e){this.x-=e;this.y-=e;return this},subVectors:function(e,t){this.x=e.x-t.x;this.y=e.y-t.y;return this},multiply:function(e){this.x*=e.x;this.y*=e.y;return this},multiplyScalar:function(e){if(isFinite(e)){this.x*=e;this.y*=e}else{this.x=0;this.y=0}return this},divide:function(e){this.x/=e.x;this.y/=e.y;return this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){this.x=Math.min(this.x,e.x);this.y=Math.min(this.y,e.y);return this},max:function(e){this.x=Math.max(this.x,e.x);this.y=Math.max(this.y,e.y);return this},clamp:function(e,t){this.x=Math.max(e.x,Math.min(t.x,this.x));this.y=Math.max(e.y,Math.min(t.y,this.y));return this},clampScalar:function(){var e,t;return function r(i,n){if(e===undefined){e=new THREE.Vector2;t=new THREE.Vector2}e.set(i,i);t.set(n,n);return this.clamp(e,t)}}(),clampLength:function(e,t){var r=this.length();this.multiplyScalar(Math.max(e,Math.min(t,r))/r);return this},floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this},roundToZero:function(){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);return this},negate:function(){this.x=-this.x;this.y=-this.y;return this},dot:function(e){return this.x*e.x+this.y*e.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,r=this.y-e.y;return t*t+r*r},setLength:function(e){return this.multiplyScalar(e/this.length())},lerp:function(e,t){this.x+=(e.x-this.x)*t;this.y+=(e.y-this.y)*t;return this},lerpVectors:function(e,t,r){this.subVectors(t,e).multiplyScalar(r).add(e);return this},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){if(t===undefined)t=0;this.x=e[t];this.y=e[t+1];return this},toArray:function(e,t){if(e===undefined)e=[];if(t===undefined)t=0;e[t]=this.x;e[t+1]=this.y;return e},fromAttribute:function(e,t,r){if(r===undefined)r=0;t=t*e.itemSize+r;this.x=e.array[t];this.y=e.array[t+1];return this},rotateAround:function(e,t){var r=Math.cos(t),i=Math.sin(t);var n=this.x-e.x;var a=this.y-e.y;this.x=n*r-a*i+e.x;this.y=n*i+a*r+e.y;return this}};THREE.Vector3=function(e,t,r){this.x=e||0;this.y=t||0;this.z=r||0};THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(e,t,r){this.x=e;this.y=t;this.z=r;return this},setX:function(e){this.x=e;return this},setY:function(e){this.y=e;return this},setZ:function(e){this.z=e;return this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){this.x=e.x;this.y=e.y;this.z=e.z;return this},add:function(e,t){if(t!==undefined){console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.");return this.addVectors(e,t)}this.x+=e.x;this.y+=e.y;this.z+=e.z;return this},addScalar:function(e){this.x+=e;this.y+=e;this.z+=e;return this},addVectors:function(e,t){this.x=e.x+t.x;this.y=e.y+t.y;this.z=e.z+t.z;return this},addScaledVector:function(e,t){this.x+=e.x*t;this.y+=e.y*t;this.z+=e.z*t;return this},sub:function(e,t){if(t!==undefined){console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.");return this.subVectors(e,t)}this.x-=e.x;this.y-=e.y;this.z-=e.z;return this},subScalar:function(e){this.x-=e;this.y-=e;this.z-=e;return this},subVectors:function(e,t){this.x=e.x-t.x;this.y=e.y-t.y;this.z=e.z-t.z;return this},multiply:function(e,t){if(t!==undefined){console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.");return this.multiplyVectors(e,t)}this.x*=e.x;this.y*=e.y;this.z*=e.z;return this},multiplyScalar:function(e){if(isFinite(e)){this.x*=e;this.y*=e;this.z*=e}else{this.x=0;this.y=0;this.z=0}return this},multiplyVectors:function(e,t){this.x=e.x*t.x;this.y=e.y*t.y;this.z=e.z*t.z;return this},applyEuler:function(){var e;return function t(r){if(r instanceof THREE.Euler===false){console.error("THREE.Vector3: .applyEuler() now expects a Euler rotation rather than a Vector3 and order.")}if(e===undefined)e=new THREE.Quaternion;this.applyQuaternion(e.setFromEuler(r));return this}}(),applyAxisAngle:function(){var e;return function t(r,i){if(e===undefined)e=new THREE.Quaternion;this.applyQuaternion(e.setFromAxisAngle(r,i));return this}}(),applyMatrix3:function(e){var t=this.x;var r=this.y;var i=this.z;var n=e.elements;this.x=n[0]*t+n[3]*r+n[6]*i;this.y=n[1]*t+n[4]*r+n[7]*i;this.z=n[2]*t+n[5]*r+n[8]*i;return this},applyMatrix4:function(e){var t=this.x,r=this.y,i=this.z;var n=e.elements;this.x=n[0]*t+n[4]*r+n[8]*i+n[12];this.y=n[1]*t+n[5]*r+n[9]*i+n[13];this.z=n[2]*t+n[6]*r+n[10]*i+n[14];return this},applyProjection:function(e){var t=this.x,r=this.y,i=this.z;var n=e.elements;var a=1/(n[3]*t+n[7]*r+n[11]*i+n[15]);this.x=(n[0]*t+n[4]*r+n[8]*i+n[12])*a;this.y=(n[1]*t+n[5]*r+n[9]*i+n[13])*a;this.z=(n[2]*t+n[6]*r+n[10]*i+n[14])*a;return this},applyQuaternion:function(e){var t=this.x;var r=this.y;var i=this.z;var n=e.x;var a=e.y;var o=e.z;var s=e.w;var h=s*t+a*i-o*r;var u=s*r+o*t-n*i;var c=s*i+n*r-a*t;var l=-n*t-a*r-o*i;this.x=h*s+l*-n+u*-o-c*-a;this.y=u*s+l*-a+c*-n-h*-o;this.z=c*s+l*-o+h*-a-u*-n;return this},project:function(){var e;return function t(r){if(e===undefined)e=new THREE.Matrix4;e.multiplyMatrices(r.projectionMatrix,e.getInverse(r.matrixWorld));return this.applyProjection(e)}}(),unproject:function(){var e;return function t(r){if(e===undefined)e=new THREE.Matrix4;e.multiplyMatrices(r.matrixWorld,e.getInverse(r.projectionMatrix));return this.applyProjection(e)}}(),transformDirection:function(e){var t=this.x,r=this.y,i=this.z;var n=e.elements;this.x=n[0]*t+n[4]*r+n[8]*i;this.y=n[1]*t+n[5]*r+n[9]*i;this.z=n[2]*t+n[6]*r+n[10]*i;this.normalize();return this},divide:function(e){this.x/=e.x;this.y/=e.y;this.z/=e.z;return this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){this.x=Math.min(this.x,e.x);this.y=Math.min(this.y,e.y);this.z=Math.min(this.z,e.z);return this},max:function(e){this.x=Math.max(this.x,e.x);this.y=Math.max(this.y,e.y);this.z=Math.max(this.z,e.z);return this},clamp:function(e,t){this.x=Math.max(e.x,Math.min(t.x,this.x));this.y=Math.max(e.y,Math.min(t.y,this.y));this.z=Math.max(e.z,Math.min(t.z,this.z));return this},clampScalar:function(){var e,t;return function r(i,n){if(e===undefined){e=new THREE.Vector3;t=new THREE.Vector3}e.set(i,i,i);t.set(n,n,n);return this.clamp(e,t)}}(),clampLength:function(e,t){var r=this.length();this.multiplyScalar(Math.max(e,Math.min(t,r))/r);return this},floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);return this},roundToZero:function(){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);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;return this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.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)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(e){return this.multiplyScalar(e/this.length())},lerp:function(e,t){this.x+=(e.x-this.x)*t;this.y+=(e.y-this.y)*t;this.z+=(e.z-this.z)*t;return this},lerpVectors:function(e,t,r){this.subVectors(t,e).multiplyScalar(r).add(e);return this},cross:function(e,t){if(t!==undefined){console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.");return this.crossVectors(e,t)}var r=this.x,i=this.y,n=this.z;this.x=i*e.z-n*e.y;this.y=n*e.x-r*e.z;this.z=r*e.y-i*e.x;return this},crossVectors:function(e,t){var r=e.x,i=e.y,n=e.z;var a=t.x,o=t.y,s=t.z;this.x=i*s-n*o;this.y=n*a-r*s;this.z=r*o-i*a;return this},projectOnVector:function(){var e,t;return function r(i){if(e===undefined)e=new THREE.Vector3;e.copy(i).normalize();t=this.dot(e);return this.copy(e).multiplyScalar(t)}}(),projectOnPlane:function(){var e;return function t(r){if(e===undefined)e=new THREE.Vector3;e.copy(this).projectOnVector(r);return this.sub(e)}}(),reflect:function(){var e;return function t(r){if(e===undefined)e=new THREE.Vector3;return this.sub(e.copy(r).multiplyScalar(2*this.dot(r)))}}(),angleTo:function(e){var t=this.dot(e)/(this.length()*e.length());return Math.acos(THREE.Math.clamp(t,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x;var r=this.y-e.y;var i=this.z-e.z;return t*t+r*r+i*i},setEulerFromRotationMatrix:function(e,t){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(e,t){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(e){console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().");return this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().");return this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().");return this.setFromMatrixColumn(e,t)},setFromMatrixPosition:function(e){this.x=e.elements[12];this.y=e.elements[13];this.z=e.elements[14];return this},setFromMatrixScale:function(e){var t=this.set(e.elements[0],e.elements[1],e.elements[2]).length();var r=this.set(e.elements[4],e.elements[5],e.elements[6]).length();var i=this.set(e.elements[8],e.elements[9],e.elements[10]).length();this.x=t;this.y=r;this.z=i;return this},setFromMatrixColumn:function(e,t){var r=e*4;var i=t.elements;this.x=i[r];this.y=i[r+1];this.z=i[r+2];return this},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){if(t===undefined)t=0;this.x=e[t];this.y=e[t+1];this.z=e[t+2];return this},toArray:function(e,t){if(e===undefined)e=[];if(t===undefined)t=0;e[t]=this.x;e[t+1]=this.y;e[t+2]=this.z;return e},fromAttribute:function(e,t,r){if(r===undefined)r=0;t=t*e.itemSize+r;this.x=e.array[t];this.y=e.array[t+1];this.z=e.array[t+2];return this}};THREE.Vector4=function(e,t,r,i){this.x=e||0;this.y=t||0;this.z=r||0;this.w=i!==undefined?i:1};THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(e,t,r,i){this.x=e;this.y=t;this.z=r;this.w=i;return this},setX:function(e){this.x=e;return this},setY:function(e){this.y=e;return this},setZ:function(e){this.z=e;return this},setW:function(e){this.w=e;return this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(e){this.x=e.x;this.y=e.y;this.z=e.z;this.w=e.w!==undefined?e.w:1;return this},add:function(e,t){if(t!==undefined){console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.");return this.addVectors(e,t)}this.x+=e.x;this.y+=e.y;this.z+=e.z;this.w+=e.w;return this},addScalar:function(e){this.x+=e;this.y+=e;this.z+=e;this.w+=e;return this},addVectors:function(e,t){this.x=e.x+t.x;this.y=e.y+t.y;this.z=e.z+t.z;this.w=e.w+t.w;return this},addScaledVector:function(e,t){this.x+=e.x*t;this.y+=e.y*t;this.z+=e.z*t;this.w+=e.w*t;return this},sub:function(e,t){if(t!==undefined){console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.");return this.subVectors(e,t)}this.x-=e.x;this.y-=e.y;this.z-=e.z;this.w-=e.w;return this},subScalar:function(e){this.x-=e;this.y-=e;this.z-=e;this.w-=e;return this},subVectors:function(e,t){this.x=e.x-t.x;this.y=e.y-t.y;this.z=e.z-t.z;this.w=e.w-t.w;return this},multiplyScalar:function(e){if(isFinite(e)){this.x*=e;this.y*=e;this.z*=e;this.w*=e}else{this.x=0;this.y=0;this.z=0;this.w=0}return this},applyMatrix4:function(e){var t=this.x;var r=this.y;var i=this.z;var n=this.w;var a=e.elements;this.x=a[0]*t+a[4]*r+a[8]*i+a[12]*n;this.y=a[1]*t+a[5]*r+a[9]*i+a[13]*n;this.z=a[2]*t+a[6]*r+a[10]*i+a[14]*n;this.w=a[3]*t+a[7]*r+a[11]*i+a[15]*n;return this},divideScalar:function(e){return this.multiplyScalar(1/e)},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);if(t<1e-4){this.x=1;this.y=0;this.z=0}else{this.x=e.x/t;
this.y=e.y/t;this.z=e.z/t}return this},setAxisAngleFromRotationMatrix:function(e){var t,r,i,n,a=.01,o=.1,s=e.elements,h=s[0],u=s[4],c=s[8],l=s[1],f=s[5],E=s[9],d=s[2],p=s[6],m=s[10];if(Math.abs(u-l)<a&&Math.abs(c-d)<a&&Math.abs(E-p)<a){if(Math.abs(u+l)<o&&Math.abs(c+d)<o&&Math.abs(E+p)<o&&Math.abs(h+f+m-3)<o){this.set(1,0,0,0);return this}t=Math.PI;var v=(h+1)/2;var T=(f+1)/2;var g=(m+1)/2;var y=(u+l)/4;var R=(c+d)/4;var H=(E+p)/4;if(v>T&&v>g){if(v<a){r=0;i=.707106781;n=.707106781}else{r=Math.sqrt(v);i=y/r;n=R/r}}else if(T>g){if(T<a){r=.707106781;i=0;n=.707106781}else{i=Math.sqrt(T);r=y/i;n=H/i}}else{if(g<a){r=.707106781;i=.707106781;n=0}else{n=Math.sqrt(g);r=R/n;i=H/n}}this.set(r,i,n,t);return this}var x=Math.sqrt((p-E)*(p-E)+(c-d)*(c-d)+(l-u)*(l-u));if(Math.abs(x)<.001)x=1;this.x=(p-E)/x;this.y=(c-d)/x;this.z=(l-u)/x;this.w=Math.acos((h+f+m-1)/2);return this},min:function(e){this.x=Math.min(this.x,e.x);this.y=Math.min(this.y,e.y);this.z=Math.min(this.z,e.z);this.w=Math.min(this.w,e.w);return this},max:function(e){this.x=Math.max(this.x,e.x);this.y=Math.max(this.y,e.y);this.z=Math.max(this.z,e.z);this.w=Math.max(this.w,e.w);return this},clamp:function(e,t){this.x=Math.max(e.x,Math.min(t.x,this.x));this.y=Math.max(e.y,Math.min(t.y,this.y));this.z=Math.max(e.z,Math.min(t.z,this.z));this.w=Math.max(e.w,Math.min(t.w,this.w));return this},clampScalar:function(){var e,t;return function r(i,n){if(e===undefined){e=new THREE.Vector4;t=new THREE.Vector4}e.set(i,i,i,i);t.set(n,n,n,n);return this.clamp(e,t)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);this.w=Math.floor(this.w);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);this.w=Math.ceil(this.w);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);this.w=Math.round(this.w);return this},roundToZero:function(){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);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;this.w=-this.w;return this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.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)},lengthManhattan: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())},setLength:function(e){return this.multiplyScalar(e/this.length())},lerp:function(e,t){this.x+=(e.x-this.x)*t;this.y+=(e.y-this.y)*t;this.z+=(e.z-this.z)*t;this.w+=(e.w-this.w)*t;return this},lerpVectors:function(e,t,r){this.subVectors(t,e).multiplyScalar(r).add(e);return this},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){if(t===undefined)t=0;this.x=e[t];this.y=e[t+1];this.z=e[t+2];this.w=e[t+3];return this},toArray:function(e,t){if(e===undefined)e=[];if(t===undefined)t=0;e[t]=this.x;e[t+1]=this.y;e[t+2]=this.z;e[t+3]=this.w;return e},fromAttribute:function(e,t,r){if(r===undefined)r=0;t=t*e.itemSize+r;this.x=e.array[t];this.y=e.array[t+1];this.z=e.array[t+2];this.w=e.array[t+3];return this}};THREE.Euler=function(e,t,r,i){this._x=e||0;this._y=t||0;this._z=r||0;this._order=i||THREE.Euler.DefaultOrder};THREE.Euler.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];THREE.Euler.DefaultOrder="XYZ";THREE.Euler.prototype={constructor:THREE.Euler,get x(){return this._x},set x(e){this._x=e;this.onChangeCallback()},get y(){return this._y},set y(e){this._y=e;this.onChangeCallback()},get z(){return this._z},set z(e){this._z=e;this.onChangeCallback()},get order(){return this._order},set order(e){this._order=e;this.onChangeCallback()},set:function(e,t,r,i){this._x=e;this._y=t;this._z=r;this._order=i||this._order;this.onChangeCallback();return this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(e){this._x=e._x;this._y=e._y;this._z=e._z;this._order=e._order;this.onChangeCallback();return this},setFromRotationMatrix:function(e,t,r){var i=THREE.Math.clamp;var n=e.elements;var a=n[0],o=n[4],s=n[8];var h=n[1],u=n[5],c=n[9];var l=n[2],f=n[6],E=n[10];t=t||this._order;if(t==="XYZ"){this._y=Math.asin(i(s,-1,1));if(Math.abs(s)<.99999){this._x=Math.atan2(-c,E);this._z=Math.atan2(-o,a)}else{this._x=Math.atan2(f,u);this._z=0}}else if(t==="YXZ"){this._x=Math.asin(-i(c,-1,1));if(Math.abs(c)<.99999){this._y=Math.atan2(s,E);this._z=Math.atan2(h,u)}else{this._y=Math.atan2(-l,a);this._z=0}}else if(t==="ZXY"){this._x=Math.asin(i(f,-1,1));if(Math.abs(f)<.99999){this._y=Math.atan2(-l,E);this._z=Math.atan2(-o,u)}else{this._y=0;this._z=Math.atan2(h,a)}}else if(t==="ZYX"){this._y=Math.asin(-i(l,-1,1));if(Math.abs(l)<.99999){this._x=Math.atan2(f,E);this._z=Math.atan2(h,a)}else{this._x=0;this._z=Math.atan2(-o,u)}}else if(t==="YZX"){this._z=Math.asin(i(h,-1,1));if(Math.abs(h)<.99999){this._x=Math.atan2(-c,u);this._y=Math.atan2(-l,a)}else{this._x=0;this._y=Math.atan2(s,E)}}else if(t==="XZY"){this._z=Math.asin(-i(o,-1,1));if(Math.abs(o)<.99999){this._x=Math.atan2(f,u);this._y=Math.atan2(s,a)}else{this._x=Math.atan2(-c,E);this._y=0}}else{console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+t)}this._order=t;if(r!==false)this.onChangeCallback();return this},setFromQuaternion:function(){var e;return function(t,r,i){if(e===undefined)e=new THREE.Matrix4;e.makeRotationFromQuaternion(t);this.setFromRotationMatrix(e,r,i);return this}}(),setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:function(){var e=new THREE.Quaternion;return function(t){e.setFromEuler(this);this.setFromQuaternion(e,t)}}(),equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){this._x=e[0];this._y=e[1];this._z=e[2];if(e[3]!==undefined)this._order=e[3];this.onChangeCallback();return this},toArray:function(e,t){if(e===undefined)e=[];if(t===undefined)t=0;e[t]=this._x;e[t+1]=this._y;e[t+2]=this._z;e[t+3]=this._order;return e},toVector3:function(e){if(e){return e.set(this._x,this._y,this._z)}else{return new THREE.Vector3(this._x,this._y,this._z)}},onChange:function(e){this.onChangeCallback=e;return this},onChangeCallback:function(){}};THREE.Line3=function(e,t){this.start=e!==undefined?e:new THREE.Vector3;this.end=t!==undefined?t:new THREE.Vector3};THREE.Line3.prototype={constructor:THREE.Line3,set:function(e,t){this.start.copy(e);this.end.copy(t);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.start.copy(e.start);this.end.copy(e.end);return this},center:function(e){var t=e||new THREE.Vector3;return t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){var t=e||new THREE.Vector3;return t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){var r=t||new THREE.Vector3;return this.delta(r).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(){var e=new THREE.Vector3;var t=new THREE.Vector3;return function(r,i){e.subVectors(r,this.start);t.subVectors(this.end,this.start);var n=t.dot(t);var a=t.dot(e);var o=a/n;if(i){o=THREE.Math.clamp(o,0,1)}return o}}(),closestPointToPoint:function(e,t,r){var i=this.closestPointToPointParameter(e,t);var n=r||new THREE.Vector3;return this.delta(n).multiplyScalar(i).add(this.start)},applyMatrix4:function(e){this.start.applyMatrix4(e);this.end.applyMatrix4(e);return this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}};THREE.Box2=function(e,t){this.min=e!==undefined?e:new THREE.Vector2(Infinity,Infinity);this.max=t!==undefined?t:new THREE.Vector2(-Infinity,-Infinity)};THREE.Box2.prototype={constructor:THREE.Box2,set:function(e,t){this.min.copy(e);this.max.copy(t);return this},setFromPoints:function(e){this.makeEmpty();for(var t=0,r=e.length;t<r;t++){this.expandByPoint(e[t])}return this},setFromCenterAndSize:function(){var e=new THREE.Vector2;return function(t,r){var i=e.copy(r).multiplyScalar(.5);this.min.copy(t).sub(i);this.max.copy(t).add(i);return this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.min.copy(e.min);this.max.copy(e.max);return this},makeEmpty:function(){this.min.x=this.min.y=Infinity;this.max.x=this.max.y=-Infinity;return this},empty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},center:function(e){var t=e||new THREE.Vector2;return t.addVectors(this.min,this.max).multiplyScalar(.5)},size:function(e){var t=e||new THREE.Vector2;return t.subVectors(this.max,this.min)},expandByPoint:function(e){this.min.min(e);this.max.max(e);return this},expandByVector:function(e){this.min.sub(e);this.max.add(e);return this},expandByScalar:function(e){this.min.addScalar(-e);this.max.addScalar(e);return this},containsPoint:function(e){if(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y){return false}return true},containsBox:function(e){if(this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y){return true}return false},getParameter:function(e,t){var r=t||new THREE.Vector2;return r.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},isIntersectionBox:function(e){if(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y){return false}return true},clampPoint:function(e,t){var r=t||new THREE.Vector2;return r.copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new THREE.Vector2;return function(t){var r=e.copy(t).clamp(this.min,this.max);return r.sub(t).length()}}(),intersect:function(e){this.min.max(e.min);this.max.min(e.max);return this},union:function(e){this.min.min(e.min);this.max.max(e.max);return this},translate:function(e){this.min.add(e);this.max.add(e);return this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};THREE.Box3=function(e,t){this.min=e!==undefined?e:new THREE.Vector3(Infinity,Infinity,Infinity);this.max=t!==undefined?t:new THREE.Vector3(-Infinity,-Infinity,-Infinity)};THREE.Box3.prototype={constructor:THREE.Box3,set:function(e,t){this.min.copy(e);this.max.copy(t);return this},setFromPoints:function(e){this.makeEmpty();for(var t=0,r=e.length;t<r;t++){this.expandByPoint(e[t])}return this},setFromCenterAndSize:function(){var e=new THREE.Vector3;return function(t,r){var i=e.copy(r).multiplyScalar(.5);this.min.copy(t).sub(i);this.max.copy(t).add(i);return this}}(),setFromObject:function(){var e=new THREE.Vector3;return function(t){var r=this;t.updateMatrixWorld(true);this.makeEmpty();t.traverse(function(t){var i=t.geometry;if(i!==undefined){if(i instanceof THREE.Geometry){var n=i.vertices;for(var a=0,o=n.length;a<o;a++){e.copy(n[a]);e.applyMatrix4(t.matrixWorld);r.expandByPoint(e)}}else if(i instanceof THREE.BufferGeometry&&i.attributes["position"]!==undefined){var s=i.attributes["position"].array;for(var a=0,o=s.length;a<o;a+=3){e.set(s[a],s[a+1],s[a+2]);e.applyMatrix4(t.matrixWorld);r.expandByPoint(e)}}}});return this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.min.copy(e.min);this.max.copy(e.max);return this},makeEmpty:function(){this.min.x=this.min.y=this.min.z=Infinity;this.max.x=this.max.y=this.max.z=-Infinity;return this},empty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},center:function(e){var t=e||new THREE.Vector3;return t.addVectors(this.min,this.max).multiplyScalar(.5)},size:function(e){var t=e||new THREE.Vector3;return t.subVectors(this.max,this.min)},expandByPoint:function(e){this.min.min(e);this.max.max(e);return this},expandByVector:function(e){this.min.sub(e);this.max.add(e);return this},expandByScalar:function(e){this.min.addScalar(-e);this.max.addScalar(e);return this},containsPoint:function(e){if(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z){return false}return true},containsBox:function(e){if(this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z){return true}return false},getParameter:function(e,t){var r=t||new THREE.Vector3;return r.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},isIntersectionBox:function(e){if(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z){return false}return true},clampPoint:function(e,t){var r=t||new THREE.Vector3;return r.copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new THREE.Vector3;return function(t){var r=e.copy(t).clamp(this.min,this.max);return r.sub(t).length()}}(),getBoundingSphere:function(){var e=new THREE.Vector3;return function(t){var r=t||new THREE.Sphere;r.center=this.center();r.radius=this.size(e).length()*.5;return r}}(),intersect:function(e){this.min.max(e.min);this.max.min(e.max);return this},union:function(e){this.min.min(e.min);this.max.max(e.max);return this},applyMatrix4:function(){var e=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];return function(t){e[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t);e[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t);e[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t);e[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t);e[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t);e[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t);e[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t);e[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t);this.makeEmpty();this.setFromPoints(e);return this}}(),translate:function(e){this.min.add(e);this.max.add(e);return this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};THREE.Matrix3=function(){this.elements=new Float32Array([1,0,0,0,1,0,0,0,1]);if(arguments.length>0){console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}};THREE.Matrix3.prototype={constructor:THREE.Matrix3,set:function(e,t,r,i,n,a,o,s,h){var u=this.elements;u[0]=e;u[3]=t;u[6]=r;u[1]=i;u[4]=n;u[7]=a;u[2]=o;u[5]=s;u[8]=h;return this},identity:function(){this.set(1,0,0,0,1,0,0,0,1);return this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(e){var t=e.elements;this.set(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]);return this},multiplyVector3:function(e){console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.");return e.applyMatrix3(this)},multiplyVector3Array:function(e){console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.");return this.applyToVector3Array(e)},applyToVector3Array:function(){var e;return function(t,r,i){if(e===undefined)e=new THREE.Vector3;if(r===undefined)r=0;if(i===undefined)i=t.length;for(var n=0,a=r;n<i;n+=3,a+=3){e.fromArray(t,a);e.applyMatrix3(this);e.toArray(t,a)}return t}}(),applyToBuffer:function(){var e;return function t(r,i,n){if(e===undefined)e=new THREE.Vector3;if(i===undefined)i=0;if(n===undefined)n=r.length/r.itemSize;for(var a=0,o=i;a<n;a++,o++){e.x=r.getX(o);e.y=r.getY(o);e.z=r.getZ(o);e.applyMatrix3(this);r.setXYZ(e.x,e.y,e.z)}return r}}(),multiplyScalar:function(e){var t=this.elements;t[0]*=e;t[3]*=e;t[6]*=e;t[1]*=e;t[4]*=e;t[7]*=e;t[2]*=e;t[5]*=e;t[8]*=e;return this},determinant:function(){var e=this.elements;var t=e[0],r=e[1],i=e[2],n=e[3],a=e[4],o=e[5],s=e[6],h=e[7],u=e[8];return t*a*u-t*o*h-r*n*u+r*o*s+i*n*h-i*a*s},getInverse:function(e,t){var r=e.elements;var i=this.elements;i[0]=r[10]*r[5]-r[6]*r[9];i[1]=-r[10]*r[1]+r[2]*r[9];i[2]=r[6]*r[1]-r[2]*r[5];i[3]=-r[10]*r[4]+r[6]*r[8];i[4]=r[10]*r[0]-r[2]*r[8];i[5]=-r[6]*r[0]+r[2]*r[4];i[6]=r[9]*r[4]-r[5]*r[8];i[7]=-r[9]*r[0]+r[1]*r[8];i[8]=r[5]*r[0]-r[1]*r[4];var n=r[0]*i[0]+r[1]*i[3]+r[2]*i[6];if(n===0){var a="Matrix3.getInverse(): can't invert matrix, determinant is 0";if(t||false){throw new Error(a)}else{console.warn(a)}this.identity();return this}this.multiplyScalar(1/n);return this},transpose:function(){var e,t=this.elements;e=t[1];t[1]=t[3];t[3]=e;e=t[2];t[2]=t[6];t[6]=e;e=t[5];t[5]=t[7];t[7]=e;return this},flattenToArrayOffset:function(e,t){var r=this.elements;e[t]=r[0];e[t+1]=r[1];e[t+2]=r[2];e[t+3]=r[3];e[t+4]=r[4];e[t+5]=r[5];e[t+6]=r[6];e[t+7]=r[7];e[t+8]=r[8];return e},getNormalMatrix:function(e){this.getInverse(e).transpose();return this},transposeIntoArray:function(e){var t=this.elements;e[0]=t[0];e[1]=t[3];e[2]=t[6];e[3]=t[1];e[4]=t[4];e[5]=t[7];e[6]=t[2];e[7]=t[5];e[8]=t[8];return this},fromArray:function(e){this.elements.set(e);return this},toArray:function(){var e=this.elements;return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]}};THREE.Matrix4=function(){this.elements=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);if(arguments.length>0){console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}};THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(e,t,r,i,n,a,o,s,h,u,c,l,f,E,d,p){var m=this.elements;m[0]=e;m[4]=t;m[8]=r;m[12]=i;m[1]=n;m[5]=a;m[9]=o;m[13]=s;m[2]=h;m[6]=u;m[10]=c;m[14]=l;m[3]=f;m[7]=E;m[11]=d;m[15]=p;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},clone:function(){return(new THREE.Matrix4).fromArray(this.elements)},copy:function(e){this.elements.set(e.elements);return this},extractPosition:function(e){console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().");return this.copyPosition(e)},copyPosition:function(e){var t=this.elements;var r=e.elements;t[12]=r[12];t[13]=r[13];t[14]=r[14];return this},extractBasis:function(e,t,r){var i=this.elements;e.set(i[0],i[1],i[2]);t.set(i[4],i[5],i[6]);r.set(i[8],i[9],i[10]);return this},makeBasis:function(e,t,r){this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1);return this},extractRotation:function(){var e;return function(t){if(e===undefined)e=new THREE.Vector3;var r=this.elements;var i=t.elements;var n=1/e.set(i[0],i[1],i[2]).length();var a=1/e.set(i[4],i[5],i[6]).length();var o=1/e.set(i[8],i[9],i[10]).length();r[0]=i[0]*n;r[1]=i[1]*n;r[2]=i[2]*n;r[4]=i[4]*a;r[5]=i[5]*a;r[6]=i[6]*a;r[8]=i[8]*o;r[9]=i[9]*o;r[10]=i[10]*o;return this}}(),makeRotationFromEuler:function(e){if(e instanceof THREE.Euler===false){console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.")}var t=this.elements;var r=e.x,i=e.y,n=e.z;var a=Math.cos(r),o=Math.sin(r);var s=Math.cos(i),h=Math.sin(i);var u=Math.cos(n),c=Math.sin(n);if(e.order==="XYZ"){var l=a*u,f=a*c,E=o*u,d=o*c;t[0]=s*u;t[4]=-s*c;t[8]=h;t[1]=f+E*h;t[5]=l-d*h;t[9]=-o*s;t[2]=d-l*h;t[6]=E+f*h;t[10]=a*s}else if(e.order==="YXZ"){var p=s*u,m=s*c,v=h*u,T=h*c;t[0]=p+T*o;t[4]=v*o-m;t[8]=a*h;t[1]=a*c;t[5]=a*u;t[9]=-o;t[2]=m*o-v;t[6]=T+p*o;t[10]=a*s}else if(e.order==="ZXY"){var p=s*u,m=s*c,v=h*u,T=h*c;t[0]=p-T*o;t[4]=-a*c;t[8]=v+m*o;t[1]=m+v*o;t[5]=a*u;t[9]=T-p*o;t[2]=-a*h;t[6]=o;t[10]=a*s}else if(e.order==="ZYX"){var l=a*u,f=a*c,E=o*u,d=o*c;t[0]=s*u;t[4]=E*h-f;t[8]=l*h+d;t[1]=s*c;t[5]=d*h+l;t[9]=f*h-E;t[2]=-h;t[6]=o*s;t[10]=a*s}else if(e.order==="YZX"){var g=a*s,y=a*h,R=o*s,H=o*h;t[0]=s*u;t[4]=H-g*c;t[8]=R*c+y;t[1]=c;t[5]=a*u;t[9]=-o*u;t[2]=-h*u;t[6]=y*c+R;t[10]=g-H*c}else if(e.order==="XZY"){var g=a*s,y=a*h,R=o*s,H=o*h;t[0]=s*u;t[4]=-c;t[8]=h*u;t[1]=g*c+H;t[5]=a*u;t[9]=y*c-R;t[2]=R*c-y;t[6]=o*u;t[10]=H*c+g}t[3]=0;t[7]=0;t[11]=0;t[12]=0;t[13]=0;t[14]=0;t[15]=1;return this},setRotationFromQuaternion:function(e){console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().");return this.makeRotationFromQuaternion(e)},makeRotationFromQuaternion:function(e){var t=this.elements;var r=e.x,i=e.y,n=e.z,a=e.w;var o=r+r,s=i+i,h=n+n;var u=r*o,c=r*s,l=r*h;var f=i*s,E=i*h,d=n*h;var p=a*o,m=a*s,v=a*h;t[0]=1-(f+d);t[4]=c-v;t[8]=l+m;t[1]=c+v;t[5]=1-(u+d);t[9]=E-p;t[2]=l-m;t[6]=E+p;t[10]=1-(u+f);t[3]=0;t[7]=0;t[11]=0;t[12]=0;t[13]=0;t[14]=0;t[15]=1;return this},lookAt:function(){var e,t,r;return function(i,n,a){if(e===undefined)e=new THREE.Vector3;if(t===undefined)t=new THREE.Vector3;if(r===undefined)r=new THREE.Vector3;var o=this.elements;r.subVectors(i,n).normalize();if(r.lengthSq()===0){r.z=1}e.crossVectors(a,r).normalize();if(e.lengthSq()===0){r.x+=1e-4;e.crossVectors(a,r).normalize()}t.crossVectors(r,e);o[0]=e.x;o[4]=t.x;o[8]=r.x;o[1]=e.y;o[5]=t.y;o[9]=r.y;o[2]=e.z;o[6]=t.z;o[10]=r.z;return this}}(),multiply:function(e,t){if(t!==undefined){console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.");return this.multiplyMatrices(e,t)}return this.multiplyMatrices(this,e)},multiplyMatrices:function(e,t){var r=e.elements;var i=t.elements;var n=this.elements;var a=r[0],o=r[4],s=r[8],h=r[12];var u=r[1],c=r[5],l=r[9],f=r[13];var E=r[2],d=r[6],p=r[10],m=r[14];var v=r[3],T=r[7],g=r[11],y=r[15];var R=i[0],H=i[4],x=i[8],b=i[12];var w=i[1],M=i[5],S=i[9],_=i[13];var A=i[2],C=i[6],L=i[10],P=i[14];var D=i[3],k=i[7],V=i[11],F=i[15];n[0]=a*R+o*w+s*A+h*D;n[4]=a*H+o*M+s*C+h*k;n[8]=a*x+o*S+s*L+h*V;n[12]=a*b+o*_+s*P+h*F;n[1]=u*R+c*w+l*A+f*D;n[5]=u*H+c*M+l*C+f*k;n[9]=u*x+c*S+l*L+f*V;n[13]=u*b+c*_+l*P+f*F;n[2]=E*R+d*w+p*A+m*D;n[6]=E*H+d*M+p*C+m*k;n[10]=E*x+d*S+p*L+m*V;n[14]=E*b+d*_+p*P+m*F;n[3]=v*R+T*w+g*A+y*D;n[7]=v*H+T*M+g*C+y*k;n[11]=v*x+T*S+g*L+y*V;n[15]=v*b+T*_+g*P+y*F;return this},multiplyToArray:function(e,t,r){var i=this.elements;this.multiplyMatrices(e,t);r[0]=i[0];r[1]=i[1];r[2]=i[2];r[3]=i[3];r[4]=i[4];r[5]=i[5];r[6]=i[6];r[7]=i[7];r[8]=i[8];r[9]=i[9];r[10]=i[10];r[11]=i[11];r[12]=i[12];r[13]=i[13];r[14]=i[14];r[15]=i[15];return this},multiplyScalar:function(e){var t=this.elements;t[0]*=e;t[4]*=e;t[8]*=e;t[12]*=e;t[1]*=e;t[5]*=e;t[9]*=e;t[13]*=e;t[2]*=e;t[6]*=e;t[10]*=e;t[14]*=e;t[3]*=e;t[7]*=e;t[11]*=e;t[15]*=e;return this},multiplyVector3:function(e){console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");return e.applyProjection(this)},multiplyVector4:function(e){console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return e.applyMatrix4(this)},multiplyVector3Array:function(e){console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.");return this.applyToVector3Array(e)},applyToVector3Array:function(){var e;return function(t,r,i){if(e===undefined)e=new THREE.Vector3;if(r===undefined)r=0;if(i===undefined)i=t.length;for(var n=0,a=r;n<i;n+=3,a+=3){e.fromArray(t,a);e.applyMatrix4(this);e.toArray(t,a)}return t}}(),applyToBuffer:function(){var e;return function t(r,i,n){if(e===undefined)e=new THREE.Vector3;if(i===undefined)i=0;if(n===undefined)n=r.length/r.itemSize;for(var a=0,o=i;a<n;a++,o++){e.x=r.getX(o);e.y=r.getY(o);e.z=r.getZ(o);e.applyMatrix4(this);r.setXYZ(e.x,e.y,e.z)}return r}}(),rotateAxis:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");e.transformDirection(this)},crossVector:function(e){console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");return e.applyMatrix4(this)},determinant:function(){var e=this.elements;var t=e[0],r=e[4],i=e[8],n=e[12];var a=e[1],o=e[5],s=e[9],h=e[13];var u=e[2],c=e[6],l=e[10],f=e[14];var E=e[3],d=e[7],p=e[11],m=e[15];return E*(+n*s*c-i*h*c-n*o*l+r*h*l+i*o*f-r*s*f)+d*(+t*s*f-t*h*l+n*a*l-i*a*f+i*h*u-n*s*u)+p*(+t*h*c-t*o*f-n*a*c+r*a*f+n*o*u-r*h*u)+m*(-i*o*u-t*s*c+t*o*l+i*a*c-r*a*l+r*s*u)},transpose:function(){var e=this.elements;var t;t=e[1];e[1]=e[4];e[4]=t;t=e[2];e[2]=e[8];e[8]=t;t=e[6];e[6]=e[9];e[9]=t;t=e[3];e[3]=e[12];e[12]=t;t=e[7];e[7]=e[13];e[13]=t;t=e[11];e[11]=e[14];e[14]=t;return this},flattenToArrayOffset:function(e,t){var r=this.elements;e[t]=r[0];e[t+1]=r[1];e[t+2]=r[2];e[t+3]=r[3];e[t+4]=r[4];e[t+5]=r[5];e[t+6]=r[6];e[t+7]=r[7];e[t+8]=r[8];e[t+9]=r[9];e[t+10]=r[10];e[t+11]=r[11];e[t+12]=r[12];e[t+13]=r[13];e[t+14]=r[14];e[t+15]=r[15];return e},getPosition:function(){var e;return function(){if(e===undefined)e=new THREE.Vector3;console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.");var t=this.elements;return e.set(t[12],t[13],t[14])}}(),setPosition:function(e){var t=this.elements;t[12]=e.x;t[13]=e.y;t[14]=e.z;return this},getInverse:function(e,t){var r=this.elements;var i=e.elements;var n=i[0],a=i[4],o=i[8],s=i[12];var h=i[1],u=i[5],c=i[9],l=i[13];var f=i[2],E=i[6],d=i[10],p=i[14];var m=i[3],v=i[7],T=i[11],g=i[15];r[0]=c*p*v-l*d*v+l*E*T-u*p*T-c*E*g+u*d*g;r[4]=s*d*v-o*p*v-s*E*T+a*p*T+o*E*g-a*d*g;r[8]=o*l*v-s*c*v+s*u*T-a*l*T-o*u*g+a*c*g;r[12]=s*c*E-o*l*E-s*u*d+a*l*d+o*u*p-a*c*p;r[1]=l*d*m-c*p*m-l*f*T+h*p*T+c*f*g-h*d*g;r[5]=o*p*m-s*d*m+s*f*T-n*p*T-o*f*g+n*d*g;r[9]=s*c*m-o*l*m-s*h*T+n*l*T+o*h*g-n*c*g;r[13]=o*l*f-s*c*f+s*h*d-n*l*d-o*h*p+n*c*p;r[2]=u*p*m-l*E*m+l*f*v-h*p*v-u*f*g+h*E*g;r[6]=s*E*m-a*p*m-s*f*v+n*p*v+a*f*g-n*E*g;r[10]=a*l*m-s*u*m+s*h*v-n*l*v-a*h*g+n*u*g;r[14]=s*u*f-a*l*f-s*h*E+n*l*E+a*h*p-n*u*p;r[3]=c*E*m-u*d*m-c*f*v+h*d*v+u*f*T-h*E*T;r[7]=a*d*m-o*E*m+o*f*v-n*d*v-a*f*T+n*E*T;r[11]=o*u*m-a*c*m-o*h*v+n*c*v+a*h*T-n*u*T;r[15]=a*c*f-o*u*f+o*h*E-n*c*E-a*h*d+n*u*d;var y=n*r[0]+h*r[4]+f*r[8]+m*r[12];if(y===0){var R="THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";if(t||false){throw new Error(R)}else{console.warn(R)}this.identity();return this}this.multiplyScalar(1/y);return this},translate:function(e){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(e){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(e){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(e){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(e,t){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},scale:function(e){var t=this.elements;var r=e.x,i=e.y,n=e.z;t[0]*=r;t[4]*=i;t[8]*=n;t[1]*=r;t[5]*=i;t[9]*=n;t[2]*=r;t[6]*=i;t[10]*=n;t[3]*=r;t[7]*=i;t[11]*=n;return this},getMaxScaleOnAxis:function(){var e=this.elements;var t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2];var r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6];var i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,r,i))},makeTranslation:function(e,t,r){this.set(1,0,0,e,0,1,0,t,0,0,1,r,0,0,0,1);return this},makeRotationX:function(e){var t=Math.cos(e),r=Math.sin(e);this.set(1,0,0,0,0,t,-r,0,0,r,t,0,0,0,0,1);return this},makeRotationY:function(e){var t=Math.cos(e),r=Math.sin(e);this.set(t,0,r,0,0,1,0,0,-r,0,t,0,0,0,0,1);return this},makeRotationZ:function(e){var t=Math.cos(e),r=Math.sin(e);this.set(t,-r,0,0,r,t,0,0,0,0,1,0,0,0,0,1);return this},makeRotationAxis:function(e,t){var r=Math.cos(t);var i=Math.sin(t);var n=1-r;var a=e.x,o=e.y,s=e.z;var h=n*a,u=n*o;this.set(h*a+r,h*o-i*s,h*s+i*o,0,h*o+i*s,u*o+r,u*s-i*a,0,h*s-i*o,u*s+i*a,n*s*s+r,0,0,0,0,1);return this},makeScale:function(e,t,r){this.set(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1);return this},compose:function(e,t,r){this.makeRotationFromQuaternion(t);this.scale(r);this.setPosition(e);return this},decompose:function(){var e,t;return function(r,i,n){if(e===undefined)e=new THREE.Vector3;if(t===undefined)t=new THREE.Matrix4;var a=this.elements;var o=e.set(a[0],a[1],a[2]).length();var s=e.set(a[4],a[5],a[6]).length();var h=e.set(a[8],a[9],a[10]).length();var u=this.determinant();if(u<0){o=-o}r.x=a[12];r.y=a[13];r.z=a[14];t.elements.set(this.elements);var c=1/o;var l=1/s;var f=1/h;t.elements[0]*=c;t.elements[1]*=c;t.elements[2]*=c;t.elements[4]*=l;t.elements[5]*=l;t.elements[6]*=l;t.elements[8]*=f;t.elements[9]*=f;t.elements[10]*=f;i.setFromRotationMatrix(t);n.x=o;n.y=s;n.z=h;return this}}(),makeFrustum:function(e,t,r,i,n,a){var o=this.elements;var s=2*n/(t-e);var h=2*n/(i-r);var u=(t+e)/(t-e);var c=(i+r)/(i-r);var l=-(a+n)/(a-n);var f=-2*a*n/(a-n);o[0]=s;o[4]=0;o[8]=u;o[12]=0;o[1]=0;o[5]=h;o[9]=c;o[13]=0;o[2]=0;o[6]=0;o[10]=l;o[14]=f;o[3]=0;o[7]=0;o[11]=-1;o[15]=0;return this},makePerspective:function(e,t,r,i){var n=r*Math.tan(THREE.Math.degToRad(e*.5));var a=-n;var o=a*t;var s=n*t;return this.makeFrustum(o,s,a,n,r,i)},makeOrthographic:function(e,t,r,i,n,a){var o=this.elements;var s=t-e;var h=r-i;var u=a-n;var c=(t+e)/s;var l=(r+i)/h;var f=(a+n)/u;o[0]=2/s;o[4]=0;o[8]=0;o[12]=-c;o[1]=0;o[5]=2/h;o[9]=0;o[13]=-l;o[2]=0;o[6]=0;o[10]=-2/u;o[14]=-f;o[3]=0;o[7]=0;o[11]=0;o[15]=1;return this},equals:function(e){var t=this.elements;var r=e.elements;for(var i=0;i<16;i++){if(t[i]!==r[i])return false}return true},fromArray:function(e){this.elements.set(e);return this},toArray:function(){var e=this.elements;return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]}};THREE.Ray=function(e,t){this.origin=e!==undefined?e:new THREE.Vector3;this.direction=t!==undefined?t:new THREE.Vector3};THREE.Ray.prototype={constructor:THREE.Ray,set:function(e,t){this.origin.copy(e);this.direction.copy(t);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.origin.copy(e.origin);this.direction.copy(e.direction);return this},at:function(e,t){var r=t||new THREE.Vector3;return r.copy(this.direction).multiplyScalar(e).add(this.origin)},recast:function(){var e=new THREE.Vector3;return function(t){this.origin.copy(this.at(t,e));return this}}(),closestPointToPoint:function(e,t){var r=t||new THREE.Vector3;r.subVectors(e,this.origin);var i=r.dot(this.direction);if(i<0){return r.copy(this.origin)}return r.copy(this.direction).multiplyScalar(i).add(this.origin)},distanceToPoint:function(e){return Math.sqrt(this.distanceSqToPoint(e))},distanceSqToPoint:function(){var e=new THREE.Vector3;return function(t){var r=e.subVectors(t,this.origin).dot(this.direction);if(r<0){return this.origin.distanceToSquared(t)}e.copy(this.direction).multiplyScalar(r).add(this.origin);return e.distanceToSquared(t)}}(),distanceSqToSegment:function(){var e=new THREE.Vector3;var t=new THREE.Vector3;var r=new THREE.Vector3;return function(i,n,a,o){e.copy(i).add(n).multiplyScalar(.5);t.copy(n).sub(i).normalize();r.copy(this.origin).sub(e);var s=i.distanceTo(n)*.5;var h=-this.direction.dot(t);var u=r.dot(this.direction);var c=-r.dot(t);var l=r.lengthSq();var f=Math.abs(1-h*h);var E,d,p,m;if(f>0){E=h*c-u;d=h*u-c;m=s*f;if(E>=0){if(d>=-m){if(d<=m){var v=1/f;E*=v;d*=v;p=E*(E+h*d+2*u)+d*(h*E+d+2*c)+l}else{d=s;E=Math.max(0,-(h*d+u));p=-E*E+d*(d+2*c)+l}}else{d=-s;E=Math.max(0,-(h*d+u));p=-E*E+d*(d+2*c)+l}}else{if(d<=-m){E=Math.max(0,-(-h*s+u));d=E>0?-s:Math.min(Math.max(-s,-c),s);p=-E*E+d*(d+2*c)+l}else if(d<=m){E=0;d=Math.min(Math.max(-s,-c),s);p=d*(d+2*c)+l}else{E=Math.max(0,-(h*s+u));d=E>0?s:Math.min(Math.max(-s,-c),s);p=-E*E+d*(d+2*c)+l}}}else{d=h>0?-s:s;E=Math.max(0,-(h*d+u));p=-E*E+d*(d+2*c)+l}if(a){a.copy(this.direction).multiplyScalar(E).add(this.origin)}if(o){o.copy(t).multiplyScalar(d).add(e)}return p}}(),isIntersectionSphere:function(e){return this.distanceToPoint(e.center)<=e.radius},intersectSphere:function(){var e=new THREE.Vector3;return function(t,r){e.subVectors(t.center,this.origin);var i=e.dot(this.direction);var n=e.dot(e)-i*i;var a=t.radius*t.radius;if(n>a)return null;var o=Math.sqrt(a-n);var s=i-o;var h=i+o;if(s<0&&h<0)return null;if(s<0)return this.at(h,r);return this.at(s,r)}}(),isIntersectionPlane:function(e){var t=e.distanceToPoint(this.origin);if(t===0){return true}var r=e.normal.dot(this.direction);if(r*t<0){return true}return false;
},distanceToPlane:function(e){var t=e.normal.dot(this.direction);if(t===0){if(e.distanceToPoint(this.origin)===0){return 0}return null}var r=-(this.origin.dot(e.normal)+e.constant)/t;return r>=0?r:null},intersectPlane:function(e,t){var r=this.distanceToPlane(e);if(r===null){return null}return this.at(r,t)},isIntersectionBox:function(){var e=new THREE.Vector3;return function(t){return this.intersectBox(t,e)!==null}}(),intersectBox:function(e,t){var r,i,n,a,o,s;var h=1/this.direction.x,u=1/this.direction.y,c=1/this.direction.z;var l=this.origin;if(h>=0){r=(e.min.x-l.x)*h;i=(e.max.x-l.x)*h}else{r=(e.max.x-l.x)*h;i=(e.min.x-l.x)*h}if(u>=0){n=(e.min.y-l.y)*u;a=(e.max.y-l.y)*u}else{n=(e.max.y-l.y)*u;a=(e.min.y-l.y)*u}if(r>a||n>i)return null;if(n>r||r!==r)r=n;if(a<i||i!==i)i=a;if(c>=0){o=(e.min.z-l.z)*c;s=(e.max.z-l.z)*c}else{o=(e.max.z-l.z)*c;s=(e.min.z-l.z)*c}if(r>s||o>i)return null;if(o>r||r!==r)r=o;if(s<i||i!==i)i=s;if(i<0)return null;return this.at(r>=0?r:i,t)},intersectTriangle:function(){var e=new THREE.Vector3;var t=new THREE.Vector3;var r=new THREE.Vector3;var i=new THREE.Vector3;return function(n,a,o,s,h){t.subVectors(a,n);r.subVectors(o,n);i.crossVectors(t,r);var u=this.direction.dot(i);var c;if(u>0){if(s)return null;c=1}else if(u<0){c=-1;u=-u}else{return null}e.subVectors(this.origin,n);var l=c*this.direction.dot(r.crossVectors(e,r));if(l<0){return null}var f=c*this.direction.dot(t.cross(e));if(f<0){return null}if(l+f>u){return null}var E=-c*e.dot(i);if(E<0){return null}return this.at(E/u,h)}}(),applyMatrix4:function(e){this.direction.add(this.origin).applyMatrix4(e);this.origin.applyMatrix4(e);this.direction.sub(this.origin);this.direction.normalize();return this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}};THREE.Sphere=function(e,t){this.center=e!==undefined?e:new THREE.Vector3;this.radius=t!==undefined?t:0};THREE.Sphere.prototype={constructor:THREE.Sphere,set:function(e,t){this.center.copy(e);this.radius=t;return this},setFromPoints:function(){var e=new THREE.Box3;return function(t,r){var i=this.center;if(r!==undefined){i.copy(r)}else{e.setFromPoints(t).center(i)}var n=0;for(var a=0,o=t.length;a<o;a++){n=Math.max(n,i.distanceToSquared(t[a]))}this.radius=Math.sqrt(n);return this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.center.copy(e.center);this.radius=e.radius;return this},empty:function(){return this.radius<=0},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t},clampPoint:function(e,t){var r=this.center.distanceToSquared(e);var i=t||new THREE.Vector3;i.copy(e);if(r>this.radius*this.radius){i.sub(this.center).normalize();i.multiplyScalar(this.radius).add(this.center)}return i},getBoundingBox:function(e){var t=e||new THREE.Box3;t.set(this.center,this.center);t.expandByScalar(this.radius);return t},applyMatrix4:function(e){this.center.applyMatrix4(e);this.radius=this.radius*e.getMaxScaleOnAxis();return this},translate:function(e){this.center.add(e);return this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}};THREE.Frustum=function(e,t,r,i,n,a){this.planes=[e!==undefined?e:new THREE.Plane,t!==undefined?t:new THREE.Plane,r!==undefined?r:new THREE.Plane,i!==undefined?i:new THREE.Plane,n!==undefined?n:new THREE.Plane,a!==undefined?a:new THREE.Plane]};THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(e,t,r,i,n,a){var o=this.planes;o[0].copy(e);o[1].copy(t);o[2].copy(r);o[3].copy(i);o[4].copy(n);o[5].copy(a);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){var t=this.planes;for(var r=0;r<6;r++){t[r].copy(e.planes[r])}return this},setFromMatrix:function(e){var t=this.planes;var r=e.elements;var i=r[0],n=r[1],a=r[2],o=r[3];var s=r[4],h=r[5],u=r[6],c=r[7];var l=r[8],f=r[9],E=r[10],d=r[11];var p=r[12],m=r[13],v=r[14],T=r[15];t[0].setComponents(o-i,c-s,d-l,T-p).normalize();t[1].setComponents(o+i,c+s,d+l,T+p).normalize();t[2].setComponents(o+n,c+h,d+f,T+m).normalize();t[3].setComponents(o-n,c-h,d-f,T-m).normalize();t[4].setComponents(o-a,c-u,d-E,T-v).normalize();t[5].setComponents(o+a,c+u,d+E,T+v).normalize();return this},intersectsObject:function(){var e=new THREE.Sphere;return function(t){var r=t.geometry;if(r.boundingSphere===null)r.computeBoundingSphere();e.copy(r.boundingSphere);e.applyMatrix4(t.matrixWorld);return this.intersectsSphere(e)}}(),intersectsSphere:function(e){var t=this.planes;var r=e.center;var i=-e.radius;for(var n=0;n<6;n++){var a=t[n].distanceToPoint(r);if(a<i){return false}}return true},intersectsBox:function(){var e=new THREE.Vector3,t=new THREE.Vector3;return function(r){var i=this.planes;for(var n=0;n<6;n++){var a=i[n];e.x=a.normal.x>0?r.min.x:r.max.x;t.x=a.normal.x>0?r.max.x:r.min.x;e.y=a.normal.y>0?r.min.y:r.max.y;t.y=a.normal.y>0?r.max.y:r.min.y;e.z=a.normal.z>0?r.min.z:r.max.z;t.z=a.normal.z>0?r.max.z:r.min.z;var o=a.distanceToPoint(e);var s=a.distanceToPoint(t);if(o<0&&s<0){return false}}return true}}(),containsPoint:function(e){var t=this.planes;for(var r=0;r<6;r++){if(t[r].distanceToPoint(e)<0){return false}}return true}};THREE.Plane=function(e,t){this.normal=e!==undefined?e:new THREE.Vector3(1,0,0);this.constant=t!==undefined?t:0};THREE.Plane.prototype={constructor:THREE.Plane,set:function(e,t){this.normal.copy(e);this.constant=t;return this},setComponents:function(e,t,r,i){this.normal.set(e,t,r);this.constant=i;return this},setFromNormalAndCoplanarPoint:function(e,t){this.normal.copy(e);this.constant=-t.dot(this.normal);return this},setFromCoplanarPoints:function(){var e=new THREE.Vector3;var t=new THREE.Vector3;return function(r,i,n){var a=e.subVectors(n,i).cross(t.subVectors(r,i)).normalize();this.setFromNormalAndCoplanarPoint(a,r);return this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.normal.copy(e.normal);this.constant=e.constant;return this},normalize:function(){var e=1/this.normal.length();this.normal.multiplyScalar(e);this.constant*=e;return this},negate:function(){this.constant*=-1;this.normal.negate();return this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return this.orthoPoint(e,t).sub(e).negate()},orthoPoint:function(e,t){var r=this.distanceToPoint(e);var i=t||new THREE.Vector3;return i.copy(this.normal).multiplyScalar(r)},isIntersectionLine:function(e){var t=this.distanceToPoint(e.start);var r=this.distanceToPoint(e.end);return t<0&&r>0||r<0&&t>0},intersectLine:function(){var e=new THREE.Vector3;return function(t,r){var i=r||new THREE.Vector3;var n=t.delta(e);var a=this.normal.dot(n);if(a===0){if(this.distanceToPoint(t.start)===0){return i.copy(t.start)}return undefined}var o=-(t.start.dot(this.normal)+this.constant)/a;if(o<0||o>1){return undefined}return i.copy(n).multiplyScalar(o).add(t.start)}}(),coplanarPoint:function(e){var t=e||new THREE.Vector3;return t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var e=new THREE.Vector3;var t=new THREE.Vector3;var r=new THREE.Matrix3;return function(i,n){var a=n||r.getNormalMatrix(i);var o=e.copy(this.normal).applyMatrix3(a);var s=this.coplanarPoint(t);s.applyMatrix4(i);this.setFromNormalAndCoplanarPoint(o,s);return this}}(),translate:function(e){this.constant=this.constant-e.dot(this.normal);return this},equals:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}};THREE.Math={generateUUID:function(){var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");var t=new Array(36);var r=0,i;return function(){for(var n=0;n<36;n++){if(n===8||n===13||n===18||n===23){t[n]="-"}else if(n===14){t[n]="4"}else{if(r<=2)r=33554432+Math.random()*16777216|0;i=r&15;r=r>>4;t[n]=e[n===19?i&3|8:i]}}return t.join("")}}(),clamp:function(e,t,r){return Math.max(t,Math.min(r,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,r,i,n){return i+(e-t)*(n-i)/(r-t)},smoothstep:function(e,t,r){if(e<=t)return 0;if(e>=r)return 1;e=(e-t)/(r-t);return e*e*(3-2*e)},smootherstep:function(e,t,r){if(e<=t)return 0;if(e>=r)return 1;e=(e-t)/(r-t);return e*e*e*(e*(e*6-15)+10)},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(){var e=Math.PI/180;return function(t){return t*e}}(),radToDeg:function(){var e=180/Math.PI;return function(t){return t*e}}(),isPowerOfTwo:function(e){return(e&e-1)===0&&e!==0},nearestPowerOfTwo:function(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))},nextPowerOfTwo:function(e){e--;e|=e>>1;e|=e>>2;e|=e>>4;e|=e>>8;e|=e>>16;e++;return e}};THREE.Spline=function(e){this.points=e;var t=[],r={x:0,y:0,z:0},i,n,a,o,s,h,u,c,l;this.initFromArray=function(e){this.points=[];for(var t=0;t<e.length;t++){this.points[t]={x:e[t][0],y:e[t][1],z:e[t][2]}}};this.getPoint=function(e){i=(this.points.length-1)*e;n=Math.floor(i);a=i-n;t[0]=n===0?n:n-1;t[1]=n;t[2]=n>this.points.length-2?this.points.length-1:n+1;t[3]=n>this.points.length-3?this.points.length-1:n+2;h=this.points[t[0]];u=this.points[t[1]];c=this.points[t[2]];l=this.points[t[3]];o=a*a;s=a*o;r.x=f(h.x,u.x,c.x,l.x,a,o,s);r.y=f(h.y,u.y,c.y,l.y,a,o,s);r.z=f(h.z,u.z,c.z,l.z,a,o,s);return r};this.getControlPointsArray=function(){var e,t,r=this.points.length,i=[];for(e=0;e<r;e++){t=this.points[e];i[e]=[t.x,t.y,t.z]}return i};this.getLength=function(e){var t,r,i,n,a=0,o=0,s=0,h=new THREE.Vector3,u=new THREE.Vector3,c=[],l=0;c[0]=0;if(!e)e=100;i=this.points.length*e;h.copy(this.points[0]);for(t=1;t<i;t++){r=t/i;n=this.getPoint(r);u.copy(n);l+=u.distanceTo(h);h.copy(n);a=(this.points.length-1)*r;o=Math.floor(a);if(o!==s){c[o]=l;s=o}}c[c.length]=l;return{chunks:c,total:l}};this.reparametrizeByArcLength=function(e){var t,r,i,n,a,o,s,h,u=[],c=new THREE.Vector3,l=this.getLength();u.push(c.copy(this.points[0]).clone());for(t=1;t<this.points.length;t++){o=l.chunks[t]-l.chunks[t-1];s=Math.ceil(e*o/l.total);n=(t-1)/(this.points.length-1);a=t/(this.points.length-1);for(r=1;r<s-1;r++){i=n+r*(1/s)*(a-n);h=this.getPoint(i);u.push(c.copy(h).clone())}u.push(c.copy(this.points[t]).clone())}this.points=u};function f(e,t,r,i,n,a,o){var s=(r-e)*.5,h=(i-t)*.5;return(2*(t-r)+s+h)*o+(-3*(t-r)-2*s-h)*a+s*n+t}};THREE.Triangle=function(e,t,r){this.a=e!==undefined?e:new THREE.Vector3;this.b=t!==undefined?t:new THREE.Vector3;this.c=r!==undefined?r:new THREE.Vector3};THREE.Triangle.normal=function(){var e=new THREE.Vector3;return function(t,r,i,n){var a=n||new THREE.Vector3;a.subVectors(i,r);e.subVectors(t,r);a.cross(e);var o=a.lengthSq();if(o>0){return a.multiplyScalar(1/Math.sqrt(o))}return a.set(0,0,0)}}();THREE.Triangle.barycoordFromPoint=function(){var e=new THREE.Vector3;var t=new THREE.Vector3;var r=new THREE.Vector3;return function(i,n,a,o,s){e.subVectors(o,n);t.subVectors(a,n);r.subVectors(i,n);var h=e.dot(e);var u=e.dot(t);var c=e.dot(r);var l=t.dot(t);var f=t.dot(r);var E=h*l-u*u;var d=s||new THREE.Vector3;if(E===0){return d.set(-2,-1,-1)}var p=1/E;var m=(l*c-u*f)*p;var v=(h*f-u*c)*p;return d.set(1-m-v,v,m)}}();THREE.Triangle.containsPoint=function(){var e=new THREE.Vector3;return function(t,r,i,n){var a=THREE.Triangle.barycoordFromPoint(t,r,i,n,e);return a.x>=0&&a.y>=0&&a.x+a.y<=1}}();THREE.Triangle.prototype={constructor:THREE.Triangle,set:function(e,t,r){this.a.copy(e);this.b.copy(t);this.c.copy(r);return this},setFromPointsAndIndices:function(e,t,r,i){this.a.copy(e[t]);this.b.copy(e[r]);this.c.copy(e[i]);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.a.copy(e.a);this.b.copy(e.b);this.c.copy(e.c);return this},area:function(){var e=new THREE.Vector3;var t=new THREE.Vector3;return function(){e.subVectors(this.c,this.b);t.subVectors(this.a,this.b);return e.cross(t).length()*.5}}(),midpoint:function(e){var t=e||new THREE.Vector3;return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(e){return THREE.Triangle.normal(this.a,this.b,this.c,e)},plane:function(e){var t=e||new THREE.Plane;return t.setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(e,t){return THREE.Triangle.barycoordFromPoint(e,this.a,this.b,this.c,t)},containsPoint:function(e){return THREE.Triangle.containsPoint(e,this.a,this.b,this.c)},equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}};THREE.Channels=function(){this.mask=1};THREE.Channels.prototype={constructor:THREE.Channels,set:function(e){this.mask=1<<e},enable:function(e){this.mask|=1<<e},toggle:function(e){this.mask^=1<<e},disable:function(e){this.mask&=~(1<<e)}};THREE.Clock=function(e){this.autoStart=e!==undefined?e:true;this.startTime=0;this.oldTime=0;this.elapsedTime=0;this.running=false};THREE.Clock.prototype={constructor:THREE.Clock,start:function(){this.startTime=self.performance.now();this.oldTime=this.startTime;this.running=true},stop:function(){this.getElapsedTime();this.running=false},getElapsedTime:function(){this.getDelta();return this.elapsedTime},getDelta:function(){var e=0;if(this.autoStart&&!this.running){this.start()}if(this.running){var t=self.performance.now();e=.001*(t-this.oldTime);this.oldTime=t;this.elapsedTime+=e}return e}};THREE.EventDispatcher=function(){};THREE.EventDispatcher.prototype={constructor:THREE.EventDispatcher,apply:function(e){e.addEventListener=THREE.EventDispatcher.prototype.addEventListener;e.hasEventListener=THREE.EventDispatcher.prototype.hasEventListener;e.removeEventListener=THREE.EventDispatcher.prototype.removeEventListener;e.dispatchEvent=THREE.EventDispatcher.prototype.dispatchEvent},addEventListener:function(e,t){if(this._listeners===undefined)this._listeners={};var r=this._listeners;if(r[e]===undefined){r[e]=[]}if(r[e].indexOf(t)===-1){r[e].push(t)}},hasEventListener:function(e,t){if(this._listeners===undefined)return false;var r=this._listeners;if(r[e]!==undefined&&r[e].indexOf(t)!==-1){return true}return false},removeEventListener:function(e,t){if(this._listeners===undefined)return;var r=this._listeners;var i=r[e];if(i!==undefined){var n=i.indexOf(t);if(n!==-1){i.splice(n,1)}}},dispatchEvent:function(e){if(this._listeners===undefined)return;var t=this._listeners;var r=t[e.type];if(r!==undefined){e.target=this;var i=[];var n=r.length;for(var a=0;a<n;a++){i[a]=r[a]}for(var a=0;a<n;a++){i[a].call(this,e)}}}};(function(e){e.Raycaster=function(t,r,i,n){this.ray=new e.Ray(t,r);this.near=i||0;this.far=n||Infinity;this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}};Object.defineProperties(this.params,{PointCloud:{get:function(){console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points.");return this.Points}}})};function t(e,t){return e.distance-t.distance}function r(e,t,i,n){if(e.visible===false)return;e.raycast(t,i);if(n===true){var a=e.children;for(var o=0,s=a.length;o<s;o++){r(a[o],t,i,true)}}}e.Raycaster.prototype={constructor:e.Raycaster,linePrecision:1,set:function(e,t){this.ray.set(e,t)},setFromCamera:function(t,r){if(r instanceof e.PerspectiveCamera){this.ray.origin.setFromMatrixPosition(r.matrixWorld);this.ray.direction.set(t.x,t.y,.5).unproject(r).sub(this.ray.origin).normalize()}else if(r instanceof e.OrthographicCamera){this.ray.origin.set(t.x,t.y,-1).unproject(r);this.ray.direction.set(0,0,-1).transformDirection(r.matrixWorld)}else{console.error("THREE.Raycaster: Unsupported camera type.")}},intersectObject:function(e,i){var n=[];r(e,this,n,i);n.sort(t);return n},intersectObjects:function(e,i){var n=[];if(Array.isArray(e)===false){console.warn("THREE.Raycaster.intersectObjects: objects is not an Array.");return n}for(var a=0,o=e.length;a<o;a++){r(e[a],this,n,i)}n.sort(t);return n}}})(THREE);THREE.Object3D=function(){Object.defineProperty(this,"id",{value:THREE.Object3DIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="Object3D";this.parent=null;this.channels=new THREE.Channels;this.children=[];this.up=THREE.Object3D.DefaultUp.clone();var e=new THREE.Vector3;var t=new THREE.Euler;var r=new THREE.Quaternion;var i=new THREE.Vector3(1,1,1);function n(){r.setFromEuler(t,false)}function a(){t.setFromQuaternion(r,undefined,false)}t.onChange(n);r.onChange(a);Object.defineProperties(this,{position:{enumerable:true,value:e},rotation:{enumerable:true,value:t},quaternion:{enumerable:true,value:r},scale:{enumerable:true,value:i},modelViewMatrix:{value:new THREE.Matrix4},normalMatrix:{value:new THREE.Matrix3}});this.rotationAutoUpdate=true;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixAutoUpdate=THREE.Object3D.DefaultMatrixAutoUpdate;this.matrixWorldNeedsUpdate=false;this.visible=true;this.castShadow=false;this.receiveShadow=false;this.frustumCulled=true;this.renderOrder=0;this.userData={}};THREE.Object3D.DefaultUp=new THREE.Vector3(0,1,0);THREE.Object3D.DefaultMatrixAutoUpdate=true;THREE.Object3D.prototype={constructor:THREE.Object3D,get eulerOrder(){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order.");return this.rotation.order},set eulerOrder(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order.");this.rotation.order=e},get useQuaternion(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set useQuaternion(e){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set renderDepth(e){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},applyMatrix:function(e){this.matrix.multiplyMatrices(e,this.matrix);this.matrix.decompose(this.position,this.quaternion,this.scale)},setRotationFromAxisAngle:function(e,t){this.quaternion.setFromAxisAngle(e,t)},setRotationFromEuler:function(e){this.quaternion.setFromEuler(e,true)},setRotationFromMatrix:function(e){this.quaternion.setFromRotationMatrix(e)},setRotationFromQuaternion:function(e){this.quaternion.copy(e)},rotateOnAxis:function(){var e=new THREE.Quaternion;return function(t,r){e.setFromAxisAngle(t,r);this.quaternion.multiply(e);return this}}(),rotateX:function(){var e=new THREE.Vector3(1,0,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateY:function(){var e=new THREE.Vector3(0,1,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateZ:function(){var e=new THREE.Vector3(0,0,1);return function(t){return this.rotateOnAxis(e,t)}}(),translateOnAxis:function(){var e=new THREE.Vector3;return function(t,r){e.copy(t).applyQuaternion(this.quaternion);this.position.add(e.multiplyScalar(r));return this}}(),translate:function(e,t){console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.");return this.translateOnAxis(t,e)},translateX:function(){var e=new THREE.Vector3(1,0,0);return function(t){return this.translateOnAxis(e,t)}}(),translateY:function(){var e=new THREE.Vector3(0,1,0);return function(t){return this.translateOnAxis(e,t)}}(),translateZ:function(){var e=new THREE.Vector3(0,0,1);return function(t){return this.translateOnAxis(e,t)}}(),localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var e=new THREE.Matrix4;return function(t){return t.applyMatrix4(e.getInverse(this.matrixWorld))}}(),lookAt:function(){var e=new THREE.Matrix4;return function(t){e.lookAt(t,this.position,this.up);this.quaternion.setFromRotationMatrix(e)}}(),add:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++){this.add(arguments[t])}return this}if(e===this){console.error("THREE.Object3D.add: object can't be added as a child of itself.",e);return this}if(e instanceof THREE.Object3D){if(e.parent!==null){e.parent.remove(e)}e.parent=this;e.dispatchEvent({type:"added"});this.children.push(e)}else{console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e)}return this},remove:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++){this.remove(arguments[t])}}var r=this.children.indexOf(e);if(r!==-1){e.parent=null;e.dispatchEvent({type:"removed"});this.children.splice(r,1)}},getChildByName:function(e){console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().");return this.getObjectByName(e)},getObjectById:function(e){return this.getObjectByProperty("id",e)},getObjectByName:function(e){return this.getObjectByProperty("name",e)},getObjectByProperty:function(e,t){if(this[e]===t)return this;for(var r=0,i=this.children.length;r<i;r++){var n=this.children[r];var a=n.getObjectByProperty(e,t);if(a!==undefined){return a}}return undefined},getWorldPosition:function(e){var t=e||new THREE.Vector3;this.updateMatrixWorld(true);return t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var e=new THREE.Vector3;var t=new THREE.Vector3;return function(r){var i=r||new THREE.Quaternion;this.updateMatrixWorld(true);this.matrixWorld.decompose(e,i,t);return i}}(),getWorldRotation:function(){var e=new THREE.Quaternion;return function(t){var r=t||new THREE.Euler;this.getWorldQuaternion(e);return r.setFromQuaternion(e,this.rotation.order,false)}}(),getWorldScale:function(){var e=new THREE.Vector3;var t=new THREE.Quaternion;return function(r){var i=r||new THREE.Vector3;this.updateMatrixWorld(true);this.matrixWorld.decompose(e,t,i);return i}}(),getWorldDirection:function(){var e=new THREE.Quaternion;return function(t){var r=t||new THREE.Vector3;this.getWorldQuaternion(e);return r.set(0,0,1).applyQuaternion(e)}}(),raycast:function(){},traverse:function(e){e(this);var t=this.children;for(var r=0,i=t.length;r<i;r++){t[r].traverse(e)}},traverseVisible:function(e){if(this.visible===false)return;e(this);var t=this.children;for(var r=0,i=t.length;r<i;r++){t[r].traverseVisible(e)}},traverseAncestors:function(e){var t=this.parent;if(t!==null){e(t);t.traverseAncestors(e)}},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale);this.matrixWorldNeedsUpdate=true},updateMatrixWorld:function(e){if(this.matrixAutoUpdate===true)this.updateMatrix();if(this.matrixWorldNeedsUpdate===true||e===true){if(this.parent===null){this.matrixWorld.copy(this.matrix)}else{this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)}this.matrixWorldNeedsUpdate=false;e=true}for(var t=0,r=this.children.length;t<r;t++){this.children[t].updateMatrixWorld(e)}},toJSON:function(e){var t=e===undefined;var r={};if(t){e={geometries:{},materials:{},textures:{},images:{}};r.metadata={version:4.4,type:"Object",generator:"Object3D.toJSON"}}var i={};i.uuid=this.uuid;i.type=this.type;if(this.name!=="")i.name=this.name;if(JSON.stringify(this.userData)!=="{}")i.userData=this.userData;if(this.castShadow===true)i.castShadow=true;if(this.receiveShadow===true)i.receiveShadow=true;if(this.visible===false)i.visible=false;i.matrix=this.matrix.toArray();if(this.geometry!==undefined){if(e.geometries[this.geometry.uuid]===undefined){e.geometries[this.geometry.uuid]=this.geometry.toJSON(e)}i.geometry=this.geometry.uuid}if(this.material!==undefined){if(e.materials[this.material.uuid]===undefined){e.materials[this.material.uuid]=this.material.toJSON(e)}i.material=this.material.uuid}if(this.children.length>0){i.children=[];for(var n=0;n<this.children.length;n++){i.children.push(this.children[n].toJSON(e).object)}}if(t){var a=u(e.geometries);var o=u(e.materials);var s=u(e.textures);var h=u(e.images);if(a.length>0)r.geometries=a;if(o.length>0)r.materials=o;if(s.length>0)r.textures=s;if(h.length>0)r.images=h}r.object=i;return r;function u(e){var t=[];for(var r in e){var i=e[r];delete i.metadata;t.push(i)}return t}},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t){if(t===undefined)t=true;this.name=e.name;this.up.copy(e.up);this.position.copy(e.position);this.quaternion.copy(e.quaternion);this.scale.copy(e.scale);this.rotationAutoUpdate=e.rotationAutoUpdate;this.matrix.copy(e.matrix);this.matrixWorld.copy(e.matrixWorld);this.matrixAutoUpdate=e.matrixAutoUpdate;this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate;this.visible=e.visible;this.castShadow=e.castShadow;this.receiveShadow=e.receiveShadow;this.frustumCulled=e.frustumCulled;this.renderOrder=e.renderOrder;this.userData=JSON.parse(JSON.stringify(e.userData));if(t===true){for(var r=0;r<e.children.length;r++){var i=e.children[r];this.add(i.clone())}}return this}};THREE.EventDispatcher.prototype.apply(THREE.Object3D.prototype);THREE.Object3DIdCount=0;THREE.Face3=function(e,t,r,i,n,a){this.a=e;this.b=t;this.c=r;this.normal=i instanceof THREE.Vector3?i:new THREE.Vector3;this.vertexNormals=Array.isArray(i)?i:[];this.color=n instanceof THREE.Color?n:new THREE.Color;this.vertexColors=Array.isArray(n)?n:[];this.materialIndex=a!==undefined?a:0};THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.a=e.a;this.b=e.b;this.c=e.c;this.normal.copy(e.normal);this.color.copy(e.color);this.materialIndex=e.materialIndex;for(var t=0,r=e.vertexNormals.length;t<r;t++){this.vertexNormals[t]=e.vertexNormals[t].clone()}for(var t=0,r=e.vertexColors.length;t<r;t++){this.vertexColors[t]=e.vertexColors[t].clone()}return this}};THREE.Face4=function(e,t,r,i,n,a,o){console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead.");return new THREE.Face3(e,t,r,n,a,o)};THREE.BufferAttribute=function(e,t){this.uuid=THREE.Math.generateUUID();this.array=e;this.itemSize=t;this.dynamic=false;this.updateRange={offset:0,count:-1};this.version=0};THREE.BufferAttribute.prototype={constructor:THREE.BufferAttribute,get length(){console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count.");return this.array.length},get count(){return this.array.length/this.itemSize},set needsUpdate(e){if(e===true)this.version++},setDynamic:function(e){this.dynamic=e;return this},copy:function(e){this.array=new e.array.constructor(e.array);this.itemSize=e.itemSize;this.dynamic=e.dynamic;return this},copyAt:function(e,t,r){e*=this.itemSize;r*=t.itemSize;for(var i=0,n=this.itemSize;i<n;i++){this.array[e+i]=t.array[r+i]}return this},copyArray:function(e){this.array.set(e);return this},copyColorsArray:function(e){var t=this.array,r=0;for(var i=0,n=e.length;i<n;i++){var a=e[i];if(a===undefined){console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i);a=new THREE.Color}t[r++]=a.r;t[r++]=a.g;t[r++]=a.b}return this},copyIndicesArray:function(e){var t=this.array,r=0;for(var i=0,n=e.length;i<n;i++){var a=e[i];t[r++]=a.a;t[r++]=a.b;t[r++]=a.c}return this},copyVector2sArray:function(e){var t=this.array,r=0;for(var i=0,n=e.length;i<n;i++){var a=e[i];if(a===undefined){console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i);a=new THREE.Vector2}t[r++]=a.x;t[r++]=a.y}return this},copyVector3sArray:function(e){var t=this.array,r=0;for(var i=0,n=e.length;i<n;i++){var a=e[i];if(a===undefined){console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",i);a=new THREE.Vector3}t[r++]=a.x;t[r++]=a.y;t[r++]=a.z}return this},copyVector4sArray:function(e){var t=this.array,r=0;for(var i=0,n=e.length;i<n;i++){var a=e[i];if(a===undefined){console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",i);a=new THREE.Vector4}t[r++]=a.x;t[r++]=a.y;t[r++]=a.z;t[r++]=a.w}return this},set:function(e,t){if(t===undefined)t=0;this.array.set(e,t);return this},getX:function(e){return this.array[e*this.itemSize]},setX:function(e,t){this.array[e*this.itemSize]=t;return this},getY:function(e){return this.array[e*this.itemSize+1]},setY:function(e,t){this.array[e*this.itemSize+1]=t;return this},getZ:function(e){return this.array[e*this.itemSize+2]},setZ:function(e,t){this.array[e*this.itemSize+2]=t;return this},getW:function(e){return this.array[e*this.itemSize+3]},setW:function(e,t){this.array[e*this.itemSize+3]=t;return this},setXY:function(e,t,r){e*=this.itemSize;this.array[e+0]=t;this.array[e+1]=r;return this},setXYZ:function(e,t,r,i){e*=this.itemSize;this.array[e+0]=t;this.array[e+1]=r;this.array[e+2]=i;return this},setXYZW:function(e,t,r,i,n){e*=this.itemSize;this.array[e+0]=t;this.array[e+1]=r;this.array[e+2]=i;this.array[e+3]=n;return this},clone:function(){return(new this.constructor).copy(this)}};THREE.Int8Attribute=function(e,t){return new THREE.BufferAttribute(new Int8Array(e),t)};THREE.Uint8Attribute=function(e,t){return new THREE.BufferAttribute(new Uint8Array(e),t)};THREE.Uint8ClampedAttribute=function(e,t){return new THREE.BufferAttribute(new Uint8ClampedArray(e),t)};THREE.Int16Attribute=function(e,t){return new THREE.BufferAttribute(new Int16Array(e),t)};THREE.Uint16Attribute=function(e,t){return new THREE.BufferAttribute(new Uint16Array(e),t)};THREE.Int32Attribute=function(e,t){return new THREE.BufferAttribute(new Int32Array(e),t)};THREE.Uint32Attribute=function(e,t){return new THREE.BufferAttribute(new Uint32Array(e),t)};THREE.Float32Attribute=function(e,t){return new THREE.BufferAttribute(new Float32Array(e),t)};THREE.Float64Attribute=function(e,t){return new THREE.BufferAttribute(new Float64Array(e),t)};THREE.DynamicBufferAttribute=function(e,t){console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead.");return new THREE.BufferAttribute(e,t).setDynamic(true)};THREE.InstancedBufferAttribute=function(e,t,r){THREE.BufferAttribute.call(this,e,t);this.meshPerAttribute=r||1};THREE.InstancedBufferAttribute.prototype=Object.create(THREE.BufferAttribute.prototype);THREE.InstancedBufferAttribute.prototype.constructor=THREE.InstancedBufferAttribute;THREE.InstancedBufferAttribute.prototype.copy=function(e){THREE.BufferAttribute.prototype.copy.call(this,e);this.meshPerAttribute=e.meshPerAttribute;return this};THREE.InterleavedBuffer=function(e,t){this.uuid=THREE.Math.generateUUID();this.array=e;this.stride=t;this.dynamic=false;this.updateRange={offset:0,count:-1};this.version=0};THREE.InterleavedBuffer.prototype={constructor:THREE.InterleavedBuffer,get length(){return this.array.length},get count(){return this.array.length/this.stride},set needsUpdate(e){if(e===true)this.version++},setDynamic:function(e){this.dynamic=e;return this},copy:function(e){this.array=new e.array.constructor(e.array);this.stride=e.stride;this.dynamic=e.dynamic},copyAt:function(e,t,r){e*=this.stride;r*=t.stride;for(var i=0,n=this.stride;i<n;i++){this.array[e+i]=t.array[r+i]}return this},set:function(e,t){if(t===undefined)t=0;this.array.set(e,t);return this},clone:function(){return(new this.constructor).copy(this)}};THREE.InstancedInterleavedBuffer=function(e,t,r){THREE.InterleavedBuffer.call(this,e,t);this.meshPerAttribute=r||1};THREE.InstancedInterleavedBuffer.prototype=Object.create(THREE.InterleavedBuffer.prototype);THREE.InstancedInterleavedBuffer.prototype.constructor=THREE.InstancedInterleavedBuffer;THREE.InstancedInterleavedBuffer.prototype.copy=function(e){THREE.InterleavedBuffer.prototype.copy.call(this,e);this.meshPerAttribute=e.meshPerAttribute;return this};THREE.InterleavedBufferAttribute=function(e,t,r){this.uuid=THREE.Math.generateUUID();this.data=e;this.itemSize=t;this.offset=r};THREE.InterleavedBufferAttribute.prototype={constructor:THREE.InterleavedBufferAttribute,get length(){console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count.");return this.array.length},get count(){return this.data.array.length/this.data.stride},setX:function(e,t){this.data.array[e*this.data.stride+this.offset]=t;return this},setY:function(e,t){this.data.array[e*this.data.stride+this.offset+1]=t;return this},setZ:function(e,t){this.data.array[e*this.data.stride+this.offset+2]=t;return this;
},setW:function(e,t){this.data.array[e*this.data.stride+this.offset+3]=t;return this},getX:function(e){return this.data.array[e*this.data.stride+this.offset]},getY:function(e){return this.data.array[e*this.data.stride+this.offset+1]},getZ:function(e){return this.data.array[e*this.data.stride+this.offset+2]},getW:function(e){return this.data.array[e*this.data.stride+this.offset+3]},setXY:function(e,t,r){e=e*this.data.stride+this.offset;this.data.array[e+0]=t;this.data.array[e+1]=r;return this},setXYZ:function(e,t,r,i){e=e*this.data.stride+this.offset;this.data.array[e+0]=t;this.data.array[e+1]=r;this.data.array[e+2]=i;return this},setXYZW:function(e,t,r,i,n){e=e*this.data.stride+this.offset;this.data.array[e+0]=t;this.data.array[e+1]=r;this.data.array[e+2]=i;this.data.array[e+3]=n;return this}};THREE.Geometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="Geometry";this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingBox=null;this.boundingSphere=null;this.verticesNeedUpdate=false;this.elementsNeedUpdate=false;this.uvsNeedUpdate=false;this.normalsNeedUpdate=false;this.colorsNeedUpdate=false;this.lineDistancesNeedUpdate=false;this.groupsNeedUpdate=false};THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(e){var t=(new THREE.Matrix3).getNormalMatrix(e);for(var r=0,i=this.vertices.length;r<i;r++){var n=this.vertices[r];n.applyMatrix4(e)}for(var r=0,i=this.faces.length;r<i;r++){var a=this.faces[r];a.normal.applyMatrix3(t).normalize();for(var o=0,s=a.vertexNormals.length;o<s;o++){a.vertexNormals[o].applyMatrix3(t).normalize()}}if(this.boundingBox!==null){this.computeBoundingBox()}if(this.boundingSphere!==null){this.computeBoundingSphere()}this.verticesNeedUpdate=true;this.normalsNeedUpdate=true},rotateX:function(){var e;return function t(r){if(e===undefined)e=new THREE.Matrix4;e.makeRotationX(r);this.applyMatrix(e);return this}}(),rotateY:function(){var e;return function t(r){if(e===undefined)e=new THREE.Matrix4;e.makeRotationY(r);this.applyMatrix(e);return this}}(),rotateZ:function(){var e;return function t(r){if(e===undefined)e=new THREE.Matrix4;e.makeRotationZ(r);this.applyMatrix(e);return this}}(),translate:function(){var e;return function t(r,i,n){if(e===undefined)e=new THREE.Matrix4;e.makeTranslation(r,i,n);this.applyMatrix(e);return this}}(),scale:function(){var e;return function t(r,i,n){if(e===undefined)e=new THREE.Matrix4;e.makeScale(r,i,n);this.applyMatrix(e);return this}}(),lookAt:function(){var e;return function t(r){if(e===undefined)e=new THREE.Object3D;e.lookAt(r);e.updateMatrix();this.applyMatrix(e.matrix)}}(),fromBufferGeometry:function(e){var t=this;var r=e.index!==null?e.index.array:undefined;var i=e.attributes;var n=i.position.array;var a=i.normal!==undefined?i.normal.array:undefined;var o=i.color!==undefined?i.color.array:undefined;var s=i.uv!==undefined?i.uv.array:undefined;var h=i.uv2!==undefined?i.uv2.array:undefined;if(h!==undefined)this.faceVertexUvs[1]=[];var u=[];var c=[];var l=[];for(var f=0,E=0,d=0;f<n.length;f+=3,E+=2,d+=4){t.vertices.push(new THREE.Vector3(n[f],n[f+1],n[f+2]));if(a!==undefined){u.push(new THREE.Vector3(a[f],a[f+1],a[f+2]))}if(o!==undefined){t.colors.push(new THREE.Color(o[f],o[f+1],o[f+2]))}if(s!==undefined){c.push(new THREE.Vector2(s[E],s[E+1]))}if(h!==undefined){l.push(new THREE.Vector2(h[E],h[E+1]))}}function p(e,r,i){var n=a!==undefined?[u[e].clone(),u[r].clone(),u[i].clone()]:[];var f=o!==undefined?[t.colors[e].clone(),t.colors[r].clone(),t.colors[i].clone()]:[];var E=new THREE.Face3(e,r,i,n,f);t.faces.push(E);if(s!==undefined){t.faceVertexUvs[0].push([c[e].clone(),c[r].clone(),c[i].clone()])}if(h!==undefined){t.faceVertexUvs[1].push([l[e].clone(),l[r].clone(),l[i].clone()])}}if(r!==undefined){var m=e.groups;if(m.length>0){for(var f=0;f<m.length;f++){var v=m[f];var T=v.start;var g=v.count;for(var E=T,y=T+g;E<y;E+=3){p(r[E],r[E+1],r[E+2])}}}else{for(var f=0;f<r.length;f+=3){p(r[f],r[f+1],r[f+2])}}}else{for(var f=0;f<n.length/3;f+=3){p(f,f+1,f+2)}}this.computeFaceNormals();if(e.boundingBox!==null){this.boundingBox=e.boundingBox.clone()}if(e.boundingSphere!==null){this.boundingSphere=e.boundingSphere.clone()}return this},center:function(){this.computeBoundingBox();var e=this.boundingBox.center().negate();this.translate(e.x,e.y,e.z);return e},normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center;var t=this.boundingSphere.radius;var r=t===0?1:1/t;var i=new THREE.Matrix4;i.set(r,0,0,-r*e.x,0,r,0,-r*e.y,0,0,r,-r*e.z,0,0,0,1);this.applyMatrix(i);return this},computeFaceNormals:function(){var e=new THREE.Vector3,t=new THREE.Vector3;for(var r=0,i=this.faces.length;r<i;r++){var n=this.faces[r];var a=this.vertices[n.a];var o=this.vertices[n.b];var s=this.vertices[n.c];e.subVectors(s,o);t.subVectors(a,o);e.cross(t);e.normalize();n.normal.copy(e)}},computeVertexNormals:function(e){var t,r,i,n,a,o;o=new Array(this.vertices.length);for(t=0,r=this.vertices.length;t<r;t++){o[t]=new THREE.Vector3}if(e){var s,h,u;var c=new THREE.Vector3,l=new THREE.Vector3;for(i=0,n=this.faces.length;i<n;i++){a=this.faces[i];s=this.vertices[a.a];h=this.vertices[a.b];u=this.vertices[a.c];c.subVectors(u,h);l.subVectors(s,h);c.cross(l);o[a.a].add(c);o[a.b].add(c);o[a.c].add(c)}}else{for(i=0,n=this.faces.length;i<n;i++){a=this.faces[i];o[a.a].add(a.normal);o[a.b].add(a.normal);o[a.c].add(a.normal)}}for(t=0,r=this.vertices.length;t<r;t++){o[t].normalize()}for(i=0,n=this.faces.length;i<n;i++){a=this.faces[i];var f=a.vertexNormals;if(f.length===3){f[0].copy(o[a.a]);f[1].copy(o[a.b]);f[2].copy(o[a.c])}else{f[0]=o[a.a].clone();f[1]=o[a.b].clone();f[2]=o[a.c].clone()}}},computeMorphNormals:function(){var e,t,r,i,n;for(r=0,i=this.faces.length;r<i;r++){n=this.faces[r];if(!n.__originalFaceNormal){n.__originalFaceNormal=n.normal.clone()}else{n.__originalFaceNormal.copy(n.normal)}if(!n.__originalVertexNormals)n.__originalVertexNormals=[];for(e=0,t=n.vertexNormals.length;e<t;e++){if(!n.__originalVertexNormals[e]){n.__originalVertexNormals[e]=n.vertexNormals[e].clone()}else{n.__originalVertexNormals[e].copy(n.vertexNormals[e])}}}var a=new THREE.Geometry;a.faces=this.faces;for(e=0,t=this.morphTargets.length;e<t;e++){if(!this.morphNormals[e]){this.morphNormals[e]={};this.morphNormals[e].faceNormals=[];this.morphNormals[e].vertexNormals=[];var o=this.morphNormals[e].faceNormals;var s=this.morphNormals[e].vertexNormals;var h,u;for(r=0,i=this.faces.length;r<i;r++){h=new THREE.Vector3;u={a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3};o.push(h);s.push(u)}}var c=this.morphNormals[e];a.vertices=this.morphTargets[e].vertices;a.computeFaceNormals();a.computeVertexNormals();var h,u;for(r=0,i=this.faces.length;r<i;r++){n=this.faces[r];h=c.faceNormals[r];u=c.vertexNormals[r];h.copy(n.normal);u.a.copy(n.vertexNormals[0]);u.b.copy(n.vertexNormals[1]);u.c.copy(n.vertexNormals[2])}}for(r=0,i=this.faces.length;r<i;r++){n=this.faces[r];n.normal=n.__originalFaceNormal;n.vertexNormals=n.__originalVertexNormals}},computeTangents:function(){console.warn("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){var e=0;var t=this.vertices;for(var r=0,i=t.length;r<i;r++){if(r>0){e+=t[r].distanceTo(t[r-1])}this.lineDistances[r]=e}},computeBoundingBox:function(){if(this.boundingBox===null){this.boundingBox=new THREE.Box3}this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){if(this.boundingSphere===null){this.boundingSphere=new THREE.Sphere}this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,r){if(e instanceof THREE.Geometry===false){console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e);return}var i,n=this.vertices.length,a=this.vertices,o=e.vertices,s=this.faces,h=e.faces,u=this.faceVertexUvs[0],c=e.faceVertexUvs[0];if(r===undefined)r=0;if(t!==undefined){i=(new THREE.Matrix3).getNormalMatrix(t)}for(var l=0,f=o.length;l<f;l++){var E=o[l];var d=E.clone();if(t!==undefined)d.applyMatrix4(t);a.push(d)}for(l=0,f=h.length;l<f;l++){var p=h[l],m,v,T,g=p.vertexNormals,y=p.vertexColors;m=new THREE.Face3(p.a+n,p.b+n,p.c+n);m.normal.copy(p.normal);if(i!==undefined){m.normal.applyMatrix3(i).normalize()}for(var R=0,H=g.length;R<H;R++){v=g[R].clone();if(i!==undefined){v.applyMatrix3(i).normalize()}m.vertexNormals.push(v)}m.color.copy(p.color);for(var R=0,H=y.length;R<H;R++){T=y[R];m.vertexColors.push(T.clone())}m.materialIndex=p.materialIndex+r;s.push(m)}for(l=0,f=c.length;l<f;l++){var x=c[l],b=[];if(x===undefined){continue}for(var R=0,H=x.length;R<H;R++){b.push(x[R].clone())}u.push(b)}},mergeMesh:function(e){if(e instanceof THREE.Mesh===false){console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e);return}e.matrixAutoUpdate&&e.updateMatrix();this.merge(e.geometry,e.matrix)},mergeVertices:function(){var e={};var t=[],r=[];var i,n;var a=4;var o=Math.pow(10,a);var s,h,u;var c,l,f;for(s=0,h=this.vertices.length;s<h;s++){i=this.vertices[s];n=Math.round(i.x*o)+"_"+Math.round(i.y*o)+"_"+Math.round(i.z*o);if(e[n]===undefined){e[n]=s;t.push(this.vertices[s]);r[s]=t.length-1}else{r[s]=r[e[n]]}}var E=[];for(s=0,h=this.faces.length;s<h;s++){u=this.faces[s];u.a=r[u.a];u.b=r[u.b];u.c=r[u.c];c=[u.a,u.b,u.c];var d=-1;for(var p=0;p<3;p++){if(c[p]===c[(p+1)%3]){d=p;E.push(s);break}}}for(s=E.length-1;s>=0;s--){var m=E[s];this.faces.splice(m,1);for(l=0,f=this.faceVertexUvs.length;l<f;l++){this.faceVertexUvs[l].splice(m,1)}}var v=this.vertices.length-t.length;this.vertices=t;return v},sortFacesByMaterialIndex:function(){var e=this.faces;var t=e.length;for(var r=0;r<t;r++){e[r]._id=r}function i(e,t){return e.materialIndex-t.materialIndex}e.sort(i);var n=this.faceVertexUvs[0];var a=this.faceVertexUvs[1];var o,s;if(n&&n.length===t)o=[];if(a&&a.length===t)s=[];for(var r=0;r<t;r++){var h=e[r]._id;if(o)o.push(n[h]);if(s)s.push(a[h])}if(o)this.faceVertexUvs[0]=o;if(s)this.faceVertexUvs[1]=s},toJSON:function(){var e={metadata:{version:4.4,type:"Geometry",generator:"Geometry.toJSON"}};e.uuid=this.uuid;e.type=this.type;if(this.name!=="")e.name=this.name;if(this.parameters!==undefined){var t=this.parameters;for(var r in t){if(t[r]!==undefined)e[r]=t[r]}return e}var i=[];for(var n=0;n<this.vertices.length;n++){var a=this.vertices[n];i.push(a.x,a.y,a.z)}var o=[];var s=[];var h={};var u=[];var c={};var l=[];var f={};for(var n=0;n<this.faces.length;n++){var E=this.faces[n];var d=false;var p=false;var m=this.faceVertexUvs[0][n]!==undefined;var v=E.normal.length()>0;var T=E.vertexNormals.length>0;var g=E.color.r!==1||E.color.g!==1||E.color.b!==1;var y=E.vertexColors.length>0;var R=0;R=w(R,0,0);R=w(R,1,d);R=w(R,2,p);R=w(R,3,m);R=w(R,4,v);R=w(R,5,T);R=w(R,6,g);R=w(R,7,y);o.push(R);o.push(E.a,E.b,E.c);if(m){var H=this.faceVertexUvs[0][n];o.push(_(H[0]),_(H[1]),_(H[2]))}if(v){o.push(M(E.normal))}if(T){var x=E.vertexNormals;o.push(M(x[0]),M(x[1]),M(x[2]))}if(g){o.push(S(E.color))}if(y){var b=E.vertexColors;o.push(S(b[0]),S(b[1]),S(b[2]))}}function w(e,t,r){return r?e|1<<t:e&~(1<<t)}function M(e){var t=e.x.toString()+e.y.toString()+e.z.toString();if(h[t]!==undefined){return h[t]}h[t]=s.length/3;s.push(e.x,e.y,e.z);return h[t]}function S(e){var t=e.r.toString()+e.g.toString()+e.b.toString();if(c[t]!==undefined){return c[t]}c[t]=u.length;u.push(e.getHex());return c[t]}function _(e){var t=e.x.toString()+e.y.toString();if(f[t]!==undefined){return f[t]}f[t]=l.length/2;l.push(e.x,e.y);return f[t]}e.data={};e.data.vertices=i;e.data.normals=s;if(u.length>0)e.data.colors=u;if(l.length>0)e.data.uvs=[l];e.data.faces=o;return e},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.vertices=[];this.faces=[];this.faceVertexUvs=[[]];var t=e.vertices;for(var r=0,i=t.length;r<i;r++){this.vertices.push(t[r].clone())}var n=e.faces;for(var r=0,i=n.length;r<i;r++){this.faces.push(n[r].clone())}for(var r=0,i=e.faceVertexUvs.length;r<i;r++){var a=e.faceVertexUvs[r];if(this.faceVertexUvs[r]===undefined){this.faceVertexUvs[r]=[]}for(var o=0,s=a.length;o<s;o++){var h=a[o],u=[];for(var c=0,l=h.length;c<l;c++){var f=h[c];u.push(f.clone())}this.faceVertexUvs[r].push(u)}}return this},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype);THREE.GeometryIdCount=0;THREE.DirectGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="DirectGeometry";this.indices=[];this.vertices=[];this.normals=[];this.colors=[];this.uvs=[];this.uvs2=[];this.groups=[];this.morphTargets={};this.skinWeights=[];this.skinIndices=[];this.boundingBox=null;this.boundingSphere=null;this.verticesNeedUpdate=false;this.normalsNeedUpdate=false;this.colorsNeedUpdate=false;this.uvsNeedUpdate=false;this.groupsNeedUpdate=false};THREE.DirectGeometry.prototype={constructor:THREE.DirectGeometry,computeBoundingBox:THREE.Geometry.prototype.computeBoundingBox,computeBoundingSphere:THREE.Geometry.prototype.computeBoundingSphere,computeFaceNormals:function(){console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")},computeVertexNormals:function(){console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")},computeGroups:function(e){var t;var r=[];var i;var n=e.faces;for(var a=0;a<n.length;a++){var o=n[a];if(o.materialIndex!==i){i=o.materialIndex;if(t!==undefined){t.count=a*3-t.start;r.push(t)}t={start:a*3,materialIndex:i}}}if(t!==undefined){t.count=a*3-t.start;r.push(t)}this.groups=r},fromGeometry:function(e){var t=e.faces;var r=e.vertices;var i=e.faceVertexUvs;var n=i[0]&&i[0].length>0;var a=i[1]&&i[1].length>0;var o=e.morphTargets;var s=o.length;if(s>0){var h=[];for(var u=0;u<s;u++){h[u]=[]}this.morphTargets.position=h}var c=e.morphNormals;var l=c.length;if(l>0){var f=[];for(var u=0;u<l;u++){f[u]=[]}this.morphTargets.normal=f}var E=e.skinIndices;var d=e.skinWeights;var p=E.length===r.length;var m=d.length===r.length;for(var u=0;u<t.length;u++){var v=t[u];this.vertices.push(r[v.a],r[v.b],r[v.c]);var T=v.vertexNormals;if(T.length===3){this.normals.push(T[0],T[1],T[2])}else{var g=v.normal;this.normals.push(g,g,g)}var y=v.vertexColors;if(y.length===3){this.colors.push(y[0],y[1],y[2])}else{var R=v.color;this.colors.push(R,R,R)}if(n===true){var H=i[0][u];if(H!==undefined){this.uvs.push(H[0],H[1],H[2])}else{console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",u);this.uvs.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)}}if(a===true){var H=i[1][u];if(H!==undefined){this.uvs2.push(H[0],H[1],H[2])}else{console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",u);this.uvs2.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)}}for(var x=0;x<s;x++){var b=o[x].vertices;h[x].push(b[v.a],b[v.b],b[v.c])}for(var x=0;x<l;x++){var w=c[x].vertexNormals[u];f[x].push(w.a,w.b,w.c)}if(p){this.skinIndices.push(E[v.a],E[v.b],E[v.c])}if(m){this.skinWeights.push(d[v.a],d[v.b],d[v.c])}}this.computeGroups(e);this.verticesNeedUpdate=e.verticesNeedUpdate;this.normalsNeedUpdate=e.normalsNeedUpdate;this.colorsNeedUpdate=e.colorsNeedUpdate;this.uvsNeedUpdate=e.uvsNeedUpdate;this.groupsNeedUpdate=e.groupsNeedUpdate;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.DirectGeometry.prototype);THREE.BufferGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="BufferGeometry";this.index=null;this.attributes={};this.morphAttributes={};this.groups=[];this.boundingBox=null;this.boundingSphere=null;this.drawRange={start:0,count:Infinity}};THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addIndex:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().");this.setIndex(e)},getIndex:function(){return this.index},setIndex:function(e){this.index=e},addAttribute:function(e,t){if(t instanceof THREE.BufferAttribute===false&&t instanceof THREE.InterleavedBufferAttribute===false){console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).");this.addAttribute(e,new THREE.BufferAttribute(arguments[1],arguments[2]));return}if(e==="index"){console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute.");this.setIndex(t);return}this.attributes[e]=t},getAttribute:function(e){return this.attributes[e]},removeAttribute:function(e){delete this.attributes[e]},get drawcalls(){console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups.");return this.groups},get offsets(){console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups.");return this.groups},addDrawCall:function(e,t,r){if(r!==undefined){console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.")}console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup().");this.addGroup(e,t)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().");this.clearGroups()},addGroup:function(e,t,r){this.groups.push({start:e,count:t,materialIndex:r!==undefined?r:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e;this.drawRange.count=t},applyMatrix:function(e){var t=this.attributes.position;if(t!==undefined){e.applyToVector3Array(t.array);t.needsUpdate=true}var r=this.attributes.normal;if(r!==undefined){var i=(new THREE.Matrix3).getNormalMatrix(e);i.applyToVector3Array(r.array);r.needsUpdate=true}if(this.boundingBox!==null){this.computeBoundingBox()}if(this.boundingSphere!==null){this.computeBoundingSphere()}},rotateX:function(){var e;return function t(r){if(e===undefined)e=new THREE.Matrix4;e.makeRotationX(r);this.applyMatrix(e);return this}}(),rotateY:function(){var e;return function t(r){if(e===undefined)e=new THREE.Matrix4;e.makeRotationY(r);this.applyMatrix(e);return this}}(),rotateZ:function(){var e;return function t(r){if(e===undefined)e=new THREE.Matrix4;e.makeRotationZ(r);this.applyMatrix(e);return this}}(),translate:function(){var e;return function t(r,i,n){if(e===undefined)e=new THREE.Matrix4;e.makeTranslation(r,i,n);this.applyMatrix(e);return this}}(),scale:function(){var e;return function t(r,i,n){if(e===undefined)e=new THREE.Matrix4;e.makeScale(r,i,n);this.applyMatrix(e);return this}}(),lookAt:function(){var e;return function t(r){if(e===undefined)e=new THREE.Object3D;e.lookAt(r);e.updateMatrix();this.applyMatrix(e.matrix)}}(),center:function(){this.computeBoundingBox();var e=this.boundingBox.center().negate();this.translate(e.x,e.y,e.z);return e},setFromObject:function(e){var t=e.geometry;if(e instanceof THREE.Points||e instanceof THREE.Line){var r=new THREE.Float32Attribute(t.vertices.length*3,3);var i=new THREE.Float32Attribute(t.colors.length*3,3);this.addAttribute("position",r.copyVector3sArray(t.vertices));this.addAttribute("color",i.copyColorsArray(t.colors));if(t.lineDistances&&t.lineDistances.length===t.vertices.length){var n=new THREE.Float32Attribute(t.lineDistances.length,1);this.addAttribute("lineDistance",n.copyArray(t.lineDistances))}if(t.boundingSphere!==null){this.boundingSphere=t.boundingSphere.clone()}if(t.boundingBox!==null){this.boundingBox=t.boundingBox.clone()}}else if(e instanceof THREE.Mesh){if(t instanceof THREE.Geometry){this.fromGeometry(t)}}return this},updateFromObject:function(e){var t=e.geometry;if(e instanceof THREE.Mesh){var r=t.__directGeometry;if(r===undefined){return this.fromGeometry(t)}r.verticesNeedUpdate=t.verticesNeedUpdate;r.normalsNeedUpdate=t.normalsNeedUpdate;r.colorsNeedUpdate=t.colorsNeedUpdate;r.uvsNeedUpdate=t.uvsNeedUpdate;r.groupsNeedUpdate=t.groupsNeedUpdate;t.verticesNeedUpdate=false;t.normalsNeedUpdate=false;t.colorsNeedUpdate=false;t.uvsNeedUpdate=false;t.groupsNeedUpdate=false;t=r}if(t.verticesNeedUpdate===true){var i=this.attributes.position;if(i!==undefined){i.copyVector3sArray(t.vertices);i.needsUpdate=true}t.verticesNeedUpdate=false}if(t.normalsNeedUpdate===true){var i=this.attributes.normal;if(i!==undefined){i.copyVector3sArray(t.normals);i.needsUpdate=true}t.normalsNeedUpdate=false}if(t.colorsNeedUpdate===true){var i=this.attributes.color;if(i!==undefined){i.copyColorsArray(t.colors);i.needsUpdate=true}t.colorsNeedUpdate=false}if(t.uvsNeedUpdate){var i=this.attributes.uv;if(i!==undefined){i.copyVector2sArray(t.uvs);i.needsUpdate=true}t.uvsNeedUpdate=false}if(t.lineDistancesNeedUpdate){var i=this.attributes.lineDistance;if(i!==undefined){i.copyArray(t.lineDistances);i.needsUpdate=true}t.lineDistancesNeedUpdate=false}if(t.groupsNeedUpdate){t.computeGroups(e.geometry);this.groups=t.groups;t.groupsNeedUpdate=false}return this},fromGeometry:function(e){e.__directGeometry=(new THREE.DirectGeometry).fromGeometry(e);return this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var t=new Float32Array(e.vertices.length*3);this.addAttribute("position",new THREE.BufferAttribute(t,3).copyVector3sArray(e.vertices));if(e.normals.length>0){var r=new Float32Array(e.normals.length*3);this.addAttribute("normal",new THREE.BufferAttribute(r,3).copyVector3sArray(e.normals))}if(e.colors.length>0){var i=new Float32Array(e.colors.length*3);this.addAttribute("color",new THREE.BufferAttribute(i,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var n=new Float32Array(e.uvs.length*2);this.addAttribute("uv",new THREE.BufferAttribute(n,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var a=new Float32Array(e.uvs2.length*2);this.addAttribute("uv2",new THREE.BufferAttribute(a,2).copyVector2sArray(e.uvs2))}if(e.indices.length>0){var o=e.vertices.length>65535?Uint32Array:Uint16Array;var s=new o(e.indices.length*3);this.setIndex(new THREE.BufferAttribute(s,1).copyIndicesArray(e.indices))}this.groups=e.groups;for(var h in e.morphTargets){var u=[];var c=e.morphTargets[h];for(var l=0,f=c.length;l<f;l++){var E=c[l];var d=new THREE.Float32Attribute(E.length*3,3);u.push(d.copyVector3sArray(E))}this.morphAttributes[h]=u}if(e.skinIndices.length>0){var p=new THREE.Float32Attribute(e.skinIndices.length*4,4);this.addAttribute("skinIndex",p.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var m=new THREE.Float32Attribute(e.skinWeights.length*4,4);this.addAttribute("skinWeight",m.copyVector4sArray(e.skinWeights))}if(e.boundingSphere!==null){this.boundingSphere=e.boundingSphere.clone()}if(e.boundingBox!==null){this.boundingBox=e.boundingBox.clone()}return this},computeBoundingBox:function(){var e=new THREE.Vector3;return function(){if(this.boundingBox===null){this.boundingBox=new THREE.Box3}var t=this.attributes.position.array;if(t){var r=this.boundingBox;r.makeEmpty();for(var i=0,n=t.length;i<n;i+=3){e.fromArray(t,i);r.expandByPoint(e)}}if(t===undefined||t.length===0){this.boundingBox.min.set(0,0,0);this.boundingBox.max.set(0,0,0)}if(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z)){console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}}}(),computeBoundingSphere:function(){var e=new THREE.Box3;var t=new THREE.Vector3;return function(){if(this.boundingSphere===null){this.boundingSphere=new THREE.Sphere}var r=this.attributes.position.array;if(r){e.makeEmpty();var i=this.boundingSphere.center;for(var n=0,a=r.length;n<a;n+=3){t.fromArray(r,n);e.expandByPoint(t)}e.center(i);var o=0;for(var n=0,a=r.length;n<a;n+=3){t.fromArray(r,n);o=Math.max(o,i.distanceToSquared(t))}this.boundingSphere.radius=Math.sqrt(o);if(isNaN(this.boundingSphere.radius)){console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var e=this.index;var t=this.attributes;var r=this.groups;if(t.position){var i=t.position.array;if(t.normal===undefined){this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(i.length),3))}else{var n=t.normal.array;for(var a=0,o=n.length;a<o;a++){n[a]=0}}var n=t.normal.array;var s,h,u,c=new THREE.Vector3,l=new THREE.Vector3,f=new THREE.Vector3,E=new THREE.Vector3,d=new THREE.Vector3;if(e){var p=e.array;if(r.length===0){this.addGroup(0,p.length)}for(var m=0,v=r.length;m<v;++m){var T=r[m];var g=T.start;var y=T.count;for(var a=g,o=g+y;a<o;a+=3){s=p[a+0]*3;h=p[a+1]*3;u=p[a+2]*3;c.fromArray(i,s);l.fromArray(i,h);f.fromArray(i,u);E.subVectors(f,l);d.subVectors(c,l);E.cross(d);n[s]+=E.x;n[s+1]+=E.y;n[s+2]+=E.z;n[h]+=E.x;n[h+1]+=E.y;n[h+2]+=E.z;n[u]+=E.x;n[u+1]+=E.y;n[u+2]+=E.z}}}else{for(var a=0,o=i.length;a<o;a+=9){c.fromArray(i,a);l.fromArray(i,a+3);f.fromArray(i,a+6);E.subVectors(f,l);d.subVectors(c,l);E.cross(d);n[a]=E.x;n[a+1]=E.y;n[a+2]=E.z;n[a+3]=E.x;n[a+4]=E.y;n[a+5]=E.z;n[a+6]=E.x;n[a+7]=E.y;n[a+8]=E.z}}this.normalizeNormals();t.normal.needsUpdate=true}},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(e){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},merge:function(e,t){if(e instanceof THREE.BufferGeometry===false){console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e);return}if(t===undefined)t=0;var r=this.attributes;for(var i in r){if(e.attributes[i]===undefined)continue;var n=r[i];var a=n.array;var o=e.attributes[i];var s=o.array;var h=o.itemSize;for(var u=0,c=h*t;u<s.length;u++,c++){a[c]=s[u]}}return this},normalizeNormals:function(){var e=this.attributes.normal.array;var t,r,i,n;for(var a=0,o=e.length;a<o;a+=3){t=e[a];r=e[a+1];i=e[a+2];n=1/Math.sqrt(t*t+r*r+i*i);e[a]*=n;e[a+1]*=n;e[a+2]*=n}},toJSON:function(){var e={metadata:{version:4.4,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};e.uuid=this.uuid;e.type=this.type;if(this.name!=="")e.name=this.name;if(this.parameters!==undefined){var t=this.parameters;for(var r in t){if(t[r]!==undefined)e[r]=t[r]}return e}e.data={attributes:{}};var i=this.index;if(i!==null){var n=Array.prototype.slice.call(i.array);e.data.index={type:i.array.constructor.name,array:n}}var a=this.attributes;for(var r in a){var o=a[r];var n=Array.prototype.slice.call(o.array);e.data.attributes[r]={itemSize:o.itemSize,type:o.array.constructor.name,array:n}}var s=this.groups;if(s.length>0){e.data.groups=JSON.parse(JSON.stringify(s))}var h=this.boundingSphere;if(h!==null){e.data.boundingSphere={center:h.center.toArray(),radius:h.radius}}return e},clone:function(){return(new this.constructor).copy(this)},copy:function(e){var t=e.index;if(t!==null){this.setIndex(t.clone())}var r=e.attributes;for(var i in r){var n=r[i];this.addAttribute(i,n.clone())}var a=e.groups;for(var o=0,s=a.length;o<s;o++){var h=a[o];this.addGroup(h.start,h.count)}return this},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype);THREE.BufferGeometry.MaxIndex=65535;THREE.InstancedBufferGeometry=function(){THREE.BufferGeometry.call(this);this.type="InstancedBufferGeometry";this.maxInstancedCount=undefined};THREE.InstancedBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.InstancedBufferGeometry.prototype.constructor=THREE.InstancedBufferGeometry;THREE.InstancedBufferGeometry.prototype.addGroup=function(e,t,r){this.groups.push({start:e,count:t,instances:r})};THREE.InstancedBufferGeometry.prototype.copy=function(e){var t=e.index;if(t!==null){this.setIndex(t.clone())}var r=e.attributes;for(var i in r){var n=r[i];this.addAttribute(i,n.clone())}var a=e.groups;for(var o=0,s=a.length;o<s;o++){var h=a[o];this.addGroup(h.start,h.count,h.instances)}return this};THREE.EventDispatcher.prototype.apply(THREE.InstancedBufferGeometry.prototype);THREE.AnimationAction=function(e,t,r,i,n){if(e===undefined)throw new Error("clip is null");this.clip=e;this.localRoot=null;this.startTime=t||0;this.timeScale=r||1;this.weight=i||1;this.loop=n||THREE.LoopRepeat;this.loopCount=0;this.enabled=true;this.actionTime=-this.startTime;this.clipTime=0;this.propertyBindings=[]};THREE.AnimationAction.prototype={constructor:THREE.AnimationAction,setLocalRoot:function(e){this.localRoot=e;return this},updateTime:function(e){var t=this.clipTime;var r=this.loopCount;var i=this.actionTime;var n=this.clip.duration;this.actionTime=this.actionTime+e;if(this.loop===THREE.LoopOnce){this.loopCount=0;this.clipTime=Math.min(Math.max(this.actionTime,0),n);if(this.clipTime!==t){if(this.clipTime===n){this.mixer.dispatchEvent({type:"finished",action:this,direction:1})}else if(this.clipTime===0){this.mixer.dispatchEvent({type:"finished",action:this,direction:-1})}}return this.clipTime}this.loopCount=Math.floor(this.actionTime/n);var a=this.actionTime-this.loopCount*n;a=a%n;if(this.loop==THREE.LoopPingPong){if(Math.abs(this.loopCount%2)===1){a=n-a}}this.clipTime=a;if(this.loopCount!==r){this.mixer.dispatchEvent({type:"loop",action:this,loopDelta:this.loopCount-this.loopCount})}return this.clipTime},syncWith:function(e){this.actionTime=e.actionTime;this.timeScale=e.timeScale;return this},warpToDuration:function(e){this.timeScale=this.clip.duration/e;return this},init:function(e){this.clipTime=e-this.startTime;return this},update:function(e){this.updateTime(e);var t=this.clip.getAt(this.clipTime);return t},getTimeScaleAt:function(e){if(this.timeScale.getAt){return this.timeScale.getAt(e)}return this.timeScale},getWeightAt:function(e){if(this.weight.getAt){return this.weight.getAt(e)}return this.weight}};THREE.AnimationClip=function(e,t,r){this.name=e;this.tracks=r;this.duration=t!==undefined?t:-1;if(this.duration<0){for(var i=0;i<this.tracks.length;i++){var n=this.tracks[i];this.duration=Math.max(n.keys[n.keys.length-1].time)}}this.trim();this.optimize();this.results=[]};THREE.AnimationClip.prototype={constructor:THREE.AnimationClip,getAt:function(e){e=Math.max(0,Math.min(e,this.duration));for(var t=0;t<this.tracks.length;t++){var r=this.tracks[t];this.results[t]=r.getAt(e)}return this.results},trim:function(){for(var e=0;e<this.tracks.length;e++){this.tracks[e].trim(0,this.duration)}return this},optimize:function(){for(var e=0;e<this.tracks.length;e++){this.tracks[e].optimize()}return this}};THREE.AnimationClip.CreateFromMorphTargetSequence=function(e,t,r){var i=t.length;var n=[];for(var a=0;a<i;a++){var o=[];o.push({time:(a+i-1)%i,value:0});o.push({time:a,value:1});o.push({time:(a+1)%i,value:0});o.sort(THREE.KeyframeTrack.keyComparer);if(o[0].time===0){o.push({time:i,value:o[0].value})}n.push(new THREE.NumberKeyframeTrack(".morphTargetInfluences["+t[a].name+"]",o).scale(1/r))}return new THREE.AnimationClip(e,-1,n)};THREE.AnimationClip.findByName=function(e,t){for(var r=0;r<e.length;r++){if(e[r].name===t){return e[r]}}return null};THREE.AnimationClip.CreateClipsFromMorphTargetSequences=function(e,t){var r={};var i=/^([\w-]*?)([\d]+)$/;for(var n=0,a=e.length;n<a;n++){var o=e[n];var s=o.name.match(i);if(s&&s.length>1){var h=s[1];var u=r[h];if(!u){r[h]=u=[]}u.push(o)}}var c=[];for(var h in r){c.push(THREE.AnimationClip.CreateFromMorphTargetSequence(h,r[h],t))}return c};THREE.AnimationClip.parse=function(e){var t=[];for(var r=0;r<e.tracks.length;r++){t.push(THREE.KeyframeTrack.parse(e.tracks[r]).scale(1/e.fps))}return new THREE.AnimationClip(e.name,e.duration,t)};THREE.AnimationClip.parseAnimation=function(e,t,r){if(!e){console.error("  no animation in JSONLoader data");return null}var i=function(e,t,r,i,n){var a=[];for(var o=0;o<t.length;o++){var s=t[o];if(s[r]!==undefined){a.push({time:s.time,value:n(s)})}}if(a.length>0){return new i(e,a)}return null};var n=[];var a=e.name||"default";var o=e.length||-1;var s=e.fps||30;var h=e.hierarchy||[];for(var u=0;u<h.length;u++){var c=h[u].keys;if(!c||c.length==0){
continue}if(c[0].morphTargets){var l={};for(var f=0;f<c.length;f++){if(c[f].morphTargets){for(var E=0;E<c[f].morphTargets.length;E++){l[c[f].morphTargets[E]]=-1}}}for(var d in l){var p=[];for(var E=0;E<c[f].morphTargets.length;E++){var m=c[f];p.push({time:m.time,value:m.morphTarget===d?1:0})}n.push(new THREE.NumberKeyframeTrack(r+".morphTargetInfluence["+d+"]",p))}o=l.length*(s||1)}else{var v=r+".bones["+t[u].name+"]";var T=i(v+".position",c,"pos",THREE.VectorKeyframeTrack,function(e){return(new THREE.Vector3).fromArray(e.pos)});if(T)n.push(T);var g=i(v+".quaternion",c,"rot",THREE.QuaternionKeyframeTrack,function(e){if(e.rot.slerp){return e.rot.clone()}else{return(new THREE.Quaternion).fromArray(e.rot)}});if(g)n.push(g);var y=i(v+".scale",c,"scl",THREE.VectorKeyframeTrack,function(e){return(new THREE.Vector3).fromArray(e.scl)});if(y)n.push(y)}}if(n.length===0){return null}var R=new THREE.AnimationClip(a,o,n);return R};THREE.AnimationMixer=function(e){this.root=e;this.time=0;this.timeScale=1;this.actions=[];this.propertyBindingMap={}};THREE.AnimationMixer.prototype={constructor:THREE.AnimationMixer,addAction:function(e){this.actions.push(e);e.init(this.time);e.mixer=this;var t=e.clip.tracks;var r=e.localRoot||this.root;for(var i=0;i<t.length;i++){var n=t[i];var a=r.uuid+"-"+n.name;var o=this.propertyBindingMap[a];if(o===undefined){o=new THREE.PropertyBinding(r,n.name);this.propertyBindingMap[a]=o}e.propertyBindings.push(o);o.referenceCount+=1}},removeAllActions:function(){for(var e=0;e<this.actions.length;e++){this.actions[e].mixer=null}for(var t in this.propertyBindingMap){this.propertyBindingMap[t].unbind()}this.actions=[];this.propertyBindingMap={};return this},removeAction:function(e){var t=this.actions.indexOf(e);if(t!==-1){this.actions.splice(t,1);e.mixer=null}var r=e.localRoot||this.root;var i=e.clip.tracks;for(var n=0;n<i.length;n++){var a=i[n];var o=r.uuid+"-"+a.name;var s=this.propertyBindingMap[o];s.referenceCount-=1;if(s.referenceCount<=0){s.unbind();delete this.propertyBindingMap[o]}}return this},findActionByName:function(e){for(var t=0;t<this.actions.length;t++){if(this.actions[t].name===e)return this.actions[t]}return null},play:function(e,t){e.startTime=this.time;this.addAction(e);return this},fadeOut:function(e,t){var r=[];r.push({time:this.time,value:1});r.push({time:this.time+t,value:0});e.weight=new THREE.NumberKeyframeTrack("weight",r);return this},fadeIn:function(e,t){var r=[];r.push({time:this.time,value:0});r.push({time:this.time+t,value:1});e.weight=new THREE.NumberKeyframeTrack("weight",r);return this},warp:function(e,t,r,i){var n=[];n.push({time:this.time,value:t});n.push({time:this.time+i,value:r});e.timeScale=new THREE.NumberKeyframeTrack("timeScale",n);return this},crossFade:function(e,t,r,i){this.fadeOut(e,r);this.fadeIn(t,r);if(i){var n=e.clip.duration/t.clip.duration;var a=1/n;this.warp(e,1,n,r);this.warp(t,a,1,r)}return this},update:function(e){var t=e*this.timeScale;this.time+=t;for(var r=0;r<this.actions.length;r++){var i=this.actions[r];var n=i.getWeightAt(this.time);var a=i.getTimeScaleAt(this.time);var o=t*a;var s=i.update(o);if(i.weight<=0||!i.enabled)continue;for(var h=0;h<s.length;h++){var u=i.clip.tracks[h].name;i.propertyBindings[h].accumulate(s[h],n)}}for(var c in this.propertyBindingMap){this.propertyBindingMap[c].apply()}return this}};THREE.EventDispatcher.prototype.apply(THREE.AnimationMixer.prototype);THREE.AnimationUtils={getEqualsFunc:function(e){if(e.equals){return function t(e,r){return e.equals(r)}}return function r(e,t){return e===t}},clone:function(e){var t=typeof e;if(t==="object"){if(e.clone){return e.clone()}console.error("can not figure out how to copy exemplarValue",e)}return e},lerp:function(e,t,r,i){var n=THREE.AnimationUtils.getLerpFunc(e,i);return n(e,t,r)},lerp_object:function(e,t,r){return e.lerp(t,r)},slerp_object:function(e,t,r){return e.slerp(t,r)},lerp_number:function(e,t,r){return e*(1-r)+t*r},lerp_boolean:function(e,t,r){return r<.5?e:t},lerp_boolean_immediate:function(e,t,r){return e},lerp_string:function(e,t,r){return r<.5?e:t},lerp_string_immediate:function(e,t,r){return e},getLerpFunc:function(e,t){if(e===undefined||e===null)throw new Error("examplarValue is null");var r=typeof e;switch(r){case"object":if(e.lerp){return THREE.AnimationUtils.lerp_object}if(e.slerp){return THREE.AnimationUtils.slerp_object}break;case"number":return THREE.AnimationUtils.lerp_number;case"boolean":if(t){return THREE.AnimationUtils.lerp_boolean}else{return THREE.AnimationUtils.lerp_boolean_immediate}case"string":if(t){return THREE.AnimationUtils.lerp_string}else{return THREE.AnimationUtils.lerp_string_immediate}}}};THREE.KeyframeTrack=function(e,t){if(e===undefined)throw new Error("track name is undefined");if(t===undefined||t.length===0)throw new Error("no keys in track named "+e);this.name=e;this.keys=t;this.lastIndex=0;this.validate();this.optimize()};THREE.KeyframeTrack.prototype={constructor:THREE.KeyframeTrack,getAt:function(e){while(this.lastIndex<this.keys.length&&e>=this.keys[this.lastIndex].time){this.lastIndex++}while(this.lastIndex>0&&e<this.keys[this.lastIndex-1].time){this.lastIndex--}if(this.lastIndex>=this.keys.length){this.setResult(this.keys[this.keys.length-1].value);return this.result}if(this.lastIndex===0){this.setResult(this.keys[0].value);return this.result}var t=this.keys[this.lastIndex-1];this.setResult(t.value);if(t.constantToNext){return this.result}var r=this.keys[this.lastIndex];var i=(e-t.time)/(r.time-t.time);this.result=this.lerpValues(this.result,r.value,i);return this.result},shift:function(e){if(e!==0){for(var t=0;t<this.keys.length;t++){this.keys[t].time+=e}}return this},scale:function(e){if(e!==1){for(var t=0;t<this.keys.length;t++){this.keys[t].time*=e}}return this},trim:function(e,t){var r=0;for(var i=1;i<this.keys.length;i++){if(this.keys[i]<=e){r++}}var n=0;for(var i=this.keys.length-2;i>0;i++){if(this.keys[i]>=t){n++}else{break}}if(r+n>0){this.keys=this.keys.splice(r,this.keys.length-n-r)}return this},validate:function(){var e=null;if(this.keys.length===0){console.error("  track is empty, no keys",this);return}for(var t=0;t<this.keys.length;t++){var r=this.keys[t];if(!r){console.error("  key is null in track",this,t);return}if(typeof r.time!=="number"||isNaN(r.time)){console.error("  key.time is not a valid number",this,t,r);return}if(r.value===undefined||r.value===null){console.error("  key.value is null in track",this,t,r);return}if(e&&e.time>r.time){console.error("  key.time is less than previous key time, out of order keys",this,t,r,e);return}e=r}return this},optimize:function(){var e=[];var t=this.keys[0];e.push(t);var r=THREE.AnimationUtils.getEqualsFunc(t.value);for(var i=1;i<this.keys.length-1;i++){var n=this.keys[i];var a=this.keys[i+1];if(t.time===n.time){continue}if(this.compareValues(t.value,n.value)&&this.compareValues(n.value,a.value)){continue}t.constantToNext=this.compareValues(t.value,n.value);e.push(n);t=n}e.push(this.keys[this.keys.length-1]);this.keys=e;return this}};THREE.KeyframeTrack.keyComparer=function e(t,r){return t.time-r.time};THREE.KeyframeTrack.parse=function(e){if(e.type===undefined)throw new Error("track type undefined, can not parse");var t=THREE.KeyframeTrack.GetTrackTypeForTypeName(e.type);return t.parse(e)};THREE.KeyframeTrack.GetTrackTypeForTypeName=function(e){switch(e.toLowerCase()){case"vector":case"vector2":case"vector3":case"vector4":return THREE.VectorKeyframeTrack;case"quaternion":return THREE.QuaternionKeyframeTrack;case"integer":case"scalar":case"double":case"float":case"number":return THREE.NumberKeyframeTrack;case"bool":case"boolean":return THREE.BooleanKeyframeTrack;case"string":return THREE.StringKeyframeTrack}throw new Error("Unsupported typeName: "+e)};THREE.PropertyBinding=function(e,t){this.rootNode=e;this.trackName=t;this.referenceCount=0;this.originalValue=null;var r=THREE.PropertyBinding.parseTrackName(t);this.directoryName=r.directoryName;this.nodeName=r.nodeName;this.objectName=r.objectName;this.objectIndex=r.objectIndex;this.propertyName=r.propertyName;this.propertyIndex=r.propertyIndex;this.node=THREE.PropertyBinding.findNode(e,this.nodeName)||e;this.cumulativeValue=null;this.cumulativeWeight=0};THREE.PropertyBinding.prototype={constructor:THREE.PropertyBinding,reset:function(){this.cumulativeValue=null;this.cumulativeWeight=0},accumulate:function(e,t){if(!this.isBound)this.bind();if(this.cumulativeWeight===0){if(t>0){if(this.cumulativeValue===null){this.cumulativeValue=THREE.AnimationUtils.clone(e)}this.cumulativeWeight=t}}else{var r=t/(this.cumulativeWeight+t);this.cumulativeValue=this.lerpValue(this.cumulativeValue,e,r);this.cumulativeWeight+=t}},unbind:function(){if(!this.isBound)return;this.setValue(this.originalValue);this.setValue=null;this.getValue=null;this.lerpValue=null;this.equalsValue=null;this.triggerDirty=null;this.isBound=false},bind:function(){if(this.isBound)return;var e=this.node;if(!e){console.error("  trying to update node for track: "+this.trackName+" but it wasn't found.");return}if(this.objectName){if(this.objectName==="materials"){if(!e.material){console.error("  can not bind to material as node does not have a material",this);return}if(!e.material.materials){console.error("  can not bind to material.materials as node.material does not have a materials array",this);return}e=e.material.materials}else if(this.objectName==="bones"){if(!e.skeleton){console.error("  can not bind to bones as node does not have a skeleton",this);return}e=e.skeleton.bones;for(var t=0;t<e.length;t++){if(e[t].name===this.objectIndex){this.objectIndex=t;break}}}else{if(e[this.objectName]===undefined){console.error("  can not bind to objectName of node, undefined",this);return}e=e[this.objectName]}if(this.objectIndex!==undefined){if(e[this.objectIndex]===undefined){console.error("  trying to bind to objectIndex of objectName, but is undefined:",this,e);return}e=e[this.objectIndex]}}var r=e[this.propertyName];if(!r){console.error("  trying to update property for track: "+this.nodeName+"."+this.propertyName+" but it wasn't found.",e);return}if(this.propertyIndex!==undefined){if(this.propertyName==="morphTargetInfluences"){if(!e.geometry){console.error("  can not bind to morphTargetInfluences becasuse node does not have a geometry",this)}if(!e.geometry.morphTargets){console.error("  can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets",this)}for(var t=0;t<this.node.geometry.morphTargets.length;t++){if(e.geometry.morphTargets[t].name===this.propertyIndex){this.propertyIndex=t;break}}}this.setValue=function i(e){if(!this.equalsValue(r[this.propertyIndex],e)){r[this.propertyIndex]=e;return true}return false};this.getValue=function n(){return r[this.propertyIndex]}}else if(r.copy){this.setValue=function a(e){if(!this.equalsValue(r,e)){r.copy(e);return true}return false};this.getValue=function o(){return r}}else{this.setValue=function s(t){if(!this.equalsValue(e[this.propertyName],t)){e[this.propertyName]=t;return true}return false};this.getValue=function h(){return e[this.propertyName]}}if(e.needsUpdate!==undefined){this.triggerDirty=function u(){this.node.needsUpdate=true}}else if(e.matrixWorldNeedsUpdate!==undefined){this.triggerDirty=function c(){e.matrixWorldNeedsUpdate=true}}this.originalValue=this.getValue();this.equalsValue=THREE.AnimationUtils.getEqualsFunc(this.originalValue);this.lerpValue=THREE.AnimationUtils.getLerpFunc(this.originalValue,true);this.isBound=true},apply:function(){if(!this.isBound)this.bind();if(this.cumulativeWeight>0){if(this.cumulativeWeight<1){var e=1-this.cumulativeWeight;var t=e/(this.cumulativeWeight+e);this.cumulativeValue=this.lerpValue(this.cumulativeValue,this.originalValue,t)}var r=this.setValue(this.cumulativeValue);if(r&&this.triggerDirty){this.triggerDirty()}this.cumulativeValue=null;this.cumulativeWeight=0}}};THREE.PropertyBinding.parseTrackName=function(e){var t=/^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_. ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/;var r=t.exec(e);if(!r){throw new Error("cannot parse trackName at all: "+e)}if(r.index===t.lastIndex){t.lastIndex++}var i={directoryName:r[1],nodeName:r[3],objectName:r[5],objectIndex:r[7],propertyName:r[9],propertyIndex:r[11]};if(i.propertyName===null||i.propertyName.length===0){throw new Error("can not parse propertyName from trackName: "+e)}return i};THREE.PropertyBinding.findNode=function(e,t){function r(e){for(var r=0;r<e.bones.length;r++){var i=e.bones[r];if(i.name===t){return i}}return null}function i(e){for(var r=0;r<e.length;r++){var n=e[r];if(n.name===t||n.uuid===t){return n}var a=i(n.children);if(a)return a}return null}if(!t||t===""||t==="root"||t==="."||t===-1||t===e.name||t===e.uuid){return e}if(e.skeleton){var n=r(e.skeleton);if(n){return n}}if(e.children){var a=i(e.children);if(a){return a}}return null};THREE.VectorKeyframeTrack=function(e,t){THREE.KeyframeTrack.call(this,e,t);this.result=this.keys[0].value.clone()};THREE.VectorKeyframeTrack.prototype=Object.create(THREE.KeyframeTrack.prototype);THREE.VectorKeyframeTrack.prototype.constructor=THREE.VectorKeyframeTrack;THREE.VectorKeyframeTrack.prototype.setResult=function(e){this.result.copy(e)};THREE.VectorKeyframeTrack.prototype.lerpValues=function(e,t,r){return e.lerp(t,r)};THREE.VectorKeyframeTrack.prototype.compareValues=function(e,t){return e.equals(t)};THREE.VectorKeyframeTrack.prototype.clone=function(){var e=[];for(var t=0;t<this.keys.length;t++){var r=this.keys[t];e.push({time:r.time,value:r.value.clone()})}return new THREE.VectorKeyframeTrack(this.name,e)};THREE.VectorKeyframeTrack.parse=function(e){var t=e.keys[0].value.length;var r=THREE["Vector"+t];var i=[];for(var n=0;n<e.keys.length;n++){var a=e.keys[n];i.push({value:(new r).fromArray(a.value),time:a.time})}return new THREE.VectorKeyframeTrack(e.name,i)};THREE.QuaternionKeyframeTrack=function(e,t){THREE.KeyframeTrack.call(this,e,t);this.result=this.keys[0].value.clone()};THREE.QuaternionKeyframeTrack.prototype=Object.create(THREE.KeyframeTrack.prototype);THREE.QuaternionKeyframeTrack.prototype.constructor=THREE.QuaternionKeyframeTrack;THREE.QuaternionKeyframeTrack.prototype.setResult=function(e){this.result.copy(e)};THREE.QuaternionKeyframeTrack.prototype.lerpValues=function(e,t,r){return e.slerp(t,r)};THREE.QuaternionKeyframeTrack.prototype.compareValues=function(e,t){return e.equals(t)};THREE.QuaternionKeyframeTrack.prototype.multiply=function(e){for(var t=0;t<this.keys.length;t++){this.keys[t].value.multiply(e)}return this};THREE.QuaternionKeyframeTrack.prototype.clone=function(){var e=[];for(var t=0;t<this.keys.length;t++){var r=this.keys[t];e.push({time:r.time,value:r.value.clone()})}return new THREE.QuaternionKeyframeTrack(this.name,e)};THREE.QuaternionKeyframeTrack.parse=function(e){var t=[];for(var r=0;r<e.keys.length;r++){var i=e.keys[r];t.push({value:(new THREE.Quaternion).fromArray(i.value),time:i.time})}return new THREE.QuaternionKeyframeTrack(e.name,t)};THREE.StringKeyframeTrack=function(e,t){THREE.KeyframeTrack.call(this,e,t);this.result=this.keys[0].value};THREE.StringKeyframeTrack.prototype=Object.create(THREE.KeyframeTrack.prototype);THREE.StringKeyframeTrack.prototype.constructor=THREE.StringKeyframeTrack;THREE.StringKeyframeTrack.prototype.setResult=function(e){this.result=e};THREE.StringKeyframeTrack.prototype.lerpValues=function(e,t,r){return r<1?e:t};THREE.StringKeyframeTrack.prototype.compareValues=function(e,t){return e===t};THREE.StringKeyframeTrack.prototype.clone=function(){var e=[];for(var t=0;t<this.keys.length;t++){var r=this.keys[t];e.push({time:r.time,value:r.value})}return new THREE.StringKeyframeTrack(this.name,e)};THREE.StringKeyframeTrack.parse=function(e){return new THREE.StringKeyframeTrack(e.name,e.keys)};THREE.BooleanKeyframeTrack=function(e,t){THREE.KeyframeTrack.call(this,e,t);this.result=this.keys[0].value};THREE.BooleanKeyframeTrack.prototype=Object.create(THREE.KeyframeTrack.prototype);THREE.BooleanKeyframeTrack.prototype.constructor=THREE.BooleanKeyframeTrack;THREE.BooleanKeyframeTrack.prototype.setResult=function(e){this.result=e};THREE.BooleanKeyframeTrack.prototype.lerpValues=function(e,t,r){return r<1?e:t};THREE.BooleanKeyframeTrack.prototype.compareValues=function(e,t){return e===t};THREE.BooleanKeyframeTrack.prototype.clone=function(){var e=[];for(var t=0;t<this.keys.length;t++){var r=this.keys[t];e.push({time:r.time,value:r.value})}return new THREE.BooleanKeyframeTrack(this.name,e)};THREE.BooleanKeyframeTrack.parse=function(e){return new THREE.BooleanKeyframeTrack(e.name,e.keys)};THREE.NumberKeyframeTrack=function(e,t){THREE.KeyframeTrack.call(this,e,t);this.result=this.keys[0].value};THREE.NumberKeyframeTrack.prototype=Object.create(THREE.KeyframeTrack.prototype);THREE.NumberKeyframeTrack.prototype.constructor=THREE.NumberKeyframeTrack;THREE.NumberKeyframeTrack.prototype.setResult=function(e){this.result=e};THREE.NumberKeyframeTrack.prototype.lerpValues=function(e,t,r){return e*(1-r)+t*r};THREE.NumberKeyframeTrack.prototype.compareValues=function(e,t){return e===t};THREE.NumberKeyframeTrack.prototype.clone=function(){var e=[];for(var t=0;t<this.keys.length;t++){var r=this.keys[t];e.push({time:r.time,value:r.value})}return new THREE.NumberKeyframeTrack(this.name,e)};THREE.NumberKeyframeTrack.parse=function(e){return new THREE.NumberKeyframeTrack(e.name,e.keys)};THREE.Camera=function(){THREE.Object3D.call(this);this.type="Camera";this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4};THREE.Camera.prototype=Object.create(THREE.Object3D.prototype);THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.getWorldDirection=function(){var e=new THREE.Quaternion;return function(t){var r=t||new THREE.Vector3;this.getWorldQuaternion(e);return r.set(0,0,-1).applyQuaternion(e)}}();THREE.Camera.prototype.lookAt=function(){var e=new THREE.Matrix4;return function(t){e.lookAt(this.position,t,this.up);this.quaternion.setFromRotationMatrix(e)}}();THREE.Camera.prototype.clone=function(){return(new this.constructor).copy(this)};THREE.Camera.prototype.copy=function(e){THREE.Object3D.prototype.copy.call(this,e);this.matrixWorldInverse.copy(e.matrixWorldInverse);this.projectionMatrix.copy(e.projectionMatrix);return this};THREE.CubeCamera=function(e,t,r){THREE.Object3D.call(this);this.type="CubeCamera";var i=90,n=1;var a=new THREE.PerspectiveCamera(i,n,e,t);a.up.set(0,-1,0);a.lookAt(new THREE.Vector3(1,0,0));this.add(a);var o=new THREE.PerspectiveCamera(i,n,e,t);o.up.set(0,-1,0);o.lookAt(new THREE.Vector3(-1,0,0));this.add(o);var s=new THREE.PerspectiveCamera(i,n,e,t);s.up.set(0,0,1);s.lookAt(new THREE.Vector3(0,1,0));this.add(s);var h=new THREE.PerspectiveCamera(i,n,e,t);h.up.set(0,0,-1);h.lookAt(new THREE.Vector3(0,-1,0));this.add(h);var u=new THREE.PerspectiveCamera(i,n,e,t);u.up.set(0,-1,0);u.lookAt(new THREE.Vector3(0,0,1));this.add(u);var c=new THREE.PerspectiveCamera(i,n,e,t);c.up.set(0,-1,0);c.lookAt(new THREE.Vector3(0,0,-1));this.add(c);this.renderTarget=new THREE.WebGLRenderTargetCube(r,r,{format:THREE.RGBFormat,magFilter:THREE.LinearFilter,minFilter:THREE.LinearFilter});this.updateCubeMap=function(e,t){if(this.parent===null)this.updateMatrixWorld();var r=this.renderTarget;var i=r.texture.generateMipmaps;r.texture.generateMipmaps=false;r.activeCubeFace=0;e.render(t,a,r);r.activeCubeFace=1;e.render(t,o,r);r.activeCubeFace=2;e.render(t,s,r);r.activeCubeFace=3;e.render(t,h,r);r.activeCubeFace=4;e.render(t,u,r);r.texture.generateMipmaps=i;r.activeCubeFace=5;e.render(t,c,r);e.setRenderTarget(null)}};THREE.CubeCamera.prototype=Object.create(THREE.Object3D.prototype);THREE.CubeCamera.prototype.constructor=THREE.CubeCamera;THREE.OrthographicCamera=function(e,t,r,i,n,a){THREE.Camera.call(this);this.type="OrthographicCamera";this.zoom=1;this.left=e;this.right=t;this.top=r;this.bottom=i;this.near=n!==undefined?n:.1;this.far=a!==undefined?a:2e3;this.updateProjectionMatrix()};THREE.OrthographicCamera.prototype=Object.create(THREE.Camera.prototype);THREE.OrthographicCamera.prototype.constructor=THREE.OrthographicCamera;THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){var e=(this.right-this.left)/(2*this.zoom);var t=(this.top-this.bottom)/(2*this.zoom);var r=(this.right+this.left)/2;var i=(this.top+this.bottom)/2;this.projectionMatrix.makeOrthographic(r-e,r+e,i+t,i-t,this.near,this.far)};THREE.OrthographicCamera.prototype.copy=function(e){THREE.Camera.prototype.copy.call(this,e);this.left=e.left;this.right=e.right;this.top=e.top;this.bottom=e.bottom;this.near=e.near;this.far=e.far;this.zoom=e.zoom;return this};THREE.OrthographicCamera.prototype.toJSON=function(e){var t=THREE.Object3D.prototype.toJSON.call(this,e);t.object.zoom=this.zoom;t.object.left=this.left;t.object.right=this.right;t.object.top=this.top;t.object.bottom=this.bottom;t.object.near=this.near;t.object.far=this.far;return t};THREE.PerspectiveCamera=function(e,t,r,i){THREE.Camera.call(this);this.type="PerspectiveCamera";this.zoom=1;this.fov=e!==undefined?e:50;this.aspect=t!==undefined?t:1;this.near=r!==undefined?r:.1;this.far=i!==undefined?i:2e3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=Object.create(THREE.Camera.prototype);THREE.PerspectiveCamera.prototype.constructor=THREE.PerspectiveCamera;THREE.PerspectiveCamera.prototype.setLens=function(e,t){if(t===undefined)t=24;this.fov=2*THREE.Math.radToDeg(Math.atan(t/(e*2)));this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype.setViewOffset=function(e,t,r,i,n,a){this.fullWidth=e;this.fullHeight=t;this.x=r;this.y=i;this.width=n;this.height=a;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){var e=THREE.Math.radToDeg(2*Math.atan(Math.tan(THREE.Math.degToRad(this.fov)*.5)/this.zoom));if(this.fullWidth){var t=this.fullWidth/this.fullHeight;var r=Math.tan(THREE.Math.degToRad(e*.5))*this.near;var i=-r;var n=t*i;var a=t*r;var o=Math.abs(a-n);var s=Math.abs(r-i);this.projectionMatrix.makeFrustum(n+this.x*o/this.fullWidth,n+(this.x+this.width)*o/this.fullWidth,r-(this.y+this.height)*s/this.fullHeight,r-this.y*s/this.fullHeight,this.near,this.far)}else{this.projectionMatrix.makePerspective(e,this.aspect,this.near,this.far)}};THREE.PerspectiveCamera.prototype.copy=function(e){THREE.Camera.prototype.copy.call(this,e);this.fov=e.fov;this.aspect=e.aspect;this.near=e.near;this.far=e.far;this.zoom=e.zoom;return this};THREE.PerspectiveCamera.prototype.toJSON=function(e){var t=THREE.Object3D.prototype.toJSON.call(this,e);t.object.zoom=this.zoom;t.object.fov=this.fov;t.object.aspect=this.aspect;t.object.near=this.near;t.object.far=this.far;return t};THREE.Light=function(e){THREE.Object3D.call(this);this.type="Light";this.color=new THREE.Color(e);this.receiveShadow=undefined};THREE.Light.prototype=Object.create(THREE.Object3D.prototype);THREE.Light.prototype.constructor=THREE.Light;Object.defineProperties(THREE.Light.prototype,{onlyShadow:{set:function(e){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){this.shadow.camera.far=e}},shadowCameraVisible:{set:function(e){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow ) instead.")}},shadowBias:{set:function(e){this.shadow.bias=e}},shadowBlur:{set:function(e){this.shadow.blur=e}},shadowDarkness:{set:function(e){this.shadow.darkness=e}},shadowMapWidth:{set:function(e){this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){this.shadow.mapSize.height=e}}});THREE.Light.prototype.copy=function(e){THREE.Object3D.prototype.copy.call(this,e);this.color.copy(e.color);return this};THREE.Light.prototype.toJSON=function(e){var t=THREE.Object3D.prototype.toJSON.call(this,e);t.object.color=this.color.getHex();if(this.groundColor!==undefined)t.object.groundColor=this.groundColor.getHex();if(this.intensity!==undefined)t.object.intensity=this.intensity;if(this.distance!==undefined)t.object.distance=this.distance;if(this.angle!==undefined)t.object.angle=this.angle;if(this.decay!==undefined)t.object.decay=this.decay;if(this.exponent!==undefined)t.object.exponent=this.exponent;return t};THREE.LightShadow=function(e){this.camera=e;this.bias=0;this.darkness=1;this.blur=0;this.mapSize=new THREE.Vector2(512,512);this.map=null;this.matrix=null};THREE.LightShadow.prototype={constructor:THREE.LightShadow,copy:function(e){this.camera=e.camera.clone();this.bias=e.bias;this.darkness=e.darkness;this.blur=e.blur;this.mapSize.copy(e.mapSize)},clone:function(){return(new this.constructor).copy(this)}};THREE.AmbientLight=function(e){THREE.Light.call(this,e);this.type="AmbientLight";this.castShadow=undefined};THREE.AmbientLight.prototype=Object.create(THREE.Light.prototype);THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;THREE.DirectionalLight=function(e,t){THREE.Light.call(this,e);this.type="DirectionalLight";this.position.set(0,1,0);this.updateMatrix();this.target=new THREE.Object3D;this.intensity=t!==undefined?t:1;this.shadow=new THREE.LightShadow(new THREE.OrthographicCamera(-500,500,500,-500,50,5e3))};THREE.DirectionalLight.prototype=Object.create(THREE.Light.prototype);THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.DirectionalLight.prototype.copy=function(e){THREE.Light.prototype.copy.call(this,e);this.intensity=e.intensity;this.target=e.target.clone();this.shadow=e.shadow.clone();return this};THREE.HemisphereLight=function(e,t,r){THREE.Light.call(this,e);this.type="HemisphereLight";this.castShadow=undefined;this.position.set(0,1,0);this.updateMatrix();this.groundColor=new THREE.Color(t);this.intensity=r!==undefined?r:1};THREE.HemisphereLight.prototype=Object.create(THREE.Light.prototype);THREE.HemisphereLight.prototype.constructor=THREE.HemisphereLight;THREE.HemisphereLight.prototype.copy=function(e){THREE.Light.prototype.copy.call(this,e);this.groundColor.copy(e.groundColor);this.intensity=e.intensity;return this};THREE.PointLight=function(e,t,r,i){THREE.Light.call(this,e);this.type="PointLight";this.intensity=t!==undefined?t:1;this.distance=r!==undefined?r:0;this.decay=i!==undefined?i:1;this.shadow=new THREE.LightShadow(new THREE.PerspectiveCamera(90,1,1,500))};THREE.PointLight.prototype=Object.create(THREE.Light.prototype);THREE.PointLight.prototype.constructor=THREE.PointLight;THREE.PointLight.prototype.copy=function(e){THREE.Light.prototype.copy.call(this,e);this.intensity=e.intensity;this.distance=e.distance;this.decay=e.decay;this.shadow=e.shadow.clone();return this};THREE.SpotLight=function(e,t,r,i,n,a){THREE.Light.call(this,e);this.type="SpotLight";this.position.set(0,1,0);this.updateMatrix();this.target=new THREE.Object3D;this.intensity=t!==undefined?t:1;this.distance=r!==undefined?r:0;this.angle=i!==undefined?i:Math.PI/3;this.exponent=n!==undefined?n:10;this.decay=a!==undefined?a:1;this.shadow=new THREE.LightShadow(new THREE.PerspectiveCamera(50,1,50,5e3))};THREE.SpotLight.prototype=Object.create(THREE.Light.prototype);THREE.SpotLight.prototype.constructor=THREE.SpotLight;THREE.SpotLight.prototype.copy=function(e){THREE.Light.prototype.copy.call(this,e);this.intensity=e.intensity;this.distance=e.distance;this.angle=e.angle;this.exponent=e.exponent;this.decay=e.decay;this.target=e.target.clone();this.shadow=e.shadow.clone();return this};THREE.Cache={enabled:false,files:{},add:function(e,t){if(this.enabled===false)return;this.files[e]=t},get:function(e){if(this.enabled===false)return;return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};THREE.Loader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};THREE.Loader.prototype={constructor:THREE.Loader,crossOrigin:undefined,extractUrlBase:function(e){var t=e.split("/");if(t.length===1)return"./";t.pop();return t.join("/")+"/"},initMaterials:function(e,t,r){var i=[];for(var n=0;n<e.length;++n){i[n]=this.createMaterial(e[n],t,r)}return i},createMaterial:function(){var e,t,r;return function(i,n,a){if(e===undefined)e=new THREE.Color;if(t===undefined)t=new THREE.TextureLoader;if(r===undefined)r=new THREE.MaterialLoader;var o={};function s(e,r,i,s,h){var u=n+e;var c=THREE.Loader.Handlers.get(u);var l;if(c!==null){l=c.load(u)}else{t.setCrossOrigin(a);l=t.load(u)}if(r!==undefined){l.repeat.fromArray(r);if(r[0]!==1)l.wrapS=THREE.RepeatWrapping;if(r[1]!==1)l.wrapT=THREE.RepeatWrapping}if(i!==undefined){l.offset.fromArray(i)}if(s!==undefined){if(s[0]==="repeat")l.wrapS=THREE.RepeatWrapping;if(s[0]==="mirror")l.wrapS=THREE.MirroredRepeatWrapping;if(s[1]==="repeat")l.wrapT=THREE.RepeatWrapping;if(s[1]==="mirror")l.wrapT=THREE.MirroredRepeatWrapping}if(h!==undefined){l.anisotropy=h}var f=THREE.Math.generateUUID();o[f]=l;return f}var h={uuid:THREE.Math.generateUUID(),type:"MeshLambertMaterial"};for(var u in i){var c=i[u];switch(u){case"DbgColor":h.color=c;break;case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":h.name=c;break;case"blending":h.blending=THREE[c];break;case"colorDiffuse":h.color=e.fromArray(c).getHex();break;case"colorSpecular":h.specular=e.fromArray(c).getHex();break;case"colorEmissive":h.emissive=e.fromArray(c).getHex();break;case"specularCoef":h.shininess=c;break;case"shading":if(c.toLowerCase()==="basic")h.type="MeshBasicMaterial";if(c.toLowerCase()==="phong")h.type="MeshPhongMaterial";break;case"mapDiffuse":h.map=s(c,i.mapDiffuseRepeat,i.mapDiffuseOffset,i.mapDiffuseWrap,i.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapLight":h.lightMap=s(c,i.mapLightRepeat,i.mapLightOffset,i.mapLightWrap,i.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":h.aoMap=s(c,i.mapAORepeat,i.mapAOOffset,i.mapAOWrap,i.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":h.bumpMap=s(c,i.mapBumpRepeat,i.mapBumpOffset,i.mapBumpWrap,i.mapBumpAnisotropy);break;case"mapBumpScale":h.bumpScale=c;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":h.normalMap=s(c,i.mapNormalRepeat,i.mapNormalOffset,i.mapNormalWrap,i.mapNormalAnisotropy);break;case"mapNormalFactor":h.normalScale=[c,c];break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":h.specularMap=s(c,i.mapSpecularRepeat,i.mapSpecularOffset,i.mapSpecularWrap,i.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapAlpha":h.alphaMap=s(c,i.mapAlphaRepeat,i.mapAlphaOffset,i.mapAlphaWrap,i.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":h.side=THREE.BackSide;break;case"doubleSided":h.side=THREE.DoubleSide;break;case"transparency":console.warn("THREE.Loader: transparency has been renamed to opacity");h.opacity=c;break;case"opacity":case"transparent":case"depthTest":case"depthWrite":case"transparent":case"visible":case"wireframe":h[u]=c;break;case"vertexColors":if(c===true)h.vertexColors=THREE.VertexColors;if(c==="face")h.vertexColors=THREE.FaceColors;break;default:console.error("Loader.createMaterial: Unsupported",u,c);break}}if(h.type!=="MeshPhongMaterial")delete h.specular;if(h.opacity<1)h.transparent=true;r.setTextures(o);return r.parse(h)}}()};THREE.Loader.Handlers={handlers:[],add:function(e,t){this.handlers.push(e,t)},get:function(e){var t=this.handlers;for(var r=0,i=t.length;r<i;r+=2){
var n=t[r];var a=t[r+1];if(n.test(e)){return a}}return null}};THREE.XHRLoader=function(e){this.manager=e!==undefined?e:THREE.DefaultLoadingManager};THREE.XHRLoader.prototype={constructor:THREE.XHRLoader,load:function(e,t,r,i){var n=this;var a=THREE.Cache.get(e);if(a!==undefined){if(t){setTimeout(function(){t(a)},0)}return a}var o=new XMLHttpRequest;o.open("GET",e,true);o.addEventListener("load",function(r){var i=r.target.response;THREE.Cache.add(e,i);if(t)t(i);n.manager.itemEnd(e)},false);if(r!==undefined){o.addEventListener("progress",function(e){r(e)},false)}o.addEventListener("error",function(t){if(i)i(t);n.manager.itemError(e)},false);if(this.crossOrigin!==undefined)o.crossOrigin=this.crossOrigin;if(this.responseType!==undefined)o.responseType=this.responseType;if(this.withCredentials!==undefined)o.withCredentials=this.withCredentials;o.send(null);n.manager.itemStart(e);return o},setResponseType:function(e){this.responseType=e},setCrossOrigin:function(e){this.crossOrigin=e},setWithCredentials:function(e){this.withCredentials=e}};THREE.ImageLoader=function(e){this.manager=e!==undefined?e:THREE.DefaultLoadingManager};THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(e,t,r,i){var n=this;var a=THREE.Cache.get(e);if(a!==undefined){n.manager.itemStart(e);if(t){setTimeout(function(){t(a);n.manager.itemEnd(e)},0)}else{n.manager.itemEnd(e)}return a}var o=document.createElement("img");o.addEventListener("load",function(r){THREE.Cache.add(e,this);if(t)t(this);n.manager.itemEnd(e)},false);if(r!==undefined){o.addEventListener("progress",function(e){r(e)},false)}o.addEventListener("error",function(t){if(i)i(t);n.manager.itemError(e)},false);if(this.crossOrigin!==undefined)o.crossOrigin=this.crossOrigin;n.manager.itemStart(e);o.src=e;return o},setCrossOrigin:function(e){this.crossOrigin=e}};THREE.JSONLoader=function(e){if(typeof e==="boolean"){console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor.");e=undefined}this.manager=e!==undefined?e:THREE.DefaultLoadingManager;this.withCredentials=false};THREE.JSONLoader.prototype={constructor:THREE.JSONLoader,get statusDomElement(){if(this._statusDomElement===undefined){this._statusDomElement=document.createElement("div")}console.warn("THREE.JSONLoader: .statusDomElement has been removed.");return this._statusDomElement},load:function(e,t,r,i){var n=this;var a=this.texturePath&&typeof this.texturePath==="string"?this.texturePath:THREE.Loader.prototype.extractUrlBase(e);var o=new THREE.XHRLoader(this.manager);o.setCrossOrigin(this.crossOrigin);o.setWithCredentials(this.withCredentials);o.load(e,function(r){var i=JSON.parse(r);var o=i.metadata;if(o!==undefined){if(o.type==="object"){console.error("THREE.JSONLoader: "+e+" should be loaded with THREE.ObjectLoader instead.");return}if(o.type==="scene"){console.error("THREE.JSONLoader: "+e+" should be loaded with THREE.SceneLoader instead.");return}}var s=n.parse(i,a);t(s.geometry,s.materials)})},setCrossOrigin:function(e){this.crossOrigin=e},setTexturePath:function(e){this.texturePath=e},parse:function(e,t){var r=new THREE.Geometry,i=e.scale!==undefined?1/e.scale:1;n(i);a();o(i);s();r.computeFaceNormals();r.computeBoundingSphere();function n(t){function i(e,t){return e&1<<t}var n,a,o,s,h,u,c,l,f,E,d,p,m,v,T,g,y,R,H,x,b,w,M,S,_,A,C,L=e.faces,P=e.vertices,D=e.normals,k=e.colors,V=0;if(e.uvs!==undefined){for(n=0;n<e.uvs.length;n++){if(e.uvs[n].length)V++}for(n=0;n<V;n++){r.faceVertexUvs[n]=[]}}s=0;h=P.length;while(s<h){R=new THREE.Vector3;R.x=P[s++]*t;R.y=P[s++]*t;R.z=P[s++]*t;r.vertices.push(R)}s=0;h=L.length;while(s<h){E=L[s++];d=i(E,0);p=i(E,1);m=i(E,3);v=i(E,4);T=i(E,5);g=i(E,6);y=i(E,7);if(d){x=new THREE.Face3;x.a=L[s];x.b=L[s+1];x.c=L[s+3];b=new THREE.Face3;b.a=L[s+1];b.b=L[s+2];b.c=L[s+3];s+=4;if(p){f=L[s++];x.materialIndex=f;b.materialIndex=f}o=r.faces.length;if(m){for(n=0;n<V;n++){S=e.uvs[n];r.faceVertexUvs[n][o]=[];r.faceVertexUvs[n][o+1]=[];for(a=0;a<4;a++){l=L[s++];A=S[l*2];C=S[l*2+1];_=new THREE.Vector2(A,C);if(a!==2)r.faceVertexUvs[n][o].push(_);if(a!==0)r.faceVertexUvs[n][o+1].push(_)}}}if(v){c=L[s++]*3;x.normal.set(D[c++],D[c++],D[c]);b.normal.copy(x.normal)}if(T){for(n=0;n<4;n++){c=L[s++]*3;M=new THREE.Vector3(D[c++],D[c++],D[c]);if(n!==2)x.vertexNormals.push(M);if(n!==0)b.vertexNormals.push(M)}}if(g){u=L[s++];w=k[u];x.color.setHex(w);b.color.setHex(w)}if(y){for(n=0;n<4;n++){u=L[s++];w=k[u];if(n!==2)x.vertexColors.push(new THREE.Color(w));if(n!==0)b.vertexColors.push(new THREE.Color(w))}}r.faces.push(x);r.faces.push(b)}else{H=new THREE.Face3;H.a=L[s++];H.b=L[s++];H.c=L[s++];if(p){f=L[s++];H.materialIndex=f}o=r.faces.length;if(m){for(n=0;n<V;n++){S=e.uvs[n];r.faceVertexUvs[n][o]=[];for(a=0;a<3;a++){l=L[s++];A=S[l*2];C=S[l*2+1];_=new THREE.Vector2(A,C);r.faceVertexUvs[n][o].push(_)}}}if(v){c=L[s++]*3;H.normal.set(D[c++],D[c++],D[c])}if(T){for(n=0;n<3;n++){c=L[s++]*3;M=new THREE.Vector3(D[c++],D[c++],D[c]);H.vertexNormals.push(M)}}if(g){u=L[s++];H.color.setHex(k[u])}if(y){for(n=0;n<3;n++){u=L[s++];H.vertexColors.push(new THREE.Color(k[u]))}}r.faces.push(H)}}}function a(){var t=e.influencesPerVertex!==undefined?e.influencesPerVertex:2;if(e.skinWeights){for(var i=0,n=e.skinWeights.length;i<n;i+=t){var a=e.skinWeights[i];var o=t>1?e.skinWeights[i+1]:0;var s=t>2?e.skinWeights[i+2]:0;var h=t>3?e.skinWeights[i+3]:0;r.skinWeights.push(new THREE.Vector4(a,o,s,h))}}if(e.skinIndices){for(var i=0,n=e.skinIndices.length;i<n;i+=t){var u=e.skinIndices[i];var c=t>1?e.skinIndices[i+1]:0;var l=t>2?e.skinIndices[i+2]:0;var f=t>3?e.skinIndices[i+3]:0;r.skinIndices.push(new THREE.Vector4(u,c,l,f))}}r.bones=e.bones;if(r.bones&&r.bones.length>0&&(r.skinWeights.length!==r.skinIndices.length||r.skinIndices.length!==r.vertices.length)){console.warn("When skinning, number of vertices ("+r.vertices.length+"), skinIndices ("+r.skinIndices.length+"), and skinWeights ("+r.skinWeights.length+") should match.")}}function o(t){if(e.morphTargets!==undefined){for(var i=0,n=e.morphTargets.length;i<n;i++){r.morphTargets[i]={};r.morphTargets[i].name=e.morphTargets[i].name;r.morphTargets[i].vertices=[];var a=r.morphTargets[i].vertices;var o=e.morphTargets[i].vertices;for(var s=0,h=o.length;s<h;s+=3){var u=new THREE.Vector3;u.x=o[s]*t;u.y=o[s+1]*t;u.z=o[s+2]*t;a.push(u)}}}if(e.morphColors!==undefined&&e.morphColors.length>0){console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');var c=r.faces;var l=e.morphColors[0].colors;for(var i=0,n=c.length;i<n;i++){c[i].color.fromArray(l,i*3)}}}function s(){var t=[];var i=[];if(e.animation!==undefined){i.push(e.animation)}if(e.animations!==undefined){if(e.animations.length){i=i.concat(e.animations)}else{i.push(e.animations)}}for(var n=0;n<i.length;n++){var a=THREE.AnimationClip.parseAnimation(i[n],r.bones);if(a)t.push(a)}if(r.morphTargets){var o=THREE.AnimationClip.CreateClipsFromMorphTargetSequences(r.morphTargets,10);t=t.concat(o)}if(t.length>0)r.animations=t}if(e.materials===undefined||e.materials.length===0){return{geometry:r}}else{var h=THREE.Loader.prototype.initMaterials(e.materials,t,this.crossOrigin);return{geometry:r,materials:h}}}};THREE.LoadingManager=function(e,t,r){var i=this;var n=false,a=0,o=0;this.onStart=undefined;this.onLoad=e;this.onProgress=t;this.onError=r;this.itemStart=function(e){o++;if(n===false){if(i.onStart!==undefined){i.onStart(e,a,o)}}n=true};this.itemEnd=function(e){a++;if(i.onProgress!==undefined){i.onProgress(e,a,o)}if(a===o){n=false;if(i.onLoad!==undefined){i.onLoad()}}};this.itemError=function(e){if(i.onError!==undefined){i.onError(e)}}};THREE.DefaultLoadingManager=new THREE.LoadingManager;THREE.BufferGeometryLoader=function(e){this.manager=e!==undefined?e:THREE.DefaultLoadingManager};THREE.BufferGeometryLoader.prototype={constructor:THREE.BufferGeometryLoader,load:function(e,t,r,i){var n=this;var a=new THREE.XHRLoader(n.manager);a.setCrossOrigin(this.crossOrigin);a.load(e,function(e){t(n.parse(JSON.parse(e)))},r,i)},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e){var t=new THREE.BufferGeometry;var r=e.data.index;if(r!==undefined){var i=new self[r.type](r.array);t.setIndex(new THREE.BufferAttribute(i,1))}var n=e.data.attributes;for(var a in n){var o=n[a];var i=new self[o.type](o.array);t.addAttribute(a,new THREE.BufferAttribute(i,o.itemSize))}var s=e.data.groups||e.data.drawcalls||e.data.offsets;if(s!==undefined){for(var h=0,u=s.length;h!==u;++h){var c=s[h];t.addGroup(c.start,c.count)}}var l=e.data.boundingSphere;if(l!==undefined){var f=new THREE.Vector3;if(l.center!==undefined){f.fromArray(l.center)}t.boundingSphere=new THREE.Sphere(f,l.radius)}return t}};THREE.MaterialLoader=function(e){this.manager=e!==undefined?e:THREE.DefaultLoadingManager;this.textures={}};THREE.MaterialLoader.prototype={constructor:THREE.MaterialLoader,load:function(e,t,r,i){var n=this;var a=new THREE.XHRLoader(n.manager);a.setCrossOrigin(this.crossOrigin);a.load(e,function(e){t(n.parse(JSON.parse(e)))},r,i)},setCrossOrigin:function(e){this.crossOrigin=e},setTextures:function(e){this.textures=e},getTexture:function(e){var t=this.textures;if(t[e]===undefined){console.warn("THREE.MaterialLoader: Undefined texture",e)}return t[e]},parse:function(e){var t=new THREE[e.type];t.uuid=e.uuid;if(e.name!==undefined)t.name=e.name;if(e.color!==undefined)t.color.setHex(e.color);if(e.emissive!==undefined)t.emissive.setHex(e.emissive);if(e.specular!==undefined)t.specular.setHex(e.specular);if(e.shininess!==undefined)t.shininess=e.shininess;if(e.uniforms!==undefined)t.uniforms=e.uniforms;if(e.vertexShader!==undefined)t.vertexShader=e.vertexShader;if(e.fragmentShader!==undefined)t.fragmentShader=e.fragmentShader;if(e.vertexColors!==undefined)t.vertexColors=e.vertexColors;if(e.shading!==undefined)t.shading=e.shading;if(e.blending!==undefined)t.blending=e.blending;if(e.side!==undefined)t.side=e.side;if(e.opacity!==undefined)t.opacity=e.opacity;if(e.transparent!==undefined)t.transparent=e.transparent;if(e.alphaTest!==undefined)t.alphaTest=e.alphaTest;if(e.depthTest!==undefined)t.depthTest=e.depthTest;if(e.depthWrite!==undefined)t.depthWrite=e.depthWrite;if(e.wireframe!==undefined)t.wireframe=e.wireframe;if(e.wireframeLinewidth!==undefined)t.wireframeLinewidth=e.wireframeLinewidth;if(e.size!==undefined)t.size=e.size;if(e.sizeAttenuation!==undefined)t.sizeAttenuation=e.sizeAttenuation;if(e.map!==undefined)t.map=this.getTexture(e.map);if(e.alphaMap!==undefined){t.alphaMap=this.getTexture(e.alphaMap);t.transparent=true}if(e.bumpMap!==undefined)t.bumpMap=this.getTexture(e.bumpMap);if(e.bumpScale!==undefined)t.bumpScale=e.bumpScale;if(e.normalMap!==undefined)t.normalMap=this.getTexture(e.normalMap);if(e.normalScale)t.normalScale=new THREE.Vector2(e.normalScale,e.normalScale);if(e.displacementMap!==undefined)t.displacementMap=this.getTexture(e.displacementMap);if(e.displacementScale!==undefined)t.displacementScale=e.displacementScale;if(e.displacementBias!==undefined)t.displacementBias=e.displacementBias;if(e.specularMap!==undefined)t.specularMap=this.getTexture(e.specularMap);if(e.envMap!==undefined){t.envMap=this.getTexture(e.envMap);t.combine=THREE.MultiplyOperation}if(e.reflectivity)t.reflectivity=e.reflectivity;if(e.lightMap!==undefined)t.lightMap=this.getTexture(e.lightMap);if(e.lightMapIntensity!==undefined)t.lightMapIntensity=e.lightMapIntensity;if(e.aoMap!==undefined)t.aoMap=this.getTexture(e.aoMap);if(e.aoMapIntensity!==undefined)t.aoMapIntensity=e.aoMapIntensity;if(e.materials!==undefined){for(var r=0,i=e.materials.length;r<i;r++){t.materials.push(this.parse(e.materials[r]))}}return t}};THREE.ObjectLoader=function(e){this.manager=e!==undefined?e:THREE.DefaultLoadingManager;this.texturePath=""};THREE.ObjectLoader.prototype={constructor:THREE.ObjectLoader,load:function(e,t,r,i){if(this.texturePath===""){this.texturePath=e.substring(0,e.lastIndexOf("/")+1)}var n=this;var a=new THREE.XHRLoader(n.manager);a.setCrossOrigin(this.crossOrigin);a.load(e,function(e){n.parse(JSON.parse(e),t)},r,i)},setTexturePath:function(e){this.texturePath=e},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e,t){var r=this.parseGeometries(e.geometries);var i=this.parseImages(e.images,function(){if(t!==undefined)t(o)});var n=this.parseTextures(e.textures,i);var a=this.parseMaterials(e.materials,n);var o=this.parseObject(e.object,r,a);if(e.animations){o.animations=this.parseAnimations(e.animations)}if(e.images===undefined||e.images.length===0){if(t!==undefined)t(o)}return o},parseGeometries:function(e){var t={};if(e!==undefined){var r=new THREE.JSONLoader;var i=new THREE.BufferGeometryLoader;for(var n=0,a=e.length;n<a;n++){var o;var s=e[n];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":o=new THREE[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"CubeGeometry":o=new THREE.BoxGeometry(s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleBufferGeometry":o=new THREE.CircleBufferGeometry(s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CircleGeometry":o=new THREE.CircleGeometry(s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":o=new THREE.CylinderGeometry(s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":o=new THREE.SphereGeometry(s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"SphereBufferGeometry":o=new THREE.SphereBufferGeometry(s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":o=new THREE.DodecahedronGeometry(s.radius,s.detail);break;case"IcosahedronGeometry":o=new THREE.IcosahedronGeometry(s.radius,s.detail);break;case"OctahedronGeometry":o=new THREE.OctahedronGeometry(s.radius,s.detail);break;case"TetrahedronGeometry":o=new THREE.TetrahedronGeometry(s.radius,s.detail);break;case"RingGeometry":o=new THREE.RingGeometry(s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":o=new THREE.TorusGeometry(s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":o=new THREE.TorusKnotGeometry(s.radius,s.tube,s.radialSegments,s.tubularSegments,s.p,s.q,s.heightScale);break;case"BufferGeometry":o=i.parse(s);break;case"Geometry":o=r.parse(s.data,this.texturePath).geometry;break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}o.uuid=s.uuid;if(s.name!==undefined)o.name=s.name;t[s.uuid]=o}}return t},parseMaterials:function(e,t){var r={};if(e!==undefined){var i=new THREE.MaterialLoader;i.setTextures(t);for(var n=0,a=e.length;n<a;n++){var o=i.parse(e[n]);r[o.uuid]=o}}return r},parseAnimations:function(e){var t=[];for(var r=0;r<e.length;r++){var i=THREE.AnimationClip.parse(e[r]);t.push(i)}return t},parseImages:function(e,t){var r=this;var i={};function n(e){r.manager.itemStart(e);return o.load(e,function(){r.manager.itemEnd(e)})}if(e!==undefined&&e.length>0){var a=new THREE.LoadingManager(t);var o=new THREE.ImageLoader(a);o.setCrossOrigin(this.crossOrigin);for(var s=0,h=e.length;s<h;s++){var u=e[s];var c=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(u.url)?u.url:r.texturePath+u.url;i[u.uuid]=n(c)}}return i},parseTextures:function(e,t){function r(e){if(typeof e==="number")return e;console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e);return THREE[e]}var i={};if(e!==undefined){for(var n=0,a=e.length;n<a;n++){var o=e[n];if(o.image===undefined){console.warn('THREE.ObjectLoader: No "image" specified for',o.uuid)}if(t[o.image]===undefined){console.warn("THREE.ObjectLoader: Undefined image",o.image)}var s=new THREE.Texture(t[o.image]);s.needsUpdate=true;s.uuid=o.uuid;if(o.name!==undefined)s.name=o.name;if(o.mapping!==undefined)s.mapping=r(o.mapping);if(o.offset!==undefined)s.offset=new THREE.Vector2(o.offset[0],o.offset[1]);if(o.repeat!==undefined)s.repeat=new THREE.Vector2(o.repeat[0],o.repeat[1]);if(o.minFilter!==undefined)s.minFilter=r(o.minFilter);if(o.magFilter!==undefined)s.magFilter=r(o.magFilter);if(o.anisotropy!==undefined)s.anisotropy=o.anisotropy;if(Array.isArray(o.wrap)){s.wrapS=r(o.wrap[0]);s.wrapT=r(o.wrap[1])}i[o.uuid]=s}}return i},parseObject:function(){var e=new THREE.Matrix4;return function(t,r,i){var n;function a(e){if(r[e]===undefined){console.warn("THREE.ObjectLoader: Undefined geometry",e)}return r[e]}function o(e){if(e===undefined)return undefined;if(i[e]===undefined){console.warn("THREE.ObjectLoader: Undefined material",e)}return i[e]}switch(t.type){case"Scene":n=new THREE.Scene;break;case"PerspectiveCamera":n=new THREE.PerspectiveCamera(t.fov,t.aspect,t.near,t.far);break;case"OrthographicCamera":n=new THREE.OrthographicCamera(t.left,t.right,t.top,t.bottom,t.near,t.far);break;case"AmbientLight":n=new THREE.AmbientLight(t.color);break;case"DirectionalLight":n=new THREE.DirectionalLight(t.color,t.intensity);break;case"PointLight":n=new THREE.PointLight(t.color,t.intensity,t.distance,t.decay);break;case"SpotLight":n=new THREE.SpotLight(t.color,t.intensity,t.distance,t.angle,t.exponent,t.decay);break;case"HemisphereLight":n=new THREE.HemisphereLight(t.color,t.groundColor,t.intensity);break;case"Mesh":n=new THREE.Mesh(a(t.geometry),o(t.material));break;case"LOD":n=new THREE.LOD;break;case"Line":n=new THREE.Line(a(t.geometry),o(t.material),t.mode);break;case"PointCloud":case"Points":n=new THREE.Points(a(t.geometry),o(t.material));break;case"Sprite":n=new THREE.Sprite(o(t.material));break;case"Group":n=new THREE.Group;break;default:n=new THREE.Object3D}n.uuid=t.uuid;if(t.name!==undefined)n.name=t.name;if(t.matrix!==undefined){e.fromArray(t.matrix);e.decompose(n.position,n.quaternion,n.scale)}else{if(t.position!==undefined)n.position.fromArray(t.position);if(t.rotation!==undefined)n.rotation.fromArray(t.rotation);if(t.scale!==undefined)n.scale.fromArray(t.scale)}if(t.castShadow!==undefined)n.castShadow=t.castShadow;if(t.receiveShadow!==undefined)n.receiveShadow=t.receiveShadow;if(t.visible!==undefined)n.visible=t.visible;if(t.userData!==undefined)n.userData=t.userData;if(t.children!==undefined){for(var s in t.children){n.add(this.parseObject(t.children[s],r,i))}}if(t.type==="LOD"){var h=t.levels;for(var u=0;u<h.length;u++){var c=h[u];var s=n.getObjectByProperty("uuid",c.object);if(s!==undefined){n.addLevel(s,c.distance)}}}return n}}()};THREE.TextureLoader=function(e){this.manager=e!==undefined?e:THREE.DefaultLoadingManager};THREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(e,t,r,i){var n=new THREE.Texture;var a=new THREE.ImageLoader(this.manager);a.setCrossOrigin(this.crossOrigin);a.load(e,function(e){n.image=e;n.needsUpdate=true;if(t!==undefined){t(n)}},r,i);return n},setCrossOrigin:function(e){this.crossOrigin=e}};THREE.CubeTextureLoader=function(e){this.manager=e!==undefined?e:THREE.DefaultLoadingManager};THREE.CubeTextureLoader.prototype={constructor:THREE.CubeTextureLoader,load:function(e,t,r,i){var n=new THREE.CubeTexture([]);var a=new THREE.ImageLoader;a.setCrossOrigin(this.crossOrigin);var o=0;function s(r){a.load(e[r],function(e){n.images[r]=e;o++;if(o===6){n.needsUpdate=true;if(t)t(n)}},undefined,i)}for(var h=0;h<e.length;++h){s(h)}return n},setCrossOrigin:function(e){this.crossOrigin=e}};THREE.DataTextureLoader=THREE.BinaryTextureLoader=function(e){this.manager=e!==undefined?e:THREE.DefaultLoadingManager;this._parser=null};THREE.BinaryTextureLoader.prototype={constructor:THREE.BinaryTextureLoader,load:function(e,t,r,i){var n=this;var a=new THREE.DataTexture;var o=new THREE.XHRLoader(this.manager);o.setCrossOrigin(this.crossOrigin);o.setResponseType("arraybuffer");o.load(e,function(e){var r=n._parser(e);if(!r)return;if(undefined!==r.image){a.image=r.image}else if(undefined!==r.data){a.image.width=r.width;a.image.height=r.height;a.image.data=r.data}a.wrapS=undefined!==r.wrapS?r.wrapS:THREE.ClampToEdgeWrapping;a.wrapT=undefined!==r.wrapT?r.wrapT:THREE.ClampToEdgeWrapping;a.magFilter=undefined!==r.magFilter?r.magFilter:THREE.LinearFilter;a.minFilter=undefined!==r.minFilter?r.minFilter:THREE.LinearMipMapLinearFilter;a.anisotropy=undefined!==r.anisotropy?r.anisotropy:1;if(undefined!==r.format){a.format=r.format}if(undefined!==r.type){a.type=r.type}if(undefined!==r.mipmaps){a.mipmaps=r.mipmaps}if(1===r.mipmapCount){a.minFilter=THREE.LinearFilter}a.needsUpdate=true;if(t)t(a,r)},r,i);return a},setCrossOrigin:function(e){this.crossOrigin=e}};THREE.CompressedTextureLoader=function(e){this.manager=e!==undefined?e:THREE.DefaultLoadingManager;this._parser=null};THREE.CompressedTextureLoader.prototype={constructor:THREE.CompressedTextureLoader,load:function(e,t,r,i){var n=this;var a=[];var o=new THREE.CompressedTexture;o.image=a;var s=new THREE.XHRLoader(this.manager);s.setCrossOrigin(this.crossOrigin);s.setResponseType("arraybuffer");if(Array.isArray(e)){var h=0;var u=function(u){s.load(e[u],function(e){var r=n._parser(e,true);a[u]={width:r.width,height:r.height,format:r.format,mipmaps:r.mipmaps};h+=1;if(h===6){if(r.mipmapCount===1)o.minFilter=THREE.LinearFilter;o.format=r.format;o.needsUpdate=true;if(t)t(o)}},r,i)};for(var c=0,l=e.length;c<l;++c){u(c)}}else{s.load(e,function(e){var r=n._parser(e,true);if(r.isCubemap){var i=r.mipmaps.length/r.mipmapCount;for(var s=0;s<i;s++){a[s]={mipmaps:[]};for(var h=0;h<r.mipmapCount;h++){a[s].mipmaps.push(r.mipmaps[s*r.mipmapCount+h]);a[s].format=r.format;a[s].width=r.width;a[s].height=r.height}}}else{o.image.width=r.width;o.image.height=r.height;o.mipmaps=r.mipmaps}if(r.mipmapCount===1){o.minFilter=THREE.LinearFilter}o.format=r.format;o.needsUpdate=true;if(t)t(o)},r,i)}return o},setCrossOrigin:function(e){this.crossOrigin=e}};THREE.Material=function(){Object.defineProperty(this,"id",{value:THREE.MaterialIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="Material";this.side=THREE.FrontSide;this.opacity=1;this.transparent=false;this.blending=THREE.NormalBlending;this.blendSrc=THREE.SrcAlphaFactor;this.blendDst=THREE.OneMinusSrcAlphaFactor;this.blendEquation=THREE.AddEquation;this.blendSrcAlpha=null;this.blendDstAlpha=null;this.blendEquationAlpha=null;this.depthFunc=THREE.LessEqualDepth;this.depthTest=true;this.depthWrite=true;this.colorWrite=true;this.precision=null;this.polygonOffset=false;this.polygonOffsetFactor=0;this.polygonOffsetUnits=0;this.alphaTest=0;this.overdraw=0;this.visible=true;this._needsUpdate=true};THREE.Material.prototype={constructor:THREE.Material,get needsUpdate(){return this._needsUpdate},set needsUpdate(e){if(e===true)this.update();this._needsUpdate=e},setValues:function(e){if(e===undefined)return;for(var t in e){var r=e[t];if(r===undefined){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}var i=this[t];if(i===undefined){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");continue}if(i instanceof THREE.Color){i.set(r)}else if(i instanceof THREE.Vector3&&r instanceof THREE.Vector3){i.copy(r)}else if(t==="overdraw"){this[t]=Number(r)}else{this[t]=r}}},toJSON:function(e){var t={metadata:{version:4.4,type:"Material",generator:"Material.toJSON"}};t.uuid=this.uuid;t.type=this.type;if(this.name!=="")t.name=this.name;if(this.color instanceof THREE.Color)t.color=this.color.getHex();if(this.emissive instanceof THREE.Color)t.emissive=this.emissive.getHex();if(this.specular instanceof THREE.Color)t.specular=this.specular.getHex();if(this.shininess!==undefined)t.shininess=this.shininess;if(this.map instanceof THREE.Texture)t.map=this.map.toJSON(e).uuid;if(this.alphaMap instanceof THREE.Texture)t.alphaMap=this.alphaMap.toJSON(e).uuid;if(this.lightMap instanceof THREE.Texture)t.lightMap=this.lightMap.toJSON(e).uuid;if(this.bumpMap instanceof THREE.Texture){t.bumpMap=this.bumpMap.toJSON(e).uuid;t.bumpScale=this.bumpScale}if(this.normalMap instanceof THREE.Texture){t.normalMap=this.normalMap.toJSON(e).uuid;t.normalScale=this.normalScale}if(this.displacementMap instanceof THREE.Texture){t.displacementMap=this.displacementMap.toJSON(e).uuid;t.displacementScale=this.displacementScale;t.displacementBias=this.displacementBias}if(this.specularMap instanceof THREE.Texture)t.specularMap=this.specularMap.toJSON(e).uuid;if(this.envMap instanceof THREE.Texture){t.envMap=this.envMap.toJSON(e).uuid;t.reflectivity=this.reflectivity}if(this.size!==undefined)t.size=this.size;if(this.sizeAttenuation!==undefined)t.sizeAttenuation=this.sizeAttenuation;if(this.vertexColors!==undefined&&this.vertexColors!==THREE.NoColors)t.vertexColors=this.vertexColors;if(this.shading!==undefined&&this.shading!==THREE.SmoothShading)t.shading=this.shading;if(this.blending!==undefined&&this.blending!==THREE.NormalBlending)t.blending=this.blending;if(this.side!==undefined&&this.side!==THREE.FrontSide)t.side=this.side;if(this.opacity<1)t.opacity=this.opacity;if(this.transparent===true)t.transparent=this.transparent;if(this.alphaTest>0)t.alphaTest=this.alphaTest;if(this.wireframe===true)t.wireframe=this.wireframe;if(this.wireframeLinewidth>1)t.wireframeLinewidth=this.wireframeLinewidth;return t},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name;this.side=e.side;this.opacity=e.opacity;this.transparent=e.transparent;this.blending=e.blending;this.blendSrc=e.blendSrc;this.blendDst=e.blendDst;this.blendEquation=e.blendEquation;this.blendSrcAlpha=e.blendSrcAlpha;this.blendDstAlpha=e.blendDstAlpha;this.blendEquationAlpha=e.blendEquationAlpha;this.depthFunc=e.depthFunc;this.depthTest=e.depthTest;this.depthWrite=e.depthWrite;this.precision=e.precision;this.polygonOffset=e.polygonOffset;this.polygonOffsetFactor=e.polygonOffsetFactor;this.polygonOffsetUnits=e.polygonOffsetUnits;this.alphaTest=e.alphaTest;this.overdraw=e.overdraw;this.visible=e.visible;return this},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})},get wrapAround(){console.warn("THREE."+this.type+": .wrapAround has been removed.")},set wrapAround(e){console.warn("THREE."+this.type+": .wrapAround has been removed.")},get wrapRGB(){console.warn("THREE."+this.type+": .wrapRGB has been removed.");return new THREE.Color}};THREE.EventDispatcher.prototype.apply(THREE.Material.prototype);THREE.MaterialIdCount=0;THREE.LineBasicMaterial=function(e){THREE.Material.call(this);this.type="LineBasicMaterial";this.color=new THREE.Color(16777215);this.linewidth=1;this.linecap="round";this.linejoin="round";this.vertexColors=THREE.NoColors;this.fog=true;this.setValues(e)};THREE.LineBasicMaterial.prototype=Object.create(THREE.Material.prototype);THREE.LineBasicMaterial.prototype.constructor=THREE.LineBasicMaterial;THREE.LineBasicMaterial.prototype.copy=function(e){THREE.Material.prototype.copy.call(this,e);this.color.copy(e.color);this.linewidth=e.linewidth;this.linecap=e.linecap;this.linejoin=e.linejoin;this.vertexColors=e.vertexColors;this.fog=e.fog;return this};THREE.LineDashedMaterial=function(e){THREE.Material.call(this);this.type="LineDashedMaterial";this.color=new THREE.Color(16777215);this.linewidth=1;this.scale=1;this.dashSize=3;this.gapSize=1;this.vertexColors=false;this.fog=true;this.setValues(e)};THREE.LineDashedMaterial.prototype=Object.create(THREE.Material.prototype);THREE.LineDashedMaterial.prototype.constructor=THREE.LineDashedMaterial;THREE.LineDashedMaterial.prototype.copy=function(e){THREE.Material.prototype.copy.call(this,e);this.color.copy(e.color);this.linewidth=e.linewidth;this.scale=e.scale;this.dashSize=e.dashSize;this.gapSize=e.gapSize;this.vertexColors=e.vertexColors;this.fog=e.fog;return this};THREE.MeshBasicMaterial=function(e){THREE.Material.call(this);this.type="MeshBasicMaterial";this.color=new THREE.Color(16777215);this.map=null;this.aoMap=null;this.aoMapIntensity=1;this.specularMap=null;this.alphaMap=null;this.envMap=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=.98;this.fog=true;this.shading=THREE.SmoothShading;this.wireframe=false;this.wireframeLinewidth=1;this.wireframeLinecap="round";this.wireframeLinejoin="round";this.vertexColors=THREE.NoColors;this.skinning=false;this.morphTargets=false;this.setValues(e)};THREE.MeshBasicMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshBasicMaterial.prototype.constructor=THREE.MeshBasicMaterial;THREE.MeshBasicMaterial.prototype.copy=function(e){THREE.Material.prototype.copy.call(this,e);this.color.copy(e.color);this.map=e.map;this.aoMap=e.aoMap;this.aoMapIntensity=e.aoMapIntensity;this.specularMap=e.specularMap;this.alphaMap=e.alphaMap;this.envMap=e.envMap;this.combine=e.combine;this.reflectivity=e.reflectivity;this.refractionRatio=e.refractionRatio;this.fog=e.fog;this.shading=e.shading;this.wireframe=e.wireframe;this.wireframeLinewidth=e.wireframeLinewidth;this.wireframeLinecap=e.wireframeLinecap;this.wireframeLinejoin=e.wireframeLinejoin;this.vertexColors=e.vertexColors;this.skinning=e.skinning;this.morphTargets=e.morphTargets;return this};THREE.MeshLambertMaterial=function(e){THREE.Material.call(this);this.type="MeshLambertMaterial";this.color=new THREE.Color(16777215);this.emissive=new THREE.Color(0);this.map=null;this.specularMap=null;this.alphaMap=null;this.envMap=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=.98;this.fog=true;this.wireframe=false;this.wireframeLinewidth=1;this.wireframeLinecap="round";this.wireframeLinejoin="round";this.vertexColors=THREE.NoColors;this.skinning=false;this.morphTargets=false;this.morphNormals=false;this.setValues(e)};THREE.MeshLambertMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshLambertMaterial.prototype.constructor=THREE.MeshLambertMaterial;THREE.MeshLambertMaterial.prototype.copy=function(e){THREE.Material.prototype.copy.call(this,e);this.color.copy(e.color);this.emissive.copy(e.emissive);this.map=e.map;this.specularMap=e.specularMap;this.alphaMap=e.alphaMap;this.envMap=e.envMap;this.combine=e.combine;this.reflectivity=e.reflectivity;this.refractionRatio=e.refractionRatio;this.fog=e.fog;this.wireframe=e.wireframe;this.wireframeLinewidth=e.wireframeLinewidth;this.wireframeLinecap=e.wireframeLinecap;this.wireframeLinejoin=e.wireframeLinejoin;this.vertexColors=e.vertexColors;this.skinning=e.skinning;this.morphTargets=e.morphTargets;this.morphNormals=e.morphNormals;return this};THREE.MeshPhongMaterial=function(e){THREE.Material.call(this);this.type="MeshPhongMaterial";this.color=new THREE.Color(16777215);this.emissive=new THREE.Color(0);this.specular=new THREE.Color(1118481);this.shininess=30;this.metal=false;this.map=null;this.lightMap=null;this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=1;this.emissiveMap=null;this.bumpMap=null;this.bumpScale=1;this.normalMap=null;this.normalScale=new THREE.Vector2(1,1);this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.specularMap=null;this.alphaMap=null;this.envMap=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=.98;this.fog=true;this.shading=THREE.SmoothShading;this.wireframe=false;this.wireframeLinewidth=1;this.wireframeLinecap="round";this.wireframeLinejoin="round";this.vertexColors=THREE.NoColors;this.skinning=false;this.morphTargets=false;this.morphNormals=false;this.setValues(e)};THREE.MeshPhongMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshPhongMaterial.prototype.constructor=THREE.MeshPhongMaterial;THREE.MeshPhongMaterial.prototype.copy=function(e){THREE.Material.prototype.copy.call(this,e);this.color.copy(e.color);this.emissive.copy(e.emissive);this.specular.copy(e.specular);this.shininess=e.shininess;this.metal=e.metal;this.map=e.map;this.lightMap=e.lightMap;this.lightMapIntensity=e.lightMapIntensity;this.aoMap=e.aoMap;this.aoMapIntensity=e.aoMapIntensity;this.emissiveMap=e.emissiveMap;this.bumpMap=e.bumpMap;this.bumpScale=e.bumpScale;this.normalMap=e.normalMap;this.normalScale.copy(e.normalScale);this.displacementMap=e.displacementMap;
this.displacementScale=e.displacementScale;this.displacementBias=e.displacementBias;this.specularMap=e.specularMap;this.alphaMap=e.alphaMap;this.envMap=e.envMap;this.combine=e.combine;this.reflectivity=e.reflectivity;this.refractionRatio=e.refractionRatio;this.fog=e.fog;this.shading=e.shading;this.wireframe=e.wireframe;this.wireframeLinewidth=e.wireframeLinewidth;this.wireframeLinecap=e.wireframeLinecap;this.wireframeLinejoin=e.wireframeLinejoin;this.vertexColors=e.vertexColors;this.skinning=e.skinning;this.morphTargets=e.morphTargets;this.morphNormals=e.morphNormals;return this};THREE.MeshDepthMaterial=function(e){THREE.Material.call(this);this.type="MeshDepthMaterial";this.morphTargets=false;this.wireframe=false;this.wireframeLinewidth=1;this.setValues(e)};THREE.MeshDepthMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshDepthMaterial.prototype.constructor=THREE.MeshDepthMaterial;THREE.MeshDepthMaterial.prototype.copy=function(e){THREE.Material.prototype.copy.call(this,e);this.wireframe=e.wireframe;this.wireframeLinewidth=e.wireframeLinewidth;return this};THREE.MeshNormalMaterial=function(e){THREE.Material.call(this,e);this.type="MeshNormalMaterial";this.wireframe=false;this.wireframeLinewidth=1;this.morphTargets=false;this.setValues(e)};THREE.MeshNormalMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshNormalMaterial.prototype.constructor=THREE.MeshNormalMaterial;THREE.MeshNormalMaterial.prototype.copy=function(e){THREE.Material.prototype.copy.call(this,e);this.wireframe=e.wireframe;this.wireframeLinewidth=e.wireframeLinewidth;return this};THREE.MultiMaterial=function(e){this.uuid=THREE.Math.generateUUID();this.type="MultiMaterial";this.materials=e instanceof Array?e:[];this.visible=true};THREE.MultiMaterial.prototype={constructor:THREE.MultiMaterial,toJSON:function(){var e={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type,materials:[]};for(var t=0,r=this.materials.length;t<r;t++){e.materials.push(this.materials[t].toJSON())}e.visible=this.visible;return e},clone:function(){var e=new this.constructor;for(var t=0;t<this.materials.length;t++){e.materials.push(this.materials[t].clone())}e.visible=this.visible;return e}};THREE.MeshFaceMaterial=THREE.MultiMaterial;THREE.PointsMaterial=function(e){THREE.Material.call(this);this.type="PointsMaterial";this.color=new THREE.Color(16777215);this.map=null;this.size=1;this.sizeAttenuation=true;this.vertexColors=THREE.NoColors;this.fog=true;this.setValues(e)};THREE.PointsMaterial.prototype=Object.create(THREE.Material.prototype);THREE.PointsMaterial.prototype.constructor=THREE.PointsMaterial;THREE.PointsMaterial.prototype.copy=function(e){THREE.Material.prototype.copy.call(this,e);this.color.copy(e.color);this.map=e.map;this.size=e.size;this.sizeAttenuation=e.sizeAttenuation;this.vertexColors=e.vertexColors;this.fog=e.fog;return this};THREE.PointCloudMaterial=function(e){console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.");return new THREE.PointsMaterial(e)};THREE.ParticleBasicMaterial=function(e){console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.");return new THREE.PointsMaterial(e)};THREE.ParticleSystemMaterial=function(e){console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.");return new THREE.PointsMaterial(e)};THREE.ShaderMaterial=function(e){THREE.Material.call(this);this.type="ShaderMaterial";this.defines={};this.uniforms={};this.vertexShader="void main() {\n	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}";this.fragmentShader="void main() {\n	gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";this.shading=THREE.SmoothShading;this.linewidth=1;this.wireframe=false;this.wireframeLinewidth=1;this.fog=false;this.lights=false;this.vertexColors=THREE.NoColors;this.skinning=false;this.morphTargets=false;this.morphNormals=false;this.derivatives=false;this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]};this.index0AttributeName=undefined;if(e!==undefined){if(e.attributes!==undefined){console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead.")}this.setValues(e)}};THREE.ShaderMaterial.prototype=Object.create(THREE.Material.prototype);THREE.ShaderMaterial.prototype.constructor=THREE.ShaderMaterial;THREE.ShaderMaterial.prototype.copy=function(e){THREE.Material.prototype.copy.call(this,e);this.fragmentShader=e.fragmentShader;this.vertexShader=e.vertexShader;this.uniforms=THREE.UniformsUtils.clone(e.uniforms);this.attributes=e.attributes;this.defines=e.defines;this.shading=e.shading;this.wireframe=e.wireframe;this.wireframeLinewidth=e.wireframeLinewidth;this.fog=e.fog;this.lights=e.lights;this.vertexColors=e.vertexColors;this.skinning=e.skinning;this.morphTargets=e.morphTargets;this.morphNormals=e.morphNormals;this.derivatives=e.derivatives;return this};THREE.ShaderMaterial.prototype.toJSON=function(e){var t=THREE.Material.prototype.toJSON.call(this,e);t.uniforms=this.uniforms;t.attributes=this.attributes;t.vertexShader=this.vertexShader;t.fragmentShader=this.fragmentShader;return t};THREE.RawShaderMaterial=function(e){THREE.ShaderMaterial.call(this,e);this.type="RawShaderMaterial"};THREE.RawShaderMaterial.prototype=Object.create(THREE.ShaderMaterial.prototype);THREE.RawShaderMaterial.prototype.constructor=THREE.RawShaderMaterial;THREE.SpriteMaterial=function(e){THREE.Material.call(this);this.type="SpriteMaterial";this.color=new THREE.Color(16777215);this.map=null;this.rotation=0;this.fog=false;this.setValues(e)};THREE.SpriteMaterial.prototype=Object.create(THREE.Material.prototype);THREE.SpriteMaterial.prototype.constructor=THREE.SpriteMaterial;THREE.SpriteMaterial.prototype.copy=function(e){THREE.Material.prototype.copy.call(this,e);this.color.copy(e.color);this.map=e.map;this.rotation=e.rotation;this.fog=e.fog;return this};THREE.Texture=function(e,t,r,i,n,a,o,s,h){Object.defineProperty(this,"id",{value:THREE.TextureIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.sourceFile="";this.image=e!==undefined?e:THREE.Texture.DEFAULT_IMAGE;this.mipmaps=[];this.mapping=t!==undefined?t:THREE.Texture.DEFAULT_MAPPING;this.wrapS=r!==undefined?r:THREE.ClampToEdgeWrapping;this.wrapT=i!==undefined?i:THREE.ClampToEdgeWrapping;this.magFilter=n!==undefined?n:THREE.LinearFilter;this.minFilter=a!==undefined?a:THREE.LinearMipMapLinearFilter;this.anisotropy=h!==undefined?h:1;this.format=o!==undefined?o:THREE.RGBAFormat;this.type=s!==undefined?s:THREE.UnsignedByteType;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.generateMipmaps=true;this.premultiplyAlpha=false;this.flipY=true;this.unpackAlignment=4;this.version=0;this.onUpdate=null};THREE.Texture.DEFAULT_IMAGE=undefined;THREE.Texture.DEFAULT_MAPPING=THREE.UVMapping;THREE.Texture.prototype={constructor:THREE.Texture,set needsUpdate(e){if(e===true)this.version++},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.image=e.image;this.mipmaps=e.mipmaps.slice(0);this.mapping=e.mapping;this.wrapS=e.wrapS;this.wrapT=e.wrapT;this.magFilter=e.magFilter;this.minFilter=e.minFilter;this.anisotropy=e.anisotropy;this.format=e.format;this.type=e.type;this.offset.copy(e.offset);this.repeat.copy(e.repeat);this.generateMipmaps=e.generateMipmaps;this.premultiplyAlpha=e.premultiplyAlpha;this.flipY=e.flipY;this.unpackAlignment=e.unpackAlignment;return this},toJSON:function(e){if(e.textures[this.uuid]!==undefined){return e.textures[this.uuid]}function t(e){var t;if(e.toDataURL!==undefined){t=e}else{t=document.createElement("canvas");t.width=e.width;t.height=e.height;t.getContext("2d").drawImage(e,0,0,e.width,e.height)}if(t.width>2048||t.height>2048){return t.toDataURL("image/jpeg",.6)}else{return t.toDataURL("image/png")}}var r={metadata:{version:4.4,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],wrap:[this.wrapS,this.wrapT],minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy};if(this.image!==undefined){var i=this.image;if(i.uuid===undefined){i.uuid=THREE.Math.generateUUID()}if(e.images[i.uuid]===undefined){e.images[i.uuid]={uuid:i.uuid,url:t(i)}}r.image=i.uuid}e.textures[this.uuid]=r;return r},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(this.mapping!==THREE.UVMapping)return;e.multiply(this.repeat);e.add(this.offset);if(e.x<0||e.x>1){switch(this.wrapS){case THREE.RepeatWrapping:e.x=e.x-Math.floor(e.x);break;case THREE.ClampToEdgeWrapping:e.x=e.x<0?0:1;break;case THREE.MirroredRepeatWrapping:if(Math.abs(Math.floor(e.x)%2)===1){e.x=Math.ceil(e.x)-e.x}else{e.x=e.x-Math.floor(e.x)}break}}if(e.y<0||e.y>1){switch(this.wrapT){case THREE.RepeatWrapping:e.y=e.y-Math.floor(e.y);break;case THREE.ClampToEdgeWrapping:e.y=e.y<0?0:1;break;case THREE.MirroredRepeatWrapping:if(Math.abs(Math.floor(e.y)%2)===1){e.y=Math.ceil(e.y)-e.y}else{e.y=e.y-Math.floor(e.y)}break}}if(this.flipY){e.y=1-e.y}}};THREE.EventDispatcher.prototype.apply(THREE.Texture.prototype);THREE.TextureIdCount=0;THREE.CanvasTexture=function(e,t,r,i,n,a,o,s,h){THREE.Texture.call(this,e,t,r,i,n,a,o,s,h);this.needsUpdate=true};THREE.CanvasTexture.prototype=Object.create(THREE.Texture.prototype);THREE.CanvasTexture.prototype.constructor=THREE.CanvasTexture;THREE.CubeTexture=function(e,t,r,i,n,a,o,s,h){t=t!==undefined?t:THREE.CubeReflectionMapping;THREE.Texture.call(this,e,t,r,i,n,a,o,s,h);this.images=e;this.flipY=false};THREE.CubeTexture.prototype=Object.create(THREE.Texture.prototype);THREE.CubeTexture.prototype.constructor=THREE.CubeTexture;THREE.CubeTexture.prototype.copy=function(e){THREE.Texture.prototype.copy.call(this,e);this.images=e.images;return this};THREE.CompressedTexture=function(e,t,r,i,n,a,o,s,h,u,c){THREE.Texture.call(this,null,a,o,s,h,u,i,n,c);this.image={width:t,height:r};this.mipmaps=e;this.flipY=false;this.generateMipmaps=false};THREE.CompressedTexture.prototype=Object.create(THREE.Texture.prototype);THREE.CompressedTexture.prototype.constructor=THREE.CompressedTexture;THREE.DataTexture=function(e,t,r,i,n,a,o,s,h,u,c){THREE.Texture.call(this,null,a,o,s,h,u,i,n,c);this.image={data:e,width:t,height:r};this.magFilter=h!==undefined?h:THREE.NearestFilter;this.minFilter=u!==undefined?u:THREE.NearestFilter;this.flipY=false;this.generateMipmaps=false};THREE.DataTexture.prototype=Object.create(THREE.Texture.prototype);THREE.DataTexture.prototype.constructor=THREE.DataTexture;THREE.VideoTexture=function(e,t,r,i,n,a,o,s,h){THREE.Texture.call(this,e,t,r,i,n,a,o,s,h);this.generateMipmaps=false;var u=this;function c(){requestAnimationFrame(c);if(e.readyState===e.HAVE_ENOUGH_DATA){u.needsUpdate=true}}c()};THREE.VideoTexture.prototype=Object.create(THREE.Texture.prototype);THREE.VideoTexture.prototype.constructor=THREE.VideoTexture;THREE.Group=function(){THREE.Object3D.call(this);this.type="Group"};THREE.Group.prototype=Object.create(THREE.Object3D.prototype);THREE.Group.prototype.constructor=THREE.Group;THREE.Points=function(e,t){THREE.Object3D.call(this);this.type="Points";this.geometry=e!==undefined?e:new THREE.Geometry;this.material=t!==undefined?t:new THREE.PointsMaterial({color:Math.random()*16777215})};THREE.Points.prototype=Object.create(THREE.Object3D.prototype);THREE.Points.prototype.constructor=THREE.Points;THREE.Points.prototype.raycast=function(){var e=new THREE.Matrix4;var t=new THREE.Ray;return function r(i,n){var a=this;var o=a.geometry;var s=i.params.Points.threshold;e.getInverse(this.matrixWorld);t.copy(i.ray).applyMatrix4(e);if(o.boundingBox!==null){if(t.isIntersectionBox(o.boundingBox)===false){return}}var h=s/((this.scale.x+this.scale.y+this.scale.z)/3);var u=h*h;var c=new THREE.Vector3;function l(e,r){var o=t.distanceSqToPoint(e);if(o<u){var s=t.closestPointToPoint(e);s.applyMatrix4(a.matrixWorld);var h=i.ray.origin.distanceTo(s);if(h<i.near||h>i.far)return;n.push({distance:h,distanceToRay:Math.sqrt(o),point:s.clone(),index:r,face:null,object:a})}}if(o instanceof THREE.BufferGeometry){var f=o.index;var E=o.attributes;var d=E.position.array;if(f!==null){var p=f.array;for(var m=0,v=p.length;m<v;m++){var T=p[m];c.fromArray(d,T*3);l(c,T)}}else{for(var m=0,g=d.length/3;m<g;m++){c.fromArray(d,m*3);l(c,m)}}}else{var y=o.vertices;for(var m=0,g=y.length;m<g;m++){l(y[m],m)}}}}();THREE.Points.prototype.clone=function(){return new this.constructor(this.geometry,this.material).copy(this)};THREE.PointCloud=function(e,t){console.warn("THREE.PointCloud has been renamed to THREE.Points.");return new THREE.Points(e,t)};THREE.ParticleSystem=function(e,t){console.warn("THREE.ParticleSystem has been renamed to THREE.Points.");return new THREE.Points(e,t)};THREE.Line=function(e,t,r){if(r===1){console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead.");return new THREE.LineSegments(e,t)}THREE.Object3D.call(this);this.type="Line";this.geometry=e!==undefined?e:new THREE.Geometry;this.material=t!==undefined?t:new THREE.LineBasicMaterial({color:Math.random()*16777215})};THREE.Line.prototype=Object.create(THREE.Object3D.prototype);THREE.Line.prototype.constructor=THREE.Line;THREE.Line.prototype.raycast=function(){var e=new THREE.Matrix4;var t=new THREE.Ray;var r=new THREE.Sphere;return function i(n,a){var o=n.linePrecision;var s=o*o;var h=this.geometry;if(h.boundingSphere===null)h.computeBoundingSphere();r.copy(h.boundingSphere);r.applyMatrix4(this.matrixWorld);if(n.ray.isIntersectionSphere(r)===false){return}e.getInverse(this.matrixWorld);t.copy(n.ray).applyMatrix4(e);var u=new THREE.Vector3;var c=new THREE.Vector3;var l=new THREE.Vector3;var f=new THREE.Vector3;var E=this instanceof THREE.LineSegments?2:1;if(h instanceof THREE.BufferGeometry){var d=h.index;var p=h.attributes;if(d!==null){var m=d.array;var v=p.position.array;for(var T=0,g=m.length-1;T<g;T+=E){var y=m[T];var R=m[T+1];u.fromArray(v,y*3);c.fromArray(v,R*3);var H=t.distanceSqToSegment(u,c,f,l);if(H>s)continue;f.applyMatrix4(this.matrixWorld);var x=n.ray.origin.distanceTo(f);if(x<n.near||x>n.far)continue;a.push({distance:x,point:l.clone().applyMatrix4(this.matrixWorld),index:T,face:null,faceIndex:null,object:this})}}else{var v=p.position.array;for(var T=0,g=v.length/3-1;T<g;T+=E){u.fromArray(v,3*T);c.fromArray(v,3*T+3);var H=t.distanceSqToSegment(u,c,f,l);if(H>s)continue;f.applyMatrix4(this.matrixWorld);var x=n.ray.origin.distanceTo(f);if(x<n.near||x>n.far)continue;a.push({distance:x,point:l.clone().applyMatrix4(this.matrixWorld),index:T,face:null,faceIndex:null,object:this})}}}else if(h instanceof THREE.Geometry){var b=h.vertices;var w=b.length;for(var T=0;T<w-1;T+=E){var H=t.distanceSqToSegment(b[T],b[T+1],f,l);if(H>s)continue;f.applyMatrix4(this.matrixWorld);var x=n.ray.origin.distanceTo(f);if(x<n.near||x>n.far)continue;a.push({distance:x,point:l.clone().applyMatrix4(this.matrixWorld),index:T,face:null,faceIndex:null,object:this})}}}}();THREE.Line.prototype.clone=function(){return new this.constructor(this.geometry,this.material).copy(this)};THREE.LineStrip=0;THREE.LinePieces=1;THREE.LineSegments=function(e,t){THREE.Line.call(this,e,t);this.type="LineSegments"};THREE.LineSegments.prototype=Object.create(THREE.Line.prototype);THREE.LineSegments.prototype.constructor=THREE.LineSegments;THREE.Mesh=function(e,t){THREE.Object3D.call(this);this.type="Mesh";this.geometry=e!==undefined?e:new THREE.Geometry;this.material=t!==undefined?t:new THREE.MeshBasicMaterial({color:Math.random()*16777215});this.updateMorphTargets()};THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype);THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.updateMorphTargets=function(){if(this.geometry.morphTargets!==undefined&&this.geometry.morphTargets.length>0){this.morphTargetBase=-1;this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var e=0,t=this.geometry.morphTargets.length;e<t;e++){this.morphTargetInfluences.push(0);this.morphTargetDictionary[this.geometry.morphTargets[e].name]=e}}};THREE.Mesh.prototype.getMorphTargetIndexByName=function(e){if(this.morphTargetDictionary[e]!==undefined){return this.morphTargetDictionary[e]}console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target "+e+" does not exist. Returning 0.");return 0};THREE.Mesh.prototype.raycast=function(){var e=new THREE.Matrix4;var t=new THREE.Ray;var r=new THREE.Sphere;var i=new THREE.Vector3;var n=new THREE.Vector3;var a=new THREE.Vector3;var o=new THREE.Vector3;var s=new THREE.Vector3;var h=new THREE.Vector3;var u=new THREE.Vector2;var c=new THREE.Vector2;var l=new THREE.Vector2;var f=new THREE.Vector3;var E=new THREE.Vector3;var d=new THREE.Vector3;function p(e,t,r,i,n,a,o){THREE.Triangle.barycoordFromPoint(e,t,r,i,f);n.multiplyScalar(f.x);a.multiplyScalar(f.y);o.multiplyScalar(f.z);n.add(a).add(o);return n.clone()}function m(e,t,r,i,n,a,o){var s;var h=e.material;if(h.side===THREE.BackSide){s=r.intersectTriangle(a,n,i,true,o)}else{s=r.intersectTriangle(i,n,a,h.side!==THREE.DoubleSide,o)}if(s===null)return null;d.copy(o);d.applyMatrix4(e.matrixWorld);var u=t.ray.origin.distanceTo(d);if(u<t.near||u>t.far)return null;return{distance:u,point:d.clone(),object:e}}function v(e,t,r,o,s,h,f,d){i.fromArray(o,h*3);n.fromArray(o,f*3);a.fromArray(o,d*3);var v=m(e,t,r,i,n,a,E);if(v){if(s){u.fromArray(s,h*2);c.fromArray(s,f*2);l.fromArray(s,d*2);v.uv=p(E,i,n,a,u,c,l)}v.face=new THREE.Face3(h,f,d,THREE.Triangle.normal(i,n,a));v.faceIndex=h}return v}return function T(f,d){var T=this.geometry;var g=this.material;if(g===undefined)return;if(T.boundingSphere===null)T.computeBoundingSphere();var y=this.matrixWorld;r.copy(T.boundingSphere);r.applyMatrix4(y);if(f.ray.isIntersectionSphere(r)===false)return;e.getInverse(y);t.copy(f.ray).applyMatrix4(e);if(T.boundingBox!==null){if(t.isIntersectionBox(T.boundingBox)===false)return}var R,H;if(T instanceof THREE.BufferGeometry){var x,b,w;var M=T.index;var S=T.attributes;var _=S.position.array;if(S.uv!==undefined){R=S.uv.array}if(M!==null){var A=M.array;for(var C=0,L=A.length;C<L;C+=3){x=A[C];b=A[C+1];w=A[C+2];H=v(this,f,t,_,R,x,b,w);if(H){H.faceIndex=Math.floor(C/3);d.push(H)}}}else{for(var C=0,L=_.length;C<L;C+=9){x=C/3;b=x+1;w=x+2;H=v(this,f,t,_,R,x,b,w);if(H){H.index=x;d.push(H)}}}}else if(T instanceof THREE.Geometry){var P,D,k;var V=g instanceof THREE.MeshFaceMaterial;var F=V===true?g.materials:null;var U=T.vertices;var O=T.faces;var B=T.faceVertexUvs[0];if(B.length>0)R=B;for(var G=0,I=O.length;G<I;G++){var N=O[G];var z=V===true?F[N.materialIndex]:g;if(z===undefined)continue;P=U[N.a];D=U[N.b];k=U[N.c];if(z.morphTargets===true){var j=T.morphTargets;var W=this.morphTargetInfluences;i.set(0,0,0);n.set(0,0,0);a.set(0,0,0);for(var X=0,q=j.length;X<q;X++){var Y=W[X];if(Y===0)continue;var K=j[X].vertices;i.addScaledVector(o.subVectors(K[N.a],P),Y);n.addScaledVector(s.subVectors(K[N.b],D),Y);a.addScaledVector(h.subVectors(K[N.c],k),Y)}i.add(P);n.add(D);a.add(k);P=i;D=n;k=a}H=m(this,f,t,P,D,k,E);if(H){if(R){var Q=R[G];u.copy(Q[0]);c.copy(Q[1]);l.copy(Q[2]);H.uv=p(E,P,D,k,u,c,l)}H.face=N;H.faceIndex=G;d.push(H)}}}}}();THREE.Mesh.prototype.clone=function(){return new this.constructor(this.geometry,this.material).copy(this)};THREE.Bone=function(e){THREE.Object3D.call(this);this.type="Bone";this.skin=e};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.copy=function(e){THREE.Object3D.prototype.copy.call(this,e);this.skin=e.skin;return this};THREE.Skeleton=function(e,t,r){this.useVertexTexture=r!==undefined?r:true;this.identityMatrix=new THREE.Matrix4;e=e||[];this.bones=e.slice(0);if(this.useVertexTexture){var i=Math.sqrt(this.bones.length*4);i=THREE.Math.nextPowerOfTwo(Math.ceil(i));i=Math.max(i,4);this.boneTextureWidth=i;this.boneTextureHeight=i;this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4);this.boneTexture=new THREE.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,THREE.RGBAFormat,THREE.FloatType)}else{this.boneMatrices=new Float32Array(16*this.bones.length)}if(t===undefined){this.calculateInverses()}else{if(this.bones.length===t.length){this.boneInverses=t.slice(0)}else{console.warn("THREE.Skeleton bonInverses is the wrong length.");this.boneInverses=[];for(var n=0,a=this.bones.length;n<a;n++){this.boneInverses.push(new THREE.Matrix4)}}}};THREE.Skeleton.prototype.calculateInverses=function(){this.boneInverses=[];for(var e=0,t=this.bones.length;e<t;e++){var r=new THREE.Matrix4;if(this.bones[e]){r.getInverse(this.bones[e].matrixWorld)}this.boneInverses.push(r)}};THREE.Skeleton.prototype.pose=function(){var e;for(var t=0,r=this.bones.length;t<r;t++){e=this.bones[t];if(e){e.matrixWorld.getInverse(this.boneInverses[t])}}for(var t=0,r=this.bones.length;t<r;t++){e=this.bones[t];if(e){if(e.parent){e.matrix.getInverse(e.parent.matrixWorld);e.matrix.multiply(e.matrixWorld)}else{e.matrix.copy(e.matrixWorld)}e.matrix.decompose(e.position,e.quaternion,e.scale)}}};THREE.Skeleton.prototype.update=function(){var e=new THREE.Matrix4;return function t(){for(var t=0,r=this.bones.length;t<r;t++){var i=this.bones[t]?this.bones[t].matrixWorld:this.identityMatrix;e.multiplyMatrices(i,this.boneInverses[t]);e.flattenToArrayOffset(this.boneMatrices,t*16)}if(this.useVertexTexture){this.boneTexture.needsUpdate=true}}}();THREE.Skeleton.prototype.clone=function(){return new THREE.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)};THREE.SkinnedMesh=function(e,t,r){THREE.Mesh.call(this,e,t);this.type="SkinnedMesh";this.bindMode="attached";this.bindMatrix=new THREE.Matrix4;this.bindMatrixInverse=new THREE.Matrix4;var i=[];if(this.geometry&&this.geometry.bones!==undefined){var n,a;for(var o=0,s=this.geometry.bones.length;o<s;++o){a=this.geometry.bones[o];n=new THREE.Bone(this);i.push(n);n.name=a.name;n.position.fromArray(a.pos);n.quaternion.fromArray(a.rotq);if(a.scl!==undefined)n.scale.fromArray(a.scl)}for(var o=0,s=this.geometry.bones.length;o<s;++o){a=this.geometry.bones[o];if(a.parent!==-1&&a.parent!==null){i[a.parent].add(i[o])}else{this.add(i[o])}}}this.normalizeSkinWeights();this.updateMatrixWorld(true);this.bind(new THREE.Skeleton(i,undefined,r),this.matrixWorld)};THREE.SkinnedMesh.prototype=Object.create(THREE.Mesh.prototype);THREE.SkinnedMesh.prototype.constructor=THREE.SkinnedMesh;THREE.SkinnedMesh.prototype.bind=function(e,t){this.skeleton=e;if(t===undefined){this.updateMatrixWorld(true);this.skeleton.calculateInverses();t=this.matrixWorld}this.bindMatrix.copy(t);this.bindMatrixInverse.getInverse(t)};THREE.SkinnedMesh.prototype.pose=function(){this.skeleton.pose()};THREE.SkinnedMesh.prototype.normalizeSkinWeights=function(){if(this.geometry instanceof THREE.Geometry){for(var e=0;e<this.geometry.skinIndices.length;e++){var t=this.geometry.skinWeights[e];var r=1/t.lengthManhattan();if(r!==Infinity){t.multiplyScalar(r)}else{t.set(1)}}}else{}};THREE.SkinnedMesh.prototype.updateMatrixWorld=function(e){THREE.Mesh.prototype.updateMatrixWorld.call(this,true);if(this.bindMode==="attached"){this.bindMatrixInverse.getInverse(this.matrixWorld)}else if(this.bindMode==="detached"){this.bindMatrixInverse.getInverse(this.bindMatrix)}else{console.warn("THREE.SkinnedMesh unrecognized bindMode: "+this.bindMode)}};THREE.SkinnedMesh.prototype.clone=function(){return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)};THREE.LOD=function(){THREE.Object3D.call(this);this.type="LOD";Object.defineProperties(this,{levels:{enumerable:true,value:[]},objects:{get:function(){console.warn("THREE.LOD: .objects has been renamed to .levels.");return this.levels}}})};THREE.LOD.prototype=Object.create(THREE.Object3D.prototype);THREE.LOD.prototype.constructor=THREE.LOD;THREE.LOD.prototype.addLevel=function(e,t){if(t===undefined)t=0;t=Math.abs(t);var r=this.levels;for(var i=0;i<r.length;i++){if(t<r[i].distance){break}}r.splice(i,0,{distance:t,object:e});this.add(e)};THREE.LOD.prototype.getObjectForDistance=function(e){var t=this.levels;for(var r=1,i=t.length;r<i;r++){if(e<t[r].distance){break}}return t[r-1].object};THREE.LOD.prototype.raycast=function(){var e=new THREE.Vector3;return function t(r,i){e.setFromMatrixPosition(this.matrixWorld);var n=r.ray.origin.distanceTo(e);this.getObjectForDistance(n).raycast(r,i)}}();THREE.LOD.prototype.update=function(){var e=new THREE.Vector3;var t=new THREE.Vector3;return function r(i){var n=this.levels;if(n.length>1){e.setFromMatrixPosition(i.matrixWorld);t.setFromMatrixPosition(this.matrixWorld);var a=e.distanceTo(t);n[0].object.visible=true;for(var o=1,s=n.length;o<s;o++){if(a>=n[o].distance){n[o-1].object.visible=false;n[o].object.visible=true}else{break}}for(;o<s;o++){n[o].object.visible=false}}}}();THREE.LOD.prototype.copy=function(e){THREE.Object3D.prototype.copy.call(this,e,false);var t=e.levels;for(var r=0,i=t.length;r<i;r++){var n=t[r];this.addLevel(n.object.clone(),n.distance)}return this};THREE.LOD.prototype.toJSON=function(e){var t=THREE.Object3D.prototype.toJSON.call(this,e);t.object.levels=[];var r=this.levels;for(var i=0,n=r.length;i<n;i++){var a=r[i];t.object.levels.push({object:a.object.uuid,distance:a.distance})}return t};THREE.Sprite=function(){var e=new Uint16Array([0,1,2,0,2,3]);var t=new Float32Array([-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0]);var r=new Float32Array([0,0,1,0,1,1,0,1]);var i=new THREE.BufferGeometry;i.setIndex(new THREE.BufferAttribute(e,1));i.addAttribute("position",new THREE.BufferAttribute(t,3));i.addAttribute("uv",new THREE.BufferAttribute(r,2));return function n(e){THREE.Object3D.call(this);this.type="Sprite";this.geometry=i;this.material=e!==undefined?e:new THREE.SpriteMaterial}}();THREE.Sprite.prototype=Object.create(THREE.Object3D.prototype);THREE.Sprite.prototype.constructor=THREE.Sprite;THREE.Sprite.prototype.raycast=function(){var e=new THREE.Vector3;return function t(r,i){e.setFromMatrixPosition(this.matrixWorld);var n=r.ray.distanceSqToPoint(e);var a=this.scale.x*this.scale.y;if(n>a){return}i.push({distance:Math.sqrt(n),point:this.position,face:null,object:this})}}();THREE.Sprite.prototype.clone=function(){return new this.constructor(this.material).copy(this)};THREE.Particle=THREE.Sprite;THREE.LensFlare=function(e,t,r,i,n){THREE.Object3D.call(this);this.lensFlares=[];this.positionScreen=new THREE.Vector3;this.customUpdateCallback=undefined;if(e!==undefined){this.add(e,t,r,i,n)}};THREE.LensFlare.prototype=Object.create(THREE.Object3D.prototype);THREE.LensFlare.prototype.constructor=THREE.LensFlare;THREE.LensFlare.prototype.add=function(e,t,r,i,n,a){if(t===undefined)t=-1;if(r===undefined)r=0;if(a===undefined)a=1;if(n===undefined)n=new THREE.Color(16777215);if(i===undefined)i=THREE.NormalBlending;r=Math.min(r,Math.max(0,r));this.lensFlares.push({texture:e,size:t,distance:r,x:0,y:0,z:0,scale:1,rotation:0,opacity:a,color:n,blending:i})};THREE.LensFlare.prototype.updateLensFlares=function(){var e,t=this.lensFlares.length;var r;var i=-this.positionScreen.x*2;var n=-this.positionScreen.y*2;for(e=0;e<t;e++){r=this.lensFlares[e];r.x=this.positionScreen.x+i*r.distance;r.y=this.positionScreen.y+n*r.distance;r.wantedRotation=r.x*Math.PI*.25;r.rotation+=(r.wantedRotation-r.rotation)*.25}};THREE.LensFlare.prototype.copy=function(e){THREE.Object3D.prototype.copy.call(this,e);this.positionScreen.copy(e.positionScreen);this.customUpdateCallback=e.customUpdateCallback;for(var t=0,r=e.lensFlares.length;t<r;t++){this.lensFlares.push(e.lensFlares[t])}return this};THREE.Scene=function(){THREE.Object3D.call(this);this.type="Scene";this.fog=null;this.overrideMaterial=null;this.autoUpdate=true};THREE.Scene.prototype=Object.create(THREE.Object3D.prototype);THREE.Scene.prototype.constructor=THREE.Scene;THREE.Scene.prototype.copy=function(e){THREE.Object3D.prototype.copy.call(this,e);if(e.fog!==null)this.fog=e.fog.clone();if(e.overrideMaterial!==null)this.overrideMaterial=e.overrideMaterial.clone();this.autoUpdate=e.autoUpdate;this.matrixAutoUpdate=e.matrixAutoUpdate;return this};THREE.Fog=function(e,t,r){this.name="";this.color=new THREE.Color(e);this.near=t!==undefined?t:1;this.far=r!==undefined?r:1e3};THREE.Fog.prototype.clone=function(){return new THREE.Fog(this.color.getHex(),this.near,this.far)};THREE.FogExp2=function(e,t){this.name="";this.color=new THREE.Color(e);this.density=t!==undefined?t:25e-5};THREE.FogExp2.prototype.clone=function(){return new THREE.FogExp2(this.color.getHex(),this.density)};THREE.ShaderChunk={};THREE.ShaderChunk["alphamap_fragment"]="#ifdef USE_ALPHAMAP\n\n	diffuseColor.a *= texture2D( alphaMap, vUv ).g;\n\n#endif\n";THREE.ShaderChunk["alphamap_pars_fragment"]="#ifdef USE_ALPHAMAP\n\n	uniform sampler2D alphaMap;\n\n#endif\n";THREE.ShaderChunk["alphatest_fragment"]="#ifdef ALPHATEST\n\n	if ( diffuseColor.a < ALPHATEST ) discard;\n\n#endif\n";THREE.ShaderChunk["aomap_fragment"]="#ifdef USE_AOMAP\n\n	totalAmbientLight *= ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\n#endif\n";THREE.ShaderChunk["aomap_pars_fragment"]="#ifdef USE_AOMAP\n\n	uniform sampler2D aoMap;\n	uniform float aoMapIntensity;\n\n#endif";THREE.ShaderChunk["begin_vertex"]="\nvec3 transformed = vec3( position );\n";THREE.ShaderChunk["beginnormal_vertex"]="\nvec3 objectNormal = vec3( normal );\n";THREE.ShaderChunk["bumpmap_pars_fragment"]="#ifdef USE_BUMPMAP\n\n	uniform sampler2D bumpMap;\n	uniform float bumpScale;\n\n\n\n	vec2 dHdxy_fwd() {\n\n		vec2 dSTdx = dFdx( vUv );\n		vec2 dSTdy = dFdy( vUv );\n\n		float Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n		float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n		float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\n		return vec2( dBx, dBy );\n\n	}\n\n	vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\n		vec3 vSigmaX = dFdx( surf_pos );\n		vec3 vSigmaY = dFdy( surf_pos );\n		vec3 vN = surf_norm;\n		vec3 R1 = cross( vSigmaY, vN );\n		vec3 R2 = cross( vN, vSigmaX );\n\n		float fDet = dot( vSigmaX, R1 );\n\n		vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n		return normalize( abs( fDet ) * surf_norm - vGrad );\n\n	}\n\n#endif\n";THREE.ShaderChunk["color_fragment"]="#ifdef USE_COLOR\n\n	diffuseColor.rgb *= vColor;\n\n#endif";THREE.ShaderChunk["color_pars_fragment"]="#ifdef USE_COLOR\n\n	varying vec3 vColor;\n\n#endif\n";THREE.ShaderChunk["color_pars_vertex"]="#ifdef USE_COLOR\n\n	varying vec3 vColor;\n\n#endif";THREE.ShaderChunk["color_vertex"]="#ifdef USE_COLOR\n\n	vColor.xyz = color.xyz;\n\n#endif";THREE.ShaderChunk["common"]="#define PI 3.14159\n#define PI2 6.28318\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\n\nvec3 transformDirection( in vec3 normal, in mat4 matrix ) {\n\n	return normalize( ( matrix * vec4( normal, 0.0 ) ).xyz );\n\n}\n\nvec3 inverseTransformDirection( in vec3 normal, in mat4 matrix ) {\n\n	return normalize( ( vec4( normal, 0.0 ) * matrix ).xyz );\n\n}\n\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\n	float distance = dot( planeNormal, point - pointOnPlane );\n\n	return - distance * planeNormal + point;\n\n}\n\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\n	return sign( dot( point - pointOnPlane, planeNormal ) );\n\n}\n\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\n	return lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n\n}\n\nfloat calcLightAttenuation( float lightDistance, float cutoffDistance, float decayExponent ) {\n\n	if ( decayExponent > 0.0 ) {\n\n	  return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\n	}\n\n	return 1.0;\n\n}\n\nvec3 F_Schlick( in vec3 specularColor, in float dotLH ) {\n\n\n	float fresnel = exp2( ( -5.55437 * dotLH - 6.98316 ) * dotLH );\n\n	return ( 1.0 - specularColor ) * fresnel + specularColor;\n\n}\n\nfloat G_BlinnPhong_Implicit( /* in float dotNL, in float dotNV */ ) {\n\n\n	return 0.25;\n\n}\n\nfloat D_BlinnPhong( in float shininess, in float dotNH ) {\n\n\n	return ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n\n}\n\nvec3 BRDF_BlinnPhong( in vec3 specularColor, in float shininess, in vec3 normal, in vec3 lightDir, in vec3 viewDir ) {\n\n	vec3 halfDir = normalize( lightDir + viewDir );\n\n	float dotNH = saturate( dot( normal, halfDir ) );\n	float dotLH = saturate( dot( lightDir, halfDir ) );\n\n	vec3 F = F_Schlick( specularColor, dotLH );\n\n	float G = G_BlinnPhong_Implicit( /* dotNL, dotNV */ );\n\n	float D = D_BlinnPhong( shininess, dotNH );\n\n	return F * G * D;\n\n}\n\nvec3 inputToLinear( in vec3 a ) {\n\n	#ifdef GAMMA_INPUT\n\n		return pow( a, vec3( float( GAMMA_FACTOR ) ) );\n\n	#else\n\n		return a;\n\n	#endif\n\n}\n\nvec3 linearToOutput( in vec3 a ) {\n\n	#ifdef GAMMA_OUTPUT\n\n		return pow( a, vec3( 1.0 / float( GAMMA_FACTOR ) ) );\n\n	#else\n\n		return a;\n\n	#endif\n\n}\n";
THREE.ShaderChunk["defaultnormal_vertex"]="#ifdef FLIP_SIDED\n\n	objectNormal = -objectNormal;\n\n#endif\n\nvec3 transformedNormal = normalMatrix * objectNormal;\n";THREE.ShaderChunk["displacementmap_vertex"]="#ifdef USE_DISPLACEMENTMAP\n\n	transformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n\n#endif\n";THREE.ShaderChunk["displacementmap_pars_vertex"]="#ifdef USE_DISPLACEMENTMAP\n\n	uniform sampler2D displacementMap;\n	uniform float displacementScale;\n	uniform float displacementBias;\n\n#endif\n";THREE.ShaderChunk["emissivemap_fragment"]="#ifdef USE_EMISSIVEMAP\n\n	vec4 emissiveColor = texture2D( emissiveMap, vUv );\n\n	emissiveColor.rgb = inputToLinear( emissiveColor.rgb );\n\n	totalEmissiveLight *= emissiveColor.rgb;\n\n#endif\n";THREE.ShaderChunk["emissivemap_pars_fragment"]="#ifdef USE_EMISSIVEMAP\n\n	uniform sampler2D emissiveMap;\n\n#endif\n";THREE.ShaderChunk["envmap_fragment"]="#ifdef USE_ENVMAP\n\n	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n		vec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\n		vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\n		#ifdef ENVMAP_MODE_REFLECTION\n\n			vec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\n		#else\n\n			vec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\n		#endif\n\n	#else\n\n		vec3 reflectVec = vReflect;\n\n	#endif\n\n	#ifdef DOUBLE_SIDED\n		float flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n	#else\n		float flipNormal = 1.0;\n	#endif\n\n	#ifdef ENVMAP_TYPE_CUBE\n		vec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\n	#elif defined( ENVMAP_TYPE_EQUIREC )\n		vec2 sampleUV;\n		sampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n		sampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n		vec4 envColor = texture2D( envMap, sampleUV );\n\n	#elif defined( ENVMAP_TYPE_SPHERE )\n		vec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n		vec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n	#endif\n\n	envColor.xyz = inputToLinear( envColor.xyz );\n\n	#ifdef ENVMAP_BLENDING_MULTIPLY\n\n		outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\n	#elif defined( ENVMAP_BLENDING_MIX )\n\n		outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\n	#elif defined( ENVMAP_BLENDING_ADD )\n\n		outgoingLight += envColor.xyz * specularStrength * reflectivity;\n\n	#endif\n\n#endif\n";THREE.ShaderChunk["envmap_pars_fragment"]="#ifdef USE_ENVMAP\n\n	uniform float reflectivity;\n	#ifdef ENVMAP_TYPE_CUBE\n		uniform samplerCube envMap;\n	#else\n		uniform sampler2D envMap;\n	#endif\n	uniform float flipEnvMap;\n\n	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n		uniform float refractionRatio;\n\n	#else\n\n		varying vec3 vReflect;\n\n	#endif\n\n#endif\n";THREE.ShaderChunk["envmap_pars_vertex"]="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG )\n\n	varying vec3 vReflect;\n\n	uniform float refractionRatio;\n\n#endif\n";THREE.ShaderChunk["envmap_vertex"]="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG )\n\n	vec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\n	vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\n	#ifdef ENVMAP_MODE_REFLECTION\n\n		vReflect = reflect( cameraToVertex, worldNormal );\n\n	#else\n\n		vReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\n	#endif\n\n#endif\n";THREE.ShaderChunk["fog_fragment"]="#ifdef USE_FOG\n\n	#ifdef USE_LOGDEPTHBUF_EXT\n\n		float depth = gl_FragDepthEXT / gl_FragCoord.w;\n\n	#else\n\n		float depth = gl_FragCoord.z / gl_FragCoord.w;\n\n	#endif\n\n	#ifdef FOG_EXP2\n\n		float fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\n\n	#else\n\n		float fogFactor = smoothstep( fogNear, fogFar, depth );\n\n	#endif\n	\n	outgoingLight = mix( outgoingLight, fogColor, fogFactor );\n\n#endif";THREE.ShaderChunk["fog_pars_fragment"]="#ifdef USE_FOG\n\n	uniform vec3 fogColor;\n\n	#ifdef FOG_EXP2\n\n		uniform float fogDensity;\n\n	#else\n\n		uniform float fogNear;\n		uniform float fogFar;\n	#endif\n\n#endif";THREE.ShaderChunk["hemilight_fragment"]="#if MAX_HEMI_LIGHTS > 0\n\n	for ( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n		vec3 lightDir = hemisphereLightDirection[ i ];\n\n		float dotProduct = dot( normal, lightDir );\n\n		float hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\n		vec3 lightColor = mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n		totalAmbientLight += lightColor;\n\n	}\n\n#endif\n\n";THREE.ShaderChunk["lightmap_fragment"]="#ifdef USE_LIGHTMAP\n\n	totalAmbientLight += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\n#endif\n";THREE.ShaderChunk["lightmap_pars_fragment"]="#ifdef USE_LIGHTMAP\n\n	uniform sampler2D lightMap;\n	uniform float lightMapIntensity;\n\n#endif";THREE.ShaderChunk["lights_lambert_pars_vertex"]="#if MAX_DIR_LIGHTS > 0\n\n	uniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n	uniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n	uniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n	uniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n	uniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n	uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n	uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n	uniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n	uniform float pointLightDecay[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n	uniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n	uniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n	uniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n	uniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n	uniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n	uniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n	uniform float spotLightDecay[ MAX_SPOT_LIGHTS ];\n\n#endif\n";THREE.ShaderChunk["lights_lambert_vertex"]="vLightFront = vec3( 0.0 );\n\n#ifdef DOUBLE_SIDED\n\n	vLightBack = vec3( 0.0 );\n\n#endif\n\nvec3 normal = normalize( transformedNormal );\n\n#if MAX_POINT_LIGHTS > 0\n\n	for ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n		vec3 lightColor = pointLightColor[ i ];\n\n		vec3 lVector = pointLightPosition[ i ] - mvPosition.xyz;\n		vec3 lightDir = normalize( lVector );\n\n\n		float attenuation = calcLightAttenuation( length( lVector ), pointLightDistance[ i ], pointLightDecay[ i ] );\n\n\n		float dotProduct = dot( normal, lightDir );\n\n		vLightFront += lightColor * attenuation * saturate( dotProduct );\n\n		#ifdef DOUBLE_SIDED\n\n			vLightBack += lightColor * attenuation * saturate( - dotProduct );\n\n		#endif\n\n	}\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n	for ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n		vec3 lightColor = spotLightColor[ i ];\n\n		vec3 lightPosition = spotLightPosition[ i ];\n		vec3 lVector = lightPosition - mvPosition.xyz;\n		vec3 lightDir = normalize( lVector );\n\n		float spotEffect = dot( spotLightDirection[ i ], lightDir );\n\n		if ( spotEffect > spotLightAngleCos[ i ] ) {\n\n			spotEffect = saturate( pow( saturate( spotEffect ), spotLightExponent[ i ] ) );\n\n\n			float attenuation = calcLightAttenuation( length( lVector ), spotLightDistance[ i ], spotLightDecay[ i ] );\n\n			attenuation *= spotEffect;\n\n\n			float dotProduct = dot( normal, lightDir );\n\n			vLightFront += lightColor * attenuation * saturate( dotProduct );\n\n			#ifdef DOUBLE_SIDED\n\n				vLightBack += lightColor * attenuation * saturate( - dotProduct );\n\n			#endif\n\n		}\n\n	}\n\n#endif\n\n#if MAX_DIR_LIGHTS > 0\n\n	for ( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\n\n		vec3 lightColor = directionalLightColor[ i ];\n\n		vec3 lightDir = directionalLightDirection[ i ];\n\n\n		float dotProduct = dot( normal, lightDir );\n\n		vLightFront += lightColor * saturate( dotProduct );\n\n		#ifdef DOUBLE_SIDED\n\n			vLightBack += lightColor * saturate( - dotProduct );\n\n		#endif\n\n	}\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n	for ( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n		vec3 lightDir = hemisphereLightDirection[ i ];\n\n\n		float dotProduct = dot( normal, lightDir );\n\n		float hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\n		vLightFront += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n		#ifdef DOUBLE_SIDED\n\n			float hemiDiffuseWeightBack = - 0.5 * dotProduct + 0.5;\n\n			vLightBack += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeightBack );\n\n		#endif\n\n	}\n\n#endif\n";THREE.ShaderChunk["lights_phong_fragment"]="vec3 viewDir = normalize( vViewPosition );\n\nvec3 totalDiffuseLight = vec3( 0.0 );\nvec3 totalSpecularLight = vec3( 0.0 );\n\n#if MAX_POINT_LIGHTS > 0\n\n	for ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n		vec3 lightColor = pointLightColor[ i ];\n\n		vec3 lightPosition = pointLightPosition[ i ];\n		vec3 lVector = lightPosition + vViewPosition.xyz;\n		vec3 lightDir = normalize( lVector );\n\n\n		float attenuation = calcLightAttenuation( length( lVector ), pointLightDistance[ i ], pointLightDecay[ i ] );\n\n\n		float cosineTerm = saturate( dot( normal, lightDir ) );\n\n		totalDiffuseLight += lightColor * attenuation * cosineTerm;\n\n\n		vec3 brdf = BRDF_BlinnPhong( specular, shininess, normal, lightDir, viewDir );\n\n		totalSpecularLight += brdf * specularStrength * lightColor * attenuation * cosineTerm;\n\n\n	}\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n	for ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n		vec3 lightColor = spotLightColor[ i ];\n\n		vec3 lightPosition = spotLightPosition[ i ];\n		vec3 lVector = lightPosition + vViewPosition.xyz;\n		vec3 lightDir = normalize( lVector );\n\n		float spotEffect = dot( spotLightDirection[ i ], lightDir );\n\n		if ( spotEffect > spotLightAngleCos[ i ] ) {\n\n			spotEffect = saturate( pow( saturate( spotEffect ), spotLightExponent[ i ] ) );\n\n\n			float attenuation = calcLightAttenuation( length( lVector ), spotLightDistance[ i ], spotLightDecay[ i ] );\n\n			attenuation *= spotEffect;\n\n\n			float cosineTerm = saturate( dot( normal, lightDir ) );\n\n			totalDiffuseLight += lightColor * attenuation * cosineTerm;\n\n\n			vec3 brdf = BRDF_BlinnPhong( specular, shininess, normal, lightDir, viewDir );\n\n			totalSpecularLight += brdf * specularStrength * lightColor * attenuation * cosineTerm;\n\n		}\n\n	}\n\n#endif\n\n#if MAX_DIR_LIGHTS > 0\n\n	for ( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\n\n		vec3 lightColor = directionalLightColor[ i ];\n\n		vec3 lightDir = directionalLightDirection[ i ];\n\n\n		float cosineTerm = saturate( dot( normal, lightDir ) );\n\n		totalDiffuseLight += lightColor * cosineTerm;\n\n\n		vec3 brdf = BRDF_BlinnPhong( specular, shininess, normal, lightDir, viewDir );\n\n		totalSpecularLight += brdf * specularStrength * lightColor * cosineTerm;\n\n	}\n\n#endif\n";THREE.ShaderChunk["lights_phong_pars_fragment"]="uniform vec3 ambientLightColor;\n\n#if MAX_DIR_LIGHTS > 0\n\n	uniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n	uniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n	uniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n	uniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n	uniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n	uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n\n	uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n	uniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n	uniform float pointLightDecay[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n	uniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n	uniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n	uniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n	uniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n	uniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n	uniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n	uniform float spotLightDecay[ MAX_SPOT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0 || defined( USE_ENVMAP )\n\n	varying vec3 vWorldPosition;\n\n#endif\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n	varying vec3 vNormal;\n\n#endif\n";THREE.ShaderChunk["lights_phong_pars_vertex"]="#if MAX_SPOT_LIGHTS > 0 || defined( USE_ENVMAP )\n\n	varying vec3 vWorldPosition;\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n	uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n\n#endif\n";THREE.ShaderChunk["lights_phong_vertex"]="#if MAX_SPOT_LIGHTS > 0 || defined( USE_ENVMAP )\n\n	vWorldPosition = worldPosition.xyz;\n\n#endif\n";THREE.ShaderChunk["linear_to_gamma_fragment"]="\n	outgoingLight = linearToOutput( outgoingLight );\n";THREE.ShaderChunk["logdepthbuf_fragment"]="#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\n	gl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n\n#endif";THREE.ShaderChunk["logdepthbuf_pars_fragment"]="#ifdef USE_LOGDEPTHBUF\n\n	uniform float logDepthBufFC;\n\n	#ifdef USE_LOGDEPTHBUF_EXT\n\n		varying float vFragDepth;\n\n	#endif\n\n#endif\n";THREE.ShaderChunk["logdepthbuf_pars_vertex"]="#ifdef USE_LOGDEPTHBUF\n\n	#ifdef USE_LOGDEPTHBUF_EXT\n\n		varying float vFragDepth;\n\n	#endif\n\n	uniform float logDepthBufFC;\n\n#endif";THREE.ShaderChunk["logdepthbuf_vertex"]="#ifdef USE_LOGDEPTHBUF\n\n	gl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\n	#ifdef USE_LOGDEPTHBUF_EXT\n\n		vFragDepth = 1.0 + gl_Position.w;\n\n#else\n\n		gl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\n	#endif\n\n#endif";THREE.ShaderChunk["map_fragment"]="#ifdef USE_MAP\n\n	vec4 texelColor = texture2D( map, vUv );\n\n	texelColor.xyz = inputToLinear( texelColor.xyz );\n\n	diffuseColor *= texelColor;\n\n#endif\n";THREE.ShaderChunk["map_pars_fragment"]="#ifdef USE_MAP\n\n	uniform sampler2D map;\n\n#endif";THREE.ShaderChunk["map_particle_fragment"]="#ifdef USE_MAP\n\n	diffuseColor *= texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\n#endif\n";THREE.ShaderChunk["map_particle_pars_fragment"]="#ifdef USE_MAP\n\n	uniform vec4 offsetRepeat;\n	uniform sampler2D map;\n\n#endif\n";THREE.ShaderChunk["morphnormal_vertex"]="#ifdef USE_MORPHNORMALS\n\n	objectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n	objectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n	objectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n	objectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n\n#endif\n";THREE.ShaderChunk["morphtarget_pars_vertex"]="#ifdef USE_MORPHTARGETS\n\n	#ifndef USE_MORPHNORMALS\n\n	uniform float morphTargetInfluences[ 8 ];\n\n	#else\n\n	uniform float morphTargetInfluences[ 4 ];\n\n	#endif\n\n#endif";THREE.ShaderChunk["morphtarget_vertex"]="#ifdef USE_MORPHTARGETS\n\n	transformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n	transformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n	transformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n	transformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\n	#ifndef USE_MORPHNORMALS\n\n	transformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n	transformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n	transformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n	transformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\n	#endif\n\n#endif\n";THREE.ShaderChunk["normal_phong_fragment"]="#ifndef FLAT_SHADED\n\n	vec3 normal = normalize( vNormal );\n\n	#ifdef DOUBLE_SIDED\n\n		normal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\n	#endif\n\n#else\n\n	vec3 fdx = dFdx( vViewPosition );\n	vec3 fdy = dFdy( vViewPosition );\n	vec3 normal = normalize( cross( fdx, fdy ) );\n\n#endif\n\n#ifdef USE_NORMALMAP\n\n	normal = perturbNormal2Arb( -vViewPosition, normal );\n\n#elif defined( USE_BUMPMAP )\n\n	normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n\n#endif\n\n";THREE.ShaderChunk["normalmap_pars_fragment"]="#ifdef USE_NORMALMAP\n\n	uniform sampler2D normalMap;\n	uniform vec2 normalScale;\n\n\n	vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\n		vec3 q0 = dFdx( eye_pos.xyz );\n		vec3 q1 = dFdy( eye_pos.xyz );\n		vec2 st0 = dFdx( vUv.st );\n		vec2 st1 = dFdy( vUv.st );\n\n		vec3 S = normalize( q0 * st1.t - q1 * st0.t );\n		vec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n		vec3 N = normalize( surf_norm );\n\n		vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n		mapN.xy = normalScale * mapN.xy;\n		mat3 tsn = mat3( S, T, N );\n		return normalize( tsn * mapN );\n\n	}\n\n#endif\n";THREE.ShaderChunk["project_vertex"]="#ifdef USE_SKINNING\n\n	vec4 mvPosition = modelViewMatrix * skinned;\n\n#else\n\n	vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n\n#endif\n\ngl_Position = projectionMatrix * mvPosition;\n";THREE.ShaderChunk["shadowmap_fragment"]="#ifdef USE_SHADOWMAP\n\n	for ( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n		float texelSizeY =  1.0 / shadowMapSize[ i ].y;\n\n		float shadow = 0.0;\n\n#if defined( POINT_LIGHT_SHADOWS )\n\n		bool isPointLight = shadowDarkness[ i ] < 0.0;\n\n		if ( isPointLight ) {\n\n			float realShadowDarkness = abs( shadowDarkness[ i ] );\n\n			vec3 lightToPosition = vShadowCoord[ i ].xyz;\n\n	#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\n			vec3 bd3D = normalize( lightToPosition );\n			float dp = length( lightToPosition );\n\n			adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D, texelSizeY ) ), shadowBias[ i ], shadow );\n\n\n	#if defined( SHADOWMAP_TYPE_PCF )\n			const float Dr = 1.25;\n	#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n			const float Dr = 2.25;\n	#endif\n\n			float os = Dr *  2.0 * texelSizeY;\n\n			const vec3 Gsd = vec3( - 1, 0, 1 );\n\n			adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.zzz * os, texelSizeY ) ), shadowBias[ i ], shadow );\n			adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.zxz * os, texelSizeY ) ), shadowBias[ i ], shadow );\n			adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.xxz * os, texelSizeY ) ), shadowBias[ i ], shadow );\n			adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.xzz * os, texelSizeY ) ), shadowBias[ i ], shadow );\n			adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.zzx * os, texelSizeY ) ), shadowBias[ i ], shadow );\n			adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.zxx * os, texelSizeY ) ), shadowBias[ i ], shadow );\n			adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.xxx * os, texelSizeY ) ), shadowBias[ i ], shadow );\n			adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.xzx * os, texelSizeY ) ), shadowBias[ i ], shadow );\n			adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.zzy * os, texelSizeY ) ), shadowBias[ i ], shadow );\n			adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.zxy * os, texelSizeY ) ), shadowBias[ i ], shadow );\n\n			adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.xxy * os, texelSizeY ) ), shadowBias[ i ], shadow );\n			adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.xzy * os, texelSizeY ) ), shadowBias[ i ], shadow );\n			adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.zyz * os, texelSizeY ) ), shadowBias[ i ], shadow );\n			adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.xyz * os, texelSizeY ) ), shadowBias[ i ], shadow );\n			adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.zyx * os, texelSizeY ) ), shadowBias[ i ], shadow );\n			adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.xyx * os, texelSizeY ) ), shadowBias[ i ], shadow );\n			adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.yzz * os, texelSizeY ) ), shadowBias[ i ], shadow );\n			adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.yxz * os, texelSizeY ) ), shadowBias[ i ], shadow );\n			adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.yxx * os, texelSizeY ) ), shadowBias[ i ], shadow );\n			adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.yzx * os, texelSizeY ) ), shadowBias[ i ], shadow );\n\n			shadow *= realShadowDarkness * ( 1.0 / 21.0 );\n\n	#else \n			vec3 bd3D = normalize( lightToPosition );\n			float dp = length( lightToPosition );\n\n			adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D, texelSizeY ) ), shadowBias[ i ], shadow );\n\n			shadow *= realShadowDarkness;\n\n	#endif\n\n		} else {\n\n#endif \n			float texelSizeX =  1.0 / shadowMapSize[ i ].x;\n\n			vec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\n\n\n			bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n			bool inFrustum = all( inFrustumVec );\n\n			bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\n			bool frustumTest = all( frustumTestVec );\n\n			if ( frustumTest ) {\n\n	#if defined( SHADOWMAP_TYPE_PCF )\n\n\n				/*\n					for ( float y = -1.25; y <= 1.25; y += 1.25 )\n						for ( float x = -1.25; x <= 1.25; x += 1.25 ) {\n							vec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\n							float fDepth = unpackDepth( rgbaDepth );\n							if ( fDepth < shadowCoord.z )\n								shadow += 1.0;\n					}\n					shadow /= 9.0;\n				*/\n\n				shadowCoord.z += shadowBias[ i ];\n\n				const float ShadowDelta = 1.0 / 9.0;\n\n				float xPixelOffset = texelSizeX;\n				float yPixelOffset = texelSizeY;\n\n				float dx0 = - 1.25 * xPixelOffset;\n				float dy0 = - 1.25 * yPixelOffset;\n				float dx1 = 1.25 * xPixelOffset;\n				float dy1 = 1.25 * yPixelOffset;\n\n				float fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n				if ( fDepth < shadowCoord.z ) shadow += ShadowDelta;\n\n				fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n				if ( fDepth < shadowCoord.z ) shadow += ShadowDelta;\n\n				fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n				if ( fDepth < shadowCoord.z ) shadow += ShadowDelta;\n\n				fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n				if ( fDepth < shadowCoord.z ) shadow += ShadowDelta;\n\n				fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n				if ( fDepth < shadowCoord.z ) shadow += ShadowDelta;\n\n				fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n				if ( fDepth < shadowCoord.z ) shadow += ShadowDelta;\n\n				fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n				if ( fDepth < shadowCoord.z ) shadow += ShadowDelta;\n\n				fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n				if ( fDepth < shadowCoord.z ) shadow += ShadowDelta;\n\n				fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n				if ( fDepth < shadowCoord.z ) shadow += ShadowDelta;\n\n				shadow *= shadowDarkness[ i ];\n\n	#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\n\n				shadowCoord.z += shadowBias[ i ];\n\n				float xPixelOffset = texelSizeX;\n				float yPixelOffset = texelSizeY;\n\n				float dx0 = - 1.0 * xPixelOffset;\n				float dy0 = - 1.0 * yPixelOffset;\n				float dx1 = 1.0 * xPixelOffset;\n				float dy1 = 1.0 * yPixelOffset;\n\n				mat3 shadowKernel;\n				mat3 depthKernel;\n\n				depthKernel[ 0 ][ 0 ] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n				depthKernel[ 0 ][ 1 ] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n				depthKernel[ 0 ][ 2 ] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n				depthKernel[ 1 ][ 0 ] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n				depthKernel[ 1 ][ 1 ] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n				depthKernel[ 1 ][ 2 ] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n				depthKernel[ 2 ][ 0 ] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n				depthKernel[ 2 ][ 1 ] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n				depthKernel[ 2 ][ 2 ] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n\n				vec3 shadowZ = vec3( shadowCoord.z );\n				shadowKernel[ 0 ] = vec3( lessThan( depthKernel[ 0 ], shadowZ ) );\n				shadowKernel[ 0 ] *= vec3( 0.25 );\n\n				shadowKernel[ 1 ] = vec3( lessThan( depthKernel[ 1 ], shadowZ ) );\n				shadowKernel[ 1 ] *= vec3( 0.25 );\n\n				shadowKernel[ 2 ] = vec3( lessThan( depthKernel[ 2 ], shadowZ ) );\n				shadowKernel[ 2 ] *= vec3( 0.25 );\n\n				vec2 fractionalCoord = 1.0 - fract( shadowCoord.xy * shadowMapSize[ i ].xy );\n\n				shadowKernel[ 0 ] = mix( shadowKernel[ 1 ], shadowKernel[ 0 ], fractionalCoord.x );\n				shadowKernel[ 1 ] = mix( shadowKernel[ 2 ], shadowKernel[ 1 ], fractionalCoord.x );\n\n				vec4 shadowValues;\n				shadowValues.x = mix( shadowKernel[ 0 ][ 1 ], shadowKernel[ 0 ][ 0 ], fractionalCoord.y );\n				shadowValues.y = mix( shadowKernel[ 0 ][ 2 ], shadowKernel[ 0 ][ 1 ], fractionalCoord.y );\n				shadowValues.z = mix( shadowKernel[ 1 ][ 1 ], shadowKernel[ 1 ][ 0 ], fractionalCoord.y );\n				shadowValues.w = mix( shadowKernel[ 1 ][ 2 ], shadowKernel[ 1 ][ 1 ], fractionalCoord.y );\n\n				shadow = dot( shadowValues, vec4( 1.0 ) ) * shadowDarkness[ i ];\n\n	#else \n				shadowCoord.z += shadowBias[ i ];\n\n				vec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\n				float fDepth = unpackDepth( rgbaDepth );\n\n				if ( fDepth < shadowCoord.z )\n					shadow = shadowDarkness[ i ];\n\n	#endif\n\n			}\n\n#ifdef SHADOWMAP_DEBUG\n\n			if ( inFrustum ) {\n\n				if ( i == 0 ) {\n\n					outgoingLight *= vec3( 1.0, 0.5, 0.0 );\n\n				} else if ( i == 1 ) {\n\n					outgoingLight *= vec3( 0.0, 1.0, 0.8 );\n\n				} else {\n\n					outgoingLight *= vec3( 0.0, 0.5, 1.0 );\n\n				}\n\n			}\n\n#endif\n\n#if defined( POINT_LIGHT_SHADOWS )\n\n		}\n\n#endif\n\n		shadowMask = shadowMask * vec3( 1.0 - shadow );\n\n	}\n\n#endif\n";THREE.ShaderChunk["shadowmap_pars_fragment"]="#ifdef USE_SHADOWMAP\n\n	uniform sampler2D shadowMap[ MAX_SHADOWS ];\n	uniform vec2 shadowMapSize[ MAX_SHADOWS ];\n\n	uniform float shadowDarkness[ MAX_SHADOWS ];\n	uniform float shadowBias[ MAX_SHADOWS ];\n\n	varying vec4 vShadowCoord[ MAX_SHADOWS ];\n\n	float unpackDepth( const in vec4 rgba_depth ) {\n\n		const vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n		float depth = dot( rgba_depth, bit_shift );\n		return depth;\n\n	}\n\n	#if defined(POINT_LIGHT_SHADOWS)\n\n\n		void adjustShadowValue1K( const float testDepth, const vec4 textureData, const float bias, inout float shadowValue ) {\n\n			const vec4 bitSh = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n			if ( testDepth >= dot( textureData, bitSh ) * 1000.0 + bias )\n				shadowValue += 1.0;\n\n		}\n\n\n		vec2 cubeToUV( vec3 v, float texelSizeY ) {\n\n\n			vec3 absV = abs( v );\n\n\n			float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n			absV *= scaleToCube;\n\n\n			v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\n\n\n			vec2 planar = v.xy;\n\n			float almostATexel = 1.5 * texelSizeY;\n			float almostOne = 1.0 - almostATexel;\n\n			if ( absV.z >= almostOne ) {\n\n				if ( v.z > 0.0 )\n					planar.x = 4.0 - v.x;\n\n			} else if ( absV.x >= almostOne ) {\n\n				float signX = sign( v.x );\n				planar.x = v.z * signX + 2.0 * signX;\n\n			} else if ( absV.y >= almostOne ) {\n\n				float signY = sign( v.y );\n				planar.x = v.x + 2.0 * signY + 2.0;\n				planar.y = v.z * signY - 2.0;\n\n			}\n\n\n			return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\n		}\n\n	#endif\n\n#endif\n";THREE.ShaderChunk["shadowmap_pars_vertex"]="#ifdef USE_SHADOWMAP\n\n	uniform float shadowDarkness[ MAX_SHADOWS ];\n	uniform mat4 shadowMatrix[ MAX_SHADOWS ];\n	varying vec4 vShadowCoord[ MAX_SHADOWS ];\n\n#endif";THREE.ShaderChunk["shadowmap_vertex"]="#ifdef USE_SHADOWMAP\n\n	for ( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n			vShadowCoord[ i ] = shadowMatrix[ i ] * worldPosition;\n\n	}\n\n#endif";THREE.ShaderChunk["skinbase_vertex"]="#ifdef USE_SKINNING\n\n	mat4 boneMatX = getBoneMatrix( skinIndex.x );\n	mat4 boneMatY = getBoneMatrix( skinIndex.y );\n	mat4 boneMatZ = getBoneMatrix( skinIndex.z );\n	mat4 boneMatW = getBoneMatrix( skinIndex.w );\n\n#endif";THREE.ShaderChunk["skinning_pars_vertex"]="#ifdef USE_SKINNING\n\n	uniform mat4 bindMatrix;\n	uniform mat4 bindMatrixInverse;\n\n	#ifdef BONE_TEXTURE\n\n		uniform sampler2D boneTexture;\n		uniform int boneTextureWidth;\n		uniform int boneTextureHeight;\n\n		mat4 getBoneMatrix( const in float i ) {\n\n			float j = i * 4.0;\n			float x = mod( j, float( boneTextureWidth ) );\n			float y = floor( j / float( boneTextureWidth ) );\n\n			float dx = 1.0 / float( boneTextureWidth );\n			float dy = 1.0 / float( boneTextureHeight );\n\n			y = dy * ( y + 0.5 );\n\n			vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n			vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n			vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n			vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\n			mat4 bone = mat4( v1, v2, v3, v4 );\n\n			return bone;\n\n		}\n\n	#else\n\n		uniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\n		mat4 getBoneMatrix( const in float i ) {\n\n			mat4 bone = boneGlobalMatrices[ int(i) ];\n			return bone;\n\n		}\n\n	#endif\n\n#endif\n";THREE.ShaderChunk["skinning_vertex"]="#ifdef USE_SKINNING\n\n	vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\n	vec4 skinned = vec4( 0.0 );\n	skinned += boneMatX * skinVertex * skinWeight.x;\n	skinned += boneMatY * skinVertex * skinWeight.y;\n	skinned += boneMatZ * skinVertex * skinWeight.z;\n	skinned += boneMatW * skinVertex * skinWeight.w;\n	skinned  = bindMatrixInverse * skinned;\n\n#endif\n";THREE.ShaderChunk["skinnormal_vertex"]="#ifdef USE_SKINNING\n\n	mat4 skinMatrix = mat4( 0.0 );\n	skinMatrix += skinWeight.x * boneMatX;\n	skinMatrix += skinWeight.y * boneMatY;\n	skinMatrix += skinWeight.z * boneMatZ;\n	skinMatrix += skinWeight.w * boneMatW;\n	skinMatrix  = bindMatrixInverse * skinMatrix * bindMatrix;\n\n	objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\n#endif\n";THREE.ShaderChunk["specularmap_fragment"]="float specularStrength;\n\n#ifdef USE_SPECULARMAP\n\n	vec4 texelSpecular = texture2D( specularMap, vUv );\n	specularStrength = texelSpecular.r;\n\n#else\n\n	specularStrength = 1.0;\n\n#endif";THREE.ShaderChunk["specularmap_pars_fragment"]="#ifdef USE_SPECULARMAP\n\n	uniform sampler2D specularMap;\n\n#endif";THREE.ShaderChunk["uv2_pars_fragment"]="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\n	varying vec2 vUv2;\n\n#endif";THREE.ShaderChunk["uv2_pars_vertex"]="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\n	attribute vec2 uv2;\n	varying vec2 vUv2;\n\n#endif";THREE.ShaderChunk["uv2_vertex"]="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\n	vUv2 = uv2;\n\n#endif";THREE.ShaderChunk["uv_pars_fragment"]="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP )\n\n	varying vec2 vUv;\n\n#endif";
THREE.ShaderChunk["uv_pars_vertex"]="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP )\n\n	varying vec2 vUv;\n	uniform vec4 offsetRepeat;\n\n#endif\n";THREE.ShaderChunk["uv_vertex"]="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP )\n\n	vUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n\n#endif";THREE.ShaderChunk["worldpos_vertex"]="#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\n	#ifdef USE_SKINNING\n\n		vec4 worldPosition = modelMatrix * skinned;\n\n	#else\n\n		vec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\n	#endif\n\n#endif\n";if(window.updateShaders!==undefined)updateShaders();THREE.UniformsUtils={merge:function(e){var t={};for(var r=0;r<e.length;r++){var i=this.clone(e[r]);for(var n in i){t[n]=i[n]}}return t},clone:function(e){var t={};for(var r in e){t[r]={};for(var i in e[r]){var n=e[r][i];if(n instanceof THREE.Color||n instanceof THREE.Vector2||n instanceof THREE.Vector3||n instanceof THREE.Vector4||n instanceof THREE.Matrix3||n instanceof THREE.Matrix4||n instanceof THREE.Texture){t[r][i]=n.clone()}else if(Array.isArray(n)){t[r][i]=n.slice()}else{t[r][i]=n}}}return t}};THREE.UniformsLib={common:{diffuse:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},map:{type:"t",value:null},offsetRepeat:{type:"v4",value:new THREE.Vector4(0,0,1,1)},specularMap:{type:"t",value:null},alphaMap:{type:"t",value:null},envMap:{type:"t",value:null},flipEnvMap:{type:"f",value:-1},reflectivity:{type:"f",value:1},refractionRatio:{type:"f",value:.98}},aomap:{aoMap:{type:"t",value:null},aoMapIntensity:{type:"f",value:1}},lightmap:{lightMap:{type:"t",value:null},lightMapIntensity:{type:"f",value:1}},emissivemap:{emissiveMap:{type:"t",value:null}},bumpmap:{bumpMap:{type:"t",value:null},bumpScale:{type:"f",value:1}},normalmap:{normalMap:{type:"t",value:null},normalScale:{type:"v2",value:new THREE.Vector2(1,1)}},displacementmap:{displacementMap:{type:"t",value:null},displacementScale:{type:"f",value:1},displacementBias:{type:"f",value:0}},fog:{fogDensity:{type:"f",value:25e-5},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},fogColor:{type:"c",value:new THREE.Color(16777215)}},lights:{ambientLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]},directionalLightColor:{type:"fv",value:[]},hemisphereLightDirection:{type:"fv",value:[]},hemisphereLightSkyColor:{type:"fv",value:[]},hemisphereLightGroundColor:{type:"fv",value:[]},pointLightColor:{type:"fv",value:[]},pointLightPosition:{type:"fv",value:[]},pointLightDistance:{type:"fv1",value:[]},pointLightDecay:{type:"fv1",value:[]},spotLightColor:{type:"fv",value:[]},spotLightPosition:{type:"fv",value:[]},spotLightDirection:{type:"fv",value:[]},spotLightDistance:{type:"fv1",value:[]},spotLightAngleCos:{type:"fv1",value:[]},spotLightExponent:{type:"fv1",value:[]},spotLightDecay:{type:"fv1",value:[]}},points:{psColor:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},size:{type:"f",value:1},scale:{type:"f",value:1},map:{type:"t",value:null},offsetRepeat:{type:"v4",value:new THREE.Vector4(0,0,1,1)},fogDensity:{type:"f",value:25e-5},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},fogColor:{type:"c",value:new THREE.Color(16777215)}},shadowmap:{shadowMap:{type:"tv",value:[]},shadowMapSize:{type:"v2v",value:[]},shadowBias:{type:"fv1",value:[]},shadowDarkness:{type:"fv1",value:[]},shadowBlur:{type:"fv1",value:[]},shadowMatrix:{type:"m4v",value:[]}}};THREE.ShaderLib={basic:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib["common"],THREE.UniformsLib["aomap"],THREE.UniformsLib["fog"],THREE.UniformsLib["shadowmap"]]),vertexShader:[THREE.ShaderChunk["common"],THREE.ShaderChunk["uv_pars_vertex"],THREE.ShaderChunk["uv2_pars_vertex"],THREE.ShaderChunk["envmap_pars_vertex"],THREE.ShaderChunk["color_pars_vertex"],THREE.ShaderChunk["morphtarget_pars_vertex"],THREE.ShaderChunk["skinning_pars_vertex"],THREE.ShaderChunk["shadowmap_pars_vertex"],THREE.ShaderChunk["logdepthbuf_pars_vertex"],"void main() {",THREE.ShaderChunk["uv_vertex"],THREE.ShaderChunk["uv2_vertex"],THREE.ShaderChunk["color_vertex"],THREE.ShaderChunk["skinbase_vertex"],"	#ifdef USE_ENVMAP",THREE.ShaderChunk["beginnormal_vertex"],THREE.ShaderChunk["morphnormal_vertex"],THREE.ShaderChunk["skinnormal_vertex"],THREE.ShaderChunk["defaultnormal_vertex"],"	#endif",THREE.ShaderChunk["begin_vertex"],THREE.ShaderChunk["morphtarget_vertex"],THREE.ShaderChunk["skinning_vertex"],THREE.ShaderChunk["project_vertex"],THREE.ShaderChunk["logdepthbuf_vertex"],THREE.ShaderChunk["worldpos_vertex"],THREE.ShaderChunk["envmap_vertex"],THREE.ShaderChunk["shadowmap_vertex"],"}"].join("\n"),fragmentShader:["uniform vec3 diffuse;","uniform float opacity;",THREE.ShaderChunk["common"],THREE.ShaderChunk["color_pars_fragment"],THREE.ShaderChunk["uv_pars_fragment"],THREE.ShaderChunk["uv2_pars_fragment"],THREE.ShaderChunk["map_pars_fragment"],THREE.ShaderChunk["alphamap_pars_fragment"],THREE.ShaderChunk["aomap_pars_fragment"],THREE.ShaderChunk["envmap_pars_fragment"],THREE.ShaderChunk["fog_pars_fragment"],THREE.ShaderChunk["shadowmap_pars_fragment"],THREE.ShaderChunk["specularmap_pars_fragment"],THREE.ShaderChunk["logdepthbuf_pars_fragment"],"void main() {","	vec3 outgoingLight = vec3( 0.0 );","	vec4 diffuseColor = vec4( diffuse, opacity );","	vec3 totalAmbientLight = vec3( 1.0 );","	vec3 shadowMask = vec3( 1.0 );",THREE.ShaderChunk["logdepthbuf_fragment"],THREE.ShaderChunk["map_fragment"],THREE.ShaderChunk["color_fragment"],THREE.ShaderChunk["alphamap_fragment"],THREE.ShaderChunk["alphatest_fragment"],THREE.ShaderChunk["specularmap_fragment"],THREE.ShaderChunk["aomap_fragment"],THREE.ShaderChunk["shadowmap_fragment"],"	outgoingLight = diffuseColor.rgb * totalAmbientLight * shadowMask;",THREE.ShaderChunk["envmap_fragment"],THREE.ShaderChunk["linear_to_gamma_fragment"],THREE.ShaderChunk["fog_fragment"],"	gl_FragColor = vec4( outgoingLight, diffuseColor.a );","}"].join("\n")},lambert:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib["common"],THREE.UniformsLib["fog"],THREE.UniformsLib["lights"],THREE.UniformsLib["shadowmap"],{emissive:{type:"c",value:new THREE.Color(0)}}]),vertexShader:["#define LAMBERT","varying vec3 vLightFront;","#ifdef DOUBLE_SIDED","	varying vec3 vLightBack;","#endif",THREE.ShaderChunk["common"],THREE.ShaderChunk["uv_pars_vertex"],THREE.ShaderChunk["uv2_pars_vertex"],THREE.ShaderChunk["envmap_pars_vertex"],THREE.ShaderChunk["lights_lambert_pars_vertex"],THREE.ShaderChunk["color_pars_vertex"],THREE.ShaderChunk["morphtarget_pars_vertex"],THREE.ShaderChunk["skinning_pars_vertex"],THREE.ShaderChunk["shadowmap_pars_vertex"],THREE.ShaderChunk["logdepthbuf_pars_vertex"],"void main() {",THREE.ShaderChunk["uv_vertex"],THREE.ShaderChunk["uv2_vertex"],THREE.ShaderChunk["color_vertex"],THREE.ShaderChunk["beginnormal_vertex"],THREE.ShaderChunk["morphnormal_vertex"],THREE.ShaderChunk["skinbase_vertex"],THREE.ShaderChunk["skinnormal_vertex"],THREE.ShaderChunk["defaultnormal_vertex"],THREE.ShaderChunk["begin_vertex"],THREE.ShaderChunk["morphtarget_vertex"],THREE.ShaderChunk["skinning_vertex"],THREE.ShaderChunk["project_vertex"],THREE.ShaderChunk["logdepthbuf_vertex"],THREE.ShaderChunk["worldpos_vertex"],THREE.ShaderChunk["envmap_vertex"],THREE.ShaderChunk["lights_lambert_vertex"],THREE.ShaderChunk["shadowmap_vertex"],"}"].join("\n"),fragmentShader:["uniform vec3 diffuse;","uniform vec3 emissive;","uniform float opacity;","uniform vec3 ambientLightColor;","varying vec3 vLightFront;","#ifdef DOUBLE_SIDED","	varying vec3 vLightBack;","#endif",THREE.ShaderChunk["common"],THREE.ShaderChunk["color_pars_fragment"],THREE.ShaderChunk["uv_pars_fragment"],THREE.ShaderChunk["uv2_pars_fragment"],THREE.ShaderChunk["map_pars_fragment"],THREE.ShaderChunk["alphamap_pars_fragment"],THREE.ShaderChunk["envmap_pars_fragment"],THREE.ShaderChunk["fog_pars_fragment"],THREE.ShaderChunk["shadowmap_pars_fragment"],THREE.ShaderChunk["specularmap_pars_fragment"],THREE.ShaderChunk["logdepthbuf_pars_fragment"],"void main() {","	vec3 outgoingLight = vec3( 0.0 );","	vec4 diffuseColor = vec4( diffuse, opacity );","	vec3 totalAmbientLight = ambientLightColor;","	vec3 shadowMask = vec3( 1.0 );",THREE.ShaderChunk["logdepthbuf_fragment"],THREE.ShaderChunk["map_fragment"],THREE.ShaderChunk["color_fragment"],THREE.ShaderChunk["alphamap_fragment"],THREE.ShaderChunk["alphatest_fragment"],THREE.ShaderChunk["specularmap_fragment"],THREE.ShaderChunk["shadowmap_fragment"],"	#ifdef DOUBLE_SIDED","		if ( gl_FrontFacing )","			outgoingLight += diffuseColor.rgb * ( vLightFront * shadowMask + totalAmbientLight ) + emissive;","		else","			outgoingLight += diffuseColor.rgb * ( vLightBack * shadowMask + totalAmbientLight ) + emissive;","	#else","		outgoingLight += diffuseColor.rgb * ( vLightFront * shadowMask + totalAmbientLight ) + emissive;","	#endif",THREE.ShaderChunk["envmap_fragment"],THREE.ShaderChunk["linear_to_gamma_fragment"],THREE.ShaderChunk["fog_fragment"],"	gl_FragColor = vec4( outgoingLight, diffuseColor.a );","}"].join("\n")},phong:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib["common"],THREE.UniformsLib["aomap"],THREE.UniformsLib["lightmap"],THREE.UniformsLib["emissivemap"],THREE.UniformsLib["bumpmap"],THREE.UniformsLib["normalmap"],THREE.UniformsLib["displacementmap"],THREE.UniformsLib["fog"],THREE.UniformsLib["lights"],THREE.UniformsLib["shadowmap"],{emissive:{type:"c",value:new THREE.Color(0)},specular:{type:"c",value:new THREE.Color(1118481)},shininess:{type:"f",value:30}}]),vertexShader:["#define PHONG","varying vec3 vViewPosition;","#ifndef FLAT_SHADED","	varying vec3 vNormal;","#endif",THREE.ShaderChunk["common"],THREE.ShaderChunk["uv_pars_vertex"],THREE.ShaderChunk["uv2_pars_vertex"],THREE.ShaderChunk["displacementmap_pars_vertex"],THREE.ShaderChunk["envmap_pars_vertex"],THREE.ShaderChunk["lights_phong_pars_vertex"],THREE.ShaderChunk["color_pars_vertex"],THREE.ShaderChunk["morphtarget_pars_vertex"],THREE.ShaderChunk["skinning_pars_vertex"],THREE.ShaderChunk["shadowmap_pars_vertex"],THREE.ShaderChunk["logdepthbuf_pars_vertex"],"void main() {",THREE.ShaderChunk["uv_vertex"],THREE.ShaderChunk["uv2_vertex"],THREE.ShaderChunk["color_vertex"],THREE.ShaderChunk["beginnormal_vertex"],THREE.ShaderChunk["morphnormal_vertex"],THREE.ShaderChunk["skinbase_vertex"],THREE.ShaderChunk["skinnormal_vertex"],THREE.ShaderChunk["defaultnormal_vertex"],"#ifndef FLAT_SHADED","	vNormal = normalize( transformedNormal );","#endif",THREE.ShaderChunk["begin_vertex"],THREE.ShaderChunk["displacementmap_vertex"],THREE.ShaderChunk["morphtarget_vertex"],THREE.ShaderChunk["skinning_vertex"],THREE.ShaderChunk["project_vertex"],THREE.ShaderChunk["logdepthbuf_vertex"],"	vViewPosition = - mvPosition.xyz;",THREE.ShaderChunk["worldpos_vertex"],THREE.ShaderChunk["envmap_vertex"],THREE.ShaderChunk["lights_phong_vertex"],THREE.ShaderChunk["shadowmap_vertex"],"}"].join("\n"),fragmentShader:["#define PHONG","uniform vec3 diffuse;","uniform vec3 emissive;","uniform vec3 specular;","uniform float shininess;","uniform float opacity;",THREE.ShaderChunk["common"],THREE.ShaderChunk["color_pars_fragment"],THREE.ShaderChunk["uv_pars_fragment"],THREE.ShaderChunk["uv2_pars_fragment"],THREE.ShaderChunk["map_pars_fragment"],THREE.ShaderChunk["alphamap_pars_fragment"],THREE.ShaderChunk["aomap_pars_fragment"],THREE.ShaderChunk["lightmap_pars_fragment"],THREE.ShaderChunk["emissivemap_pars_fragment"],THREE.ShaderChunk["envmap_pars_fragment"],THREE.ShaderChunk["fog_pars_fragment"],THREE.ShaderChunk["lights_phong_pars_fragment"],THREE.ShaderChunk["shadowmap_pars_fragment"],THREE.ShaderChunk["bumpmap_pars_fragment"],THREE.ShaderChunk["normalmap_pars_fragment"],THREE.ShaderChunk["specularmap_pars_fragment"],THREE.ShaderChunk["logdepthbuf_pars_fragment"],"void main() {","	vec3 outgoingLight = vec3( 0.0 );","	vec4 diffuseColor = vec4( diffuse, opacity );","	vec3 totalAmbientLight = ambientLightColor;","	vec3 totalEmissiveLight = emissive;","	vec3 shadowMask = vec3( 1.0 );",THREE.ShaderChunk["logdepthbuf_fragment"],THREE.ShaderChunk["map_fragment"],THREE.ShaderChunk["color_fragment"],THREE.ShaderChunk["alphamap_fragment"],THREE.ShaderChunk["alphatest_fragment"],THREE.ShaderChunk["specularmap_fragment"],THREE.ShaderChunk["normal_phong_fragment"],THREE.ShaderChunk["lightmap_fragment"],THREE.ShaderChunk["hemilight_fragment"],THREE.ShaderChunk["aomap_fragment"],THREE.ShaderChunk["emissivemap_fragment"],THREE.ShaderChunk["lights_phong_fragment"],THREE.ShaderChunk["shadowmap_fragment"],"totalDiffuseLight *= shadowMask;","totalSpecularLight *= shadowMask;","#ifdef METAL","	outgoingLight += diffuseColor.rgb * ( totalDiffuseLight + totalAmbientLight ) * specular + totalSpecularLight + totalEmissiveLight;","#else","	outgoingLight += diffuseColor.rgb * ( totalDiffuseLight + totalAmbientLight ) + totalSpecularLight + totalEmissiveLight;","#endif",THREE.ShaderChunk["envmap_fragment"],THREE.ShaderChunk["linear_to_gamma_fragment"],THREE.ShaderChunk["fog_fragment"],"	gl_FragColor = vec4( outgoingLight, diffuseColor.a );","}"].join("\n")},points:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib["points"],THREE.UniformsLib["shadowmap"]]),vertexShader:["uniform float size;","uniform float scale;",THREE.ShaderChunk["common"],THREE.ShaderChunk["color_pars_vertex"],THREE.ShaderChunk["shadowmap_pars_vertex"],THREE.ShaderChunk["logdepthbuf_pars_vertex"],"void main() {",THREE.ShaderChunk["color_vertex"],"	vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","	#ifdef USE_SIZEATTENUATION","		gl_PointSize = size * ( scale / length( mvPosition.xyz ) );","	#else","		gl_PointSize = size;","	#endif","	gl_Position = projectionMatrix * mvPosition;",THREE.ShaderChunk["logdepthbuf_vertex"],THREE.ShaderChunk["worldpos_vertex"],THREE.ShaderChunk["shadowmap_vertex"],"}"].join("\n"),fragmentShader:["uniform vec3 psColor;","uniform float opacity;",THREE.ShaderChunk["common"],THREE.ShaderChunk["color_pars_fragment"],THREE.ShaderChunk["map_particle_pars_fragment"],THREE.ShaderChunk["fog_pars_fragment"],THREE.ShaderChunk["shadowmap_pars_fragment"],THREE.ShaderChunk["logdepthbuf_pars_fragment"],"void main() {","	vec3 outgoingLight = vec3( 0.0 );","	vec4 diffuseColor = vec4( psColor, opacity );","	vec3 shadowMask = vec3( 1.0 );",THREE.ShaderChunk["logdepthbuf_fragment"],THREE.ShaderChunk["map_particle_fragment"],THREE.ShaderChunk["color_fragment"],THREE.ShaderChunk["alphatest_fragment"],THREE.ShaderChunk["shadowmap_fragment"],"	outgoingLight = diffuseColor.rgb * shadowMask;",THREE.ShaderChunk["fog_fragment"],"	gl_FragColor = vec4( outgoingLight, diffuseColor.a );","}"].join("\n")},dashed:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib["common"],THREE.UniformsLib["fog"],{scale:{type:"f",value:1},dashSize:{type:"f",value:1},totalSize:{type:"f",value:2}}]),vertexShader:["uniform float scale;","attribute float lineDistance;","varying float vLineDistance;",THREE.ShaderChunk["common"],THREE.ShaderChunk["color_pars_vertex"],THREE.ShaderChunk["logdepthbuf_pars_vertex"],"void main() {",THREE.ShaderChunk["color_vertex"],"	vLineDistance = scale * lineDistance;","	vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","	gl_Position = projectionMatrix * mvPosition;",THREE.ShaderChunk["logdepthbuf_vertex"],"}"].join("\n"),fragmentShader:["uniform vec3 diffuse;","uniform float opacity;","uniform float dashSize;","uniform float totalSize;","varying float vLineDistance;",THREE.ShaderChunk["common"],THREE.ShaderChunk["color_pars_fragment"],THREE.ShaderChunk["fog_pars_fragment"],THREE.ShaderChunk["logdepthbuf_pars_fragment"],"void main() {","	if ( mod( vLineDistance, totalSize ) > dashSize ) {","		discard;","	}","	vec3 outgoingLight = vec3( 0.0 );","	vec4 diffuseColor = vec4( diffuse, opacity );",THREE.ShaderChunk["logdepthbuf_fragment"],THREE.ShaderChunk["color_fragment"],"	outgoingLight = diffuseColor.rgb;",THREE.ShaderChunk["fog_fragment"],"	gl_FragColor = vec4( outgoingLight, diffuseColor.a );","}"].join("\n")},depth:{uniforms:{mNear:{type:"f",value:1},mFar:{type:"f",value:2e3},opacity:{type:"f",value:1}},vertexShader:[THREE.ShaderChunk["common"],THREE.ShaderChunk["morphtarget_pars_vertex"],THREE.ShaderChunk["logdepthbuf_pars_vertex"],"void main() {",THREE.ShaderChunk["begin_vertex"],THREE.ShaderChunk["morphtarget_vertex"],THREE.ShaderChunk["project_vertex"],THREE.ShaderChunk["logdepthbuf_vertex"],"}"].join("\n"),fragmentShader:["uniform float mNear;","uniform float mFar;","uniform float opacity;",THREE.ShaderChunk["common"],THREE.ShaderChunk["logdepthbuf_pars_fragment"],"void main() {",THREE.ShaderChunk["logdepthbuf_fragment"],"	#ifdef USE_LOGDEPTHBUF_EXT","		float depth = gl_FragDepthEXT / gl_FragCoord.w;","	#else","		float depth = gl_FragCoord.z / gl_FragCoord.w;","	#endif","	float color = 1.0 - smoothstep( mNear, mFar, depth );","	gl_FragColor = vec4( vec3( color ), opacity );","}"].join("\n")},normal:{uniforms:{opacity:{type:"f",value:1}},vertexShader:["varying vec3 vNormal;",THREE.ShaderChunk["common"],THREE.ShaderChunk["morphtarget_pars_vertex"],THREE.ShaderChunk["logdepthbuf_pars_vertex"],"void main() {","	vNormal = normalize( normalMatrix * normal );",THREE.ShaderChunk["begin_vertex"],THREE.ShaderChunk["morphtarget_vertex"],THREE.ShaderChunk["project_vertex"],THREE.ShaderChunk["logdepthbuf_vertex"],"}"].join("\n"),fragmentShader:["uniform float opacity;","varying vec3 vNormal;",THREE.ShaderChunk["common"],THREE.ShaderChunk["logdepthbuf_pars_fragment"],"void main() {","	gl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );",THREE.ShaderChunk["logdepthbuf_fragment"],"}"].join("\n")},cube:{uniforms:{tCube:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.ShaderChunk["common"],THREE.ShaderChunk["logdepthbuf_pars_vertex"],"void main() {","	vWorldPosition = transformDirection( position, modelMatrix );","	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk["logdepthbuf_vertex"],"}"].join("\n"),fragmentShader:["uniform samplerCube tCube;","uniform float tFlip;","varying vec3 vWorldPosition;",THREE.ShaderChunk["common"],THREE.ShaderChunk["logdepthbuf_pars_fragment"],"void main() {","	gl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );",THREE.ShaderChunk["logdepthbuf_fragment"],"}"].join("\n")},equirect:{uniforms:{tEquirect:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.ShaderChunk["common"],THREE.ShaderChunk["logdepthbuf_pars_vertex"],"void main() {","	vWorldPosition = transformDirection( position, modelMatrix );","	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk["logdepthbuf_vertex"],"}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;","uniform float tFlip;","varying vec3 vWorldPosition;",THREE.ShaderChunk["common"],THREE.ShaderChunk["logdepthbuf_pars_fragment"],"void main() {","vec3 direction = normalize( vWorldPosition );","vec2 sampleUV;","sampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );","sampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;","gl_FragColor = texture2D( tEquirect, sampleUV );",THREE.ShaderChunk["logdepthbuf_fragment"],"}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk["common"],THREE.ShaderChunk["morphtarget_pars_vertex"],THREE.ShaderChunk["skinning_pars_vertex"],THREE.ShaderChunk["logdepthbuf_pars_vertex"],"void main() {",THREE.ShaderChunk["skinbase_vertex"],THREE.ShaderChunk["begin_vertex"],THREE.ShaderChunk["morphtarget_vertex"],THREE.ShaderChunk["skinning_vertex"],THREE.ShaderChunk["project_vertex"],THREE.ShaderChunk["logdepthbuf_vertex"],"}"].join("\n"),fragmentShader:[THREE.ShaderChunk["common"],THREE.ShaderChunk["logdepthbuf_pars_fragment"],"vec4 pack_depth( const in float depth ) {","	const vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );","	const vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );","	vec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );","	res -= res.xxyz * bit_mask;","	return res;","}","void main() {",THREE.ShaderChunk["logdepthbuf_fragment"],"	#ifdef USE_LOGDEPTHBUF_EXT","		gl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );","	#else","		gl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );","	#endif","}"].join("\n")},distanceRGBA:{uniforms:{lightPos:{type:"v3",value:new THREE.Vector3(0,0,0)}},vertexShader:["varying vec4 vWorldPosition;",THREE.ShaderChunk["common"],THREE.ShaderChunk["morphtarget_pars_vertex"],THREE.ShaderChunk["skinning_pars_vertex"],"void main() {",THREE.ShaderChunk["skinbase_vertex"],THREE.ShaderChunk["begin_vertex"],THREE.ShaderChunk["morphtarget_vertex"],THREE.ShaderChunk["skinning_vertex"],THREE.ShaderChunk["project_vertex"],THREE.ShaderChunk["worldpos_vertex"],"vWorldPosition = worldPosition;","}"].join("\n"),fragmentShader:["uniform vec3 lightPos;","varying vec4 vWorldPosition;",THREE.ShaderChunk["common"],"vec4 pack1K ( float depth ) {","   depth /= 1000.0;","   const vec4 bitSh = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );","	const vec4 bitMsk = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );","	vec4 res = fract( depth * bitSh );","	res -= res.xxyz * bitMsk;","	return res; ","}","float unpack1K ( vec4 color ) {","	const vec4 bitSh = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );","	return dot( color, bitSh ) * 1000.0;","}","void main () {","	gl_FragColor = pack1K( length( vWorldPosition.xyz - lightPos.xyz ) );","}"].join("\n")}};THREE.WebGLRenderer=function(e){console.log("THREE.WebGLRenderer",THREE.REVISION);e=e||{};var t=e.canvas!==undefined?e.canvas:document.createElement("canvas"),r=e.context!==undefined?e.context:null,i=t.width,n=t.height,a=1,o=e.alpha!==undefined?e.alpha:false,s=e.depth!==undefined?e.depth:true,h=e.stencil!==undefined?e.stencil:true,u=e.antialias!==undefined?e.antialias:false,c=e.premultipliedAlpha!==undefined?e.premultipliedAlpha:true,l=e.preserveDrawingBuffer!==undefined?e.preserveDrawingBuffer:false,f=new THREE.Color(0),E=0;var d=[];var p=[];var m=-1;var v=[];var T=-1;var g=new Float32Array(8);var y=[];var R=[];this.domElement=t;this.context=null;this.autoClear=true;this.autoClearColor=true;this.autoClearDepth=true;this.autoClearStencil=true;this.sortObjects=true;this.gammaFactor=2;this.gammaInput=false;this.gammaOutput=false;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=true;var H=this,x=null,b=null,w=-1,M="",S=null,_=0,A=0,C=0,L=t.width,P=t.height,D=0,k=0,V=new THREE.Frustum,F=new THREE.Matrix4,U=new THREE.Vector3,O=new THREE.Vector3,B=true,G={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[],decays:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[],decays:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},I={geometries:0,textures:0},N={calls:0,vertices:0,faces:0,points:0};this.info={render:N,memory:I,programs:null};var z;try{var j={alpha:o,depth:s,stencil:h,antialias:u,premultipliedAlpha:c,preserveDrawingBuffer:l};z=r||t.getContext("webgl",j)||t.getContext("experimental-webgl",j);if(z===null){if(t.getContext("webgl")!==null){throw"Error creating WebGL context with your selected attributes."}else{throw"Error creating WebGL context."}}t.addEventListener("webglcontextlost",oe,false)}catch(W){console.error("THREE.WebGLRenderer: "+W)}var X=new THREE.WebGLExtensions(z);X.get("OES_texture_float");X.get("OES_texture_float_linear");X.get("OES_texture_half_float");X.get("OES_texture_half_float_linear");X.get("OES_standard_derivatives");X.get("ANGLE_instanced_arrays");if(X.get("OES_element_index_uint")){THREE.BufferGeometry.MaxIndex=4294967296}var q=new THREE.WebGLCapabilities(z,X,e);var Y=new THREE.WebGLState(z,X,Ze);var K=new THREE.WebGLProperties;var Q=new THREE.WebGLObjects(z,K,this.info);var Z=new THREE.WebGLPrograms(this,q);this.info.programs=Z.programs;var J=new THREE.WebGLBufferRenderer(z,X,N);var $=new THREE.WebGLIndexedBufferRenderer(z,X,N);function ee(e,t,r,i){if(c===true){e*=i;t*=i;r*=i}z.clearColor(e,t,r,i)}function te(){Y.init();z.viewport(A,C,L,P);ee(f.r,f.g,f.b,E)}function re(){x=null;S=null;M="";w=-1;B=true;Y.reset()}te();this.context=z;this.capabilities=q;this.extensions=X;this.state=Y;var ie=new THREE.WebGLShadowMap(this,d,Q);this.shadowMap=ie;var ne=new THREE.SpritePlugin(this,y);var ae=new THREE.LensFlarePlugin(this,R);this.getContext=function(){return z};this.getContextAttributes=function(){return z.getContextAttributes()};this.forceContextLoss=function(){X.get("WEBGL_lose_context").loseContext()};this.getMaxAnisotropy=function(){var e;return function t(){if(e!==undefined)return e;var t=X.get("EXT_texture_filter_anisotropic");if(t!==null){e=z.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else{e=0}return e}}();this.getPrecision=function(){return q.precision};this.getPixelRatio=function(){return a};this.setPixelRatio=function(e){if(e!==undefined)a=e};this.getSize=function(){return{width:i,height:n}};this.setSize=function(e,r,o){i=e;n=r;t.width=e*a;t.height=r*a;if(o!==false){t.style.width=e+"px";t.style.height=r+"px"}this.setViewport(0,0,e,r)};this.setViewport=function(e,t,r,i){A=e*a;C=t*a;L=r*a;P=i*a;z.viewport(A,C,L,P)};this.getViewport=function(e){e.x=A/a;e.y=C/a;e.z=L/a;e.w=P/a};this.setScissor=function(e,t,r,i){z.scissor(e*a,t*a,r*a,i*a)};this.enableScissorTest=function(e){Y.setScissorTest(e)};this.getClearColor=function(){return f};this.setClearColor=function(e,t){f.set(e);E=t!==undefined?t:1;ee(f.r,f.g,f.b,E)};this.getClearAlpha=function(){return E};this.setClearAlpha=function(e){E=e;ee(f.r,f.g,f.b,E)};this.clear=function(e,t,r){var i=0;if(e===undefined||e)i|=z.COLOR_BUFFER_BIT;if(t===undefined||t)i|=z.DEPTH_BUFFER_BIT;if(r===undefined||r)i|=z.STENCIL_BUFFER_BIT;z.clear(i)};this.clearColor=function(){z.clear(z.COLOR_BUFFER_BIT)};this.clearDepth=function(){z.clear(z.DEPTH_BUFFER_BIT)};this.clearStencil=function(){z.clear(z.STENCIL_BUFFER_BIT)};this.clearTarget=function(e,t,r,i){this.setRenderTarget(e);this.clear(t,r,i)};this.resetGLState=re;this.properties=K;this.dispose=function(){t.removeEventListener("webglcontextlost",oe,false)};function oe(e){e.preventDefault();re();te();K.clear()}function se(e){var t=e.target;t.removeEventListener("dispose",se);ce(t);I.textures--}function he(e){var t=e.target;t.removeEventListener("dispose",he);le(t);I.textures--}function ue(e){var t=e.target;t.removeEventListener("dispose",ue);fe(t)}function ce(e){var t=K.get(e);if(e.image&&t.__image__webglTextureCube){z.deleteTexture(t.__image__webglTextureCube)}else{if(t.__webglInit===undefined)return;z.deleteTexture(t.__webglTexture)}K.delete(e)}function le(e){var t=K.get(e);var r=K.get(e.texture);if(!e||r.__webglTexture===undefined)return;z.deleteTexture(r.__webglTexture);if(e instanceof THREE.WebGLRenderTargetCube){for(var i=0;i<6;i++){z.deleteFramebuffer(t.__webglFramebuffer[i]);z.deleteRenderbuffer(t.__webglRenderbuffer[i])}}else{z.deleteFramebuffer(t.__webglFramebuffer);z.deleteRenderbuffer(t.__webglRenderbuffer)}K.delete(e.texture);K.delete(e)}function fe(e){Ee(e);K.delete(e)}function Ee(e){var t=K.get(e).program;e.program=undefined;if(t!==undefined){Z.releaseProgram(t)}}this.renderBufferImmediate=function(e,t,r){Y.initAttributes();var i=K.get(e);if(e.hasPositions&&!i.position)i.position=z.createBuffer();if(e.hasNormals&&!i.normal)i.normal=z.createBuffer();if(e.hasUvs&&!i.uv)i.uv=z.createBuffer();if(e.hasColors&&!i.color)i.color=z.createBuffer();var n=t.getAttributes();if(e.hasPositions){z.bindBuffer(z.ARRAY_BUFFER,i.position);z.bufferData(z.ARRAY_BUFFER,e.positionArray,z.DYNAMIC_DRAW);Y.enableAttribute(n.position);z.vertexAttribPointer(n.position,3,z.FLOAT,false,0,0)}if(e.hasNormals){z.bindBuffer(z.ARRAY_BUFFER,i.normal);if(r.type!=="MeshPhongMaterial"&&r.shading===THREE.FlatShading){for(var a=0,o=e.count*3;a<o;a+=9){var s=e.normalArray;var h=(s[a+0]+s[a+3]+s[a+6])/3;var u=(s[a+1]+s[a+4]+s[a+7])/3;var c=(s[a+2]+s[a+5]+s[a+8])/3;s[a+0]=h;s[a+1]=u;s[a+2]=c;s[a+3]=h;s[a+4]=u;s[a+5]=c;s[a+6]=h;s[a+7]=u;s[a+8]=c}}z.bufferData(z.ARRAY_BUFFER,e.normalArray,z.DYNAMIC_DRAW);Y.enableAttribute(n.normal);z.vertexAttribPointer(n.normal,3,z.FLOAT,false,0,0)}if(e.hasUvs&&r.map){z.bindBuffer(z.ARRAY_BUFFER,i.uv);z.bufferData(z.ARRAY_BUFFER,e.uvArray,z.DYNAMIC_DRAW);Y.enableAttribute(n.uv);z.vertexAttribPointer(n.uv,2,z.FLOAT,false,0,0)}if(e.hasColors&&r.vertexColors!==THREE.NoColors){z.bindBuffer(z.ARRAY_BUFFER,i.color);z.bufferData(z.ARRAY_BUFFER,e.colorArray,z.DYNAMIC_DRAW);Y.enableAttribute(n.color);z.vertexAttribPointer(n.color,3,z.FLOAT,false,0,0)}Y.disableUnusedAttributes();z.drawArrays(z.TRIANGLES,0,e.count);e.count=0};this.renderBufferDirect=function(e,t,r,i,n,o,s){He(n);var h=be(e,t,r,n,o);var u=false;var c=i.id+"_"+h.id+"_"+n.wireframe;if(c!==M){M=c;u=true}var l=o.morphTargetInfluences;if(l!==undefined){var f=[];for(var E=0,d=l.length;E<d;E++){var p=l[E];f.push([p,E])}f.sort(pe);if(f.length>8){f.length=8}var m=i.morphAttributes;for(var E=0,d=f.length;E<d;E++){var p=f[E];g[E]=p[0];if(p[0]!==0){var v=p[1];if(n.morphTargets===true&&m.position)i.addAttribute("morphTarget"+E,m.position[v]);if(n.morphNormals===true&&m.normal)i.addAttribute("morphNormal"+E,m.normal[v])}else{if(n.morphTargets===true)i.removeAttribute("morphTarget"+E);if(n.morphNormals===true)i.removeAttribute("morphNormal"+E)}}var T=h.getUniforms();if(T.morphTargetInfluences!==null){z.uniform1fv(T.morphTargetInfluences,g)}u=true}var v=i.index;var y=i.attributes.position;if(n.wireframe===true){v=Q.getWireframeAttribute(i)}var R;if(v!==null){R=$;R.setIndex(v)}else{R=J}if(u){de(n,h,i);if(v!==null){z.bindBuffer(z.ELEMENT_ARRAY_BUFFER,Q.getAttributeBuffer(v))}}var H=0;var x=Infinity;if(v!==null){x=v.count}else if(y!==undefined){x=y.count}var b=i.drawRange.start;var w=i.drawRange.count;var S=s!==null?s.start:0;var _=s!==null?s.count:Infinity;var A=Math.max(H,b,S);var C=Math.min(H+x,b+w,S+_)-1;var L=Math.max(0,C-A+1);if(o instanceof THREE.Mesh){if(n.wireframe===true){Y.setLineWidth(n.wireframeLinewidth*a);R.setMode(z.LINES)}else{R.setMode(z.TRIANGLES)}if(i instanceof THREE.InstancedBufferGeometry&&i.maxInstancedCount>0){R.renderInstances(i)}else{R.render(A,L)}}else if(o instanceof THREE.Line){var P=n.linewidth;if(P===undefined)P=1;Y.setLineWidth(P*a);if(o instanceof THREE.LineSegments){R.setMode(z.LINES)}else{R.setMode(z.LINE_STRIP)}R.render(A,L)}else if(o instanceof THREE.Points){R.setMode(z.POINTS);R.render(A,L)}};function de(e,t,r,i){var n;if(r instanceof THREE.InstancedBufferGeometry){n=X.get("ANGLE_instanced_arrays");if(n===null){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}}if(i===undefined)i=0;Y.initAttributes();var a=r.attributes;var o=t.getAttributes();var s=e.defaultAttributeValues;for(var h in o){var u=o[h];if(u>=0){var c=a[h];if(c!==undefined){var l=c.itemSize;var f=Q.getAttributeBuffer(c);if(c instanceof THREE.InterleavedBufferAttribute){var E=c.data;var d=E.stride;var p=c.offset;if(E instanceof THREE.InstancedInterleavedBuffer){Y.enableAttributeAndDivisor(u,E.meshPerAttribute,n);if(r.maxInstancedCount===undefined){r.maxInstancedCount=E.meshPerAttribute*E.count}}else{Y.enableAttribute(u)}z.bindBuffer(z.ARRAY_BUFFER,f);z.vertexAttribPointer(u,l,z.FLOAT,false,d*E.array.BYTES_PER_ELEMENT,(i*d+p)*E.array.BYTES_PER_ELEMENT)}else{if(c instanceof THREE.InstancedBufferAttribute){Y.enableAttributeAndDivisor(u,c.meshPerAttribute,n);if(r.maxInstancedCount===undefined){r.maxInstancedCount=c.meshPerAttribute*c.count}}else{Y.enableAttribute(u)}z.bindBuffer(z.ARRAY_BUFFER,f);z.vertexAttribPointer(u,l,z.FLOAT,false,0,i*l*4);
}}else if(s!==undefined){var m=s[h];if(m!==undefined){switch(m.length){case 2:z.vertexAttrib2fv(u,m);break;case 3:z.vertexAttrib3fv(u,m);break;case 4:z.vertexAttrib4fv(u,m);break;default:z.vertexAttrib1fv(u,m)}}}}}Y.disableUnusedAttributes()}function pe(e,t){return t[0]-e[0]}function me(e,t){if(e.object.renderOrder!==t.object.renderOrder){return e.object.renderOrder-t.object.renderOrder}else if(e.material.id!==t.material.id){return e.material.id-t.material.id}else if(e.z!==t.z){return e.z-t.z}else{return e.id-t.id}}function ve(e,t){if(e.object.renderOrder!==t.object.renderOrder){return e.object.renderOrder-t.object.renderOrder}if(e.z!==t.z){return t.z-e.z}else{return e.id-t.id}}this.render=function(e,t,r,i){if(t instanceof THREE.Camera===false){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}var n=e.fog;M="";w=-1;S=null;B=true;if(e.autoUpdate===true)e.updateMatrixWorld();if(t.parent===null)t.updateMatrixWorld();t.matrixWorldInverse.getInverse(t.matrixWorld);F.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse);V.setFromMatrix(F);d.length=0;m=-1;T=-1;y.length=0;R.length=0;ge(e,t);p.length=m+1;v.length=T+1;if(H.sortObjects===true){p.sort(me);v.sort(ve)}ie.render(e);N.calls=0;N.vertices=0;N.faces=0;N.points=0;this.setRenderTarget(r);if(this.autoClear||i){this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil)}if(e.overrideMaterial){var a=e.overrideMaterial;ye(p,t,d,n,a);ye(v,t,d,n,a)}else{Y.setBlending(THREE.NoBlending);ye(p,t,d,n);ye(v,t,d,n)}ne.render(e,t);ae.render(e,t,D,k);if(r){var o=r.texture;var s=Ne(r);if(o.generateMipmaps&&s&&o.minFilter!==THREE.NearestFilter&&o.minFilter!==THREE.LinearFilter){Ke(r)}}Y.setDepthTest(true);Y.setDepthWrite(true);Y.setColorWrite(true)};function Te(e,t,r,i,n){var a,o;if(r.transparent){a=v;o=++T}else{a=p;o=++m}var s=a[o];if(s!==undefined){s.id=e.id;s.object=e;s.geometry=t;s.material=r;s.z=U.z;s.group=n}else{s={id:e.id,object:e,geometry:t,material:r,z:U.z,group:n};a.push(s)}}function ge(e,t){if(e.visible===false)return;if((e.channels.mask&t.channels.mask)!==0){if(e instanceof THREE.Light){d.push(e)}else if(e instanceof THREE.Sprite){y.push(e)}else if(e instanceof THREE.LensFlare){R.push(e)}else if(e instanceof THREE.ImmediateRenderObject){if(H.sortObjects===true){U.setFromMatrixPosition(e.matrixWorld);U.applyProjection(F)}Te(e,null,e.material,U.z,null)}else if(e instanceof THREE.Mesh||e instanceof THREE.Line||e instanceof THREE.Points){if(e instanceof THREE.SkinnedMesh){e.skeleton.update()}if(e.frustumCulled===false||V.intersectsObject(e)===true){var r=e.material;if(r.visible===true){if(H.sortObjects===true){U.setFromMatrixPosition(e.matrixWorld);U.applyProjection(F)}var i=Q.update(e);if(r instanceof THREE.MeshFaceMaterial){var n=i.groups;var a=r.materials;for(var o=0,s=n.length;o<s;o++){var h=n[o];var u=a[h.materialIndex];if(u.visible===true){Te(e,i,u,U.z,h)}}}else{Te(e,i,r,U.z,null)}}}}}var c=e.children;for(var o=0,s=c.length;o<s;o++){ge(c[o],t)}}function ye(e,t,r,i,n){for(var a=0,o=e.length;a<o;a++){var s=e[a];var h=s.object;var u=s.geometry;var c=n===undefined?s.material:n;var l=s.group;h.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse,h.matrixWorld);h.normalMatrix.getNormalMatrix(h.modelViewMatrix);if(h instanceof THREE.ImmediateRenderObject){He(c);var f=be(t,r,i,c,h);M="";h.render(function(e){H.renderBufferImmediate(e,f,c)})}else{H.renderBufferDirect(t,r,i,u,c,h,l)}}}function Re(e,t,r,i){var n=K.get(e);var a=Z.getParameters(e,t,r,i);var o=Z.getProgramCode(e,a);var s=n.program;var h=true;if(s===undefined){e.addEventListener("dispose",ue)}else if(s.code!==o){Ee(e)}else if(a.shaderID!==undefined){return}else{h=false}if(h){if(a.shaderID){var u=THREE.ShaderLib[a.shaderID];n.__webglShader={name:e.type,uniforms:THREE.UniformsUtils.clone(u.uniforms),vertexShader:u.vertexShader,fragmentShader:u.fragmentShader}}else{n.__webglShader={name:e.type,uniforms:e.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader}}e.__webglShader=n.__webglShader;s=Z.acquireProgram(e,a,o);n.program=s;e.program=s}var c=s.getAttributes();if(e.morphTargets){e.numSupportedMorphTargets=0;for(var l=0;l<H.maxMorphTargets;l++){if(c["morphTarget"+l]>=0){e.numSupportedMorphTargets++}}}if(e.morphNormals){e.numSupportedMorphNormals=0;for(l=0;l<H.maxMorphNormals;l++){if(c["morphNormal"+l]>=0){e.numSupportedMorphNormals++}}}n.uniformsList=[];var f=n.program.getUniforms();for(var E in n.__webglShader.uniforms){var d=f[E];if(d){n.uniformsList.push([n.__webglShader.uniforms[E],d])}}}function He(e){xe(e);if(e.transparent===true){Y.setBlending(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha)}else{Y.setBlending(THREE.NoBlending)}Y.setDepthFunc(e.depthFunc);Y.setDepthTest(e.depthTest);Y.setDepthWrite(e.depthWrite);Y.setColorWrite(e.colorWrite);Y.setPolygonOffset(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits)}function xe(e){e.side!==THREE.DoubleSide?Y.enable(z.CULL_FACE):Y.disable(z.CULL_FACE);Y.setFlipSided(e.side===THREE.BackSide)}function be(e,t,r,i,n){_=0;var a=K.get(i);if(i.needsUpdate||!a.program){Re(i,t,r,n);i.needsUpdate=false}var o=false;var s=false;var h=false;var u=a.program,c=u.getUniforms(),l=a.__webglShader.uniforms;if(u.id!==x){z.useProgram(u.program);x=u.id;o=true;s=true;h=true}if(i.id!==w){if(w===-1)h=true;w=i.id;s=true}if(o||e!==S){z.uniformMatrix4fv(c.projectionMatrix,false,e.projectionMatrix.elements);if(q.logarithmicDepthBuffer){z.uniform1f(c.logDepthBufFC,2/(Math.log(e.far+1)/Math.LN2))}if(e!==S)S=e;if(i instanceof THREE.ShaderMaterial||i instanceof THREE.MeshPhongMaterial||i.envMap){if(c.cameraPosition!==undefined){U.setFromMatrixPosition(e.matrixWorld);z.uniform3f(c.cameraPosition,U.x,U.y,U.z)}}if(i instanceof THREE.MeshPhongMaterial||i instanceof THREE.MeshLambertMaterial||i instanceof THREE.MeshBasicMaterial||i instanceof THREE.ShaderMaterial||i.skinning){if(c.viewMatrix!==undefined){z.uniformMatrix4fv(c.viewMatrix,false,e.matrixWorldInverse.elements)}}}if(i.skinning){if(n.bindMatrix&&c.bindMatrix!==undefined){z.uniformMatrix4fv(c.bindMatrix,false,n.bindMatrix.elements)}if(n.bindMatrixInverse&&c.bindMatrixInverse!==undefined){z.uniformMatrix4fv(c.bindMatrixInverse,false,n.bindMatrixInverse.elements)}if(q.floatVertexTextures&&n.skeleton&&n.skeleton.useVertexTexture){if(c.boneTexture!==undefined){var f=Ve();z.uniform1i(c.boneTexture,f);H.setTexture(n.skeleton.boneTexture,f)}if(c.boneTextureWidth!==undefined){z.uniform1i(c.boneTextureWidth,n.skeleton.boneTextureWidth)}if(c.boneTextureHeight!==undefined){z.uniform1i(c.boneTextureHeight,n.skeleton.boneTextureHeight)}}else if(n.skeleton&&n.skeleton.boneMatrices){if(c.boneGlobalMatrices!==undefined){z.uniformMatrix4fv(c.boneGlobalMatrices,false,n.skeleton.boneMatrices)}}}if(s){if(r&&i.fog){Ae(l,r)}if(i instanceof THREE.MeshPhongMaterial||i instanceof THREE.MeshLambertMaterial||i.lights){if(B){h=true;Oe(t,e);B=false}if(h){Le(l,G);Pe(l,true)}else{Pe(l,false)}}if(i instanceof THREE.MeshBasicMaterial||i instanceof THREE.MeshLambertMaterial||i instanceof THREE.MeshPhongMaterial){we(l,i)}if(i instanceof THREE.LineBasicMaterial){Me(l,i)}else if(i instanceof THREE.LineDashedMaterial){Me(l,i);Se(l,i)}else if(i instanceof THREE.PointsMaterial){_e(l,i)}else if(i instanceof THREE.MeshPhongMaterial){Ce(l,i)}else if(i instanceof THREE.MeshDepthMaterial){l.mNear.value=e.near;l.mFar.value=e.far;l.opacity.value=i.opacity}else if(i instanceof THREE.MeshNormalMaterial){l.opacity.value=i.opacity}if(n.receiveShadow&&!i._shadowPass){De(l,t,e)}Fe(a.uniformsList)}ke(c,n);if(c.modelMatrix!==undefined){z.uniformMatrix4fv(c.modelMatrix,false,n.matrixWorld.elements)}return u}function we(e,t){e.opacity.value=t.opacity;e.diffuse.value=t.color;if(t.emissive){e.emissive.value=t.emissive}e.map.value=t.map;e.specularMap.value=t.specularMap;e.alphaMap.value=t.alphaMap;if(t.aoMap){e.aoMap.value=t.aoMap;e.aoMapIntensity.value=t.aoMapIntensity}var r;if(t.map){r=t.map}else if(t.specularMap){r=t.specularMap}else if(t.displacementMap){r=t.displacementMap}else if(t.normalMap){r=t.normalMap}else if(t.bumpMap){r=t.bumpMap}else if(t.alphaMap){r=t.alphaMap}else if(t.emissiveMap){r=t.emissiveMap}if(r!==undefined){if(r instanceof THREE.WebGLRenderTarget)r=r.texture;var i=r.offset;var n=r.repeat;e.offsetRepeat.value.set(i.x,i.y,n.x,n.y)}e.envMap.value=t.envMap;e.flipEnvMap.value=t.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;e.reflectivity.value=t.reflectivity;e.refractionRatio.value=t.refractionRatio}function Me(e,t){e.diffuse.value=t.color;e.opacity.value=t.opacity}function Se(e,t){e.dashSize.value=t.dashSize;e.totalSize.value=t.dashSize+t.gapSize;e.scale.value=t.scale}function _e(e,r){e.psColor.value=r.color;e.opacity.value=r.opacity;e.size.value=r.size;e.scale.value=t.height/2;e.map.value=r.map;if(r.map!==null){var i=r.map.offset;var n=r.map.repeat;e.offsetRepeat.value.set(i.x,i.y,n.x,n.y)}}function Ae(e,t){e.fogColor.value=t.color;if(t instanceof THREE.Fog){e.fogNear.value=t.near;e.fogFar.value=t.far}else if(t instanceof THREE.FogExp2){e.fogDensity.value=t.density}}function Ce(e,t){e.specular.value=t.specular;e.shininess.value=Math.max(t.shininess,1e-4);if(t.lightMap){e.lightMap.value=t.lightMap;e.lightMapIntensity.value=t.lightMapIntensity}if(t.emissiveMap){e.emissiveMap.value=t.emissiveMap}if(t.bumpMap){e.bumpMap.value=t.bumpMap;e.bumpScale.value=t.bumpScale}if(t.normalMap){e.normalMap.value=t.normalMap;e.normalScale.value.copy(t.normalScale)}if(t.displacementMap){e.displacementMap.value=t.displacementMap;e.displacementScale.value=t.displacementScale;e.displacementBias.value=t.displacementBias}}function Le(e,t){e.ambientLightColor.value=t.ambient;e.directionalLightColor.value=t.directional.colors;e.directionalLightDirection.value=t.directional.positions;e.pointLightColor.value=t.point.colors;e.pointLightPosition.value=t.point.positions;e.pointLightDistance.value=t.point.distances;e.pointLightDecay.value=t.point.decays;e.spotLightColor.value=t.spot.colors;e.spotLightPosition.value=t.spot.positions;e.spotLightDistance.value=t.spot.distances;e.spotLightDirection.value=t.spot.directions;e.spotLightAngleCos.value=t.spot.anglesCos;e.spotLightExponent.value=t.spot.exponents;e.spotLightDecay.value=t.spot.decays;e.hemisphereLightSkyColor.value=t.hemi.skyColors;e.hemisphereLightGroundColor.value=t.hemi.groundColors;e.hemisphereLightDirection.value=t.hemi.positions}function Pe(e,t){e.ambientLightColor.needsUpdate=t;e.directionalLightColor.needsUpdate=t;e.directionalLightDirection.needsUpdate=t;e.pointLightColor.needsUpdate=t;e.pointLightPosition.needsUpdate=t;e.pointLightDistance.needsUpdate=t;e.pointLightDecay.needsUpdate=t;e.spotLightColor.needsUpdate=t;e.spotLightPosition.needsUpdate=t;e.spotLightDistance.needsUpdate=t;e.spotLightDirection.needsUpdate=t;e.spotLightAngleCos.needsUpdate=t;e.spotLightExponent.needsUpdate=t;e.spotLightDecay.needsUpdate=t;e.hemisphereLightSkyColor.needsUpdate=t;e.hemisphereLightGroundColor.needsUpdate=t;e.hemisphereLightDirection.needsUpdate=t}function De(e,t,r){if(e.shadowMatrix){var i=0;for(var n=0,a=t.length;n<a;n++){var o=t[n];if(o.castShadow===true){if(o instanceof THREE.PointLight||o instanceof THREE.SpotLight||o instanceof THREE.DirectionalLight){var s=o.shadow;if(o instanceof THREE.PointLight){U.setFromMatrixPosition(o.matrixWorld).negate();s.matrix.identity().setPosition(U);e.shadowDarkness.value[i]=-s.darkness}else{e.shadowDarkness.value[i]=s.darkness}e.shadowMatrix.value[i]=s.matrix;e.shadowMap.value[i]=s.map;e.shadowMapSize.value[i]=s.mapSize;e.shadowBias.value[i]=s.bias;e.shadowBlur.value[i]=s.blur;i++}}}}}function ke(e,t){z.uniformMatrix4fv(e.modelViewMatrix,false,t.modelViewMatrix.elements);if(e.normalMatrix){z.uniformMatrix3fv(e.normalMatrix,false,t.normalMatrix.elements)}}function Ve(){var e=_;if(e>=q.maxTextures){console.warn("WebGLRenderer: trying to use "+e+" texture units while this GPU supports only "+q.maxTextures)}_+=1;return e}function Fe(e){var t,r;for(var i=0,n=e.length;i<n;i++){var a=e[i][0];if(a.needsUpdate===false)continue;var o=a.type;var s=a.value;var h=e[i][1];switch(o){case"1i":z.uniform1i(h,s);break;case"1f":z.uniform1f(h,s);break;case"2f":z.uniform2f(h,s[0],s[1]);break;case"3f":z.uniform3f(h,s[0],s[1],s[2]);break;case"4f":z.uniform4f(h,s[0],s[1],s[2],s[3]);break;case"1iv":z.uniform1iv(h,s);break;case"3iv":z.uniform3iv(h,s);break;case"1fv":z.uniform1fv(h,s);break;case"2fv":z.uniform2fv(h,s);break;case"3fv":z.uniform3fv(h,s);break;case"4fv":z.uniform4fv(h,s);break;case"Matrix3fv":z.uniformMatrix3fv(h,false,s);break;case"Matrix4fv":z.uniformMatrix4fv(h,false,s);break;case"i":z.uniform1i(h,s);break;case"f":z.uniform1f(h,s);break;case"v2":z.uniform2f(h,s.x,s.y);break;case"v3":z.uniform3f(h,s.x,s.y,s.z);break;case"v4":z.uniform4f(h,s.x,s.y,s.z,s.w);break;case"c":z.uniform3f(h,s.r,s.g,s.b);break;case"iv1":z.uniform1iv(h,s);break;case"iv":z.uniform3iv(h,s);break;case"fv1":z.uniform1fv(h,s);break;case"fv":z.uniform3fv(h,s);break;case"v2v":if(a._array===undefined){a._array=new Float32Array(2*s.length)}for(var u=0,c=0,l=s.length;u<l;u++,c+=2){a._array[c+0]=s[u].x;a._array[c+1]=s[u].y}z.uniform2fv(h,a._array);break;case"v3v":if(a._array===undefined){a._array=new Float32Array(3*s.length)}for(var u=0,f=0,l=s.length;u<l;u++,f+=3){a._array[f+0]=s[u].x;a._array[f+1]=s[u].y;a._array[f+2]=s[u].z}z.uniform3fv(h,a._array);break;case"v4v":if(a._array===undefined){a._array=new Float32Array(4*s.length)}for(var u=0,E=0,l=s.length;u<l;u++,E+=4){a._array[E+0]=s[u].x;a._array[E+1]=s[u].y;a._array[E+2]=s[u].z;a._array[E+3]=s[u].w}z.uniform4fv(h,a._array);break;case"m3":z.uniformMatrix3fv(h,false,s.elements);break;case"m3v":if(a._array===undefined){a._array=new Float32Array(9*s.length)}for(var u=0,l=s.length;u<l;u++){s[u].flattenToArrayOffset(a._array,u*9)}z.uniformMatrix3fv(h,false,a._array);break;case"m4":z.uniformMatrix4fv(h,false,s.elements);break;case"m4v":if(a._array===undefined){a._array=new Float32Array(16*s.length)}for(var u=0,l=s.length;u<l;u++){s[u].flattenToArrayOffset(a._array,u*16)}z.uniformMatrix4fv(h,false,a._array);break;case"t":t=s;r=Ve();z.uniform1i(h,r);if(!t)continue;if(t instanceof THREE.CubeTexture||Array.isArray(t.image)&&t.image.length===6){We(t,r)}else if(t instanceof THREE.WebGLRenderTargetCube){Xe(t.texture,r)}else if(t instanceof THREE.WebGLRenderTarget){H.setTexture(t.texture,r)}else{H.setTexture(t,r)}break;case"tv":if(a._array===undefined){a._array=[]}for(var u=0,l=a.value.length;u<l;u++){a._array[u]=Ve()}z.uniform1iv(h,a._array);for(var u=0,l=a.value.length;u<l;u++){t=a.value[u];r=a._array[u];if(!t)continue;if(t instanceof THREE.CubeTexture||t.image instanceof Array&&t.image.length===6){We(t,r)}else if(t instanceof THREE.WebGLRenderTarget){H.setTexture(t.texture,r)}else if(t instanceof THREE.WebGLRenderTargetCube){Xe(t.texture,r)}else{H.setTexture(t,r)}}break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+o)}}}function Ue(e,t,r,i){e[t+0]=r.r*i;e[t+1]=r.g*i;e[t+2]=r.b*i}function Oe(e,t){var r,i,n,a=0,o=0,s=0,h,u,c,l,f,E=G,d=t.matrixWorldInverse,p=E.directional.colors,m=E.directional.positions,v=E.point.colors,T=E.point.positions,g=E.point.distances,y=E.point.decays,R=E.spot.colors,H=E.spot.positions,x=E.spot.distances,b=E.spot.directions,w=E.spot.anglesCos,M=E.spot.exponents,S=E.spot.decays,_=E.hemi.skyColors,A=E.hemi.groundColors,C=E.hemi.positions,L=0,P=0,D=0,k=0,V=0,F=0,B=0,I=0,N=0,z=0,j=0,W=0;for(r=0,i=e.length;r<i;r++){n=e[r];h=n.color;l=n.intensity;f=n.distance;if(n instanceof THREE.AmbientLight){if(!n.visible)continue;a+=h.r;o+=h.g;s+=h.b}else if(n instanceof THREE.DirectionalLight){V+=1;if(!n.visible)continue;O.setFromMatrixPosition(n.matrixWorld);U.setFromMatrixPosition(n.target.matrixWorld);O.sub(U);O.transformDirection(d);N=L*3;m[N+0]=O.x;m[N+1]=O.y;m[N+2]=O.z;Ue(p,N,h,l);L+=1}else if(n instanceof THREE.PointLight){F+=1;if(!n.visible)continue;z=P*3;Ue(v,z,h,l);U.setFromMatrixPosition(n.matrixWorld);U.applyMatrix4(d);T[z+0]=U.x;T[z+1]=U.y;T[z+2]=U.z;g[P]=f;y[P]=n.distance===0?0:n.decay;P+=1}else if(n instanceof THREE.SpotLight){B+=1;if(!n.visible)continue;j=D*3;Ue(R,j,h,l);O.setFromMatrixPosition(n.matrixWorld);U.copy(O).applyMatrix4(d);H[j+0]=U.x;H[j+1]=U.y;H[j+2]=U.z;x[D]=f;U.setFromMatrixPosition(n.target.matrixWorld);O.sub(U);O.transformDirection(d);b[j+0]=O.x;b[j+1]=O.y;b[j+2]=O.z;w[D]=Math.cos(n.angle);M[D]=n.exponent;S[D]=n.distance===0?0:n.decay;D+=1}else if(n instanceof THREE.HemisphereLight){I+=1;if(!n.visible)continue;O.setFromMatrixPosition(n.matrixWorld);O.transformDirection(d);W=k*3;C[W+0]=O.x;C[W+1]=O.y;C[W+2]=O.z;u=n.color;c=n.groundColor;Ue(_,W,u,l);Ue(A,W,c,l);k+=1}}for(r=L*3,i=Math.max(p.length,V*3);r<i;r++)p[r]=0;for(r=P*3,i=Math.max(v.length,F*3);r<i;r++)v[r]=0;for(r=D*3,i=Math.max(R.length,B*3);r<i;r++)R[r]=0;for(r=k*3,i=Math.max(_.length,I*3);r<i;r++)_[r]=0;for(r=k*3,i=Math.max(A.length,I*3);r<i;r++)A[r]=0;E.directional.length=L;E.point.length=P;E.spot.length=D;E.hemi.length=k;E.ambient[0]=a;E.ambient[1]=o;E.ambient[2]=s}this.setFaceCulling=function(e,t){if(e===THREE.CullFaceNone){Y.disable(z.CULL_FACE)}else{if(t===THREE.FrontFaceDirectionCW){z.frontFace(z.CW)}else{z.frontFace(z.CCW)}if(e===THREE.CullFaceBack){z.cullFace(z.BACK)}else if(e===THREE.CullFaceFront){z.cullFace(z.FRONT)}else{z.cullFace(z.FRONT_AND_BACK)}Y.enable(z.CULL_FACE)}};function Be(e,t,r){var i;if(r){z.texParameteri(e,z.TEXTURE_WRAP_S,Ze(t.wrapS));z.texParameteri(e,z.TEXTURE_WRAP_T,Ze(t.wrapT));z.texParameteri(e,z.TEXTURE_MAG_FILTER,Ze(t.magFilter));z.texParameteri(e,z.TEXTURE_MIN_FILTER,Ze(t.minFilter))}else{z.texParameteri(e,z.TEXTURE_WRAP_S,z.CLAMP_TO_EDGE);z.texParameteri(e,z.TEXTURE_WRAP_T,z.CLAMP_TO_EDGE);if(t.wrapS!==THREE.ClampToEdgeWrapping||t.wrapT!==THREE.ClampToEdgeWrapping){console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",t)}z.texParameteri(e,z.TEXTURE_MAG_FILTER,Qe(t.magFilter));z.texParameteri(e,z.TEXTURE_MIN_FILTER,Qe(t.minFilter));if(t.minFilter!==THREE.NearestFilter&&t.minFilter!==THREE.LinearFilter){console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",t)}}i=X.get("EXT_texture_filter_anisotropic");if(i){if(t.type===THREE.FloatType&&X.get("OES_texture_float_linear")===null)return;if(t.type===THREE.HalfFloatType&&X.get("OES_texture_half_float_linear")===null)return;if(t.anisotropy>1||K.get(t).__currentAnisotropy){z.texParameterf(e,i.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(t.anisotropy,H.getMaxAnisotropy()));K.get(t).__currentAnisotropy=t.anisotropy}}}function Ge(e,t,r){if(e.__webglInit===undefined){e.__webglInit=true;t.addEventListener("dispose",se);e.__webglTexture=z.createTexture();I.textures++}Y.activeTexture(z.TEXTURE0+r);Y.bindTexture(z.TEXTURE_2D,e.__webglTexture);z.pixelStorei(z.UNPACK_FLIP_Y_WEBGL,t.flipY);z.pixelStorei(z.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha);z.pixelStorei(z.UNPACK_ALIGNMENT,t.unpackAlignment);t.image=Ie(t.image,q.maxTextureSize);if(ze(t)&&Ne(t.image)===false){if(THREE.skipPowerOfTwo!==true)t.image=je(t.image)}var i=t.image,n=Ne(i),a=Ze(t.format),o=Ze(t.type);Be(z.TEXTURE_2D,t,n);var s,h=t.mipmaps;if(t instanceof THREE.DataTexture){if(h.length>0&&n){for(var u=0,c=h.length;u<c;u++){s=h[u];Y.texImage2D(z.TEXTURE_2D,u,a,s.width,s.height,0,a,o,s.data)}t.generateMipmaps=false}else{Y.texImage2D(z.TEXTURE_2D,0,a,i.width,i.height,0,a,o,i.data)}}else if(t instanceof THREE.CompressedTexture){for(var u=0,c=h.length;u<c;u++){s=h[u];if(t.format!==THREE.RGBAFormat&&t.format!==THREE.RGBFormat){if(Y.getCompressedTextureFormats().indexOf(a)>-1){Y.compressedTexImage2D(z.TEXTURE_2D,u,a,s.width,s.height,0,s.data)}else{console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()")}}else{Y.texImage2D(z.TEXTURE_2D,u,a,s.width,s.height,0,a,o,s.data)}}}else{if(h.length>0&&n){for(var u=0,c=h.length;u<c;u++){s=h[u];Y.texImage2D(z.TEXTURE_2D,u,a,a,o,s)}t.generateMipmaps=false}else{Y.texImage2D(z.TEXTURE_2D,0,a,a,o,t.image)}}if(t.generateMipmaps&&n)z.generateMipmap(z.TEXTURE_2D);e.__version=t.version;if(t.onUpdate)t.onUpdate(t)}this.setTexture=function(e,t){var r=K.get(e);if(e.version>0&&r.__version!==e.version){var i=e.image;if(i===undefined){console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",e);return}if(i.complete===false){console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",e);return}Ge(r,e,t);return}Y.activeTexture(z.TEXTURE0+t);Y.bindTexture(z.TEXTURE_2D,r.__webglTexture)};function Ie(e,t){if(e.width>t||e.height>t){var r=t/Math.max(e.width,e.height);var i=document.createElement("canvas");i.width=Math.floor(e.width*r);i.height=Math.floor(e.height*r);var n=i.getContext("2d");n.drawImage(e,0,0,e.width,e.height,0,0,i.width,i.height);console.warn("THREE.WebGLRenderer: image is too big ("+e.width+"x"+e.height+"). Resized to "+i.width+"x"+i.height,e);return i}return e}function Ne(e){return THREE.Math.isPowerOfTwo(e.width)&&THREE.Math.isPowerOfTwo(e.height)}function ze(e){if(e.wrapS!==THREE.ClampToEdgeWrapping||e.wrapT!==THREE.ClampToEdgeWrapping)return true;if(e.minFilter!==THREE.NearestFilter&&e.minFilter!==THREE.LinearFilter)return true;return false}function je(e){if(e instanceof HTMLImageElement||e instanceof HTMLCanvasElement){var t=document.createElement("canvas");t.width=THREE.Math.nearestPowerOfTwo(e.width);t.height=THREE.Math.nearestPowerOfTwo(e.height);var r=t.getContext("2d");r.drawImage(e,0,0,t.width,t.height);return t}return e}function We(e,t){var r=K.get(e);if(e.image.length===6){if(e.version>0&&r.__version!==e.version){if(!r.__image__webglTextureCube){e.addEventListener("dispose",se);r.__image__webglTextureCube=z.createTexture();I.textures++}Y.activeTexture(z.TEXTURE0+t);Y.bindTexture(z.TEXTURE_CUBE_MAP,r.__image__webglTextureCube);z.pixelStorei(z.UNPACK_FLIP_Y_WEBGL,e.flipY);var i=e instanceof THREE.CompressedTexture;var n=e.image[0]instanceof THREE.DataTexture;var a=[];for(var o=0;o<6;o++){if(H.autoScaleCubemaps&&!i&&!n){a[o]=Ie(e.image[o],q.maxCubemapSize)}else{a[o]=n?e.image[o].image:e.image[o]}}var s=a[0],h=Ne(s),u=Ze(e.format),c=Ze(e.type);Be(z.TEXTURE_CUBE_MAP,e,h);for(var o=0;o<6;o++){if(!i){if(n){Y.texImage2D(z.TEXTURE_CUBE_MAP_POSITIVE_X+o,0,u,a[o].width,a[o].height,0,u,c,a[o].data)}else{Y.texImage2D(z.TEXTURE_CUBE_MAP_POSITIVE_X+o,0,u,u,c,a[o])}}else{var l,f=a[o].mipmaps;for(var E=0,d=f.length;E<d;E++){l=f[E];if(e.format!==THREE.RGBAFormat&&e.format!==THREE.RGBFormat){if(Y.getCompressedTextureFormats().indexOf(u)>-1){Y.compressedTexImage2D(z.TEXTURE_CUBE_MAP_POSITIVE_X+o,E,u,l.width,l.height,0,l.data)}else{console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()")}}else{Y.texImage2D(z.TEXTURE_CUBE_MAP_POSITIVE_X+o,E,u,l.width,l.height,0,u,c,l.data)}}}}if(e.generateMipmaps&&h){z.generateMipmap(z.TEXTURE_CUBE_MAP)}r.__version=e.version;if(e.onUpdate)e.onUpdate(e)}else{Y.activeTexture(z.TEXTURE0+t);Y.bindTexture(z.TEXTURE_CUBE_MAP,r.__image__webglTextureCube)}}}function Xe(e,t){Y.activeTexture(z.TEXTURE0+t);Y.bindTexture(z.TEXTURE_CUBE_MAP,K.get(e).__webglTexture)}function qe(e,t,r){z.bindFramebuffer(z.FRAMEBUFFER,e);z.framebufferTexture2D(z.FRAMEBUFFER,z.COLOR_ATTACHMENT0,r,K.get(t.texture).__webglTexture,0)}function Ye(e,t){z.bindRenderbuffer(z.RENDERBUFFER,e);if(t.depthBuffer&&!t.stencilBuffer){z.renderbufferStorage(z.RENDERBUFFER,z.DEPTH_COMPONENT16,t.width,t.height);z.framebufferRenderbuffer(z.FRAMEBUFFER,z.DEPTH_ATTACHMENT,z.RENDERBUFFER,e)}else if(t.depthBuffer&&t.stencilBuffer){z.renderbufferStorage(z.RENDERBUFFER,z.DEPTH_STENCIL,t.width,t.height);z.framebufferRenderbuffer(z.FRAMEBUFFER,z.DEPTH_STENCIL_ATTACHMENT,z.RENDERBUFFER,e)}else{z.renderbufferStorage(z.RENDERBUFFER,z.RGBA4,t.width,t.height)}}this.setRenderTarget=function(e){var t=e instanceof THREE.WebGLRenderTargetCube;if(e&&K.get(e).__webglFramebuffer===undefined){var r=K.get(e);var i=K.get(e.texture);if(e.depthBuffer===undefined)e.depthBuffer=true;if(e.stencilBuffer===undefined)e.stencilBuffer=true;e.addEventListener("dispose",he);i.__webglTexture=z.createTexture();I.textures++;var n=Ne(e),a=Ze(e.texture.format),o=Ze(e.texture.type);if(t){r.__webglFramebuffer=[];r.__webglRenderbuffer=[];Y.bindTexture(z.TEXTURE_CUBE_MAP,i.__webglTexture);Be(z.TEXTURE_CUBE_MAP,e.texture,n);for(var s=0;s<6;s++){r.__webglFramebuffer[s]=z.createFramebuffer();r.__webglRenderbuffer[s]=z.createRenderbuffer();Y.texImage2D(z.TEXTURE_CUBE_MAP_POSITIVE_X+s,0,a,e.width,e.height,0,a,o,null);qe(r.__webglFramebuffer[s],e,z.TEXTURE_CUBE_MAP_POSITIVE_X+s);Ye(r.__webglRenderbuffer[s],e)}if(e.texture.generateMipmaps&&n)z.generateMipmap(z.TEXTURE_CUBE_MAP)}else{r.__webglFramebuffer=z.createFramebuffer();if(e.shareDepthFrom){r.__webglRenderbuffer=e.shareDepthFrom.__webglRenderbuffer}else{r.__webglRenderbuffer=z.createRenderbuffer()}Y.bindTexture(z.TEXTURE_2D,i.__webglTexture);Be(z.TEXTURE_2D,e.texture,n);Y.texImage2D(z.TEXTURE_2D,0,a,e.width,e.height,0,a,o,null);qe(r.__webglFramebuffer,e,z.TEXTURE_2D);if(e.shareDepthFrom){if(e.depthBuffer&&!e.stencilBuffer){z.framebufferRenderbuffer(z.FRAMEBUFFER,z.DEPTH_ATTACHMENT,z.RENDERBUFFER,r.__webglRenderbuffer)}else if(e.depthBuffer&&e.stencilBuffer){z.framebufferRenderbuffer(z.FRAMEBUFFER,z.DEPTH_STENCIL_ATTACHMENT,z.RENDERBUFFER,r.__webglRenderbuffer)}}else{Ye(r.__webglRenderbuffer,e)}if(e.texture.generateMipmaps&&n)z.generateMipmap(z.TEXTURE_2D)}if(t){Y.bindTexture(z.TEXTURE_CUBE_MAP,null)}else{Y.bindTexture(z.TEXTURE_2D,null)}z.bindRenderbuffer(z.RENDERBUFFER,null);z.bindFramebuffer(z.FRAMEBUFFER,null)}var h,u,c,l,f;if(e){var r=K.get(e);if(t){h=r.__webglFramebuffer[e.activeCubeFace]}else{h=r.__webglFramebuffer}u=e.width;c=e.height;l=0;f=0}else{h=null;u=L;c=P;l=A;f=C}if(h!==b){z.bindFramebuffer(z.FRAMEBUFFER,h);z.viewport(l,f,u,c);b=h}if(t){var i=K.get(e.texture);z.framebufferTexture2D(z.FRAMEBUFFER,z.COLOR_ATTACHMENT0,z.TEXTURE_CUBE_MAP_POSITIVE_X+e.activeCubeFace,i.__webglTexture,0)}D=u;k=c};this.readRenderTargetPixels=function(e,t,r,i,n,a){if(e instanceof THREE.WebGLRenderTarget===false){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}var o=K.get(e).__webglFramebuffer;if(o){var s=false;if(o!==b){z.bindFramebuffer(z.FRAMEBUFFER,o);s=true}try{var h=e.texture;if(h.format!==THREE.RGBAFormat&&Ze(h.format)!==z.getParameter(z.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(h.type!==THREE.UnsignedByteType&&Ze(h.type)!==z.getParameter(z.IMPLEMENTATION_COLOR_READ_TYPE)&&!(h.type===THREE.FloatType&&X.get("WEBGL_color_buffer_float"))&&!(h.type===THREE.HalfFloatType&&X.get("EXT_color_buffer_half_float"))){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}if(z.checkFramebufferStatus(z.FRAMEBUFFER)===z.FRAMEBUFFER_COMPLETE){z.readPixels(t,r,i,n,Ze(h.format),Ze(h.type),a)}else{console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}}finally{if(s){z.bindFramebuffer(z.FRAMEBUFFER,b)}}}};function Ke(e){var t=e instanceof THREE.WebGLRenderTargetCube?z.TEXTURE_CUBE_MAP:z.TEXTURE_2D;var r=K.get(e.texture).__webglTexture;Y.bindTexture(t,r);z.generateMipmap(t);Y.bindTexture(t,null)}function Qe(e){if(e===THREE.NearestFilter||e===THREE.NearestMipMapNearestFilter||e===THREE.NearestMipMapLinearFilter){return z.NEAREST}return z.LINEAR}function Ze(e){var t;if(e===THREE.RepeatWrapping)return z.REPEAT;if(e===THREE.ClampToEdgeWrapping)return z.CLAMP_TO_EDGE;if(e===THREE.MirroredRepeatWrapping)return z.MIRRORED_REPEAT;if(e===THREE.NearestFilter)return z.NEAREST;if(e===THREE.NearestMipMapNearestFilter)return z.NEAREST_MIPMAP_NEAREST;if(e===THREE.NearestMipMapLinearFilter)return z.NEAREST_MIPMAP_LINEAR;if(e===THREE.LinearFilter)return z.LINEAR;if(e===THREE.LinearMipMapNearestFilter)return z.LINEAR_MIPMAP_NEAREST;if(e===THREE.LinearMipMapLinearFilter)return z.LINEAR_MIPMAP_LINEAR;if(e===THREE.UnsignedByteType)return z.UNSIGNED_BYTE;if(e===THREE.UnsignedShort4444Type)return z.UNSIGNED_SHORT_4_4_4_4;if(e===THREE.UnsignedShort5551Type)return z.UNSIGNED_SHORT_5_5_5_1;if(e===THREE.UnsignedShort565Type)return z.UNSIGNED_SHORT_5_6_5;if(e===THREE.ByteType)return z.BYTE;if(e===THREE.ShortType)return z.SHORT;if(e===THREE.UnsignedShortType)return z.UNSIGNED_SHORT;if(e===THREE.IntType)return z.INT;if(e===THREE.UnsignedIntType)return z.UNSIGNED_INT;if(e===THREE.FloatType)return z.FLOAT;t=X.get("OES_texture_half_float");if(t!==null){if(e===THREE.HalfFloatType)return t.HALF_FLOAT_OES}if(e===THREE.AlphaFormat)return z.ALPHA;if(e===THREE.RGBFormat)return z.RGB;if(e===THREE.RGBAFormat)return z.RGBA;if(e===THREE.LuminanceFormat)return z.LUMINANCE;if(e===THREE.LuminanceAlphaFormat)return z.LUMINANCE_ALPHA;if(e===THREE.AddEquation)return z.FUNC_ADD;if(e===THREE.SubtractEquation)return z.FUNC_SUBTRACT;if(e===THREE.ReverseSubtractEquation)return z.FUNC_REVERSE_SUBTRACT;if(e===THREE.ZeroFactor)return z.ZERO;if(e===THREE.OneFactor)return z.ONE;if(e===THREE.SrcColorFactor)return z.SRC_COLOR;if(e===THREE.OneMinusSrcColorFactor)return z.ONE_MINUS_SRC_COLOR;if(e===THREE.SrcAlphaFactor)return z.SRC_ALPHA;if(e===THREE.OneMinusSrcAlphaFactor)return z.ONE_MINUS_SRC_ALPHA;if(e===THREE.DstAlphaFactor)return z.DST_ALPHA;if(e===THREE.OneMinusDstAlphaFactor)return z.ONE_MINUS_DST_ALPHA;if(e===THREE.DstColorFactor)return z.DST_COLOR;if(e===THREE.OneMinusDstColorFactor)return z.ONE_MINUS_DST_COLOR;if(e===THREE.SrcAlphaSaturateFactor)return z.SRC_ALPHA_SATURATE;t=X.get("WEBGL_compressed_texture_s3tc");if(t!==null){if(e===THREE.RGB_S3TC_DXT1_Format)return t.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===THREE.RGBA_S3TC_DXT1_Format)return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===THREE.RGBA_S3TC_DXT3_Format)return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===THREE.RGBA_S3TC_DXT5_Format)return t.COMPRESSED_RGBA_S3TC_DXT5_EXT}t=X.get("WEBGL_compressed_texture_pvrtc");if(t!==null){if(e===THREE.RGB_PVRTC_4BPPV1_Format)return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===THREE.RGB_PVRTC_2BPPV1_Format)return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===THREE.RGBA_PVRTC_4BPPV1_Format)return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===THREE.RGBA_PVRTC_2BPPV1_Format)return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}t=X.get("EXT_blend_minmax");if(t!==null){if(e===THREE.MinEquation)return t.MIN_EXT;if(e===THREE.MaxEquation)return t.MAX_EXT}return 0}this.supportsFloatTextures=function(){console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' ).");return X.get("OES_texture_float")};this.supportsHalfFloatTextures=function(){console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' ).");return X.get("OES_texture_half_float")};this.supportsStandardDerivatives=function(){console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' ).");return X.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' ).");return X.get("WEBGL_compressed_texture_s3tc")};this.supportsCompressedTexturePVRTC=function(){console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' ).");return X.get("WEBGL_compressed_texture_pvrtc")};this.supportsBlendMinMax=function(){console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' ).");return X.get("EXT_blend_minmax")};this.supportsVertexTextures=function(){return q.vertexTextures};this.supportsInstancedArrays=function(){console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' ).");
return X.get("ANGLE_instanced_arrays")};this.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};this.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};this.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")};this.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")};Object.defineProperties(this,{shadowMapEnabled:{get:function(){return ie.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.");ie.enabled=e}},shadowMapType:{get:function(){return ie.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.");ie.type=e}},shadowMapCullFace:{get:function(){return ie.cullFace},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.");ie.cullFace=e}},shadowMapDebug:{get:function(){return ie.debug},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapDebug is now .shadowMap.debug.");ie.debug=e}}})};THREE.WebGLRenderTarget=function(e,t,r){this.uuid=THREE.Math.generateUUID();this.width=e;this.height=t;r=r||{};if(r.minFilter===undefined)r.minFilter=THREE.LinearFilter;this.texture=new THREE.Texture(undefined,undefined,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy);this.depthBuffer=r.depthBuffer!==undefined?r.depthBuffer:true;this.stencilBuffer=r.stencilBuffer!==undefined?r.stencilBuffer:true;this.shareDepthFrom=r.shareDepthFrom!==undefined?r.shareDepthFrom:null};THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,get wrapS(){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.");return this.texture.wrapS},set wrapS(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.");this.texture.wrapS=e},get wrapT(){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.");return this.texture.wrapT},set wrapT(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.");this.texture.wrapT=e},get magFilter(){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.");return this.texture.magFilter},set magFilter(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.");this.texture.magFilter=e},get minFilter(){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.");return this.texture.minFilter},set minFilter(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.");this.texture.minFilter=e},get anisotropy(){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.");return this.texture.anisotropy},set anisotropy(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.");this.texture.anisotropy=e},get offset(){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset.");return this.texture.offset},set offset(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset.");this.texture.offset=e},get repeat(){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat.");return this.texture.repeat},set repeat(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat.");this.texture.repeat=e},get format(){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format.");return this.texture.format},set format(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format.");this.texture.format=e},get type(){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type.");return this.texture.type},set type(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type.");this.texture.type=e},get generateMipmaps(){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.");return this.texture.generateMipmaps},set generateMipmaps(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.");this.texture.generateMipmaps=e},setSize:function(e,t){if(this.width!==e||this.height!==t){this.width=e;this.height=t;this.dispose()}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.width=e.width;this.height=e.height;this.texture=e.texture.clone();this.depthBuffer=e.depthBuffer;this.stencilBuffer=e.stencilBuffer;this.shareDepthFrom=e.shareDepthFrom;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube=function(e,t,r){THREE.WebGLRenderTarget.call(this,e,t,r);this.activeCubeFace=0};THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube.prototype.constructor=THREE.WebGLRenderTargetCube;THREE.WebGLBufferRenderer=function(e,t,r){var i;function n(e){i=e}function a(t,n){e.drawArrays(i,t,n);r.calls++;r.vertices+=n;if(i===e.TRIANGLES)r.faces+=n/3}function o(e){var r=t.get("ANGLE_instanced_arrays");if(r===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}var n=e.attributes.position;if(n instanceof THREE.InterleavedBufferAttribute){r.drawArraysInstancedANGLE(i,0,n.data.count,e.maxInstancedCount)}else{r.drawArraysInstancedANGLE(i,0,n.count,e.maxInstancedCount)}}this.setMode=n;this.render=a;this.renderInstances=o};THREE.WebGLIndexedBufferRenderer=function(e,t,r){var i;function n(e){i=e}var a,o;function s(r){if(r.array instanceof Uint32Array&&t.get("OES_element_index_uint")){a=e.UNSIGNED_INT;o=4}else{a=e.UNSIGNED_SHORT;o=2}}function h(t,n){e.drawElements(i,n,a,t*o);r.calls++;r.vertices+=n;if(i===e.TRIANGLES)r.faces+=n/3}function u(e){var r=t.get("ANGLE_instanced_arrays");if(r===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}var n=e.index;r.drawElementsInstancedANGLE(i,n.array.length,a,0,e.maxInstancedCount)}this.setMode=n;this.setIndex=s;this.render=h;this.renderInstances=u};THREE.WebGLExtensions=function(e){var t={};this.get=function(r){if(t[r]!==undefined){return t[r]}var i;switch(r){case"EXT_texture_filter_anisotropic":i=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=e.getExtension(r)}if(i===null){console.warn("THREE.WebGLRenderer: "+r+" extension not supported.")}t[r]=i;return i}};THREE.WebGLCapabilities=function(e,t,r){function i(t){if(t==="highp"){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0){return"highp"}t="mediump"}if(t==="mediump"){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0){return"mediump"}}return"lowp"}this.getMaxPrecision=i;this.precision=r.precision!==undefined?r.precision:"highp",this.logarithmicDepthBuffer=r.logarithmicDepthBuffer!==undefined?r.logarithmicDepthBuffer:false;this.maxTextures=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.maxVertexTextures=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS);this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE);this.maxCubemapSize=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE);this.maxAttributes=e.getParameter(e.MAX_VERTEX_ATTRIBS);this.maxVertexUniforms=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS);this.maxVaryings=e.getParameter(e.MAX_VARYING_VECTORS);this.maxFragmentUniforms=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS);this.vertexTextures=this.maxVertexTextures>0;this.floatFragmentTextures=!!t.get("OES_texture_float");this.floatVertexTextures=this.vertexTextures&&this.floatFragmentTextures;var n=i(this.precision);if(n!==this.precision){console.warn("THREE.WebGLRenderer:",this.precision,"not supported, using",n,"instead.");this.precision=n}if(this.logarithmicDepthBuffer){this.logarithmicDepthBuffer=!!t.get("EXT_frag_depth")}};THREE.WebGLGeometries=function(e,t,r){var i={};function n(e){var t=e.geometry;if(i[t.id]!==undefined){return i[t.id]}t.addEventListener("dispose",a);var n;if(t instanceof THREE.BufferGeometry){n=t}else if(t instanceof THREE.Geometry){if(t._bufferGeometry===undefined){t._bufferGeometry=(new THREE.BufferGeometry).setFromObject(e)}n=t._bufferGeometry}i[t.id]=n;r.memory.geometries++;return n}function a(e){var n=e.target;var o=i[n.id];h(o.attributes);n.removeEventListener("dispose",a);delete i[n.id];var u=t.get(n);if(u.wireframe)s(u.wireframe);r.memory.geometries--}function o(e){if(e instanceof THREE.InterleavedBufferAttribute){return t.get(e.data).__webglBuffer}return t.get(e).__webglBuffer}function s(t){var r=o(t);if(r!==undefined){e.deleteBuffer(r);u(t)}}function h(e){for(var t in e){s(e[t])}}function u(e){if(e instanceof THREE.InterleavedBufferAttribute){t.delete(e.data)}else{t.delete(e)}}this.get=n};THREE.WebGLObjects=function(e,t,r){var i=new THREE.WebGLGeometries(e,t,r);function n(t){var r=i.get(t);if(t.geometry instanceof THREE.Geometry){r.updateFromObject(t)}var n=r.index;var o=r.attributes;if(n!==null){a(n,e.ELEMENT_ARRAY_BUFFER)}for(var s in o){a(o[s],e.ARRAY_BUFFER)}var h=r.morphAttributes;for(var s in h){var u=h[s];for(var c=0,l=u.length;c<l;c++){a(u[c],e.ARRAY_BUFFER)}}return r}function a(e,r){var i=e instanceof THREE.InterleavedBufferAttribute?e.data:e;var n=t.get(i);if(n.__webglBuffer===undefined){o(n,i,r)}else if(n.version!==i.version){s(n,i,r)}}function o(t,r,i){t.__webglBuffer=e.createBuffer();e.bindBuffer(i,t.__webglBuffer);var n=r.dynamic?e.DYNAMIC_DRAW:e.STATIC_DRAW;e.bufferData(i,r.array,n);t.version=r.version}function s(t,r,i){e.bindBuffer(i,t.__webglBuffer);if(r.dynamic===false||r.updateRange.count===-1){e.bufferSubData(i,0,r.array)}else if(r.updateRange.count===0){console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.")}else{e.bufferSubData(i,r.updateRange.offset*r.array.BYTES_PER_ELEMENT,r.array.subarray(r.updateRange.offset,r.updateRange.offset+r.updateRange.count));r.updateRange.count=0}t.version=r.version}function h(e){if(e instanceof THREE.InterleavedBufferAttribute){return t.get(e.data).__webglBuffer}return t.get(e).__webglBuffer}function u(r){var i=t.get(r);if(i.wireframe!==undefined){return i.wireframe}var n=[];var o=r.index;var s=r.attributes;var h=s.position;if(o!==null){var u={};var l=o.array;for(var f=0,E=l.length;f<E;f+=3){var d=l[f+0];var p=l[f+1];var m=l[f+2];if(c(u,d,p))n.push(d,p);if(c(u,p,m))n.push(p,m);if(c(u,m,d))n.push(m,d)}}else{var l=s.position.array;for(var f=0,E=l.length/3-1;f<E;f+=3){var d=f+0;var p=f+1;var m=f+2;n.push(d,p,p,m,m,d)}}var v=h.count>65535?Uint32Array:Uint16Array;var T=new THREE.BufferAttribute(new v(n),1);a(T,e.ELEMENT_ARRAY_BUFFER);i.wireframe=T;return T}function c(e,t,r){if(t>r){var i=t;t=r;r=i}var n=e[t];if(n===undefined){e[t]=[r];return true}else if(n.indexOf(r)===-1){n.push(r);return true}return false}this.getAttributeBuffer=h;this.getWireframeAttribute=u;this.update=n};THREE.WebGLProgram=function(){var e=0;function t(e){var t=[];for(var r in e){var i=e[r];if(i===false)continue;t.push("#define "+r+" "+i)}return t.join("\n")}function r(e,t,r){var i={};var n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(var a=0;a<n;a++){var o=e.getActiveUniform(t,a);var s=o.name;var h=e.getUniformLocation(t,s);var u=s.lastIndexOf("[0]");if(u!==-1&&u===s.length-3){i[s.substr(0,u)]=h}i[s]=h}return i}function i(e,t,r){var i={};var n=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(var a=0;a<n;a++){var o=e.getActiveAttrib(t,a);var s=o.name;i[s]=e.getAttribLocation(t,s)}return i}function n(e){return e!==""}return function a(o,s,h,u){var c=o.context;var l=h.defines;var f=h.__webglShader.vertexShader;var E=h.__webglShader.fragmentShader;var d="SHADOWMAP_TYPE_BASIC";if(u.shadowMapType===THREE.PCFShadowMap){d="SHADOWMAP_TYPE_PCF"}else if(u.shadowMapType===THREE.PCFSoftShadowMap){d="SHADOWMAP_TYPE_PCF_SOFT"}var p="ENVMAP_TYPE_CUBE";var m="ENVMAP_MODE_REFLECTION";var v="ENVMAP_BLENDING_MULTIPLY";if(u.envMap){switch(h.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:p="ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:p="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:p="ENVMAP_TYPE_SPHERE";break}switch(h.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:m="ENVMAP_MODE_REFRACTION";break}switch(h.combine){case THREE.MultiplyOperation:v="ENVMAP_BLENDING_MULTIPLY";break;case THREE.MixOperation:v="ENVMAP_BLENDING_MIX";break;case THREE.AddOperation:v="ENVMAP_BLENDING_ADD";break}}var T=o.gammaFactor>0?o.gammaFactor:1;var g=t(l);var y=c.createProgram();var R,H;if(h instanceof THREE.RawShaderMaterial){R="";H=""}else{R=["precision "+u.precision+" float;","precision "+u.precision+" int;","#define SHADER_NAME "+h.__webglShader.name,g,u.supportsVertexTextures?"#define VERTEX_TEXTURES":"",o.gammaInput?"#define GAMMA_INPUT":"",o.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+T,"#define MAX_DIR_LIGHTS "+u.maxDirLights,"#define MAX_POINT_LIGHTS "+u.maxPointLights,"#define MAX_SPOT_LIGHTS "+u.maxSpotLights,"#define MAX_HEMI_LIGHTS "+u.maxHemiLights,"#define MAX_SHADOWS "+u.maxShadows,"#define MAX_BONES "+u.maxBones,u.map?"#define USE_MAP":"",u.envMap?"#define USE_ENVMAP":"",u.envMap?"#define "+m:"",u.lightMap?"#define USE_LIGHTMAP":"",u.aoMap?"#define USE_AOMAP":"",u.emissiveMap?"#define USE_EMISSIVEMAP":"",u.bumpMap?"#define USE_BUMPMAP":"",u.normalMap?"#define USE_NORMALMAP":"",u.displacementMap&&u.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",u.specularMap?"#define USE_SPECULARMAP":"",u.alphaMap?"#define USE_ALPHAMAP":"",u.vertexColors?"#define USE_COLOR":"",u.flatShading?"#define FLAT_SHADED":"",u.skinning?"#define USE_SKINNING":"",u.useVertexTexture?"#define BONE_TEXTURE":"",u.morphTargets?"#define USE_MORPHTARGETS":"",u.morphNormals&&u.flatShading===false?"#define USE_MORPHNORMALS":"",u.doubleSided?"#define DOUBLE_SIDED":"",u.flipSided?"#define FLIP_SIDED":"",u.shadowMapEnabled?"#define USE_SHADOWMAP":"",u.shadowMapEnabled?"#define "+d:"",u.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",u.pointLightShadows>0?"#define POINT_LIGHT_SHADOWS":"",u.sizeAttenuation?"#define USE_SIZEATTENUATION":"",u.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",u.logarithmicDepthBuffer&&o.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR","	attribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","	attribute vec3 morphTarget0;","	attribute vec3 morphTarget1;","	attribute vec3 morphTarget2;","	attribute vec3 morphTarget3;","	#ifdef USE_MORPHNORMALS","		attribute vec3 morphNormal0;","		attribute vec3 morphNormal1;","		attribute vec3 morphNormal2;","		attribute vec3 morphNormal3;","	#else","		attribute vec3 morphTarget4;","		attribute vec3 morphTarget5;","		attribute vec3 morphTarget6;","		attribute vec3 morphTarget7;","	#endif","#endif","#ifdef USE_SKINNING","	attribute vec4 skinIndex;","	attribute vec4 skinWeight;","#endif","\n"].filter(n).join("\n");H=[u.bumpMap||u.normalMap||u.flatShading||h.derivatives?"#extension GL_OES_standard_derivatives : enable":"",u.logarithmicDepthBuffer&&o.extensions.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"","precision "+u.precision+" float;","precision "+u.precision+" int;","#define SHADER_NAME "+h.__webglShader.name,g,"#define MAX_DIR_LIGHTS "+u.maxDirLights,"#define MAX_POINT_LIGHTS "+u.maxPointLights,"#define MAX_SPOT_LIGHTS "+u.maxSpotLights,"#define MAX_HEMI_LIGHTS "+u.maxHemiLights,"#define MAX_SHADOWS "+u.maxShadows,u.alphaTest?"#define ALPHATEST "+u.alphaTest:"",o.gammaInput?"#define GAMMA_INPUT":"",o.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+T,u.useFog&&u.fog?"#define USE_FOG":"",u.useFog&&u.fogExp?"#define FOG_EXP2":"",u.map?"#define USE_MAP":"",u.envMap?"#define USE_ENVMAP":"",u.envMap?"#define "+p:"",u.envMap?"#define "+m:"",u.envMap?"#define "+v:"",u.lightMap?"#define USE_LIGHTMAP":"",u.aoMap?"#define USE_AOMAP":"",u.emissiveMap?"#define USE_EMISSIVEMAP":"",u.bumpMap?"#define USE_BUMPMAP":"",u.normalMap?"#define USE_NORMALMAP":"",u.specularMap?"#define USE_SPECULARMAP":"",u.alphaMap?"#define USE_ALPHAMAP":"",u.vertexColors?"#define USE_COLOR":"",u.flatShading?"#define FLAT_SHADED":"",u.metal?"#define METAL":"",u.doubleSided?"#define DOUBLE_SIDED":"",u.flipSided?"#define FLIP_SIDED":"",u.shadowMapEnabled?"#define USE_SHADOWMAP":"",u.shadowMapEnabled?"#define "+d:"",u.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",u.pointLightShadows>0?"#define POINT_LIGHT_SHADOWS":"",u.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",u.logarithmicDepthBuffer&&o.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","\n"].filter(n).join("\n")}var x=R+f;var b=H+E;var w=THREE.WebGLShader(c,c.VERTEX_SHADER,x);var M=THREE.WebGLShader(c,c.FRAGMENT_SHADER,b);c.attachShader(y,w);c.attachShader(y,M);if(h.index0AttributeName!==undefined){c.bindAttribLocation(y,0,h.index0AttributeName)}else if(u.morphTargets===true){c.bindAttribLocation(y,0,"position")}c.linkProgram(y);var S=c.getProgramInfoLog(y);var _=c.getShaderInfoLog(w);var A=c.getShaderInfoLog(M);var C=true;var L=true;if(c.getProgramParameter(y,c.LINK_STATUS)===false){C=false;console.error("THREE.WebGLProgram: shader error: ",c.getError(),"gl.VALIDATE_STATUS",c.getProgramParameter(y,c.VALIDATE_STATUS),"gl.getProgramInfoLog",S,_,A)}else if(S!==""){console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",S)}else if(_===""||A===""){L=false}if(L){this.diagnostics={runnable:C,material:h,programLog:S,vertexShader:{log:_,prefix:R},fragmentShader:{log:A,prefix:H}}}c.deleteShader(w);c.deleteShader(M);var P;this.getUniforms=function(){if(P===undefined){P=r(c,y)}return P};var D;this.getAttributes=function(){if(D===undefined){D=i(c,y)}return D};this.destroy=function(){c.deleteProgram(y);this.program=undefined};Object.defineProperties(this,{uniforms:{get:function(){console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms().");return this.getUniforms()}},attributes:{get:function(){console.warn("THREE.WebGLProgram: .attributes is now .getAttributes().");return this.getAttributes()}}});this.id=e++;this.code=s;this.usedTimes=1;this.program=y;this.vertexShader=w;this.fragmentShader=M;return this}}();THREE.WebGLPrograms=function(e,t){var r=[];var i={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points"};var n=["precision","supportsVertexTextures","map","envMap","envMapMode","lightMap","aoMap","emissiveMap","bumpMap","normalMap","displacementMap","specularMap","alphaMap","combine","vertexColors","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","maxDirLights","maxPointLights","maxSpotLights","maxHemiLights","maxShadows","shadowMapEnabled","pointLightShadows","shadowMapType","shadowMapDebug","alphaTest","metal","doubleSided","flipSided"];function a(e){if(t.floatVertexTextures&&e&&e.skeleton&&e.skeleton.useVertexTexture){return 1024}else{var r=t.maxVertexUniforms;var i=Math.floor((r-20)/4);var n=i;if(e!==undefined&&e instanceof THREE.SkinnedMesh){n=Math.min(e.skeleton.bones.length,n);if(n<e.skeleton.bones.length){console.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+n+" (try OpenGL instead of ANGLE)")}}return n}}function o(e){var t=0;var r=0;var i=0;var n=0;for(var a=0,o=e.length;a<o;a++){var s=e[a];if(s.visible===false)continue;if(s instanceof THREE.DirectionalLight)t++;if(s instanceof THREE.PointLight)r++;if(s instanceof THREE.SpotLight)i++;if(s instanceof THREE.HemisphereLight)n++}return{directional:t,point:r,spot:i,hemi:n}}function s(e){var t=0;var r=0;for(var i=0,n=e.length;i<n;i++){var a=e[i];if(!a.castShadow)continue;if(a instanceof THREE.SpotLight||a instanceof THREE.DirectionalLight)t++;if(a instanceof THREE.PointLight){t++;r++}}return{maxShadows:t,pointLightShadows:r}}this.getParameters=function(r,n,h,u){var c=i[r.type];var l=o(n);var f=s(n);var E=a(u);var d=e.getPrecision();if(r.precision!==null){d=t.getMaxPrecision(r.precision);if(d!==r.precision){console.warn("THREE.WebGLRenderer.initMaterial:",r.precision,"not supported, using",d,"instead.")}}var p={shaderID:c,precision:d,supportsVertexTextures:t.vertexTextures,map:!!r.map,envMap:!!r.envMap,envMapMode:r.envMap&&r.envMap.mapping,lightMap:!!r.lightMap,aoMap:!!r.aoMap,emissiveMap:!!r.emissiveMap,bumpMap:!!r.bumpMap,normalMap:!!r.normalMap,displacementMap:!!r.displacementMap,specularMap:!!r.specularMap,alphaMap:!!r.alphaMap,combine:r.combine,vertexColors:r.vertexColors,fog:h,useFog:r.fog,fogExp:h instanceof THREE.FogExp2,flatShading:r.shading===THREE.FlatShading,sizeAttenuation:r.sizeAttenuation,logarithmicDepthBuffer:t.logarithmicDepthBuffer,skinning:r.skinning,maxBones:E,useVertexTexture:t.floatVertexTextures&&u&&u.skeleton&&u.skeleton.useVertexTexture,morphTargets:r.morphTargets,morphNormals:r.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,maxDirLights:l.directional,maxPointLights:l.point,maxSpotLights:l.spot,maxHemiLights:l.hemi,maxShadows:f.maxShadows,pointLightShadows:f.pointLightShadows,shadowMapEnabled:e.shadowMap.enabled&&u.receiveShadow&&f.maxShadows>0,shadowMapType:e.shadowMap.type,shadowMapDebug:e.shadowMap.debug,alphaTest:r.alphaTest,metal:r.metal,doubleSided:r.side===THREE.DoubleSide,flipSided:r.side===THREE.BackSide};return p};this.getProgramCode=function(e,t){var r=[];if(t.shaderID){r.push(t.shaderID)}else{r.push(e.fragmentShader);r.push(e.vertexShader)}if(e.defines!==undefined){for(var i in e.defines){r.push(i);r.push(e.defines[i])}}for(var a=0;a<n.length;a++){var o=n[a];r.push(o);r.push(t[o])}return r.join()};this.acquireProgram=function(t,i,n){var a;for(var o=0,s=r.length;o<s;o++){var h=r[o];if(h.code===n){a=h;++a.usedTimes;break}}if(a===undefined){a=new THREE.WebGLProgram(e,n,t,i);r.push(a)}return a};this.releaseProgram=function(e){if(--e.usedTimes===0){var t=r.indexOf(e);r[t]=r[r.length-1];r.pop();e.destroy()}};this.programs=r};THREE.WebGLProperties=function(){var e={};this.get=function(t){var r=t.uuid;var i=e[r];if(i===undefined){i={};e[r]=i}return i};this.delete=function(t){delete e[t.uuid]};this.clear=function(){e={}}};THREE.WebGLShader=function(){function e(e){var t=e.split("\n");for(var r=0;r<t.length;r++){t[r]=r+1+": "+t[r]}return t.join("\n")}return function t(r,i,n){var a=r.createShader(i);r.shaderSource(a,n);r.compileShader(a);if(r.getShaderParameter(a,r.COMPILE_STATUS)===false){console.error("THREE.WebGLShader: Shader couldn't compile.")}if(r.getShaderInfoLog(a)!==""){console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",i===r.VERTEX_SHADER?"vertex":"fragment",r.getShaderInfoLog(a),e(n))}return a}}();THREE.WebGLShadowMap=function(e,t,r){var i=e.context,n=e.state,a=new THREE.Frustum,o=new THREE.Matrix4,s=new THREE.Vector3,h=new THREE.Vector3,u=new THREE.Vector3,c=new THREE.Vector3,l=[],f=1,E=2,d=(f|E)+1,p=new Array(d),m=new Array(d);var v=[new THREE.Vector3(1,0,0),new THREE.Vector3(-1,0,0),new THREE.Vector3(0,0,1),new THREE.Vector3(0,0,-1),new THREE.Vector3(0,1,0),new THREE.Vector3(0,-1,0)];var T=[new THREE.Vector3(0,1,0),new THREE.Vector3(0,1,0),new THREE.Vector3(0,1,0),new THREE.Vector3(0,1,0),new THREE.Vector3(0,0,1),new THREE.Vector3(0,0,-1)];var g=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4];var y=new THREE.Vector4;var R=THREE.ShaderLib["depthRGBA"];var H=THREE.UniformsUtils.clone(R.uniforms);var x=THREE.ShaderLib["distanceRGBA"];var b=THREE.UniformsUtils.clone(x.uniforms);for(var w=0;w!==d;++w){var M=(w&f)!==0;var S=(w&E)!==0;var _=new THREE.ShaderMaterial({uniforms:H,vertexShader:R.vertexShader,fragmentShader:R.fragmentShader,morphTargets:M,skinning:S});_._shadowPass=true;p[w]=_;var A=new THREE.ShaderMaterial({uniforms:b,vertexShader:x.vertexShader,fragmentShader:x.fragmentShader,morphTargets:M,skinning:S});A._shadowPass=true;m[w]=A}var C=this;this.enabled=false;this.autoUpdate=true;this.needsUpdate=false;this.type=THREE.PCFShadowMap;this.cullFace=THREE.CullFaceFront;this.render=function(s){var h,f;if(C.enabled===false)return;if(C.autoUpdate===false&&C.needsUpdate===false)return;i.clearColor(1,1,1,1);n.disable(i.BLEND);n.enable(i.CULL_FACE);i.frontFace(i.CCW);i.cullFace(C.cullFace===THREE.CullFaceFront?i.FRONT:i.BACK);n.setDepthTest(true);e.getViewport(y);for(var E=0,d=t.length;E<d;E++){var p=t[E];if(p.castShadow===true){var m=p.shadow;var R=m.camera;var H=m.mapSize;if(p instanceof THREE.PointLight){h=6;f=true;var x=H.x/4;var b=H.y/2;g[0].set(x*2,b,x,b);g[1].set(0,b,x,b);g[2].set(x*3,b,x,b);g[3].set(x,b,x,b);g[4].set(x*3,0,x,b);g[5].set(x,0,x,b)}else{h=1;f=false}if(m.map===null){var w=THREE.LinearFilter;if(C.type===THREE.PCFSoftShadowMap){w=THREE.NearestFilter}var M={minFilter:w,magFilter:w,format:THREE.RGBAFormat};m.map=new THREE.WebGLRenderTarget(H.x,H.y,M);m.matrix=new THREE.Matrix4;if(p instanceof THREE.SpotLight){R.aspect=H.x/H.y}R.updateProjectionMatrix()}var S=m.map;var _=m.matrix;c.setFromMatrixPosition(p.matrixWorld);R.position.copy(c);e.setRenderTarget(S);e.clear();for(var A=0;A<h;A++){if(f){u.copy(R.position);u.add(v[A]);R.up.copy(T[A]);R.lookAt(u);var D=g[A];e.setViewport(D.x,D.y,D.z,D.w)}else{u.setFromMatrixPosition(p.target.matrixWorld);R.lookAt(u)}R.updateMatrixWorld();R.matrixWorldInverse.getInverse(R.matrixWorld);_.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);_.multiply(R.projectionMatrix);_.multiply(R.matrixWorldInverse);o.multiplyMatrices(R.projectionMatrix,R.matrixWorldInverse);a.setFromMatrix(o);l.length=0;P(s,R);for(var k=0,V=l.length;k<V;k++){var F=l[k];var U=r.update(F);var O=F.material;if(O instanceof THREE.MeshFaceMaterial){var B=U.groups;var G=O.materials;for(var I=0,N=B.length;I<N;I++){var z=B[I];var j=G[z.materialIndex];if(j.visible===true){var W=L(F,j,f,c);e.renderBufferDirect(R,t,null,U,W,F,z)}}}else{var W=L(F,O,f,c);e.renderBufferDirect(R,t,null,U,W,F,null)}}}e.resetGLState()}}e.setViewport(y.x,y.y,y.z,y.w);var X=e.getClearColor(),q=e.getClearAlpha();e.setClearColor(X,q);n.enable(i.BLEND);if(C.cullFace===THREE.CullFaceFront){i.cullFace(i.BACK)}e.resetGLState();C.needsUpdate=false};function L(e,t,r,i){var n=e.geometry;var a=null;var o=p;var s=e.customDepthMaterial;if(r){o=m;s=e.customDistanceMaterial}if(!s){var h=n.morphTargets!==undefined&&n.morphTargets.length>0&&t.morphTargets;var u=e instanceof THREE.SkinnedMesh&&t.skinning;var c=0;if(h)c|=f;if(u)c|=E;a=o[c]}else{a=s}a.visible=t.visible;a.wireframe=t.wireframe;a.wireframeLinewidth=t.wireframeLinewidth;if(r&&a.uniforms.lightPos!==undefined){a.uniforms.lightPos.value.copy(i)}return a}function P(e,t){if(e.visible===false)return;if(e instanceof THREE.Mesh||e instanceof THREE.Line||e instanceof THREE.Points){if(e.castShadow&&(e.frustumCulled===false||a.intersectsObject(e)===true)){var r=e.material;if(r.visible===true){e.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse,e.matrixWorld);l.push(e)}}}var i=e.children;for(var n=0,o=i.length;n<o;n++){P(i[n],t)}}};THREE.WebGLState=function(e,t,r){var i=this;var n=new Uint8Array(16);var a=new Uint8Array(16);var o=new Uint8Array(16);var s={};var h=null;var u=null;var c=null;var l=null;var f=null;var E=null;var d=null;var p=null;var m=null;var v=null;var T=null;var g=null;var y=null;var R=null;var H=null;var x=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);var b=undefined;var w={};this.init=function(){e.clearColor(0,0,0,1);e.clearDepth(1);e.clearStencil(0);this.enable(e.DEPTH_TEST);e.depthFunc(e.LEQUAL);e.frontFace(e.CCW);e.cullFace(e.BACK);this.enable(e.CULL_FACE);this.enable(e.BLEND);e.blendEquation(e.FUNC_ADD);e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA)};this.initAttributes=function(){for(var e=0,t=n.length;e<t;e++){n[e]=0}};this.enableAttribute=function(r){n[r]=1;if(a[r]===0){e.enableVertexAttribArray(r);a[r]=1}if(o[r]!==0){var i=t.get("ANGLE_instanced_arrays");i.vertexAttribDivisorANGLE(r,0);o[r]=0}};this.enableAttributeAndDivisor=function(t,r,i){n[t]=1;if(a[t]===0){e.enableVertexAttribArray(t);a[t]=1}if(o[t]!==r){i.vertexAttribDivisorANGLE(t,r);o[t]=r}};this.disableUnusedAttributes=function(){for(var t=0,r=a.length;t<r;t++){if(a[t]!==n[t]){e.disableVertexAttribArray(t);a[t]=0}}};this.enable=function(t){if(s[t]!==true){e.enable(t);s[t]=true}};this.disable=function(t){if(s[t]!==false){e.disable(t);s[t]=false}};this.getCompressedTextureFormats=function(){if(h===null){h=[];if(t.get("WEBGL_compressed_texture_pvrtc")||t.get("WEBGL_compressed_texture_s3tc")){var r=e.getParameter(e.COMPRESSED_TEXTURE_FORMATS);for(var i=0;i<r.length;i++){h.push(r[i])}}}return h};this.setBlending=function(t,i,n,a,o,s,h){if(t!==u){if(t===THREE.NoBlending){this.disable(e.BLEND)}else if(t===THREE.AdditiveBlending){this.enable(e.BLEND);e.blendEquation(e.FUNC_ADD);e.blendFunc(e.SRC_ALPHA,e.ONE)}else if(t===THREE.SubtractiveBlending){this.enable(e.BLEND);e.blendEquation(e.FUNC_ADD);e.blendFunc(e.ZERO,e.ONE_MINUS_SRC_COLOR)}else if(t===THREE.MultiplyBlending){this.enable(e.BLEND);e.blendEquation(e.FUNC_ADD);e.blendFunc(e.ZERO,e.SRC_COLOR)}else if(t===THREE.CustomBlending){this.enable(e.BLEND)}else{this.enable(e.BLEND);e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD);e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA)}u=t}if(t===THREE.CustomBlending){o=o||i;s=s||n;h=h||a;if(i!==c||o!==E){e.blendEquationSeparate(r(i),r(o));c=i;E=o}if(n!==l||a!==f||s!==d||h!==p){e.blendFuncSeparate(r(n),r(a),r(s),r(h));l=n;f=a;d=s;p=h}}else{c=null;l=null;f=null;E=null;d=null;p=null}};this.setDepthFunc=function(t){if(m!==t){if(t){switch(t){case THREE.NeverDepth:e.depthFunc(e.NEVER);break;case THREE.AlwaysDepth:e.depthFunc(e.ALWAYS);break;case THREE.LessDepth:e.depthFunc(e.LESS);break;case THREE.LessEqualDepth:e.depthFunc(e.LEQUAL);break;case THREE.EqualDepth:e.depthFunc(e.EQUAL);break;case THREE.GreaterEqualDepth:e.depthFunc(e.GEQUAL);break;case THREE.GreaterDepth:e.depthFunc(e.GREATER);break;case THREE.NotEqualDepth:e.depthFunc(e.NOTEQUAL);break;default:e.depthFunc(e.LEQUAL)}}else{e.depthFunc(e.LEQUAL)}m=t}};this.setDepthTest=function(t){if(t){this.enable(e.DEPTH_TEST)}else{this.disable(e.DEPTH_TEST)}};this.setDepthWrite=function(t){if(v!==t){e.depthMask(t);v=t}};this.setColorWrite=function(t){if(T!==t){e.colorMask(t,t,t,t);T=t}};this.setFlipSided=function(t){if(g!==t){if(t){e.frontFace(e.CW)}else{e.frontFace(e.CCW)}g=t}};this.setLineWidth=function(t){if(t!==y){e.lineWidth(t);y=t}};this.setPolygonOffset=function(t,r,i){if(t){this.enable(e.POLYGON_OFFSET_FILL)}else{this.disable(e.POLYGON_OFFSET_FILL)}if(t&&(R!==r||H!==i)){e.polygonOffset(r,i);R=r;H=i}};this.setScissorTest=function(t){if(t){this.enable(e.SCISSOR_TEST)}else{this.disable(e.SCISSOR_TEST)}};this.activeTexture=function(t){if(t===undefined)t=e.TEXTURE0+x-1;if(b!==t){e.activeTexture(t);b=t}};this.bindTexture=function(t,r){if(b===undefined){
i.activeTexture()}var n=w[b];if(n===undefined){n={type:undefined,texture:undefined};w[b]=n}if(n.type!==t||n.texture!==r){e.bindTexture(t,r);n.type=t;n.texture=r}};this.compressedTexImage2D=function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(t){console.error(t)}};this.texImage2D=function(){try{e.texImage2D.apply(e,arguments)}catch(t){console.error(t)}};this.reset=function(){for(var t=0;t<a.length;t++){if(a[t]===1){e.disableVertexAttribArray(t);a[t]=0}}s={};h=null;u=null;v=null;T=null;g=null}};THREE.LensFlarePlugin=function(e,t){var r=e.context;var i=e.state;var n,a;var o,s,h;var u;var c,l;function f(){var e=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]);var t=new Uint16Array([0,1,2,0,2,3]);n=r.createBuffer();a=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,n);r.bufferData(r.ARRAY_BUFFER,e,r.STATIC_DRAW);r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,a);r.bufferData(r.ELEMENT_ARRAY_BUFFER,t,r.STATIC_DRAW);c=r.createTexture();l=r.createTexture();i.bindTexture(r.TEXTURE_2D,c);r.texImage2D(r.TEXTURE_2D,0,r.RGB,16,16,0,r.RGB,r.UNSIGNED_BYTE,null);r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE);r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE);r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST);r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST);i.bindTexture(r.TEXTURE_2D,l);r.texImage2D(r.TEXTURE_2D,0,r.RGBA,16,16,0,r.RGBA,r.UNSIGNED_BYTE,null);r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE);r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE);r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST);r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST);u=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0;var f;if(u){f={vertexShader:["uniform lowp int renderType;","uniform vec3 screenPosition;","uniform vec2 scale;","uniform float rotation;","uniform sampler2D occlusionMap;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","varying float vVisibility;","void main() {","vUV = uv;","vec2 pos = position;","if ( renderType == 2 ) {","vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );","vVisibility =        visibility.r / 9.0;","vVisibility *= 1.0 - visibility.g / 9.0;","vVisibility *=       visibility.b / 9.0;","vVisibility *= 1.0 - visibility.a / 9.0;","pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;","pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;","}","gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );","}"].join("\n"),fragmentShader:["uniform lowp int renderType;","uniform sampler2D map;","uniform float opacity;","uniform vec3 color;","varying vec2 vUV;","varying float vVisibility;","void main() {","if ( renderType == 0 ) {","gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );","} else if ( renderType == 1 ) {","gl_FragColor = texture2D( map, vUV );","} else {","vec4 texture = texture2D( map, vUV );","texture.a *= opacity * vVisibility;","gl_FragColor = texture;","gl_FragColor.rgb *= color;","}","}"].join("\n")}}else{f={vertexShader:["uniform lowp int renderType;","uniform vec3 screenPosition;","uniform vec2 scale;","uniform float rotation;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","void main() {","vUV = uv;","vec2 pos = position;","if ( renderType == 2 ) {","pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;","pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;","}","gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );","}"].join("\n"),fragmentShader:["precision mediump float;","uniform lowp int renderType;","uniform sampler2D map;","uniform sampler2D occlusionMap;","uniform float opacity;","uniform vec3 color;","varying vec2 vUV;","void main() {","if ( renderType == 0 ) {","gl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );","} else if ( renderType == 1 ) {","gl_FragColor = texture2D( map, vUV );","} else {","float visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;","visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;","visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;","visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;","visibility = ( 1.0 - visibility / 4.0 );","vec4 texture = texture2D( map, vUV );","texture.a *= opacity * visibility;","gl_FragColor = texture;","gl_FragColor.rgb *= color;","}","}"].join("\n")}}o=E(f);s={vertex:r.getAttribLocation(o,"position"),uv:r.getAttribLocation(o,"uv")};h={renderType:r.getUniformLocation(o,"renderType"),map:r.getUniformLocation(o,"map"),occlusionMap:r.getUniformLocation(o,"occlusionMap"),opacity:r.getUniformLocation(o,"opacity"),color:r.getUniformLocation(o,"color"),scale:r.getUniformLocation(o,"scale"),rotation:r.getUniformLocation(o,"rotation"),screenPosition:r.getUniformLocation(o,"screenPosition")}}this.render=function(E,d,p,m){if(t.length===0)return;var v=new THREE.Vector3;var T=m/p,g=p*.5,y=m*.5;var R=16/m,H=new THREE.Vector2(R*T,R);var x=new THREE.Vector3(1,1,0),b=new THREE.Vector2(1,1);if(o===undefined){f()}r.useProgram(o);i.initAttributes();i.enableAttribute(s.vertex);i.enableAttribute(s.uv);i.disableUnusedAttributes();r.uniform1i(h.occlusionMap,0);r.uniform1i(h.map,1);r.bindBuffer(r.ARRAY_BUFFER,n);r.vertexAttribPointer(s.vertex,2,r.FLOAT,false,2*8,0);r.vertexAttribPointer(s.uv,2,r.FLOAT,false,2*8,8);r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,a);i.disable(r.CULL_FACE);r.depthMask(false);for(var w=0,M=t.length;w<M;w++){R=16/m;H.set(R*T,R);var S=t[w];v.set(S.matrixWorld.elements[12],S.matrixWorld.elements[13],S.matrixWorld.elements[14]);v.applyMatrix4(d.matrixWorldInverse);v.applyProjection(d.projectionMatrix);x.copy(v);b.x=x.x*g+g;b.y=x.y*y+y;if(u||b.x>0&&b.x<p&&b.y>0&&b.y<m){i.activeTexture(r.TEXTURE0);i.bindTexture(r.TEXTURE_2D,null);i.activeTexture(r.TEXTURE1);i.bindTexture(r.TEXTURE_2D,c);r.copyTexImage2D(r.TEXTURE_2D,0,r.RGB,b.x-8,b.y-8,16,16,0);r.uniform1i(h.renderType,0);r.uniform2f(h.scale,H.x,H.y);r.uniform3f(h.screenPosition,x.x,x.y,x.z);i.disable(r.BLEND);i.enable(r.DEPTH_TEST);r.drawElements(r.TRIANGLES,6,r.UNSIGNED_SHORT,0);i.activeTexture(r.TEXTURE0);i.bindTexture(r.TEXTURE_2D,l);r.copyTexImage2D(r.TEXTURE_2D,0,r.RGBA,b.x-8,b.y-8,16,16,0);r.uniform1i(h.renderType,1);i.disable(r.DEPTH_TEST);i.activeTexture(r.TEXTURE1);i.bindTexture(r.TEXTURE_2D,c);r.drawElements(r.TRIANGLES,6,r.UNSIGNED_SHORT,0);S.positionScreen.copy(x);if(S.customUpdateCallback){S.customUpdateCallback(S)}else{S.updateLensFlares()}r.uniform1i(h.renderType,2);i.enable(r.BLEND);for(var _=0,A=S.lensFlares.length;_<A;_++){var C=S.lensFlares[_];if(C.opacity>.001&&C.scale>.001){x.x=C.x;x.y=C.y;x.z=C.z;R=C.size*C.scale/m;H.x=R*T;H.y=R;r.uniform3f(h.screenPosition,x.x,x.y,x.z);r.uniform2f(h.scale,H.x,H.y);r.uniform1f(h.rotation,C.rotation);r.uniform1f(h.opacity,C.opacity);r.uniform3f(h.color,C.color.r,C.color.g,C.color.b);i.setBlending(C.blending,C.blendEquation,C.blendSrc,C.blendDst);e.setTexture(C.texture,1);r.drawElements(r.TRIANGLES,6,r.UNSIGNED_SHORT,0)}}}}i.enable(r.CULL_FACE);i.enable(r.DEPTH_TEST);r.depthMask(true);e.resetGLState()};function E(t){var i=r.createProgram();var n=r.createShader(r.FRAGMENT_SHADER);var a=r.createShader(r.VERTEX_SHADER);var o="precision "+e.getPrecision()+" float;\n";r.shaderSource(n,o+t.fragmentShader);r.shaderSource(a,o+t.vertexShader);r.compileShader(n);r.compileShader(a);r.attachShader(i,n);r.attachShader(i,a);r.linkProgram(i);return i}};THREE.SpritePlugin=function(e,t){var r=e.context;var i=e.state;var n,a;var o,s,h;var u;var c=new THREE.Vector3;var l=new THREE.Quaternion;var f=new THREE.Vector3;function E(){var e=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]);var t=new Uint16Array([0,1,2,0,2,3]);n=r.createBuffer();a=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,n);r.bufferData(r.ARRAY_BUFFER,e,r.STATIC_DRAW);r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,a);r.bufferData(r.ELEMENT_ARRAY_BUFFER,t,r.STATIC_DRAW);o=d();s={position:r.getAttribLocation(o,"position"),uv:r.getAttribLocation(o,"uv")};h={uvOffset:r.getUniformLocation(o,"uvOffset"),uvScale:r.getUniformLocation(o,"uvScale"),rotation:r.getUniformLocation(o,"rotation"),scale:r.getUniformLocation(o,"scale"),color:r.getUniformLocation(o,"color"),map:r.getUniformLocation(o,"map"),opacity:r.getUniformLocation(o,"opacity"),modelViewMatrix:r.getUniformLocation(o,"modelViewMatrix"),projectionMatrix:r.getUniformLocation(o,"projectionMatrix"),fogType:r.getUniformLocation(o,"fogType"),fogDensity:r.getUniformLocation(o,"fogDensity"),fogNear:r.getUniformLocation(o,"fogNear"),fogFar:r.getUniformLocation(o,"fogFar"),fogColor:r.getUniformLocation(o,"fogColor"),alphaTest:r.getUniformLocation(o,"alphaTest")};var i=document.createElement("canvas");i.width=8;i.height=8;var c=i.getContext("2d");c.fillStyle="white";c.fillRect(0,0,8,8);u=new THREE.Texture(i);u.needsUpdate=true}this.render=function(d,m){if(t.length===0)return;if(o===undefined){E()}r.useProgram(o);i.initAttributes();i.enableAttribute(s.position);i.enableAttribute(s.uv);i.disableUnusedAttributes();i.disable(r.CULL_FACE);i.enable(r.BLEND);r.bindBuffer(r.ARRAY_BUFFER,n);r.vertexAttribPointer(s.position,2,r.FLOAT,false,2*8,0);r.vertexAttribPointer(s.uv,2,r.FLOAT,false,2*8,8);r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,a);r.uniformMatrix4fv(h.projectionMatrix,false,m.projectionMatrix.elements);i.activeTexture(r.TEXTURE0);r.uniform1i(h.map,0);var v=0;var T=0;var g=d.fog;if(g){r.uniform3f(h.fogColor,g.color.r,g.color.g,g.color.b);if(g instanceof THREE.Fog){r.uniform1f(h.fogNear,g.near);r.uniform1f(h.fogFar,g.far);r.uniform1i(h.fogType,1);v=1;T=1}else if(g instanceof THREE.FogExp2){r.uniform1f(h.fogDensity,g.density);r.uniform1i(h.fogType,2);v=2;T=2}}else{r.uniform1i(h.fogType,0);v=0;T=0}for(var y=0,R=t.length;y<R;y++){var H=t[y];H.modelViewMatrix.multiplyMatrices(m.matrixWorldInverse,H.matrixWorld);H.z=-H.modelViewMatrix.elements[14]}t.sort(p);var x=[];for(var y=0,R=t.length;y<R;y++){var H=t[y];var b=H.material;r.uniform1f(h.alphaTest,b.alphaTest);r.uniformMatrix4fv(h.modelViewMatrix,false,H.modelViewMatrix.elements);H.matrixWorld.decompose(c,l,f);x[0]=f.x;x[1]=f.y;var w=0;if(d.fog&&b.fog){w=T}if(v!==w){r.uniform1i(h.fogType,w);v=w}if(b.map!==null){r.uniform2f(h.uvOffset,b.map.offset.x,b.map.offset.y);r.uniform2f(h.uvScale,b.map.repeat.x,b.map.repeat.y)}else{r.uniform2f(h.uvOffset,0,0);r.uniform2f(h.uvScale,1,1)}r.uniform1f(h.opacity,b.opacity);r.uniform3f(h.color,b.color.r,b.color.g,b.color.b);r.uniform1f(h.rotation,b.rotation);r.uniform2fv(h.scale,x);i.setBlending(b.blending,b.blendEquation,b.blendSrc,b.blendDst);i.setDepthTest(b.depthTest);i.setDepthWrite(b.depthWrite);if(b.map&&b.map.image&&b.map.image.width){e.setTexture(b.map,0)}else{e.setTexture(u,0)}r.drawElements(r.TRIANGLES,6,r.UNSIGNED_SHORT,0)}i.enable(r.CULL_FACE);e.resetGLState()};function d(){var t=r.createProgram();var i=r.createShader(r.VERTEX_SHADER);var n=r.createShader(r.FRAGMENT_SHADER);r.shaderSource(i,["precision "+e.getPrecision()+" float;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform float rotation;","uniform vec2 scale;","uniform vec2 uvOffset;","uniform vec2 uvScale;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","void main() {","vUV = uvOffset + uv * uvScale;","vec2 alignedPosition = position * scale;","vec2 rotatedPosition;","rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;","rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;","vec4 finalPosition;","finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );","finalPosition.xy += rotatedPosition;","finalPosition = projectionMatrix * finalPosition;","gl_Position = finalPosition;","}"].join("\n"));r.shaderSource(n,["precision "+e.getPrecision()+" float;","uniform vec3 color;","uniform sampler2D map;","uniform float opacity;","uniform int fogType;","uniform vec3 fogColor;","uniform float fogDensity;","uniform float fogNear;","uniform float fogFar;","uniform float alphaTest;","varying vec2 vUV;","void main() {","vec4 texture = texture2D( map, vUV );","if ( texture.a < alphaTest ) discard;","gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );","if ( fogType > 0 ) {","float depth = gl_FragCoord.z / gl_FragCoord.w;","float fogFactor = 0.0;","if ( fogType == 1 ) {","fogFactor = smoothstep( fogNear, fogFar, depth );","} else {","const float LOG2 = 1.442695;","fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );","fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );","}","gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );","}","}"].join("\n"));r.compileShader(i);r.compileShader(n);r.attachShader(t,i);r.attachShader(t,n);r.linkProgram(t);return t}function p(e,t){if(e.z!==t.z){return t.z-e.z}else{return t.id-e.id}}};THREE.CurveUtils={tangentQuadraticBezier:function(e,t,r,i){return 2*(1-e)*(r-t)+2*e*(i-r)},tangentCubicBezier:function(e,t,r,i,n){return-3*t*(1-e)*(1-e)+3*r*(1-e)*(1-e)-6*e*r*(1-e)+6*e*i*(1-e)-3*e*e*i+3*e*e*n},tangentSpline:function(e,t,r,i,n){var a=6*e*e-6*e;var o=3*e*e-4*e+1;var s=-6*e*e+6*e;var h=3*e*e-2*e;return a+o+s+h},interpolate:function(e,t,r,i,n){var a=(r-e)*.5;var o=(i-t)*.5;var s=n*n;var h=n*s;return(2*t-2*r+a+o)*h+(-3*t+3*r-2*a-o)*s+a*n+t}};THREE.GeometryUtils={merge:function(e,t,r){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var i;if(t instanceof THREE.Mesh){t.matrixAutoUpdate&&t.updateMatrix();i=t.matrix;t=t.geometry}e.merge(t,i,r)},center:function(e){console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.");return e.center()}};THREE.ImageUtils={crossOrigin:undefined,loadTexture:function(e,t,r,i){var n=new THREE.TextureLoader;n.setCrossOrigin(this.crossOrigin);var a=n.load(e,r,undefined,i);if(t)a.mapping=t;return a},loadTextureCube:function(e,t,r,i){console.warn("THREE.ImageUtils.loadTextureCube is being deprecated. Use THREE.CubeTextureLoader() instead.");var n=new THREE.CubeTextureLoader;n.setCrossOrigin(this.crossOrigin);var a=n.load(e,r,undefined,i);if(t)a.mapping=t;return a},loadCompressedTexture:function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")}};THREE.SceneUtils={createMultiMaterialObject:function(e,t){var r=new THREE.Group;for(var i=0,n=t.length;i<n;i++){r.add(new THREE.Mesh(e,t[i]))}return r},detach:function(e,t,r){e.applyMatrix(t.matrixWorld);t.remove(e);r.add(e)},attach:function(e,t,r){var i=new THREE.Matrix4;i.getInverse(r.matrixWorld);e.applyMatrix(i);t.remove(e);r.add(e)}};THREE.ShapeUtils={area:function(e){var t=e.length;var r=0;for(var i=t-1,n=0;n<t;i=n++){r+=e[i].x*e[n].y-e[n].x*e[i].y}return r*.5},triangulate:function(){function e(e,t,r,i,n,a){var o;var s,h,u,c;var l,f,E,d;s=e[a[t]].x;h=e[a[t]].y;u=e[a[r]].x;c=e[a[r]].y;l=e[a[i]].x;f=e[a[i]].y;if(Number.EPSILON>(u-s)*(f-h)-(c-h)*(l-s))return false;var p,m,v,T,g,y;var R,H,x,b,w,M;var S,_,A;p=l-u;m=f-c;v=s-l;T=h-f;g=u-s;y=c-h;for(o=0;o<n;o++){E=e[a[o]].x;d=e[a[o]].y;if(E===s&&d===h||E===u&&d===c||E===l&&d===f)continue;R=E-s;H=d-h;x=E-u;b=d-c;w=E-l;M=d-f;A=p*b-m*x;S=g*H-y*R;_=v*M-T*w;if(A>=-Number.EPSILON&&_>=-Number.EPSILON&&S>=-Number.EPSILON)return false}return true}return function(t,r){var i=t.length;if(i<3)return null;var n=[],a=[],o=[];var s,h,u;if(THREE.ShapeUtils.area(t)>0){for(h=0;h<i;h++)a[h]=h}else{for(h=0;h<i;h++)a[h]=i-1-h}var c=i;var l=2*c;for(h=c-1;c>2;){if(l--<=0){console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()");if(r)return o;return n}s=h;if(c<=s)s=0;h=s+1;if(c<=h)h=0;u=h+1;if(c<=u)u=0;if(e(t,s,h,u,c,a)){var f,E,d,p,m;f=a[s];E=a[h];d=a[u];n.push([t[f],t[E],t[d]]);o.push([a[s],a[h],a[u]]);for(p=h,m=h+1;m<c;p++,m++){a[p]=a[m]}c--;l=2*c}}if(r)return o;return n}}(),triangulateShape:function(e,t){function r(e,t,r){if(e.x!==t.x){if(e.x<t.x){return e.x<=r.x&&r.x<=t.x}else{return t.x<=r.x&&r.x<=e.x}}else{if(e.y<t.y){return e.y<=r.y&&r.y<=t.y}else{return t.y<=r.y&&r.y<=e.y}}}function i(e,t,i,n,a){var o=t.x-e.x,s=t.y-e.y;var h=n.x-i.x,u=n.y-i.y;var c=e.x-i.x;var l=e.y-i.y;var f=s*h-o*u;var E=s*c-o*l;if(Math.abs(f)>Number.EPSILON){var d;if(f>0){if(E<0||E>f)return[];d=u*c-h*l;if(d<0||d>f)return[]}else{if(E>0||E<f)return[];d=u*c-h*l;if(d>0||d<f)return[]}if(d===0){if(a&&(E===0||E===f))return[];return[e]}if(d===f){if(a&&(E===0||E===f))return[];return[t]}if(E===0)return[i];if(E===f)return[n];var p=d/f;return[{x:e.x+p*o,y:e.y+p*s}]}else{if(E!==0||u*c!==h*l)return[];var m=o===0&&s===0;var v=h===0&&u===0;if(m&&v){if(e.x!==i.x||e.y!==i.y)return[];return[e]}if(m){if(!r(i,n,e))return[];return[e]}if(v){if(!r(e,t,i))return[];return[i]}var T,g,y,R;var H,x,b,w;if(o!==0){if(e.x<t.x){T=e;y=e.x;g=t;R=t.x}else{T=t;y=t.x;g=e;R=e.x}if(i.x<n.x){H=i;b=i.x;x=n;w=n.x}else{H=n;b=n.x;x=i;w=i.x}}else{if(e.y<t.y){T=e;y=e.y;g=t;R=t.y}else{T=t;y=t.y;g=e;R=e.y}if(i.y<n.y){H=i;b=i.y;x=n;w=n.y}else{H=n;b=n.y;x=i;w=i.y}}if(y<=b){if(R<b)return[];if(R===b){if(a)return[];return[H]}if(R<=w)return[H,g];return[H,x]}else{if(y>w)return[];if(y===w){if(a)return[];return[T]}if(R<=w)return[T,g];return[T,x]}}}function n(e,t,r,i){var n=t.x-e.x,a=t.y-e.y;var o=r.x-e.x,s=r.y-e.y;var h=i.x-e.x,u=i.y-e.y;var c=n*s-a*o;var l=n*u-a*h;if(Math.abs(c)>Number.EPSILON){var f=h*s-u*o;if(c>0){return l>=0&&f>=0}else{return l>=0||f>=0}}else{return l>0}}function a(e,t){var r=e.concat();var a;function o(e,t){var i=r.length-1;var o=e-1;if(o<0)o=i;var s=e+1;if(s>i)s=0;var h=n(r[e],r[o],r[s],a[t]);if(!h){return false}var u=a.length-1;var c=t-1;if(c<0)c=u;var l=t+1;if(l>u)l=0;h=n(a[t],a[c],a[l],r[e]);if(!h){return false}return true}function s(e,t){var n,a,o;for(n=0;n<r.length;n++){a=n+1;a%=r.length;o=i(e,t,r[n],r[a],true);if(o.length>0)return true}return false}var h=[];function u(e,r){var n,a,o,s,u;for(n=0;n<h.length;n++){a=t[h[n]];for(o=0;o<a.length;o++){s=o+1;s%=a.length;u=i(e,r,a[o],a[s],true);if(u.length>0)return true}}return false}var c,l,f,E,d,p,m=[],v,T,g,y;for(var R=0,H=t.length;R<H;R++){h.push(R)}var x=0;var b=h.length*2;while(h.length>0){b--;if(b<0){console.log("Infinite Loop! Holes left:"+h.length+", Probably Hole outside Shape!");break}for(l=x;l<r.length;l++){f=r[l];c=-1;for(var R=0;R<h.length;R++){d=h[R];p=f.x+":"+f.y+":"+d;if(m[p]!==undefined)continue;a=t[d];for(var w=0;w<a.length;w++){E=a[w];if(!o(l,w))continue;if(s(f,E))continue;if(u(f,E))continue;c=w;h.splice(R,1);v=r.slice(0,l+1);T=r.slice(l);g=a.slice(c);y=a.slice(0,c+1);r=v.concat(g).concat(y).concat(T);x=l;break}if(c>=0)break;m[p]=true}if(c>=0)break}}return r}var o,s,h,u,c,l,f={};var E=e.concat();for(var d=0,p=t.length;d<p;d++){Array.prototype.push.apply(E,t[d])}for(o=0,s=E.length;o<s;o++){c=E[o].x+":"+E[o].y;if(f[c]!==undefined){console.warn("THREE.Shape: Duplicate point",c)}f[c]=o}var m=a(e,t);var v=THREE.ShapeUtils.triangulate(m,false);for(o=0,s=v.length;o<s;o++){u=v[o];for(h=0;h<3;h++){c=u[h].x+":"+u[h].y;l=f[c];if(l!==undefined){u[h]=l}}}return v.concat()},isClockWise:function(e){return THREE.ShapeUtils.area(e)<0},b2:function(){function e(e,t){var r=1-e;return r*r*t}function t(e,t){return 2*(1-e)*e*t}function r(e,t){return e*e*t}return function(i,n,a,o){return e(i,n)+t(i,a)+r(i,o)}}(),b3:function(){function e(e,t){var r=1-e;return r*r*r*t}function t(e,t){var r=1-e;return 3*r*r*e*t}function r(e,t){var r=1-e;return 3*r*e*e*t}function i(e,t){return e*e*e*t}return function(n,a,o,s,h){return e(n,a)+t(n,o)+r(n,s)+i(n,h)}}()};THREE.Audio=function(e){THREE.Object3D.call(this);this.type="Audio";this.context=e.context;this.source=this.context.createBufferSource();this.source.onended=this.onEnded.bind(this);this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.panner=this.context.createPanner();this.panner.connect(this.gain);this.autoplay=false;this.startTime=0;this.playbackRate=1;this.isPlaying=false};THREE.Audio.prototype=Object.create(THREE.Object3D.prototype);THREE.Audio.prototype.constructor=THREE.Audio;THREE.Audio.prototype.load=function(e){var t=this;var r=new XMLHttpRequest;r.open("GET",e,true);r.responseType="arraybuffer";r.onload=function(e){t.context.decodeAudioData(this.response,function(e){t.source.buffer=e;if(t.autoplay)t.play()})};r.send();return this};THREE.Audio.prototype.play=function(){if(this.isPlaying===true){console.warn("THREE.Audio: Audio is already playing.");return}var e=this.context.createBufferSource();e.buffer=this.source.buffer;e.loop=this.source.loop;e.onended=this.source.onended;e.start(0,this.startTime);e.playbackRate.value=this.playbackRate;this.isPlaying=true;this.source=e;this.connect()};THREE.Audio.prototype.pause=function(){this.source.stop();this.startTime=this.context.currentTime};THREE.Audio.prototype.stop=function(){this.source.stop();this.startTime=0};THREE.Audio.prototype.connect=function(){if(this.filter!==undefined){this.source.connect(this.filter);this.filter.connect(this.panner)}else{this.source.connect(this.panner)}};THREE.Audio.prototype.disconnect=function(){if(this.filter!==undefined){this.source.disconnect(this.filter);this.filter.disconnect(this.panner)}else{this.source.disconnect(this.panner)}};THREE.Audio.prototype.setFilter=function(e){if(this.isPlaying===true){this.disconnect();this.filter=e;this.connect()}else{this.filter=e}};THREE.Audio.prototype.getFilter=function(){return this.filter};THREE.Audio.prototype.setPlaybackRate=function(e){this.playbackRate=e;if(this.isPlaying===true){this.source.playbackRate.value=this.playbackRate}};THREE.Audio.prototype.getPlaybackRate=function(){return this.playbackRate};THREE.Audio.prototype.onEnded=function(){this.isPlaying=false};THREE.Audio.prototype.setLoop=function(e){this.source.loop=e};THREE.Audio.prototype.getLoop=function(){return this.source.loop};THREE.Audio.prototype.setRefDistance=function(e){this.panner.refDistance=e};THREE.Audio.prototype.getRefDistance=function(){return this.panner.refDistance};THREE.Audio.prototype.setRolloffFactor=function(e){this.panner.rolloffFactor=e};THREE.Audio.prototype.getRolloffFactor=function(){return this.panner.rolloffFactor};THREE.Audio.prototype.setVolume=function(e){this.gain.gain.value=e};THREE.Audio.prototype.getVolume=function(){return this.gain.gain.value};THREE.Audio.prototype.updateMatrixWorld=function(){var e=new THREE.Vector3;return function t(r){THREE.Object3D.prototype.updateMatrixWorld.call(this,r);e.setFromMatrixPosition(this.matrixWorld);this.panner.setPosition(e.x,e.y,e.z)}}();THREE.AudioListener=function(){THREE.Object3D.call(this);this.type="AudioListener";this.context=new(window.AudioContext||window.webkitAudioContext)};THREE.AudioListener.prototype=Object.create(THREE.Object3D.prototype);THREE.AudioListener.prototype.constructor=THREE.AudioListener;THREE.AudioListener.prototype.updateMatrixWorld=function(){var e=new THREE.Vector3;var t=new THREE.Quaternion;var r=new THREE.Vector3;var i=new THREE.Vector3;return function n(a){THREE.Object3D.prototype.updateMatrixWorld.call(this,a);var o=this.context.listener;var s=this.up;this.matrixWorld.decompose(e,t,r);i.set(0,0,-1).applyQuaternion(t);o.setPosition(e.x,e.y,e.z);o.setOrientation(i.x,i.y,i.z,s.x,s.y,s.z)}}();THREE.Curve=function(){};THREE.Curve.prototype={constructor:THREE.Curve,getPoint:function(e){console.warn("THREE.Curve: Warning, getPoint() not implemented!");return null},getPointAt:function(e){var t=this.getUtoTmapping(e);return this.getPoint(t)},getPoints:function(e){if(!e)e=5;var t,r=[];for(t=0;t<=e;t++){r.push(this.getPoint(t/e))}return r},getSpacedPoints:function(e){if(!e)e=5;var t,r=[];for(t=0;t<=e;t++){r.push(this.getPointAt(t/e))}return r},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(!e)e=this.__arcLengthDivisions?this.__arcLengthDivisions:200;if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate){return this.cacheArcLengths}this.needsUpdate=false;var t=[];var r,i=this.getPoint(0);var n,a=0;t.push(0);for(n=1;n<=e;n++){r=this.getPoint(n/e);a+=r.distanceTo(i);t.push(a);i=r}this.cacheArcLengths=t;return t},updateArcLengths:function(){this.needsUpdate=true;this.getLengths()},getUtoTmapping:function(e,t){var r=this.getLengths();var i=0,n=r.length;var a;if(t){a=t}else{a=e*r[n-1]}var o=0,s=n-1,h;while(o<=s){i=Math.floor(o+(s-o)/2);h=r[i]-a;if(h<0){o=i+1}else if(h>0){s=i-1}else{s=i;break}}i=s;if(r[i]===a){var u=i/(n-1);return u}var c=r[i];var l=r[i+1];var f=l-c;var E=(a-c)/f;var u=(i+E)/(n-1);return u},getTangent:function(e){var t=1e-4;var r=e-t;var i=e+t;if(r<0)r=0;if(i>1)i=1;var n=this.getPoint(r);var a=this.getPoint(i);var o=a.clone().sub(n);return o.normalize()},getTangentAt:function(e){var t=this.getUtoTmapping(e);return this.getTangent(t)}};THREE.Curve.Utils=THREE.CurveUtils;THREE.Curve.create=function(e,t){e.prototype=Object.create(THREE.Curve.prototype);e.prototype.constructor=e;e.prototype.getPoint=t;return e};THREE.CurvePath=function(){this.curves=[];this.autoClose=false};THREE.CurvePath.prototype=Object.create(THREE.Curve.prototype);THREE.CurvePath.prototype.constructor=THREE.CurvePath;THREE.CurvePath.prototype.add=function(e){this.curves.push(e)};THREE.CurvePath.prototype.closePath=function(){var e=this.curves[0].getPoint(0);var t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){this.curves.push(new THREE.LineCurve(t,e))}};THREE.CurvePath.prototype.getPoint=function(e){var t=e*this.getLength();var r=this.getCurveLengths();var i=0;while(i<r.length){if(r[i]>=t){var n=r[i]-t;var a=this.curves[i];var o=1-n/a.getLength();return a.getPointAt(o)}i++}return null};THREE.CurvePath.prototype.getLength=function(){var e=this.getCurveLengths();return e[e.length-1]};THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length){return this.cacheLengths}var e=[],t=0;for(var r=0,i=this.curves.length;r<i;r++){t+=this.curves[r].getLength();e.push(t)}this.cacheLengths=e;return e};THREE.CurvePath.prototype.createPointsGeometry=function(e){var t=this.getPoints(e,true);return this.createGeometry(t)};THREE.CurvePath.prototype.createSpacedPointsGeometry=function(e){var t=this.getSpacedPoints(e,true);return this.createGeometry(t)};THREE.CurvePath.prototype.createGeometry=function(e){var t=new THREE.Geometry;for(var r=0,i=e.length;r<i;r++){var n=e[r];t.vertices.push(new THREE.Vector3(n.x,n.y,n.z||0))}return t};THREE.Path=function(e){THREE.CurvePath.call(this);this.actions=[];if(e){this.fromPoints(e)}};THREE.Path.prototype=Object.create(THREE.CurvePath.prototype);THREE.Path.prototype.constructor=THREE.Path;THREE.Path.prototype.fromPoints=function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,r=e.length;t<r;t++){this.lineTo(e[t].x,e[t].y)}};THREE.Path.prototype.moveTo=function(e,t){this.actions.push({action:"moveTo",args:[e,t]})};THREE.Path.prototype.lineTo=function(e,t){var r=this.actions[this.actions.length-1].args;var i=r[r.length-2];var n=r[r.length-1];var a=new THREE.LineCurve(new THREE.Vector2(i,n),new THREE.Vector2(e,t));this.curves.push(a);this.actions.push({action:"lineTo",args:[e,t]})};THREE.Path.prototype.quadraticCurveTo=function(e,t,r,i){var n=this.actions[this.actions.length-1].args;var a=n[n.length-2];var o=n[n.length-1];var s=new THREE.QuadraticBezierCurve(new THREE.Vector2(a,o),new THREE.Vector2(e,t),new THREE.Vector2(r,i));this.curves.push(s);this.actions.push({action:"quadraticCurveTo",args:[e,t,r,i]})};THREE.Path.prototype.bezierCurveTo=function(e,t,r,i,n,a){var o=this.actions[this.actions.length-1].args;var s=o[o.length-2];var h=o[o.length-1];var u=new THREE.CubicBezierCurve(new THREE.Vector2(s,h),new THREE.Vector2(e,t),new THREE.Vector2(r,i),new THREE.Vector2(n,a));this.curves.push(u);this.actions.push({action:"bezierCurveTo",args:[e,t,r,i,n,a]})};THREE.Path.prototype.splineThru=function(e){var t=Array.prototype.slice.call(arguments);var r=this.actions[this.actions.length-1].args;var i=r[r.length-2];var n=r[r.length-1];var a=[new THREE.Vector2(i,n)];Array.prototype.push.apply(a,e);var o=new THREE.SplineCurve(a);this.curves.push(o);this.actions.push({action:"splineThru",args:t})};THREE.Path.prototype.arc=function(e,t,r,i,n,a){var o=this.actions[this.actions.length-1].args;var s=o[o.length-2];var h=o[o.length-1];this.absarc(e+s,t+h,r,i,n,a)};THREE.Path.prototype.absarc=function(e,t,r,i,n,a){this.absellipse(e,t,r,r,i,n,a)};THREE.Path.prototype.ellipse=function(e,t,r,i,n,a,o,s){var h=this.actions[this.actions.length-1].args;var u=h[h.length-2];var c=h[h.length-1];this.absellipse(e+u,t+c,r,i,n,a,o,s)};THREE.Path.prototype.absellipse=function(e,t,r,i,n,a,o,s){var h=[e,t,r,i,n,a,o,s||0];var u=new THREE.EllipseCurve(e,t,r,i,n,a,o,s);this.curves.push(u);var c=u.getPoint(1);h.push(c.x);h.push(c.y);this.actions.push({action:"ellipse",args:h})};THREE.Path.prototype.getSpacedPoints=function(e,t){if(!e)e=40;var r=[];for(var i=0;i<e;i++){r.push(this.getPoint(i/e))}return r};THREE.Path.prototype.getPoints=function(e,t){e=e||12;var r=THREE.ShapeUtils.b2;var i=THREE.ShapeUtils.b3;var n=[];var a,o,s,h,u,c,l,f,E,d,p;for(var m=0,v=this.actions.length;m<v;m++){var T=this.actions[m];var g=T.action;var y=T.args;switch(g){case"moveTo":n.push(new THREE.Vector2(y[0],y[1]));break;case"lineTo":n.push(new THREE.Vector2(y[0],y[1]));break;case"quadraticCurveTo":a=y[2];o=y[3];u=y[0];c=y[1];if(n.length>0){E=n[n.length-1];l=E.x;f=E.y}else{E=this.actions[m-1].args;l=E[E.length-2];f=E[E.length-1]}for(var R=1;R<=e;R++){var H=R/e;d=r(H,l,u,a);p=r(H,f,c,o);n.push(new THREE.Vector2(d,p))}break;case"bezierCurveTo":a=y[4];o=y[5];u=y[0];c=y[1];s=y[2];h=y[3];if(n.length>0){E=n[n.length-1];l=E.x;f=E.y}else{E=this.actions[m-1].args;l=E[E.length-2];f=E[E.length-1]}for(var R=1;R<=e;R++){var H=R/e;d=i(H,l,u,s,a);p=i(H,f,c,h,o);n.push(new THREE.Vector2(d,p))}break;case"splineThru":E=this.actions[m-1].args;var x=new THREE.Vector2(E[E.length-2],E[E.length-1]);var b=[x];var w=e*y[0].length;b=b.concat(y[0]);var M=new THREE.SplineCurve(b);for(var R=1;R<=w;R++){n.push(M.getPointAt(R/w))}break;case"arc":var S=y[0],_=y[1],A=y[2],C=y[3],L=y[4],P=!!y[5];var D=L-C;var k;var V=e*2;for(var R=1;R<=V;R++){var H=R/V;if(!P){H=1-H}k=C+H*D;d=S+A*Math.cos(k);p=_+A*Math.sin(k);n.push(new THREE.Vector2(d,p))}break;case"ellipse":var S=y[0],_=y[1],F=y[2],U=y[3],C=y[4],L=y[5],P=!!y[6],O=y[7];var D=L-C;var k;var V=e*2;var B,G;if(O!==0){B=Math.cos(O);G=Math.sin(O)}for(var R=1;R<=V;R++){var H=R/V;if(!P){H=1-H}k=C+H*D;d=S+F*Math.cos(k);p=_+U*Math.sin(k);if(O!==0){var I=d,N=p;d=(I-S)*B-(N-_)*G+S;p=(I-S)*G+(N-_)*B+_}n.push(new THREE.Vector2(d,p))}break}}var z=n[n.length-1];if(Math.abs(z.x-n[0].x)<Number.EPSILON&&Math.abs(z.y-n[0].y)<Number.EPSILON)n.splice(n.length-1,1);if(t){n.push(n[0])}return n};THREE.Path.prototype.toShapes=function(e,t){function r(e){var t=[],r=new THREE.Path;for(var i=0,n=e.length;i<n;i++){var a=e[i];var o=a.args;var s=a.action;if(s==="moveTo"){if(r.actions.length!==0){t.push(r);r=new THREE.Path}}r[s].apply(r,o)}if(r.actions.length!==0){t.push(r)}return t}function i(e){var t=[];for(var r=0,i=e.length;r<i;r++){var n=e[r];var a=new THREE.Shape;a.actions=n.actions;a.curves=n.curves;t.push(a)}return t}function n(e,t){var r=t.length;var i=false;for(var n=r-1,a=0;a<r;n=a++){var o=t[n];var s=t[a];var h=s.x-o.x;var u=s.y-o.y;if(Math.abs(u)>Number.EPSILON){if(u<0){o=t[a];h=-h;s=t[n];u=-u}if(e.y<o.y||e.y>s.y)continue;if(e.y===o.y){if(e.x===o.x)return true;
}else{var c=u*(e.x-o.x)-h*(e.y-o.y);if(c===0)return true;if(c<0)continue;i=!i}}else{if(e.y!==o.y)continue;if(s.x<=e.x&&e.x<=o.x||o.x<=e.x&&e.x<=s.x)return true}}return i}var a=THREE.ShapeUtils.isClockWise;var o=r(this.actions);if(o.length===0)return[];if(t===true)return i(o);var s,h,u,c=[];if(o.length===1){h=o[0];u=new THREE.Shape;u.actions=h.actions;u.curves=h.curves;c.push(u);return c}var l=!a(o[0].getPoints());l=e?!l:l;var f=[];var E=[];var d=[];var p=0;var m;E[p]=undefined;d[p]=[];for(var v=0,T=o.length;v<T;v++){h=o[v];m=h.getPoints();s=a(m);s=e?!s:s;if(s){if(!l&&E[p])p++;E[p]={s:new THREE.Shape,p:m};E[p].s.actions=h.actions;E[p].s.curves=h.curves;if(l)p++;d[p]=[]}else{d[p].push({h:h,p:m[0]})}}if(!E[0])return i(o);if(E.length>1){var g=false;var y=[];for(var R=0,H=E.length;R<H;R++){f[R]=[]}for(var R=0,H=E.length;R<H;R++){var x=d[R];for(var b=0;b<x.length;b++){var w=x[b];var M=true;for(var S=0;S<E.length;S++){if(n(w.p,E[S].p)){if(R!==S)y.push({froms:R,tos:S,hole:b});if(M){M=false;f[S].push(w)}else{g=true}}}if(M){f[R].push(w)}}}if(y.length>0){if(!g)d=f}}var _;for(var v=0,A=E.length;v<A;v++){u=E[v].s;c.push(u);_=d[v];for(var C=0,L=_.length;C<L;C++){u.holes.push(_[C].h)}}return c};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=Object.create(THREE.Path.prototype);THREE.Shape.prototype.constructor=THREE.Shape;THREE.Shape.prototype.extrude=function(e){return new THREE.ExtrudeGeometry(this,e)};THREE.Shape.prototype.makeGeometry=function(e){return new THREE.ShapeGeometry(this,e)};THREE.Shape.prototype.getPointsHoles=function(e){var t=[];for(var r=0,i=this.holes.length;r<i;r++){t[r]=this.holes[r].getPoints(e)}return t};THREE.Shape.prototype.extractAllPoints=function(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}};THREE.Shape.prototype.extractPoints=function(e){return this.extractAllPoints(e)};THREE.Shape.Utils=THREE.ShapeUtils;THREE.LineCurve=function(e,t){this.v1=e;this.v2=t};THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.LineCurve.prototype.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(e){var t=this.v2.clone().sub(this.v1);t.multiplyScalar(e).add(this.v1);return t};THREE.LineCurve.prototype.getPointAt=function(e){return this.getPoint(e)};THREE.LineCurve.prototype.getTangent=function(e){var t=this.v2.clone().sub(this.v1);return t.normalize()};THREE.QuadraticBezierCurve=function(e,t,r){this.v0=e;this.v1=t;this.v2=r};THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve;THREE.QuadraticBezierCurve.prototype.getPoint=function(e){var t=THREE.ShapeUtils.b2;return new THREE.Vector2(t(e,this.v0.x,this.v1.x,this.v2.x),t(e,this.v0.y,this.v1.y,this.v2.y))};THREE.QuadraticBezierCurve.prototype.getTangent=function(e){var t=THREE.CurveUtils.tangentQuadraticBezier;return new THREE.Vector2(t(e,this.v0.x,this.v1.x,this.v2.x),t(e,this.v0.y,this.v1.y,this.v2.y)).normalize()};THREE.CubicBezierCurve=function(e,t,r,i){this.v0=e;this.v1=t;this.v2=r;this.v3=i};THREE.CubicBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.CubicBezierCurve.prototype.constructor=THREE.CubicBezierCurve;THREE.CubicBezierCurve.prototype.getPoint=function(e){var t=THREE.ShapeUtils.b3;return new THREE.Vector2(t(e,this.v0.x,this.v1.x,this.v2.x,this.v3.x),t(e,this.v0.y,this.v1.y,this.v2.y,this.v3.y))};THREE.CubicBezierCurve.prototype.getTangent=function(e){var t=THREE.CurveUtils.tangentCubicBezier;return new THREE.Vector2(t(e,this.v0.x,this.v1.x,this.v2.x,this.v3.x),t(e,this.v0.y,this.v1.y,this.v2.y,this.v3.y)).normalize()};THREE.SplineCurve=function(e){this.points=e==undefined?[]:e};THREE.SplineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.SplineCurve.prototype.constructor=THREE.SplineCurve;THREE.SplineCurve.prototype.getPoint=function(e){var t=this.points;var r=(t.length-1)*e;var i=Math.floor(r);var n=r-i;var a=t[i===0?i:i-1];var o=t[i];var s=t[i>t.length-2?t.length-1:i+1];var h=t[i>t.length-3?t.length-1:i+2];var u=THREE.CurveUtils.interpolate;return new THREE.Vector2(u(a.x,o.x,s.x,h.x,n),u(a.y,o.y,s.y,h.y,n))};THREE.EllipseCurve=function(e,t,r,i,n,a,o,s){this.aX=e;this.aY=t;this.xRadius=r;this.yRadius=i;this.aStartAngle=n;this.aEndAngle=a;this.aClockwise=o;this.aRotation=s||0};THREE.EllipseCurve.prototype=Object.create(THREE.Curve.prototype);THREE.EllipseCurve.prototype.constructor=THREE.EllipseCurve;THREE.EllipseCurve.prototype.getPoint=function(e){var t=this.aEndAngle-this.aStartAngle;if(t<0)t+=Math.PI*2;if(t>Math.PI*2)t-=Math.PI*2;var r;if(this.aClockwise===true){r=this.aEndAngle+(1-e)*(Math.PI*2-t)}else{r=this.aStartAngle+e*t}var i=this.aX+this.xRadius*Math.cos(r);var n=this.aY+this.yRadius*Math.sin(r);if(this.aRotation!==0){var a=Math.cos(this.aRotation);var o=Math.sin(this.aRotation);var s=i,h=n;i=(s-this.aX)*a-(h-this.aY)*o+this.aX;n=(s-this.aX)*o+(h-this.aY)*a+this.aY}return new THREE.Vector2(i,n)};THREE.ArcCurve=function(e,t,r,i,n,a){THREE.EllipseCurve.call(this,e,t,r,r,i,n,a)};THREE.ArcCurve.prototype=Object.create(THREE.EllipseCurve.prototype);THREE.ArcCurve.prototype.constructor=THREE.ArcCurve;THREE.LineCurve3=THREE.Curve.create(function(e,t){this.v1=e;this.v2=t},function(e){var t=new THREE.Vector3;t.subVectors(this.v2,this.v1);t.multiplyScalar(e);t.add(this.v1);return t});THREE.QuadraticBezierCurve3=THREE.Curve.create(function(e,t,r){this.v0=e;this.v1=t;this.v2=r},function(e){var t=THREE.ShapeUtils.b2;return new THREE.Vector3(t(e,this.v0.x,this.v1.x,this.v2.x),t(e,this.v0.y,this.v1.y,this.v2.y),t(e,this.v0.z,this.v1.z,this.v2.z))});THREE.CubicBezierCurve3=THREE.Curve.create(function(e,t,r,i){this.v0=e;this.v1=t;this.v2=r;this.v3=i},function(e){var t=THREE.ShapeUtils.b3;return new THREE.Vector3(t(e,this.v0.x,this.v1.x,this.v2.x,this.v3.x),t(e,this.v0.y,this.v1.y,this.v2.y,this.v3.y),t(e,this.v0.z,this.v1.z,this.v2.z,this.v3.z))});THREE.SplineCurve3=THREE.Curve.create(function(e){console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3");this.points=e==undefined?[]:e},function(e){var t=this.points;var r=(t.length-1)*e;var i=Math.floor(r);var n=r-i;var a=t[i==0?i:i-1];var o=t[i];var s=t[i>t.length-2?t.length-1:i+1];var h=t[i>t.length-3?t.length-1:i+2];var u=THREE.CurveUtils.interpolate;return new THREE.Vector3(u(a.x,o.x,s.x,h.x,n),u(a.y,o.y,s.y,h.y,n),u(a.z,o.z,s.z,h.z,n))});THREE.CatmullRomCurve3=function(){var e=new THREE.Vector3,t=new n,r=new n,i=new n;function n(){}n.prototype.init=function(e,t,r,i){this.c0=e;this.c1=r;this.c2=-3*e+3*t-2*r-i;this.c3=2*e-2*t+r+i};n.prototype.initNonuniformCatmullRom=function(e,t,r,i,n,a,o){var s=(t-e)/n-(r-e)/(n+a)+(r-t)/a;var h=(r-t)/a-(i-t)/(a+o)+(i-r)/o;s*=a;h*=a;this.init(t,r,s,h)};n.prototype.initCatmullRom=function(e,t,r,i,n){this.init(t,r,n*(r-e),n*(i-t))};n.prototype.calc=function(e){var t=e*e;var r=t*e;return this.c0+this.c1*e+this.c2*t+this.c3*r};return THREE.Curve.create(function(e){this.points=e||[]},function(n){var a=this.points,o,s,h,u;u=a.length;if(u<2)console.log("duh, you need at least 2 points");o=(u-1)*n;s=Math.floor(o);h=o-s;if(h===0&&s===u-1){s=u-2;h=1}var c,l,f,E;if(s===0){e.subVectors(a[0],a[1]).add(a[0]);c=e}else{c=a[s-1]}l=a[s];f=a[s+1];if(s+2<u){E=a[s+2]}else{e.subVectors(a[u-1],a[u-2]).add(a[u-2]);E=e}if(this.type===undefined||this.type==="centripetal"||this.type==="chordal"){var d=this.type==="chordal"?.5:.25;var p=Math.pow(c.distanceToSquared(l),d);var m=Math.pow(l.distanceToSquared(f),d);var v=Math.pow(f.distanceToSquared(E),d);if(m<1e-4)m=1;if(p<1e-4)p=m;if(v<1e-4)v=m;t.initNonuniformCatmullRom(c.x,l.x,f.x,E.x,p,m,v);r.initNonuniformCatmullRom(c.y,l.y,f.y,E.y,p,m,v);i.initNonuniformCatmullRom(c.z,l.z,f.z,E.z,p,m,v)}else if(this.type==="catmullrom"){var T=this.tension!==undefined?this.tension:.5;t.initCatmullRom(c.x,l.x,f.x,E.x,T);r.initCatmullRom(c.y,l.y,f.y,E.y,T);i.initCatmullRom(c.z,l.z,f.z,E.z,T)}var g=new THREE.Vector3(t.calc(h),r.calc(h),i.calc(h));return g})}();THREE.ClosedSplineCurve3=THREE.Curve.create(function(e){this.points=e==undefined?[]:e},function(e){var t=this.points;var r=(t.length-0)*e;var i=Math.floor(r);var n=r-i;i+=i>0?0:(Math.floor(Math.abs(i)/t.length)+1)*t.length;var a=t[(i-1)%t.length];var o=t[i%t.length];var s=t[(i+1)%t.length];var h=t[(i+2)%t.length];var u=THREE.CurveUtils.interpolate;return new THREE.Vector3(u(a.x,o.x,s.x,h.x,n),u(a.y,o.y,s.y,h.y,n),u(a.z,o.z,s.z,h.z,n))});THREE.BoxGeometry=function(e,t,r,i,n,a){THREE.Geometry.call(this);this.type="BoxGeometry";this.parameters={width:e,height:t,depth:r,widthSegments:i,heightSegments:n,depthSegments:a};this.widthSegments=i||1;this.heightSegments=n||1;this.depthSegments=a||1;var o=this;var s=e/2;var h=t/2;var u=r/2;c("z","y",-1,-1,r,t,s,0);c("z","y",1,-1,r,t,-s,1);c("x","z",1,1,e,r,h,2);c("x","z",1,-1,e,r,-h,3);c("x","y",1,-1,e,t,u,4);c("x","y",-1,-1,e,t,-u,5);function c(e,t,r,i,n,a,s,h){var u,c,l,f=o.widthSegments,E=o.heightSegments,d=n/2,p=a/2,m=o.vertices.length;if(e==="x"&&t==="y"||e==="y"&&t==="x"){u="z"}else if(e==="x"&&t==="z"||e==="z"&&t==="x"){u="y";E=o.depthSegments}else if(e==="z"&&t==="y"||e==="y"&&t==="z"){u="x";f=o.depthSegments}var v=f+1,T=E+1,g=n/f,y=a/E,R=new THREE.Vector3;R[u]=s>0?1:-1;for(l=0;l<T;l++){for(c=0;c<v;c++){var H=new THREE.Vector3;H[e]=(c*g-d)*r;H[t]=(l*y-p)*i;H[u]=s;o.vertices.push(H)}}for(l=0;l<E;l++){for(c=0;c<f;c++){var x=c+v*l;var b=c+v*(l+1);var w=c+1+v*(l+1);var M=c+1+v*l;var S=new THREE.Vector2(c/f,1-l/E);var _=new THREE.Vector2(c/f,1-(l+1)/E);var A=new THREE.Vector2((c+1)/f,1-(l+1)/E);var C=new THREE.Vector2((c+1)/f,1-l/E);var L=new THREE.Face3(x+m,b+m,M+m);L.normal.copy(R);L.vertexNormals.push(R.clone(),R.clone(),R.clone());L.materialIndex=h;o.faces.push(L);o.faceVertexUvs[0].push([S,_,C]);L=new THREE.Face3(b+m,w+m,M+m);L.normal.copy(R);L.vertexNormals.push(R.clone(),R.clone(),R.clone());L.materialIndex=h;o.faces.push(L);o.faceVertexUvs[0].push([_.clone(),A,C.clone()])}}}};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.BoxGeometry.prototype.constructor=THREE.BoxGeometry;THREE.BoxGeometry.prototype.clone=function(){var e=this.parameters;return new THREE.BoxGeometry(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)};THREE.CubeGeometry=THREE.BoxGeometry;THREE.CircleGeometry=function(e,t,r,i){THREE.Geometry.call(this);this.type="CircleGeometry";this.parameters={radius:e,segments:t,thetaStart:r,thetaLength:i};this.fromBufferGeometry(new THREE.CircleBufferGeometry(e,t,r,i))};THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CircleGeometry.prototype.constructor=THREE.CircleGeometry;THREE.CircleGeometry.prototype.clone=function(){var e=this.parameters;return new THREE.CircleGeometry(e.radius,e.segments,e.thetaStart,e.thetaLength)};THREE.CircleBufferGeometry=function(e,t,r,i){THREE.BufferGeometry.call(this);this.type="CircleBufferGeometry";this.parameters={radius:e,segments:t,thetaStart:r,thetaLength:i};e=e||50;t=t!==undefined?Math.max(3,t):8;r=r!==undefined?r:0;i=i!==undefined?i:Math.PI*2;var n=t+2;var a=new Float32Array(n*3);var o=new Float32Array(n*3);var s=new Float32Array(n*2);o[2]=1;s[0]=.5;s[1]=.5;for(var h=0,u=3,c=2;h<=t;h++,u+=3,c+=2){var l=r+h/t*i;a[u]=e*Math.cos(l);a[u+1]=e*Math.sin(l);o[u+2]=1;s[c]=(a[u]/e+1)/2;s[c+1]=(a[u+1]/e+1)/2}var f=[];for(var u=1;u<=t;u++){f.push(u,u+1,0)}this.setIndex(new THREE.BufferAttribute(new Uint16Array(f),1));this.addAttribute("position",new THREE.BufferAttribute(a,3));this.addAttribute("normal",new THREE.BufferAttribute(o,3));this.addAttribute("uv",new THREE.BufferAttribute(s,2));this.boundingSphere=new THREE.Sphere(new THREE.Vector3,e)};THREE.CircleBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.CircleBufferGeometry.prototype.constructor=THREE.CircleBufferGeometry;THREE.CircleBufferGeometry.prototype.clone=function(){var e=this.parameters;return new THREE.CircleBufferGeometry(e.radius,e.segments,e.thetaStart,e.thetaLength)};THREE.CylinderGeometry=function(e,t,r,i,n,a,o,s){THREE.Geometry.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:e,radiusBottom:t,height:r,radialSegments:i,heightSegments:n,openEnded:a,thetaStart:o,thetaLength:s};e=e!==undefined?e:20;t=t!==undefined?t:20;r=r!==undefined?r:100;i=i||8;n=n||1;a=a!==undefined?a:false;o=o!==undefined?o:0;s=s!==undefined?s:2*Math.PI;var h=r/2;var u,c,l=[],f=[];for(c=0;c<=n;c++){var E=[];var d=[];var p=c/n;var m=p*(t-e)+e;for(u=0;u<=i;u++){var v=u/i;var T=new THREE.Vector3;T.x=m*Math.sin(v*s+o);T.y=-p*r+h;T.z=m*Math.cos(v*s+o);this.vertices.push(T);E.push(this.vertices.length-1);d.push(new THREE.Vector2(v,1-p))}l.push(E);f.push(d)}var g=(t-e)/r;var y,R;for(u=0;u<i;u++){if(e!==0){y=this.vertices[l[0][u]].clone();R=this.vertices[l[0][u+1]].clone()}else{y=this.vertices[l[1][u]].clone();R=this.vertices[l[1][u+1]].clone()}y.setY(Math.sqrt(y.x*y.x+y.z*y.z)*g).normalize();R.setY(Math.sqrt(R.x*R.x+R.z*R.z)*g).normalize();for(c=0;c<n;c++){var H=l[c][u];var x=l[c+1][u];var b=l[c+1][u+1];var w=l[c][u+1];var M=y.clone();var S=y.clone();var _=R.clone();var A=R.clone();var C=f[c][u].clone();var L=f[c+1][u].clone();var P=f[c+1][u+1].clone();var D=f[c][u+1].clone();this.faces.push(new THREE.Face3(H,x,w,[M,S,A]));this.faceVertexUvs[0].push([C,L,D]);this.faces.push(new THREE.Face3(x,b,w,[S.clone(),_,A.clone()]));this.faceVertexUvs[0].push([L.clone(),P,D.clone()])}}if(a===false&&e>0){this.vertices.push(new THREE.Vector3(0,h,0));for(u=0;u<i;u++){var H=l[0][u];var x=l[0][u+1];var b=this.vertices.length-1;var M=new THREE.Vector3(0,1,0);var S=new THREE.Vector3(0,1,0);var _=new THREE.Vector3(0,1,0);var C=f[0][u].clone();var L=f[0][u+1].clone();var P=new THREE.Vector2(L.x,0);this.faces.push(new THREE.Face3(H,x,b,[M,S,_],undefined,1));this.faceVertexUvs[0].push([C,L,P])}}if(a===false&&t>0){this.vertices.push(new THREE.Vector3(0,-h,0));for(u=0;u<i;u++){var H=l[n][u+1];var x=l[n][u];var b=this.vertices.length-1;var M=new THREE.Vector3(0,-1,0);var S=new THREE.Vector3(0,-1,0);var _=new THREE.Vector3(0,-1,0);var C=f[n][u+1].clone();var L=f[n][u].clone();var P=new THREE.Vector2(L.x,1);this.faces.push(new THREE.Face3(H,x,b,[M,S,_],undefined,2));this.faceVertexUvs[0].push([C,L,P])}}this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;THREE.CylinderGeometry.prototype.clone=function(){var e=this.parameters;return new THREE.CylinderGeometry(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)};THREE.EdgesGeometry=function(e,t){THREE.BufferGeometry.call(this);t=t!==undefined?t:1;var r=Math.cos(THREE.Math.degToRad(t));var i=[0,0],n={};function a(e,t){return e-t}var o=["a","b","c"];var s;if(e instanceof THREE.BufferGeometry){s=new THREE.Geometry;s.fromBufferGeometry(e)}else{s=e.clone()}s.mergeVertices();s.computeFaceNormals();var h=s.vertices;var u=s.faces;for(var c=0,l=u.length;c<l;c++){var f=u[c];for(var E=0;E<3;E++){i[0]=f[o[E]];i[1]=f[o[(E+1)%3]];i.sort(a);var d=i.toString();if(n[d]===undefined){n[d]={vert1:i[0],vert2:i[1],face1:c,face2:undefined}}else{n[d].face2=c}}}var p=[];for(var d in n){var m=n[d];if(m.face2===undefined||u[m.face1].normal.dot(u[m.face2].normal)<=r){var v=h[m.vert1];p.push(v.x);p.push(v.y);p.push(v.z);v=h[m.vert2];p.push(v.x);p.push(v.y);p.push(v.z)}}this.addAttribute("position",new THREE.BufferAttribute(new Float32Array(p),3))};THREE.EdgesGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.EdgesGeometry.prototype.constructor=THREE.EdgesGeometry;THREE.ExtrudeGeometry=function(e,t){if(typeof e==="undefined"){e=[];return}THREE.Geometry.call(this);this.type="ExtrudeGeometry";e=Array.isArray(e)?e:[e];this.addShapeList(e,t);this.computeFaceNormals()};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;THREE.ExtrudeGeometry.prototype.addShapeList=function(e,t){var r=e.length;for(var i=0;i<r;i++){var n=e[i];this.addShape(n,t)}};THREE.ExtrudeGeometry.prototype.addShape=function(e,t){var r=t.amount!==undefined?t.amount:100;var i=t.bevelThickness!==undefined?t.bevelThickness:6;var n=t.bevelSize!==undefined?t.bevelSize:i-2;var a=t.bevelSegments!==undefined?t.bevelSegments:3;var o=t.bevelEnabled!==undefined?t.bevelEnabled:true;var s=t.curveSegments!==undefined?t.curveSegments:12;var h=t.steps!==undefined?t.steps:1;var u=t.extrudePath;var c,l=false;var f=t.UVGenerator!==undefined?t.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator;var E,d,p,m;if(u){c=u.getSpacedPoints(h);l=true;o=false;E=t.frames!==undefined?t.frames:new THREE.TubeGeometry.FrenetFrames(u,h,false);d=new THREE.Vector3;p=new THREE.Vector3;m=new THREE.Vector3}if(!o){a=0;i=0;n=0}var v,T,g;var y=this;var R=this.vertices.length;var H=e.extractPoints(s);var x=H.shape;var b=H.holes;var w=!THREE.ShapeUtils.isClockWise(x);if(w){x=x.reverse();for(T=0,g=b.length;T<g;T++){v=b[T];if(THREE.ShapeUtils.isClockWise(v)){b[T]=v.reverse()}}w=false}var M=THREE.ShapeUtils.triangulateShape(x,b);var S=x;for(T=0,g=b.length;T<g;T++){v=b[T];x=x.concat(v)}function _(e,t,r){if(!t)console.error("THREE.ExtrudeGeometry: vec does not exist");return t.clone().multiplyScalar(r).add(e)}var A,C,L,P,D,k=x.length,V,F=M.length;function U(e,t,r){var i,n,a=1;var o=e.x-t.x,s=e.y-t.y;var h=r.x-e.x,u=r.y-e.y;var c=o*o+s*s;var l=o*u-s*h;if(Math.abs(l)>Number.EPSILON){var f=Math.sqrt(c);var E=Math.sqrt(h*h+u*u);var d=t.x-s/f;var p=t.y+o/f;var m=r.x-u/E;var v=r.y+h/E;var T=((m-d)*u-(v-p)*h)/(o*u-s*h);i=d+o*T-e.x;n=p+s*T-e.y;var g=i*i+n*n;if(g<=2){return new THREE.Vector2(i,n)}else{a=Math.sqrt(g/2)}}else{var y=false;if(o>Number.EPSILON){if(h>Number.EPSILON){y=true}}else{if(o<-Number.EPSILON){if(h<-Number.EPSILON){y=true}}else{if(Math.sign(s)===Math.sign(u)){y=true}}}if(y){i=-s;n=o;a=Math.sqrt(c)}else{i=o;n=s;a=Math.sqrt(c/2)}}return new THREE.Vector2(i/a,n/a)}var O=[];for(var B=0,G=S.length,I=G-1,N=B+1;B<G;B++,I++,N++){if(I===G)I=0;if(N===G)N=0;O[B]=U(S[B],S[I],S[N])}var z=[],j,W=O.concat();for(T=0,g=b.length;T<g;T++){v=b[T];j=[];for(B=0,G=v.length,I=G-1,N=B+1;B<G;B++,I++,N++){if(I===G)I=0;if(N===G)N=0;j[B]=U(v[B],v[I],v[N])}z.push(j);W=W.concat(j)}for(A=0;A<a;A++){L=A/a;P=i*(1-L);C=n*Math.sin(L*Math.PI/2);for(B=0,G=S.length;B<G;B++){D=_(S[B],O[B],C);Q(D.x,D.y,-P)}for(T=0,g=b.length;T<g;T++){v=b[T];j=z[T];for(B=0,G=v.length;B<G;B++){D=_(v[B],j[B],C);Q(D.x,D.y,-P)}}}C=n;for(B=0;B<k;B++){D=o?_(x[B],W[B],C):x[B];if(!l){Q(D.x,D.y,0)}else{p.copy(E.normals[0]).multiplyScalar(D.x);d.copy(E.binormals[0]).multiplyScalar(D.y);m.copy(c[0]).add(p).add(d);Q(m.x,m.y,m.z)}}var X;for(X=1;X<=h;X++){for(B=0;B<k;B++){D=o?_(x[B],W[B],C):x[B];if(!l){Q(D.x,D.y,r/h*X)}else{p.copy(E.normals[X]).multiplyScalar(D.x);d.copy(E.binormals[X]).multiplyScalar(D.y);m.copy(c[X]).add(p).add(d);Q(m.x,m.y,m.z)}}}for(A=a-1;A>=0;A--){L=A/a;P=i*(1-L);C=n*Math.sin(L*Math.PI/2);for(B=0,G=S.length;B<G;B++){D=_(S[B],O[B],C);Q(D.x,D.y,r+P)}for(T=0,g=b.length;T<g;T++){v=b[T];j=z[T];for(B=0,G=v.length;B<G;B++){D=_(v[B],j[B],C);if(!l){Q(D.x,D.y,r+P)}else{Q(D.x,D.y+c[h-1].y,c[h-1].x+P)}}}}q();Y();function q(){if(o){var e=0;var t=k*e;for(B=0;B<F;B++){V=M[B];Z(V[2]+t,V[1]+t,V[0]+t)}e=h+a*2;t=k*e;for(B=0;B<F;B++){V=M[B];Z(V[0]+t,V[1]+t,V[2]+t)}}else{for(B=0;B<F;B++){V=M[B];Z(V[2],V[1],V[0])}for(B=0;B<F;B++){V=M[B];Z(V[0]+k*h,V[1]+k*h,V[2]+k*h)}}}function Y(){var e=0;K(S,e);e+=S.length;for(T=0,g=b.length;T<g;T++){v=b[T];K(v,e);e+=v.length}}function K(e,t){var r,i;B=e.length;while(--B>=0){r=B;i=B-1;if(i<0)i=e.length-1;var n=0,o=h+a*2;for(n=0;n<o;n++){var s=k*n;var u=k*(n+1);var c=t+r+s,l=t+i+s,f=t+i+u,E=t+r+u;J(c,l,f,E,e,n,o,r,i)}}}function Q(e,t,r){y.vertices.push(new THREE.Vector3(e,t,r))}function Z(e,t,r){e+=R;t+=R;r+=R;y.faces.push(new THREE.Face3(e,t,r,null,null,0));var i=f.generateTopUV(y,e,t,r);y.faceVertexUvs[0].push(i)}function J(e,t,r,i,n,a,o,s,h){e+=R;t+=R;r+=R;i+=R;y.faces.push(new THREE.Face3(e,t,i,null,null,1));y.faces.push(new THREE.Face3(t,r,i,null,null,1));var u=f.generateSideWallUV(y,e,t,r,i);y.faceVertexUvs[0].push([u[0],u[1],u[3]]);y.faceVertexUvs[0].push([u[1],u[2],u[3]])}};THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(e,t,r,i){var n=e.vertices;var a=n[t];var o=n[r];var s=n[i];return[new THREE.Vector2(a.x,a.y),new THREE.Vector2(o.x,o.y),new THREE.Vector2(s.x,s.y)]},generateSideWallUV:function(e,t,r,i,n){var a=e.vertices;var o=a[t];var s=a[r];var h=a[i];var u=a[n];if(Math.abs(o.y-s.y)<.01){return[new THREE.Vector2(o.x,1-o.z),new THREE.Vector2(s.x,1-s.z),new THREE.Vector2(h.x,1-h.z),new THREE.Vector2(u.x,1-u.z)]}else{return[new THREE.Vector2(o.y,1-o.z),new THREE.Vector2(s.y,1-s.z),new THREE.Vector2(h.y,1-h.z),new THREE.Vector2(u.y,1-u.z)]}}};THREE.ShapeGeometry=function(e,t){THREE.Geometry.call(this);this.type="ShapeGeometry";if(Array.isArray(e)===false)e=[e];this.addShapeList(e,t);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry;THREE.ShapeGeometry.prototype.addShapeList=function(e,t){for(var r=0,i=e.length;r<i;r++){this.addShape(e[r],t)}return this};THREE.ShapeGeometry.prototype.addShape=function(e,t){if(t===undefined)t={};var r=t.curveSegments!==undefined?t.curveSegments:12;var i=t.material;var n=t.UVGenerator===undefined?THREE.ExtrudeGeometry.WorldUVGenerator:t.UVGenerator;var a,o,s;var h=this.vertices.length;var u=e.extractPoints(r);var c=u.shape;var l=u.holes;var f=!THREE.ShapeUtils.isClockWise(c);if(f){c=c.reverse();for(a=0,o=l.length;a<o;a++){s=l[a];if(THREE.ShapeUtils.isClockWise(s)){l[a]=s.reverse()}}f=false}var E=THREE.ShapeUtils.triangulateShape(c,l);for(a=0,o=l.length;a<o;a++){s=l[a];c=c.concat(s)}var d,p=c.length;var m,v=E.length;for(a=0;a<p;a++){d=c[a];this.vertices.push(new THREE.Vector3(d.x,d.y,0))}for(a=0;a<v;a++){m=E[a];var T=m[0]+h;var g=m[1]+h;var y=m[2]+h;this.faces.push(new THREE.Face3(T,g,y,null,null,i));this.faceVertexUvs[0].push(n.generateTopUV(this,T,g,y))}};THREE.LatheGeometry=function(e,t,r,i){THREE.Geometry.call(this);this.type="LatheGeometry";this.parameters={points:e,segments:t,phiStart:r,phiLength:i};t=t||12;r=r||0;i=i||2*Math.PI;var n=1/(e.length-1);var a=1/t;for(var o=0,s=t;o<=s;o++){var h=r+o*a*i;var u=Math.cos(h),c=Math.sin(h);for(var l=0,f=e.length;l<f;l++){var E=e[l];var d=new THREE.Vector3;d.x=u*E.x-c*E.y;d.y=c*E.x+u*E.y;d.z=E.z;this.vertices.push(d)}}var p=e.length;for(var o=0,s=t;o<s;o++){for(var l=0,f=e.length-1;l<f;l++){var m=l+p*o;var v=m;var T=m+p;var u=m+1+p;var g=m+1;var y=o*a;var R=l*n;var H=y+a;var x=R+n;this.faces.push(new THREE.Face3(v,T,g));this.faceVertexUvs[0].push([new THREE.Vector2(y,R),new THREE.Vector2(H,R),new THREE.Vector2(y,x)]);this.faces.push(new THREE.Face3(T,u,g));this.faceVertexUvs[0].push([new THREE.Vector2(H,R),new THREE.Vector2(H,x),new THREE.Vector2(y,x)])}}this.mergeVertices();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;THREE.PlaneGeometry=function(e,t,r,i){THREE.Geometry.call(this);this.type="PlaneGeometry";this.parameters={width:e,height:t,widthSegments:r,heightSegments:i};this.fromBufferGeometry(new THREE.PlaneBufferGeometry(e,t,r,i))};THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry;THREE.PlaneGeometry.prototype.clone=function(){var e=this.parameters;return new THREE.PlaneGeometry(e.width,e.height,e.widthSegments,e.heightSegments)};THREE.PlaneBufferGeometry=function(e,t,r,i){THREE.BufferGeometry.call(this);this.type="PlaneBufferGeometry";this.parameters={width:e,height:t,widthSegments:r,heightSegments:i};var n=e/2;var a=t/2;var o=Math.floor(r)||1;var s=Math.floor(i)||1;var h=o+1;var u=s+1;var c=e/o;var l=t/s;var f=new Float32Array(h*u*3);var E=new Float32Array(h*u*3);var d=new Float32Array(h*u*2);var p=0;var m=0;for(var v=0;v<u;v++){var T=v*l-a;for(var g=0;g<h;g++){var y=g*c-n;f[p]=y;f[p+1]=-T;E[p+2]=1;d[m]=g/o;d[m+1]=1-v/s;p+=3;m+=2}}p=0;var R=new(f.length/3>65535?Uint32Array:Uint16Array)(o*s*6);for(var v=0;v<s;v++){for(var g=0;g<o;g++){var H=g+h*v;var x=g+h*(v+1);var b=g+1+h*(v+1);var w=g+1+h*v;R[p]=H;R[p+1]=x;R[p+2]=w;R[p+3]=x;R[p+4]=b;R[p+5]=w;p+=6}}this.setIndex(new THREE.BufferAttribute(R,1));this.addAttribute("position",new THREE.BufferAttribute(f,3));this.addAttribute("normal",new THREE.BufferAttribute(E,3));this.addAttribute("uv",new THREE.BufferAttribute(d,2))};THREE.PlaneBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.PlaneBufferGeometry.prototype.constructor=THREE.PlaneBufferGeometry;THREE.PlaneBufferGeometry.prototype.clone=function(){var e=this.parameters;return new THREE.PlaneBufferGeometry(e.width,e.height,e.widthSegments,e.heightSegments)};THREE.RingGeometry=function(e,t,r,i,n,a){THREE.Geometry.call(this);this.type="RingGeometry";this.parameters={innerRadius:e,outerRadius:t,thetaSegments:r,phiSegments:i,thetaStart:n,thetaLength:a};e=e||0;t=t||50;n=n!==undefined?n:0;a=a!==undefined?a:Math.PI*2;r=r!==undefined?Math.max(3,r):8;i=i!==undefined?Math.max(1,i):8;var o,s,h=[],u=e,c=(t-e)/i;for(o=0;o<i+1;o++){for(s=0;s<r+1;s++){var l=new THREE.Vector3;var f=n+s/r*a;l.x=u*Math.cos(f);l.y=u*Math.sin(f);this.vertices.push(l);h.push(new THREE.Vector2((l.x/t+1)/2,(l.y/t+1)/2))}u+=c}var E=new THREE.Vector3(0,0,1);for(o=0;o<i;o++){var d=o*(r+1);for(s=0;s<r;s++){var f=s+d;var p=f;var m=f+r+1;var v=f+r+2;this.faces.push(new THREE.Face3(p,m,v,[E.clone(),E.clone(),E.clone()]));this.faceVertexUvs[0].push([h[p].clone(),h[m].clone(),h[v].clone()]);p=f;m=f+r+2;v=f+1;this.faces.push(new THREE.Face3(p,m,v,[E.clone(),E.clone(),E.clone()]));this.faceVertexUvs[0].push([h[p].clone(),h[m].clone(),h[v].clone()])}}this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,u)};THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.RingGeometry.prototype.constructor=THREE.RingGeometry;THREE.RingGeometry.prototype.clone=function(){var e=this.parameters;return new THREE.RingGeometry(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)};THREE.SphereGeometry=function(e,t,r,i,n,a,o){THREE.Geometry.call(this);this.type="SphereGeometry";this.parameters={radius:e,widthSegments:t,heightSegments:r,phiStart:i,phiLength:n,thetaStart:a,thetaLength:o};this.fromBufferGeometry(new THREE.SphereBufferGeometry(e,t,r,i,n,a,o))};THREE.SphereGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;THREE.SphereGeometry.prototype.clone=function(){var e=this.parameters;return new THREE.SphereGeometry(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)};THREE.SphereBufferGeometry=function(e,t,r,i,n,a,o){THREE.BufferGeometry.call(this);this.type="SphereBufferGeometry";this.parameters={radius:e,widthSegments:t,heightSegments:r,phiStart:i,phiLength:n,thetaStart:a,thetaLength:o};e=e||50;t=Math.max(3,Math.floor(t)||8);r=Math.max(2,Math.floor(r)||6);i=i!==undefined?i:0;n=n!==undefined?n:Math.PI*2;a=a!==undefined?a:0;o=o!==undefined?o:Math.PI;var s=a+o;var h=(t+1)*(r+1);var u=new THREE.BufferAttribute(new Float32Array(h*3),3);var c=new THREE.BufferAttribute(new Float32Array(h*3),3);var l=new THREE.BufferAttribute(new Float32Array(h*2),2);var f=0,E=[],d=new THREE.Vector3;for(var p=0;p<=r;p++){var m=[];var v=p/r;for(var T=0;T<=t;T++){var g=T/t;var y=-e*Math.cos(i+g*n)*Math.sin(a+v*o);var R=e*Math.cos(a+v*o);var H=e*Math.sin(i+g*n)*Math.sin(a+v*o);d.set(y,R,H).normalize();u.setXYZ(f,y,R,H);c.setXYZ(f,d.x,d.y,d.z);l.setXY(f,g,1-v);m.push(f);f++}E.push(m)}var x=[];for(var p=0;p<r;p++){for(var T=0;T<t;T++){var b=E[p][T+1];var w=E[p][T];var M=E[p+1][T];var S=E[p+1][T+1];if(p!==0||a>0)x.push(b,w,S);if(p!==r-1||s<Math.PI)x.push(w,M,S)}}this.setIndex(new(u.count>65535?THREE.Uint32Attribute:THREE.Uint16Attribute)(x,1));this.addAttribute("position",u);this.addAttribute("normal",c);this.addAttribute("uv",l);this.boundingSphere=new THREE.Sphere(new THREE.Vector3,e)};THREE.SphereBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.SphereBufferGeometry.prototype.constructor=THREE.SphereBufferGeometry;THREE.SphereBufferGeometry.prototype.clone=function(){var e=this.parameters;return new THREE.SphereBufferGeometry(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)};THREE.TorusGeometry=function(e,t,r,i,n){THREE.Geometry.call(this);this.type="TorusGeometry";this.parameters={radius:e,tube:t,radialSegments:r,tubularSegments:i,arc:n};e=e||100;t=t||40;r=r||8;i=i||6;n=n||Math.PI*2;var a=new THREE.Vector3,o=[],s=[];for(var h=0;h<=r;h++){for(var u=0;u<=i;u++){var c=u/i*n;var l=h/r*Math.PI*2;a.x=e*Math.cos(c);a.y=e*Math.sin(c);var f=new THREE.Vector3;f.x=(e+t*Math.cos(l))*Math.cos(c);f.y=(e+t*Math.cos(l))*Math.sin(c);f.z=t*Math.sin(l);this.vertices.push(f);o.push(new THREE.Vector2(u/i,h/r));s.push(f.clone().sub(a).normalize())}}for(var h=1;h<=r;h++){for(var u=1;u<=i;u++){var E=(i+1)*h+u-1;var d=(i+1)*(h-1)+u-1;var p=(i+1)*(h-1)+u;var m=(i+1)*h+u;var v=new THREE.Face3(E,d,m,[s[E].clone(),s[d].clone(),s[m].clone()]);this.faces.push(v);this.faceVertexUvs[0].push([o[E].clone(),o[d].clone(),o[m].clone()]);v=new THREE.Face3(d,p,m,[s[d].clone(),s[p].clone(),s[m].clone()]);this.faces.push(v);this.faceVertexUvs[0].push([o[d].clone(),o[p].clone(),o[m].clone()])}}this.computeFaceNormals()};THREE.TorusGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;THREE.TorusGeometry.prototype.clone=function(){var e=this.parameters;return new THREE.TorusGeometry(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)};THREE.TorusKnotGeometry=function(e,t,r,i,n,a,o){THREE.Geometry.call(this);this.type="TorusKnotGeometry";this.parameters={radius:e,tube:t,radialSegments:r,tubularSegments:i,p:n,q:a,heightScale:o};e=e||100;t=t||40;r=r||64;i=i||8;n=n||2;a=a||3;o=o||1;var s=new Array(r);var h=new THREE.Vector3;var u=new THREE.Vector3;var c=new THREE.Vector3;for(var l=0;l<r;++l){s[l]=new Array(i);var f=l/r*2*n*Math.PI;var E=C(f,a,n,e,o);var d=C(f+.01,a,n,e,o);h.subVectors(d,E);u.addVectors(d,E);c.crossVectors(h,u);u.crossVectors(c,h);c.normalize();u.normalize();for(var p=0;p<i;++p){var m=p/i*2*Math.PI;var v=-t*Math.cos(m);var T=t*Math.sin(m);var g=new THREE.Vector3;g.x=E.x+v*u.x+T*c.x;g.y=E.y+v*u.y+T*c.y;g.z=E.z+v*u.z+T*c.z;s[l][p]=this.vertices.push(g)-1}}for(var l=0;l<r;++l){for(var p=0;p<i;++p){var y=(l+1)%r;var R=(p+1)%i;var H=s[l][p];var x=s[y][p];var b=s[y][R];var w=s[l][R];var M=new THREE.Vector2(l/r,p/i);var S=new THREE.Vector2((l+1)/r,p/i);var _=new THREE.Vector2((l+1)/r,(p+1)/i);var A=new THREE.Vector2(l/r,(p+1)/i);this.faces.push(new THREE.Face3(H,x,w));this.faceVertexUvs[0].push([M,S,A]);this.faces.push(new THREE.Face3(x,b,w));this.faceVertexUvs[0].push([S.clone(),_,A.clone()])}}this.computeFaceNormals();this.computeVertexNormals();function C(e,t,r,i,n){var a=Math.cos(e);var o=Math.sin(e);var s=t/r*e;var h=Math.cos(s);var u=i*(2+h)*.5*a;var c=i*(2+h)*o*.5;var l=n*i*Math.sin(s)*.5;return new THREE.Vector3(u,c,l)}};THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;THREE.TorusKnotGeometry.prototype.clone=function(){var e=this.parameters;return new THREE.TorusKnotGeometry(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.p,e.q,e.heightScale)};THREE.TubeGeometry=function(e,t,r,i,n,a){THREE.Geometry.call(this);this.type="TubeGeometry";this.parameters={path:e,segments:t,radius:r,radialSegments:i,closed:n,taper:a};t=t||64;r=r||1;i=i||8;n=n||false;a=a||THREE.TubeGeometry.NoTaper;var o=[];var s=this,h,u,c,l=t+1,f,E,d,p,m,v,T=new THREE.Vector3,g,y,R,H,x,b,w,M,S,_,A,C;var L=new THREE.TubeGeometry.FrenetFrames(e,t,n),P=L.tangents,D=L.normals,k=L.binormals;
this.tangents=P;this.normals=D;this.binormals=k;function V(e,t,r){return s.vertices.push(new THREE.Vector3(e,t,r))-1}for(g=0;g<l;g++){o[g]=[];f=g/(l-1);v=e.getPointAt(f);h=P[g];u=D[g];c=k[g];d=r*a(f);for(y=0;y<i;y++){E=y/i*2*Math.PI;p=-d*Math.cos(E);m=d*Math.sin(E);T.copy(v);T.x+=p*u.x+m*c.x;T.y+=p*u.y+m*c.y;T.z+=p*u.z+m*c.z;o[g][y]=V(T.x,T.y,T.z)}}for(g=0;g<t;g++){for(y=0;y<i;y++){R=n?(g+1)%t:g+1;H=(y+1)%i;x=o[g][y];b=o[R][y];w=o[R][H];M=o[g][H];S=new THREE.Vector2(g/t,y/i);_=new THREE.Vector2((g+1)/t,y/i);A=new THREE.Vector2((g+1)/t,(y+1)/i);C=new THREE.Vector2(g/t,(y+1)/i);this.faces.push(new THREE.Face3(x,b,M));this.faceVertexUvs[0].push([S,_,C]);this.faces.push(new THREE.Face3(b,w,M));this.faceVertexUvs[0].push([_.clone(),A,C.clone()])}}this.computeFaceNormals();this.computeVertexNormals()};THREE.TubeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TubeGeometry.prototype.constructor=THREE.TubeGeometry;THREE.TubeGeometry.prototype.clone=function(){return new this.constructor(this.parameters.path,this.parameters.segments,this.parameters.radius,this.parameters.radialSegments,this.parameters.closed,this.parameters.taper)};THREE.TubeGeometry.NoTaper=function(e){return 1};THREE.TubeGeometry.SinusoidalTaper=function(e){return Math.sin(Math.PI*e)};THREE.TubeGeometry.FrenetFrames=function(e,t,r){var i=new THREE.Vector3,n=[],a=[],o=[],s=new THREE.Vector3,h=new THREE.Matrix4,u=t+1,c,l,f,E,d,p,m;this.tangents=n;this.normals=a;this.binormals=o;for(p=0;p<u;p++){m=p/(u-1);n[p]=e.getTangentAt(m);n[p].normalize()}v();function v(){a[0]=new THREE.Vector3;o[0]=new THREE.Vector3;l=Number.MAX_VALUE;f=Math.abs(n[0].x);E=Math.abs(n[0].y);d=Math.abs(n[0].z);if(f<=l){l=f;i.set(1,0,0)}if(E<=l){l=E;i.set(0,1,0)}if(d<=l){i.set(0,0,1)}s.crossVectors(n[0],i).normalize();a[0].crossVectors(n[0],s);o[0].crossVectors(n[0],a[0])}for(p=1;p<u;p++){a[p]=a[p-1].clone();o[p]=o[p-1].clone();s.crossVectors(n[p-1],n[p]);if(s.length()>Number.EPSILON){s.normalize();c=Math.acos(THREE.Math.clamp(n[p-1].dot(n[p]),-1,1));a[p].applyMatrix4(h.makeRotationAxis(s,c))}o[p].crossVectors(n[p],a[p])}if(r){c=Math.acos(THREE.Math.clamp(a[0].dot(a[u-1]),-1,1));c/=u-1;if(n[0].dot(s.crossVectors(a[0],a[u-1]))>0){c=-c}for(p=1;p<u;p++){a[p].applyMatrix4(h.makeRotationAxis(n[p],c*p));o[p].crossVectors(n[p],a[p])}}};THREE.PolyhedronGeometry=function(e,t,r,i){THREE.Geometry.call(this);this.type="PolyhedronGeometry";this.parameters={vertices:e,indices:t,radius:r,detail:i};r=r||1;i=i||0;var n=this;for(var a=0,o=e.length;a<o;a+=3){y(new THREE.Vector3(e[a],e[a+1],e[a+2]))}var s=this.vertices;var h=[];for(var a=0,u=0,o=t.length;a<o;a+=3,u++){var c=s[t[a]];var l=s[t[a+1]];var f=s[t[a+2]];h[u]=new THREE.Face3(c.index,l.index,f.index,[c.clone(),l.clone(),f.clone()],undefined,u)}var E=new THREE.Vector3;for(var a=0,o=h.length;a<o;a++){H(h[a],i)}for(var a=0,o=this.faceVertexUvs[0].length;a<o;a++){var d=this.faceVertexUvs[0][a];var p=d[0].x;var m=d[1].x;var v=d[2].x;var T=Math.max(p,m,v);var g=Math.min(p,m,v);if(T>.9&&g<.1){if(p<.2)d[0].x+=1;if(m<.2)d[1].x+=1;if(v<.2)d[2].x+=1}}for(var a=0,o=this.vertices.length;a<o;a++){this.vertices[a].multiplyScalar(r)}this.mergeVertices();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,r);function y(e){var t=e.normalize().clone();t.index=n.vertices.push(t)-1;var r=x(e)/2/Math.PI+.5;var i=b(e)/Math.PI+.5;t.uv=new THREE.Vector2(r,1-i);return t}function R(e,t,r,i){var a=new THREE.Face3(e.index,t.index,r.index,[e.clone(),t.clone(),r.clone()],undefined,i);n.faces.push(a);E.copy(e).add(t).add(r).divideScalar(3);var o=x(E);n.faceVertexUvs[0].push([w(e.uv,e,o),w(t.uv,t,o),w(r.uv,r,o)])}function H(e,t){var r=Math.pow(2,t);var i=y(n.vertices[e.a]);var a=y(n.vertices[e.b]);var o=y(n.vertices[e.c]);var s=[];var h=e.materialIndex;for(var u=0;u<=r;u++){s[u]=[];var c=y(i.clone().lerp(o,u/r));var l=y(a.clone().lerp(o,u/r));var f=r-u;for(var E=0;E<=f;E++){if(E===0&&u===r){s[u][E]=c}else{s[u][E]=y(c.clone().lerp(l,E/f))}}}for(var u=0;u<r;u++){for(var E=0;E<2*(r-u)-1;E++){var d=Math.floor(E/2);if(E%2===0){R(s[u][d+1],s[u+1][d],s[u][d],h)}else{R(s[u][d+1],s[u+1][d+1],s[u+1][d],h)}}}}function x(e){return Math.atan2(e.z,-e.x)}function b(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}function w(e,t,r){if(r<0&&e.x===1)e=new THREE.Vector2(e.x-1,e.y);if(t.x===0&&t.z===0)e=new THREE.Vector2(r/2/Math.PI+.5,e.y);return e.clone()}};THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PolyhedronGeometry.prototype.constructor=THREE.PolyhedronGeometry;THREE.PolyhedronGeometry.prototype.clone=function(){var e=this.parameters;return new THREE.PolyhedronGeometry(e.vertices,e.indices,e.radius,e.detail)};THREE.DodecahedronGeometry=function(e,t){var r=(1+Math.sqrt(5))/2;var i=1/r;var n=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-r,0,-i,r,0,i,-r,0,i,r,-i,-r,0,-i,r,0,i,-r,0,i,r,0,-r,0,-i,r,0,-i,-r,0,i,r,0,i];var a=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];THREE.PolyhedronGeometry.call(this,n,a,e,t);this.type="DodecahedronGeometry";this.parameters={radius:e,detail:t}};THREE.DodecahedronGeometry.prototype=Object.create(THREE.PolyhedronGeometry.prototype);THREE.DodecahedronGeometry.prototype.constructor=THREE.DodecahedronGeometry;THREE.DodecahedronGeometry.prototype.clone=function(){var e=this.parameters;return new THREE.DodecahedronGeometry(e.radius,e.detail)};THREE.IcosahedronGeometry=function(e,t){var r=(1+Math.sqrt(5))/2;var i=[-1,r,0,1,r,0,-1,-r,0,1,-r,0,0,-1,r,0,1,r,0,-1,-r,0,1,-r,r,0,-1,r,0,1,-r,0,-1,-r,0,1];var n=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];THREE.PolyhedronGeometry.call(this,i,n,e,t);this.type="IcosahedronGeometry";this.parameters={radius:e,detail:t}};THREE.IcosahedronGeometry.prototype=Object.create(THREE.PolyhedronGeometry.prototype);THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry;THREE.IcosahedronGeometry.prototype.clone=function(){var e=this.parameters;return new THREE.IcosahedronGeometry(e.radius,e.detail)};THREE.OctahedronGeometry=function(e,t){var r=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1];var i=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];THREE.PolyhedronGeometry.call(this,r,i,e,t);this.type="OctahedronGeometry";this.parameters={radius:e,detail:t}};THREE.OctahedronGeometry.prototype=Object.create(THREE.PolyhedronGeometry.prototype);THREE.OctahedronGeometry.prototype.constructor=THREE.OctahedronGeometry;THREE.OctahedronGeometry.prototype.clone=function(){var e=this.parameters;return new THREE.OctahedronGeometry(e.radius,e.detail)};THREE.TetrahedronGeometry=function(e,t){var r=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1];var i=[2,1,0,0,3,2,1,3,0,2,3,1];THREE.PolyhedronGeometry.call(this,r,i,e,t);this.type="TetrahedronGeometry";this.parameters={radius:e,detail:t}};THREE.TetrahedronGeometry.prototype=Object.create(THREE.PolyhedronGeometry.prototype);THREE.TetrahedronGeometry.prototype.constructor=THREE.TetrahedronGeometry;THREE.TetrahedronGeometry.prototype.clone=function(){var e=this.parameters;return new THREE.TetrahedronGeometry(e.radius,e.detail)};THREE.ParametricGeometry=function(e,t,r){THREE.Geometry.call(this);this.type="ParametricGeometry";this.parameters={func:e,slices:t,stacks:r};var i=this.vertices;var n=this.faces;var a=this.faceVertexUvs[0];var o,s,h;var u,c;var l=t+1;for(o=0;o<=r;o++){c=o/r;for(s=0;s<=t;s++){u=s/t;h=e(u,c);i.push(h)}}var f,E,d,p;var m,v,T,g;for(o=0;o<r;o++){for(s=0;s<t;s++){f=o*l+s;E=o*l+s+1;d=(o+1)*l+s+1;p=(o+1)*l+s;m=new THREE.Vector2(s/t,o/r);v=new THREE.Vector2((s+1)/t,o/r);T=new THREE.Vector2((s+1)/t,(o+1)/r);g=new THREE.Vector2(s/t,(o+1)/r);n.push(new THREE.Face3(f,E,p));a.push([m,v,g]);n.push(new THREE.Face3(E,d,p));a.push([v.clone(),T,g.clone()])}}this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ParametricGeometry.prototype.constructor=THREE.ParametricGeometry;THREE.WireframeGeometry=function(e){THREE.BufferGeometry.call(this);var t=[0,0],r={};function i(e,t){return e-t}var n=["a","b","c"];if(e instanceof THREE.Geometry){var a=e.vertices;var o=e.faces;var s=0;var h=new Uint32Array(6*o.length);for(var u=0,c=o.length;u<c;u++){var l=o[u];for(var f=0;f<3;f++){t[0]=l[n[f]];t[1]=l[n[(f+1)%3]];t.sort(i);var E=t.toString();if(r[E]===undefined){h[2*s]=t[0];h[2*s+1]=t[1];r[E]=true;s++}}}var d=new Float32Array(s*2*3);for(var u=0,c=s;u<c;u++){for(var f=0;f<2;f++){var p=a[h[2*u+f]];var m=6*u+3*f;d[m+0]=p.x;d[m+1]=p.y;d[m+2]=p.z}}this.addAttribute("position",new THREE.BufferAttribute(d,3))}else if(e instanceof THREE.BufferGeometry){if(e.index!==null){var v=e.index.array;var a=e.attributes.position;var T=e.drawcalls;var s=0;if(T.length===0){e.addGroup(0,v.length)}var h=new Uint32Array(2*v.length);for(var g=0,y=T.length;g<y;++g){var R=T[g];var H=R.start;var x=R.count;for(var u=H,b=H+x;u<b;u+=3){for(var f=0;f<3;f++){t[0]=v[u+f];t[1]=v[u+(f+1)%3];t.sort(i);var E=t.toString();if(r[E]===undefined){h[2*s]=t[0];h[2*s+1]=t[1];r[E]=true;s++}}}}var d=new Float32Array(s*2*3);for(var u=0,c=s;u<c;u++){for(var f=0;f<2;f++){var m=6*u+3*f;var w=h[2*u+f];d[m+0]=a.getX(w);d[m+1]=a.getY(w);d[m+2]=a.getZ(w)}}this.addAttribute("position",new THREE.BufferAttribute(d,3))}else{var a=e.attributes.position.array;var s=a.length/3;var M=s/3;var d=new Float32Array(s*2*3);for(var u=0,c=M;u<c;u++){for(var f=0;f<3;f++){var m=18*u+6*f;var S=9*u+3*f;d[m+0]=a[S];d[m+1]=a[S+1];d[m+2]=a[S+2];var w=9*u+3*((f+1)%3);d[m+3]=a[w];d[m+4]=a[w+1];d[m+5]=a[w+2]}}this.addAttribute("position",new THREE.BufferAttribute(d,3))}}};THREE.WireframeGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.WireframeGeometry.prototype.constructor=THREE.WireframeGeometry;THREE.AxisHelper=function(e){e=e||1;var t=new Float32Array([0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e]);var r=new Float32Array([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1]);var i=new THREE.BufferGeometry;i.addAttribute("position",new THREE.BufferAttribute(t,3));i.addAttribute("color",new THREE.BufferAttribute(r,3));var n=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});THREE.LineSegments.call(this,i,n)};THREE.AxisHelper.prototype=Object.create(THREE.LineSegments.prototype);THREE.AxisHelper.prototype.constructor=THREE.AxisHelper;THREE.ArrowHelper=function(){var e=new THREE.Geometry;e.vertices.push(new THREE.Vector3(0,0,0),new THREE.Vector3(0,1,0));var t=new THREE.CylinderGeometry(0,.5,1,5,1);t.translate(0,-.5,0);return function r(i,n,a,o,s,h){THREE.Object3D.call(this);if(o===undefined)o=16776960;if(a===undefined)a=1;if(s===undefined)s=.2*a;if(h===undefined)h=.2*s;this.position.copy(n);if(s<a){this.line=new THREE.Line(e,new THREE.LineBasicMaterial({color:o}));this.line.matrixAutoUpdate=false;this.add(this.line)}this.cone=new THREE.Mesh(t,new THREE.MeshBasicMaterial({color:o}));this.cone.matrixAutoUpdate=false;this.add(this.cone);this.setDirection(i);this.setLength(a,s,h)}}();THREE.ArrowHelper.prototype=Object.create(THREE.Object3D.prototype);THREE.ArrowHelper.prototype.constructor=THREE.ArrowHelper;THREE.ArrowHelper.prototype.setDirection=function(){var e=new THREE.Vector3;var t;return function r(i){if(i.y>.99999){this.quaternion.set(0,0,0,1)}else if(i.y<-.99999){this.quaternion.set(1,0,0,0)}else{e.set(i.z,0,-i.x).normalize();t=Math.acos(i.y);this.quaternion.setFromAxisAngle(e,t)}}}();THREE.ArrowHelper.prototype.setLength=function(e,t,r){if(t===undefined)t=.2*e;if(r===undefined)r=.2*t;if(t<e){this.line.scale.set(1,e-t,1);this.line.updateMatrix()}this.cone.scale.set(r,t,r);this.cone.position.y=e;this.cone.updateMatrix()};THREE.ArrowHelper.prototype.setColor=function(e){if(this.line!==undefined)this.line.material.color.set(e);this.cone.material.color.set(e)};THREE.BoxHelper=function(e){var t=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]);var r=new Float32Array(8*3);var i=new THREE.BufferGeometry;i.setIndex(new THREE.BufferAttribute(t,1));i.addAttribute("position",new THREE.BufferAttribute(r,3));THREE.LineSegments.call(this,i,new THREE.LineBasicMaterial({color:16776960}));if(e!==undefined){this.update(e)}};THREE.BoxHelper.prototype=Object.create(THREE.LineSegments.prototype);THREE.BoxHelper.prototype.constructor=THREE.BoxHelper;THREE.BoxHelper.prototype.update=function(){var e=new THREE.Box3;return function(t){e.setFromObject(t);if(e.empty())return;var r=e.min;var i=e.max;var n=this.geometry.attributes.position;var a=n.array;a[0]=i.x;a[1]=i.y;a[2]=i.z;a[3]=r.x;a[4]=i.y;a[5]=i.z;a[6]=r.x;a[7]=r.y;a[8]=i.z;a[9]=i.x;a[10]=r.y;a[11]=i.z;a[12]=i.x;a[13]=i.y;a[14]=r.z;a[15]=r.x;a[16]=i.y;a[17]=r.z;a[18]=r.x;a[19]=r.y;a[20]=r.z;a[21]=i.x;a[22]=r.y;a[23]=r.z;n.needsUpdate=true;this.geometry.computeBoundingSphere()}}();THREE.BoundingBoxHelper=function(e,t){var r=t!==undefined?t:8947848;this.object=e;this.box=new THREE.Box3;THREE.Mesh.call(this,new THREE.BoxGeometry(1,1,1),new THREE.MeshBasicMaterial({color:r,wireframe:true}))};THREE.BoundingBoxHelper.prototype=Object.create(THREE.Mesh.prototype);THREE.BoundingBoxHelper.prototype.constructor=THREE.BoundingBoxHelper;THREE.BoundingBoxHelper.prototype.update=function(){this.box.setFromObject(this.object);this.box.size(this.scale);this.box.center(this.position)};THREE.CameraHelper=function(e){var t=new THREE.Geometry;var r=new THREE.LineBasicMaterial({color:16777215,vertexColors:THREE.FaceColors});var i={};var n=16755200;var a=16711680;var o=43775;var s=16777215;var h=3355443;u("n1","n2",n);u("n2","n4",n);u("n4","n3",n);u("n3","n1",n);u("f1","f2",n);u("f2","f4",n);u("f4","f3",n);u("f3","f1",n);u("n1","f1",n);u("n2","f2",n);u("n3","f3",n);u("n4","f4",n);u("p","n1",a);u("p","n2",a);u("p","n3",a);u("p","n4",a);u("u1","u2",o);u("u2","u3",o);u("u3","u1",o);u("c","t",s);u("p","c",h);u("cn1","cn2",h);u("cn3","cn4",h);u("cf1","cf2",h);u("cf3","cf4",h);function u(e,t,r){c(e,r);c(t,r)}function c(e,r){t.vertices.push(new THREE.Vector3);t.colors.push(new THREE.Color(r));if(i[e]===undefined){i[e]=[]}i[e].push(t.vertices.length-1)}THREE.LineSegments.call(this,t,r);this.camera=e;this.camera.updateProjectionMatrix();this.matrix=e.matrixWorld;this.matrixAutoUpdate=false;this.pointMap=i;this.update()};THREE.CameraHelper.prototype=Object.create(THREE.LineSegments.prototype);THREE.CameraHelper.prototype.constructor=THREE.CameraHelper;THREE.CameraHelper.prototype.update=function(){var e,t;var r=new THREE.Vector3;var i=new THREE.Camera;function n(n,a,o,s){r.set(a,o,s).unproject(i);var h=t[n];if(h!==undefined){for(var u=0,c=h.length;u<c;u++){e.vertices[h[u]].copy(r)}}}return function(){e=this.geometry;t=this.pointMap;var r=1,a=1;i.projectionMatrix.copy(this.camera.projectionMatrix);n("c",0,0,-1);n("t",0,0,1);n("n1",-r,-a,-1);n("n2",r,-a,-1);n("n3",-r,a,-1);n("n4",r,a,-1);n("f1",-r,-a,1);n("f2",r,-a,1);n("f3",-r,a,1);n("f4",r,a,1);n("u1",r*.7,a*1.1,-1);n("u2",-r*.7,a*1.1,-1);n("u3",0,a*2,-1);n("cf1",-r,0,1);n("cf2",r,0,1);n("cf3",0,-a,1);n("cf4",0,a,1);n("cn1",-r,0,-1);n("cn2",r,0,-1);n("cn3",0,-a,-1);n("cn4",0,a,-1);e.verticesNeedUpdate=true}}();THREE.DirectionalLightHelper=function(e,t){THREE.Object3D.call(this);this.light=e;this.light.updateMatrixWorld();this.matrix=e.matrixWorld;this.matrixAutoUpdate=false;t=t||1;var r=new THREE.Geometry;r.vertices.push(new THREE.Vector3(-t,t,0),new THREE.Vector3(t,t,0),new THREE.Vector3(t,-t,0),new THREE.Vector3(-t,-t,0),new THREE.Vector3(-t,t,0));var i=new THREE.LineBasicMaterial({fog:false});i.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.lightPlane=new THREE.Line(r,i);this.add(this.lightPlane);r=new THREE.Geometry;r.vertices.push(new THREE.Vector3,new THREE.Vector3);i=new THREE.LineBasicMaterial({fog:false});i.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.targetLine=new THREE.Line(r,i);this.add(this.targetLine);this.update()};THREE.DirectionalLightHelper.prototype=Object.create(THREE.Object3D.prototype);THREE.DirectionalLightHelper.prototype.constructor=THREE.DirectionalLightHelper;THREE.DirectionalLightHelper.prototype.dispose=function(){this.lightPlane.geometry.dispose();this.lightPlane.material.dispose();this.targetLine.geometry.dispose();this.targetLine.material.dispose()};THREE.DirectionalLightHelper.prototype.update=function(){var e=new THREE.Vector3;var t=new THREE.Vector3;var r=new THREE.Vector3;return function(){e.setFromMatrixPosition(this.light.matrixWorld);t.setFromMatrixPosition(this.light.target.matrixWorld);r.subVectors(t,e);this.lightPlane.lookAt(r);this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.targetLine.geometry.vertices[1].copy(r);this.targetLine.geometry.verticesNeedUpdate=true;this.targetLine.material.color.copy(this.lightPlane.material.color)}}();THREE.EdgesHelper=function(e,t,r){var i=t!==undefined?t:16777215;THREE.LineSegments.call(this,new THREE.EdgesGeometry(e.geometry,r),new THREE.LineBasicMaterial({color:i}));this.matrix=e.matrixWorld;this.matrixAutoUpdate=false};THREE.EdgesHelper.prototype=Object.create(THREE.LineSegments.prototype);THREE.EdgesHelper.prototype.constructor=THREE.EdgesHelper;THREE.FaceNormalsHelper=function(e,t,r,i){this.object=e;this.size=t!==undefined?t:1;var n=r!==undefined?r:16776960;var a=i!==undefined?i:1;var o=0;var s=this.object.geometry;if(s instanceof THREE.Geometry){o=s.faces.length}else{console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.")}var h=new THREE.BufferGeometry;var u=new THREE.Float32Attribute(o*2*3,3);h.addAttribute("position",u);THREE.LineSegments.call(this,h,new THREE.LineBasicMaterial({color:n,linewidth:a}));this.matrixAutoUpdate=false;this.update()};THREE.FaceNormalsHelper.prototype=Object.create(THREE.LineSegments.prototype);THREE.FaceNormalsHelper.prototype.constructor=THREE.FaceNormalsHelper;THREE.FaceNormalsHelper.prototype.update=function(){var e=new THREE.Vector3;var t=new THREE.Vector3;var r=new THREE.Matrix3;return function i(){this.object.updateMatrixWorld(true);r.getNormalMatrix(this.object.matrixWorld);var i=this.object.matrixWorld;var n=this.geometry.attributes.position;var a=this.object.geometry;var o=a.vertices;var s=a.faces;var h=0;for(var u=0,c=s.length;u<c;u++){var l=s[u];var f=l.normal;e.copy(o[l.a]).add(o[l.b]).add(o[l.c]).divideScalar(3).applyMatrix4(i);t.copy(f).applyMatrix3(r).normalize().multiplyScalar(this.size).add(e);n.setXYZ(h,e.x,e.y,e.z);h=h+1;n.setXYZ(h,t.x,t.y,t.z);h=h+1}n.needsUpdate=true;return this}}();THREE.GridHelper=function(e,t){var r=new THREE.Geometry;var i=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});this.color1=new THREE.Color(4473924);this.color2=new THREE.Color(8947848);for(var n=-e;n<=e;n+=t){r.vertices.push(new THREE.Vector3(-e,0,n),new THREE.Vector3(e,0,n),new THREE.Vector3(n,0,-e),new THREE.Vector3(n,0,e));var a=n===0?this.color1:this.color2;r.colors.push(a,a,a,a)}THREE.LineSegments.call(this,r,i)};THREE.GridHelper.prototype=Object.create(THREE.LineSegments.prototype);THREE.GridHelper.prototype.constructor=THREE.GridHelper;THREE.GridHelper.prototype.setColors=function(e,t){this.color1.set(e);this.color2.set(t);this.geometry.colorsNeedUpdate=true};THREE.HemisphereLightHelper=function(e,t){THREE.Object3D.call(this);this.light=e;this.light.updateMatrixWorld();this.matrix=e.matrixWorld;this.matrixAutoUpdate=false;this.colors=[new THREE.Color,new THREE.Color];var r=new THREE.SphereGeometry(t,4,2);r.rotateX(-Math.PI/2);for(var i=0,n=8;i<n;i++){r.faces[i].color=this.colors[i<4?0:1]}var a=new THREE.MeshBasicMaterial({vertexColors:THREE.FaceColors,wireframe:true});this.lightSphere=new THREE.Mesh(r,a);this.add(this.lightSphere);this.update()};THREE.HemisphereLightHelper.prototype=Object.create(THREE.Object3D.prototype);THREE.HemisphereLightHelper.prototype.constructor=THREE.HemisphereLightHelper;THREE.HemisphereLightHelper.prototype.dispose=function(){this.lightSphere.geometry.dispose();this.lightSphere.material.dispose()};THREE.HemisphereLightHelper.prototype.update=function(){var e=new THREE.Vector3;return function(){this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity);this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity);this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate());this.lightSphere.geometry.colorsNeedUpdate=true}}();THREE.PointLightHelper=function(e,t){this.light=e;this.light.updateMatrixWorld();var r=new THREE.SphereGeometry(t,4,2);var i=new THREE.MeshBasicMaterial({wireframe:true,fog:false});i.color.copy(this.light.color).multiplyScalar(this.light.intensity);THREE.Mesh.call(this,r,i);this.matrix=this.light.matrixWorld;this.matrixAutoUpdate=false};THREE.PointLightHelper.prototype=Object.create(THREE.Mesh.prototype);THREE.PointLightHelper.prototype.constructor=THREE.PointLightHelper;THREE.PointLightHelper.prototype.dispose=function(){this.geometry.dispose();this.material.dispose()};THREE.PointLightHelper.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)};THREE.SkeletonHelper=function(e){this.bones=this.getBoneList(e);var t=new THREE.Geometry;for(var r=0;r<this.bones.length;r++){var i=this.bones[r];if(i.parent instanceof THREE.Bone){t.vertices.push(new THREE.Vector3);t.vertices.push(new THREE.Vector3);t.colors.push(new THREE.Color(0,0,1));t.colors.push(new THREE.Color(0,1,0))}}t.dynamic=true;var n=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors,depthTest:false,depthWrite:false,transparent:true});THREE.LineSegments.call(this,t,n);this.root=e;this.matrix=e.matrixWorld;this.matrixAutoUpdate=false;this.update()};THREE.SkeletonHelper.prototype=Object.create(THREE.LineSegments.prototype);THREE.SkeletonHelper.prototype.constructor=THREE.SkeletonHelper;THREE.SkeletonHelper.prototype.getBoneList=function(e){var t=[];if(e instanceof THREE.Bone){t.push(e)}for(var r=0;r<e.children.length;r++){t.push.apply(t,this.getBoneList(e.children[r]))}return t};THREE.SkeletonHelper.prototype.update=function(){var e=this.geometry;var t=(new THREE.Matrix4).getInverse(this.root.matrixWorld);var r=new THREE.Matrix4;var i=0;for(var n=0;n<this.bones.length;n++){var a=this.bones[n];if(a.parent instanceof THREE.Bone){r.multiplyMatrices(t,a.matrixWorld);e.vertices[i].setFromMatrixPosition(r);r.multiplyMatrices(t,a.parent.matrixWorld);e.vertices[i+1].setFromMatrixPosition(r);i+=2}}e.verticesNeedUpdate=true;e.computeBoundingSphere()};THREE.SpotLightHelper=function(e){THREE.Object3D.call(this);this.light=e;this.light.updateMatrixWorld();this.matrix=e.matrixWorld;this.matrixAutoUpdate=false;var t=new THREE.CylinderGeometry(0,1,1,8,1,true);t.translate(0,-.5,0);t.rotateX(-Math.PI/2);var r=new THREE.MeshBasicMaterial({wireframe:true,fog:false});this.cone=new THREE.Mesh(t,r);this.add(this.cone);this.update()};THREE.SpotLightHelper.prototype=Object.create(THREE.Object3D.prototype);THREE.SpotLightHelper.prototype.constructor=THREE.SpotLightHelper;THREE.SpotLightHelper.prototype.dispose=function(){this.cone.geometry.dispose();this.cone.material.dispose()};THREE.SpotLightHelper.prototype.update=function(){var e=new THREE.Vector3;var t=new THREE.Vector3;return function(){var r=this.light.distance?this.light.distance:1e4;var i=r*Math.tan(this.light.angle);this.cone.scale.set(i,i,r);e.setFromMatrixPosition(this.light.matrixWorld);t.setFromMatrixPosition(this.light.target.matrixWorld);this.cone.lookAt(t.sub(e));this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}}();THREE.VertexNormalsHelper=function(e,t,r,i){this.object=e;this.size=t!==undefined?t:1;var n=r!==undefined?r:16711680;var a=i!==undefined?i:1;var o=0;var s=this.object.geometry;if(s instanceof THREE.Geometry){o=s.faces.length*3}else if(s instanceof THREE.BufferGeometry){o=s.attributes.normal.count}var h=new THREE.BufferGeometry;var u=new THREE.Float32Attribute(o*2*3,3);h.addAttribute("position",u);THREE.LineSegments.call(this,h,new THREE.LineBasicMaterial({color:n,linewidth:a}));this.matrixAutoUpdate=false;this.update()};THREE.VertexNormalsHelper.prototype=Object.create(THREE.LineSegments.prototype);THREE.VertexNormalsHelper.prototype.constructor=THREE.VertexNormalsHelper;THREE.VertexNormalsHelper.prototype.update=function(){var e=new THREE.Vector3;var t=new THREE.Vector3;var r=new THREE.Matrix3;return function i(){var i=["a","b","c"];this.object.updateMatrixWorld(true);r.getNormalMatrix(this.object.matrixWorld);var n=this.object.matrixWorld;var a=this.geometry.attributes.position;var o=this.object.geometry;if(o instanceof THREE.Geometry){var s=o.vertices;var h=o.faces;var u=0;for(var c=0,l=h.length;c<l;c++){var f=h[c];for(var E=0,d=f.vertexNormals.length;E<d;E++){var p=s[f[i[E]]];var m=f.vertexNormals[E];e.copy(p).applyMatrix4(n);t.copy(m).applyMatrix3(r).normalize().multiplyScalar(this.size).add(e);a.setXYZ(u,e.x,e.y,e.z);u=u+1;a.setXYZ(u,t.x,t.y,t.z);u=u+1}}}else if(o instanceof THREE.BufferGeometry){var v=o.attributes.position;var T=o.attributes.normal;var u=0;for(var E=0,d=v.count;E<d;E++){e.set(v.getX(E),v.getY(E),v.getZ(E)).applyMatrix4(n);t.set(T.getX(E),T.getY(E),T.getZ(E));t.applyMatrix3(r).normalize().multiplyScalar(this.size).add(e);a.setXYZ(u,e.x,e.y,e.z);u=u+1;a.setXYZ(u,t.x,t.y,t.z);u=u+1}}a.needsUpdate=true;return this}}();THREE.WireframeHelper=function(e,t){var r=t!==undefined?t:16777215;THREE.LineSegments.call(this,new THREE.WireframeGeometry(e.geometry),new THREE.LineBasicMaterial({color:r}));this.matrix=e.matrixWorld;this.matrixAutoUpdate=false};THREE.WireframeHelper.prototype=Object.create(THREE.LineSegments.prototype);THREE.WireframeHelper.prototype.constructor=THREE.WireframeHelper;THREE.ImmediateRenderObject=function(e){THREE.Object3D.call(this);this.material=e;this.render=function(e){}};THREE.ImmediateRenderObject.prototype=Object.create(THREE.Object3D.prototype);THREE.ImmediateRenderObject.prototype.constructor=THREE.ImmediateRenderObject;THREE.MorphBlendMesh=function(e,t){THREE.Mesh.call(this,e,t);this.animationsMap={};this.animationsList=[];var r=this.geometry.morphTargets.length;var i="__default";var n=0;var a=r-1;var o=r/1;this.createAnimation(i,n,a,o);this.setAnimationWeight(i,1)};THREE.MorphBlendMesh.prototype=Object.create(THREE.Mesh.prototype);THREE.MorphBlendMesh.prototype.constructor=THREE.MorphBlendMesh;THREE.MorphBlendMesh.prototype.createAnimation=function(e,t,r,i){var n={start:t,end:r,length:r-t+1,fps:i,duration:(r-t)/i,lastFrame:0,currentFrame:0,active:false,time:0,direction:1,weight:1,directionBackwards:false,mirroredLoop:false};this.animationsMap[e]=n;this.animationsList.push(n)};THREE.MorphBlendMesh.prototype.autoCreateAnimations=function(e){var t=/([a-z]+)_?(\d+)/;var r,i={};var n=this.geometry;for(var a=0,o=n.morphTargets.length;a<o;a++){var s=n.morphTargets[a];var h=s.name.match(t);if(h&&h.length>1){var u=h[1];if(!i[u])i[u]={start:Infinity,end:-Infinity};var c=i[u];if(a<c.start)c.start=a;if(a>c.end)c.end=a;if(!r)r=u}}for(var u in i){var c=i[u];this.createAnimation(u,c.start,c.end,e)}this.firstAnimation=r};THREE.MorphBlendMesh.prototype.setAnimationDirectionForward=function(e){var t=this.animationsMap[e];if(t){t.direction=1;t.directionBackwards=false}};THREE.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(e){var t=this.animationsMap[e];if(t){t.direction=-1;t.directionBackwards=true}};THREE.MorphBlendMesh.prototype.setAnimationFPS=function(e,t){var r=this.animationsMap[e];if(r){r.fps=t;r.duration=(r.end-r.start)/r.fps}};THREE.MorphBlendMesh.prototype.setAnimationDuration=function(e,t){var r=this.animationsMap[e];if(r){r.duration=t;r.fps=(r.end-r.start)/r.duration}};THREE.MorphBlendMesh.prototype.setAnimationWeight=function(e,t){var r=this.animationsMap[e];if(r){r.weight=t}};THREE.MorphBlendMesh.prototype.setAnimationTime=function(e,t){var r=this.animationsMap[e];if(r){r.time=t}};THREE.MorphBlendMesh.prototype.getAnimationTime=function(e){var t=0;var r=this.animationsMap[e];if(r){t=r.time}return t};THREE.MorphBlendMesh.prototype.getAnimationDuration=function(e){var t=-1;var r=this.animationsMap[e];if(r){t=r.duration}return t};THREE.MorphBlendMesh.prototype.playAnimation=function(e){var t=this.animationsMap[e];if(t){t.time=0;t.active=true}else{console.warn("THREE.MorphBlendMesh: animation["+e+"] undefined in .playAnimation()")}};THREE.MorphBlendMesh.prototype.stopAnimation=function(e){var t=this.animationsMap[e];if(t){t.active=false}};THREE.MorphBlendMesh.prototype.update=function(e){for(var t=0,r=this.animationsList.length;t<r;t++){var i=this.animationsList[t];if(!i.active)continue;var n=i.duration/i.length;i.time+=i.direction*e;if(i.mirroredLoop){if(i.time>i.duration||i.time<0){i.direction*=-1;if(i.time>i.duration){i.time=i.duration;i.directionBackwards=true}if(i.time<0){i.time=0;i.directionBackwards=false}}}else{i.time=i.time%i.duration;if(i.time<0)i.time+=i.duration}var a=i.start+THREE.Math.clamp(Math.floor(i.time/n),0,i.length-1);var o=i.weight;if(a!==i.currentFrame){this.morphTargetInfluences[i.lastFrame]=0;this.morphTargetInfluences[i.currentFrame]=1*o;this.morphTargetInfluences[a]=0;i.lastFrame=i.currentFrame;i.currentFrame=a}var s=i.time%n/n;if(i.directionBackwards)s=1-s;if(i.currentFrame!==i.lastFrame){this.morphTargetInfluences[i.currentFrame]=s*o;this.morphTargetInfluences[i.lastFrame]=(1-s)*o}else{this.morphTargetInfluences[i.currentFrame]=o}}};THREE.CSS3DObject=function(e){THREE.Object3D.call(this);this.element=e;this.element.style.position="absolute";this.addEventListener("removed",function(e){if(this.element.parentNode!==null){this.element.parentNode.removeChild(this.element)}})};THREE.CSS3DObject.prototype=Object.create(THREE.Object3D.prototype);THREE.CSS3DObject.prototype.constructor=THREE.CSS3DObject;THREE.CSS3DSprite=function(e){THREE.CSS3DObject.call(this,e)};THREE.CSS3DSprite.prototype=Object.create(THREE.CSS3DObject.prototype);THREE.CSS3DSprite.prototype.constructor=THREE.CSS3DSprite;THREE.CSS3DRenderer=function(){console.log("THREE.CSS3DRenderer",THREE.REVISION);var e,t;var r,i;var n=new THREE.Matrix4;var a={camera:{fov:0,style:""},objects:{}};var o=document.createElement("div");o.style.overflow="hidden";o.style.WebkitTransformStyle="preserve-3d";o.style.MozTransformStyle="preserve-3d";o.style.oTransformStyle="preserve-3d";o.style.transformStyle="preserve-3d";this.domElement=o;var s=document.createElement("div");s.style.WebkitTransformStyle="preserve-3d";s.style.MozTransformStyle="preserve-3d";s.style.oTransformStyle="preserve-3d";s.style.transformStyle="preserve-3d";o.appendChild(s);this.setClearColor=function(){};this.getSize=function(){return{width:e,height:t}};this.setSize=function(n,a){e=n;t=a;r=e/2;i=t/2;o.style.width=n+"px";o.style.height=a+"px";s.style.width=n+"px";s.style.height=a+"px"};var h=function(e){return Math.abs(e)<Number.EPSILON?0:e};var u=function(e){var t=e.elements;return"matrix3d("+h(t[0])+","+h(-t[1])+","+h(t[2])+","+h(t[3])+","+h(t[4])+","+h(-t[5])+","+h(t[6])+","+h(t[7])+","+h(t[8])+","+h(-t[9])+","+h(t[10])+","+h(t[11])+","+h(t[12])+","+h(-t[13])+","+h(t[14])+","+h(t[15])+")"};var c=function(e){var t=e.elements;return"translate3d(-50%,-50%,0) matrix3d("+h(t[0])+","+h(t[1])+","+h(t[2])+","+h(t[3])+","+h(-t[4])+","+h(-t[5])+","+h(-t[6])+","+h(-t[7])+","+h(t[8])+","+h(t[9])+","+h(t[10])+","+h(t[11])+","+h(t[12])+","+h(t[13])+","+h(t[14])+","+h(t[15])+")"};var l=function(e,t){if(e instanceof THREE.CSS3DObject){var r;if(e instanceof THREE.CSS3DSprite){n.copy(t.matrixWorldInverse);n.transpose();n.copyPosition(e.matrixWorld);n.scale(e.scale);n.elements[3]=0;n.elements[7]=0;n.elements[11]=0;n.elements[15]=1;r=c(n)}else{r=c(e.matrixWorld)}var i=e.element;var o=a.objects[e.id];if(o===undefined||o!==r){i.style.WebkitTransform=r;i.style.MozTransform=r;i.style.oTransform=r;i.style.transform=r;a.objects[e.id]=r}if(i.parentNode!==s){
s.appendChild(i)}}for(var h=0,u=e.children.length;h<u;h++){l(e.children[h],t)}};this.render=function(e,n){var h=.5/Math.tan(THREE.Math.degToRad(n.fov*.5))*t;if(a.camera.fov!==h){o.style.WebkitPerspective=h+"px";o.style.MozPerspective=h+"px";o.style.oPerspective=h+"px";o.style.perspective=h+"px";a.camera.fov=h}e.updateMatrixWorld();if(n.parent===null)n.updateMatrixWorld();n.matrixWorldInverse.getInverse(n.matrixWorld);var c="translate3d(0,0,"+h+"px)"+u(n.matrixWorldInverse)+" translate3d("+r+"px,"+i+"px, 0)";if(a.camera.style!==c){s.style.WebkitTransform=c;s.style.MozTransform=c;s.style.oTransform=c;s.style.transform=c;a.camera.style=c}l(e,n)}};

Youez - 2016 - github.com/yon3zu
LinuXploit