main_2020_show.js 2.5 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658556595566055661556625566355664556655566655667556685566955670556715567255673556745567555676556775567855679556805568155682556835568455685556865568755688556895569055691556925569355694556955569655697556985569955700557015570255703557045570555706557075570855709557105571155712557135571455715557165571755718557195572055721557225572355724557255572655727557285572955730557315573255733557345573555736557375573855739557405574155742557435574455745557465574755748557495575055751557525575355754557555575655757557585575955760557615576255763557645576555766557675576855769557705577155772557735577455775557765577755778557795578055781557825578355784557855578655787557885578955790557915579255793557945579555796557975579855799558005580155802558035580455805558065580755808558095581055811558125581355814558155581655817558185581955820558215582255823558245582555826558275582855829558305583155832558335583455835558365583755838558395584055841558425584355844558455584655847558485584955850558515585255853558545585555856558575585855859558605586155862558635586455865558665586755868558695587055871558725587355874558755587655877558785587955880558815588255883558845588555886558875588855889558905589155892558935589455895558965589755898558995590055901559025590355904559055590655907559085590955910559115591255913559145591555916559175591855919559205592155922559235592455925559265592755928559295593055931559325593355934559355593655937559385593955940559415594255943559445594555946559475594855949559505595155952559535595455955559565595755958559595596055961559625596355964559655596655967559685596955970559715597255973559745597555976559775597855979559805598155982559835598455985559865598755988559895599055991559925599355994559955599655997559985599956000560015600256003560045600556006560075600856009560105601156012560135601456015560165601756018560195602056021560225602356024560255602656027560285602956030560315603256033560345603556036560375603856039560405604156042560435604456045560465604756048560495605056051560525605356054560555605656057560585605956060560615606256063560645606556066560675606856069560705607156072560735607456075560765607756078560795608056081560825608356084560855608656087560885608956090560915609256093560945609556096560975609856099561005610156102561035610456105561065610756108561095611056111561125611356114561155611656117561185611956120561215612256123561245612556126561275612856129561305613156132561335613456135561365613756138561395614056141561425614356144561455614656147561485614956150561515615256153561545615556156561575615856159561605616156162561635616456165561665616756168561695617056171561725617356174561755617656177561785617956180561815618256183561845618556186561875618856189561905619156192561935619456195561965619756198561995620056201562025620356204562055620656207562085620956210562115621256213562145621556216562175621856219562205622156222562235622456225562265622756228562295623056231562325623356234562355623656237562385623956240562415624256243562445624556246562475624856249562505625156252562535625456255562565625756258562595626056261562625626356264562655626656267562685626956270562715627256273562745627556276562775627856279562805628156282562835628456285562865628756288562895629056291562925629356294562955629656297562985629956300563015630256303563045630556306563075630856309563105631156312563135631456315563165631756318563195632056321563225632356324563255632656327563285632956330563315633256333563345633556336563375633856339563405634156342563435634456345563465634756348563495635056351563525635356354563555635656357563585635956360563615636256363563645636556366563675636856369563705637156372563735637456375563765637756378563795638056381563825638356384563855638656387563885638956390563915639256393563945639556396563975639856399564005640156402564035640456405564065640756408564095641056411564125641356414564155641656417564185641956420564215642256423564245642556426564275642856429564305643156432564335643456435564365643756438564395644056441564425644356444564455644656447564485644956450564515645256453564545645556456564575645856459564605646156462564635646456465564665646756468564695647056471564725647356474564755647656477564785647956480564815648256483564845648556486564875648856489564905649156492564935649456495564965649756498564995650056501565025650356504565055650656507565085650956510565115651256513565145651556516565175651856519565205652156522565235652456525565265652756528565295653056531565325653356534565355653656537565385653956540565415654256543565445654556546565475654856549565505655156552565535655456555565565655756558565595656056561565625656356564565655656656567565685656956570565715657256573565745657556576565775657856579565805658156582565835658456585565865658756588565895659056591565925659356594565955659656597565985659956600566015660256603566045660556606566075660856609566105661156612566135661456615566165661756618566195662056621566225662356624566255662656627566285662956630566315663256633566345663556636566375663856639566405664156642566435664456645566465664756648566495665056651566525665356654566555665656657566585665956660566615666256663566645666556666566675666856669566705667156672566735667456675566765667756678566795668056681566825668356684566855668656687566885668956690566915669256693566945669556696566975669856699567005670156702567035670456705567065670756708567095671056711567125671356714567155671656717567185671956720567215672256723567245672556726567275672856729567305673156732567335673456735567365673756738567395674056741567425674356744567455674656747567485674956750567515675256753567545675556756567575675856759567605676156762567635676456765567665676756768567695677056771567725677356774567755677656777567785677956780567815678256783567845678556786567875678856789567905679156792567935679456795567965679756798567995680056801568025680356804568055680656807568085680956810568115681256813568145681556816568175681856819568205682156822568235682456825568265682756828568295683056831568325683356834568355683656837568385683956840568415684256843568445684556846568475684856849568505685156852568535685456855568565685756858568595686056861568625686356864568655686656867568685686956870568715687256873568745687556876568775687856879
  1. /* 许钟文修改的 标记 xzw
  2. 另外 所有"matter"字样已被我删除 原因:删除matterport信息
  3. */
  4. var dom = {//许钟文add
  5. getOffset: function(type, element, parent) {
  6. left = (type == "left") ? element.offsetLeft : element.offsetTop;
  7. if (!parent) parent = $("body")[0];
  8. while (element = element.offsetParent) {
  9. if (element == parent) break;
  10. left += (type == "left") ? element.offsetLeft : element.offsetTop;
  11. }
  12. return left;
  13. }
  14. };
  15. !function() {
  16. "use strict";
  17. function t(t, i) {
  18. return typeof t === i
  19. }
  20. function i(t, i) {
  21. return t instanceof i
  22. }
  23. function n(t) {
  24. return t && t.nodeType
  25. }
  26. function e(t) {
  27. return n(t) ? t : i(t, g) ? t[0] : void 0
  28. }
  29. function o(t, i, n) {
  30. return g.each(t, function(t, e) {
  31. n = i.call(e, n, t, e)
  32. }),
  33. n
  34. }
  35. function r(t, i, n) {
  36. var e, o, r;
  37. if (t === i)
  38. return !0;
  39. if (!t || !i || t.constructor !== i.constructor)
  40. return !1;
  41. for (e = 0,
  42. o = n.length; o > e; e += 1) {
  43. if (r = n[e],
  44. t[r] && y(t[r].equals) && !t[r].equals(i[r]))
  45. return !1;
  46. if (t[r] !== i[r])
  47. return !1
  48. }
  49. return !0
  50. }
  51. function s(t, i, n, e) {
  52. this.left = E(t),
  53. this.top = E(i),
  54. this.width = E(n),
  55. this.height = E(e),
  56. this.right = this.left + this.width,
  57. this.bottom = this.top + this.height
  58. }
  59. function h(t, i, n, e) {
  60. this.visible = t || 0,
  61. this.viewport = i || 0,
  62. this.possible = n || 0,
  63. this.rects = e && T({}, e) || null
  64. }
  65. function l(t, i) {
  66. this.els = t,
  67. this.viewport = i
  68. }
  69. function c(t, i, n) {
  70. var e;
  71. return g.inArray(n, q) >= 0 ? e = s.ofElement(t) : g.inArray(n, S) >= 0 && (e = h.of(t, i)),
  72. e ? e[n] : 0
  73. }
  74. function u(t, i) {
  75. return t.val - i.val
  76. }
  77. function a(t, i) {
  78. return i.val - t.val
  79. }
  80. function f(t) {
  81. var i = s.ofContent(t, !0)
  82. , n = s.ofViewport(t, !0)
  83. , e = i.width - n.width
  84. , o = i.height - n.height;
  85. this.content = i,
  86. this.viewport = n,
  87. this.width = 0 >= e ? null : n.left / e,
  88. this.height = 0 >= o ? null : n.top / o,
  89. this.left = n.left,
  90. this.top = n.top,
  91. this.right = i.right - n.right,
  92. this.bottom = i.bottom - n.bottom
  93. }
  94. function p(t) {
  95. this.el = t || window
  96. }
  97. function d(t, i) {
  98. this.context = t,
  99. this.viewport = i,
  100. this.init()
  101. }
  102. function v(t, i, n, e) {
  103. this.context = new l(t,i),
  104. this.property = n,
  105. this.descending = e,
  106. this.init()
  107. }
  108. function w(t) {
  109. t && t !== window && t !== document ? (this.context = t,
  110. this.$autoTarget = g(t)) : this.context = window,
  111. this.init()
  112. }
  113. var g = jQuery
  114. , m = g(window)
  115. , b = g(document)
  116. , T = g.extend
  117. , y = g.isFunction
  118. , k = Math.max
  119. , V = Math.min
  120. , E = Math.round
  121. , x = function() {
  122. var t = {}
  123. , i = 1;
  124. return function(n) {
  125. return n ? (t[n] || (t[n] = i,
  126. i += 1),
  127. t[n]) : 0
  128. }
  129. }();
  130. T(s.prototype, {
  131. equals: function(t) {
  132. return r(this, t, ["left", "top", "width", "height"])
  133. },
  134. area: function() {
  135. return this.width * this.height
  136. },
  137. relativeTo: function(t) {
  138. return new s(this.left - t.left,this.top - t.top,this.width,this.height)
  139. },
  140. intersection: function(t) {
  141. if (!i(t, s))
  142. return null;
  143. var n = k(this.left, t.left)
  144. , e = V(this.right, t.right)
  145. , o = k(this.top, t.top)
  146. , r = V(this.bottom, t.bottom)
  147. , h = e - n
  148. , l = r - o;
  149. return h >= 0 && l >= 0 ? new s(n,o,h,l) : null
  150. },
  151. envelope: function(t) {
  152. if (!i(t, s))
  153. return this;
  154. var n = V(this.left, t.left)
  155. , e = k(this.right, t.right)
  156. , o = V(this.top, t.top)
  157. , r = k(this.bottom, t.bottom)
  158. , h = e - n
  159. , l = r - o;
  160. return new s(n,o,h,l)
  161. }
  162. }),
  163. T(s, {
  164. ofContent: function(t, i) {
  165. return t && t !== document && t !== window ? i ? new s(0,0,t.scrollWidth,t.scrollHeight) : new s(t.offsetLeft - t.scrollLeft,t.offsetTop - t.scrollTop,t.scrollWidth,t.scrollHeight) : new s(0,0,b.width(),b.height())
  166. },
  167. ofViewport: function(t, i) {
  168. return t && t !== document && t !== window ? i ? new s(t.scrollLeft,t.scrollTop,t.clientWidth,t.clientHeight) : new s(t.offsetLeft,t.offsetTop,t.clientWidth,t.clientHeight) : new s(m.scrollLeft(),m.scrollTop(),m.width(),m.height())
  169. },
  170. ofElement: function(t) {
  171. var i = g(t);
  172. if (!i.is(":visible"))
  173. return null;
  174. var n = i.offset();
  175. return new s(n.left,n.top,i.outerWidth(),i.outerHeight())
  176. }
  177. }),
  178. T(h.prototype, {
  179. equals: function(t) {
  180. return this.fracsEqual(t) && this.rectsEqual(t)
  181. },
  182. fracsEqual: function(t) {
  183. return r(this, t, ["visible", "viewport", "possible"])
  184. },
  185. rectsEqual: function(t) {
  186. return r(this.rects, t.rects, ["document", "element", "viewport"])
  187. }
  188. }),
  189. T(h, {
  190. of: function(t, i) {
  191. var e, o, r;
  192. return t = n(t) && s.ofElement(t) || t,
  193. i = n(i) && s.ofViewport(i) || i || s.ofViewport(),
  194. t instanceof s && (e = t.intersection(i)) ? (o = e.area(),
  195. r = V(t.width, i.width) * V(t.height, i.height),
  196. new h(o / t.area(),o / i.area(),o / r,{
  197. document: e,
  198. element: e.relativeTo(t),
  199. viewport: e.relativeTo(i)
  200. })) : new h
  201. }
  202. });
  203. var q = ["width", "height", "left", "right", "top", "bottom"]
  204. , S = ["possible", "visible", "viewport"];
  205. T(l.prototype, {
  206. sorted: function(t, i) {
  207. var n = this.viewport;
  208. return g.map(this.els, function(i) {
  209. return {
  210. el: i,
  211. val: c(i, n, t)
  212. }
  213. }).sort(i ? a : u)
  214. },
  215. best: function(t, i) {
  216. return this.els.length ? this.sorted(t, i)[0] : null
  217. }
  218. }),
  219. T(f.prototype, {
  220. equals: function(t) {
  221. return r(this, t, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  222. }
  223. }),
  224. T(p.prototype, {
  225. equals: function(t) {
  226. return r(this, t, ["el"])
  227. },
  228. scrollState: function() {
  229. return new f(this.el)
  230. },
  231. scrollTo: function(t, i, n) {
  232. var e = g(this.el === window ? "html,body" : this.el);
  233. t = t || 0,
  234. i = i || 0,
  235. n = isNaN(n) ? 1e3 : n,
  236. e.stop(!0).animate({
  237. scrollLeft: t,
  238. scrollTop: i
  239. }, n)
  240. },
  241. scroll: function(t, i, n) {
  242. var e = this.el === window ? m : g(this.el);
  243. t = t || 0,
  244. i = i || 0,
  245. this.scrollTo(e.scrollLeft() + t, e.scrollTop() + i, n)
  246. },
  247. scrollToRect: function(t, i, n, e) {
  248. i = i || 0,
  249. n = n || 0,
  250. this.scrollTo(t.left - i, t.top - n, e)
  251. },
  252. scrollToElement: function(t, i, n, e) {
  253. var o = s.ofElement(t).relativeTo(s.ofContent(this.el));
  254. this.scrollToRect(o, i, n, e)
  255. }
  256. });
  257. var C = {
  258. init: function() {
  259. this.callbacks = g.Callbacks("memory unique"),
  260. this.currVal = null,
  261. this.prevVal = null,
  262. this.checkProxy = g.proxy(this.check, this),
  263. this.autoCheck()
  264. },
  265. bind: function(t) {
  266. this.callbacks.add(t)
  267. },
  268. unbind: function(t) {
  269. t ? this.callbacks.remove(t) : this.callbacks.empty()
  270. },
  271. trigger: function() {
  272. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  273. },
  274. check: function(t) {
  275. var i = this.updatedValue(t);
  276. return void 0 !== i && (this.prevVal = this.currVal,
  277. this.currVal = i,
  278. this.trigger(),
  279. !0)
  280. },
  281. $autoTarget: m,
  282. autoEvents: "load resize scroll",
  283. autoCheck: function(t) {
  284. this.$autoTarget[t === !1 ? "off" : "on"](this.autoEvents, this.checkProxy)
  285. }
  286. };
  287. T(d.prototype, C, {
  288. updatedValue: function() {
  289. var t = h.of(this.context, this.viewport);
  290. return this.currVal && this.currVal.equals(t) ? void 0 : t
  291. }
  292. }),
  293. T(v.prototype, C, {
  294. updatedValue: function() {
  295. var t = this.context.best(this.property, this.descending);
  296. return t && (t = t.val > 0 ? t.el : null,
  297. this.currVal !== t) ? t : void 0
  298. }
  299. }),
  300. T(w.prototype, C, {
  301. updatedValue: function() {
  302. var t = new f(this.context);
  303. return this.currVal && this.currVal.equals(t) ? void 0 : t
  304. }
  305. });
  306. var L = function(t, i) {
  307. var n = [].slice
  308. , e = jQuery
  309. , o = e.extend
  310. , r = e.isFunction
  311. , s = o({}, i)
  312. , h = function(i, n, o, s) {
  313. return o = r(o) ? o.apply(i, n) : o,
  314. r(s[o]) ? s[o].apply(i, n) : void e.error('Method "' + o + '" does not exist on jQuery.' + t)
  315. }
  316. , l = function() {
  317. return h(this, n.call(arguments), s.defaultStatic, l)
  318. }
  319. , c = function(t) {
  320. return r(c[t]) ? c[t].apply(this, n.call(arguments, 1)) : h(this, n.call(arguments), s.defaultMethod, c)
  321. }
  322. , u = function(t) {
  323. t && (o(l, t.statics),
  324. o(c, t.methods)),
  325. l.modplug = u
  326. };
  327. u.prev = {
  328. statics: e[t],
  329. methods: e.fn[t]
  330. },
  331. u(i),
  332. e[t] = l,
  333. e.fn[t] = c
  334. }
  335. , M = "fracs";
  336. L(M, {
  337. statics: {
  338. version: "0.15.0",
  339. Rect: s,
  340. Fractions: h,
  341. Group: l,
  342. ScrollState: f,
  343. Viewport: p,
  344. FracsCallbacks: d,
  345. GroupCallbacks: v,
  346. ScrollStateCallbacks: w,
  347. fracs: function(t, i) {
  348. return h.of(t, i)
  349. }
  350. },
  351. methods: {
  352. content: function(t) {
  353. return this.length ? s.ofContent(this[0], t) : null
  354. },
  355. envelope: function() {
  356. return o(this, function(t) {
  357. var i = s.ofElement(this);
  358. return t ? t.envelope(i) : i
  359. })
  360. },
  361. fracs: function(i, n, o) {
  362. t(i, "string") || (o = n,
  363. n = i,
  364. i = null),
  365. y(n) || (o = n,
  366. n = null),
  367. o = e(o);
  368. var r = M + ".fracs." + x(o);
  369. return "unbind" === i ? this.each(function() {
  370. var t = g(this).data(r);
  371. t && t.unbind(n)
  372. }) : "check" === i ? this.each(function() {
  373. var t = g(this).data(r);
  374. t && t.check()
  375. }) : y(n) ? this.each(function() {
  376. var t = g(this)
  377. , i = t.data(r);
  378. i || (i = new d(this,o),
  379. t.data(r, i)),
  380. i.bind(n)
  381. }) : this.length ? h.of(this[0], o) : null
  382. },
  383. intersection: function() {
  384. return o(this, function(t) {
  385. var i = s.ofElement(this);
  386. return t ? t.intersection(i) : i
  387. })
  388. },
  389. max: function(t, i, n) {
  390. return y(i) || (n = i,
  391. i = null),
  392. n = e(n),
  393. i ? (new v(this,n,t,!0).bind(i),
  394. this) : this.pushStack(new l(this,n).best(t, !0).el)
  395. },
  396. min: function(t, i, n) {
  397. return y(i) || (n = i,
  398. i = null),
  399. n = e(n),
  400. i ? (new v(this,n,t).bind(i),
  401. this) : this.pushStack(new l(this,n).best(t).el)
  402. },
  403. rect: function() {
  404. return this.length ? s.ofElement(this[0]) : null
  405. },
  406. scrollState: function(i, n) {
  407. var e = M + ".scrollState";
  408. return t(i, "string") || (n = i,
  409. i = null),
  410. "unbind" === i ? this.each(function() {
  411. var t = g(this).data(e);
  412. t && t.unbind(n)
  413. }) : "check" === i ? this.each(function() {
  414. var t = g(this).data(e);
  415. t && t.check()
  416. }) : y(n) ? this.each(function() {
  417. var t = g(this)
  418. , i = t.data(e);
  419. i || (i = new w(this),
  420. t.data(e, i)),
  421. i.bind(n)
  422. }) : this.length ? new f(this[0]) : null
  423. },
  424. scroll: function(t, i, n) {
  425. return this.each(function() {
  426. new p(this).scroll(t, i, n)
  427. })
  428. },
  429. scrollTo: function(t, i, n, o) {
  430. return g.isNumeric(t) && (o = n,
  431. n = i,
  432. i = t,
  433. t = null),
  434. t = e(t),
  435. this.each(function() {
  436. t ? new p(this).scrollToElement(t, i, n, o) : new p(this).scrollTo(i, n, o)
  437. })
  438. },
  439. scrollToThis: function(t, i, n, o) {
  440. return o = new p(e(o)),
  441. o.scrollToElement(this[0], t, i, n),
  442. this
  443. },
  444. softLink: function(t, i, n, o) {
  445. return o = new p(e(o)),
  446. this.filter("a[href^=#]").each(function() {
  447. var e = g(this);
  448. e.on("click", function() {
  449. o.scrollToElement(g(e.attr("href"))[0], t, i, n)
  450. })
  451. })
  452. },
  453. sort: function(i, n, o) {
  454. return t(n, "boolean") || (o = n,
  455. n = null),
  456. o = e(o),
  457. this.pushStack(g.map(new l(this,o).sorted(i, !n), function(t) {
  458. return t.el
  459. }))
  460. },
  461. viewport: function(t) {
  462. return this.length ? s.ofViewport(this[0], t) : null
  463. }
  464. },
  465. defaultStatic: "fracs",
  466. defaultMethod: "fracs"
  467. })
  468. }();
  469. if ("undefined" == typeof jQuery)
  470. throw new Error("Bootstrap's JavaScript requires jQuery");
  471. +function(t) {
  472. "use strict";
  473. function e(e) {
  474. return this.each(function() {
  475. var o = t(this)
  476. , s = o.data("bs.tooltip")
  477. , n = "object" == typeof e && e;
  478. (s || "destroy" != e) && (s || o.data("bs.tooltip", s = new i(this,n)),
  479. "string" == typeof e && s[e]())
  480. })
  481. }
  482. var i = function(t, e) {
  483. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  484. this.init("tooltip", t, e)
  485. };
  486. i.VERSION = "3.2.0",
  487. i.DEFAULTS = {
  488. animation: !0,
  489. placement: "top",
  490. selector: !1,
  491. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  492. trigger: "hover focus",
  493. title: "",
  494. delay: 0,
  495. html: !1,
  496. container: !1,
  497. viewport: {
  498. selector: "body",
  499. padding: 0
  500. }
  501. },
  502. i.prototype.init = function(e, i, o) {
  503. this.enabled = !0,
  504. this.type = e,
  505. this.$element = t(i),
  506. this.options = this.getOptions(o),
  507. this.$viewport = this.options.viewport && t(this.options.viewport.selector || this.options.viewport);
  508. for (var s = this.options.trigger.split(" "), n = s.length; n--; ) {
  509. var r = s[n];
  510. if ("click" == r)
  511. this.$element.on("click." + this.type, this.options.selector, t.proxy(this.toggle, this));
  512. else if ("manual" != r) {
  513. var a = "hover" == r ? "mouseenter" : "focusin"
  514. , l = "hover" == r ? "mouseleave" : "focusout";
  515. this.$element.on(a + "." + this.type, this.options.selector, t.proxy(this.enter, this)),
  516. this.$element.on(l + "." + this.type, this.options.selector, t.proxy(this.leave, this))
  517. }
  518. }
  519. this.options.selector ? this._options = t.extend({}, this.options, {
  520. trigger: "manual",
  521. selector: ""
  522. }) : this.fixTitle()
  523. }
  524. ,
  525. i.prototype.getDefaults = function() {
  526. return i.DEFAULTS
  527. }
  528. ,
  529. i.prototype.getOptions = function(e) {
  530. return e = t.extend({}, this.getDefaults(), this.$element.data(), e),
  531. e.delay && "number" == typeof e.delay && (e.delay = {
  532. show: e.delay,
  533. hide: e.delay
  534. }),
  535. e
  536. }
  537. ,
  538. i.prototype.getDelegateOptions = function() {
  539. var e = {}
  540. , i = this.getDefaults();
  541. return this._options && t.each(this._options, function(t, o) {
  542. i[t] != o && (e[t] = o)
  543. }),
  544. e
  545. }
  546. ,
  547. i.prototype.enter = function(e) {
  548. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  549. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  550. t(e.currentTarget).data("bs." + this.type, i)),
  551. clearTimeout(i.timeout),
  552. i.hoverState = "in",
  553. i.options.delay && i.options.delay.show ? void (i.timeout = setTimeout(function() {
  554. // "in" == i.hoverState && i.show()
  555. }, i.options.delay.show)) : i.show()
  556. }
  557. ,
  558. i.prototype.leave = function(e) {
  559. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  560. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  561. t(e.currentTarget).data("bs." + this.type, i)),
  562. clearTimeout(i.timeout),
  563. i.hoverState = "out",
  564. i.options.delay && i.options.delay.hide ? void (i.timeout = setTimeout(function() {
  565. "out" == i.hoverState && i.hide()
  566. }, i.options.delay.hide)) : i.hide()
  567. }
  568. ,
  569. i.prototype.show = function() {
  570. var e = t.Event("show.bs." + this.type);
  571. if (this.hasContent() && this.enabled) {
  572. this.$element.trigger(e);
  573. var i = t.contains(document.documentElement, this.$element[0]);
  574. if (e.isDefaultPrevented() || !i)
  575. return;
  576. var o = this
  577. , s = this.tip()
  578. , n = this.getUID(this.type);
  579. this.setContent(),
  580. s.attr("id", n),
  581. this.$element.attr("aria-describedby", n),
  582. this.options.animation && s.addClass("fade");
  583. var r = "function" == typeof this.options.placement ? this.options.placement.call(this, s[0], this.$element[0]) : this.options.placement
  584. , a = /\s?auto?\s?/i
  585. , l = a.test(r);
  586. l && (r = r.replace(a, "") || "top"),
  587. s.detach().css({
  588. top: 0,
  589. left: 0,
  590. display: "block"
  591. }).addClass(r).data("bs." + this.type, this),
  592. this.options.container ? s.appendTo(this.options.container) : s.insertAfter(this.$element);
  593. var p = this.getPosition()
  594. , h = s[0].offsetWidth
  595. , f = s[0].offsetHeight;
  596. if (l) {
  597. var u = r
  598. , c = this.$element.parent()
  599. , d = this.getPosition(c);
  600. r = "bottom" == r && p.top + p.height + f - d.scroll > d.height ? "top" : "top" == r && p.top - d.scroll - f < 0 ? "bottom" : "right" == r && p.right + h > d.width ? "left" : "left" == r && p.left - h < d.left ? "right" : r,
  601. s.removeClass(u).addClass(r)
  602. }
  603. var g = this.getCalculatedOffset(r, p, h, f);
  604. this.applyPlacement(g, r);
  605. var y = function() {
  606. o.$element.trigger("shown.bs." + o.type),
  607. o.hoverState = null
  608. };
  609. t.support.transition && this.$tip.hasClass("fade") ? s.one("bsTransitionEnd", y).emulateTransitionEnd(150) : y()
  610. }
  611. }
  612. ,
  613. i.prototype.applyPlacement = function(e, i) {
  614. var o = this.tip()
  615. , s = o[0].offsetWidth
  616. , n = o[0].offsetHeight
  617. , r = parseInt(o.css("margin-top"), 10)
  618. , a = parseInt(o.css("margin-left"), 10);
  619. isNaN(r) && (r = 0),
  620. isNaN(a) && (a = 0),
  621. e.top = e.top + r,
  622. e.left = e.left + a,
  623. t.offset.setOffset(o[0], t.extend({
  624. using: function(t) {
  625. o.css({
  626. top: Math.round(t.top),
  627. left: Math.round(t.left)
  628. })
  629. }
  630. }, e), 0),
  631. o.addClass("in");
  632. var l = o[0].offsetWidth
  633. , p = o[0].offsetHeight;
  634. "top" == i && p != n && (e.top = e.top + n - p);
  635. var h = this.getViewportAdjustedDelta(i, e, l, p);
  636. h.left ? e.left += h.left : e.top += h.top;
  637. var f = h.left ? 2 * h.left - s + l : 2 * h.top - n + p
  638. , u = h.left ? "left" : "top"
  639. , c = h.left ? "offsetWidth" : "offsetHeight";
  640. o.offset(e),
  641. this.replaceArrow(f, o[0][c], u)
  642. }
  643. ,
  644. i.prototype.replaceArrow = function(t, e, i) {
  645. this.arrow().css(i, t ? 50 * (1 - t / e) + "%" : "")
  646. }
  647. ,
  648. i.prototype.setContent = function() {
  649. var t = this.tip()
  650. , e = this.getTitle();
  651. t.find(".tooltip-inner")[this.options.html ? "html" : "text"](e),
  652. t.removeClass("fade in top bottom left right")
  653. }
  654. ,
  655. i.prototype.hide = function() {
  656. function e() {
  657. "in" != i.hoverState && o.detach(),
  658. i.$element.trigger("hidden.bs." + i.type)
  659. }
  660. var i = this
  661. , o = this.tip()
  662. , s = t.Event("hide.bs." + this.type);
  663. if (this.$element.removeAttr("aria-describedby"),
  664. this.$element.trigger(s),
  665. !s.isDefaultPrevented())
  666. return o.removeClass("in"),
  667. t.support.transition && this.$tip.hasClass("fade") ? o.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  668. this.hoverState = null,
  669. this
  670. }
  671. ,
  672. i.prototype.fixTitle = function() {
  673. var t = this.$element;
  674. (t.attr("title") || "string" != typeof t.attr("data-original-title")) && t.attr("data-original-title", t.attr("title") || "").attr("title", "")
  675. }
  676. ,
  677. i.prototype.hasContent = function() {
  678. return this.getTitle()
  679. }
  680. ,
  681. i.prototype.getPosition = function(e) {
  682. e = e || this.$element;
  683. var i = e[0]
  684. , o = "BODY" == i.tagName;
  685. return t.extend({}, "function" == typeof i.getBoundingClientRect ? i.getBoundingClientRect() : null, {
  686. scroll: o ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  687. width: o ? t(window).width() : e.outerWidth(),
  688. height: o ? t(window).height() : e.outerHeight()
  689. }, o ? {
  690. top: 0,
  691. left: 0
  692. } : e.offset())
  693. }
  694. ,
  695. i.prototype.getCalculatedOffset = function(t, e, i, o) {
  696. return "bottom" == t ? {
  697. top: e.top + e.height,
  698. left: e.left + e.width / 2 - i / 2
  699. } : "top" == t ? {
  700. top: e.top - o,
  701. left: e.left + e.width / 2 - i / 2
  702. } : "left" == t ? {
  703. top: e.top + e.height / 2 - o / 2,
  704. left: e.left - i
  705. } : {
  706. top: e.top + e.height / 2 - o / 2,
  707. left: e.left + e.width
  708. }
  709. }
  710. ,
  711. i.prototype.getViewportAdjustedDelta = function(t, e, i, o) {
  712. var s = {
  713. top: 0,
  714. left: 0
  715. };
  716. if (!this.$viewport)
  717. return s;
  718. var n = this.options.viewport && this.options.viewport.padding || 0
  719. , r = this.getPosition(this.$viewport);
  720. if (/right|left/.test(t)) {
  721. var a = e.top - n - r.scroll
  722. , l = e.top + n - r.scroll + o;
  723. a < r.top ? s.top = r.top - a : l > r.top + r.height && (s.top = r.top + r.height - l)
  724. } else {
  725. var p = e.left - n
  726. , h = e.left + n + i;
  727. p < r.left ? s.left = r.left - p : h > r.width && (s.left = r.left + r.width - h)
  728. }
  729. return s
  730. }
  731. ,
  732. i.prototype.getTitle = function() {
  733. var t, e = this.$element, i = this.options;
  734. return t = e.attr("data-original-title") || ("function" == typeof i.title ? i.title.call(e[0]) : i.title)
  735. }
  736. ,
  737. i.prototype.getUID = function(t) {
  738. do
  739. t += ~~(1e6 * Math.random());
  740. while (document.getElementById(t));return t
  741. }
  742. ,
  743. i.prototype.tip = function() {
  744. return this.$tip = this.$tip || t(this.options.template)
  745. }
  746. ,
  747. i.prototype.arrow = function() {
  748. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  749. }
  750. ,
  751. i.prototype.validate = function() {
  752. this.$element[0].parentNode || (this.hide(),
  753. this.$element = null,
  754. this.options = null)
  755. }
  756. ,
  757. i.prototype.enable = function() {
  758. this.enabled = !0
  759. }
  760. ,
  761. i.prototype.disable = function() {
  762. this.enabled = !1
  763. }
  764. ,
  765. i.prototype.toggleEnabled = function() {
  766. this.enabled = !this.enabled
  767. }
  768. ,
  769. i.prototype.toggle = function(e) {
  770. var i = this;
  771. e && (i = t(e.currentTarget).data("bs." + this.type),
  772. i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  773. t(e.currentTarget).data("bs." + this.type, i))),
  774. i.tip().hasClass("in") ? i.leave(i) : i.enter(i)
  775. }
  776. ,
  777. i.prototype.destroy = function() {
  778. clearTimeout(this.timeout),
  779. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  780. }
  781. ;
  782. var o = t.fn.tooltip;
  783. t.fn.tooltip = e,
  784. t.fn.tooltip.Constructor = i,
  785. t.fn.tooltip.noConflict = function() {
  786. return t.fn.tooltip = o,
  787. this
  788. }
  789. }(jQuery);
  790. !function(e, t, n) {
  791. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  792. }("Keen", this, function() {
  793. "use strict";
  794. function Keen() {
  795. return _init.apply(this, arguments)
  796. }
  797. function _init(e) {
  798. if (_isUndefined(e))
  799. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  800. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  801. throw new Error("Please provide a projectId");
  802. this.configure(e)
  803. }
  804. function _extend(e) {
  805. for (var t = 1; t < arguments.length; t++)
  806. for (var n in arguments[t])
  807. e[n] = arguments[t][n];
  808. return e
  809. }
  810. function _isUndefined(e) {
  811. return void 0 === e
  812. }
  813. function _type(e) {
  814. var t = e && e.constructor ? e.constructor.toString() : void 0;
  815. return t ? t.match(/function (.*)\(/)[1] : "Null"
  816. }
  817. function _each(e, t, n) {
  818. var r;
  819. if (!e)
  820. return 0;
  821. if (n = n ? n : e,
  822. "array" === _type(e)) {
  823. for (r = 0; r < e.length; r++)
  824. if (t.call(n, e[r], r, e) === !1)
  825. return 0
  826. } else
  827. for (r in e)
  828. if (e.hasOwnProperty(r) && t.call(n, e[r], r, e) === !1)
  829. return 0;
  830. return 1
  831. }
  832. function _parse_params(e) {
  833. for (var t, n = {}, r = /\+/g, i = /([^&=]+)=?([^&]*)/g, o = function(e) {
  834. return decodeURIComponent(e.replace(r, " "))
  835. }, a = e.split("?")[1]; t = i.exec(a); )
  836. n[o(t[1])] = o(t[2]);
  837. return n
  838. }
  839. function _set_protocol(e) {
  840. switch (e) {
  841. case "http":
  842. return "http";
  843. case "auto":
  844. return location.protocol.replace(/:/g, "");
  845. case "https":
  846. case void 0:
  847. default:
  848. return "https"
  849. }
  850. }
  851. function _set_request_type(e) {
  852. var t = e || "jsonp"
  853. , n = !1;
  854. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (n = !0),
  855. null == t || "xhr" == t ? n ? "xhr" : "jsonp" : t
  856. }
  857. function _build_url(e) {
  858. return this.client.endpoint + "/projects/" + this.client.projectId + e
  859. }
  860. function _uploadEvent(e, t, n, r, i) {
  861. var o = _build_url.apply(this, ["/events/" + e])
  862. , a = {};
  863. n = n !== !1,
  864. this.client.globalProperties && (a = this.client.globalProperties(e));
  865. for (var c in t)
  866. t.hasOwnProperty(c) && (a[c] = t[c]);
  867. switch (this.client.requestType) {
  868. case "xhr":
  869. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, n, r, i]);
  870. break;
  871. case "jsonp":
  872. var s = JSON.stringify(a)
  873. , l = Keen.Base64.encode(s);
  874. o = o + "?api_key=" + this.client.writeKey,
  875. o = o + "&data=" + l,
  876. o = o + "&modified=" + (new Date).getTime(),
  877. _request.jsonp.apply(this, [o, this.client.writeKey, r, i]);
  878. break;
  879. case "beacon":
  880. var s = JSON.stringify(a)
  881. , l = Keen.Base64.encode(s);
  882. o = o + "?api_key=" + encodeURIComponent(this.client.writeKey),
  883. o = o + "&data=" + encodeURIComponent(l),
  884. o = o + "&modified=" + encodeURIComponent((new Date).getTime()),
  885. o += "&c=clv1",
  886. _request.beacon.apply(this, [o, null, r, i])
  887. }
  888. }
  889. Keen.prototype.configure = function(e) {
  890. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  891. e.protocol = _set_protocol(e.protocol),
  892. e.requestType = _set_request_type(e.requestType),
  893. this.client = {
  894. projectId: e.projectId,
  895. writeKey: e.writeKey,
  896. readKey: e.readKey,
  897. globalProperties: null,
  898. endpoint: e.protocol + "://" + e.host,
  899. requestType: e.requestType
  900. },
  901. Keen.trigger("client", this, e),
  902. this.trigger("ready"),
  903. this
  904. }
  905. ;
  906. var _request = {
  907. xhr: function(e, t, n, r, i, o, a, c) {
  908. if (!i)
  909. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  910. var s = new XMLHttpRequest;
  911. if (s.onreadystatechange = function() {
  912. if (4 == s.readyState)
  913. if (s.status >= 200 && s.status < 300) {
  914. var e;
  915. try {
  916. e = JSON.parse(s.responseText)
  917. } catch (e) {
  918. Keen.log("Could not JSON parse HTTP response: " + s.responseText),
  919. c && c(s, e)
  920. }
  921. a && e && a(e)
  922. } else
  923. Keen.log("HTTP request failed."),
  924. c && c(s, null)
  925. }
  926. ,
  927. s.open(e, t, o),
  928. i && s.setRequestHeader("Authorization", i),
  929. r && s.setRequestHeader("Content-Type", "application/json"),
  930. n)
  931. for (var l in n)
  932. n.hasOwnProperty(l) && s.setRequestHeader(l, n[l]);
  933. var u = r ? JSON.stringify(r) : null;
  934. s.send(u)
  935. },
  936. jsonp: function(e, t, n, r) {
  937. if (!t)
  938. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  939. if (t && e.indexOf("api_key") < 0) {
  940. var i = e.indexOf("?") > 0 ? "&" : "?";
  941. e = e + i + "api_key=" + t
  942. }
  943. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  944. o += "a";
  945. var a = !1;
  946. window[o] = function(e) {
  947. a = !0,
  948. n && e && n(e),
  949. window[o] = void 0
  950. }
  951. ,
  952. e = e + "&jsonp=" + o;
  953. var c = document.createElement("script");
  954. c.id = "keen-jsonp",
  955. c.src = e,
  956. document.getElementsByTagName("head")[0].appendChild(c),
  957. c.onreadystatechange = function() {
  958. a === !1 && "loaded" === this.readyState && (a = !0,
  959. r && r())
  960. }
  961. ,
  962. c.onerror = function() {
  963. a === !1 && (a = !0,
  964. r && r())
  965. }
  966. },
  967. beacon: function(e, t, n, r) {
  968. if (t && e.indexOf("api_key") < 0) {
  969. var i = e.indexOf("?") > 0 ? "&" : "?";
  970. e = e + i + "api_key=" + t
  971. }
  972. var o = !1
  973. , a = document.createElement("img");
  974. a.onload = function() {
  975. if (o = !0,
  976. "naturalHeight"in this) {
  977. if (this.naturalHeight + this.naturalWidth === 0)
  978. return void this.onerror()
  979. } else if (this.width + this.height === 0)
  980. return void this.onerror();
  981. n && n({
  982. created: !0
  983. })
  984. }
  985. ,
  986. a.onerror = function() {
  987. o = !0,
  988. r && r()
  989. }
  990. ,
  991. a.src = e
  992. }
  993. }
  994. , Events = Keen.Events = {
  995. on: function(e, t) {
  996. this.listeners || (this.listeners = {});
  997. var n = this.listeners[e] || (this.listeners[e] = []);
  998. return n.push({
  999. callback: t
  1000. }),
  1001. this
  1002. },
  1003. off: function(e, t) {
  1004. if (!e && !t)
  1005. return this.listeners = void 0,
  1006. delete this.listeners,
  1007. this;
  1008. for (var n = this.listeners[e] || [], r = n.length; r--; )
  1009. t && t == n[r].callback && this.listeners[e].splice(r, 1),
  1010. t && 0 != n.length || (this.listeners[e] = void 0,
  1011. delete this.listeners[e]);
  1012. return this
  1013. },
  1014. trigger: function(e) {
  1015. if (!this.listeners)
  1016. return this;
  1017. for (var t = Array.prototype.slice.call(arguments, 1), n = this.listeners[e] || [], r = 0; r < n.length; r++)
  1018. n[r].callback.apply(this, t);
  1019. return this
  1020. }
  1021. };
  1022. _extend(Keen.prototype, Events),
  1023. _extend(Keen, Events),
  1024. Keen.loaded = !0,
  1025. Keen.utils = {
  1026. each: _each,
  1027. extend: _extend,
  1028. parseParams: _parse_params
  1029. },
  1030. Keen.ready = function(e) {
  1031. Keen.loaded ? e() : Keen.on("ready", e)
  1032. }
  1033. ,
  1034. Keen.log = function(e) {
  1035. "object" == typeof console && console.log("[Keen IO]", e)
  1036. }
  1037. ;
  1038. var Plugins = Keen.Plugins = {};
  1039. Keen.prototype.addEvent = function() {
  1040. _uploadEvent.apply(this, arguments)
  1041. }
  1042. ,
  1043. Keen.prototype.addEventSync = function(e, t, n, r) {
  1044. _uploadEvent.apply(this, [e, t, !1, n, r])
  1045. }
  1046. ,
  1047. Keen.prototype.trackExternalLink = function(e, t, n, r, i) {
  1048. var o = e
  1049. , a = o.metaKey
  1050. , c = o.target
  1051. , s = !1
  1052. , l = function() {};
  1053. return void 0 === r && (r = 500),
  1054. "A" === c.nodeName ? l = function() {
  1055. a || s || (s = !0,
  1056. window.location = c.href)
  1057. }
  1058. : "FORM" === c.nodeName && (l = function() {
  1059. s || (s = !0,
  1060. c.submit())
  1061. }
  1062. ),
  1063. i && (l = function() {
  1064. s || (s = !0,
  1065. i())
  1066. }
  1067. ),
  1068. _uploadEvent.call(this, t, n, l, l),
  1069. setTimeout(function() {
  1070. l()
  1071. }, r),
  1072. !!a && void 0
  1073. }
  1074. ,
  1075. Keen.prototype.setGlobalProperties = function(e) {
  1076. if (!this.client)
  1077. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1078. if (!e || "function" != typeof e)
  1079. throw new Error("Invalid value for global properties: " + e);
  1080. this.client.globalProperties = e
  1081. }
  1082. ,
  1083. Keen.Base64 = {
  1084. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1085. encode: function(e) {
  1086. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map;
  1087. for (e = this.utf8.encode(e); l < e.length; )
  1088. t = e.charCodeAt(l++),
  1089. n = e.charCodeAt(l++),
  1090. r = e.charCodeAt(l++),
  1091. i = t >> 2,
  1092. o = (3 & t) << 4 | n >> 4,
  1093. a = isNaN(n) ? 64 : (15 & n) << 2 | r >> 6,
  1094. c = isNaN(n) || isNaN(r) ? 64 : 63 & r,
  1095. s = s + u.charAt(i) + u.charAt(o) + u.charAt(a) + u.charAt(c);
  1096. return s
  1097. },
  1098. decode: function(e) {
  1099. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map, f = String.fromCharCode;
  1100. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1101. t = u.indexOf(e.charAt(l++)),
  1102. n = u.indexOf(e.charAt(l++)),
  1103. r = u.indexOf(e.charAt(l++)),
  1104. i = u.indexOf(e.charAt(l++)),
  1105. o = t << 2 | n >> 4,
  1106. a = (15 & n) << 4 | r >> 2,
  1107. c = (3 & r) << 6 | i,
  1108. s = s + (f(o) + (64 != r ? f(a) : "")) + (64 != i ? f(c) : "");
  1109. return this.utf8.decode(s)
  1110. },
  1111. utf8: {
  1112. encode: function(e) {
  1113. for (var t, n = "", r = 0, i = String.fromCharCode; r < e.length; )
  1114. t = e.charCodeAt(r++),
  1115. n += 128 > t ? i(t) : t > 127 && 2048 > t ? i(t >> 6 | 192) + i(63 & t | 128) : i(t >> 12 | 224) + i(t >> 6 & 63 | 128) + i(63 & t | 128);
  1116. return n
  1117. },
  1118. decode: function(e) {
  1119. for (var t, n, r = "", i = 0, o = String.fromCharCode; i < e.length; )
  1120. n = e.charCodeAt(i),
  1121. r += 128 > n ? [o(n), i++][0] : n > 191 && 224 > n ? [o((31 & n) << 6 | 63 & (t = e.charCodeAt(i + 1))), i += 2][0] : [o((15 & n) << 12 | (63 & (t = e.charCodeAt(i + 1))) << 6 | 63 & (c3 = e.charCodeAt(i + 2))), i += 3][0];
  1122. return r
  1123. }
  1124. }
  1125. },
  1126. "object" != typeof JSON && (JSON = {}),
  1127. function() {
  1128. function f(e) {
  1129. return 10 > e ? "0" + e : e
  1130. }
  1131. function quote(e) {
  1132. return escapable.lastIndex = 0,
  1133. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1134. var t = meta[e];
  1135. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1136. }) + '"' : '"' + e + '"'
  1137. }
  1138. function str(e, t) {
  1139. var n, r, i, o, a, c = gap, s = t[e];
  1140. switch (s && "object" == typeof s && "function" == typeof s.toJSON && (s = s.toJSON(e)),
  1141. "function" == typeof rep && (s = rep.call(t, e, s)),
  1142. typeof s) {
  1143. case "string":
  1144. return quote(s);
  1145. case "number":
  1146. return isFinite(s) ? String(s) : "null";
  1147. case "boolean":
  1148. case "null":
  1149. return String(s);
  1150. case "object":
  1151. if (!s)
  1152. return "null";
  1153. if (gap += indent,
  1154. a = [],
  1155. "[object Array]" === Object.prototype.toString.apply(s)) {
  1156. for (o = s.length,
  1157. n = 0; o > n; n += 1)
  1158. a[n] = str(n, s) || "null";
  1159. return i = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + c + "]" : "[" + a.join(",") + "]",
  1160. gap = c,
  1161. i
  1162. }
  1163. if (rep && "object" == typeof rep)
  1164. for (o = rep.length,
  1165. n = 0; o > n; n += 1)
  1166. "string" == typeof rep[n] && (r = rep[n],
  1167. i = str(r, s),
  1168. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1169. else
  1170. for (r in s)
  1171. Object.prototype.hasOwnProperty.call(s, r) && (i = str(r, s),
  1172. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1173. return i = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + c + "}" : "{" + a.join(",") + "}",
  1174. gap = c,
  1175. i
  1176. }
  1177. }
  1178. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1179. return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z" : null
  1180. }
  1181. ,
  1182. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1183. return this.valueOf()
  1184. }
  1185. );
  1186. var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta = {
  1187. "\b": "\\b",
  1188. "\t": "\\t",
  1189. "\n": "\\n",
  1190. "\f": "\\f",
  1191. "\r": "\\r",
  1192. '"': '\\"',
  1193. "\\": "\\\\"
  1194. }, rep;
  1195. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, n) {
  1196. var r;
  1197. if (gap = "",
  1198. indent = "",
  1199. "number" == typeof n)
  1200. for (r = 0; n > r; r += 1)
  1201. indent += " ";
  1202. else
  1203. "string" == typeof n && (indent = n);
  1204. if (rep = t,
  1205. t && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1206. throw new Error("JSON.stringify");
  1207. return str("", {
  1208. "": e
  1209. })
  1210. }
  1211. ),
  1212. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1213. function walk(e, t) {
  1214. var n, r, i = e[t];
  1215. if (i && "object" == typeof i)
  1216. for (n in i)
  1217. Object.prototype.hasOwnProperty.call(i, n) && (r = walk(i, n),
  1218. void 0 !== r ? i[n] = r : delete i[n]);
  1219. return reviver.call(e, t, i)
  1220. }
  1221. var j;
  1222. if (text = String(text),
  1223. cx.lastIndex = 0,
  1224. cx.test(text) && (text = text.replace(cx, function(e) {
  1225. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1226. })),
  1227. /^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, "")))
  1228. return j = eval("(" + text + ")"),
  1229. "function" == typeof reviver ? walk({
  1230. "": j
  1231. }, "") : j;
  1232. throw new SyntaxError("JSON.parse")
  1233. }
  1234. )
  1235. }(),
  1236. !function(e, t, n) {
  1237. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  1238. }("domready", Keen.utils, function(e) {
  1239. function t(e) {
  1240. for (d = 1; e = r.shift(); )
  1241. e()
  1242. }
  1243. var n, r = [], i = !1, o = document, a = o.documentElement, c = a.doScroll, s = "DOMContentLoaded", l = "addEventListener", u = "onreadystatechange", f = "readyState", p = c ? /^loaded|^c/ : /^loaded|c/, d = p.test(o[f]);
  1244. return o[l] && o[l](s, n = function() {
  1245. o.removeEventListener(s, n, i),
  1246. t()
  1247. }
  1248. , i),
  1249. c && o.attachEvent(u, n = function() {
  1250. /^c/.test(o[f]) && (o.detachEvent(u, n),
  1251. t())
  1252. }
  1253. ),
  1254. e = c ? function(t) {
  1255. self != top ? d ? t() : r.push(t) : function() {
  1256. try {
  1257. a.doScroll("left")
  1258. } catch (n) {
  1259. return setTimeout(function() {
  1260. e(t)
  1261. }, 50)
  1262. }
  1263. t()
  1264. }()
  1265. }
  1266. : function(e) {
  1267. d ? e() : r.push(e)
  1268. }
  1269. });
  1270. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1271. if (loaded && cached) {
  1272. clients = cached.clients || {},
  1273. ready = cached.ready || [];
  1274. for (var instance in clients)
  1275. if (clients.hasOwnProperty(instance)) {
  1276. var client = clients[instance];
  1277. for (var method in Keen.prototype)
  1278. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1279. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1280. ,
  1281. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1282. ,
  1283. client._config && (client.configure.call(client, client._config),
  1284. delete client._config),
  1285. client._setGlobalProperties) {
  1286. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1287. client.setGlobalProperties.apply(client, globals[i]);
  1288. delete client._setGlobalProperties
  1289. }
  1290. if (client._addEvent) {
  1291. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1292. client.addEvent.apply(client, queue[i]);
  1293. delete client._addEvent
  1294. }
  1295. var callback = client._on || [];
  1296. if (client._on) {
  1297. for (var i = 0; i < callback.length; i++)
  1298. client.on.apply(client, callback[i]);
  1299. client.trigger("ready"),
  1300. delete client._on
  1301. }
  1302. }
  1303. for (var i = 0; i < ready.length; i++) {
  1304. var callback = ready[i];
  1305. Keen.on("ready", function() {
  1306. callback()
  1307. })
  1308. }
  1309. }
  1310. return Keen.loaded && setTimeout(function() {
  1311. Keen.utils.domready(function() {
  1312. Keen.trigger("ready")
  1313. })
  1314. }, 0),
  1315. Keen
  1316. });
  1317. !function() {
  1318. var t = window.analytics = window.analytics || [];
  1319. if (!t.initialize) {
  1320. if (t.invoked)
  1321. return void (window.console && console.error && console.error("Segment snippet included twice."));
  1322. t.invoked = !0,
  1323. t.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1324. t.factory = function(e) {
  1325. return function() {
  1326. var n = Array.prototype.slice.call(arguments);
  1327. return n.unshift(e),
  1328. t.push(n),
  1329. t
  1330. }
  1331. }
  1332. ;
  1333. for (var e = 0; e < t.methods.length; e++) {
  1334. var n = t.methods[e];
  1335. t[n] = t.factory(n)
  1336. }
  1337. t.load = function(t) {
  1338. var e = document.createElement("script");
  1339. e.type = "text/javascript",
  1340. e.async = !0,
  1341. e.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + t + "/analytics.min.js";
  1342. var n = document.getElementsByTagName("script")[0];
  1343. n.parentNode.insertBefore(e, n)
  1344. }
  1345. ,
  1346. t.SNIPPET_VERSION = "4.0.0"
  1347. }
  1348. }();
  1349. !function(i, e) {
  1350. "use strict";
  1351. var s = ""
  1352. , r = "?"
  1353. , o = "function"
  1354. , a = "undefined"
  1355. , n = "object"
  1356. , t = "major"
  1357. , d = "model"
  1358. , w = "name"
  1359. , l = "type"
  1360. , p = "vendor"
  1361. , m = "version"
  1362. , c = "architecture"
  1363. , u = "console"
  1364. , g = "mobile"
  1365. , f = "tablet"
  1366. , h = "smarttv"
  1367. , b = {
  1368. has: function(i, e) {
  1369. return e.toLowerCase().indexOf(i.toLowerCase()) !== -1
  1370. },
  1371. lowerize: function(i) {
  1372. return i.toLowerCase()
  1373. }
  1374. }
  1375. , y = {
  1376. rgx: function() {
  1377. for (var i, s, r, t, d, w, l, p = 0, m = arguments; p < m.length; p += 2) {
  1378. var c = m[p]
  1379. , u = m[p + 1];
  1380. if (typeof i === a) {
  1381. i = {};
  1382. for (t in u)
  1383. d = u[t],
  1384. typeof d === n ? i[d[0]] = e : i[d] = e
  1385. }
  1386. for (s = r = 0; s < c.length; s++)
  1387. if (w = c[s].exec(this.getUA())) {
  1388. for (t = 0; t < u.length; t++)
  1389. l = w[++r],
  1390. d = u[t],
  1391. typeof d === n && d.length > 0 ? 2 == d.length ? typeof d[1] == o ? i[d[0]] = d[1].call(this, l) : i[d[0]] = d[1] : 3 == d.length ? typeof d[1] !== o || d[1].exec && d[1].test ? i[d[0]] = l ? l.replace(d[1], d[2]) : e : i[d[0]] = l ? d[1].call(this, l, d[2]) : e : 4 == d.length && (i[d[0]] = l ? d[3].call(this, l.replace(d[1], d[2])) : e) : i[d] = l ? l : e;
  1392. break
  1393. }
  1394. if (w)
  1395. break
  1396. }
  1397. return i
  1398. },
  1399. str: function(i, s) {
  1400. for (var o in s)
  1401. if (typeof s[o] === n && s[o].length > 0) {
  1402. for (var a = 0; a < s[o].length; a++)
  1403. if (b.has(s[o][a], i))
  1404. return o === r ? e : o
  1405. } else if (b.has(s[o], i))
  1406. return o === r ? e : o;
  1407. return i
  1408. }
  1409. }
  1410. , v = {
  1411. browser: {
  1412. oldsafari: {
  1413. major: {
  1414. 1: ["/8", "/1", "/3"],
  1415. 2: "/4",
  1416. "?": "/"
  1417. },
  1418. version: {
  1419. "1.0": "/8",
  1420. 1.2: "/1",
  1421. 1.3: "/3",
  1422. "2.0": "/412",
  1423. "2.0.2": "/416",
  1424. "2.0.3": "/417",
  1425. "2.0.4": "/419",
  1426. "?": "/"
  1427. }
  1428. }
  1429. },
  1430. device: {
  1431. sprint: {
  1432. model: {
  1433. "Evo Shift 4G": "7373KT"
  1434. },
  1435. vendor: {
  1436. HTC: "APA",
  1437. Sprint: "Sprint"
  1438. }
  1439. }
  1440. },
  1441. os: {
  1442. windows: {
  1443. version: {
  1444. ME: "4.90",
  1445. "NT 3.11": "NT3.51",
  1446. "NT 4.0": "NT4.0",
  1447. 2e3: "NT 5.0",
  1448. XP: ["NT 5.1", "NT 5.2"],
  1449. Vista: "NT 6.0",
  1450. 7: "NT 6.1",
  1451. 8: "NT 6.2",
  1452. 8.1: "NT 6.3",
  1453. RT: "ARM"
  1454. }
  1455. }
  1456. }
  1457. }
  1458. , k = {
  1459. browser: [[/(opera\smini)\/((\d+)?[\w\.-]+)/i, /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, /(opera).+version\/((\d+)?[\w\.]+)/i, /(opera)[\/\s]+((\d+)?[\w\.]+)/i], [w, m, t], [/\s(opr)\/((\d+)?[\w\.]+)/i], [[w, "Opera"], m, t], [/(kindle)\/((\d+)?[\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i, /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i, /(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i, /(rekonq)((?:\/)[\w\.]+)*/i, /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i], [w, m, t], [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i], [[w, "IE"], m, t], [/(yabrowser)\/((\d+)?[\w\.]+)/i], [[w, "Yandex"], m, t], [/(comodo_dragon)\/((\d+)?[\w\.]+)/i], [[w, /_/g, " "], m, t], [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i], [w, m, t], [/(dolfin)\/((\d+)?[\w\.]+)/i], [[w, "Dolphin"], m, t], [/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i], [[w, "Chrome"], m, t], [/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i], [m, t, [w, "Mobile Safari"]], [/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i], [m, t, w], [/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i], [w, [t, y.str, v.browser.oldsafari.major], [m, y.str, v.browser.oldsafari.version]], [/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i], [w, m, t], [/(navigator|netscape)\/((\d+)?[\w\.-]+)/i], [[w, "Netscape"], m, t], [/(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i, /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i, /(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i, /(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i, /(links)\s\(((\d+)?[\w\.]+)/i, /(gobrowser)\/?((\d+)?[\w\.]+)*/i, /(ice\s?browser)\/v?((\d+)?[\w\._]+)/i, /(mosaic)[\/\s]((\d+)?[\w\.]+)/i], [w, m, t], [/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, /(coremedia) v((\d+)[\w\._]+)/i], [w, m, t], [/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i], [w, m], [/(ares|ossproxy)\s((\d+)[\w\.-]+)/i], [w, m, t], [/(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/((\d+)[\w\.-]+)/i, /(clementine|music player daemon)\s((\d+)[\w\.-]+)/i, /(lg player|nexplayer)\s((\d+)[\d\.]+)/i, /player\/(nexplayer|lg player)\s((\d+)[\w\.-]+)/i], [w, m, t], [/(nexplayer)\s((\d+)[\w\.-]+)/i], [w, m, t], [/(flrp)\/((\d+)[\w\.-]+)/i], [[w, "Flip Player"], m, t], [/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i], [w], [/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i], [w, m, t], [/(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i, /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i, /(lavf)((\d+)[\d\.]+)/i], [w, m, t], [/(htc_one_s)\/((\d+)[\d\.]+)/i], [[w, /_/g, " "], m, t], [/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i], [w, m], [/(mplayer)(?:\s|\/)((\d+)[\w\.-]+)/i, /(mplayer) unknown-((\d+)[\w\.\-]+)/i], [w, m, t], [/(mplayer)/i, /(yourmuze)/i, /(media player classic|nero showtime)/i], [w], [/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i], [w, m, t], [/(nokia\d+)\/((\d+)[\w\.-]+)/i], [w, m, t], [/\s(songbird)\/((\d+)[\w\.-]+)/i], [w, m, t], [/(winamp)3 version ((\d+)[\w\.-]+)/i, /(winamp)\s((\d+)[\w\.-]+)/i, /(winamp)mpeg\/((\d+)[\w\.-]+)/i], [w, m, t], [/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i], [w], [/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i], [w, m, t], [/(smp)((\d+)[\d\.]+)/i], [w, m, t], [/(vlc) media player - version ((\d+)[\w\.]+)/i, /(vlc)\/((\d+)[\w\.-]+)/i, /(xbmc|gvfs|xine|xmms|irapp)\/((\d+)[\w\.-]+)/i, /(foobar2000)\/((\d+)[\d\.]+)/i, /(itunes)\/((\d+)[\d\.]+)/i], [w, m, t], [/(wmplayer)\/((\d+)[\w\.-]+)/i, /(windows-media-player)\/((\d+)[\w\.-]+)/i], [[w, /-/g, " "], m, t], [/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i], [m, t, [w, "Windows"]], [/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i], [w, m, t], [/(rad.io)\s((\d+)[\d\.]+)/i, /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i], [[w, "rad.io"], m, t]],
  1460. cpu: [[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i], [[c, "amd64"]], [/(ia32(?=;))/i], [[c, b.lowerize]], [/((?:i[346]|x)86)[;\)]/i], [[c, "ia32"]], [/windows\s(ce|mobile);\sppc;/i], [[c, "arm"]], [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i], [[c, /ower/, "", b.lowerize]], [/(sun4\w)[;\)]/i], [[c, "sparc"]], [/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i], [c, b.lowerize]],
  1461. device: [[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i], [d, p, [l, f]], [/applecoremedia\/[\w\.]+ \((ipad)/], [d, [p, "Apple"], [l, f]], [/(apple\s{0,1}tv)/i], [[d, "Apple TV"], [p, "Apple"]], [/(hp).+(touchpad)/i, /(kindle)\/([\w\.]+)/i, /\s(nook)[\w\s]+build\/(\w+)/i, /(dell)\s(strea[kpr\s\d]*[\dko])/i], [p, d, [l, f]], [/\((ip[honed|\s\w*]+);.+(apple)/i], [d, p, [l, g]], [/\((ip[honed|\s\w*]+);/i], [d, [p, "Apple"], [l, g]], [/(blackberry)[\s-]?(\w+)/i, /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola)[\s_-]?([\w-]+)*/i, /(hp)\s([\w\s]+\w)/i, /(asus)-?(\w+)/i], [p, d, [l, g]], [/\((bb10);\s(\w+)/i], [[p, "BlackBerry"], d, [l, g]], [/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i], [[p, "Asus"], d, [l, f]], [/(sony)\s(tablet\s[ps])/i], [p, d, [l, f]], [/(nintendo)\s([wids3u]+)/i], [p, d, [l, u]], [/((playstation)\s[3portablevi]+)/i], [[p, "Sony"], d, [l, u]], [/(sprint\s(\w+))/i], [[p, y.str, v.device.sprint.vendor], [d, y.str, v.device.sprint.model], [l, g]], [/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, /(zte)-(\w+)*/i, /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i], [p, [d, /_/g, " "], [l, g]], [/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i, /(mot)[\s-]?(\w+)*/i], [[p, "Motorola"], d, [l, g]], [/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i], [[p, "Motorola"], d, [l, f]], [/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i], [[p, "Samsung"], d, [l, f]], [/((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i, /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i, /sec-((sgh\w+))/i], [[p, "Samsung"], d, [l, g]], [/(sie)-(\w+)*/i], [[p, "Siemens"], d, [l, g]], [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i], [[p, "Nokia"], d, [l, g]], [/android\s3\.[\s\w-;]{10}((a\d{3}))/i], [[p, "Acer"], d, [l, f]], [/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i], [[p, "LG"], d, [l, f]], [/((nexus\s[45]))/i, /(lg)[e;\s-\/]+(\w+)*/i], [[p, "LG"], d, [l, g]], [/android.+((ideatab[a-z0-9\-\s]+))/i], [[p, "Lenovo"], d, [l, f]], [/(lg) netcast\.tv/i], [p, [l, h]], [/(mobile|tablet);.+rv\:.+gecko\//i], [l, p, d]],
  1462. engine: [[/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, /(icab)[\/\s]([23]\.[\d\.]+)/i], [w, m], [/rv\:([\w\.]+).*(gecko)/i], [m, w]],
  1463. os: [[/microsoft\s(windows)\s(vista|xp)/i], [w, m], [/(windows)\snt\s6\.2;\s(arm)/i, /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i], [w, [m, y.str, v.os.windows.version]], [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i], [[w, "Windows"], [m, y.str, v.os.windows.version]], [/\((bb)(10);/i], [[w, "BlackBerry"], m], [/(blackberry)\w*\/?([\w\.]+)*/i, /(tizen)\/([\w\.]+)/i, /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i], [w, m], [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i], [[w, "Symbian"], m], [/mozilla.+\(mobile;.+gecko.+firefox/i], [[w, "Firefox OS"], m], [/(nintendo|playstation)\s([wids3portablevu]+)/i, /(mint)[\/\s\(]?(\w+)*/i, /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i, /(hurd|linux)\s?([\w\.]+)*/i, /(gnu)\s?([\w\.]+)*/i], [w, m], [/(cros)\s[\w]+\s([\w\.]+\w)/i], [[w, "Chromium OS"], m], [/(sunos)\s?([\w\.]+\d)*/i], [[w, "Solaris"], m], [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i], [w, m], [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i], [[w, "iOS"], [m, /_/g, "."]], [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i], [w, [m, /_/g, "."]], [/(haiku)\s(\w+)/i, /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, /(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i, /(unix)\s?([\w\.]+)*/i], [w, m]]
  1464. }
  1465. , x = function(e) {
  1466. var r = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : s);
  1467. return this instanceof x ? (this.getBrowser = function() {
  1468. return y.rgx.apply(this, k.browser)
  1469. }
  1470. ,
  1471. this.getCPU = function() {
  1472. return y.rgx.apply(this, k.cpu)
  1473. }
  1474. ,
  1475. this.getDevice = function() {
  1476. return y.rgx.apply(this, k.device)
  1477. }
  1478. ,
  1479. this.getEngine = function() {
  1480. return y.rgx.apply(this, k.engine)
  1481. }
  1482. ,
  1483. this.getOS = function() {
  1484. return y.rgx.apply(this, k.os)
  1485. }
  1486. ,
  1487. this.getResult = function() {
  1488. return {
  1489. ua: this.getUA(),
  1490. browser: this.getBrowser(),
  1491. engine: this.getEngine(),
  1492. os: this.getOS(),
  1493. device: this.getDevice(),
  1494. cpu: this.getCPU()
  1495. }
  1496. }
  1497. ,
  1498. this.getUA = function() {
  1499. return r
  1500. }
  1501. ,
  1502. this.setUA = function(i) {
  1503. return r = i,
  1504. this
  1505. }
  1506. ,
  1507. void this.setUA(r)) : new x(e).getResult()
  1508. };
  1509. if (typeof exports !== a)
  1510. typeof module !== a && module.exports && (exports = module.exports = x),
  1511. exports.UAParser = x;
  1512. else if (i.UAParser = x,
  1513. typeof define === o && define.amd && define(function() {
  1514. return x
  1515. }),
  1516. typeof i.jQuery !== a) {
  1517. var A = i.jQuery
  1518. , _ = new x;
  1519. A.ua = _.getResult(),
  1520. A.ua.get = function() {
  1521. return _.getUA()
  1522. }
  1523. ,
  1524. A.ua.set = function(i) {
  1525. _.setUA(i);
  1526. var e = _.getResult();
  1527. for (var s in e)
  1528. A.ua[s] = e[s]
  1529. }
  1530. }
  1531. }(this);
  1532. window.Modernizr = function(n, e, t) {
  1533. function o(n) {
  1534. d.cssText = n
  1535. }
  1536. function r(n, e) {
  1537. return typeof n === e
  1538. }
  1539. var i, c, u, a = "2.8.2", f = {}, s = e.documentElement, l = "modernizr", p = e.createElement(l), d = p.style, y = ({}.toString,
  1540. {}), w = [], b = w.slice, v = {}.hasOwnProperty;
  1541. u = r(v, "undefined") || r(v.call, "undefined") ? function(n, e) {
  1542. return e in n && r(n.constructor.prototype[e], "undefined")
  1543. }
  1544. : function(n, e) {
  1545. return v.call(n, e)
  1546. }
  1547. ,
  1548. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1549. var e = this;
  1550. if ("function" != typeof e)
  1551. throw new TypeError;
  1552. var t = b.call(arguments, 1)
  1553. , o = function() {
  1554. if (this instanceof o) {
  1555. var r = function() {};
  1556. r.prototype = e.prototype;
  1557. var i = new r
  1558. , c = e.apply(i, t.concat(b.call(arguments)));
  1559. return Object(c) === c ? c : i
  1560. }
  1561. return e.apply(n, t.concat(b.call(arguments)))
  1562. };
  1563. return o
  1564. }
  1565. ),
  1566. y.webgl = function() {
  1567. return !!n.WebGLRenderingContext
  1568. }
  1569. ;
  1570. for (var h in y)
  1571. u(y, h) && (c = h.toLowerCase(),
  1572. f[c] = y[h](),
  1573. w.push((f[c] ? "" : "no-") + c));
  1574. return f.addTest = function(n, e) {
  1575. if ("object" == typeof n)
  1576. for (var o in n)
  1577. u(n, o) && f.addTest(o, n[o]);
  1578. else {
  1579. if (n = n.toLowerCase(),
  1580. f[n] !== t)
  1581. return f;
  1582. e = "function" == typeof e ? e() : e,
  1583. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (e ? "" : "no-") + n),
  1584. f[n] = e
  1585. }
  1586. return f
  1587. }
  1588. ,
  1589. o(""),
  1590. p = i = null,
  1591. f._version = a,
  1592. f
  1593. }(this, this.document);
  1594. !function(e, t, a) {
  1595. "use strict";
  1596. function n(t, h, m) {
  1597. function H(a) {
  1598. var n = 0
  1599. , i = Ee.length;
  1600. if (Ce.old = e.extend({}, Ce),
  1601. Ie = we ? 0 : be[ge.horizontal ? "width" : "height"](),
  1602. ke = Be[ge.horizontal ? "width" : "height"](),
  1603. ze = we ? t : Pe[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1604. Ee.length = 0,
  1605. Ce.start = 0,
  1606. Ce.end = q(ze - Ie, 0),
  1607. Re) {
  1608. n = Ne.length,
  1609. qe = Pe.children(ge.itemSelector),
  1610. Ne.length = 0;
  1611. var r, s = c(Pe, ge.horizontal ? "paddingLeft" : "paddingTop"), o = c(Pe, ge.horizontal ? "paddingRight" : "paddingBottom"), l = "border-box" === e(qe).css("boxSizing"), u = "none" !== qe.css("float"), f = 0, v = qe.length - 1;
  1612. ze = 0,
  1613. qe.each(function(t, a) {
  1614. var n = e(a)
  1615. , i = a.getBoundingClientRect()
  1616. , l = E(ge.horizontal ? i.width || i.right - i.left : i.height || i.bottom - i.top)
  1617. , d = c(n, ge.horizontal ? "marginLeft" : "marginTop")
  1618. , p = c(n, ge.horizontal ? "marginRight" : "marginBottom")
  1619. , h = l + d + p
  1620. , m = !d || !p
  1621. , g = {};
  1622. g.el = a,
  1623. g.size = m ? l : h,
  1624. g.half = g.size / 2,
  1625. g.start = ze + (m ? d : 0),
  1626. g.center = g.start - E(Ie / 2 - g.size / 2),
  1627. g.end = g.start - Ie + g.size,
  1628. t || (ze += s),
  1629. ze += h,
  1630. ge.horizontal || u || p && d && t > 0 && (ze -= N(d, p)),
  1631. t === v && (g.end += o,
  1632. ze += o,
  1633. f = m ? p : 0),
  1634. Ne.push(g),
  1635. r = g
  1636. }),
  1637. Pe[0].style[ge.horizontal ? "width" : "height"] = (l ? ze : ze - s - o) + "px",
  1638. ze -= f,
  1639. Ne.length ? (Ce.start = Ne[0][Me ? "center" : "start"],
  1640. Ce.end = Me ? r.center : ze > Ie ? r.end : Ce.start) : Ce.start = Ce.end = 0
  1641. }
  1642. if (Ce.center = E(Ce.end / 2 + Ce.start / 2),
  1643. Q(),
  1644. Se.length && ke > 0 && (ge.dynamicHandle ? (Te = Ce.start === Ce.end ? ke : E(ke * Ie / ze),
  1645. Te = d(Te, ge.minHandleSize, ke),
  1646. Se[0].style[ge.horizontal ? "width" : "height"] = Te + "px") : Te = Se[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1647. xe.end = ke - Te,
  1648. it || j()),
  1649. !we && Ie > 0) {
  1650. var p = Ce.start
  1651. , h = "";
  1652. if (Re)
  1653. e.each(Ne, function(e, t) {
  1654. Me ? Ee.push(t.center) : t.start + t.size > p && p <= Ce.end && (p = t.start,
  1655. Ee.push(p),
  1656. p += Ie,
  1657. p > Ce.end && p < Ce.end + Ie && Ee.push(Ce.end))
  1658. });
  1659. else
  1660. for (; p - Ie < Ce.end; )
  1661. Ee.push(p),
  1662. p += Ie;
  1663. if (De[0] && i !== Ee.length) {
  1664. for (var m = 0; m < Ee.length; m++)
  1665. h += ge.pageBuilder.call(ye, m);
  1666. Ae = De.html(h).children(),
  1667. Ae.eq(Oe.activePage).addClass(ge.activeClass)
  1668. }
  1669. }
  1670. if (Oe.slideeSize = ze,
  1671. Oe.frameSize = Ie,
  1672. Oe.sbSize = ke,
  1673. Oe.handleSize = Te,
  1674. Re) {
  1675. a && null != ge.startAt && (W(ge.startAt),
  1676. ye[Le ? "toCenter" : "toStart"](ge.startAt));
  1677. var g = Ne[Oe.activeItem];
  1678. X(Le && g ? g.center : d(Ce.dest, Ce.start, Ce.end))
  1679. } else
  1680. a ? null != ge.startAt && X(ge.startAt, 1) : X(d(Ce.dest, Ce.start, Ce.end));
  1681. pe("load")
  1682. }
  1683. function X(e, t, a) {
  1684. if (Re && at.released && !a) {
  1685. var n = $(e)
  1686. , i = e > Ce.start && e < Ce.end;
  1687. Le ? (i && (e = Ne[n.centerItem].center),
  1688. Me && ge.activateMiddle && W(n.centerItem)) : i && (e = Ne[n.firstItem].start)
  1689. }
  1690. at.init && at.slidee && ge.elasticBounds ? e > Ce.end ? e = Ce.end + (e - Ce.end) / 6 : e < Ce.start && (e = Ce.start + (e - Ce.start) / 6) : e = d(e, Ce.start, Ce.end),
  1691. et.start = +new Date,
  1692. et.time = 0,
  1693. et.from = Ce.cur,
  1694. et.to = e,
  1695. et.delta = e - Ce.cur,
  1696. et.tweesing = at.tweese || at.init && !at.slidee,
  1697. et.immediate = !et.tweesing && (t || at.init && at.slidee || !ge.speed),
  1698. at.tweese = 0,
  1699. e !== Ce.dest && (Ce.dest = e,
  1700. pe("change"),
  1701. it || Y()),
  1702. K(),
  1703. Q(),
  1704. Z(),
  1705. F()
  1706. }
  1707. function Y() {
  1708. if (ye.initialized) {
  1709. if (!it)
  1710. return it = w(Y),
  1711. void (at.released && pe("moveStart"));
  1712. et.immediate ? Ce.cur = et.to : et.tweesing ? (et.tweeseDelta = et.to - Ce.cur,
  1713. x(et.tweeseDelta) < .1 ? Ce.cur = et.to : Ce.cur += et.tweeseDelta * (at.released ? ge.swingSpeed : ge.syncSpeed)) : (et.time = N(+new Date - et.start, ge.speed),
  1714. Ce.cur = et.from + et.delta * e.easing[ge.easing](et.time / ge.speed, et.time, 0, 1, ge.speed)),
  1715. et.to === Ce.cur ? (Ce.cur = et.to,
  1716. at.tweese = it = 0) : it = w(Y),
  1717. pe("move"),
  1718. we || (f ? Pe[0].style[f] = v + (ge.horizontal ? "translateX" : "translateY") + "(" + -Ce.cur + "px)" : Pe[0].style[ge.horizontal ? "left" : "top"] = -E(Ce.cur) + "px"),
  1719. !it && at.released && pe("moveEnd"),
  1720. j()
  1721. }
  1722. }
  1723. function j() {
  1724. Se.length && (xe.cur = Ce.start === Ce.end ? 0 : ((at.init && !at.slidee ? Ce.dest : Ce.cur) - Ce.start) / (Ce.end - Ce.start) * xe.end,
  1725. xe.cur = d(E(xe.cur), xe.start, xe.end),
  1726. _e.hPos !== xe.cur && (_e.hPos = xe.cur,
  1727. f ? Se[0].style[f] = v + (ge.horizontal ? "translateX" : "translateY") + "(" + xe.cur + "px)" : Se[0].style[ge.horizontal ? "left" : "top"] = xe.cur + "px"))
  1728. }
  1729. function F() {
  1730. Ae[0] && _e.page !== Oe.activePage && (_e.page = Oe.activePage,
  1731. Ae.removeClass(ge.activeClass).eq(Oe.activePage).addClass(ge.activeClass),
  1732. pe("activePage", _e.page))
  1733. }
  1734. function M() {
  1735. tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) || ye.stop(),
  1736. ot = at.init ? w(M) : 0,
  1737. tt.now = +new Date,
  1738. tt.pos = Ce.cur + (tt.now - tt.lastTime) / 1e3 * tt.speed,
  1739. X(at.init ? tt.pos : E(tt.pos)),
  1740. at.init || Ce.cur !== Ce.dest || pe("moveEnd"),
  1741. tt.lastTime = tt.now
  1742. }
  1743. function L(e, t, n) {
  1744. if ("boolean" === i(t) && (n = t,
  1745. t = a),
  1746. t === a)
  1747. X(Ce[e], n);
  1748. else {
  1749. if (Le && "center" !== e)
  1750. return;
  1751. var r = ye.getPos(t);
  1752. r && X(r[e], n, !Le)
  1753. }
  1754. }
  1755. function R(e) {
  1756. return null != e ? l(e) ? e >= 0 && e < Ne.length ? e : -1 : qe.index(e) : -1
  1757. }
  1758. function U(e) {
  1759. return R(l(e) && 0 > e ? e + Ne.length : e)
  1760. }
  1761. function W(e, t) {
  1762. var a = R(e);
  1763. return !(!Re || 0 > a) && ((_e.active !== a || t) && (qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  1764. qe.eq(a).addClass(ge.activeClass),
  1765. _e.active = Oe.activeItem = a,
  1766. Z(),
  1767. pe("active", a)),
  1768. a)
  1769. }
  1770. function $(e) {
  1771. e = d(l(e) ? e : Ce.dest, Ce.start, Ce.end);
  1772. var t = {}
  1773. , a = Me ? 0 : Ie / 2;
  1774. if (!we)
  1775. for (var n = 0, i = Ee.length; i > n; n++) {
  1776. if (e >= Ce.end || n === Ee.length - 1) {
  1777. t.activePage = Ee.length - 1;
  1778. break
  1779. }
  1780. if (e <= Ee[n] + a) {
  1781. t.activePage = n;
  1782. break
  1783. }
  1784. }
  1785. if (Re) {
  1786. for (var r = !1, s = !1, o = !1, c = 0, u = Ne.length; u > c; c++)
  1787. if (r === !1 && e <= Ne[c].start + Ne[c].half && (r = c),
  1788. o === !1 && e <= Ne[c].center + Ne[c].half && (o = c),
  1789. c === u - 1 || e <= Ne[c].end + Ne[c].half) {
  1790. s = c;
  1791. break
  1792. }
  1793. t.firstItem = l(r) ? r : 0,
  1794. t.centerItem = l(o) ? o : t.firstItem,
  1795. t.lastItem = l(s) ? s : t.centerItem
  1796. }
  1797. return t
  1798. }
  1799. function Q(t) {
  1800. e.extend(Oe, $(t))
  1801. }
  1802. function Z() {
  1803. var e = Ce.dest <= Ce.start
  1804. , t = Ce.dest >= Ce.end
  1805. , a = (e ? 1 : 0) | (t ? 2 : 0);
  1806. if (_e.slideePosState !== a && (_e.slideePosState = a,
  1807. Je.is("button,input") && Je.prop("disabled", e),
  1808. Ke.is("button,input") && Ke.prop("disabled", t),
  1809. Je.add(Qe)[e ? "addClass" : "removeClass"](ge.disabledClass),
  1810. Ke.add($e)[t ? "addClass" : "removeClass"](ge.disabledClass)),
  1811. _e.fwdbwdState !== a && at.released && (_e.fwdbwdState = a,
  1812. Qe.is("button,input") && Qe.prop("disabled", e),
  1813. $e.is("button,input") && $e.prop("disabled", t)),
  1814. Re && null != Oe.activeItem) {
  1815. var n = 0 === Oe.activeItem
  1816. , i = Oe.activeItem >= Ne.length - 1
  1817. , r = (n ? 1 : 0) | (i ? 2 : 0);
  1818. _e.itemsButtonState !== r && (_e.itemsButtonState = r,
  1819. Ze.is("button,input") && Ze.prop("disabled", n),
  1820. Ge.is("button,input") && Ge.prop("disabled", i),
  1821. Ze[n ? "addClass" : "removeClass"](ge.disabledClass),
  1822. Ge[i ? "addClass" : "removeClass"](ge.disabledClass))
  1823. }
  1824. }
  1825. function G(e, t, a) {
  1826. if (e = U(e),
  1827. t = U(t),
  1828. e > -1 && t > -1 && e !== t && (!a || t !== e - 1) && (a || t !== e + 1)) {
  1829. qe.eq(e)[a ? "insertAfter" : "insertBefore"](Ne[t].el);
  1830. var n = t > e ? e : a ? t : t - 1
  1831. , i = e > t ? e : a ? t + 1 : t
  1832. , r = e > t;
  1833. null != Oe.activeItem && (e === Oe.activeItem ? _e.active = Oe.activeItem = a ? r ? t + 1 : t : r ? t : t - 1 : Oe.activeItem > n && Oe.activeItem < i && (_e.active = Oe.activeItem += r ? 1 : -1)),
  1834. H()
  1835. }
  1836. }
  1837. function J(e, t) {
  1838. for (var a = 0, n = Ve[e].length; n > a; a++)
  1839. if (Ve[e][a] === t)
  1840. return a;
  1841. return -1
  1842. }
  1843. function K() {
  1844. at.released && !ye.isPaused && ye.resume()
  1845. }
  1846. function V(e) {
  1847. return E(d(e, xe.start, xe.end) / xe.end * (Ce.end - Ce.start)) + Ce.start
  1848. }
  1849. function _() {
  1850. at.history[0] = at.history[1],
  1851. at.history[1] = at.history[2],
  1852. at.history[2] = at.history[3],
  1853. at.history[3] = at.delta
  1854. }
  1855. function ee(e) {
  1856. at.released = 0,
  1857. at.source = e,
  1858. at.slidee = "slidee" === e
  1859. }
  1860. function te(t) {
  1861. var a = "touchstart" === t.type
  1862. , n = t.data.source
  1863. , i = "slidee" === n;
  1864. at.init || !a && ie(t.target) || ("handle" !== n || ge.dragHandle && xe.start !== xe.end) && (!i || (a ? ge.touchDragging : ge.mouseDragging && t.which < 2)) && (a || r(t),
  1865. ee(n),
  1866. at.init = 0,
  1867. at.$source = e(t.target),
  1868. at.touch = a,
  1869. at.pointer = a ? t.originalEvent.touches[0] : t,
  1870. at.initX = at.pointer.pageX,
  1871. at.initY = at.pointer.pageY,
  1872. at.initPos = i ? Ce.cur : xe.cur,
  1873. at.start = +new Date,
  1874. at.time = 0,
  1875. at.path = 0,
  1876. at.delta = 0,
  1877. at.locked = 0,
  1878. at.history = [0, 0, 0, 0],
  1879. at.pathToLock = i ? a ? 30 : 10 : 0,
  1880. b.on(a ? z : I, ae),
  1881. ye.pause(1),
  1882. (i ? Pe : Se).addClass(ge.draggedClass),
  1883. pe("moveStart"),
  1884. i && (rt = setInterval(_, 10)))
  1885. }
  1886. function ae(e) {
  1887. if (at.released = "mouseup" === e.type || "touchend" === e.type,
  1888. at.pointer = at.touch ? e.originalEvent[at.released ? "changedTouches" : "touches"][0] : e,
  1889. at.pathX = at.pointer.pageX - at.initX,
  1890. at.pathY = at.pointer.pageY - at.initY,
  1891. at.path = D(A(at.pathX, 2) + A(at.pathY, 2)),
  1892. at.delta = ge.horizontal ? at.pathX : at.pathY,
  1893. at.released || !(at.path < 1)) {
  1894. if (!at.init) {
  1895. if (!(ge.horizontal ? x(at.pathX) > x(at.pathY) : x(at.pathX) < x(at.pathY)))
  1896. return ne();
  1897. at.init = 1
  1898. }
  1899. r(e),
  1900. !at.locked && at.path > at.pathToLock && at.slidee && (at.locked = 1,
  1901. at.$source.on(B, s)),
  1902. at.released && (ne(),
  1903. ge.releaseSwing && at.slidee && (at.swing = (at.delta - at.history[0]) / 40 * 300,
  1904. at.delta += at.swing,
  1905. at.tweese = x(at.swing) > 10)),
  1906. X(at.slidee ? E(at.initPos - at.delta) : V(at.initPos + at.delta))
  1907. }
  1908. }
  1909. function ne() {
  1910. clearInterval(rt),
  1911. at.released = !0,
  1912. b.off(at.touch ? z : I, ae),
  1913. (at.slidee ? Pe : Se).removeClass(ge.draggedClass),
  1914. setTimeout(function() {
  1915. at.$source.off(B, s)
  1916. }),
  1917. Ce.cur === Ce.dest && at.init && pe("moveEnd"),
  1918. ye.resume(1),
  1919. at.init = 0
  1920. }
  1921. function ie(t) {
  1922. return ~e.inArray(t.nodeName, k) || e(t).is(ge.interactive)
  1923. }
  1924. function re() {
  1925. ye.stop(),
  1926. b.off("mouseup", re)
  1927. }
  1928. function se(e) {
  1929. switch (r(e),
  1930. this) {
  1931. case $e[0]:
  1932. case Qe[0]:
  1933. ye.moveBy($e.is(this) ? ge.moveBy : -ge.moveBy),
  1934. b.on("mouseup", re);
  1935. break;
  1936. case Ze[0]:
  1937. ye.prev();
  1938. break;
  1939. case Ge[0]:
  1940. ye.next();
  1941. break;
  1942. case Je[0]:
  1943. ye.prevPage();
  1944. break;
  1945. case Ke[0]:
  1946. ye.nextPage()
  1947. }
  1948. }
  1949. function oe(e) {
  1950. return nt.curDelta = (ge.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  1951. nt.curDelta /= 1 === e.deltaMode ? 3 : 100,
  1952. Re ? (p = +new Date,
  1953. nt.last < p - nt.resetTime && (nt.delta = 0),
  1954. nt.last = p,
  1955. nt.delta += nt.curDelta,
  1956. x(nt.delta) < 1 ? nt.finalDelta = 0 : (nt.finalDelta = E(nt.delta / 1),
  1957. nt.delta %= 1),
  1958. nt.finalDelta) : nt.curDelta
  1959. }
  1960. function le(e) {
  1961. e.originalEvent[g] = ye;
  1962. var t = +new Date;
  1963. if (O + ge.scrollHijack > t && Ue[0] !== document && Ue[0] !== window)
  1964. return void (O = t);
  1965. if (ge.scrollBy && Ce.start !== Ce.end) {
  1966. var a = oe(e.originalEvent);
  1967. (ge.scrollTrap || a > 0 && Ce.dest < Ce.end || 0 > a && Ce.dest > Ce.start) && r(e, 1),
  1968. ye.slideBy(ge.scrollBy * a)
  1969. }
  1970. }
  1971. function ce(e) {
  1972. ge.clickBar && e.target === Be[0] && (r(e),
  1973. X(V((ge.horizontal ? e.pageX - Be.offset().left : e.pageY - Be.offset().top) - Te / 2)))
  1974. }
  1975. function de(e) {
  1976. if (ge.keyboardNavBy)
  1977. switch (e.which) {
  1978. case ge.horizontal ? 37 : 38:
  1979. r(e),
  1980. ye["pages" === ge.keyboardNavBy ? "prevPage" : "prev"]();
  1981. break;
  1982. case ge.horizontal ? 39 : 40:
  1983. r(e),
  1984. ye["pages" === ge.keyboardNavBy ? "nextPage" : "next"]()
  1985. }
  1986. }
  1987. function ue(e) {
  1988. return ie(this) ? void (e.originalEvent[g + "ignore"] = !0) : void (this.parentNode !== Pe[0] || e.originalEvent[g + "ignore"] || ye.activate(this))
  1989. }
  1990. function fe() {
  1991. this.parentNode === De[0] && ye.activatePage(Ae.index(this))
  1992. }
  1993. function ve(e) {
  1994. ge.pauseOnHover && ye["mouseenter" === e.type ? "pause" : "resume"](2)
  1995. }
  1996. function pe(e, t) {
  1997. if (Ve[e]) {
  1998. for (me = Ve[e].length,
  1999. T.length = 0,
  2000. he = 0; me > he; he++)
  2001. T.push(Ve[e][he]);
  2002. for (he = 0; me > he; he++)
  2003. T[he].call(ye, e, t)
  2004. }
  2005. }
  2006. var he, me, ge = e.extend({}, n.defaults, h), ye = this, we = l(t), be = e(t), Pe = ge.slidee ? e(ge.slidee).eq(0) : be.children().eq(0), Ie = 0, ze = 0, Ce = {
  2007. start: 0,
  2008. center: 0,
  2009. end: 0,
  2010. cur: 0,
  2011. dest: 0
  2012. }, Be = e(ge.scrollBar).eq(0), Se = Be.children().eq(0), ke = 0, Te = 0, xe = {
  2013. start: 0,
  2014. end: 0,
  2015. cur: 0
  2016. }, De = e(ge.pagesBar), Ae = 0, Ee = [], qe = 0, Ne = [], Oe = {
  2017. firstItem: 0,
  2018. lastItem: 0,
  2019. centerItem: 0,
  2020. activeItem: null,
  2021. activePage: 0
  2022. }, He = new u(be[0]), Xe = new u(Pe[0]), Ye = new u(Be[0]), je = new u(Se[0]), Fe = "basic" === ge.itemNav, Me = "forceCentered" === ge.itemNav, Le = "centered" === ge.itemNav || Me, Re = !we && (Fe || Le || Me), Ue = ge.scrollSource ? e(ge.scrollSource) : be, We = ge.dragSource ? e(ge.dragSource) : be, $e = e(ge.forward), Qe = e(ge.backward), Ze = e(ge.prev), Ge = e(ge.next), Je = e(ge.prevPage), Ke = e(ge.nextPage), Ve = {}, _e = {}, et = {}, tt = {}, at = {
  2023. released: 1
  2024. }, nt = {
  2025. last: 0,
  2026. delta: 0,
  2027. resetTime: 200
  2028. }, it = 0, rt = 0, st = 0, ot = 0;
  2029. we || (t = be[0]),
  2030. ye.initialized = 0,
  2031. ye.frame = t,
  2032. ye.slidee = Pe[0],
  2033. ye.pos = Ce,
  2034. ye.rel = Oe,
  2035. ye.items = Ne,
  2036. ye.pages = Ee,
  2037. ye.isPaused = 0,
  2038. ye.options = ge,
  2039. ye.dragging = at,
  2040. ye.reload = function() {
  2041. H()
  2042. }
  2043. ,
  2044. ye.getPos = function(e) {
  2045. if (Re) {
  2046. var t = R(e);
  2047. return -1 !== t && Ne[t]
  2048. }
  2049. var a = Pe.find(e).eq(0);
  2050. if (a[0]) {
  2051. var n = ge.horizontal ? a.offset().left - Pe.offset().left : a.offset().top - Pe.offset().top
  2052. , i = a[ge.horizontal ? "outerWidth" : "outerHeight"]();
  2053. return {
  2054. start: n,
  2055. center: n - Ie / 2 + i / 2,
  2056. end: n - Ie + i,
  2057. size: i
  2058. }
  2059. }
  2060. return !1
  2061. }
  2062. ,
  2063. ye.moveBy = function(e) {
  2064. tt.speed = e,
  2065. !at.init && tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) && (tt.lastTime = +new Date,
  2066. tt.startPos = Ce.cur,
  2067. ee("button"),
  2068. at.init = 1,
  2069. pe("moveStart"),
  2070. y(ot),
  2071. M())
  2072. }
  2073. ,
  2074. ye.stop = function() {
  2075. "button" === at.source && (at.init = 0,
  2076. at.released = 1)
  2077. }
  2078. ,
  2079. ye.prev = function() {
  2080. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem - 1)
  2081. }
  2082. ,
  2083. ye.next = function() {
  2084. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem + 1)
  2085. }
  2086. ,
  2087. ye.prevPage = function() {
  2088. ye.activatePage(Oe.activePage - 1)
  2089. }
  2090. ,
  2091. ye.nextPage = function() {
  2092. ye.activatePage(Oe.activePage + 1)
  2093. }
  2094. ,
  2095. ye.slideBy = function(e, t) {
  2096. e && (Re ? ye[Le ? "toCenter" : "toStart"](d((Le ? Oe.centerItem : Oe.firstItem) + ge.scrollBy * e, 0, Ne.length)) : X(Ce.dest + e, t))
  2097. }
  2098. ,
  2099. ye.slideTo = function(e, t) {
  2100. X(e, t)
  2101. }
  2102. ,
  2103. ye.toStart = function(e, t) {
  2104. L("start", e, t)
  2105. }
  2106. ,
  2107. ye.toEnd = function(e, t) {
  2108. L("end", e, t)
  2109. }
  2110. ,
  2111. ye.toCenter = function(e, t) {
  2112. L("center", e, t)
  2113. }
  2114. ,
  2115. ye.getIndex = R,
  2116. ye.activate = function(e, t) {
  2117. var a = W(e);
  2118. ge.smart && a !== !1 && (Le ? ye.toCenter(a, t) : a >= Oe.lastItem ? ye.toStart(a, t) : a <= Oe.firstItem ? ye.toEnd(a, t) : K())
  2119. }
  2120. ,
  2121. ye.activatePage = function(e, t) {
  2122. l(e) && X(Ee[d(e, 0, Ee.length - 1)], t)
  2123. }
  2124. ,
  2125. ye.resume = function(e) {
  2126. ge.cycleBy && ge.cycleInterval && ("items" !== ge.cycleBy || Ne[0] && null != Oe.activeItem) && !(e < ye.isPaused) && (ye.isPaused = 0,
  2127. st ? st = clearTimeout(st) : pe("resume"),
  2128. st = setTimeout(function() {
  2129. switch (pe("cycle"),
  2130. ge.cycleBy) {
  2131. case "items":
  2132. ye.activate(Oe.activeItem >= Ne.length - 1 ? 0 : Oe.activeItem + 1);
  2133. break;
  2134. case "pages":
  2135. ye.activatePage(Oe.activePage >= Ee.length - 1 ? 0 : Oe.activePage + 1)
  2136. }
  2137. }, ge.cycleInterval))
  2138. }
  2139. ,
  2140. ye.pause = function(e) {
  2141. e < ye.isPaused || (ye.isPaused = e || 100,
  2142. st && (st = clearTimeout(st),
  2143. pe("pause")))
  2144. }
  2145. ,
  2146. ye.toggle = function() {
  2147. ye[st ? "pause" : "resume"]()
  2148. }
  2149. ,
  2150. ye.set = function(t, a) {
  2151. e.isPlainObject(t) ? e.extend(ge, t) : ge.hasOwnProperty(t) && (ge[t] = a)
  2152. }
  2153. ,
  2154. ye.add = function(t, a) {
  2155. var n = e(t);
  2156. Re ? (null == a || !Ne[0] || a >= Ne.length ? n.appendTo(Pe) : Ne.length && n.insertBefore(Ne[a].el),
  2157. null != Oe.activeItem && a <= Oe.activeItem && (_e.active = Oe.activeItem += n.length)) : Pe.append(n),
  2158. H()
  2159. }
  2160. ,
  2161. ye.remove = function(t) {
  2162. if (Re) {
  2163. var a = U(t);
  2164. if (a > -1) {
  2165. qe.eq(a).remove();
  2166. var n = a === Oe.activeItem;
  2167. null != Oe.activeItem && a < Oe.activeItem && (_e.active = --Oe.activeItem),
  2168. H(),
  2169. n && (_e.active = null,
  2170. ye.activate(Oe.activeItem))
  2171. }
  2172. } else
  2173. e(t).remove(),
  2174. H()
  2175. }
  2176. ,
  2177. ye.moveAfter = function(e, t) {
  2178. G(e, t, 1)
  2179. }
  2180. ,
  2181. ye.moveBefore = function(e, t) {
  2182. G(e, t)
  2183. }
  2184. ,
  2185. ye.on = function(e, t) {
  2186. if ("object" === i(e))
  2187. for (var a in e)
  2188. e.hasOwnProperty(a) && ye.on(a, e[a]);
  2189. else if ("function" === i(t))
  2190. for (var n = e.split(" "), r = 0, s = n.length; s > r; r++)
  2191. Ve[n[r]] = Ve[n[r]] || [],
  2192. -1 === J(n[r], t) && Ve[n[r]].push(t);
  2193. else if ("array" === i(t))
  2194. for (var o = 0, l = t.length; l > o; o++)
  2195. ye.on(e, t[o])
  2196. }
  2197. ,
  2198. ye.one = function(e, t) {
  2199. function a() {
  2200. t.apply(ye, arguments),
  2201. ye.off(e, a)
  2202. }
  2203. ye.on(e, a)
  2204. }
  2205. ,
  2206. ye.off = function(e, t) {
  2207. if (t instanceof Array)
  2208. for (var a = 0, n = t.length; n > a; a++)
  2209. ye.off(e, t[a]);
  2210. else
  2211. for (var i = e.split(" "), r = 0, s = i.length; s > r; r++)
  2212. if (Ve[i[r]] = Ve[i[r]] || [],
  2213. null == t)
  2214. Ve[i[r]].length = 0;
  2215. else {
  2216. var o = J(i[r], t);
  2217. -1 !== o && Ve[i[r]].splice(o, 1)
  2218. }
  2219. }
  2220. ,
  2221. ye.destroy = function() {
  2222. return Ue.add(Se).add(Be).add(De).add($e).add(Qe).add(Ze).add(Ge).add(Je).add(Ke).off("." + g),
  2223. b.off("keydown", de),
  2224. Ze.add(Ge).add(Je).add(Ke).removeClass(ge.disabledClass),
  2225. qe && null != Oe.activeItem && qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2226. De.empty(),
  2227. we || (be.off("." + g),
  2228. He.restore(),
  2229. Xe.restore(),
  2230. Ye.restore(),
  2231. je.restore(),
  2232. e.removeData(t, g)),
  2233. Ne.length = Ee.length = 0,
  2234. _e = {},
  2235. ye.initialized = 0,
  2236. ye
  2237. }
  2238. ,
  2239. ye.init = function() {
  2240. if (!ye.initialized) {
  2241. ye.on(m);
  2242. var e = ["overflow", "position"]
  2243. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2244. He.save.apply(He, e),
  2245. Ye.save.apply(Ye, e),
  2246. Xe.save.apply(Xe, t),
  2247. je.save.apply(je, t);
  2248. var a = Se;
  2249. return we || (a = a.add(Pe),
  2250. be.css("overflow", "hidden"),
  2251. f || "static" !== be.css("position") || be.css("position", "relative")),
  2252. f ? v && a.css(f, v) : ("static" === Be.css("position") && Be.css("position", "relative"),
  2253. a.css({
  2254. position: "absolute"
  2255. })),
  2256. ge.forward && $e.on(S, se),
  2257. ge.backward && Qe.on(S, se),
  2258. ge.prev && Ze.on(B, se),
  2259. ge.next && Ge.on(B, se),
  2260. ge.prevPage && Je.on(B, se),
  2261. ge.nextPage && Ke.on(B, se),
  2262. Ue.on(C, le),
  2263. Be[0] && Be.on(B, ce),
  2264. Re && ge.activateOn && be.on(ge.activateOn + "." + g, "*", ue),
  2265. De[0] && ge.activatePageOn && De.on(ge.activatePageOn + "." + g, "*", fe),
  2266. We.on(P, {
  2267. source: "slidee"
  2268. }, te),
  2269. Se && Se.on(P, {
  2270. source: "handle"
  2271. }, te),
  2272. b.on("keydown", de),
  2273. we || (be.on("mouseenter." + g + " mouseleave." + g, ve),
  2274. be.on("scroll." + g, o)),
  2275. ye.initialized = 1,
  2276. H(!0),
  2277. ge.cycleBy && !we && ye[ge.startPaused ? "pause" : "resume"](),
  2278. ye
  2279. }
  2280. }
  2281. }
  2282. function i(e) {
  2283. return null == e ? String(e) : "object" == typeof e || "function" == typeof e ? Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase() || "object" : typeof e
  2284. }
  2285. function r(e, t) {
  2286. e.preventDefault(),
  2287. t && e.stopPropagation()
  2288. }
  2289. function s(t) {
  2290. r(t, 1),
  2291. e(this).off(t.type, s)
  2292. }
  2293. function o() {
  2294. this.scrollLeft = 0,
  2295. this.scrollTop = 0
  2296. }
  2297. function l(e) {
  2298. return !isNaN(parseFloat(e)) && isFinite(e)
  2299. }
  2300. function c(e, t) {
  2301. return 0 | E(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2302. }
  2303. function d(e, t, a) {
  2304. return t > e ? t : e > a ? a : e
  2305. }
  2306. function u(e) {
  2307. var t = {};
  2308. return t.style = {},
  2309. t.save = function() {
  2310. if (e && e.nodeType) {
  2311. for (var a = 0; a < arguments.length; a++)
  2312. t.style[arguments[a]] = e.style[arguments[a]];
  2313. return t
  2314. }
  2315. }
  2316. ,
  2317. t.restore = function() {
  2318. if (e && e.nodeType) {
  2319. for (var a in t.style)
  2320. t.style.hasOwnProperty(a) && (e.style[a] = t.style[a]);
  2321. return t
  2322. }
  2323. }
  2324. ,
  2325. t
  2326. }
  2327. var f, v, p, h = "sly", m = "Sly", g = h, y = t.cancelAnimationFrame || t.cancelRequestAnimationFrame, w = t.requestAnimationFrame, b = e(document), P = "touchstart." + g + " mousedown." + g, I = "mousemove." + g + " mouseup." + g, z = "touchmove." + g + " touchend." + g, C = (document.implementation.hasFeature("Event.wheel", "3.0") ? "wheel." : "mousewheel.") + g, B = "click." + g, S = "mousedown." + g, k = ["INPUT", "SELECT", "BUTTON", "TEXTAREA"], T = [], x = Math.abs, D = Math.sqrt, A = Math.pow, E = Math.round, q = Math.max, N = Math.min, O = 0;
  2328. b.on(C, function(e) {
  2329. var t = e.originalEvent[g]
  2330. , a = +new Date;
  2331. (!t || t.options.scrollHijack < a - O) && (O = a)
  2332. }),
  2333. function(e) {
  2334. function t(e) {
  2335. var t = (new Date).getTime()
  2336. , n = Math.max(0, 16 - (t - a))
  2337. , i = setTimeout(e, n);
  2338. return a = t,
  2339. i
  2340. }
  2341. w = e.requestAnimationFrame || e.webkitRequestAnimationFrame || t;
  2342. var a = (new Date).getTime()
  2343. , n = e.cancelAnimationFrame || e.webkitCancelAnimationFrame || e.clearTimeout;
  2344. y = function(t) {
  2345. n.call(e, t)
  2346. }
  2347. }(window),
  2348. function() {
  2349. function e(e) {
  2350. for (var n = 0, i = t.length; i > n; n++) {
  2351. var r = t[n] ? t[n] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2352. if (null != a.style[r])
  2353. return r
  2354. }
  2355. }
  2356. var t = ["", "webkit", "moz", "ms", "o"]
  2357. , a = document.createElement("div");
  2358. f = e("transform"),
  2359. v = e("perspective") ? "translateZ(0) " : ""
  2360. }(),
  2361. t[m] = n,
  2362. e.fn[h] = function(t, a) {
  2363. var r, s;
  2364. return e.isPlainObject(t) || (("string" === i(t) || t === !1) && (r = t === !1 ? "destroy" : t,
  2365. s = Array.prototype.slice.call(arguments, 1)),
  2366. t = {}),
  2367. this.each(function(i, o) {
  2368. var l = e.data(o, g);
  2369. l || r ? l && r && l[r] && l[r].apply(l, s) : l = e.data(o, g, new n(o,t,a).init())
  2370. })
  2371. }
  2372. ,
  2373. n.defaults = {
  2374. slidee: null,
  2375. horizontal: !1,
  2376. itemNav: null,
  2377. itemSelector: null,
  2378. smart: !1,
  2379. activateOn: null,
  2380. activateMiddle: !1,
  2381. scrollSource: null,
  2382. scrollBy: 0,
  2383. scrollHijack: 300,
  2384. scrollTrap: !1,
  2385. dragSource: null,
  2386. mouseDragging: !1,
  2387. touchDragging: !1,
  2388. releaseSwing: !1,
  2389. swingSpeed: .2,
  2390. elasticBounds: !1,
  2391. interactive: null,
  2392. scrollBar: null,
  2393. dragHandle: !1,
  2394. dynamicHandle: !1,
  2395. minHandleSize: 50,
  2396. clickBar: !1,
  2397. syncSpeed: .5,
  2398. pagesBar: null,
  2399. activatePageOn: null,
  2400. pageBuilder: function(e) {
  2401. return "<li>" + (e + 1) + "</li>"
  2402. },
  2403. forward: null,
  2404. backward: null,
  2405. prev: null,
  2406. next: null,
  2407. prevPage: null,
  2408. nextPage: null,
  2409. cycleBy: null,
  2410. cycleInterval: 5e3,
  2411. pauseOnHover: !1,
  2412. startPaused: !1,
  2413. moveBy: 300,
  2414. speed: 0,
  2415. easing: "swing",
  2416. startAt: null,
  2417. keyboardNavBy: null,
  2418. draggedClass: "dragged",
  2419. activeClass: "active",
  2420. disabledClass: "disabled"
  2421. }
  2422. }(jQuery, window);
  2423. !function e(t, i, n) {
  2424. function r(a, s) {
  2425. if (!i[a]) {
  2426. if (!t[a]) {
  2427. var l = "function" == typeof require && require;
  2428. if (!s && l)
  2429. return l(a, !0);
  2430. if (o)
  2431. return o(a, !0);
  2432. var c = new Error("Cannot find module '" + a + "'");
  2433. throw c.code = "MODULE_NOT_FOUND",
  2434. c
  2435. }
  2436. var h = i[a] = {
  2437. exports: {}
  2438. };
  2439. t[a][0].call(h.exports, function(e) {
  2440. var i = t[a][1][e];
  2441. return r(i ? i : e)
  2442. }, h, h.exports, e, t, i, n)
  2443. }
  2444. return i[a].exports
  2445. }
  2446. for (var o = "function" == typeof require && require, a = 0; a < n.length; a++)
  2447. r(n[a]);
  2448. return r
  2449. }({
  2450. 1: [function(e, t, i) {
  2451. (function(i) {
  2452. "use strict";
  2453. function n(e) {
  2454. this.player = null,
  2455. this.director = null,
  2456. this.modelManager = null,
  2457. this.container = null,
  2458. this.tagManager = null,
  2459. this.fadeInSpeed = e,
  2460. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2461. }
  2462. var r = e("three")
  2463. , o = e("./util/logger")
  2464. , a = (e("./util/common"),
  2465. e("./enum/PlayerEvents"))
  2466. , s = e("./enum/DirectorEvents")
  2467. , l = e("./settings")
  2468. , c = e("./enum/Viewmode")
  2469. , h = (e("./enum/WarpStyle"),
  2470. e("./enum/BlackoutStyle"),
  2471. e("./enum/ModelManagerEvents"))
  2472. , u = e("./enum/tagEvents")
  2473. , d = e("./util/transitions")
  2474. , p = e("./util/lerp")
  2475. , f = new o(i);
  2476. window.THREE = r;
  2477. n.prototype.init = function(e, t, i, n, r) {
  2478. window.app = this;
  2479. this.player = t,
  2480. this.director = e,
  2481. this.modelManager = i,
  2482. this.tagManager = n,
  2483. this.container = r,
  2484. this.updateModel(),
  2485. this.bindEvents()
  2486. }
  2487. ,
  2488. n.prototype.bindEvents = function() {
  2489. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  2490. this.player.on(a.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2491. this.player.on(a.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2492. this.player.on(a.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2493. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  2494. this.player.on(a.StartOutside, this.handleStartOutside.bind(this)),
  2495. this.player.on(a.WarpStarted, this.handleWarpStarted.bind(this)),
  2496. this.director.on(s.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2497. this.tagManager.on(u.TagActivated, this.ontagActivated.bind(this)),
  2498. this.tagManager.on(u.TagNavigation, this.onNavigationTotag.bind(this))
  2499. }
  2500. ,
  2501. n.prototype.updateModel = function() {
  2502. //模型this.model
  2503. this.model = this.modelManager.getActiveModel()
  2504. }
  2505. ,
  2506. n.prototype.handleWarpStarted = function() {
  2507. this.hidePlayerReticule()
  2508. }
  2509. ,
  2510. n.prototype.ontagActivated = function() {
  2511. this.hidePlayerReticule()
  2512. }
  2513. ,
  2514. n.prototype.onNavigationTotag = function() {
  2515. this.hidePlayerReticule()
  2516. }
  2517. ,
  2518. n.prototype.handlePlayerModeChanging = function(e, t, i) {
  2519. var n = this.modelManager.getActiveModel()
  2520. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : l[t].markerOpacity;
  2521. n.fadePanoMarkers(r),
  2522. n.setMode(t)
  2523. }
  2524. ,
  2525. n.prototype.handlePlayerModeChanged = function(e, t) {
  2526. var i = this.modelManager.getActiveModel()
  2527. , n = t === c.PANORAMA ? r.DoubleSide : r.FrontSide;
  2528. i.setSide(n),
  2529. i.setMode(t)
  2530. }
  2531. ,
  2532. n.prototype.handleClosestPanoChanging = function(e, t, i) {
  2533. i !== c.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2534. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2535. }
  2536. ,
  2537. n.prototype.handleActionInterruption = function() {}
  2538. ,
  2539. n.prototype.handleStartInside = function(e) {
  2540. var t = l[this.player.mode]
  2541. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2542. this.fadeIn(this.fadeInSpeed),
  2543. this.model.alpha = 0,
  2544. this.model.skybox.material.uniforms.opacity.value = 1,
  2545. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2546. var n = this.player.reticule;
  2547. d.start(p.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2548. }
  2549. ,
  2550. n.prototype.handleStartOutside = function(e) {
  2551. this.fadeIn(e)
  2552. }
  2553. ,
  2554. n.prototype.fadeIn = function(e) {
  2555. null !== e && void 0 !== e || (e = 2e3,
  2556. f.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2557. $(this.container).fadeIn(e)
  2558. }
  2559. ,
  2560. n.prototype.hidePlayerReticule = function() {
  2561. this.player.reticule.hide()
  2562. }
  2563. ,
  2564. t.exports = n
  2565. }
  2566. ).call(this, "/js/DisplayController.js")
  2567. }
  2568. , {
  2569. "./enum/BlackoutStyle": 18,
  2570. "./enum/DirectorEvents": 23,
  2571. "./enum/tagEvents": 32,
  2572. "./enum/ModelManagerEvents": 33,
  2573. "./enum/PlayerEvents": 40,
  2574. "./enum/Viewmode": 51,
  2575. "./enum/WarpStyle": 52,
  2576. "./settings": 166,
  2577. "./util/common": 185,
  2578. "./util/lerp": 188,
  2579. "./util/logger": 189,
  2580. "./util/transitions": 195,
  2581. three: 217
  2582. }],
  2583. 2: [function(e, t, i) {
  2584. "use strict";
  2585. function n() {
  2586. this.baseStartTime = performance.timing.navigationStart,
  2587. this.loadingStartTime = null,
  2588. this.waitingStartTime = null,
  2589. this.appReadyTime = null
  2590. }
  2591. n.prototype.setBaseStartTime = function(e) {
  2592. this.baseStartTime = e || Date.now()
  2593. }
  2594. ,
  2595. n.prototype.setWaitingStartTime = function(e) {
  2596. this.waitingStartTime = e || Date.now()
  2597. }
  2598. ,
  2599. n.prototype.setLoadingStartTime = function(e) {
  2600. this.loadingStartTime = e || Date.now()
  2601. }
  2602. ,
  2603. n.prototype.setAppReadyTime = function(e) {
  2604. this.appReadyTime = e || Date.now()
  2605. }
  2606. ,
  2607. n.prototype.calcFullLoadingTime = function() {
  2608. var e = this.appReadyTime - this.baseStartTime;
  2609. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2610. e
  2611. }
  2612. ,
  2613. t.exports = n
  2614. }
  2615. , {}],
  2616. 3: [function(e, t, i) {
  2617. (function(i) {
  2618. "use strict";
  2619. function n() {
  2620. return 100 * Math.random()
  2621. }
  2622. var r = e("./util/logger")
  2623. , o = e("./util/browser")
  2624. , a = new r(i)
  2625. , s = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2626. initialized: !1,
  2627. init: function(e, t) {
  2628. if (t = t || {},
  2629. !this.initialized) {
  2630. this.initialized = !0,
  2631. o.valueFromHash("tilegen") && (t.tilegen = 1 === o.valueFromHash("tilegen", 0)),
  2632. o.valueFromHash("imgopt") && (t.imgopt = 1 === o.valueFromHash("imgopt", 0));
  2633. for (var i in e) {
  2634. var r = i.match("^sc_tilegen_([0-9]+)$");
  2635. r && (s.tilegen = n() < parseInt(r[1]));
  2636. var l = i.match("^sc_imgopt_([0-9]+)$");
  2637. l && (s.imgopt = n() < parseInt(l[1]))
  2638. }
  2639. for (var c in t)
  2640. s[c] = t[c],
  2641. a.debug("A/B override:", c, s[c])
  2642. }
  2643. },
  2644. changeIfTileGenerating: function(e) {
  2645. return s.tilegen && (e += e.indexOf("?") === -1 ? "?" : "&",
  2646. e += ""),
  2647. e
  2648. },
  2649. changeIfImageOptimzing: function(e) {
  2650. return s.imgopt && e.indexOf("imgopt=1") === -1 && (e += e.indexOf("?") === -1 ? "?" : "&",
  2651. e += ""),
  2652. e
  2653. },
  2654. tilegen: !1,
  2655. imgopt: !1
  2656. };
  2657. t.exports = s
  2658. }
  2659. ).call(this, "/js/ab.js")
  2660. }
  2661. , {
  2662. "./util/browser": 182,
  2663. "./util/logger": 189
  2664. }],
  2665. 4: [function(e, t, i) {
  2666. (function(i) {
  2667. "use strict";
  2668. function n() {
  2669. return {
  2670. addons: [{
  2671. name: "keen:ua_parser",
  2672. input: {
  2673. ua_string: "user_agent"
  2674. },
  2675. output: "parsed_user_agent"
  2676. }]
  2677. }
  2678. }
  2679. function r(e, t, i, n) {
  2680. function r(t) {
  2681. l[t.sid] = !0;
  2682. var i = t.billboard.media && t.billboard.media.type
  2683. , n = {
  2684. tag_id: t.sid,
  2685. tags_visited: Object.keys(l).length,
  2686. tag_count: Object.keys(e.tags).length,
  2687. tag_view_count: ++E,
  2688. has_media: !!i
  2689. };
  2690. i && (n.media_type = i),
  2691. u("tag_opened", n)
  2692. }
  2693. var l = {}
  2694. , h = Date.now() - N
  2695. , f = null;
  2696. n && (f = Date.now() - window.navigationStart);
  2697. var g;
  2698. try {
  2699. g = /* e.data.player_options.highlight_reel && */ e.heroLocations.length > 0
  2700. } catch (e) {
  2701. g = !1
  2702. }
  2703. var v, A = e.supportsVR;
  2704. A || (v = "VR disabled at the model/account level",
  2705. m.valueFromHash("vr") === _.NONE ? v = "VR disabled, using &vr=0" : m.detectAndroid() ? b.isDeviceSupported(w.Android) || (v = "VR disabled, unsupported Android version") : m.detectIOS() && (b.isDeviceSupported(w.IOS) || (v = "VR disabled, unsupported iOS version"))),
  2706. u("model_loaded", {
  2707. duration: h,
  2708. duration_from_navigation_start: f,
  2709. has_hlr: g,
  2710. has_vr: A,
  2711. vr_reason: v
  2712. });
  2713. var I = 0;
  2714. e.panos.forEach(function(e) {
  2715. e.on("enter", function() {
  2716. c("pano_viewed", {
  2717. pano_id: e.id,
  2718. pano_view_count: ++I,
  2719. alignment_type: e.alignmentType,
  2720. interaction_source: O,
  2721. navigation_source: p
  2722. })
  2723. })
  2724. });
  2725. var E = 0;
  2726. for (var T in e.tags)
  2727. e.tags[T].billboard.on(M.OPENED, r.bind(this, e.tags[T]));
  2728. t.on("tour_auto", function(e) {
  2729. p = "tour_" + e
  2730. }),
  2731. t.on("tour_manual", function(e) {
  2732. O = "gui-" + e,
  2733. p = "tour_manual"
  2734. }),
  2735. i.on(C.InteractionKey, function() {
  2736. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionKey)
  2737. }),
  2738. i.on(C.InteractionDirect, function() {
  2739. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionDirect)
  2740. }),
  2741. o(t),
  2742. a(),
  2743. s()
  2744. }
  2745. function o(e) {
  2746. I.on(T.OPENED, function() {
  2747. c("showcase_share_intent", {
  2748. pano_id: e.currentPano && e.currentPano.id
  2749. })
  2750. }),
  2751. I.on(T.LINK_CLICKED, function(t) {
  2752. c("showcase_share_action", {
  2753. channel: t.channel,
  2754. pano_id: e.currentPano && e.currentPano.id
  2755. })
  2756. }),
  2757. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2758. c("showcase_share_origin_link_clicked")
  2759. })
  2760. }
  2761. function a() {}
  2762. function s() {
  2763. b.on(S.OPENED, c.bind(this, "showcase_gui", {
  2764. gui_action: "click_vr_button"
  2765. })),
  2766. b.on(S.LAUNCH, function(e) {
  2767. c("showcase_gui", {
  2768. gui_action: "launch_vr",
  2769. vr_platform: e.vr_platform,
  2770. vr_app: e.vr_app
  2771. })
  2772. }),
  2773. b.on(S.PREV, c.bind(this, "showcase_gui", {
  2774. gui_action: "vr_modal_prev"
  2775. })),
  2776. b.on(S.NEXT, function(e) {
  2777. c("showcase_gui", {
  2778. gui_action: e.nextAction
  2779. })
  2780. }),
  2781. b.on(S.CLOSED, c.bind(this, "showcase_gui", {
  2782. gui_action: "vr_modal_close"
  2783. })),
  2784. b.on(S.falseICECHOSEN, function(e) {
  2785. c("showcase_gui", {
  2786. gui_action: e.name + " "
  2787. })
  2788. }),
  2789. b.on(S.STORE, function(e) {
  2790. c("showcase_gui", {
  2791. gui_action: "launch_store",
  2792. store: e
  2793. })
  2794. })
  2795. }
  2796. function l(e, t) {
  2797. if (f)
  2798. try {
  2799. f.addEvent(e, v.extendObject({
  2800. host: window.location.host,
  2801. keen: n(),
  2802. user_agent: "${keen.user_agent}",
  2803. referrer: {
  2804. url: v.normalizeUrl(document.referrer),
  2805. domain: v.domainFromUrl(document.referrer),
  2806. url_original: document.referrer
  2807. },
  2808. embedded: m.inIframe(),
  2809. is_mobile: m.isMobile(),
  2810. version: "2.25.6-0-gd87e5b1"
  2811. }, t))
  2812. } catch (e) {
  2813. P.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2814. }
  2815. }
  2816. function c(e, t) {
  2817. if (t = t || {},
  2818. L)
  2819. try {
  2820. window.analytics.track(e, v.extendObject(t, B), {
  2821. context: {
  2822. app: {
  2823. name: "showcase",
  2824. version: "2.25.6-0-gd87e5b1"
  2825. },
  2826. screen: {
  2827. width: window.screen.width,
  2828. height: window.screen.height,
  2829. density: window.devicePixelRatio
  2830. }
  2831. }
  2832. })
  2833. } catch (t) {
  2834. console.warn("Failed to send data to segment for " + e)
  2835. }
  2836. }
  2837. function h(e, t) {
  2838. if (t = t || {},
  2839. navigator.sendBeacon && L)
  2840. try {
  2841. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2842. event: e,
  2843. anonymousId: window.analytics.user().anonymousId(),
  2844. properties: v.extendObject(t, B),
  2845. writeKey: L,
  2846. sentAt: Date.now(),
  2847. type: "track",
  2848. context: {
  2849. userAgent: m.userAgent(),
  2850. library: {
  2851. name: "showcase-beacon",
  2852. version: "2.25.6-0-gd87e5b1"
  2853. },
  2854. app: {
  2855. name: "showcase",
  2856. version: "2.25.6-0-gd87e5b1"
  2857. }
  2858. }
  2859. }))
  2860. } catch (e) {
  2861. console.warn("Failed to send async segment request")
  2862. }
  2863. }
  2864. function u(e, t) {
  2865. t = t || {},
  2866. c(e, t)
  2867. }
  2868. function d(e, t) {
  2869. O = e === C.InteractionGui ? "gui-" + t : e,
  2870. p = "self_guided"
  2871. }
  2872. var p, f, g = (e("three"),
  2873. e("./util/ajax"),
  2874. e("./ab")), m = e("./util/browser"), v = e("./util/common"), A = e("./settings"), y = (e("./localization/localize"),
  2875. e("./enum/Viewmode")), C = e("./enum/ControlEvents"), I = e("./gui/sharing/modal"), E = e("./gui/title/titleBar"), b = e("./gui/vr/vrModal"), w = e("./enum/VRPlatforms"), _ = e("./enum/VROption"), T = e("./gui/sharing/ShareEvents"), x = e("./gui/title/TitleEvents"), S = e("./gui/vr/vrEvent"), M = e("./tag/Billboard/BillboardEvent"), R = e("./util/logger"), P = new R(i), O = (e("./enum/PlayerEvents"),
  2876. "direct"), L = null, D = !1, N = null, B = null, F = v.uuid4();
  2877. t.exports = {
  2878. report: function(e, t, i, n) {
  2879. l("Session starts", {
  2880. model: e,
  2881. status: t,
  2882. loadtime: Date.now() - (N || Date.now()),
  2883. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2884. autoplay: i,
  2885. quickstart: n,
  2886. ab_tilegen: g.tilegen,
  2887. ab_imgopt: g.imgopt
  2888. })
  2889. },
  2890. impression: function(e) {
  2891. e = e || {};
  2892. var t = void 0 === e.isVisible || e.isVisible
  2893. , i = (void 0 !== e.immediate && e.immediate,
  2894. window.location.search.substr(1).split("&"));
  2895. u("impression", {
  2896. visible: t,
  2897. url_params: i
  2898. })
  2899. },
  2900. initKeen: function(e) {
  2901. return e.token && e.appId ? void (f = new Keen({
  2902. projectId: e.appId,
  2903. writeKey: e.token,
  2904. readKey: "",
  2905. requestType: "xhr"
  2906. })) : void P.warn("no keen token/appId")
  2907. },
  2908. initSegment: function(e) {
  2909. return e.token ? (L = e.token,
  2910. window.analytics.load(e.token),
  2911. B = {
  2912. model_id: e.model,
  2913. start_source: e.startSource,
  2914. autoplay: e.autoplay,
  2915. quickstart: e.quickstart,
  2916. language_tag: A.languageTag,
  2917. is_mobile: m.isMobile(),
  2918. iframe: m.inIframe(),
  2919. aspect_ratio: m.aspectRatio(),
  2920. session_id: F,
  2921. window: {
  2922. width: $("#player").width(),
  2923. height: $("#player").height()
  2924. },
  2925. platform: {
  2926. browser: {
  2927. name: $.ua.browser.name,
  2928. major: $.ua.browser.major,
  2929. version: $.ua.browser.version
  2930. },
  2931. os: {
  2932. name: $.ua.os.name,
  2933. version: $.ua.os.version
  2934. },
  2935. device: {
  2936. vendor: $.ua.device.vendor,
  2937. model: $.ua.device.model,
  2938. type: $.ua.device.type
  2939. }
  2940. }
  2941. },
  2942. D = Math.random() < A.analytics.sessionTrackingRate,
  2943. P.debug("tracking sample rate = " + A.analytics.sessionTrackingRate),
  2944. void P.debug("tracking this session = " + D)) : void P.warn("no segment token")
  2945. },
  2946. sessionStart: function(e) {
  2947. P.debug("analytics user_session_start"),
  2948. c("session_started"),
  2949. N = Date.now(),
  2950. window.addEventListener("unload", function() {
  2951. h("session_ended", {
  2952. duration: Date.now() - N
  2953. })
  2954. })
  2955. },
  2956. modelLoaded: function(e, t, i, n) {
  2957. r(e, t, i, n)
  2958. },
  2959. loadComplete: function(e) {
  2960. var t = {
  2961. time_to_app_start: e
  2962. };
  2963. c("load_times", t)
  2964. },
  2965. track: function(e, t) {
  2966. D && (P.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  2967. c(e, t))
  2968. },
  2969. trackAlways: function(e, t) {
  2970. P.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  2971. c(e, t)
  2972. },
  2973. getSessionId: function() {
  2974. return F
  2975. },
  2976. updateInteraction: d
  2977. }
  2978. }
  2979. ).call(this, "/js/analytics.js")
  2980. }
  2981. , {
  2982. "./ab": 3,
  2983. "./enum/ControlEvents": 21,
  2984. "./enum/PlayerEvents": 40,
  2985. "./enum/VROption": 47,
  2986. "./enum/VRPlatforms": 49,
  2987. "./enum/Viewmode": 51,
  2988. "./gui/sharing/ShareEvents": 76,
  2989. "./gui/sharing/modal": 77,
  2990. "./gui/title/TitleEvents": 80,
  2991. "./gui/title/titleBar": 82,
  2992. "./gui/vr/vrEvent": 85,
  2993. "./gui/vr/vrModal": 87,
  2994. "./localization/localize": 108,
  2995. "./tag/Billboard/BillboardEvent": 120,
  2996. "./settings": 166,
  2997. "./util/ajax": 181,
  2998. "./util/browser": 182,
  2999. "./util/common": 185,
  3000. "./util/logger": 189,
  3001. three: 217
  3002. }],
  3003. 5: [function(e, t, i) {
  3004. "use strict";
  3005. function n() {
  3006. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  3007. this.controls = null
  3008. }
  3009. var r = e("three")
  3010. , o = e("../constants")
  3011. , a = e("../util/cameraLight");
  3012. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3013. n.prototype.updateAspect = function(e) {
  3014. this.aspect = e,
  3015. this.updateProjectionMatrix()
  3016. }
  3017. ,
  3018. t.exports = n
  3019. }
  3020. , {
  3021. "../constants": 8,
  3022. "../util/cameraLight": 184,
  3023. three: 217
  3024. }],
  3025. 6: [function(e, t, i) {
  3026. "use strict";
  3027. function n() {
  3028. var e = $("#player").width() / $("#player").height();
  3029. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  3030. this.controls = null,
  3031. this.updateAspect(e)
  3032. }
  3033. var r = e("three")
  3034. , o = e("../constants");
  3035. n.prototype = Object.create(r.OrthographicCamera.prototype),
  3036. n.prototype.updateAspect = function(e) {
  3037. this.aspect = e,
  3038. this.top = o.orthoBase / e,
  3039. this.bottom = -o.orthoBase / e,
  3040. this.updateProjectionMatrix()
  3041. }
  3042. ,
  3043. t.exports = n
  3044. }
  3045. , {
  3046. "../constants": 8,
  3047. three: 217
  3048. }],
  3049. 7: [function(e, t, i) {
  3050. "use strict";
  3051. function n() {
  3052. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  3053. this.controls = null
  3054. }
  3055. var r = e("three")
  3056. , o = e("../settings")
  3057. , a = e("../util/cameraLight");
  3058. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3059. n.prototype.updateAspect = function(e) {
  3060. this.aspect = e,
  3061. this.updateProjectionMatrix()
  3062. }
  3063. ,
  3064. t.exports = n
  3065. }
  3066. , {
  3067. "../settings": 166,
  3068. "../util/cameraLight": 184,
  3069. three: 217
  3070. }],
  3071. 8: [function(e, t, i) {
  3072. "use strict";
  3073. t.exports = {
  3074. signedUrlDefaultExpireTime: 24e4,
  3075. signedUrlCheckInterval: 1e4,
  3076. signedUrlRefreshBuffer: 15e3,
  3077. dollhouseFOV: 70,
  3078. dollhouseNear: 1,
  3079. dollhouseFar: 5e3,
  3080. insideFOV: 70,
  3081. insideFOVMax: 120,
  3082. insideNear: .1,
  3083. insideFar: 5e3,
  3084. insideLookSpeed: .12,
  3085. insideLookLimitUp: 40,
  3086. insideLookLimitDown: -40,
  3087. orthoNear: 1,
  3088. orthoFar: 5e3,
  3089. orthoBase: 10,
  3090. narrowLandscapeHeight: 290,
  3091. reallyNarrowLandscapeHeight: 250,
  3092. visionTilingStartDate: new Date("8/26/2016"),
  3093. visionTilingStartVersion: "1.1.407.13667",
  3094. windowHeightHighQualityThreshold: 900,
  3095. tourStepDelayDefault: 3500,
  3096. tourStepDelaySlideShow: 5e3,
  3097. workshopApsect: 9 / 16,
  3098. highQualityMaxZoom: 2,
  3099. ultraHighQualityMaxZoom: 3
  3100. }
  3101. }
  3102. , {}],
  3103. 9: [function(e, t, i) {
  3104. "use strict";
  3105. function n() {
  3106. this.activeControl = null,
  3107. this.controls = {},
  3108. this.cameras = {}
  3109. }
  3110. var r = e("./PanoramaControls")
  3111. , o = e("./DollhouseControls")
  3112. , a = e("./FloorplanControls")
  3113. , s = e("../cameras/PanoramaCamera")
  3114. , l = e("../cameras/DollhouseCamera")
  3115. , c = e("../cameras/FloorplanCamera")
  3116. , h = e("events").EventEmitter
  3117. , u = e("../enum/ControlEvents")
  3118. , d = e("../enum/ModelManagerEvents")
  3119. , p = e("../enum/Viewmode")
  3120. , f = e("../settings");
  3121. n.prototype = Object.create(h.prototype),
  3122. n.prototype.init = function(e, t) {
  3123. this.setUpControls(),
  3124. this.bindEvents(e, t)
  3125. }
  3126. ,
  3127. n.prototype.activateControls = function(e) {
  3128. this.activeControl && (this.activeControl.reset(),
  3129. this.activeControl.enabled = !1),
  3130. this.controls[e] && (this.controls[e].enabled = !0),
  3131. this.activeControl = this.controls[e]
  3132. }
  3133. ,
  3134. n.prototype.setUpControls = function() {
  3135. var e = {}
  3136. , t = {}
  3137. , i = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3138. , n = [s, l, c]
  3139. , h = [r, o, a];
  3140. i.forEach(function(i, r) {
  3141. e[i] = new n[r],
  3142. t[i] = new h[r](e[i]),
  3143. t[i].on(u.Move, this.emit.bind(this, u.Move)),
  3144. t[i].on(u.InputStart, this.emit.bind(this, u.InputStart)),
  3145. t[i].on(u.InteractionDirect, this.emit.bind(this, u.InteractionDirect)),
  3146. t[i].on(u.InteractionKey, this.emit.bind(this, u.InteractionKey)),
  3147. t[i].on(u.Pinch, this.emit.bind(this, u.Pinch)),
  3148. t[i].on(u.Scroll, this.emit.bind(this, u.Scroll))
  3149. }
  3150. .bind(this)),
  3151. this.controls = t,
  3152. this.cameras = e
  3153. }
  3154. ,
  3155. n.prototype.bindEvents = function(e, t) {
  3156. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3157. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3158. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3159. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3160. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this),{ passive: false }),
  3161. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3162. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3163. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3164. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3165. e.addEventListener("contextmenu", function(e) {
  3166. e.preventDefault()
  3167. }),
  3168. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3169. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3170. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3171. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3172. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3173. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3174. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3175. t.on(d.ActiveModelChanged, function(e) {
  3176. this.setModelForControls(e.model)
  3177. }
  3178. .bind(this))
  3179. }
  3180. ,
  3181. n.prototype.setModelForControls = function(e) {
  3182. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3183. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3184. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3185. this.controls[e].setBounds(t)
  3186. }
  3187. .bind(this))
  3188. }
  3189. ,
  3190. n.prototype.onMouseDown = function(e) {
  3191. e.preventDefault(),
  3192. this.activeControl && this.activeControl.onMouseDown(e)
  3193. }
  3194. ,
  3195. n.prototype.onMouseMove = function(e) {
  3196. e.preventDefault(),
  3197. this.activeControl && this.activeControl.onMouseMove(e)
  3198. }
  3199. ,
  3200. n.prototype.onMouseUp = function(e) {
  3201. e.preventDefault(),
  3202. this.activeControl && this.activeControl.onMouseUp(e)
  3203. }
  3204. ,
  3205. n.prototype.onMouseOver = function(e) {
  3206. e.preventDefault(),
  3207. this.activeControl && this.activeControl.onMouseOver(e)
  3208. }
  3209. ,
  3210. n.prototype.onMouseWheel = function(e) {
  3211. e.preventDefault(),
  3212. this.activeControl && this.activeControl.onMouseWheel(e)
  3213. }
  3214. ,
  3215. n.prototype.onTouchStart = function(e) {
  3216. e.preventDefault(),
  3217. this.activeControl && this.activeControl.onTouchStart(e);
  3218. var hotList = $('#hotListWrap')[0];
  3219. hotList.classList.remove('hotListActive');
  3220. $('#hotListContent ul .active').removeClass('active');
  3221. $('#hotList')[0].classList.remove('active')
  3222. }
  3223. ,
  3224. n.prototype.onTouchMove = function(e) {
  3225. e.preventDefault(),
  3226. this.activeControl && this.activeControl.onTouchMove(e)
  3227. }
  3228. ,
  3229. n.prototype.onTouchEnd = function(e) {
  3230. e.preventDefault(),
  3231. this.activeControl && this.activeControl.onTouchEnd(e)
  3232. }
  3233. ,
  3234. n.prototype.onPointerDown = function(e) {
  3235. if (e.preventDefault(),
  3236. this.activeControl)
  3237. switch (e.pointerType) {
  3238. case "mouse":
  3239. this.activeControl.onMouseDown(e);
  3240. break;
  3241. default:
  3242. this.activeControl.onPointerDown(e)
  3243. }
  3244. }
  3245. ,
  3246. n.prototype.onPointerMove = function(e) {
  3247. if (e.preventDefault(),
  3248. this.activeControl)
  3249. switch (e.pointerType) {
  3250. case "mouse":
  3251. this.activeControl.onMouseMove(e);
  3252. break;
  3253. default:
  3254. this.activeControl.onPointerMove(e)
  3255. }
  3256. }
  3257. ,
  3258. n.prototype.onPointerUp = function(e) {
  3259. if (e.preventDefault(),
  3260. this.activeControl)
  3261. switch (e.pointerType) {
  3262. case "mouse":
  3263. this.activeControl.onMouseUp(e);
  3264. break;
  3265. default:
  3266. this.activeControl.onPointerUp(e)
  3267. }
  3268. }
  3269. ,
  3270. n.prototype.onPointerCancel = function(e) {
  3271. e.preventDefault(),
  3272. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3273. }
  3274. ,
  3275. n.prototype.onKeyDown = function(e) {
  3276. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3277. this.activeControl && this.activeControl.onKeyDown(e))
  3278. }
  3279. ,
  3280. n.prototype.onKeyUp = function(e) {
  3281. e.preventDefault(),
  3282. this.activeControl && this.activeControl.onKeyUp(e)
  3283. }
  3284. ,
  3285. t.exports = n
  3286. }
  3287. , {
  3288. "../cameras/DollhouseCamera": 5,
  3289. "../cameras/FloorplanCamera": 6,
  3290. "../cameras/PanoramaCamera": 7,
  3291. "../enum/ControlEvents": 21,
  3292. "../enum/ModelManagerEvents": 33,
  3293. "../enum/Viewmode": 51,
  3294. "../settings": 166,
  3295. "./DollhouseControls": 10,
  3296. "./FloorplanControls": 11,
  3297. "./PanoramaControls": 13,
  3298. events: 202
  3299. }],
  3300. 10: [function(e, t, i) {
  3301. "use strict";
  3302. function n(e) {
  3303. a.call(this, e),
  3304. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3305. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3306. this.minDistance = o.dollhouseDefault.minDistance,
  3307. this.maxDistance = o.dollhouseDefault.maxDistance,
  3308. this.adjustedMinDistance = this.minDistance,
  3309. this.adjustedMaxDistance = this.maxDistance
  3310. }
  3311. var r = e("three")
  3312. , o = e("../settings")
  3313. , a = e("./OutsideControls");
  3314. n.prototype = Object.create(a.prototype),
  3315. n.prototype.pan = function(e, t) {
  3316. this.camera.updateMatrix();
  3317. var i = this.camera.position.clone().sub(this.target).length();
  3318. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3319. this.panLeft(2 * e * i / $("#player").height()),
  3320. this.panUp(-2 * t * i / $("#player").height())
  3321. }
  3322. ,
  3323. n.prototype.updateZoom = function() {
  3324. var e = this.offset.length();
  3325. return e * this.scale
  3326. }
  3327. ,
  3328. n.prototype.setZoomBounds = function(e) {
  3329. var t = e.min.distanceTo(e.max);
  3330. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3331. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3332. this.minDistance = this.adjustedMinDistance,
  3333. this.maxDistance = this.adjustedMaxDistance
  3334. }
  3335. ,
  3336. n.prototype.resetRanges = function(e, t) {
  3337. e ? (this.minDistance = Math.min(e, this.minDistance),
  3338. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3339. this.maxDistance = this.adjustedMaxDistance),
  3340. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3341. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3342. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3343. }
  3344. ,
  3345. n.prototype.toJSON = function() {
  3346. return a.prototype.toJSON.call(this)
  3347. }
  3348. ,
  3349. t.exports = n
  3350. }
  3351. , {
  3352. "../settings": 166,
  3353. "./OutsideControls": 12,
  3354. three: 217
  3355. }],
  3356. 11: [function(e, t, i) {
  3357. "use strict";
  3358. function n(e) {
  3359. a.call(this, e),
  3360. this.minDistance = 15,
  3361. this.maxDistance = 50,
  3362. this.noRotateUpDown = !0,
  3363. this.minPolarAngle = 0,
  3364. this.maxPolarAngle = 0,
  3365. this.mouseActions[l.LEFT] = s.PAN,
  3366. this.mouseActions[l.MIDDLE] = s.DOLLY,
  3367. this.mouseActions[l.RIGHT] = s.ROTATE,
  3368. this.touchActions[1] = s.PAN,
  3369. this.touchActions[2] = s.ROTATE_DOLLY,
  3370. this.absoluteScale = 1,
  3371. this.currentScale = 1
  3372. }
  3373. var r = e("three")
  3374. , o = e("../settings")
  3375. , a = e("./OutsideControls")
  3376. , s = e("../enum/ControlActions")
  3377. , l = e("../enum/MouseButton")
  3378. , c = e("../util/math")
  3379. , h = e("../util/browser");
  3380. n.prototype = Object.create(a.prototype),
  3381. n.prototype.zoomToContain = function(e) {
  3382. var t = Math.max(e.x, e.z)
  3383. , i = Math.min(e.x, e.z)
  3384. , n = Math.max(t, i * this.camera.aspect)
  3385. , r = Math.max(i, t * this.camera.aspect);
  3386. this.absoluteScale = (h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase * 1.2,
  3387. this.currentScale = this.absoluteScale
  3388. }
  3389. ,
  3390. n.prototype.rotateToView = function(e, t) {
  3391. var i = 0
  3392. , n = h.aspectRatio() < 1
  3393. , r = e.x < e.z;
  3394. n === r ? t.z > 0 && (i = Math.PI) : i = t.x > 0 ? Math.PI / 2 : -Math.PI / 2,
  3395. this.rotateLeft(i),
  3396. this.update(0)
  3397. }
  3398. ,
  3399. n.prototype.pan = function(e, t) {
  3400. this.camera.updateMatrix(),
  3401. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3402. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3403. }
  3404. ,
  3405. n.prototype.updateZoom = function() {
  3406. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3407. this.absoluteScale = Math.max(o.zoomNearLimit, Math.min(this.absoluteScale, o.zoomFarLimit)),
  3408. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3409. this.camera.left = -o.orthoBase * this.currentScale,
  3410. this.camera.right = o.orthoBase * this.currentScale,
  3411. this.camera.top = o.orthoBase * this.currentScale / this.camera.aspect,
  3412. this.camera.bottom = -o.orthoBase * this.currentScale / this.camera.aspect,
  3413. this.camera.updateProjectionMatrix(),
  3414. this.offset.length()
  3415. }
  3416. ,
  3417. n.prototype.toJSON = function() {
  3418. var e = new r.Quaternion
  3419. , t = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  3420. , i = new r.Quaternion;
  3421. return function() {
  3422. var n = a.prototype.toJSON.call(this);
  3423. return e.copy(n.camera_quaternion),
  3424. i.copy(t),
  3425. i.multiply(e),
  3426. n.camera_quaternion.x = c.toPrecision(i.x, 4),
  3427. n.camera_quaternion.y = c.toPrecision(i.y, 4),
  3428. n.camera_quaternion.z = c.toPrecision(i.z, 4),
  3429. n.camera_quaternion.w = c.toPrecision(i.w, 4),
  3430. n.ortho_zoom = c.toPrecision(this.currentScale * this.camera.aspect, 4),
  3431. n
  3432. }
  3433. }(),
  3434. t.exports = n
  3435. }
  3436. , {
  3437. "../enum/ControlActions": 20,
  3438. "../enum/MouseButton": 34,
  3439. "../settings": 166,
  3440. "../util/browser": 182,
  3441. "../util/math": 190,
  3442. "./OutsideControls": 12,
  3443. three: 217
  3444. }],
  3445. 12: [function(e, t, i) {
  3446. "use strict";
  3447. function n(e) {
  3448. this.camera = e,
  3449. this.camera.controls = this,
  3450. this.enabled = !1,
  3451. this.target = new r.Vector3,
  3452. this.targetBounds = new r.Box3,
  3453. this.zoomSpeed = 1,
  3454. this.minDistance = 0,
  3455. this.maxDistance = 1 / 0,
  3456. this.noRotateUpDown = !1,
  3457. this.rotateSpeed = 1,
  3458. this.keyboardZoomSpeed = 0,
  3459. this.keyPanSpeed = 7,
  3460. this.autoRotate = !1,
  3461. this.autoRotateSpeed = 2,
  3462. this.autoPan = !1,
  3463. this.autoPanPosition = new r.Vector3,
  3464. this.minPolarAngle = r.Math.degToRad(25),
  3465. this.maxPolarAngle = r.Math.degToRad(65),
  3466. this.rotationAcceleration = new r.Vector2,
  3467. this.rotationSpeed = new r.Vector2,
  3468. this.panAcceleration = new r.Vector2,
  3469. this.panSpeed = new r.Vector2,
  3470. this.rotateStart = new r.Vector2,
  3471. this.rotateEnd = new r.Vector2,
  3472. this.rotateDelta = new r.Vector2,
  3473. this.panStart = new r.Vector2,
  3474. this.panEnd = new r.Vector2,
  3475. this.panDelta = new r.Vector2,
  3476. this.panOffset = new r.Vector3,
  3477. this.offset = new r.Vector3,
  3478. this.dollyStart = new r.Vector2,
  3479. this.dollyEnd = new r.Vector2,
  3480. this.dollyDelta = new r.Vector2,
  3481. this.phiDelta = 0,
  3482. this.thetaDelta = 0,
  3483. this.scale = 1,
  3484. this.panVector = new r.Vector3,
  3485. this.lastPosition = new r.Vector3,
  3486. this.state = c.NONE,
  3487. this.mouseActions = {},
  3488. this.mouseActions[h.LEFT] = c.ROTATE,
  3489. this.mouseActions[h.MIDDLE] = c.DOLLY,
  3490. this.mouseActions[h.RIGHT] = c.PAN,
  3491. this.touchActions = {},
  3492. this.touchActions[1] = c.ROTATE,
  3493. this.touchActions[2] = c.PAN_DOLLY,
  3494. this.lastMoveTime = 0,
  3495. this.pointersLimit = 2,
  3496. this.pointers = []
  3497. }
  3498. var r = e("three")
  3499. , o = e("../settings")
  3500. , a = e("../util/common")
  3501. , s = e("../util/math")
  3502. , l = e("../enum/Vectors")
  3503. , c = e("../enum/ControlActions")
  3504. , h = e("../enum/MouseButton")
  3505. , u = e("../enum/Keys")
  3506. , d = e("../enum/ControlEvents")
  3507. , p = e("events").EventEmitter
  3508. , f = 1e-6;
  3509. n.prototype = Object.create(p.prototype),
  3510. n.prototype.setBounds = function(e) {
  3511. this.targetBounds = e
  3512. }
  3513. ,
  3514. n.prototype.isEngaged = function() {
  3515. return this.state !== c.NONE
  3516. }
  3517. ,
  3518. n.prototype.rotateLeft = function(e) {
  3519. void 0 === e && (e = this.getAutoRotationAngle()),
  3520. this.thetaDelta -= e
  3521. }
  3522. ,
  3523. n.prototype.rotateUp = function(e) {
  3524. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3525. this.phiDelta -= e)
  3526. }
  3527. ,
  3528. n.prototype.panLeft = function(e) {
  3529. var t = this.camera.matrix.elements;
  3530. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3531. this.panOffset.multiplyScalar(-e),
  3532. this.panVector.add(this.panOffset)
  3533. }
  3534. ,
  3535. n.prototype.panUp = function(e) {
  3536. var t = this.camera.matrix.elements;
  3537. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3538. this.panOffset.multiplyScalar(-e),
  3539. this.panVector.add(this.panOffset)
  3540. }
  3541. ,
  3542. n.prototype.startRotating = function(e, t) {
  3543. e && this.navRotationAcc("x", e),
  3544. t && this.navRotationAcc("y", t)
  3545. }
  3546. ,
  3547. n.prototype.stopRotating = function(e) {
  3548. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3549. this.navRotationAcc("x", 0),
  3550. this.navRotationAcc("y", 0)
  3551. }
  3552. ,
  3553. n.prototype.setAutoPanPosition = function(e, t) {
  3554. var i = new r.Vector3
  3555. , n = new r.Vector3;
  3556. return function(e, t) {
  3557. i.copy(this.camera.position),
  3558. void 0 === e && null === e || i.setX(e),
  3559. void 0 === t && null === t || i.setZ(t);
  3560. var r = this.camera.position.distanceTo(this.target)
  3561. , o = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3562. this.targetClamped = !1,
  3563. n.copy(i).addScaledVector(o, r),
  3564. this.targetBounds.containsPoint(n) || (this.targetBounds.clampPoint(n, n),
  3565. i.copy(n).addScaledVector(o, -r),
  3566. this.targetClamped = !0),
  3567. this.autoPanPosition.x = i.x,
  3568. this.autoPanPosition.z = i.z,
  3569. this.autoPan && this.stopAutoPanning()
  3570. }
  3571. }(),
  3572. n.prototype.stopAutoPanning = function() {
  3573. var e = this.autoPan;
  3574. this.autoPan = !1,
  3575. this.emit(this.targetClamped ? d.AutoPanClamped : e ? d.AutoPanInterrupt : d.AutoPanComplete)
  3576. }
  3577. ,
  3578. n.prototype.dollyIn = function(e) {
  3579. void 0 === e && (e = this.getZoomScale()),
  3580. this.scale /= e
  3581. }
  3582. ,
  3583. n.prototype.dollyOut = function(e) {
  3584. void 0 === e && (e = this.getZoomScale()),
  3585. this.scale *= e
  3586. }
  3587. ,
  3588. n.prototype.updatePan = function(e) {
  3589. if (this.panSpeed.multiplyScalar(1 - o.panFriction).addScaledVector(this.panAcceleration, o.panAccelerationOutside * e),
  3590. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3591. this.autoPan) {
  3592. var t = (new r.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3593. t.setY(0).clampLength(0, 50 * e),
  3594. this.target.add(t),
  3595. this.camera.position.add(t),
  3596. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3597. this.stopAutoPanning())
  3598. }
  3599. }
  3600. ,
  3601. n.prototype.update = function(e) {
  3602. e || (e = 1 / 60),
  3603. this.rotationSpeed.multiplyScalar(1 - o.rotationFriction).addScaledVector(this.rotationAcceleration, o.rotationAccelerationOutside * e),
  3604. this.rotateLeft(-this.rotationSpeed.x),
  3605. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3606. this.updatePan(e);
  3607. var t = this.camera.position;
  3608. this.offset.copy(t).sub(this.target);
  3609. var i = Math.atan2(this.offset.x, this.offset.z)
  3610. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3611. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3612. i += this.thetaDelta,
  3613. n += this.phiDelta,
  3614. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3615. n = Math.max(f, Math.min(Math.PI - f, n));
  3616. var r = this.updateZoom();
  3617. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3618. this.target.add(this.panVector),
  3619. this.targetBounds.clampPoint(this.target, this.target),
  3620. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3621. this.offset.y = r * Math.cos(n),
  3622. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3623. t.copy(this.target).add(this.offset),
  3624. this.camera.lookAt(this.target),
  3625. this.thetaDelta = 0,
  3626. this.phiDelta = 0,
  3627. this.scale = 1,
  3628. this.panVector.set(0, 0, 0),
  3629. this.lastPosition.distanceTo(this.camera.position) > 0 && this.lastPosition.copy(this.camera.position)
  3630. }
  3631. ,
  3632. n.prototype.getAutoRotationAngle = function() {
  3633. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3634. }
  3635. ,
  3636. n.prototype.getZoomScale = function() {
  3637. return Math.pow(.95, this.zoomSpeed)
  3638. }
  3639. ,
  3640. n.prototype.onMouseDown = function(e) {
  3641. if (this.enabled) {
  3642. switch (e.preventDefault(),
  3643. this.stopAutoPanning(),
  3644. this.mouseDown = !0,
  3645. this.state = this.mouseActions[e.button],
  3646. this.state) {
  3647. case c.ROTATE:
  3648. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3649. this.rotationSpeed.set(0, 0);
  3650. break;
  3651. case c.DOLLY:
  3652. this.dollyStart.set(e.clientX, e.clientY);
  3653. break;
  3654. case c.PAN:
  3655. this.panStart.set(e.clientX, e.clientY)
  3656. }
  3657. this.emit(d.InputStart, "mouse")
  3658. }
  3659. }
  3660. ,
  3661. n.prototype.onMouseMove = function(e) {
  3662. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3663. switch (e.preventDefault(),
  3664. this.state) {
  3665. case c.ROTATE:
  3666. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3667. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3668. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3669. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3670. this.rotateStart.copy(this.rotateEnd);
  3671. break;
  3672. case c.DOLLY:
  3673. this.dollyEnd.set(e.clientX, e.clientY),
  3674. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart);
  3675. var t = this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut;
  3676. t.call(this),
  3677. this.dollyStart.copy(this.dollyEnd);
  3678. break;
  3679. case c.PAN:
  3680. this.panEnd.set(e.clientX, e.clientY),
  3681. this.panDelta.subVectors(this.panEnd, this.panStart),
  3682. this.pan(this.panDelta.x, this.panDelta.y),
  3683. this.panStart.copy(this.panEnd)
  3684. }
  3685. this.emit(d.Move, "mouse"),
  3686. this.lastMoveTime = e.timeStamp,
  3687. this.update()
  3688. }
  3689. }
  3690. ,
  3691. n.prototype.onMouseUp = function(e) {
  3692. this.enabled && (this.mouseDown = !1,
  3693. this.state = c.NONE,
  3694. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3695. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3696. this.update(),
  3697. this.rotationAcceleration.set(0, 0),
  3698. this.rotateDelta.set(0, 0)))
  3699. }
  3700. ,
  3701. n.prototype.onMouseOver = function(e) {
  3702. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3703. }
  3704. ,
  3705. n.prototype.onMouseWheel = function(e) {
  3706. if (this.enabled && o.useWheel) {
  3707. this.emit(d.Move, "wheel");
  3708. var t = e.wheelDelta || -e.detail
  3709. , i = t > 0 ? this.dollyOut : this.dollyIn;
  3710. i.call(this),
  3711. this.update()
  3712. }
  3713. }
  3714. ,
  3715. n.prototype.onKeyDown = function(e) {
  3716. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3717. this.handleKeyDown(e.which)))
  3718. }
  3719. ,
  3720. n.prototype.navRotationAcc = function(e, t) {
  3721. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3722. }
  3723. ,
  3724. n.prototype.navPanAcc = function(e, t) {
  3725. this.stopAutoPanning(),
  3726. this.panAcceleration[e] = t
  3727. }
  3728. ,
  3729. n.prototype.handleKeyDown = function(e) {
  3730. var t = !0;
  3731. switch (e) {
  3732. case u.UPARROW:
  3733. case u.I:
  3734. this.navRotationAcc("y", 1);
  3735. break;
  3736. case u.DOWNARROW:
  3737. case u.K:
  3738. this.navRotationAcc("y", -1);
  3739. break;
  3740. case u.LEFTARROW:
  3741. case u.J:
  3742. this.navRotationAcc("x", -1);
  3743. break;
  3744. case u.RIGHTARROW:
  3745. case u.L:
  3746. this.navRotationAcc("x", 1);
  3747. break;
  3748. case u.W:
  3749. this.navPanAcc("y", 1);
  3750. break;
  3751. case u.S:
  3752. this.navPanAcc("y", -1);
  3753. break;
  3754. case u.A:
  3755. this.navPanAcc("x", -1);
  3756. break;
  3757. case u.D:
  3758. this.navPanAcc("x", 1);
  3759. break;
  3760. default:
  3761. t = !1
  3762. }
  3763. t && this.emit(d.Move, "key")
  3764. }
  3765. ,
  3766. n.prototype.onKeyUp = function(e) {
  3767. this.enabled && (e.preventDefault(),
  3768. e.stopPropagation(),
  3769. this.handleKeyUp(e.which))
  3770. }
  3771. ,
  3772. n.prototype.handleKeyUp = function(e) {
  3773. switch (e) {
  3774. case u.I:
  3775. case u.K:
  3776. case u.UPARROW:
  3777. case u.DOWNARROW:
  3778. this.keyboardZoomSpeed = 0,
  3779. this.rotationAcceleration.y = 0;
  3780. break;
  3781. case u.J:
  3782. case u.L:
  3783. case u.LEFTARROW:
  3784. case u.RIGHTARROW:
  3785. this.rotationAcceleration.x = 0;
  3786. break;
  3787. case u.S:
  3788. case u.W:
  3789. this.panAcceleration.y = 0;
  3790. break;
  3791. case u.A:
  3792. case u.D:
  3793. this.panAcceleration.x = 0
  3794. }
  3795. }
  3796. ,
  3797. n.prototype.onTouchStart = function(e) {
  3798. if (this.enabled || this.state === c.NONE) {
  3799. e.preventDefault(),
  3800. e.stopPropagation(),
  3801. this.stopAutoPanning();
  3802. var t = function() {
  3803. if (2 === e.touches.length) {
  3804. var t = e.touches[0].pageX - e.touches[1].pageX
  3805. , i = e.touches[0].pageY - e.touches[1].pageY;
  3806. this.dollyStart.set(t, i)
  3807. }
  3808. }
  3809. .bind(this)
  3810. , i = function() {
  3811. this.panStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3812. }
  3813. .bind(this)
  3814. , n = function() {
  3815. this.rotateStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3816. }
  3817. .bind(this);
  3818. switch (this.state = this.touchActions[e.touches.length],
  3819. this.state) {
  3820. case c.PAN_DOLLY:
  3821. t();
  3822. case c.PAN:
  3823. i();
  3824. break;
  3825. case c.ROTATE_DOLLY:
  3826. t();
  3827. case c.ROTATE:
  3828. n()
  3829. }
  3830. this.rotationSpeed.set(0, 0),
  3831. this.emit(d.InputStart, "touch")
  3832. }
  3833. }
  3834. ,
  3835. n.prototype.onTouchMove = function(e) {
  3836. if (this.enabled && this.state !== c.NONE) {
  3837. e.preventDefault(),
  3838. e.stopPropagation();
  3839. var t = function() {
  3840. var t = e.touches[0].pageX - e.touches[1].pageX
  3841. , i = e.touches[0].pageY - e.touches[1].pageY;
  3842. this.dollyEnd.set(t, i);
  3843. var n = this.dollyStart.length() - this.dollyEnd.length();
  3844. n > 0 ? this.dollyOut(1 + n / 500) : this.dollyIn(1 - n / 500),
  3845. this.dollyStart.copy(this.dollyEnd)
  3846. }
  3847. .bind(this)
  3848. , i = function() {
  3849. this.panEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3850. this.panDelta.subVectors(this.panEnd, this.panStart),
  3851. this.pan(this.panDelta.x, this.panDelta.y),
  3852. this.panStart.copy(this.panEnd),
  3853. this.rotateDelta.set(0, 0)
  3854. }
  3855. .bind(this)
  3856. , n = function() {
  3857. this.rotateEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3858. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3859. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3860. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3861. this.rotateStart.copy(this.rotateEnd)
  3862. }
  3863. .bind(this)
  3864. , r = function() {
  3865. if (2 === e.touches.length) {
  3866. var i = window.devicePixelRatio || 1
  3867. , r = e.touches[1].pageX - e.touches[0].pageX
  3868. , s = e.touches[1].pageY - e.touches[0].pageY
  3869. , l = Math.sqrt(r * r + s * s)
  3870. , h = Math.abs(this.dollyStart.length() - l);
  3871. if (h > o.input.touchMoveThreshold * i)
  3872. this.state = c.DOLLY,
  3873. t();
  3874. else {
  3875. var u = a.average(e.touches, "pageX")
  3876. , d = a.average(e.touches, "pageY")
  3877. , p = this.rotateDelta.set(u, d).sub(this.rotateStart).length();
  3878. p > o.input.touchMoveThreshold && (this.state = c.ROTATE,
  3879. this.rotateStart.set(u, d),
  3880. n())
  3881. }
  3882. }
  3883. }
  3884. .bind(this);
  3885. switch (this.state) {
  3886. case c.PAN_DOLLY:
  3887. t();
  3888. case c.PAN:
  3889. i();
  3890. break;
  3891. case c.ROTATE_DOLLY:
  3892. r();
  3893. break;
  3894. case c.DOLLY:
  3895. t();
  3896. break;
  3897. case c.ROTATE:
  3898. n();
  3899. break;
  3900. default:
  3901. this.state = c.NONE
  3902. }
  3903. this.lastMoveTime = e.timeStamp,
  3904. this.emit(d.Move, "touch")
  3905. }
  3906. }
  3907. ,
  3908. n.prototype.onTouchEnd = function(e) {
  3909. this.enabled && (this.state === c.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3910. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3911. this.state = c.NONE,
  3912. this.update(),
  3913. this.rotationAcceleration.set(0, 0),
  3914. this.rotateDelta.set(0, 0))
  3915. }
  3916. ,
  3917. n.prototype.onPointerDown = function(e) {
  3918. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3919. id: e.pointerId,
  3920. pageX: e.pageX,
  3921. pageY: e.pageY
  3922. }),
  3923. e.touches = this.pointers,
  3924. this.onTouchStart(e)),
  3925. this.emit(d.InputStart, "pointer"))
  3926. }
  3927. ,
  3928. n.prototype.onPointerMove = function(e) {
  3929. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  3930. e.pointerId === t.id && (t.pageX = e.pageX,
  3931. t.pageY = e.pageY)
  3932. }),
  3933. e.touches = this.pointers,
  3934. this.onTouchMove(e))
  3935. }
  3936. ,
  3937. n.prototype.onPointerUp = function(e) {
  3938. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  3939. e.pointerId === t.id && this.pointers.splice(i, 1)
  3940. }
  3941. .bind(this)),
  3942. e.touches = this.pointers,
  3943. this.onTouchEnd(e))
  3944. }
  3945. ,
  3946. n.prototype.reset = function() {
  3947. this.state = c.NONE,
  3948. this.stopAutoPanning(),
  3949. this.rotationSpeed.set(0, 0),
  3950. this.rotationAcceleration.set(0, 0),
  3951. this.panSpeed.set(0, 0),
  3952. this.panAcceleration.set(0, 0)
  3953. }
  3954. ,
  3955. n.prototype.toJSON = function() {
  3956. var e = {
  3957. camera_position: {
  3958. x: s.toPrecision(this.camera.position.x, 4),
  3959. y: s.toPrecision(this.camera.position.y, 4),
  3960. z: s.toPrecision(this.camera.position.z, 4)
  3961. },
  3962. camera_quaternion: {
  3963. x: s.toPrecision(this.camera.quaternion.x, 4),
  3964. y: s.toPrecision(this.camera.quaternion.y, 4),
  3965. z: s.toPrecision(this.camera.quaternion.z, 4),
  3966. w: s.toPrecision(this.camera.quaternion.w, 4)
  3967. }
  3968. };
  3969. return e
  3970. }
  3971. ,
  3972. t.exports = n
  3973. }
  3974. , {
  3975. "../enum/ControlActions": 20,
  3976. "../enum/ControlEvents": 21,
  3977. "../enum/Keys": 30,
  3978. "../enum/MouseButton": 34,
  3979. "../enum/Vectors": 50,
  3980. "../settings": 166,
  3981. "../util/common": 185,
  3982. "../util/math": 190,
  3983. events: 202,
  3984. three: 217
  3985. }],
  3986. 13: [function(e, t, i) {
  3987. (function(i) {
  3988. "use strict";
  3989. function n(e) {
  3990. this.camera = e,
  3991. this.camera.controls = this,
  3992. this.target = new r.Vector3(0,0,0),
  3993. this.lookVector = new r.Vector3,
  3994. this.lookSpeed = .05,
  3995. this.rotationAcc = new r.Vector2,
  3996. this.rotationSpeed = new r.Vector2,
  3997. this.lat = 0,
  3998. this.lon = 0,
  3999. this.phi = 0,
  4000. this.theta = 0,
  4001. this.enabled = !1,
  4002. this.locked = !1,
  4003. this.pointer = new r.Vector2(0,0),
  4004. this.rotationHistory = [],
  4005. this.rotationDifference = new r.Vector2,
  4006. this.pointerDragOn = !1,
  4007. this.pointerDragStart = new r.Vector2(0,0),
  4008. this.pinchDistance = 0,
  4009. this.moveStart = new r.Vector2,
  4010. this.moveTolerance = .01,
  4011. this.pointersLimit = 2,
  4012. this.pointers = []
  4013. }
  4014. var r = e("three")
  4015. , o = e("../util/logger")
  4016. , a = e("../settings")
  4017. , s = e("../util/common")
  4018. , l = e("../util/math")
  4019. , c = (e("../enum/Vectors"),
  4020. e("../enum/MouseButton"))
  4021. , h = e("../enum/Keys")
  4022. , u = e("../enum/ControlEvents")
  4023. , d = e("events").EventEmitter;
  4024. new o(i);
  4025. n.prototype = Object.create(d.prototype),
  4026. n.prototype.usable = function() {
  4027. return this.enabled && !this.locked
  4028. }
  4029. ,
  4030. n.prototype.lookAt = function(e) {
  4031. var t = this.camera.position.clone().sub(e)
  4032. , i = Math.atan(t.z / t.x);
  4033. i += t.x < 0 ? Math.PI : 0,
  4034. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0,
  4035. this.lon = r.Math.radToDeg(i) + 180;
  4036. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4037. , o = Math.atan(t.y / n);
  4038. this.lat = -r.Math.radToDeg(o)
  4039. }
  4040. ,
  4041. n.prototype.startRotationFrom = function(e, t) {
  4042. l.convertScreenPositionToNDC(e, t, this.pointer),
  4043. this.pointerDragOn = !0,
  4044. this.pointerDragStart.copy(this.pointer),
  4045. this.moveStart.copy(this.pointer),
  4046. this.rotationHistory = [],
  4047. this.rotationSpeed.set(0, 0)
  4048. }
  4049. ,
  4050. n.prototype.onMouseOver = function(e) {
  4051. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  4052. }
  4053. ,
  4054. n.prototype.onTouchStart = function(e) {
  4055. if (this.usable()) {
  4056. switch (e.preventDefault(),
  4057. e.stopPropagation(),
  4058. e.touches.length) {
  4059. case 1:
  4060. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4061. break;
  4062. case 2:
  4063. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4064. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  4065. this.pinchDistance = Math.sqrt(t * t + i * i)
  4066. }
  4067. this.emit(u.InputStart, "touch")
  4068. }
  4069. }
  4070. ,
  4071. n.prototype.onPointerDown = function(e) {
  4072. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4073. id: e.pointerId,
  4074. clientX: e.clientX,
  4075. clientY: e.clientY
  4076. }),
  4077. e.touches = this.pointers,
  4078. this.onTouchStart(e),
  4079. this.emit(u.InputStart, "pointer"))
  4080. }
  4081. ,
  4082. n.prototype.onMouseDown = function(e) {
  4083. if (this.usable()) {
  4084. switch (e.preventDefault(),
  4085. e.stopPropagation(),
  4086. e.button) {
  4087. case c.LEFT:
  4088. this.startRotationFrom(e.clientX, e.clientY)
  4089. }
  4090. this.emit(u.InputStart, "mouse")
  4091. }
  4092. }
  4093. ,
  4094. n.prototype.updateRotation = function() {
  4095. if (this.usable() && this.pointerDragOn) {
  4096. var e = new r.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4097. , t = new r.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4098. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4099. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4100. , o = Math.atan2(e.y, i)
  4101. , a = Math.atan2(t.y, n);
  4102. this.rotationDifference.y = r.Math.radToDeg(o - a),
  4103. e.y = 0,
  4104. t.y = 0;
  4105. var s = Math.acos(e.dot(t) / e.length() / t.length());
  4106. isNaN(s) || (this.rotationDifference.x = r.Math.radToDeg(s),
  4107. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4108. this.pointerDragStart.copy(this.pointer)
  4109. }
  4110. }
  4111. ,
  4112. n.prototype.onMouseMove = function(e) {
  4113. this.usable() && (l.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4114. this.pointerDragOn && (Math.abs(this.pointer.x - this.moveStart.x) > this.moveTolerance || Math.abs(this.pointer.y - this.moveStart.y) > this.moveTolerance) && this.emit(u.Move, "mouse"))
  4115. }
  4116. ,
  4117. n.prototype.onTouchMove = function(e) {
  4118. if (this.usable())
  4119. switch (this.emit(u.Move, "touch"),
  4120. e.touches.length) {
  4121. case 1:
  4122. l.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4123. break;
  4124. case 2:
  4125. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4126. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4127. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4128. Math.abs(n) > .01 && (this.emit(u.InteractionDirect),
  4129. this.emit(u.Pinch, n),
  4130. this.pinchDistance -= n)
  4131. }
  4132. }
  4133. ,
  4134. n.prototype.onPointerMove = function(e) {
  4135. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  4136. e.pointerId === t.id && (t.clientX = e.clientX,
  4137. t.clientY = e.clientY)
  4138. }),
  4139. e.touches = this.pointers,
  4140. this.onTouchMove(e))
  4141. }
  4142. ,
  4143. n.prototype.endRotation = function() {
  4144. this.pointerDragOn = !1;
  4145. var e = s.averageVectors(this.rotationHistory);
  4146. this.rotationSpeed.set(e.x * a.rotationAfterMoveMultiplier, e.y * a.rotationAfterMoveMultiplier)
  4147. }
  4148. ,
  4149. n.prototype.onTouchEnd = function(e) {
  4150. this.usable() && (e.preventDefault(),
  4151. e.stopPropagation(),
  4152. this.endRotation())
  4153. }
  4154. ,
  4155. n.prototype.onMouseUp = function(e) {
  4156. this.usable() && (e.preventDefault(),
  4157. e.stopPropagation(),
  4158. this.endRotation())
  4159. }
  4160. ,
  4161. n.prototype.onPointerUp = function(e) {
  4162. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  4163. e.pointerId === t.id && this.pointers.splice(i, 1)
  4164. }
  4165. .bind(this)),
  4166. e.touches = this.pointers,
  4167. this.onTouchEnd(e))
  4168. }
  4169. ,
  4170. n.prototype.update = function(e) {
  4171. this.lon,
  4172. this.lat;
  4173. for (this.updateRotation(),
  4174. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > a.rotationAfterMoveHistoryCount; )
  4175. this.rotationHistory.shift();
  4176. this.lon += this.rotationDifference.x,
  4177. this.lat += this.rotationDifference.y,
  4178. this.rotationDifference.set(0, 0),
  4179. this.rotationSpeed.x = this.rotationSpeed.x * (1 - a.rotationFriction) + this.rotationAcc.x * a.rotationAccelerationInside,
  4180. this.rotationSpeed.y = this.rotationSpeed.y * (1 - a.rotationFriction) + this.rotationAcc.y * a.rotationAccelerationInside,
  4181. this.lon += this.rotationSpeed.x * e,
  4182. this.lat += this.rotationSpeed.y * e,
  4183. this.lat = Math.max(a.insideLookLimitDown, Math.min(a.insideLookLimitUp, this.lat)),
  4184. this.phi = r.Math.degToRad(90 - this.lat),
  4185. this.theta = r.Math.degToRad(this.lon),
  4186. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4187. this.lookVector.y = Math.cos(this.phi),
  4188. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4189. this.target.copy(this.lookVector).add(this.camera.position),
  4190. this.camera.lookAt(this.target)
  4191. }
  4192. ,
  4193. n.prototype.onMouseWheel = function(e) {
  4194. if (this.usable()) {
  4195. var t = e.wheelDelta || -e.detail;
  4196. this.emit(u.InteractionDirect),
  4197. this.emit(u.Scroll, t)
  4198. }
  4199. }
  4200. ,
  4201. n.prototype.onKeyDown = function(e) {
  4202. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4203. this.handleKeyDown(e.which)))
  4204. }
  4205. ,
  4206. n.prototype.handleKeyDown = function(e) {
  4207. var t = function(e, t) {
  4208. this.rotationAcc[e] = t
  4209. }
  4210. .bind(this);
  4211. this.emit(u.InteractionKey);
  4212. var i = !0;
  4213. switch (e) {
  4214. case h.LEFTARROW:
  4215. case h.J:
  4216. t("x", -1);
  4217. break;
  4218. case h.RIGHTARROW:
  4219. case h.L:
  4220. t("x", 1);
  4221. break;
  4222. case h.I:
  4223. t("y", 1);
  4224. break;
  4225. case h.K:
  4226. t("y", -1);
  4227. break;
  4228. default:
  4229. i = !1
  4230. }
  4231. i && this.emit(u.Move, "key")
  4232. }
  4233. ,
  4234. n.prototype.onKeyUp = function(e) {
  4235. this.usable() && (e.preventDefault(),
  4236. e.stopPropagation(),
  4237. this.handleKeyUp(e.which))
  4238. }
  4239. ,
  4240. n.prototype.handleKeyUp = function(e) {
  4241. switch (e) {
  4242. case h.LEFTARROW:
  4243. case h.J:
  4244. case h.RIGHTARROW:
  4245. case h.L:
  4246. this.rotationAcc.x = 0;
  4247. break;
  4248. case h.I:
  4249. case h.K:
  4250. this.rotationAcc.y = 0
  4251. }
  4252. }
  4253. ,
  4254. n.prototype.startRotating = function(e, t) {
  4255. e && (this.rotationAcc.x = e),
  4256. t && (this.rotationAcc.y = t)
  4257. }
  4258. ,
  4259. n.prototype.stopRotating = function(e) {
  4260. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4261. this.rotationAcc.set(0, 0)
  4262. }
  4263. ,
  4264. n.prototype.reset = function() {
  4265. this.pointerDragOn = !1,
  4266. this.rotationAcc.set(0, 0),
  4267. this.rotationSpeed.set(0, 0),
  4268. this.pointers = []
  4269. }
  4270. ,
  4271. n.prototype.toJSON = function() {
  4272. var e = {
  4273. camera_position: {
  4274. x: l.toPrecision(this.camera.position.x, 4),
  4275. y: l.toPrecision(this.camera.position.y, 4),
  4276. z: l.toPrecision(this.camera.position.z, 4)
  4277. },
  4278. camera_quaternion: {
  4279. x: l.toPrecision(this.camera.quaternion.x, 4),
  4280. y: l.toPrecision(this.camera.quaternion.y, 4),
  4281. z: l.toPrecision(this.camera.quaternion.z, 4),
  4282. w: l.toPrecision(this.camera.quaternion.w, 4)
  4283. }
  4284. };
  4285. return e
  4286. }
  4287. ,
  4288. n.prototype.setStateFromJSON = function(e) {
  4289. this.camera.position.copy(e.camera_position),
  4290. this.camera.quaternion.copy(e.camera_quaternion)
  4291. }
  4292. ,
  4293. t.exports = n
  4294. }
  4295. ).call(this, "/js/controls/PanoramaControls.js")
  4296. }
  4297. , {
  4298. "../enum/ControlEvents": 21,
  4299. "../enum/Keys": 30,
  4300. "../enum/MouseButton": 34,
  4301. "../enum/Vectors": 50,
  4302. "../settings": 166,
  4303. "../util/common": 185,
  4304. "../util/logger": 189,
  4305. "../util/math": 190,
  4306. events: 202,
  4307. three: 217
  4308. }],
  4309. 14: [function(e, t, i) {
  4310. (function(i) {
  4311. "use strict";
  4312. var n = e("three")
  4313. , r = e("../enum/Viewmode")
  4314. , o = e("../util/logger")
  4315. , a = new o(i);
  4316. t.exports = {
  4317. serialize: function(e) {
  4318. return encodeURI(JSON.stringify(e))
  4319. },
  4320. deserialize: function(e) {
  4321. function t(e) {
  4322. function t(e, t) {
  4323. return e && "number" == typeof t && !isNaN(t)
  4324. }
  4325. return e.reduce(t, !0)
  4326. }
  4327. try {
  4328. var i = JSON.parse(decodeURI(e))
  4329. , o = {
  4330. mode: r.fromInt(i.camera_mode),
  4331. panoId: i.scan_id,
  4332. position: (new n.Vector3).copy(i.camera_position),
  4333. quaternion: (new n.Quaternion).copy(i.camera_quaternion),
  4334. zoom: i.ortho_zoom,
  4335. floorVisibility: i.floor_visibility
  4336. }
  4337. , s = o.position;
  4338. t([s.x, s.y, s.z]) || o.position.set(0, 0, 0);
  4339. var l = o.quaternion;
  4340. return t([l.x, l.y, l.z, l.w]) || o.quaternion.set(0, 0, 0, 1),
  4341. o
  4342. } catch (i) {
  4343. a.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4344. try {
  4345. var c = e.split(",")
  4346. , h = {
  4347. x: parseFloat(c[2]),
  4348. y: parseFloat(c[3]),
  4349. z: parseFloat(c[4])
  4350. }
  4351. , u = {
  4352. x: parseFloat(c[5]),
  4353. y: parseFloat(c[6]),
  4354. z: parseFloat(c[7]),
  4355. w: parseFloat(c[8])
  4356. };
  4357. return t([h.x, h.y, h.z]) || (h.x = 0,
  4358. h.y = 0,
  4359. h.z = 0),
  4360. t([u.x, u.y, u.z, u.w]) || (u.x = 0,
  4361. u.y = 0,
  4362. u.z = 0,
  4363. u.w = 1),
  4364. {
  4365. mode: r.fromInt(c[0]),
  4366. panoId: c[1],
  4367. position: (new n.Vector3).copy(h),
  4368. quaternion: (new n.Quaternion).copy(u)
  4369. }
  4370. } catch (t) {
  4371. a.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4372. }
  4373. }
  4374. return null
  4375. }
  4376. }
  4377. }
  4378. ).call(this, "/js/controls/serializer.js")
  4379. }
  4380. , {
  4381. "../enum/Viewmode": 51,
  4382. "../util/logger": 189,
  4383. three: 217
  4384. }],
  4385. 15: [function(e, t, i) {
  4386. (function(i) {
  4387. "use strict";
  4388. function n() {
  4389. this.endlessLoop = a.warp.loop,
  4390. this.clock = new r.Clock(!0),
  4391. this.model = null,
  4392. this.player = null,
  4393. this.currentItem = null,
  4394. this.destinationItem = null,
  4395. this.tourIsPlaying = !1,
  4396. this.transitionStage = y.None,
  4397. this.nextFunc = null,
  4398. this.onTheBus = !1,
  4399. this.tourInProgress = !1,
  4400. this.reachSource = null,
  4401. this.interrupted = !1,
  4402. this.nItems = 0,
  4403. this.walkingSectionPaused = !1
  4404. }
  4405. var r = e("three")
  4406. , o = e("./util/logger")
  4407. , a = e("./settings")
  4408. , s = e("./util/transitions")
  4409. , l = e("events").EventEmitter
  4410. , c = e("./enum/Viewmode")
  4411. , h = e("./analytics")
  4412. , u = e("./enum/WarpStyle")
  4413. , s = e("./util/transitions")
  4414. , d = (e("./model/ModelManager"),
  4415. e("./enum/ModelManagerEvents"))
  4416. , p = e("./enum/DirectorEvents")
  4417. , f = e("./enum/PlayerEvents")
  4418. , g = (e("./enum/ControlEvents"),
  4419. e("./enum/BlackoutStyle"))
  4420. , m = e("./enum/PathDiscardMode")
  4421. , v = e("./enum/PathDisplayMode")
  4422. , A = (e("./player"),
  4423. new o(i))
  4424. , y = Object.freeze({
  4425. None: 0,
  4426. Moving: 1,
  4427. Aiming: 2,
  4428. Interlude: 3
  4429. })
  4430. , C = Object.freeze({
  4431. Forward: 1,
  4432. NoChange: 0,
  4433. Backwards: -1
  4434. })
  4435. , I = s.getUniqueId();
  4436. n.prototype = Object.create(l.prototype),
  4437. n.prototype.init = function(e, t) {
  4438. this.player = e,
  4439. this.modelManager = t,
  4440. this.updateModel(),
  4441. this.resetAll(),
  4442. this.bindEvents()
  4443. }
  4444. ,
  4445. n.prototype.resetAll = function() {
  4446. if (this.currentItem = null,
  4447. this.destinationItem = null,
  4448. this.tourIsPlaying = !1,
  4449. this.bgmReplay(),//xzw
  4450. this.transitionStage = y.None,
  4451. this.nextFunc = null,
  4452. this.onTheBus = !1,
  4453. this.reachSource = null,
  4454. this.interrupted = !1,
  4455. this.model) {
  4456. var e = a.path.typ === u.WALK ? u.WALK : u.STD;
  4457. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && this.model.data.player_options.fast_transitions === !1 ? e : u.BLACK
  4458. } else
  4459. this.defaultWarpStyle = u.BLACK,
  4460. A.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4461. this.resetSpecialTransition()
  4462. }
  4463. ,
  4464. n.prototype.updateModel = function() {
  4465. this.model = this.modelManager.getActiveModel(),
  4466. this.nItems = this.model.heroLocations.length
  4467. }
  4468. ,
  4469. n.prototype.bindEvents = function() {
  4470. this.modelManager.on(d.ActiveModelChanged, this.updateModel.bind(this)),
  4471. this.player.on(f.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4472. this.player.on(f.Move, this.handlePlayerMove.bind(this)),
  4473. this.player.on(f.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4474. this.player.on(f.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4475. this.player.on(f.InputStart, this.handlePlayerInputStart.bind(this)),
  4476. this.player.on(f.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4477. this.player.once(f.Move, function() {
  4478. s.cancelById(I)
  4479. })
  4480. }
  4481. ,
  4482. n.prototype.checkAndHandleWalkingtourInterruption = function(e) {
  4483. return e === u.WALK && (this.interrupt(g.NONE),
  4484. this.pauseWalkingSection(),
  4485. this.player.fastForwardActivePanoFlight(),
  4486. !0)
  4487. }
  4488. ,
  4489. n.prototype.handlePlayerMove = function(e) {
  4490. this.transitionStage === y.Interlude && this.interrupt(g.NONE),
  4491. this.emit("update.controls")
  4492. }
  4493. ,
  4494. n.prototype.handlePlayerPanoChosen = function(e, t) {
  4495. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4496. this.emit("update.controls"))
  4497. }
  4498. ,
  4499. n.prototype.handlePlayerModeChanged = function(e, t) {
  4500. this.intermediateState() || e === t || (this.onTheBus = !1,
  4501. this.emit("update.controls"))
  4502. }
  4503. ,
  4504. n.prototype.handlePlayerInputStart = function(e) {
  4505. this.transitionStage === y.Interlude && this.interrupt(g.NONE)
  4506. }
  4507. ,
  4508. n.prototype.handlePlayerFlyingStarted = function() {
  4509. this.clearWalkingSectionPaused()
  4510. }
  4511. ,
  4512. n.prototype.describe = function() {
  4513. return {
  4514. nItems: this.nItems,
  4515. currentItem: this.currentItem,
  4516. destinationItem: this.destinationItem,
  4517. tourIsPlaying: this.tourIsPlaying,
  4518. onTheBus: this.onTheBus,
  4519. endlessLoop: this.endlessLoop,
  4520. viewMode: this.player.mode,
  4521. inTransition: this._inTransition(),
  4522. transitionStage: this.transitionStage,
  4523. tourInProgress: this.tourInProgress
  4524. }
  4525. }
  4526. ,
  4527. n.prototype._inTransition = function() {
  4528. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === c.TRANSITIONING || this.tourIsPlaying
  4529. }
  4530. ,
  4531. n.prototype.bounceable = function() {
  4532. var e = this.clock.getDelta();
  4533. return this.isInterrupted() || e < .9 && e > .01 || this.player.flying && !this.player.isWarping()
  4534. }
  4535. ,
  4536. n.prototype.currentMoveDirection = function() {
  4537. return null === this.currentItem || void 0 === this.currentItem ? C.Forward : this.destinationItem === this.currentItem ? C.NoChange : this.destinationItem > this.currentItem ? C.Forward : C.Backwards
  4538. }
  4539. ,
  4540. n.prototype.clearPath = function() {
  4541. this._inTransition() || this.player.path.discardPathObject()
  4542. }
  4543. ,
  4544. n.prototype.allFloors = function() {
  4545. this.model.toggleAllFloors()
  4546. }
  4547. ,
  4548. n.prototype.actionComplete = function(e) {
  4549. if (this.interrupted = !1,
  4550. this.transitionStage = y.None,
  4551. this.resetSpecialTransition(),
  4552. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4553. this.tourIsPlaying || (this.player.disablePreRendering(),
  4554. this.player.mode === c.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4555. this.emit("update.controls"),
  4556. this.nextFunc) {
  4557. var t = this.nextFunc;
  4558. this.nextFunc = null,
  4559. t()
  4560. }
  4561. }
  4562. ,
  4563. n.prototype.awaitCompletion = function(e, t) {
  4564. this.nextFunc = t,
  4565. e()
  4566. }
  4567. ,
  4568. n.prototype.updateSuccessFunction = function(e) {
  4569. this.nextFunc = e
  4570. }
  4571. ,
  4572. n.prototype.interrupt = function(e, t) {
  4573. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4574. this.tourIsPlaying = !1,
  4575. this.bgmReplay(),//xzw
  4576. this.interrupted = !0,
  4577. this.nextFunc = null,
  4578. this.emit(p.ActionInterrupted),
  4579. null !== e && void 0 !== e || (e = g.BEGINNING),
  4580. this.player.interruptAndFastForward(e, t),
  4581. !0)
  4582. }
  4583. ,
  4584. n.prototype.wouldInterrupt = function() {
  4585. return this.transitionStage !== y.None
  4586. }
  4587. ,
  4588. n.prototype.intermediateState = function() {
  4589. return this.transitionStage !== y.None
  4590. }
  4591. ,
  4592. n.prototype.isInterrupted = function() {
  4593. return this.interrupted
  4594. }
  4595. ,
  4596. n.prototype.pauseWalkingSection = function() {
  4597. this.walkingSectionPaused = !0
  4598. }
  4599. ,
  4600. n.prototype.clearWalkingSectionPaused = function() {
  4601. this.walkingSectionPaused = !1
  4602. }
  4603. ,
  4604. n.prototype.autoTour = function() {
  4605. var e = Date.now();
  4606. this.model.auxDataPromise.then(function() {
  4607. e = Date.now() - e;
  4608. var t = a.warp.auto
  4609. , i = this.model.data && this.model.data.player_options /* && this.model.data.player_options.highlight_reel */;
  4610. t >= 0 && this.model.heroCount() > 1 && i && s.trigger({
  4611. duration: Math.max(1e3 * Math.min(300, t) - e, 0),
  4612. done: function() {
  4613. this.playTour()
  4614. }
  4615. .bind(this),
  4616. name: "_atr",
  4617. id: I
  4618. })
  4619. }
  4620. .bind(this))
  4621. }
  4622. ,
  4623. n.prototype.atDestinationPano = function() {
  4624. if (!this.player.currentPano || null === this.destinationItem)
  4625. return !1;
  4626. var e = this.player.currentPano.id;
  4627. if (void 0 === e)
  4628. return !1;
  4629. var t = this.model.heroLocations;
  4630. return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4631. }
  4632. ,
  4633. n.prototype.redirectToItem = function(e, t) {
  4634. if (null === e || void 0 === e)
  4635. return void A.warn("Director.redirectToItem() -> Redirecting to null item.");
  4636. if (!this.wouldInterrupt())
  4637. return void A.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4638. if (this.player.mode === c.TRANSITIONING)
  4639. return void A.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4640. A.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4641. var i = function() {
  4642. s.setTimeout(function() {
  4643. this.setDestinationItem(e),
  4644. this.goToDestination(!0, g.BEGINNING, a.warp.warpInterruptionRedirectTime, !1)
  4645. }
  4646. .bind(this), 0)
  4647. }
  4648. .bind(this);
  4649. this.interrupt(g.END, 0),
  4650. this.updateSuccessFunction(i)
  4651. }
  4652. ,
  4653. n.prototype.useSpecialTransition = function(e) {
  4654. void 0 !== e && this.defaultWarpStyle !== u.BLACK && A.debug("useSpecialTransition(): " + e),
  4655. this.nextWarpStyle = u.BLACK
  4656. }
  4657. ,
  4658. n.prototype.resetSpecialTransition = function() {
  4659. this.nextWarpStyle = this.defaultWarpStyle
  4660. }
  4661. ,
  4662. n.prototype.arrivedAtDestination = function(e) {
  4663. if (this.player.flying || this.player.isWarping())
  4664. A.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4665. else {
  4666. this.transitionStage = y.Aiming;
  4667. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4668. this.player.model.fadePanoMarkers(0),
  4669. this.awaitCompletion(function() {
  4670. this.resetSpecialTransition(),
  4671. e ? this.player.aimTourCamera(this.destinationItem, v.Retain, v.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4672. }
  4673. .bind(this), t)
  4674. }
  4675. }
  4676. ,
  4677. n.prototype.goToDestination = function(e, t, i, n) {
  4678. if(typeof g_data2.tourAudio !== 'undefined' && g_data2.tourAudio !== null){
  4679. var tM = g_data2.tourAudio[this.model.heroLocations[this.destinationItem].sid];
  4680. if(tM && tM.music.length > 0){
  4681. var s = g_Prefix+tM.music;
  4682. g_tourAudio.src = s;
  4683. g_tourAudio.load();
  4684. g_tourAudio.crossOrigin = "anonymous"
  4685. g_tourAudio.oncanplaythrough = function() {
  4686. g_tourAudio.play();
  4687. //$("#volume").addClass("unable")
  4688. if(g_bgAudio && !g_bgAudio.paused){
  4689. manage.switchBgmState(false);
  4690. g_bgAudio.pauseByTour = true
  4691. }
  4692. g_playAudio = g_tourAudio;
  4693. }
  4694. }
  4695. };
  4696. if (this.onTheBus = !0,
  4697. this.emit("update.controls"),
  4698. this.player.updateLastView(),
  4699. !n && this.atDestinationPano())
  4700. return void this.arrivedAtDestination(!0);
  4701. if (this.player.flying || this.player.isWarping())
  4702. A.warn("Cannot go to new destination while player is flying or warping.");
  4703. else {
  4704. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4705. , o = null
  4706. , a = null;
  4707. if (r.isPano()) {
  4708. //var s = 0 === this.destinationItem || e ? u.BLACK : this.nextWarpStyle;
  4709. //var walk = window.MP_PREFETCHED_MODELDATA.black ? 'black' : 'walk';
  4710. var s = window.MP_PREFETCHED_MODELDATA.momentTour || 'walk';
  4711. a = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, v.Show, m.Slow, s, true, i, this.actionComplete.bind(this)),
  4712. o = this.arrivedAtDestination.bind(this, !0)
  4713. } else
  4714. a = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4715. o = this.arrivedAtDestination.bind(this, !1);
  4716. this.transitionStage = y.Moving,
  4717. this.model.fadePanoMarkers(0),
  4718. this.awaitCompletion(function() {
  4719. a();
  4720. }
  4721. .bind(this), o),
  4722. this.emit("update.controls")
  4723. }
  4724. }
  4725. ,
  4726. n.prototype.tourInterlude = function() {
  4727. if (h.trackAlways("reach_highlight", {
  4728. reach_source: this.reachSource
  4729. }),
  4730. this.model.fadePanoMarkers(0),
  4731. this.emit("update.controls"),
  4732. this.tourIsPlaying)
  4733. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4734. this.stopTour(),
  4735. this.emit(p.TourEnd),
  4736. void (this.player.mode === c.PANORAMA && this.model.fadePanoMarkers(a.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4737. this.transitionStage = y.Interlude,
  4738. this.player.tourInterlude(this.nextItem(this.currentItem),this.actionComplete.bind(this))
  4739. }
  4740. .bind(this), this.goNext.bind(this))
  4741. }
  4742. ,
  4743. n.prototype.playTour = function() {
  4744. if (!this.bounceable())
  4745. return this.tourIsPlaying ? void A.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4746. this.tourInProgress = !0,
  4747. this.reachSource = "play",
  4748. this.tourIsPlaying = !0,
  4749. this.wasZoomEnabled = this.player.zoomEnabled,
  4750. this.player.zoomEnabled = !1,
  4751. this.resetSpecialTransition(),
  4752. this.emit("update.controls"),
  4753. this.emit(p.TourStart),
  4754. this.player.enablePreRendering(),
  4755. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4756. this.goToDestination()) : this.goNext()))
  4757. }
  4758. ,
  4759. n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
  4760. //if(g_tourAudio && g_tourAudio.paused && g_bgAudio && g_bgAudio.paused){
  4761. if(g_bgAudio && g_bgAudio.paused && g_bgAudio.pauseByTour){
  4762. g_playAudio = g_bgAudio;
  4763. g_tourAudio && g_tourAudio.pause();
  4764. //window.tourAudio && window.tourAudio.pause();
  4765. manage.switchBgmState(true);
  4766. }
  4767. }
  4768. ,
  4769. n.prototype.stopTour = function() {
  4770. this.isInterrupted() || this.transitionStage === y.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4771. this.tourIsPlaying = !1,
  4772. this.bgmReplay(),//xzw
  4773. this.interrupt(),
  4774. this.clearWalkingSectionPaused(),
  4775. this.resetSpecialTransition(),
  4776. this.emit("update.controls"))
  4777. //window.tourAudio && window.tourAudio.pause();
  4778. if( g_tourAudio && g_tourAudio.paused == false )
  4779. {
  4780. g_tourAudio.pause();
  4781. g_tourAudio.src = ""
  4782. }
  4783. }
  4784. ,
  4785. n.prototype.endTourProgress = function() {
  4786. this.tourInProgress = !1,
  4787. this.emit("update.controls"),
  4788. this.emit(p.TourEnd)
  4789. }
  4790. ,
  4791. n.prototype.goToHighlight = function(e) {
  4792. if (this.wouldInterrupt())
  4793. e === this.destinationItem ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4794. else {
  4795. if (A.debug("<tour.goto " + e + ">"),
  4796. this.isInterrupted())
  4797. return;
  4798. this.clearWalkingSectionPaused(),
  4799. this.setDestinationItem(e),
  4800. this.useSpecialTransition("Hilight"),
  4801. this.goToDestination(),
  4802. h.trackAlways("reach_highlight", {
  4803. reach_source: "thumb"
  4804. })
  4805. }
  4806. }
  4807. ,
  4808. n.prototype.prevHighlight = function() {
  4809. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4810. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4811. this.reachSource = "prev",
  4812. this.goPrev()))
  4813. }
  4814. ,
  4815. n.prototype.nextHighlight = function() {
  4816. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4817. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4818. this.reachSource = "next",
  4819. this.goNext()))
  4820. }
  4821. ,
  4822. n.prototype.changeMode = function(e) {
  4823. var t = $.Deferred()
  4824. , i = t.resolve.bind(t)
  4825. , n = t.reject.bind(t);
  4826. this.emit(p.StartModeChange);
  4827. var r = function() {
  4828. return this.clearWalkingSectionPaused(),
  4829. !!this.wouldInterrupt() && (this.interrupt(),
  4830. !0)
  4831. }
  4832. .bind(this);
  4833. if (!r()) {
  4834. switch (e) {
  4835. case c.PANORAMA:
  4836. this.player.mode === c.PANORAMA ? this.player.currentPano.isAligned() || this.player.goToLastView(!0).done(i).fail(n) : this.player.insideMode(this.player.lastInsideView.pano).done(i).fail(n);
  4837. break;
  4838. case c.DOLLHOUSE:
  4839. case c.FLOORPLAN:
  4840. this.player.flyToNewMode({
  4841. mode: e
  4842. }).done(i).fail(n);
  4843. break;
  4844. case c.OUTDOOR:
  4845. this.player.model.has360Views && (this.player.mode !== c.PANORAMA || this.player.mode === c.PANORAMA && this.player.currentPano.isAligned()) && this.player.goToLastView(!1).done(i).fail(n)
  4846. }
  4847. return t.promise()
  4848. }
  4849. }
  4850. ,
  4851. n.prototype.atEndOfTour = function() {
  4852. var e = this.currentItem >= this.nItems - 1;
  4853. return e
  4854. }
  4855. ,
  4856. n.prototype.firstDestination = function() {
  4857. return this.nItems > 0 ? 0 : null
  4858. }
  4859. ,
  4860. n.prototype.finalDestination = function() {
  4861. return this.nItems > 0 ? this.nItems - 1 : null
  4862. }
  4863. ,
  4864. n.prototype.goPrev = function() {
  4865. this.tourAdvance(-1)
  4866. }
  4867. ,
  4868. n.prototype.goNext = function() {
  4869. this.tourAdvance(1)
  4870. }
  4871. ,
  4872. n.prototype.setDestinationItem = function(e) {
  4873. this.destinationItem = e,
  4874. this.emit("update.controls")
  4875. }
  4876. ,
  4877. n.prototype.setCurrentItem = function(e) {
  4878. this.currentItem = e,
  4879. this.emit("update.controls")
  4880. }
  4881. ,
  4882. n.prototype.nextItem = function(e) {
  4883. return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4884. }
  4885. ,
  4886. n.prototype.prevItem = function(e) {
  4887. return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4888. }
  4889. ,
  4890. n.prototype.tourAdvance = function(e) {
  4891. A.debug("tourAdvance(" + e + ")"),
  4892. null === this.currentItem || void 0 === this.currentItem ? this.setDestinationItem(this.firstDestination()) : this.setDestinationItem(this.currentItem + e),
  4893. this.destinationItem < 0 ? (this.setDestinationItem(this.finalDestination()),
  4894. this.useSpecialTransition("reverse-looping to end")) : this.destinationItem >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  4895. this.useSpecialTransition("looping back to start"));
  4896. // 方奕卓 瞬间过渡, 相机缩放至1
  4897. if(window.MP_PREFETCHED_MODELDATA.momentTour === 'black') {
  4898. var zoomLevel = this.player.zoomLevel;
  4899. this.player.zoomEnabled = true;
  4900. var zoom = function(e, d) {
  4901. this.player.zoomTo((1-e)*zoomLevel, true)
  4902. }.bind(this)
  4903. s.start(zoom, 1500, function(){
  4904. }, 0, d.easeOutQuad, "zoom")
  4905. }
  4906. this.goToDestination()
  4907. }
  4908. ,
  4909. t.exports = n
  4910. }
  4911. ).call(this, "/js/director.js")
  4912. }
  4913. , {
  4914. "./analytics": 4,
  4915. "./enum/BlackoutStyle": 18,
  4916. "./enum/ControlEvents": 21,
  4917. "./enum/DirectorEvents": 23,
  4918. "./enum/ModelManagerEvents": 33,
  4919. "./enum/PathDiscardMode": 38,
  4920. "./enum/PathDisplayMode": 39,
  4921. "./enum/PlayerEvents": 40,
  4922. "./enum/Viewmode": 51,
  4923. "./enum/WarpStyle": 52,
  4924. "./model/ModelManager": 140,
  4925. "./player": 155,
  4926. "./settings": 166,
  4927. "./util/logger": 189,
  4928. "./util/transitions": 195,
  4929. events: 202,
  4930. three: 217
  4931. }],
  4932. 16: [function(e, t, i) {
  4933. "use strict";
  4934. var n = e("three")
  4935. , r = e("./enum/Viewmode")
  4936. , o = (e("./settings"),
  4937. e("./util/transitions"))
  4938. , a = e("./enum/PlayerEvents")
  4939. , s = new n.ShaderPass(n.HorizontalBlurShader)
  4940. , l = new n.ShaderPass(n.VerticalBlurShader);
  4941. l.renderToScreen = !0;
  4942. var c = $("#player").width() / $("#player").height();
  4943. isNaN(c) && (c = 1);
  4944. var h = {
  4945. currentBlur: 0,
  4946. aspect: c,
  4947. blurStrength: 1,
  4948. hblurPass: s,
  4949. vblurPass: l,
  4950. bindEvents: function(e) {
  4951. e.on(a.ModeChanged, function(e, t) {
  4952. e === r.PANORAMA && (o.cancel(h.blur),
  4953. o.cancel(h.addBlur),
  4954. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  4955. })
  4956. },
  4957. blur: function(e) {
  4958. h.currentBlur = e;
  4959. var t = e * h.blurStrength;
  4960. l.uniforms.v.value = t / 512 * h.aspect,
  4961. s.uniforms.h.value = t / 512
  4962. },
  4963. addBlur: function(e) {
  4964. e = Math.max(e, h.currentBlur),
  4965. h.blur(e)
  4966. },
  4967. removeBlur: function(e) {
  4968. e = Math.min(1 - e, h.currentBlur),
  4969. h.blur(e)
  4970. }
  4971. };
  4972. h.blur(0),
  4973. t.exports = h
  4974. }
  4975. , {
  4976. "./enum/PlayerEvents": 40,
  4977. "./enum/Viewmode": 51,
  4978. "./settings": 166,
  4979. "./util/transitions": 195,
  4980. three: 217
  4981. }],
  4982. 17: [function(e, t, i) {
  4983. "use strict";
  4984. t.exports = {
  4985. UNKNOWN: 0,
  4986. ALIGNED: 1,
  4987. UNALIGNED: 2,
  4988. PLACED: 3
  4989. }
  4990. }
  4991. , {}],
  4992. 18: [function(e, t, i) {
  4993. "use strict";
  4994. t.exports = {
  4995. NONE: 0,
  4996. MIDDLE: 1,
  4997. END: 2,
  4998. BEGINNING: 3,
  4999. FADEIN: 4
  5000. }
  5001. }
  5002. , {}],
  5003. 19: [function(e, t, i) {
  5004. "use strict";
  5005. var n = e("three");
  5006. t.exports = {
  5007. newBlue: new n.Color(4967932),
  5008. altBlue: new n.Color(47355),
  5009. tagDefault: new n.Color(223357),
  5010. classicBlue: new n.Color(53759),
  5011. mpYellow: new n.Color(16502016),
  5012. mpOrange: new n.Color(16428055),
  5013. mpBlue: new n.Color(12096),
  5014. mpLtGrey: new n.Color(13751252),
  5015. mpDkGrey: new n.Color(10000019),
  5016. mpRed: new n.Color(12525854),
  5017. mpOrangeDesat: new n.Color(16764529),
  5018. mpBlueDesat: new n.Color(4034734),
  5019. mpRedDesat: new n.Color(14705505),
  5020. white: new n.Color(16777215),
  5021. black: new n.Color(0),
  5022. _desat: function(e, t) {
  5023. var i = t || .3
  5024. , r = (new n.Color).copy(e).getHSL();
  5025. return (new n.Color).setHSL(r.h, r.s * (1 - i), r.l)
  5026. },
  5027. _darken: function(e, t) {
  5028. var i = t || .2
  5029. , r = e.getHSL();
  5030. return (new n.Color).setHSL(r.h, r.s, r.l * (1 - i))
  5031. }
  5032. }
  5033. }
  5034. , {
  5035. three: 217
  5036. }],
  5037. 20: [function(e, t, i) {
  5038. "use strict";
  5039. t.exports = {
  5040. NONE: -1,
  5041. ROTATE: 0,
  5042. DOLLY: 1,
  5043. PAN: 2,
  5044. ROTATE_DOLLY: 3,
  5045. PAN_DOLLY: 4
  5046. }
  5047. }
  5048. , {}],
  5049. 21: [function(e, t, i) {
  5050. "use strict";
  5051. t.exports = {
  5052. Move: "move",
  5053. InteractionDirect: "interaction.direct",
  5054. InteractionKey: "interaction.key",
  5055. InteractionGui: "interaction.gui",
  5056. FlyInDirection: "fly.direction",
  5057. InputStart: "input.start",
  5058. Pinch: "input.pinch",
  5059. Scroll: "input.scroll",
  5060. AutoPanInterrupt: "autopan.interrupt",
  5061. AutoPanComplete: "autopan.complete",
  5062. AutoPanClamped: "autopan.clamped",
  5063. LongTap: "longtap"
  5064. }
  5065. }
  5066. , {}],
  5067. 22: [function(e, t, i) {
  5068. "use strict";
  5069. t.exports = Object.freeze({
  5070. FORWARD: "FORWARD",
  5071. LEFT: "LEFT",
  5072. RIGHT: "RIGHT",
  5073. BACK: "BACK",
  5074. UP: "UP",
  5075. DOWN: "DOWN"
  5076. })
  5077. }
  5078. , {}],
  5079. 23: [function(e, t, i) {
  5080. "use strict";
  5081. t.exports = {
  5082. ActionInterrupted: "action.interrupted",
  5083. TourStart: "tour.start",
  5084. TourEnd: "tour.end",
  5085. StartModeChange: "mode.startChange"
  5086. }
  5087. }
  5088. , {}],
  5089. 24: [function(e, t, i) {
  5090. "use strict";
  5091. t.exports = Object.freeze({
  5092. None: 0,
  5093. Queued: 1,
  5094. ForceQueued: 2,
  5095. Downloading: 3,
  5096. Downloaded: 4,
  5097. DownloadFailed: 5
  5098. })
  5099. }
  5100. , {}],
  5101. 25: [function(e, t, i) {
  5102. "use strict";
  5103. t.exports = {
  5104. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5105. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5106. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5107. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5108. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5109. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5110. }
  5111. }
  5112. , {}],
  5113. 26: [function(e, t, i) {
  5114. "use strict";
  5115. t.exports = {
  5116. Texture2D: 0,
  5117. TextureCube: 1
  5118. }
  5119. }
  5120. , {}],
  5121. 27: [function(e, t, i) {
  5122. "use strict";
  5123. t.exports = {
  5124. SMALL: "small",
  5125. LARGE: "large"
  5126. }
  5127. }
  5128. , {}],
  5129. 28: [function(e, t, i) {
  5130. "use strict";
  5131. var n = e("./Viewmode")
  5132. , r = {
  5133. LANDING: {},
  5134. NAVIGATION: "navigation",
  5135. MORE_HELP: "moreHelp",
  5136. TOUR_INTERACTION: {}
  5137. };
  5138. r.LANDING[n.PANORAMA] = "panorama.landing",
  5139. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5140. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5141. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5142. r.TOUR_INTERACTION.standard = "standard.tour",
  5143. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5144. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5145. t.exports = r
  5146. }
  5147. , {
  5148. "./Viewmode": 51
  5149. }],
  5150. 29: [function(e, t, i) {
  5151. "use strict";
  5152. var n = {
  5153. UP: 1,
  5154. DOWN: -1,
  5155. LEFT: "L",
  5156. RIGHT: "R",
  5157. FORWARD: "F",
  5158. BACK: "B",
  5159. reverse: {},
  5160. opposite: function(e) {
  5161. return this.reverse[e.toString()]
  5162. }
  5163. };
  5164. !function() {
  5165. n.reverse[n.UP] = n.DOWN,
  5166. n.reverse[n.DOWN] = n.UP,
  5167. n.reverse[n.LEFT] = n.RIGHT,
  5168. n.reverse[n.RIGHT] = n.LEFT,
  5169. n.reverse[n.FORWARD] = n.BACK,
  5170. n.reverse[n.BACK] = n.FORWARD
  5171. }(),
  5172. t.exports = n
  5173. }
  5174. , {}],
  5175. 30: [function(e, t, i) {
  5176. "use strict";
  5177. var n = e("../util/browser")
  5178. , r = {
  5179. ZERO: 48,
  5180. ONE: 49,
  5181. TWO: 50,
  5182. THREE: 51,
  5183. FOUR: 52,
  5184. FIVE: 53,
  5185. SIX: 54,
  5186. SEVEN: 55,
  5187. EIGHT: 56,
  5188. NINE: 57,
  5189. LEFTARROW: 37,
  5190. UPARROW: 38,
  5191. RIGHTARROW: 39,
  5192. DOWNARROW: 40,
  5193. A: 65,
  5194. B: 66,
  5195. C: 67,
  5196. D: 68,
  5197. E: 69,
  5198. F: 70,
  5199. G: 71,
  5200. H: 72,
  5201. I: 73,
  5202. J: 74,
  5203. K: 75,
  5204. L: 76,
  5205. M: 77,
  5206. N: 78,
  5207. O: 79,
  5208. P: 80,
  5209. Q: 81,
  5210. R: 82,
  5211. S: 83,
  5212. T: 84,
  5213. U: 85,
  5214. V: 86,
  5215. W: 87,
  5216. X: 88,
  5217. Y: 89,
  5218. Z: 90,
  5219. SPACE: 32,
  5220. RETURN: 13,
  5221. SEMICOLON: 186,
  5222. PLUSEQUALS: 187,
  5223. DASHUNDERSCORE: 189,
  5224. OPENBRACKET: 219
  5225. };
  5226. n.detectFirefox() && (r.SEMICOLON = 59,
  5227. r.PLUSEQUALS = 61,
  5228. r.DASHUNDERSCORE = 173),
  5229. t.exports = r
  5230. }
  5231. , {
  5232. "../util/browser": 182
  5233. }],
  5234. 31: [function(e, t, i) {
  5235. "use strict";
  5236. t.exports = {
  5237. EN_US: "en-US",
  5238. ES_MX: "es-MX",
  5239. FR_FR: "fr-FR",
  5240. DE_DE: "de-DE",
  5241. RU_RU: "ru-RU",
  5242. CN_CN: "cn-CN",
  5243. JP_JP: "jp-JP"
  5244. }
  5245. }
  5246. , {}],
  5247. 32: [function(e, t, i) {
  5248. "use strict";
  5249. t.exports = {
  5250. TagActivated: "tag.activated",
  5251. TagDismissed: "tag.dismissed",
  5252. TagNavigation: "tag.navigation"
  5253. }
  5254. }
  5255. , {}],
  5256. 33: [function(e, t, i) {
  5257. "use strict";
  5258. t.exports = {
  5259. ModelAdded: "model-added",
  5260. ActiveModelChanged: "active-model-changed"
  5261. }
  5262. }
  5263. , {}],
  5264. 34: [function(e, t, i) {
  5265. "use strict";
  5266. t.exports = {
  5267. LEFT: 0,
  5268. MIDDLE: 1,
  5269. RIGHT: 2
  5270. }
  5271. }
  5272. , {}],
  5273. 35: [function(e, t, i) {
  5274. "use strict";
  5275. t.exports = {
  5276. PanoRenderComplete: "panorama.render.complete",
  5277. TileRenderFailure: "panorama.tile.render.failed",
  5278. TileRenderSuccess: "panorama.tile.render.success",
  5279. TileUploadAttempted: "panorama.tile.upload.attempted",
  5280. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5281. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5282. }
  5283. }
  5284. , {}],
  5285. 36: [function(e, t, i) {
  5286. "use strict";
  5287. t.exports = {
  5288. BASE: 1,
  5289. STANDARD: 2,
  5290. HIGH: 3,
  5291. ULTRAHIGH: 4
  5292. }
  5293. }
  5294. , {}],
  5295. 37: [function(e, t, i) {
  5296. "use strict";
  5297. t.exports = {
  5298. LoadComplete: "panorama.load.complete",
  5299. LoadFailed: "panorama.load.failed",
  5300. TileLoaded: "panorama.tile.loaded"
  5301. }
  5302. }
  5303. , {}],
  5304. 38: [function(e, t, i) {
  5305. "use strict";
  5306. t.exports = Object.freeze({
  5307. Standard: 0,
  5308. Slow: 1,
  5309. Retain: 2
  5310. })
  5311. }
  5312. , {}],
  5313. 39: [function(e, t, i) {
  5314. "use strict";
  5315. t.exports = Object.freeze({
  5316. Show: 0,
  5317. Hide: 1,
  5318. Retain: 2
  5319. })
  5320. }
  5321. , {}],
  5322. 40: [function(e, t, i) {
  5323. "use strict";
  5324. t.exports = {
  5325. Move: "move",
  5326. MoveComplete: "move.complete",
  5327. ModeChanged: "mode.changed",
  5328. ModeChanging: "mode.changing",
  5329. PanoChosen: "pano.chosen",
  5330. ClosestPanoChanging: "closest.pano.changing",
  5331. WarpStarted: "warp.started",
  5332. WarpInterrupted: "warp.interrupted",
  5333. WarpEnded: "warp.ended",
  5334. FlyinFinished: "flyin.finished",
  5335. FlyingStarted: "flying.started",
  5336. FlyingInterrupted: "flying.interrupted",
  5337. FlyingEnded: "flying.ended",
  5338. Ready: "ready",
  5339. StartInside: "start.inside",
  5340. StartOutside: "start.outside",
  5341. ViewChanged: "view.changed",
  5342. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5343. InputStart: "input.start"
  5344. }
  5345. }
  5346. , {}],
  5347. 41: [function(e, t, i) {
  5348. "use strict";
  5349. t.exports = Object.freeze({
  5350. DEFAULT: 0,
  5351. PANOMARKERS: 1,
  5352. RETICULE: 2,
  5353. TAG: 3
  5354. })
  5355. }
  5356. , {}],
  5357. 42: [function(e, t, i) {
  5358. "use strict";
  5359. t.exports = {
  5360. visibleFloor: 1,
  5361. ghostFloor: 3,
  5362. boundingSkybox: 1,
  5363. panoMarker: 2,
  5364. reticule: 3,
  5365. tagStem: 4,
  5366. tagDisc: 5,
  5367. ribbon: 100
  5368. }
  5369. }
  5370. , {}],
  5371. 43: [function(e, t, i) {
  5372. "use strict";
  5373. t.exports = {
  5374. ContextCreated: "scene-renderer-context-created",
  5375. AfterRender: "after-render",
  5376. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5377. }
  5378. }
  5379. , {}],
  5380. 44: [function(e, t, i) {
  5381. "use strict";
  5382. t.exports = {
  5383. IDLE: "idle",
  5384. BROWSE: "browse",
  5385. EXAMINE: "examine"
  5386. }
  5387. }
  5388. , {}],
  5389. 45: [function(e, t, i) {
  5390. "use strict";
  5391. t.exports = {
  5392. TileDownloadSuccess: "tiledownloader.download.success",
  5393. TileDownloadFailure: "tiledownloader.download.failure",
  5394. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5395. }
  5396. }
  5397. , {}],
  5398. 46: [function(e, t, i) {
  5399. "use strict";
  5400. t.exports = {
  5401. CardboardAndroid: "googlevr",
  5402. GearVR: "gearvr",
  5403. CardboardIOS: "googlevrios",
  5404. Cardboard: "googlevr"
  5405. }
  5406. }
  5407. , {}],
  5408. 47: [function(e, t, i) {
  5409. "use strict";
  5410. t.exports = {
  5411. NONE: 0,
  5412. CONTEXTUAL: 1,
  5413. ANDROID: 2
  5414. }
  5415. }
  5416. , {}],
  5417. 48: [function(e, t, i) {
  5418. "use strict";
  5419. var n = {
  5420. Title: 0,
  5421. Cardboard: 1
  5422. }
  5423. , r = {
  5424. Title: 0,
  5425. Cardboard: 1,
  5426. Gear: 2
  5427. };
  5428. !function() {
  5429. [n, r].forEach(function(e) {
  5430. e.pageCount = Object.keys(e).length
  5431. })
  5432. }(),
  5433. t.exports.ios = n,
  5434. t.exports.standard = r
  5435. }
  5436. , {}],
  5437. 49: [function(e, t, i) {
  5438. "use strict";
  5439. t.exports = {
  5440. Android: "android",
  5441. IOS: "ios",
  5442. Desktop: "desktop",
  5443. UnsupportedAndroid: "android-unsupported"
  5444. }
  5445. }
  5446. , {}],
  5447. 50: [function(e, t, i) {
  5448. "use strict";
  5449. var n = e("three");
  5450. t.exports = {
  5451. UP: new n.Vector3(0,1,0),
  5452. DOWN: new n.Vector3(0,-1,0),
  5453. LEFT: new n.Vector3(-1,0,0),
  5454. RIGHT: new n.Vector3(1,0,0),
  5455. FORWARD: new n.Vector3(0,0,-1),
  5456. BACK: new n.Vector3(0,0,1)
  5457. }
  5458. }
  5459. , {
  5460. three: 217
  5461. }],
  5462. 51: [function(e, t, i) {
  5463. "use strict";
  5464. var n = e("../exception/ViewmodeConvertException")
  5465. , r = e("./coreViewmodes")
  5466. , o = e("../util/common")
  5467. , a = {
  5468. MESH: "mesh",
  5469. OUTDOOR: "outdoor",
  5470. TRANSITIONING: "transitioning",
  5471. toInt: function(e) {
  5472. switch (e) {
  5473. case this.PANORAMA:
  5474. return 1;
  5475. case this.DOLLHOUSE:
  5476. return 2;
  5477. case this.FLOORPLAN:
  5478. return 3;
  5479. case this.OUTDOOR:
  5480. return 4;
  5481. case this.TRANSITIONING:
  5482. return -1
  5483. }
  5484. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5485. },
  5486. fromInt: function(e) {
  5487. switch (e) {
  5488. case "1":
  5489. case 1:
  5490. return this.PANORAMA;
  5491. case "2":
  5492. case 2:
  5493. return this.DOLLHOUSE;
  5494. case "3":
  5495. case 3:
  5496. return this.FLOORPLAN;
  5497. case "4":
  5498. case 4:
  5499. return this.OUTDOOR
  5500. }
  5501. throw new n("No known conversion for int to viewmode for int: " + e)
  5502. },
  5503. convertWorkshopModeInt: function(e) {
  5504. switch (e) {
  5505. case "0":
  5506. case 0:
  5507. case undefined: //xzw add
  5508. return this.PANORAMA;
  5509. case "1":
  5510. case 1:
  5511. return this.FLOORPLAN;
  5512. case "2":
  5513. case 2:
  5514. return this.DOLLHOUSE;
  5515. case "3":
  5516. case 3:
  5517. return this.MESH
  5518. }
  5519. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5520. }
  5521. };
  5522. o.extendObject(a, r),
  5523. t.exports = a
  5524. }
  5525. , {
  5526. "../exception/ViewmodeConvertException": 58,
  5527. "../util/common": 185,
  5528. "./coreViewmodes": 54
  5529. }],
  5530. 52: [function(e, t, i) {
  5531. "use strict";
  5532. t.exports = {
  5533. BLACK: "black",
  5534. STD: "std",
  5535. WALK: "walk"
  5536. }
  5537. }
  5538. , {}],
  5539. 53: [function(e, t, i) {
  5540. "use strict";
  5541. t.exports = {
  5542. ZoomIn: "zoom.in",
  5543. ZoomOut: "zoom.out",
  5544. ZoomMax: "zoom.max",
  5545. ZoomMin: "zoom.min"
  5546. }
  5547. }
  5548. , {}],
  5549. 54: [function(e, t, i) {
  5550. "use strict";
  5551. t.exports = {
  5552. PANORAMA: "panorama",
  5553. DOLLHOUSE: "dollhouse",
  5554. FLOORPLAN: "floorplan"
  5555. }
  5556. }
  5557. , {}],
  5558. 55: [function(e, t, i) {
  5559. "use strict";
  5560. function n(e) {
  5561. this.message = e
  5562. }
  5563. t.exports = n
  5564. }
  5565. , {}],
  5566. 56: [function(e, t, i) {
  5567. "use strict";
  5568. function n(e) {
  5569. r.call(this, e)
  5570. }
  5571. var r = e("./BasicException");
  5572. n.prototype = Object.create(r.prototype),
  5573. t.exports = n
  5574. }
  5575. , {
  5576. "./BasicException": 55
  5577. }],
  5578. 57: [function(e, t, i) {
  5579. "use strict";
  5580. function n(e) {
  5581. r.call(this, e)
  5582. }
  5583. var r = e("./BasicException");
  5584. n.prototype = Object.create(r.prototype),
  5585. t.exports = n
  5586. }
  5587. , {
  5588. "./BasicException": 55
  5589. }],
  5590. 58: [function(e, t, i) {
  5591. "use strict";
  5592. function n(e) {
  5593. r.call(this, e)
  5594. }
  5595. var r = e("./BasicException");
  5596. n.prototype = Object.create(r.prototype),
  5597. t.exports = n
  5598. }
  5599. , {
  5600. "./BasicException": 55
  5601. }],
  5602. 59: [function(e, t, i) {
  5603. (function(i) {
  5604. "use strict";
  5605. function n(e) {
  5606. var t = {};
  5607. if (e) {
  5608. var i = e.flags;
  5609. if (i)
  5610. for (var n in i)
  5611. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5612. return t
  5613. }
  5614. return l.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5615. null
  5616. }
  5617. var r = e("./util/ajax")
  5618. , o = e("./util/showcase")
  5619. , a = e("./util/logger")
  5620. , s = ""
  5621. , l = new a(i)
  5622. , c = {};
  5623. t.exports = {
  5624. loadFeatureFlags: function(e) {
  5625. var t = $.Deferred();
  5626. return r.get(e.urlBase + s, {
  5627. responseType: "json",
  5628. prefetchFrom: "user",
  5629. auth: o.getAuthorizationHeader()
  5630. }).done(function(e) {
  5631. c = n(e),
  5632. c ? t.resolve(c) : t.reject("loading-failed")
  5633. }).fail(function() {
  5634. l.debug("Retrieval of feature flags failed."),
  5635. t.reject("loading-failed")
  5636. }),
  5637. t.promise()
  5638. },
  5639. getFlags: function() {
  5640. return c
  5641. },
  5642. updateDependentSettings: function(e, t) {
  5643. e = e || c,
  5644. e.labels && (t.labels.enabled = !0),
  5645. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5646. e.showcase_sdk && (t.sdkInit = !0),
  5647. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5648. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5649. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5650. e.hide_sc_sharing && (t.share.enabled = !1)
  5651. }
  5652. }
  5653. }
  5654. ).call(this, "/js/featureflags.js")
  5655. }
  5656. , {
  5657. "./util/ajax": 181,
  5658. "./util/logger": 189,
  5659. "./util/showcase": 193
  5660. }],
  5661. 60: [function(e, t, i) {
  5662. "use strict";
  5663. var n = (e("../util/common"),
  5664. {
  5665. status: 0,
  5666. set: function(e) {
  5667. if (isNaN(e))
  5668. return !1;
  5669. var t = $('.progressbar');
  5670. 0 > e && (e = 0);
  5671. e > 100 && (e = 100);
  5672. var width = parseInt(t.css('width').replace("px",""))/100; //获取进度条总长度除以100
  5673. var barperc = e*width;
  5674. var perc = Math.round(e);
  5675. var labelpos = (parseInt(barperc)-15);
  5676. t.find('.bar').css('width',barperc); //已经再跑颜色的百分比
  5677. t.find('.label').css('left', labelpos); //上面跟着的字的百分比
  5678. t.find('.perc').text(perc+'%'); //具体数字的百分比
  5679. this.status = e
  5680. },
  5681. done: function(e) {
  5682. return e || this.status ? (this.status = null,
  5683. this.set(100)) : this
  5684. }
  5685. });
  5686. t.exports.circleLoader = n
  5687. }
  5688. , {
  5689. "../util/common": 185
  5690. }],
  5691. 61: [function(e, t, i) {
  5692. "use strict";
  5693. t.exports = Object.freeze({
  5694. CLOSE: "modal.closer.close"
  5695. })
  5696. }
  5697. , {}],
  5698. 62: [function(e, t, i) {
  5699. "use strict";
  5700. function n(e, t) {
  5701. t && (t.stopPropagation(),
  5702. t.preventDefault()),
  5703. e && this.emit(l.CLOSE, e),
  5704. g.reset()
  5705. }
  5706. function r(e, t) {
  5707. function i() {
  5708. var t = e.offsetHeight >= $("#player").height() && e.offsetWidth >= $("#player").width();
  5709. t !== f && (f = t,
  5710. t ? (e.classList.add("closeByFooter"),
  5711. h.classList.add("closeByFooter")) : (e.classList.remove("closeByFooter"),
  5712. h.classList.remove("closeByFooter")))
  5713. }
  5714. t ? setTimeout(i, o.guiAnimationSpeed) : i()
  5715. }
  5716. var o = e("../../settings")
  5717. , a = (e("../../tag/Media/MediaEvent"),
  5718. e("../../util/browser"))
  5719. , s = e("../../util/common")
  5720. , l = e("./ModalCloserEvent")
  5721. , c = e("events").EventEmitter
  5722. , h = document.getElementsByClassName("footer")[0]
  5723. , u = h.querySelectorAll(".close")[0]
  5724. , d = null
  5725. , p = null
  5726. , f = null
  5727. , g = (a.isMobile(),
  5728. {
  5729. open: function(e) {
  5730. e && (r(e),
  5731. d && u.removeEventListener("click", d, !0),
  5732. d = n.bind(this, e.id),
  5733. u.addEventListener("click", d, !0),
  5734. p && window.removeEventListener("resize", p, !0),
  5735. p = r.bind(this, e),
  5736. window.addEventListener("resize", p, !0))
  5737. },
  5738. reset: function() {
  5739. h.classList.remove("closeByFooter"),
  5740. u.removeEventListener("click", d, !0),
  5741. window.removeEventListener("resize", p, !0),
  5742. d = p = f = null
  5743. }
  5744. });
  5745. s.extendObject(g, c.prototype),
  5746. t.exports = g
  5747. }
  5748. , {
  5749. "../../tag/Media/MediaEvent": 131,
  5750. "../../settings": 166,
  5751. "../../util/browser": 182,
  5752. "../../util/common": 185,
  5753. "./ModalCloserEvent": 61,
  5754. events: 202
  5755. }],
  5756. 63: [function(e, t, i) {
  5757. "use strict";
  5758. function n(e, t, i) {
  5759. var n = new r.GUI({
  5760. width: 400
  5761. })
  5762. , u = n.addFolder("Flydown from Dollhouse");
  5763. u.add(h.flydown, "movementEasing", Object.keys(a)),
  5764. u.add(h.flydown, "movementDelay", 0, 1).step(.01),
  5765. u.add(h.flydown, "rotationEasing", Object.keys(a)),
  5766. u.add(h.flydown, "rotationDelay", 0, 1).step(.01),
  5767. u.add(h.flydown, "modelTextureDelay", 0, 1).step(.01),
  5768. u.add(h.flydown, "skyboxDelay", 0, 1).step(.01),
  5769. u.add(h.dollhouseDefault, "minPolarAngle", 0, o.Math.degToRad(50)),
  5770. u.add(h.dollhouseDefault, "maxPolarAngle", o.Math.degToRad(50), o.Math.degToRad(170));
  5771. var d = n.addFolder("Transition between panos");
  5772. d.add(h.transition, "blur", 0, 10).onFinishChange(function() {}),
  5773. d.add(h.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5774. h.transition.flyTime = 0,
  5775. d.__controllers.forEach(function(e) {
  5776. e.updateDisplay()
  5777. })
  5778. }),
  5779. d.add(h.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5780. h.transition.flySpeed = 0,
  5781. d.__controllers.forEach(function(e) {
  5782. e.updateDisplay()
  5783. })
  5784. }),
  5785. d.add(h.transition, "aimTime", 500, 2500).step(50),
  5786. d.add(h.transition, "aimSlowFactor", 1, 3).step(.1),
  5787. d.add(h.transition, "movementEasing", Object.keys(a));
  5788. var p = n.addFolder("Path Display");
  5789. p.add(h.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5790. p.add(h.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5791. p.add(h.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5792. p.add(h.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5793. p.add(h.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5794. p.add(h.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5795. p.add(h.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5796. p.add(h.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5797. p.add(h.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5798. p.add(h.path, "color", Object.keys(l)).onFinishChange(function() {
  5799. h.path.color = l[h.path.color],
  5800. h.path.colorUp = l._desat(h.path.color),
  5801. h.path.colorDown = l.darken(h.path.color)
  5802. }),
  5803. p.add(h, "reticuleColor", Object.keys(l)).onFinishChange(function() {
  5804. h.reticuleColor = l[h.reticuleColor]
  5805. });
  5806. var f = n.addFolder("Warping")
  5807. , g = f.addFolder("Warp/Teleport");
  5808. g.add(h.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5809. g.add(h.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5810. g.add(h.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5811. g.add(h.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5812. g.add(h.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5813. g.add(h.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5814. g.add(h.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5815. g.add(h.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5816. g.add(h.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5817. g.add(h.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5818. g.add(h.path, "mapGuides").onFinishChange(function() {}),
  5819. g.add(h.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5820. g.add(h.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5821. g.add(h.path, "typ", Object.keys(c)).onFinishChange(function() {
  5822. h.path.typ = c[h.path.typ]
  5823. }),
  5824. g.add(h.warp, "loop").onChange(function() {}).onFinishChange(function() {
  5825. t.endlessLoop = h.warp.loop
  5826. }),
  5827. g.add(h.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  5828. g.add(h.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  5829. g.add(h.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  5830. var m = f.addFolder("Long Warp Only");
  5831. m.add(h.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  5832. h.warp.flySpeed = 0,
  5833. m.__controllers.forEach(function(e) {
  5834. e.updateDisplay()
  5835. })
  5836. }),
  5837. m.add(h.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  5838. m.add(h.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  5839. m.add(h.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  5840. m.add(h.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5841. m.add(h.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5842. m.add(h.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  5843. m.add(h.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  5844. m.add(h.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  5845. m.add(h.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  5846. var v = n.addFolder("Warp Esoterica");
  5847. v.add(h.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  5848. v.add(h.warp, "blur", .01, 1).onFinishChange(function() {}),
  5849. v.add(h.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5850. h.warp.minWarpTime = 0,
  5851. v.__controllers.forEach(function(e) {
  5852. e.updateDisplay()
  5853. })
  5854. }),
  5855. v.add(h.warp, "showBunny").onFinishChange(function() {}),
  5856. v.add(h.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  5857. v.add(h.warp, "movementEasing", Object.keys(a));
  5858. var A = n.addFolder("Misc");
  5859. A.add(h, "dollhouseFOV", 10, 180).onChange(function() {
  5860. i.cameras[s.DOLLHOUSE].fov = h.dollhouseFOV
  5861. }),
  5862. A.add(h, "insideFOV", 10, 180).onChange(function() {
  5863. i.cameras[s.PANORAMA].fov = h.insideFOV
  5864. }),
  5865. A.add(h, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  5866. A.add(h, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  5867. A.add(h, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  5868. var y = n.addFolder("Navigation");
  5869. y.add(h.navigation, "panoScores").onFinishChange(function() {
  5870. h.navigation.panoScores || e.panos.forEach(function(e) {
  5871. e.floor.remove(e.text3d),
  5872. e.text3d = null
  5873. })
  5874. }),
  5875. y.add(h.navigation, "mouseDirection"),
  5876. y.add(h.navigation, "filterStrictness", 0, 1),
  5877. y.add(h.navigation, "angleFactor", -60, 0),
  5878. y.add(h.navigation, "directionFactor", 1, 20),
  5879. y.add(h.navigation, "distanceFactor", -5, 5),
  5880. y.add(h.navigation, "optionalityFactor", .1, 10);
  5881. var C = n.addFolder("tags")
  5882. , I = C.addFolder("Tag Creation");
  5883. I.add(h.tags.pole, "enabled").name("poleEnabled"),
  5884. I.add(h.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  5885. I.add(h.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  5886. I.add(h.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  5887. var E = C.addFolder("Visibility");
  5888. E.add(h.tags.visibility, "anyDistance"),
  5889. E.add(h.tags.visibility, "visibleDistance", .1, 30).step(.1),
  5890. E.add(h.tags.visibility, "cameraClearance", 0, 1).step(.01),
  5891. E.add(h.tags.visibility, "hideViaFloor"),
  5892. E.add(h.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  5893. E.add(h.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  5894. var b = C.addFolder("Disc Parameters");
  5895. b.add(h.tags.disc.scale, "nearBound", .1, 10).step(.1),
  5896. b.add(h.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  5897. b.add(h.tags.disc.scale, "linkFarBound").onChange(function(e) {
  5898. e && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - h.tags.disc.scale.linkPercent / 100))
  5899. }),
  5900. b.add(h.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  5901. h.tags.disc.scale.linkFarBound && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - e / 100))
  5902. }),
  5903. b.add(h.tags.disc.scale, "maxSize", 40, 200).step(1),
  5904. b.add(h.tags.disc.scale, "minSize", 20, 100).step(1),
  5905. b.add(h.tags.disc.scale, "responsiveness", 0, 100).step(1);
  5906. var w = C.addFolder("Navigate");
  5907. w.add(h.tags.navigate, "nearestPano").name("nearestPano"),
  5908. w.add(h.tags.navigate, "lineOfSight").name("lineOfSight"),
  5909. w.add(h.tags.navigate, "reactivate").name("reactivate"),
  5910. w.add(h.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  5911. w.add(h.tags.navigate, "tiltTolerance", 0, 50).step(1),
  5912. w.add(h.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  5913. var _ = n.addFolder("Debug");
  5914. _.add(h, "wireframe").onFinishChange(function() {
  5915. e.chunks.forEach(function(t) {
  5916. t.material && (t.wireframeTwin || (t.wireframeTwin = new o.WireframeHelper(t),
  5917. t.wireframeTwin.material.depthWrite = !1,
  5918. t.wireframeTwin.material.depthTest = !1,
  5919. t.wireframeTwin.material.opacity = .5,
  5920. t.wireframeTwin.material.transparent = !0),
  5921. h.wireframe ? e.add(t.wireframeTwin) : e.remove(t.wireframeTwin))
  5922. })
  5923. }),
  5924. _.add(h, "skyboxWireframe").onFinishChange(function() {
  5925. h.skyboxWireframe ? (e.skybox.wireframe = new o.WireframeHelper(e.skybox),
  5926. e.add(e.skybox.wireframe)) : (e.remove(e.skybox.wireframe),
  5927. e.skybox.wireframe = null)
  5928. }),
  5929. _.add(h, "showSweeps").onFinishChange(function() {
  5930. e.setSweepVisibility(h.showSweeps)
  5931. }),
  5932. _.add(h, "showMesh").onFinishChange(function() {
  5933. e.chunks.forEach(function(e) {
  5934. e.visible = h.showMesh
  5935. })
  5936. }),
  5937. _.add(h, "showFloors").onFinishChange(function() {
  5938. e.floors.forEach(function(e) {
  5939. e.collider.children.forEach(function(e) {
  5940. e.material.visible = h.showFloors
  5941. })
  5942. })
  5943. }),
  5944. _.add(h, "showSkyboxes").onFinishChange(function() {
  5945. e.panos.forEach(function(e) {
  5946. e.skyboxMesh.visible = h.showSkyboxes
  5947. })
  5948. }),
  5949. _.add(h, "showNeighbors").onChange(function() {}),
  5950. _.add(e, "alpha", 0, 1)
  5951. }
  5952. var r = e("../lib/dat.gui")
  5953. , o = e("three")
  5954. , a = e("../util/easing")
  5955. , s = e("../enum/Viewmode")
  5956. , l = e("../enum/Colors")
  5957. , c = e("../enum/WarpStyle")
  5958. , h = e("../settings");
  5959. e("../tag/tag");
  5960. r.GUI.prototype.removeFolder = function(e) {
  5961. var t = this.__folders[e];
  5962. t && (t.close(),
  5963. this.__ul.removeChild(t.domElement.parentNode),
  5964. delete this.__folders[e],
  5965. this.onResize())
  5966. }
  5967. ,
  5968. t.exports.toggle = n
  5969. }
  5970. , {
  5971. "../enum/Colors": 19,
  5972. "../enum/Viewmode": 51,
  5973. "../enum/WarpStyle": 52,
  5974. "../lib/dat.gui": 93,
  5975. "../tag/tag": 123,
  5976. "../settings": 166,
  5977. "../util/easing": 186,
  5978. three: 217
  5979. }],
  5980. 64: [function(e, t, i) {
  5981. (function(i) {
  5982. "use strict";
  5983. function n(e, t, i, n) {
  5984. $(".gui-error .error-problem-text").text(e),
  5985. $(".gui-error .error-solution-text").text(t),
  5986. $(".gui-error .error-explanation").text(i),
  5987. $(".gui-error .error-actions").html(n),
  5988. $(window).resize(),
  5989. $(".gui-error").fadeIn(),
  5990. $("#bottom-logo").fadeIn()
  5991. }
  5992. function r(e) {
  5993. var t = ['<div class="browser-tiles">', '<div class="tile">', '<a href="https://www.google.com/chrome/browser/" target="_blank">', '<img class="icon" src="images/icon_Google_Chrome_2011.png" ', 'rel="tiletip" title="Chrome"></a>', "</div>", '<div class="tile">', '<a href="https://www.mozilla.org/en-US/firefox/new/" target="_blank">', '<img class="icon" src="images/icon_Mozilla_Firefox.png" ', 'rel="tiletip" title="Firefox"></a>', "</div>", '<div class="tile">', '<a href="http://windows.microsoft.com/en-us/internet-explorer/download-ie" target="_blank">', '<img class="icon" src="images/icon_Internet_Explorer_10.png" ', 'rel="tiletip" title="Internet Explorer"></a>', "</div>", '<div class="tile">', '<a href="https://support.apple.com/en-us/HT204416" target="_blank">', '<img class="icon" src="images/icon_MacOSX_Safari.png" ', 'rel="tiletip" title="Safari"></a>', "</div>", "</div>"].join("");
  5994. n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
  5995. s.isMobile() || $("[rel=tiletip]").tooltip({
  5996. placement: "bottom",
  5997. delay: {
  5998. show: 50,
  5999. hide: 0
  6000. },
  6001. trigger: "hover",
  6002. viewport: {
  6003. selector: "body",
  6004. padding: 10
  6005. }
  6006. })
  6007. }
  6008. function o() {
  6009. var e = s.isMobile() ? "" : '<span class="link install-browser">' + h.ERROR_GENERIC_ACTIONS_2 + "</span>" + h.ERROR_GENERIC_ACTIONS_3
  6010. , t = [h.ERROR_GENERIC_ACTIONS_1, e,].join("");
  6011. n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, "", t),
  6012. s.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  6013. e.preventDefault(),
  6014. e.stopPropagation(),
  6015. r(" ")
  6016. })
  6017. }
  6018. function a(e) {
  6019. if ($("head title").text(c.pageTitle),
  6020. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  6021. $("#gui-loading").fadeOut(250),
  6022. $("#quick-blackout").hide(),
  6023. l.track("showcase_error", {
  6024. error_key: e
  6025. }),
  6026. h.locale || h.init(),
  6027. "webgl-unsupported" === e)
  6028. s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  6029. else if ("webgl-ios" === e)
  6030. n(h.ERROR_WEBGL_IOS_PROBLEM, h.ERROR_WEBGL_IOS_SOLUTION, "", h.ERROR_WEBGL_IOS_ACTIONS_1 + "<strong>" + h.ERROR_WEBGL_IOS_ACTIONS_2 + "</strong>.");
  6031. else if ("webgl-safari" === e)
  6032. n(h.ERROR_WEBGL_SAFARI_PROBLEM, "", "", h.ERROR_WEBGL_SAFARI_ACTIONS_1 + "<strong>" + h.ERROR_WEBGL_SAFARI_ACTIONS_2 + "</strong>. " + h.ERROR_WEBGL_SAFARI_ACTIONS_3 + "<strong>" + h.ERROR_WEBGL_SAFARI_ACTIONS_4 + "</strong>.");
  6033. else if ("webgl-generic" === e)
  6034. o();
  6035. else if ("missing-urls" === e)
  6036. n(h.ERROR_MISSING_URLS_PROBLEM, "", h.ERROR_MISSING_URLS_EXPLANATION);
  6037. else if ("loading-failed" === e)
  6038. n(h.ERROR_LOADING_FAILED_PROBLEM, "", "", h.ERROR_LOADING_FAILED_ACTIONS_1 + '<a class="link" target="_blank" href=' + p + ">" + h.ERROR_LOADING_FAILED_ACTIONS_2 + "</a>.");
  6039. else {
  6040. if ("loading-failed-maintenance" !== e)
  6041. return void d.error("Unhandled error: " + e);
  6042. n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION)
  6043. }
  6044. }
  6045. var s = e("./../util/browser")
  6046. , l = e("./../analytics")
  6047. , c = e("./../settings")
  6048. , h = e("../localization/localize")
  6049. , u = e("./../util/logger")
  6050. , d = new u(i)
  6051. , p = '"https://support.port.com/hc/articles/208220058"';
  6052. t.exports.error = a
  6053. }
  6054. ).call(this, "/js/gui/error.js")
  6055. }
  6056. , {
  6057. "../localization/localize": 108,
  6058. "./../analytics": 4,
  6059. "./../settings": 166,
  6060. "./../util/browser": 182,
  6061. "./../util/logger": 189
  6062. }],
  6063. 65: [function(e, t, i) {
  6064. (function(i) {
  6065. "use strict";
  6066. function n() {
  6067. Ue = [],
  6068. je.floors.visible && Ue.push(".gui-floor", ".gui-floor-title"),
  6069. Ue.push(".hideTarget", ".pinTop.right")
  6070. }
  6071. function r() {
  6072. for (var e in je)
  6073. if (je.hasOwnProperty(e)) {
  6074. var t = je[e];
  6075. if (!t.visible)
  6076. for (var i = 0; i < t.elements.length; i++)
  6077. $(t.elements[i]).hide()
  6078. }
  6079. je.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6080. je.tourControls.visible === !1 && $("#drawer").addClass("fullWidth"),
  6081. n()
  6082. }
  6083. function o(e, t) {
  6084. var i = !K.isMobile() && Q.zoom.enabled && t.mode === _e.PANORAMA && !e.tourIsPlaying;
  6085. $("#gui-zoomin").toggle(i),
  6086. $("#gui-zoomout").toggle(i)
  6087. }
  6088. function a() {
  6089. c(),
  6090. $(".pinBottom").toggleClass("open"),
  6091. $("#drawer").toggleClass("open"),
  6092. $(".footer").toggleClass("open"),
  6093. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", Re.CLOSE_HIGHLIGHTS),
  6094. Ze("highlights")) : ($("#pullTab .icon").attr("data-original-title", Re.OPEN_HIGHLIGHTS),
  6095. ie.resetDrawer()),
  6096. setTimeout(function() {
  6097. $("#pullTab").toggleClass("opened");
  6098. }, $("#drawer").hasClass("open") ? 0 : Q.highlightAnimationDuration),
  6099. $(".pinBottom").hasClass("open") && s($(".vr-popup")) && $(".vr-popup").is(":visible") && Ae.dismiss()
  6100. }
  6101. function s(e) {
  6102. var t;
  6103. "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6104. t = e.position().top + e.outerHeight(),
  6105. e.attr("style", "display: none"));
  6106. var i = $("#player").outerHeight()
  6107. , n = i - 130;
  6108. return n < t + 25
  6109. }
  6110. function l(e) {
  6111. "touchstart" === e.type && e.preventDefault(),
  6112. e.stopPropagation()
  6113. }
  6114. function c() {
  6115. W && (W.reload(),
  6116. W.init())
  6117. }
  6118. function h(e) {
  6119. ne.show(e),
  6120. r()
  6121. }
  6122. function u(e) {
  6123. ne.progress(e)
  6124. }
  6125. function d(e, t, i) {
  6126. var n = t.player;
  6127. $("#gui-thumb").fadeOut(2500),
  6128. ne.hide(function() {
  6129. Ge = !1
  6130. }),
  6131. me.init(e, i),
  6132. de.finishSetup(Object.keys(e.tags).length),
  6133. i.on(Te.IMAGE_OPENED, Ze.bind(this, "tag"));
  6134. var s = function() {
  6135. i.dismissExaminedTag(),
  6136. i.disableHovering()
  6137. };
  6138. Ae.on(ye.OPENED, s),
  6139. Ce.on(Me.OPENED, s),
  6140. he.on(ue.OPENED, s),
  6141. fe.on(ge.OPENED, s);
  6142. var l = i.enableHovering.bind(i);
  6143. if (Ae.on(ye.CLOSED, l),
  6144. Ce.on(Me.CLOSED, l),
  6145. he.on(ue.CLOSED, l),
  6146. fe.on(ge.CLOSED, l),
  6147. Q.labels.enabled && Object.keys(e.labels).length,
  6148. e.floors.length <= 1 || !je.floors.visible ? je.floors.visible = !1 : (y(e, t),
  6149. C(e.currentFloor, n.mode)),
  6150. getQueryVariable('m') === '372'&& (je.floors.visible = 1, y(e,t)),
  6151. r(),
  6152. o(t, t.player),
  6153. $("#gui").fadeIn(1500),
  6154. je.highlight.visible && (2 !== Q.startHighlights || e.has360Views) && setTimeout(function() {
  6155. a(),
  6156. (!e.has360Views && 1 !== Q.startHighlights || e.has360Views && 0 === Q.startHighlights) && setTimeout(a, 2e3)
  6157. }, 2e3),
  6158. !K.isMobile())
  6159. for (var c = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], h = 0; h < c.length; h++)
  6160. $(c[h]).addClass("hasHover");
  6161. O(e),
  6162. de.setupToggling();
  6163. //xzw:
  6164. window.editHotPanel && editHotPanel();
  6165. //czj
  6166. navBorderRadius(e);
  6167. //czj 编辑界面
  6168. //window.EditingInterface && new EditingInterface(n.sceneRenderer);
  6169. window.EditTools && new EditTools(n.sceneRenderer);
  6170. }
  6171. function navBorderRadius(e){
  6172. var pullTab = $("#pullTab"),
  6173. mobileRadius = {
  6174. "bottom":{"border-bottom-left-radius":"10px","border-bottom-right-radius":"10px"},
  6175. "top":{"border-top-left-radius":"10px","border-top-right-radius":"10px"}
  6176. },
  6177. topRadius = {
  6178. "bottom":{"border-top-right-radius":"10px","border-bottom-right-radius":"10px"},
  6179. "top":{"border-bottom-left-radius":"10px","border-top-left-radius":"10px"}
  6180. };
  6181. function BorderRadius(bottom,top){
  6182. $("#gui-modes-map > div:visible:last").css(bottom);
  6183. if(pullTab.is(':visible')){
  6184. $(".viewContainer > div:visible:first").css(top);
  6185. }else{
  6186. $("#gui-modes-map > div:visible:first").css(top);
  6187. }
  6188. }
  6189. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  6190. BorderRadius(mobileRadius.bottom,mobileRadius.top);
  6191. }else{
  6192. BorderRadius(topRadius.bottom,topRadius.top);
  6193. }
  6194. //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
  6195. if(window.MP_PREFETCHED_MODELDATA.model.special || window.MP_PREFETCHED_MODELDATA.special === "true"){
  6196. window.specialScene && specialScene.special().afterImplement();
  6197. }
  6198. }
  6199. function p(e) {
  6200. e || (e = 0),
  6201. We = !1,
  6202. window.setTimeout(function() {
  6203. We || (ze = !0,
  6204. $("#gui-spinner").stop(!0, !0).show())
  6205. }
  6206. .bind(this), e)
  6207. }
  6208. function f() {
  6209. $("#gui-spinner").stop(!0, !0),
  6210. $("#gui-spinner").fadeOut(1e3),
  6211. We = !0,
  6212. ze = !1
  6213. }
  6214. function g(e, t) {
  6215. var i = e.mode
  6216. , n = t || e.currentPano;
  6217. $("#gui-modes-dollhouse").toggleClass("active", i === _e.DOLLHOUSE),
  6218. $("#gui-modes-floorplan").toggleClass("active", i === _e.FLOORPLAN),
  6219. $("#gui-modes-inside").toggleClass("active", i === _e.PANORAMA),
  6220. i === _e.PANORAMA ? ($("#view-controllers").slideUp(500),
  6221. Q.show360Views.enabled && !n.isAligned() ? (
  6222. $(".gui-floor").addClass("hidden"),
  6223. $("#gui-modes-outside").addClass("desktop-only")) : (
  6224. $(".gui-floor").removeClass("hidden"),
  6225. $("#gui-modes-outside").removeClass("desktop-only")),
  6226. $("#gui-modes-outside").removeClass("hidden")) : i !== _e.TRANSITIONING && (f(),
  6227. Be = i,
  6228. $("#gui-modes-outside").addClass("hidden"),
  6229. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6230. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(Q.guiAnimationSpeed))
  6231. }
  6232. function m(e, t) {
  6233. var i = t.player;
  6234. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6235. l(e),
  6236. J.updateInteraction(Se.InteractionGui, "inside-button"),
  6237. J.track("USER", {
  6238. event_type: "showcase_gui",
  6239. gui_action: "click_inside_mode_button"
  6240. }),
  6241. t.changeMode(_e.PANORAMA);
  6242. }),
  6243. $("#gui-modes-outside").find("a").on("click", function(e) {
  6244. l(e),
  6245. J.track("showcase_gui", {
  6246. gui_action: "click_outside_mode_button"
  6247. }),
  6248. t.changeMode(Be)
  6249. }),
  6250. $("#gui-modes-floorplan").on("click", function(e) {
  6251. l(e),
  6252. i.mode !== _e.FLOORPLAN && (J.track("showcase_gui", {
  6253. gui_action: "click_floorplan_mode_button"
  6254. }),
  6255. t.changeMode(_e.FLOORPLAN));
  6256. }),
  6257. $("#gui-modes-dollhouse").on("click", function(e) {
  6258. l(e),
  6259. i.mode !== _e.DOLLHOUSE && (J.track("showcase_gui", {
  6260. gui_action: "click_dollhouse_mode_button"
  6261. }),
  6262. t.changeMode(_e.DOLLHOUSE));
  6263. })
  6264. }
  6265. function v(e, t) {
  6266. function i() {
  6267. document.getElementById("vr").classList.remove("hidden"),
  6268. Q.vr.allowWebVR ? K.getVRDisplay().then(function(e) {
  6269. K.supportsFullscreen() ? n(e) : (De.warn("Unable to use WebVR when full screen is not supported"),
  6270. $(".improper-embed").toggleClass("hidden", !1),
  6271. r())
  6272. }, function(e) {
  6273. r()
  6274. }) : r()
  6275. }
  6276. function n(i) {
  6277. De.info(i.displayName + " detected, VR button activates WebVR experience"),
  6278. Ie.init(e.data, t, i, q),
  6279. Ie.on(Ee.OPENED, Ze.bind(gui, "vr")),
  6280. Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe))
  6281. }
  6282. function r() {
  6283. De.info("WebVR support not found, VR button activates native app VR modal"),
  6284. Ae.init(e.data, q),
  6285. Ae.on(ye.OPENED, function() {
  6286. var e = document.getElementById("vr-modal");
  6287. return function() {
  6288. Ze("vr"),
  6289. le.open(e)
  6290. }
  6291. }()),
  6292. Ae.on(ye.CLOSED, le.reset)
  6293. }
  6294. if (Q.vr.enabled && e.supportsVR && !K.valueFromHash("mls", 0))
  6295. switch (Q.vr.option) {
  6296. case Pe.CONTEXTUAL:
  6297. i();
  6298. break;
  6299. case Pe.ANDROID:
  6300. K.detectAndroid() && i();
  6301. break;
  6302. case Pe.NONE:
  6303. }
  6304. }
  6305. function A(e, t) {
  6306. $("#play").find("a").on("mousedown touchstart", function(e) {
  6307. l(e);
  6308. Ze("tour");
  6309. ve.play();
  6310. J.trackAlways("showcase_gui", {
  6311. gui_action: "play_highlights"
  6312. })
  6313. }),
  6314. window.startAndPlay = function(e) {
  6315. // l(e);
  6316. Ze("tour");
  6317. ve.play();
  6318. J.trackAlways("showcase_gui", {
  6319. gui_action: "play_highlights"
  6320. })
  6321. };
  6322. $("#pause").find("a").on("mousedown touchstart", function(e) {
  6323. l(e),
  6324. ve.pause(),
  6325. J.trackAlways("showcase_gui", {
  6326. gui_action: "pause_highlights"
  6327. })
  6328. }),
  6329. $("#gui-zoomin").find("a").on("click", function(e) {
  6330. l(e),
  6331. t.player.zoomInIncrementally()
  6332. }),
  6333. $("#gui-zoomout").find("a").on("click", function(e) {
  6334. l(e),
  6335. t.player.zoomOutIncrementally()
  6336. })
  6337. }
  6338. function y(e, t) {
  6339. for (var i = $(".gui-floor"), n = 0; n < e.floors.length; n++) {
  6340. if(getQueryVariable('m') === '372') continue;
  6341. var r = $('<div class="floorChoice" data-index="' + n + '"></div>').text(e.floors.get(n).name);
  6342. $(".gui-floor").find(".container").prepend(r)
  6343. //cxz 本来一开始是prepend 后来改了append 按顺序插入
  6344. }
  6345. i.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + Re.FLOOR_ALL + "</div>"),
  6346. i.on("click", function(e) {
  6347. l(e),
  6348. Ze("floor"),
  6349. i.toggleClass("open")
  6350. }),
  6351. $(".floorChoice").on("click", function(e) {
  6352. l(e);
  6353. var n = $(this).data("index");
  6354. "all" !== n ? (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6355. t.player.gotoFloor(n),
  6356. J.track("showcase_gui", {
  6357. gui_action: "click_floor_select_button",
  6358. interaction_source: "gui"
  6359. })) : (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6360. Ze("move"),
  6361. t.allFloors(),
  6362. J.track("showcase_gui", {
  6363. gui_action: "click_toggle_all_floors_button",
  6364. interaction_source: "gui"
  6365. })),
  6366. i.removeClass("open")
  6367. })
  6368. }
  6369. function C(e, t) {
  6370. e && (t === _e.DOLLHOUSE || t === _e.FLOORPLAN ? ($(".allFloorBtn").show(),$(".gui-floor-icon").hide(),$(".gui-floor-title").show()) : ($(".allFloorBtn").hide(),$(".gui-floor-icon").show(),$(".gui-floor-title").hide()),
  6371. e.model.allFloorsVisible ? ($(".gui-floor-title").text(Re.FLOOR_ALL),
  6372. $(".gui-floor-number").text(Re.FLOOR_ALL),
  6373. $(".floorChoice").removeClass("active"),
  6374. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6375. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6376. $(".floorChoice").removeClass("active"),
  6377. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6378. }
  6379. function I(e) {
  6380. return e.describe().inTransition
  6381. }
  6382. function E(e) {
  6383. $("<img/>").attr("src", e).on("load", function() {
  6384. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  6385. $(this).remove()
  6386. })
  6387. }
  6388. function b(e, t, i) {
  6389. Fe = e.heroLocations.length;
  6390. var n = '<li class="thumbImg" data-index=""><img src=""></li>'
  6391. , r = 100 / Fe + "%"
  6392. , o = $("#thumb-container")
  6393. , a = $("#progressBar");
  6394. $("#status").find(".totalSteps").text(Fe);
  6395. for (var s = 0; s < Fe; s++) {
  6396. var c = e.heroLocations[s]
  6397. , h = $(n);
  6398. if (h.attr("data-index", s),
  6399. je.highlight.visible && h.find("img").attr("src", c.thumbUrl),
  6400. c.name) {
  6401. var u = $('<div class="overlay"></div>').text(c.name);
  6402. h.prepend(u)
  6403. }
  6404. if (e.has360Views && c.cameraMode === _e.PANORAMA) {
  6405. var d = e.panos.get(c.panoId)
  6406. , p = d && !d.isAligned()
  6407. , f = p ? '<div><img class="mark360View" src="images/mark-360-white-v2.png"></div>' : '<div><img class="markInsideView" src="images/mark-inside-white.png"></div>';
  6408. h.prepend(f)
  6409. }
  6410. o.append(h),
  6411. a.append('<div class="step" data-idx="' + s + '" style="width:' + r + '"></div>')
  6412. }
  6413. j = 144 * Fe,
  6414. Y = 111 * Fe,
  6415. $(".thumbImg").on("mouseover", function() {
  6416. I(t) || i.showPathToHeroLocation($(this).data("index"))
  6417. }),
  6418. $(".thumbImg").on("mouseout", function() {
  6419. t.clearPath()
  6420. }),
  6421. $(".thumbImg").on("click", function(e) {
  6422. l(e);
  6423. var i = $(this);
  6424. J.updateInteraction(Se.InteractionGui, "thumbnail"),
  6425. J.trackAlways("showcase_gui", {
  6426. gui_action: "click_highlight"
  6427. }),
  6428. t.goToHighlight(i.data("index"))
  6429. }),
  6430. $(".previous").find("a").on("click", function(e) {
  6431. l(e),
  6432. J.trackAlways("showcase_gui", {
  6433. gui_action: "prev_highlight"
  6434. }),
  6435. t.prevHighlight()
  6436. }),
  6437. $(".next").find("a").on("click", function(e) {
  6438. l(e),
  6439. J.trackAlways("showcase_gui", {
  6440. gui_action: "next_highlight"
  6441. }),
  6442. t.nextHighlight()
  6443. }),
  6444. $("#drawer").on("mouseleave", function(e) {
  6445. l(e);
  6446. var t;
  6447. try {
  6448. t = new MouseEvent("mouseup",{
  6449. clientX: e.clientX,
  6450. clientY: e.clientY,
  6451. screenX: e.screenX,
  6452. screenY: e.screenY
  6453. })
  6454. } catch (i) {
  6455. t = document.createEvent("MouseEvents"),
  6456. t.initMouseEvent("mouseup", e.bubbles, e.cancelable, e.view, e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget)
  6457. }
  6458. document.dispatchEvent(t)
  6459. }),
  6460. W = new Sly($("#scrollFrame"),{
  6461. horizontal: !0,
  6462. itemNav: "centered",
  6463. smart: !0,
  6464. scrollTrap: !0,
  6465. scrollBy: 1,
  6466. mouseDragging: !0,
  6467. touchDragging: !0,
  6468. speed: 300,
  6469. dragHandle: !0,
  6470. dynamicHandle: !0,
  6471. clickBar: !0,
  6472. scrollBar: $("#scroller"),
  6473. activateOn: null
  6474. }).init(),
  6475. W.on("active", function(e, t) {
  6476. Ve = t,
  6477. Ze("tour"),
  6478. $(".step").removeClass("active"),
  6479. $("#status").find(".curIdx").text(t + 1);
  6480. for (var i = 0; i <= t; i++)
  6481. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6482. }),
  6483. w()
  6484. }
  6485. function w() {
  6486. var e = $("#player").width() - 20
  6487. , t = $("#scroller")
  6488. , i = $("#drawer")
  6489. , n = $(".pinBottom");
  6490. if ($("#player").width() < 488 || $("#player").height() < 488)
  6491. t.addClass("hidden"),
  6492. i.addClass("noScroll"),
  6493. n.addClass("noScroll");
  6494. else {
  6495. var r = j > e
  6496. , o = !i.hasClass("noScroll")
  6497. , a = r !== o;
  6498. a && (t.toggleClass("hidden"),
  6499. i.toggleClass("noScroll"),
  6500. n.toggleClass("noScroll"))
  6501. }
  6502. }
  6503. function _(e) {
  6504. je.tourControls.visible = true//e.tour_buttons && K.valueFromHash("gt", 1),
  6505. je.coBrand.visible = e.presented_by && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", !1),
  6506. je.highlight.visible = /* e.highlight_reel && */ 1 !== Q.specialEdition && Q.showHighlights
  6507. }
  6508. function T(e) {
  6509. function t(t, i) {
  6510. return !!e.player_options[t] && e[i || t]
  6511. }
  6512. $(".model-title").text(e.name);
  6513. var i = Q.pageTitle;
  6514. // 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
  6515. 2 !== K.valueFromHash("mls", 0) && (i = e.name),
  6516. document.title = i,
  6517. K.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  6518. delay: {
  6519. show: 50,
  6520. hide: 0
  6521. },
  6522. trigger: "hover",
  6523. html: !1,
  6524. viewport: {
  6525. selector: "body",
  6526. padding: 10
  6527. }
  6528. }),
  6529. K.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  6530. // t("presented_by") && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", 0) ? document.getElementById("loaderCoBrandName").innerText = t("presented_by") : document.getElementById("loaderCoBrand").classList.add("hidden"),
  6531. de.populate({
  6532. name: t("model_name", "name"),
  6533. coBrand: t("presented_by"),
  6534. description: t("model_summary", "summary") || "暂无内容",
  6535. contactName: t("contact_name"),
  6536. address: t("address"),
  6537. phone: t("contact_phone"),
  6538. formattedPhone: e.formatted_contact_phone,
  6539. email: t("contact_email"),
  6540. url: t("external_url"),
  6541. socialSharing: e.enable_social_sharing && e.is_public
  6542. })
  6543. }
  6544. function x(e, t, i, n, r, o) {
  6545. function a() {
  6546. o.setLoadingStartTime(),
  6547. H(),
  6548. r ? (re.showMessage(t, i, je.coBrand.visible),
  6549. l()) : h(l)
  6550. }
  6551. var s = $.Deferred()
  6552. , l = s.resolve.bind(s);
  6553. return Ge = !0,
  6554. O(e),
  6555. e.data.player_options && _(e.data.player_options),
  6556. 1 === Q.specialEdition && $("body").addClass("specialEdition"),
  6557. Re.localizeGUI(),
  6558. T(e.data),
  6559. r || $(".quick").addClass("hidden"),
  6560. e.data.image && !r && E(e.data.image),
  6561. n ? (J.impression(),
  6562. a()) : (o.setWaitingStartTime(),
  6563. oe.show(r, a)),
  6564. s
  6565. }
  6566. function S(e, t, i, n, r, a, s) {
  6567. q = s,
  6568. e.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6569. e.supportedModes[_e.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6570. ae.init(),
  6571. re.init(e, a),
  6572. Oe.init(e, t, n),
  6573. $(".icon").on("mouseover", function() {
  6574. t.player && t.player.reticule.hide()
  6575. }),
  6576. m(e, t),
  6577. A(e, t),
  6578. e.data.enable_social_sharing && e.data.is_public && Q.share.enabled && (Ce.init(e.data.name),
  6579. Ce.on(Me.OPENED, function() {
  6580. var e = document.getElementById("share-modal");
  6581. return function() {
  6582. Ze("share"),
  6583. le.open(e)
  6584. }
  6585. }()),
  6586. Ce.on(Me.CLOSED, le.reset)),
  6587. e.heroLocations.length > 1 ? b(e, t, i) : (je.highlight.visible = !1,
  6588. je.tourControls.visible = !1),
  6589. de.on(pe.OPEN_INFO, Ze.bind(this, "info")),
  6590. z(),
  6591. g(i),
  6592. v(e, r),
  6593. e.on("floor.changed", C),
  6594. e.on("waiting", R.bind(this, e)),
  6595. e.on("waiting-done", P.bind(this, e)),
  6596. i.on(xe.ModeChanged, function(e, n) {
  6597. g(i),
  6598. o(t, i),
  6599. n === _e.PANORAMA && i.currentPano && !i.currentPano.isAligned() && (n = _e.OUTDOOR),
  6600. he.updateMode(n)
  6601. }),
  6602. n.on(Se.Move, Ze.bind(this, "move")),
  6603. i.on(xe.Ready, function() {
  6604. ie.init(n, i, i.tagManager, t),
  6605. i.on(xe.ModeChanged, function(e, t) {
  6606. e !== t && $(".vr-popup").is(":visible") && Ae.dismiss()
  6607. })
  6608. }),
  6609. i.on(xe.PanoChosen, function(e, t) {
  6610. g(i, t),
  6611. he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA)
  6612. }),
  6613. le.on(ce.CLOSE, function(e) {
  6614. switch (e) {
  6615. case "vr-modal":
  6616. Ae.dismiss();
  6617. break;
  6618. case "share-modal":
  6619. Ce.hide();
  6620. break;
  6621. case "terms-modal":
  6622. fe.hide()
  6623. }
  6624. });
  6625. var l = $("#play").eq(0)
  6626. , c = $("#pause").eq(0)
  6627. , h = $(".pinBottom").toArray()
  6628. , u = $("#drawer").eq(0)
  6629. , d = $("#playHead").eq(0)
  6630. , p = $("#progressBar").eq(0)
  6631. , f = $("#thumb-container").eq(0)
  6632. , y = f.children()
  6633. , I = p.children();
  6634. t.on("update.controls", function() {
  6635. var n = t.describe();
  6636. n.tourIsPlaying || i.isWarping() ? (je.tourControls.visible && (l.hide(),
  6637. c.show()),
  6638. n.tourInProgress && (h.forEach(function(e) {
  6639. e.classList.add("playing")
  6640. }),
  6641. u.addClass("playing"),
  6642. d.addClass("playing"))) : (je.tourControls.visible && (l.show(),
  6643. c.hide()),
  6644. n.tourInProgress || (ve.stopTour(),
  6645. h.forEach(function(e) {
  6646. e.classList.remove("playing")
  6647. }),
  6648. u.removeClass("playing"),
  6649. d.removeClass("playing")));
  6650. var r, a, s;
  6651. if (null !== n.currentItem) {
  6652. var p, f;
  6653. $("#status").find(".curIdx").text(n.currentItem + 1),
  6654. n.onTheBus ? (p = "active",
  6655. f = "recent") : (f = "active",
  6656. p = "recent");
  6657. var g = null === n.destinationItem || n.currentItem === n.destinationItem;
  6658. for (r = 0; r < e.heroLocations.length; r += 1)
  6659. s = y.eq(r),
  6660. a = I.eq(r),
  6661. s.removeClass(f),
  6662. a.removeClass(f),
  6663. n.onTheBus && r === n.destinationItem ? (s.addClass(p),
  6664. a.addClass(p),
  6665. W.activate(r)) : n.onTheBus && g && r === n.currentItem ? (s.addClass(p),
  6666. a.addClass(p)) : (s.removeClass(p),
  6667. a.removeClass(p))
  6668. } else
  6669. for (r = 0; r < e.heroLocations.length; r += 1)
  6670. s = y.eq(r),
  6671. a = I.eq(r),
  6672. s.removeClass("active recent"),
  6673. a.removeClass("active recent");
  6674. o(t, i)
  6675. }),
  6676. document.addEventListener("keydown", function(n) {
  6677. switch (J.updateInteraction(Se.InteractionKey),
  6678. n.which) {
  6679. case we.ZERO:
  6680. Q.debug && e.toggleAlpha();
  6681. break;
  6682. case we.NINE:
  6683. Q.debug && se.toggle();
  6684. break;
  6685. case we.ONE:
  6686. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.PANORAMA);
  6687. break;
  6688. case we.TWO:
  6689. e.outsideAllowed() && !i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) && t.changeMode(_e.DOLLHOUSE);
  6690. break;
  6691. case we.THREE:
  6692. e.outsideAllowed() && !i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) && t.changeMode(_e.FLOORPLAN);
  6693. break;
  6694. case we.FOUR:
  6695. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR);
  6696. break;
  6697. case we.SPACE:
  6698. je.tourControls.visible && ($("#playHead").hasClass("playing") || Ze("tour"));
  6699. break;
  6700. case we.RETURN:
  6701. Q.debug && e.toggleExplodeUp();
  6702. break;
  6703. case we.P:
  6704. k();
  6705. break;
  6706. case we.U:
  6707. B();
  6708. break;
  6709. case we.X:
  6710. Q.debug && e.toggleExplode();
  6711. break;
  6712. case we.PLUSEQUALS:
  6713. t.player.activatePersistentZooming(!0),
  6714. ie.hideUi();
  6715. break;
  6716. case we.DASHUNDERSCORE:
  6717. t.player.activatePersistentZooming(!1),
  6718. ie.hideUi();
  6719. break;
  6720. case we.SEVEN:
  6721. De.info("Zoom level: " + t.player.zoomLevel + ", FOV: " + t.player.zoomFov);
  6722. break;
  6723. case we.EIGHT:
  6724. t.player.decreaseZoomSpeed();
  6725. break;
  6726. case we.NINE:
  6727. t.player.increaseZoomSpeed()
  6728. }
  6729. return i && i.reticule.hide(),
  6730. !0
  6731. }
  6732. .bind(this)),
  6733. document.addEventListener("keyup", function(e) {
  6734. switch (e.which) {
  6735. case we.PLUSEQUALS:
  6736. t.player.deactivatePersistentZooming();
  6737. break;
  6738. case we.DASHUNDERSCORE:
  6739. t.player.deactivatePersistentZooming()
  6740. }
  6741. }
  6742. .bind(this)),
  6743. F(e),
  6744. L(e, t.player),
  6745. M(i),
  6746. te.setAutoPlay(e.heroCount()),
  6747. he.init(i, a.mode),
  6748. he.on(ue.OPENED, Ze.bind(this, "help")),
  6749. fe.init(),
  6750. fe.on(ge.OPENED, function() {
  6751. var e = document.getElementById("terms-modal");
  6752. return function() {
  6753. Ze("terms"),
  6754. le.open(e)
  6755. }
  6756. }()),
  6757. fe.on(ge.CLOSED, le.reset),
  6758. Q.quickstart.enabled || re.delayLanding(a.mode).then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
  6759. (Q.quickstart.enabled || i.model.outsideAllowed()) && ie.init(n, i, i.tagManager, t),
  6760. Q.profiling.enabled && se.show(),
  6761. ve.init(t)
  6762. }
  6763. function M(e) {
  6764. var t = function(e, t) {
  6765. $(e).find("a").each(function(e, i) {
  6766. t ? $(i).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(i).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  6767. i.style.pointerEvents = t ? "auto" : "none"
  6768. })
  6769. }
  6770. , i = function() {
  6771. e.zoomLevel >= Q.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  6772. e.zoomLevel <= Q.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  6773. };
  6774. e.on(Ne.ZoomMax, function() {
  6775. t("#gui-zoomin", !1),
  6776. t("#gui-zoomout", !0)
  6777. }),
  6778. e.on(Ne.ZoomMin, function() {
  6779. t("#gui-zoomin", !0),
  6780. t("#gui-zoomout", !1)
  6781. }),
  6782. e.on(Ne.ZoomIn, function() {
  6783. t("#gui-zoomout", !0)
  6784. }),
  6785. e.on(Ne.ZoomOut, function() {
  6786. t("#gui-zoomin", !0)
  6787. }),
  6788. i()
  6789. }
  6790. function R(e) {
  6791. O(e)
  6792. }
  6793. function P(e) {
  6794. O(e)
  6795. }
  6796. function O(e) {
  6797. var t = e.waitQueue.length;
  6798. t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay)
  6799. }
  6800. function L(e, t) {
  6801. He = {
  6802. gui: null,
  6803. visible: !1,
  6804. model: e,
  6805. player: t
  6806. }
  6807. }
  6808. function D(e, t) {
  6809. function i() {
  6810. var i = t.toJSON();
  6811. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + e.sid + "&start=" + be.serialize(i),
  6812. t.tagManager.activeTag && (n.linkToLocation += "&tag=" + t.tagManager.activeTag.sid)
  6813. }
  6814. var n = {}
  6815. , r = new Le.GUI({
  6816. autoPlace: !0,
  6817. width: "60%"
  6818. });
  6819. i(),
  6820. t.on(xe.ViewChanged, i),
  6821. r.add(n, "linkToLocation").name(Re.LINK_TO_LOCATION).listen(),
  6822. r.domElement.id = "datLinks";
  6823. var o = [].slice.call(r.domElement.querySelectorAll(".property-name"));
  6824. return o.forEach(function(e) {
  6825. if (!K.detectSafari()) {
  6826. var t = document.createElement("button");
  6827. t.classList.add("btn-deep-link"),
  6828. t.innerText = Re.MENU_COPY,
  6829. e.nextSibling.appendChild(t);
  6830. var i = function() {
  6831. alert(Re.LINK_ALERT_COPY),
  6832. t.hide()
  6833. };
  6834. t.addEventListener("click", function(e) {
  6835. try {
  6836. var t = e.target.parentNode.childNodes[0];
  6837. t.select();
  6838. var n = document.execCommand("copy");
  6839. t.blur(),
  6840. n || i()
  6841. } catch (e) {
  6842. i()
  6843. }
  6844. })
  6845. }
  6846. }),
  6847. $(r.__closeButton).hide(),
  6848. r
  6849. }
  6850. function N(e) {
  6851. He.gui || (He.gui = D(He.model, He.player)),
  6852. He.visible = e,
  6853. e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide()
  6854. }
  6855. function B() {
  6856. N(!He.visible)
  6857. }
  6858. function F(e) {
  6859. ke = {
  6860. gui: null,
  6861. visible: !1,
  6862. model: e
  6863. }
  6864. }
  6865. function V(e) {
  6866. var t = new Le.GUI;
  6867. return t.add(Q, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6868. e.setSweepVisibility(Q.showSweeps)
  6869. }),
  6870. t.add(Q, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6871. t.add(Q.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6872. Q.transition.flySpeed = 0,
  6873. t.__controllers.forEach(function(e) {
  6874. e.updateDisplay()
  6875. })
  6876. }),
  6877. t.add(Q.path, "opacity", 0, 1).name("Path opacity"),
  6878. $(t.__closeButton).hide(),
  6879. t
  6880. }
  6881. function U(e) {
  6882. ke.gui || (ke.gui = V(ke.model)),
  6883. ke.visible = e,
  6884. e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide()
  6885. }
  6886. function k() {
  6887. U(!ke.visible)
  6888. }
  6889. function H() {
  6890. function e(e) {
  6891. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)/* || e.preventDefault()*/
  6892. }
  6893. $("body").css("touch-action", "none"),
  6894. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {
  6895. // e.preventDefault()
  6896. });
  6897. var t = document.getElementById("terms-text")
  6898. , i = document.getElementById("more-help-wrapper")
  6899. , n = (document.getElementById("navigation-help-wrapper"),
  6900. document.getElementById("help-dialog"),
  6901. document.getElementById("tag-billboards"));
  6902. Q.useWheel && (document.body.addEventListener("mousewheel", e, { passive: false }),
  6903. document.body.addEventListener("DOMMouseScroll", e)),
  6904. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  6905. e.stopPropagation()
  6906. })
  6907. }
  6908. function G(e, t) {
  6909. for (var i = []; e; )
  6910. i.push(e),
  6911. e = e.parentNode;
  6912. for (; t && i.indexOf(t) === -1; )
  6913. t = t.parentNode;
  6914. return t
  6915. }
  6916. function z() {
  6917. var e, t = function(t) {
  6918. e = 0 === t.button || 1 === t.which ? t.target : null
  6919. }, i = function(t) {
  6920. e !== t.target && (e = G(e, t.target));
  6921. var i = document.getElementById("gui-parent");
  6922. if (G(i, e) !== i && (e = null),
  6923. e) {
  6924. var n;
  6925. try {
  6926. n = new MouseEvent("click",t)
  6927. } catch (e) {
  6928. n = document.createEvent("MouseEvents"),
  6929. n.initMouseEvent("click", t.bubbles, t.cancelable, t.view, t.detail, t.screenX, t.screenY, t.clientX, t.clientY, t.ctrlKey, t.altKey, t.shiftKey, t.metaKey, t.button, t.relatedTarget)
  6930. }
  6931. n.syntheticClick = !0,
  6932. e.dispatchEvent(n),
  6933. e = null
  6934. }
  6935. };
  6936. document.body.addEventListener("mousedown", t, !0),
  6937. document.body.addEventListener("mouseup", i, !0),
  6938. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6939. e.syntheticClick || (e.stopPropagation(),
  6940. "A" === e.target.nodeName && e.preventDefault())
  6941. }, !0)
  6942. }
  6943. var W, j, Y, X, Z, q, K = (e("three"),
  6944. e("../util/ajax"),
  6945. e("../util/browser")), Q = e("../settings"), J = e("../analytics"), ee = (e("../util/transitions"),
  6946. e("../util/camera"),
  6947. e("../util/logger")), te = (e("../objects/Snapshot"),
  6948. e("./helpManager")), ie = e("./immersiveMode"), ne = e("./loadingScreen"), re = e("./landingScreen"), oe = e("./playButton"), ae = e("./populateModal"), se = e("./memoryUsage"), le = e("./closer/modalCloser"), ce = e("./closer/ModalCloserEvent"), he = e("./help/help"), ue = e("./help/HelpEvent"), de = e("./title/titleBar"), pe = e("./title/TitleEvents"), fe = e("./terms/terms"), ge = e("./terms/TermsEvent"), me = e("./title/tagToggle"), ve = e("./tourInteraction"), Ae = e("./vr/vrModal"), ye = e("./vr/vrEvent"), Ce = e("./sharing/modal"), Ie = e("./webvr/webVRgui"), Ee = e("./webvr/WebVrEvent"), be = e("../controls/serializer"), we = e("../enum/Keys"), _e = e("../enum/Viewmode"), Te = (e("../enum/BlackoutStyle"),
  6949. e("../tag/Media/MediaEvent")), xe = (e("../enum/PathDiscardMode"),
  6950. e("../enum/PathDisplayMode"),
  6951. e("../enum/DirectorEvents"),
  6952. e("../enum/PlayerEvents")), Se = e("../enum/ControlEvents"), Me = e("./sharing/ShareEvents"), Re = e("../localization/localize"), Pe = (e("../enum/Vectors"),
  6953. e("../enum/WarpStyle"),
  6954. e("../enum/AlignmentType"),
  6955. e("../enum/VROption")), Oe = e("./konami"), Le = e("../lib/dat.gui"), De = new ee(i), Ne = (e("../util/showcase"),
  6956. e("../enum/ZoomEvents")), Be = _e.DOLLHOUSE, Fe = 0, Ve = 0, Ue = [".hideTarget"], ke = null, He = null, Ge = !1, ze = !1, We = !1, je = {
  6957. coBrand: {
  6958. visible: !0,
  6959. elements: [".co-brand", "#loaderCoBrand"]
  6960. },
  6961. help: {
  6962. visible: !0,
  6963. elements: [".nav-help", "#nav-help"]
  6964. },
  6965. tourControls: {
  6966. visible: !0,
  6967. elements: [".next", ".previous", "#play"]
  6968. },
  6969. highlight: {
  6970. visible: !0,
  6971. elements: ["#drawer", "#pullTab"]
  6972. },
  6973. share: {
  6974. visible: !0,
  6975. elements: [".socialButton", "#share"]
  6976. },
  6977. fullScreen: {
  6978. visible: !0,
  6979. elements: ["#gui-fullscreen"]
  6980. },
  6981. floors: {
  6982. visible: !0,
  6983. elements: [".gui-floor"]
  6984. }
  6985. }, Ye = function() {
  6986. var e = document.getElementById("drawer");
  6987. return function() {
  6988. $("#player").height() < 400 && e.classList.contains("open") && a()
  6989. }
  6990. }(), Xe = function() {
  6991. var e = document.getElementById("meta-info");
  6992. return function() {
  6993. $("#player").height() < 400 && e.classList.contains("expand") && de.toggleMeta(!0)
  6994. }
  6995. }(), Ze = function(e) {
  6996. function t() {
  6997. u.classList.contains("expand") && de.toggleMeta(!0)
  6998. }
  6999. function i() {
  7000. fe.hide()
  7001. }
  7002. function n() {
  7003. he.close()
  7004. }
  7005. function r() {
  7006. Ae.dismiss()
  7007. }
  7008. function o() {
  7009. p.hasClass("open") && a(!0)
  7010. }
  7011. function l() {
  7012. Ce.hide()
  7013. }
  7014. function c() {
  7015. f.hasClass("open") && f.removeClass("open")
  7016. }
  7017. function h() {
  7018. d.classList.contains("fadeIn") && (d.classList.contains("landing") ? re.dismissModal() : d.classList.contains("tour") && ve.dismissModal())
  7019. }
  7020. var u = document.getElementById("meta-info")
  7021. , d = document.getElementById("interaction-modal")
  7022. , p = $("#drawer").eq(0)
  7023. , f = $(".gui-floor").eq(0)
  7024. , g = $(".vr-popup").eq(0);
  7025. return function(e) {
  7026. switch (e) {
  7027. case "info":
  7028. i(),
  7029. n(),
  7030. Ye(),
  7031. l(),
  7032. c(),
  7033. r(),
  7034. h();
  7035. break;
  7036. case "terms":
  7037. t(),
  7038. n(),
  7039. o(),
  7040. l(),
  7041. c(),
  7042. r(),
  7043. h();
  7044. break;
  7045. case "help":
  7046. t(),
  7047. i(),
  7048. l(),
  7049. c(),
  7050. r(),
  7051. h();
  7052. break;
  7053. case "vr":
  7054. t(),
  7055. i(),
  7056. l(),
  7057. c(),
  7058. n(),
  7059. h(),
  7060. s(g) && o();
  7061. break;
  7062. case "highlights":
  7063. Xe(),
  7064. i(),
  7065. l(),
  7066. c();
  7067. break;
  7068. case "share":
  7069. t(),
  7070. i(),
  7071. n(),
  7072. c(),
  7073. r(),
  7074. h();
  7075. break;
  7076. case "floor":
  7077. i(),
  7078. l(),
  7079. r();
  7080. break;
  7081. case "view":
  7082. c(),
  7083. l(),
  7084. i(),
  7085. r();
  7086. break;
  7087. case "tour":
  7088. i(),
  7089. l(),
  7090. c(),
  7091. r();
  7092. break;
  7093. case "move":
  7094. i(),
  7095. l(),
  7096. c(),
  7097. r();
  7098. break;
  7099. case "resize":
  7100. t(),
  7101. Ye(),
  7102. c();
  7103. break;
  7104. case "tag":
  7105. i(),
  7106. n(),
  7107. l(),
  7108. c(),
  7109. r()
  7110. }
  7111. }
  7112. }();
  7113. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  7114. $("#gui-fullscreen").toggle(!K.isFullscreen()),
  7115. $("#gui-fullscreen-exit").toggle(!!K.isFullscreen()),
  7116. setTimeout(function() {
  7117. $(".icon:visible").hide().show(0)
  7118. }, 100)
  7119. }),
  7120. $("#gui-fullscreen").find("a").on("click", function(e) {
  7121. l(e),
  7122. K.requestFullscreen($("body")[0]),
  7123. J.track("showcase_gui", {
  7124. gui_action: "click_enter_fullscreen",
  7125. interaction_source: "gui"
  7126. })
  7127. //czj
  7128. //W.reload()
  7129. }),
  7130. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  7131. l(e),
  7132. K.exitFullscreen(),
  7133. J.track("showcase_gui", {
  7134. gui_action: "click_exit_fullscreen",
  7135. interaction_source: "gui"
  7136. })
  7137. })
  7138. $(window).on("resize", function(e) {
  7139. var t = e.target.innerHeight
  7140. , i = e.target.innerWidth;
  7141. t === X && i === Z || (je.highlight.visible && w(),
  7142. Ze("resize"),
  7143. $(".pinTop.right").removeClass("hideUnderMeta"),
  7144. c(),
  7145. X = t,
  7146. Z = i)
  7147. }).resize(),
  7148. K.supportsFullscreen() || $("#gui-fullscreen").hide(),
  7149. $("#pullTab").on("click", function(e) {
  7150. l(e),
  7151. $("#drawer").hasClass("open") ? (J.trackAlways("showcase_gui", {
  7152. gui_action: "hide_highlight_reel"
  7153. }),
  7154. $(this).addClass("open").children("img").attr("src","images/auto.png")) : (J.trackAlways("showcase_gui", {
  7155. gui_action: "show_highlight_reel"
  7156. }),
  7157. $(this).removeClass("open").children("img").attr("src","images/auto-suspend.png"));
  7158. a()
  7159. });
  7160. /***********************方奕卓 热点列表事件监听 ************************/
  7161. if(window.MP_PREFETCHED_MODELDATA.showHotListSta === 'true') {
  7162. $('#hotList').css('display', '');
  7163. $('#hotList').on('click',function(e){
  7164. l(e);
  7165. var hotList = $('#hotListWrap')[0];
  7166. var isActive = hotList.classList.contains('hotListActive');
  7167. if(isActive){
  7168. hotList.classList.remove('hotListActive');
  7169. this.classList.remove('active')
  7170. }else{
  7171. hotList.classList.add('hotListActive');
  7172. this.classList.add('active')
  7173. }
  7174. }),
  7175. $('#hotListContent ul').on('mouseover', function(e){
  7176. l(e);
  7177. var target = e.target;
  7178. var hotList = document.getElementById('hotListWrap');
  7179. if(target.tagName === 'SPAN'){
  7180. var targetParent = target.parentElement.parentElement;
  7181. if(target.offsetWidth + 116 >= targetParent.clientWidth){
  7182. hotList.style.width = target.offsetWidth + 116 + 'px';
  7183. }else{
  7184. hotList.style.width = '';
  7185. }
  7186. }else if(target.tagName === 'LI'){
  7187. var targetParent = target.parentElement;
  7188. if(target.children[0].offsetWidth + 116 >= targetParent.clientWidth){
  7189. hotList.style.width = target.children[0].offsetWidth + 116 + 'px';
  7190. }else{
  7191. hotList.style.width = ''
  7192. }
  7193. }else {
  7194. hotList.style.width = '';
  7195. }
  7196. });
  7197. $('#hotListContent ul').on('click', function(e){
  7198. l(e);
  7199. this.preElem && this.preElem.classList.remove('active');
  7200. if(e.target.tagName === 'SPAN'){
  7201. e.target.parentElement.classList.add('active');
  7202. e.target.parentElement.hot && e.target.parentElement.hot.examine(window.player,true); // 打开热点
  7203. this.preElem = e.target.parentElement;
  7204. }else{
  7205. e.target.classList.add('active');
  7206. e.target.hot && e.target.hot.examine(window.player,true); // 打开热点
  7207. this.preElem = e.target;
  7208. }
  7209. })
  7210. $('#hotListClose').on('click', function(e){
  7211. l(e);
  7212. var hotList = $('#hotListWrap')[0];
  7213. hotList.classList.remove('hotListActive');
  7214. $('#hotListContent ul .active').removeClass('active');
  7215. $('#hotList')[0].classList.remove('active')
  7216. })
  7217. }
  7218. /*****************************************************************/
  7219. /*********************** 方奕卓 VR功能事件监听 ********************/
  7220. if(window.MP_PREFETCHED_MODELDATA.supportsVR === 'true'){
  7221. $('#vr').css('display', ''); // 显示vr功能按钮
  7222. }
  7223. $("#more-menu-button").on("click", function(e) {
  7224. l(e);
  7225. var t = $("#more-menu");
  7226. t.toggleClass("open")
  7227. }),
  7228. t.exports.init = S,
  7229. t.exports.startLoading = x,
  7230. t.exports.endLoading = d,
  7231. t.exports.onProgress = u
  7232. }
  7233. ).call(this, "/js/gui/gui.js")
  7234. }
  7235. , {
  7236. "../analytics": 4,
  7237. "../controls/serializer": 14,
  7238. "../enum/AlignmentType": 17,
  7239. "../enum/BlackoutStyle": 18,
  7240. "../enum/ControlEvents": 21,
  7241. "../enum/DirectorEvents": 23,
  7242. "../enum/Keys": 30,
  7243. "../enum/PathDiscardMode": 38,
  7244. "../enum/PathDisplayMode": 39,
  7245. "../enum/PlayerEvents": 40,
  7246. "../enum/VROption": 47,
  7247. "../enum/Vectors": 50,
  7248. "../enum/Viewmode": 51,
  7249. "../enum/WarpStyle": 52,
  7250. "../enum/ZoomEvents": 53,
  7251. "../lib/dat.gui": 93,
  7252. "../localization/localize": 108,
  7253. "../tag/Media/MediaEvent": 131,
  7254. "../objects/Snapshot": 153,
  7255. "../settings": 166,
  7256. "../util/ajax": 181,
  7257. "../util/browser": 182,
  7258. "../util/camera": 183,
  7259. "../util/logger": 189,
  7260. "../util/showcase": 193,
  7261. "../util/transitions": 195,
  7262. "./closer/ModalCloserEvent": 61,
  7263. "./closer/modalCloser": 62,
  7264. "./help/HelpEvent": 66,
  7265. "./help/help": 67,
  7266. "./helpManager": 68,
  7267. "./immersiveMode": 69,
  7268. "./konami": 70,
  7269. "./landingScreen": 71,
  7270. "./loadingScreen": 72,
  7271. "./memoryUsage": 73,
  7272. "./playButton": 74,
  7273. "./populateModal": 75,
  7274. "./sharing/ShareEvents": 76,
  7275. "./sharing/modal": 77,
  7276. "./terms/TermsEvent": 78,
  7277. "./terms/terms": 79,
  7278. "./title/TitleEvents": 80,
  7279. "./title/tagToggle": 81,
  7280. "./title/titleBar": 82,
  7281. "./tourInteraction": 84,
  7282. "./vr/vrEvent": 85,
  7283. "./vr/vrModal": 87,
  7284. "./webvr/WebVrEvent": 88,
  7285. "./webvr/webVRgui": 89,
  7286. three: 217
  7287. }],
  7288. 66: [function(e, t, i) {
  7289. "use strict";
  7290. t.exports = Object.freeze({
  7291. OPENED: "help.opened",
  7292. CLOSED: "help.closed"
  7293. })
  7294. }
  7295. , {}],
  7296. 67: [function(e, t, i) {
  7297. "use strict";
  7298. function n() {
  7299. g.on("click", function(e) {
  7300. if (S && S !== l.TRANSITIONING) {
  7301. var t = window.getComputedStyle(y).getPropertyValue("opacity") > 0;
  7302. t && !M ? R.close() : r()
  7303. }
  7304. }),
  7305. w.on("click", function(e) {
  7306. R.close()
  7307. }),
  7308. E.on("click", function(e) {
  7309. S && S !== l.TRANSITIONING && (s(),
  7310. o())
  7311. }),
  7312. b.on("click", function(e) {
  7313. s(),
  7314. a()
  7315. })
  7316. }
  7317. function r() {
  7318. S && S !== l.TRANSITIONING && (M = !0,
  7319. setTimeout(function() {
  7320. M = !1
  7321. }, d.help.modalStayDuration),
  7322. R.emit(h.OPENED),
  7323. m.addClass("open " + S),
  7324. g.addClass("open"),
  7325. s(),
  7326. o(),
  7327. y.style.removeProperty ? y.style.removeProperty("display") : y.style.removeAttribute("display"),
  7328. y.classList.add("fadeIn"))
  7329. }
  7330. function o() {
  7331. E.addClass("underline-tab"),
  7332. u.fill(_, c.NAVIGATION, S),
  7333. m.addClass(S)
  7334. }
  7335. function a() {
  7336. b.addClass("underline-tab"),
  7337. u.fill(T, c.MORE_HELP),
  7338. m.addClass("more-help")
  7339. }
  7340. function s(e, t) {
  7341. m.removeClass("more-help " + l.PANORAMA + " " + l.DOLLHOUSE + " " + l.FLOORPLAN + " " + l.OUTDOOR),
  7342. I.forEach(function(e) {
  7343. e.classList.remove("underline-tab")
  7344. })
  7345. }
  7346. var l = e("../../enum/Viewmode")
  7347. , c = e("../../enum/HelpModalType")
  7348. , h = e("./HelpEvent")
  7349. , u = (e("../helpManager"),
  7350. e("./../populateModal"))
  7351. , d = e("../../settings")
  7352. , p = e("../../util/common")
  7353. , f = e("events").EventEmitter
  7354. , g = $(".footer-help").eq(0)
  7355. , m = $("#help-dialog").eq(0)
  7356. , v = document.querySelector("#quick-logo")
  7357. , A = document.querySelector("#loaderCoBrand")
  7358. , y = document.querySelector("#help-dialog")
  7359. , C = document.querySelector(".footer")
  7360. , I = $(".help-tabs").children().toArray()
  7361. , E = $(".navigation-tab").eq(0)
  7362. , b = $(".more-help-tab").eq(0)
  7363. , w = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7364. m.find(".close").eq(0))
  7365. , _ = m.find(".interactions").toArray()
  7366. , T = m.find(".ui-instructions").toArray()
  7367. , x = l.PANORAMA
  7368. , S = l.PANORAMA
  7369. , M = !1
  7370. , R = {
  7371. init: function(e, t) {
  7372. S = t,
  7373. x = t,
  7374. [y, A, v, C].forEach(function(e) {
  7375. e.classList.add(u.deviceType)
  7376. }),
  7377. n()
  7378. },
  7379. close: function() {
  7380. if (m.hasClass("open") && (this.emit(h.CLOSED),
  7381. g.removeClass("open"),
  7382. m.removeClass("open"),
  7383. y.classList.contains("fadeIn"))) {
  7384. y.classList.remove("fadeIn");
  7385. var e = S === l.TRANSITIONING ? x : S;
  7386. u.clear(_, c.NAVIGATION, e)
  7387. }
  7388. },
  7389. updateMode: function(e) {
  7390. x = S,
  7391. S = e
  7392. }
  7393. };
  7394. p.extendObject(R, f.prototype),
  7395. t.exports = R
  7396. }
  7397. , {
  7398. "../../enum/HelpModalType": 28,
  7399. "../../enum/Viewmode": 51,
  7400. "../../settings": 166,
  7401. "../../util/common": 185,
  7402. "../helpManager": 68,
  7403. "./../populateModal": 75,
  7404. "./HelpEvent": 66,
  7405. events: 202
  7406. }],
  7407. 68: [function(e, t, i) {
  7408. (function(i) {
  7409. "use strict";
  7410. var n = e("../util/browser")
  7411. , r = e("./../util/logger")
  7412. , o = e("./../settings")
  7413. , a = new r(i)
  7414. , s = function() {
  7415. var e;
  7416. try {
  7417. return e = window.localStorage.getItem("visitCount") || "0",
  7418. e = (parseFloat(e) + 1).toString(),
  7419. window.localStorage.setItem("visitCount", e),
  7420. a.debug("visitCount = " + e),
  7421. e
  7422. } catch (t) {
  7423. e = "1",
  7424. a.debug("couldn't set local storage")
  7425. }
  7426. }()
  7427. , l = !1;
  7428. t.exports = {
  7429. isHelpDisabled: function() {
  7430. return "0" === n.valueFromHash("help", null) || l
  7431. },
  7432. isLargeHelpEnabled: function() {
  7433. return ("1" === s || "1" === n.valueFromHash("help", null)) && !this.isHelpDisabled()
  7434. },
  7435. isSmallHelpEnabled: function() {
  7436. return "2" === n.valueFromHash("help", null) && !this.isHelpDisabled()
  7437. },
  7438. isHelpEnabled: function() {
  7439. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7440. },
  7441. setAutoPlay: function(e) {
  7442. l = o.warp.auto >= 0 && e > 1
  7443. }
  7444. }
  7445. }
  7446. ).call(this, "/js/gui/helpManager.js")
  7447. }
  7448. , {
  7449. "../util/browser": 182,
  7450. "./../settings": 166,
  7451. "./../util/logger": 189
  7452. }],
  7453. 69: [function(e, t, i) {
  7454. "use strict";
  7455. function n(e, t, i, n) {
  7456. F = n,
  7457. r(e, t, i, F),
  7458. o(),
  7459. N = t.mode
  7460. }
  7461. function r(e, t, i, n) {
  7462. [C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function(t) {
  7463. e.controls[t].on(v.Move, a),
  7464. e.controls[t].on(v.LongTap, c)
  7465. }),
  7466. M.on("mousewheel DOMMouseScroll", a),
  7467. i.on(m.TagActivated, a),
  7468. i.on(m.TagNavigation, a),
  7469. t.on(A.FlyingEnded, s),
  7470. t.on(A.ModeChanging, function(e, t) {
  7471. B = t !== C.PANORAMA && e !== C.PANORAMA
  7472. }),
  7473. t.on(A.ModeChanged, function(e, i) {
  7474. N = t.mode,
  7475. i !== C.TRANSITIONING ? l() : a("modeChange")
  7476. }),
  7477. n.on(y.TourStart, function() {
  7478. L = !0,
  7479. a()
  7480. }),
  7481. n.on(y.TourEnd, function() {
  7482. L = !1,
  7483. l()
  7484. }),
  7485. n.on(y.ActionInterrupted, function() {
  7486. L = !1
  7487. }),
  7488. R.addEventListener("touchend", function() {
  7489. $("#pullTab").hasClass("opened") && !L && l()
  7490. }, !0)
  7491. }
  7492. function o() {
  7493. p.isMobile() ? (b.forEach(function(e) {
  7494. e.classList.add("mobile")
  7495. }),
  7496. w.click(l)) : (b.forEach(function(e) {
  7497. e.addEventListener("mouseleave", function() {
  7498. !M.is(":hover") && b[0].classList.contains("detectHover") && l()
  7499. }, !0)
  7500. }),
  7501. M.mouseleave(function() {
  7502. b[0].classList.contains("detectHover") && l()
  7503. }))
  7504. }
  7505. function a(e) {
  7506. D || d(e) && _.hasClass("playing") || (clearTimeout(O),
  7507. P = !0,
  7508. g.close(),
  7509. h(e),
  7510. N !== C.DOLLHOUSE && N !== C.FLOORPLAN && (x.hasClass("expand") && !S.hasClass("closed") || 2 === p.valueFromHash("title", 1) ,
  7511. _.hasClass("playing") || (b.forEach(function(e) {
  7512. e.classList.add("detectHover")
  7513. }),
  7514. O = setTimeout(l, f.immersive.timeToShowAgain))))
  7515. }
  7516. function s() {
  7517. _.hasClass("playing") || (clearTimeout(O),
  7518. O = setTimeout(l, f.immersive.timeToShowAgain))
  7519. }
  7520. function l() {
  7521. clearTimeout(O),
  7522. P = !1,
  7523. I.forEach(function(e) {
  7524. e.classList.remove("drawerOpen")
  7525. }),
  7526. L || E.forEach(function(e) {
  7527. e.classList.remove("duringTour")
  7528. }),
  7529. b.forEach(function(e) {
  7530. e.classList.remove("detectHover")
  7531. })
  7532. }
  7533. function c() {
  7534. P ? l() : a(),
  7535. D = !0,
  7536. setTimeout(function() {
  7537. D = !1
  7538. }, f.immersive.uiStayDuration)
  7539. }
  7540. function h(e) {
  7541. !d(e) && L ? E.forEach(function(e) {
  7542. e.classList.remove("drawerOpen"),
  7543. e.classList.add("duringTour")
  7544. }) : _.hasClass("open") ? E.forEach(function(e) {
  7545. e.classList.remove("duringTour"),
  7546. e.classList.add("drawerOpen")
  7547. }) : B || N === C.FLOORPLAN || N === C.DOLLHOUSE || E.forEach(function(e) {
  7548. e.classList.add("fadeOut")
  7549. })
  7550. }
  7551. function u() {
  7552. T.hasClass("duringTour") || (L = !1,
  7553. a("gui"),
  7554. l())
  7555. }
  7556. function d(e) {
  7557. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7558. }
  7559. var p = e("../util/browser")
  7560. , f = e("../settings")
  7561. , g = e("./help/help")
  7562. , m = e("../enum/tagEvents")
  7563. , v = e("../enum/ControlEvents")
  7564. , A = e("../enum/PlayerEvents")
  7565. , y = e("../enum/DirectorEvents")
  7566. , A = e("../enum/PlayerEvents")
  7567. , C = e("../enum/Viewmode")
  7568. , I = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7569. , E = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7570. , b = $("#hover-bottom, #hover-top").toArray()
  7571. , w = ($("#pullTab").eq(0),
  7572. $("#playHead").eq(0),
  7573. $(".pinBottom-container").eq(0))
  7574. , _ = $("#drawer").eq(0)
  7575. , T = $("#drawer-container").eq(0)
  7576. , x = $("#meta-info").eq(0)
  7577. , S = $(".pinTop.left").eq(0)
  7578. , M = $("#player").eq(0)
  7579. , R = document.getElementById("pullTab")
  7580. , P = !1
  7581. , O = null
  7582. , L = !1
  7583. , D = !1
  7584. , N = null
  7585. , B = !1
  7586. , F = null;
  7587. t.exports.init = n,
  7588. t.exports.hideUi = a,
  7589. t.exports.resetDrawer = u
  7590. }
  7591. , {
  7592. "../enum/ControlEvents": 21,
  7593. "../enum/DirectorEvents": 23,
  7594. "../enum/tagEvents": 32,
  7595. "../enum/PlayerEvents": 40,
  7596. "../enum/Viewmode": 51,
  7597. "../settings": 166,
  7598. "../util/browser": 182,
  7599. "./help/help": 67
  7600. }],
  7601. 70: [function(e, t, i) {
  7602. (function(i) {
  7603. "use strict";
  7604. function n(e, t, i) {
  7605. l.debug("konami has the modelInstance");
  7606. var n = [];
  7607. $(window).on("keydown", function(e) {
  7608. n.push(e.which),
  7609. n.length > o.secretPanelWord.length && n.shift(),
  7610. s.equalLists(n, o.secretPanelWord) && (l.debug("Developer mode active."),
  7611. o.debug = !0)
  7612. }),
  7613. $(window).on("keydown", function n(r) {
  7614. o.debug && 72 === r.which && (e && i ? (a.toggle(e, t, i),
  7615. $(window).off("keydown", n)) : console.warn("sorry we're not ready yet"))
  7616. })
  7617. }
  7618. var r = e("./../util/logger")
  7619. , o = e("./../settings")
  7620. , a = e("./debug")
  7621. , s = e("./../util/common")
  7622. , l = (e("./gui"),
  7623. new r(i));
  7624. o.console && $("body").append('<div id="debug-console"></div>'),
  7625. t.exports.init = n
  7626. }
  7627. ).call(this, "/js/gui/konami.js")
  7628. }
  7629. , {
  7630. "./../settings": 166,
  7631. "./../util/common": 185,
  7632. "./../util/logger": 189,
  7633. "./debug": 63,
  7634. "./gui": 65
  7635. }],
  7636. 71: [function(e, t, i) {
  7637. "use strict";
  7638. function n(e, t) {
  7639. E = t.mode === p.PANORAMA && t.pano && !t.pano.isAligned() ? p.OUTDOOR : t.mode
  7640. }
  7641. function r(e) {
  7642. var t = $.Deferred();
  7643. e || t.resolve();
  7644. var i = c.startupFlyinDelay;
  7645. return e === p.PANORAMA && (i += c.dollhouse.transitionTime),
  7646. setTimeout(t.resolve.bind(t), i),
  7647. t
  7648. }
  7649. function o(e, t, i) {
  7650. var n = 0;
  7651. c.quickstart.enabled && (a(i),
  7652. n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay);
  7653. var r = function() {
  7654. e.once(g.Move, l),
  7655. t.once(f.TourStart, l)
  7656. };
  7657. s(n, r)
  7658. }
  7659. function a(e) {
  7660. return e && (y.addClass("quick-brand"),
  7661. v.before(y),
  7662. A = $(".quick-brand").toArray()),
  7663. m.addClass("fadeOut"),
  7664. setTimeout(function() {
  7665. A.forEach(function(e) {
  7666. e.classList.add("fadeIn")
  7667. })
  7668. }, c.quickstart.showTextDelay),
  7669. setTimeout(function() {
  7670. A.forEach(function(e) {
  7671. e.classList.add("fadeOut")
  7672. })
  7673. }, c.quickstart.fadeOutDelay),
  7674. !0
  7675. }
  7676. function s(e, t) {
  7677. setTimeout(function() {
  7678. if (h.isHelpEnabled()) {
  7679. if (t(),
  7680. u.init(),
  7681. C.addClass("fadeIn landing " + u.deviceType),
  7682. h.isSmallHelpEnabled())
  7683. return void C.addClass("small");
  7684. u.fill(I, d.LANDING[E]),
  7685. C.addClass(E)
  7686. }
  7687. }, e)
  7688. //csz 用户引导界面
  7689. var helpData = {
  7690. "pc":["images/pc_step1.png","images/pc_step2.png","images/pc_step3.png"],
  7691. "mobile":["images/phone_step1.png","images/phone_step2.png","images/phone_step3.png"]
  7692. }
  7693. var navIcon = $(".nav-icon .icon");
  7694. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) navIcon.attr("src",helpData.mobile[0]);
  7695. function paging(id){
  7696. id.on("click",function(){
  7697. var navPage = null;
  7698. $(this).attr("data-id") == "plus" ? navPage = +navIcon.attr("data-page")+1 : navPage = +navIcon.attr("data-page")-1;
  7699. if(navPage > helpData.length || navPage < 1) return false
  7700. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  7701. navIcon.attr({"data-page":navPage,"src":helpData.mobile[navPage - 1]});
  7702. }else{
  7703. navIcon.attr({"data-page":navPage,"src":helpData.pc[navPage - 1]});
  7704. }
  7705. })
  7706. };
  7707. paging($(".next-button"));
  7708. paging($(".prev-button"));
  7709. }
  7710. function l() {
  7711. u.clear(I, d.LANDING[E]),
  7712. C.removeClass("fadeIn")
  7713. }
  7714. var c = e("../settings")
  7715. , h = (e("./help/help"),
  7716. e("./helpManager"))
  7717. , u = e("./populateModal")
  7718. , d = e("../enum/HelpModalType")
  7719. , p = e("../enum/Viewmode")
  7720. , f = e("../enum/DirectorEvents")
  7721. , g = e("../enum/PlayerEvents")
  7722. , m = $("#quick-blackout").eq(0)
  7723. , v = $("#quick-logo").eq(0)
  7724. , A = $(".quick-brand").toArray()
  7725. , y = $("#loaderCoBrand").eq(0)
  7726. , C = $("#interaction-modal").eq(0)
  7727. , I = C.find(".interaction").toArray()
  7728. , E = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7729. "");
  7730. t.exports.delayLanding = r,
  7731. t.exports.showMessage = o,
  7732. t.exports.init = n,
  7733. t.exports.dismissModal = l
  7734. }
  7735. , {
  7736. "../enum/DirectorEvents": 23,
  7737. "../enum/HelpModalType": 28,
  7738. "../enum/PlayerEvents": 40,
  7739. "../enum/Viewmode": 51,
  7740. "../settings": 166,
  7741. "./help/help": 67,
  7742. "./helpManager": 68,
  7743. "./populateModal": 75
  7744. }],
  7745. 72: [function(e, t, i) {
  7746. "use strict";
  7747. var n = e("./circleLoader").circleLoader;
  7748. t.exports = {
  7749. element: $("#gui-loading"),
  7750. hide: function(e) {
  7751. n.done(),
  7752. this.element.fadeOut(1500, e)
  7753. },
  7754. show: function(e) {
  7755. this.element.fadeIn(500, function() {
  7756. this.element.css("display", "table"),
  7757. e && e()
  7758. }
  7759. .bind(this))
  7760. },
  7761. progress: function(e) {
  7762. n.set(e)
  7763. }
  7764. }
  7765. }
  7766. , {
  7767. "./circleLoader": 60
  7768. }],
  7769. 73: [function(e, t, i) {
  7770. "use strict";
  7771. var n = e("../settings")
  7772. , r = $("#memory-info")
  7773. , o = r.find("#memory-gpu")
  7774. , a = !1;
  7775. t.exports = {
  7776. show: function() {
  7777. n.profiling.enabled && (r.show(),
  7778. a = !0)
  7779. },
  7780. hide: function() {
  7781. r.hide(),
  7782. a = !1
  7783. },
  7784. toggle: function() {
  7785. a ? this.hide() : this.show()
  7786. },
  7787. update: function(e) {
  7788. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7789. }
  7790. }
  7791. }
  7792. , {
  7793. "../settings": 166
  7794. }],
  7795. 74: [function(e, t, i) {
  7796. "use strict";
  7797. var n = e("../util/browser")
  7798. , r = e("../analytics");
  7799. e("../settings");
  7800. t.exports = {
  7801. show: function(e, t) {
  7802. $("#gui-message").fadeOut(500, function() {
  7803. t()
  7804. })
  7805. }
  7806. }
  7807. }
  7808. , {
  7809. "../analytics": 4,
  7810. "../settings": 166,
  7811. "../util/browser": 182
  7812. }],
  7813. 75: [function(e, t, i) {
  7814. "use strict";
  7815. function n(e, t, i, n) {
  7816. function r(e) {
  7817. return e.classList.contains(a)
  7818. }
  7819. var o = i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType];
  7820. //for (var a in o) {
  7821. //var s = e.find(r);
  7822. //for (var l in o[a]) {
  7823. //var c = o[a][l];
  7824. //if ("top-info" === l || "bottom-info" === l) {
  7825. //var h = n ? c : "";
  7826. //czj 注释掉第一次打开的用户引导
  7827. //s.querySelector("." + l).textContent = h
  7828. //} else {
  7829. //var u = n ? c : "";
  7830. //, d = s.querySelector("." + l);
  7831. //d.src = u,
  7832. //n ? d.classList.remove("hidden") : d.classList.add("hidden")
  7833. //}
  7834. //}
  7835. //}
  7836. //var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
  7837. // p.forEach(function(e) {
  7838. // n ? e.classList.remove("hidden") : e.classList.add("hidden")
  7839. // })
  7840. }
  7841. var r = e("../util/browser")
  7842. , o = e("../localization/localize")
  7843. , a = e("../enum/HelpModalType")
  7844. , s = (e("../enum/HelpModalSize"),
  7845. e("../enum/Viewmode"));
  7846. t.exports = {
  7847. init: function() {
  7848. if (!this.hasInitialized) {
  7849. this.hasInitialized = !0,
  7850. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7851. this.assets = {},
  7852. this.assets[a.LANDING[s.PANORAMA]] = {
  7853. desktop: {
  7854. left: {
  7855. "top-info": o.ROTATE,
  7856. "big-image": "images/nav_help_mouse_drag_left.png",
  7857. keyboard: "images/nav_help_keyboard_left_right.png"
  7858. },
  7859. middle: {
  7860. "top-info": o.MOVE,
  7861. "big-image": "images/nav_help_mouse_click.png",
  7862. keyboard: "images/nav_help_keyboard_up_down.png"
  7863. },
  7864. right: {
  7865. "top-info": o.ZOOM,
  7866. "big-image": "images/nav_help_mouse_zoom.png",
  7867. keyboard: "images/nav_help_zoom_keys.png"
  7868. }
  7869. },
  7870. mobile: {
  7871. left: {
  7872. "top-info": o.ROTATE,
  7873. "big-image": "images/nav_help_gesture_drag.png"
  7874. },
  7875. middle: {
  7876. "top-info": o.MOVE,
  7877. "big-image": "images/nav_help_gesture_tap.png"
  7878. },
  7879. right: {
  7880. "top-info": o.ZOOM,
  7881. "big-image": "images/nav_help_gesture_pinch.png"
  7882. }
  7883. }
  7884. },
  7885. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7886. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7887. desktop: {
  7888. left: {
  7889. "top-info": o.ROTATE,
  7890. "big-image": "images/nav_help_mouse_drag_left.png",
  7891. keyboard: "images/nav_help_keyboard_left_right.png"
  7892. },
  7893. middle: {
  7894. "top-info": o.MOVE,
  7895. "big-image": "images/nav_help_mouse_position_right.png"
  7896. }
  7897. },
  7898. mobile: {
  7899. left: {
  7900. "top-info": o.ROTATE,
  7901. "big-image": "images/nav_help_gesture_drag.png"
  7902. },
  7903. middle: {
  7904. "top-info": o.MOVE,
  7905. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7906. }
  7907. }
  7908. },
  7909. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7910. desktop: {
  7911. left: {
  7912. "top-info": o.MOVE,
  7913. "big-image": "images/nav_help_mouse_position_left.png"
  7914. },
  7915. middle: {
  7916. "top-info": o.ROTATE,
  7917. "big-image": "images/nav_help_mouse_drag_right.png",
  7918. keyboard: "images/nav_help_keyboard_left_right.png"
  7919. }
  7920. },
  7921. mobile: {
  7922. left: {
  7923. "top-info": o.MOVE,
  7924. "big-image": "images/nav_help_gesture_position.png"
  7925. },
  7926. middle: {
  7927. "top-info": o.ROTATE,
  7928. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7929. }
  7930. }
  7931. };
  7932. var e = {
  7933. "top-info": o.INSIDE,
  7934. "big-image": "images/nav_help_click_inside.png",
  7935. keyboard: "images/nav_help_inside_key.png"
  7936. };
  7937. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7938. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7939. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7940. var t = {
  7941. "top-info": o.INSIDE,
  7942. "big-image": "images/nav_help_tap_inside.png"
  7943. };
  7944. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7945. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7946. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7947. this.assets[a.NAVIGATION] = {},
  7948. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7949. desktop: {
  7950. left: {
  7951. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7952. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7953. "big-image": "images/nav_help_mouse_drag_left.png",
  7954. keyboard: "images/nav_help_keyboard_left_right.png"
  7955. },
  7956. middle: {
  7957. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7958. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7959. "big-image": "images/nav_help_mouse_click.png",
  7960. keyboard: "images/nav_help_keyboard_up_down.png"
  7961. },
  7962. right: {
  7963. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7964. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7965. "big-image": "images/nav_help_mouse_zoom.png",
  7966. keyboard: "images/nav_help_zoom_keys.png"
  7967. }
  7968. },
  7969. mobile: {
  7970. left: {
  7971. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7972. "big-image": "images/nav_help_gesture_drag.png"
  7973. },
  7974. middle: {
  7975. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7976. "big-image": "images/nav_help_gesture_tap.png"
  7977. },
  7978. right: {
  7979. "top-info": o.HELP_MOBILE_3,
  7980. "big-image": "images/nav_help_gesture_pinch.png"
  7981. }
  7982. }
  7983. },
  7984. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  7985. desktop: {
  7986. left: {
  7987. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  7988. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  7989. "big-image": "images/nav_help_mouse_drag_left.png",
  7990. keyboard: "images/nav_help_keyboard_all.png"
  7991. },
  7992. middle: {
  7993. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  7994. "big-image": "images/nav_help_mouse_position_right.png"
  7995. },
  7996. right: {
  7997. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  7998. "big-image": "images/nav_help_mouse_zoom.png"
  7999. }
  8000. },
  8001. mobile: {
  8002. left: {
  8003. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  8004. "big-image": "images/nav_help_gesture_drag.png"
  8005. },
  8006. middle: {
  8007. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  8008. "big-image": "images/nav_help_gesture_position_two_finger.png"
  8009. },
  8010. right: {
  8011. "top-info": o.HELP_MOBILE_3,
  8012. "big-image": "images/nav_help_gesture_pinch.png"
  8013. }
  8014. }
  8015. },
  8016. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  8017. desktop: {
  8018. left: {
  8019. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  8020. "big-image": "images/nav_help_mouse_position_left.png"
  8021. },
  8022. middle: {
  8023. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  8024. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  8025. "big-image": "images/nav_help_mouse_drag_right.png",
  8026. keyboard: "images/nav_help_keyboard_left_right.png"
  8027. },
  8028. right: {
  8029. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  8030. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  8031. "big-image": "images/nav_help_mouse_zoom.png",
  8032. keyboard: "images/nav_help_keyboard_up_down.png"
  8033. }
  8034. },
  8035. mobile: {
  8036. left: {
  8037. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  8038. "big-image": "images/nav_help_gesture_position.png"
  8039. },
  8040. middle: {
  8041. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  8042. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  8043. },
  8044. right: {
  8045. "top-info": o.HELP_MOBILE_3,
  8046. "big-image": "images/nav_help_gesture_pinch.png"
  8047. }
  8048. }
  8049. },
  8050. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  8051. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  8052. "top-info": o.HELP_DESKTOP_360_2A,
  8053. "bottom-info": o.HELP_DESKTOP_360_2B,
  8054. "big-image": "images/nav_help_click_inside.png",
  8055. keyboard: "images/nav_help_inside_key.png"
  8056. },
  8057. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  8058. "top-info": o.HELP_MOBILE_360_2,
  8059. "big-image": "images/nav_help_tap_inside.png"
  8060. },
  8061. this.assets[a.MORE_HELP] = {
  8062. desktop: {
  8063. "more-help-hlr": {
  8064. "top-info": o.HELP_MORE_HLR_A,
  8065. "big-image": "images/nav_help_expand.svg",
  8066. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8067. },
  8068. "more-help-dollhouse": {
  8069. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8070. "big-image": "images/nav_help_dollhouse.svg",
  8071. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  8072. },
  8073. "more-help-floors": {
  8074. "top-info": o.HELP_MORE_FLOORS_A,
  8075. "big-image": "images/nav_help_floor picker.svg",
  8076. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8077. },
  8078. "more-help-tag": {
  8079. "top-info": o.HELP_MORE_TAG_A,
  8080. "big-image": "images/nav_help_tag.svg",
  8081. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  8082. },
  8083. "more-help-zoom": {
  8084. "top-info": o.HELP_MORE_ZOOM_A,
  8085. "big-image": "images/nav_help_zoom.svg",
  8086. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  8087. },
  8088. "more-help-tour": {
  8089. "top-info": o.HELP_MORE_TOUR_A,
  8090. "big-image": "images/nav_help_play.png",
  8091. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8092. },
  8093. "more-help-inside": {
  8094. "top-info": o.HELP_MORE_INSIDE_A,
  8095. "big-image": "images/nav_help_inside.svg",
  8096. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  8097. },
  8098. "more-help-vr": {
  8099. "top-info": o.HELP_MORE_VR_A,
  8100. "big-image": "images/nav_help_vr.svg",
  8101. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  8102. },
  8103. "more-help-360": {
  8104. "top-info": o.HELP_MORE_360_A,
  8105. "big-image": "images/nav_help_360.svg",
  8106. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  8107. },
  8108. "more-help-fullscreen": {
  8109. "top-info": o.HELP_MORE_FULLSCREEN_A,
  8110. "big-image": "images/nav_help_fullscreen.svg",
  8111. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8112. }
  8113. },
  8114. mobile: {
  8115. "more-help-hlr": {
  8116. "top-info": o.HELP_MORE_HLR_A,
  8117. "big-image": "images/nav_help_expand.svg",
  8118. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8119. },
  8120. "more-help-dollhouse": {
  8121. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8122. "big-image": "images/nav_help_dollhouse.svg",
  8123. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8124. },
  8125. "more-help-floors": {
  8126. "top-info": o.HELP_MORE_FLOORS_A,
  8127. "big-image": "images/nav_help_floor picker.svg",
  8128. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8129. },
  8130. "more-help-tag": {
  8131. "top-info": o.HELP_MORE_TAG_A,
  8132. "big-image": "images/nav_help_tag.svg",
  8133. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8134. },
  8135. "more-help-tour": {
  8136. "top-info": o.HELP_MORE_TOUR_A,
  8137. "big-image": "images/nav_help_play.png",
  8138. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8139. },
  8140. "more-help-inside": {
  8141. "top-info": o.HELP_MORE_INSIDE_A,
  8142. "big-image": "images/nav_help_inside.svg",
  8143. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8144. },
  8145. "more-help-vr": {
  8146. "top-info": o.HELP_MORE_VR_A,
  8147. "big-image": "images/webvr.svg",
  8148. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8149. },
  8150. "more-help-360": {
  8151. "top-info": o.HELP_MORE_360_A,
  8152. "big-image": "images/nav_help_360.svg",
  8153. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8154. }
  8155. }
  8156. },
  8157. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8158. desktop: {
  8159. left: {
  8160. "top-info": o.ROTATE,
  8161. "big-image": "images/nav_help_mouse_drag_left.png",
  8162. keyboard: "images/nav_help_keyboard_left_right.png"
  8163. },
  8164. middle: {
  8165. "top-info": o.MOVE,
  8166. "big-image": "images/nav_help_mouse_click.png",
  8167. keyboard: "images/nav_help_keyboard_up_down.png"
  8168. },
  8169. right: {
  8170. "top-info": o.PLAY,
  8171. "big-image": "images/Desktop-help-play-button.svg",
  8172. keyboard: "images/Desktop-help-spacebar-2.svg"
  8173. }
  8174. },
  8175. mobile: {
  8176. left: {
  8177. "top-info": o.ROTATE,
  8178. "big-image": "images/nav_help_gesture_drag.png"
  8179. },
  8180. middle: {
  8181. "top-info": o.MOVE,
  8182. "big-image": "images/nav_help_gesture_tap.png"
  8183. },
  8184. right: {
  8185. "top-info": o.PLAY,
  8186. "big-image": "images/mobile-help-play-button.svg"
  8187. }
  8188. }
  8189. },
  8190. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8191. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8192. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8193. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8194. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8195. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8196. }
  8197. },
  8198. fill: function(e, t, i) {
  8199. n.call(this, e, t, i, !0)
  8200. },
  8201. clear: function(e, t, i) {
  8202. n.call(this, e, t, i, !1)
  8203. }
  8204. }
  8205. }
  8206. , {
  8207. "../enum/HelpModalSize": 27,
  8208. "../enum/HelpModalType": 28,
  8209. "../enum/Viewmode": 51,
  8210. "../localization/localize": 108,
  8211. "../util/browser": 182
  8212. }],
  8213. 76: [function(e, t, i) {
  8214. "use strict";
  8215. t.exports = Object.freeze({
  8216. OPENED: "share.open",
  8217. CLOSED: "share.closed",
  8218. LINK_CLICKED: "share.linked"
  8219. })
  8220. }
  8221. , {}],
  8222. 77: [function(e, t, i) {
  8223. "use strict";
  8224. function n(e) {
  8225. function t(t, i) {
  8226. var n = window.screenY + ($("#player").height() - i) / 2
  8227. , r = window.screenX + ($("#player").width() - t) / 2
  8228. , o = "top=" + n + ",left=" + r + ",width=" + t + ",height=" + i;
  8229. I.emit(l.LINK_CLICKED, {
  8230. channel: e
  8231. }),
  8232. window.open(C[e], "shareWindow", o)
  8233. }
  8234. switch (e) {
  8235. case y.FACEBOOK:
  8236. t(580, 420);
  8237. break;
  8238. case y.TWITTER:
  8239. t(550, 440);
  8240. break;
  8241. case y.MAIL:
  8242. I.emit(l.LINK_CLICKED, {
  8243. channel: "email"
  8244. }),
  8245. window.open(C[e], "_blank");
  8246. break;
  8247. case y.LINKEDIN:
  8248. }
  8249. }
  8250. function r(e) {
  8251. I.emit(l.LINK_CLICKED, {
  8252. channel: "copylink"
  8253. });
  8254. var t = document.createRange();
  8255. t.selectNodeContents(v);
  8256. var i = window.getSelection();
  8257. i.removeAllRanges(),
  8258. i.addRange(t),
  8259. document.execCommand("copy"),
  8260. A.classList.remove("hidden"),
  8261. v.classList.add("highlighted")
  8262. }
  8263. function o(e) {
  8264. e && (e.stopPropagation(),
  8265. e.target === v) || (window.getSelection().removeAllRanges(),
  8266. v.classList.remove("highlighted"),
  8267. A.classList.add("hidden"))
  8268. }
  8269. var a = e("../../util/browser")
  8270. , s = e("../../localization/localize")
  8271. , l = e("./ShareEvents")
  8272. , c = e("../../util/common")
  8273. , h = e("events").EventEmitter
  8274. , u = document.getElementById("sharing")
  8275. , d = document.getElementById("share-modal")
  8276. , p = document.getElementById("share-close")
  8277. , f = document.getElementById("facebook-share")
  8278. , g = document.getElementById("twitter-share")
  8279. , m = document.getElementById("mail-share")
  8280. , v = document.getElementById("share-url-text")
  8281. , A = document.getElementById("copy-success")
  8282. , y = Object.freeze({
  8283. FACEBOOK: "facebook",
  8284. TWITTER: "twitter",
  8285. MAIL: "mail",
  8286. LINKEDIN: "linkedin"
  8287. })
  8288. , C = {};
  8289. C[y.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8290. C[y.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8291. C[y.MAIL] = "mailto:?subject=";
  8292. var I = {
  8293. init: function(e) {
  8294. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8295. C[y.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8296. C[y.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8297. C[y.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8298. u.addEventListener("click", this.toggle.bind(this)),
  8299. p.addEventListener("click", this.hide.bind(this)),
  8300. v.addEventListener("click", r),
  8301. d.addEventListener("click", o),
  8302. f.addEventListener("click", n.bind(this, y.FACEBOOK)),
  8303. g.addEventListener("click", n.bind(this, y.TWITTER)),
  8304. m.addEventListener("click", n.bind(this, y.MAIL)),
  8305. v.textContent = window.location.href + "&utm_source=4",
  8306. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8307. u.classList.remove("hidden")
  8308. },
  8309. show: function() {
  8310. this.emit(l.OPENED),
  8311. d.classList.add("fadeIn")
  8312. },
  8313. hide: function() {
  8314. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8315. document.selection && document.selection.empty(),
  8316. window.getSelection().removeAllRanges(),
  8317. o(),
  8318. d.classList.remove("fadeIn"))
  8319. },
  8320. toggle: function() {
  8321. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8322. }
  8323. };
  8324. c.extendObject(I, h.prototype),
  8325. t.exports = I
  8326. }
  8327. , {
  8328. "../../localization/localize": 108,
  8329. "../../util/browser": 182,
  8330. "../../util/common": 185,
  8331. "./ShareEvents": 76,
  8332. events: 202
  8333. }],
  8334. 78: [function(e, t, i) {
  8335. "use strict";
  8336. t.exports = Object.freeze({
  8337. OPENED: "terms.opened",
  8338. CLOSED: "terms.closed"
  8339. })
  8340. }
  8341. , {}],
  8342. 79: [function(e, t, i) {
  8343. "use strict";
  8344. var n = e("./TermsEvent")
  8345. , r = e("../../localization/localize")
  8346. , o = e("../../analytics")
  8347. , a = e("../../util/ajax")
  8348. , s = e("../../util/common")
  8349. , l = e("events").EventEmitter
  8350. , c = document.getElementById("terms-modal")
  8351. , h = {
  8352. init: function() {
  8353. $(".footer-terms").on("click", function(e) {
  8354. e.preventDefault(),
  8355. this.show()
  8356. }
  8357. .bind(this)),
  8358. $("#terms-modal .close").on("click", this.hide.bind(this))
  8359. },
  8360. show: function() {
  8361. this.emit(n.OPENED),
  8362. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8363. var t = $("#terms-text").html(e);
  8364. o.track("showcase_gui", {
  8365. gui_action: "click_terms_button",
  8366. interaction_source: "gui"
  8367. }),
  8368. t.find("a").attr("target", "_blank")
  8369. }).fail(function() {
  8370. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8371. }),
  8372. c.classList.add("fadeIn")
  8373. },
  8374. hide: function(e) {
  8375. e && e.preventDefault(),
  8376. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8377. c.classList.remove("fadeIn")
  8378. }
  8379. };
  8380. s.extendObject(h, l.prototype),
  8381. t.exports = h
  8382. }
  8383. , {
  8384. "../../analytics": 4,
  8385. "../../localization/localize": 108,
  8386. "../../util/ajax": 181,
  8387. "../../util/common": 185,
  8388. "./TermsEvent": 78,
  8389. events: 202
  8390. }],
  8391. 80: [function(e, t, i) {
  8392. "use strict";
  8393. t.exports = Object.freeze({
  8394. OPEN_INFO: "title.open.info",
  8395. CLOSE_INFO: "title.close.info",
  8396. SHOW_INFO: "title.show.info",
  8397. HIDE_INFO: "title.hide.info",
  8398. LINK_CLICKED: "title.link.click",
  8399. CONTACT_LINK_CLICKED: "title.contact.click",
  8400. ORIGIN_LINK_CLICKED: "title.origin.click"
  8401. })
  8402. }
  8403. , {}],
  8404. 81: [function(e, t, i) {
  8405. "use strict";
  8406. function n(e, t) {
  8407. o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t)
  8408. }
  8409. function r(e, t) {
  8410. function i(i) {
  8411. e.shouldShowtags = "show" === this.value,
  8412. e.shouldShowtags ? t.showAlltags(o.tags.startup.fadeInDuration) : t.hideAlltags(o.tags.startup.fadeInDuration)
  8413. }
  8414. document.getElementById("tag-toggles").classList.remove("hidden"),
  8415. document.getElementById("radio-tag-show").checked = !0;
  8416. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8417. n[r].addEventListener("change", i)
  8418. }
  8419. var o = e("../../settings");
  8420. t.exports.init = n
  8421. }
  8422. , {
  8423. "../../settings": 166
  8424. }],
  8425. 82: [function(e, t, i) {
  8426. (function(i) {
  8427. "use strict";
  8428. function n(e, t) {
  8429. return e && u.valueFromHash("title", 1) && 2 !== u.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e, g_weixinObj.title = e,
  8430. e.length > g.minTooltipCharacters && I.parentElement.setAttribute("data-original-title", e),
  8431. t && 1 !== m.specialEdition && m.brand && !m.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8432. document.getElementById("gui-name").classList.add("noCoBrand"),
  8433. document.getElementById("cobrandTitle").classList.add("hidden")),
  8434. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8435. !1)
  8436. }
  8437. function r(e) {
  8438. return e ? (L = !0,
  8439. void (_.innerHTML = e)) : void _.classList.add("hidden")
  8440. }
  8441. function o(e, t, i, n) {
  8442. if (!e && !t && !i || !m.brand || u.valueFromHash("mls", !1))
  8443. return void T.classList.add("hidden");
  8444. L = !0;
  8445. var r = []
  8446. , o = c(r, "<br>");
  8447. if (e && o('<span id="contactName">' + e + "</span>"),
  8448. t) {
  8449. var a = n || t
  8450. , s = u.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>";
  8451. o(s)
  8452. }
  8453. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8454. r[0] = "",
  8455. x.innerHTML = r.join("")
  8456. }
  8457. function a(e) {
  8458. if ("string" == typeof e)
  8459. try {
  8460. e = JSON.parse(e)
  8461. } catch (e) {
  8462. return y.warn("Unable to parse address data"),
  8463. void S.parentElement.classList.add("hidden")
  8464. }
  8465. if (!(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)))
  8466. return void S.parentElement.classList.add("hidden");
  8467. L = !0;
  8468. var t = []
  8469. , i = c(t, " ");
  8470. e.address_1 && i(e.address_1),
  8471. e.address_2 && i(e.address_2),
  8472. e.city && i(e.city, ", "),
  8473. e.state && i(e.state, ", "),
  8474. e.zip && i(e.zip, e.state ? " " : ", "),
  8475. t[0] = "",
  8476. S.innerText = t.join("")
  8477. }
  8478. function s(e) {
  8479. var t = document.createElement("a");
  8480. return t.id = "url",
  8481. t.target = "_blank",
  8482. t.href = e,
  8483. t.innerText = e,
  8484. t.addEventListener("click", N.emit.bind(N, v.ORIGIN_LINK_CLICKED)),
  8485. t
  8486. }
  8487. function l(e) {
  8488. return !(!e || u.inIframe() && document.referrer === e) && (R.classList.remove("hidden"),
  8489. P.innerHTML = f.WEBVR_LEARN_MORE + ": ",
  8490. P.appendChild(s(e)),
  8491. O.forEach(function(e) {
  8492. e.classList.add("share-link")
  8493. }),
  8494. !0)
  8495. }
  8496. function c(e, t) {
  8497. var i = e
  8498. , n = t;
  8499. return function(e, t) {
  8500. i.push(t || n, e)
  8501. }
  8502. }
  8503. function h() {
  8504. document.getElementById("title-toggle").addEventListener("click", N.toggleTitle.bind(N)),
  8505. L && I.addEventListener("click", N.toggleMeta.bind(N, !1));
  8506. var e = [].slice.call(_.querySelectorAll("a"));
  8507. e.forEach(function(e) {
  8508. e.addEventListener("click", N.emit.bind(N, v.LINK_CLICKED))
  8509. });
  8510. var t = [].slice.call(T.querySelectorAll("a"));
  8511. t.forEach(function(e) {
  8512. e.addEventListener("click", N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
  8513. contact_type: e.getAttribute("id")
  8514. }))
  8515. })
  8516. }
  8517. var u = e("../../util/browser")
  8518. , d = e("../../util/common")
  8519. , p = e("../../util/logger")
  8520. , f = e("../../localization/localize")
  8521. , g = e("./titleBarSettings")
  8522. , m = e("../../settings")
  8523. , v = e("./TitleEvents")
  8524. , A = e("events").EventEmitter
  8525. , y = new p(i)
  8526. , C = document.querySelector(".pinTop.left")
  8527. , I = document.getElementsByClassName("title-container")[0]
  8528. , E = document.getElementById("title-toggle").querySelector("i")
  8529. , b = document.getElementById("meta-info-wrapper")
  8530. , w = document.getElementById("meta-info")
  8531. , _ = document.getElementById("meta-description")
  8532. , T = document.getElementsByClassName("contact-info")[0]
  8533. , x = document.getElementById("contact-data")
  8534. , S = document.getElementById("addressTxt")
  8535. , M = document.getElementById("tag-toggles")
  8536. , R = document.getElementById("share-origin")
  8537. , P = document.getElementById("share-link-wrapper")
  8538. , O = [w, b, I]
  8539. , L = !1
  8540. , D = !1
  8541. , N = {
  8542. populate: function(e) {
  8543. if (n(e.name, e.coBrand)) {
  8544. if (r(e.description),
  8545. o(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8546. a(e.address),
  8547. L) {
  8548. var t = document.createElement("br");
  8549. M.insertBefore(t, M.firstElementChild)
  8550. }
  8551. e.socialSharing && m.share.enabled && (D = l(e.url))
  8552. }
  8553. },
  8554. finishSetup: function(e) {
  8555. L = L || !!e,
  8556. h(),
  8557. L || (D ? I.classList.add("share-only") : I.classList.add("no-meta"))
  8558. },
  8559. toggleMeta: function(e, t) {
  8560. var title = document.getElementById("model-title");
  8561. t && t.preventDefault();
  8562. var i = w.classList.contains("expand");
  8563. e && !i || (i ? (O.forEach(function(e) {
  8564. e.classList.remove("expand")
  8565. }),
  8566. this.emit(v.CLOSE_INFO),title.classList.remove("expand")) : (O.forEach(function(e) {
  8567. e.classList.add("expand");
  8568. }),
  8569. title.classList.add("expand"),
  8570. this.emit(v.OPEN_INFO)))
  8571. },
  8572. setupToggling: function() {
  8573. b.style.height = w.offsetHeight + "px",
  8574. w.addEventListener("transitionend", function() {
  8575. b.style.height = w.offsetHeight + "px"
  8576. })
  8577. },
  8578. toggleTitle: function(e) {
  8579. e && e.preventDefault(),
  8580. C.classList.contains("closed") ? (C.classList.add("open"),
  8581. E.classList.remove("icon-dpad-right"),
  8582. E.classList.add("icon-dpad-left"),
  8583. this.emit(v.SHOW_INFO),
  8584. setTimeout(function() {
  8585. C.classList.remove("closed"),
  8586. C.classList.remove("open")
  8587. }, g.removeAnimationClasses)) : (C.classList.add("closed"),
  8588. E.classList.remove("icon-dpad-left"),
  8589. E.classList.add("icon-dpad-right"),
  8590. this.emit(v.HIDE_INFO))
  8591. }
  8592. };
  8593. d.extendObject(N, A.prototype),
  8594. t.exports = N
  8595. }
  8596. ).call(this, "/js/gui/title/titleBar.js")
  8597. }
  8598. , {
  8599. "../../localization/localize": 108,
  8600. "../../settings": 166,
  8601. "../../util/browser": 182,
  8602. "../../util/common": 185,
  8603. "../../util/logger": 189,
  8604. "./TitleEvents": 80,
  8605. "./titleBarSettings": 83,
  8606. events: 202
  8607. }],
  8608. 83: [function(e, t, i) {
  8609. "use strict";
  8610. t.exports = Object.freeze({
  8611. minTooltipCharacters: 19,
  8612. removeAnimationClasses: 500
  8613. })
  8614. }
  8615. , {}],
  8616. 84: [function(e, t, i) {
  8617. "use strict";
  8618. function n(e) {
  8619. C = e,
  8620. P.forEach(function(e) {
  8621. b.addEventListener(e, u.bind(this, !1), !0),
  8622. w.addEventListener(e, u.bind(this, !0), !0),
  8623. E.addEventListener(e, o, !0),
  8624. S.forEach(function(t) {
  8625. t.addEventListener(e, a, !0)
  8626. }),
  8627. $("#drawer img").on(e, a)
  8628. }),
  8629. document.addEventListener("keydown", u.bind(this, !1), !0),
  8630. C.on(v.TourStart, function() {
  8631. E.classList.add("playing")
  8632. })
  8633. }
  8634. function r() {
  8635. C.playTour(),
  8636. I && clearTimeout(I),
  8637. d(),
  8638. _.removeClass("fadeIn")
  8639. }
  8640. function o() {
  8641. E.classList.contains("playing") && (C.stopTour(),
  8642. _.addClass("fadeIn"),
  8643. setTimeout(function() {
  8644. _.removeClass("fadeIn")
  8645. }, p.tourInteraction.showPauseButton),
  8646. O || (clearTimeout(I),
  8647. I = setTimeout(h, p.tourInteraction.showModal)),
  8648. setTimeout(function() {
  8649. E.classList.remove("playing")
  8650. }, p.tourInteraction.allowNextClick))
  8651. }
  8652. function a() {
  8653. C.tourInProgress && (C.stopTour(),
  8654. C.endTourProgress(),
  8655. E.classList.remove("playing"))
  8656. }
  8657. function s() {
  8658. T.is(":visible") ? r() : o()
  8659. }
  8660. function l() {
  8661. x.hasClass("playing") && (clearTimeout(I),
  8662. C.atEndOfTour() ? c() : _.removeClass("fadeIn"))
  8663. }
  8664. function c() {
  8665. E.classList.remove("playing"),
  8666. h()
  8667. }
  8668. function h() {
  8669. if (!p.tourInteraction.disabled) {
  8670. M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
  8671. M.addClass("fadeIn tour " + m.deviceType);
  8672. var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
  8673. if (!p.tourInteraction.smallModal) {
  8674. var t;
  8675. t = C.player.mode === g.PANORAMA && !C.player.currentPano.isAligned() || C.player.mode === g.DOLLHOUSE ? g.OUTDOOR : C.player.mode === g.FLOORPLAN ? g.FLOORPLAN : g.PANORAMA,
  8676. m.fill(R, A.TOUR_INTERACTION[t]),
  8677. M.addClass(t)
  8678. }
  8679. M.addClass(e)
  8680. }
  8681. }
  8682. function u(e, t) {
  8683. if (t) {
  8684. var i = "keydown" === t.type
  8685. , n = t.which === f.SPACE || C.tourIsPlaying;
  8686. i && n || e || (O = !0),
  8687. C.atEndOfTour() && d(),
  8688. !C.tourIsPlaying && C.tourInProgress && (_.removeClass("fadeIn"),
  8689. d(),
  8690. t.which !== f.SPACE && a()),
  8691. i && n && s()
  8692. }
  8693. }
  8694. function d() {
  8695. M.removeClass("fadeIn")
  8696. }
  8697. var p = (e("../util/browser"),
  8698. e("../settings"))
  8699. , f = e("../enum/Keys")
  8700. , g = e("../enum/Viewmode")
  8701. , m = (e("./helpManager"),
  8702. e("./populateModal"))
  8703. , v = e("../enum/DirectorEvents")
  8704. , A = e("../enum/HelpModalType")
  8705. , y = e("../enum/HelpModalSize")
  8706. , C = null
  8707. , I = null
  8708. , E = document.getElementById("pause-overlay")
  8709. , b = document.getElementById("player")
  8710. , w = document.getElementById("gui")
  8711. , _ = $("#pause-icon").eq(0)
  8712. , T = $("#play").eq(0)
  8713. , x = $("#playHead").eq(0)
  8714. , S = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8715. , M = $("#interaction-modal").eq(0)
  8716. , R = $("#interaction-modal .interaction").toArray()
  8717. , P = ["touchstart", "mousedown", "pointerdown"]
  8718. , O = !1;
  8719. t.exports.init = n,
  8720. t.exports.play = r,
  8721. t.exports.pause = o,
  8722. t.exports.pauseWithoutCTA = a,
  8723. t.exports.togglePlay = s,
  8724. t.exports.stopTour = l,
  8725. t.exports.dismissModal = d
  8726. }
  8727. , {
  8728. "../enum/DirectorEvents": 23,
  8729. "../enum/HelpModalSize": 27,
  8730. "../enum/HelpModalType": 28,
  8731. "../enum/Keys": 30,
  8732. "../enum/Viewmode": 51,
  8733. "../settings": 166,
  8734. "../util/browser": 182,
  8735. "./helpManager": 68,
  8736. "./populateModal": 75
  8737. }],
  8738. 85: [function(e, t, i) {
  8739. "use strict";
  8740. t.exports = Object.freeze({
  8741. OPENED: "vr.modal.opened",
  8742. LAUNCH: "vr.modal.launch",
  8743. CLOSED: "vr.modal.closed",
  8744. NEXT: "vr.modal.next",
  8745. PREV: "vr.modal.prev",
  8746. STORE: "vr.modal.store",
  8747. falseICECHOSEN: "vr.modal.device"
  8748. })
  8749. }
  8750. , {}],
  8751. 86: [function(e, t, i) {
  8752. "use strict";
  8753. function n(e, t, i) {
  8754. function n(e, t, n, r) {
  8755. function o() {
  8756. return p + "&m=" + t + "&display=" + e
  8757. }
  8758. function s() {
  8759. var e = "&utm_medium=" + (a.inIframe() ? "embed" : "direct")
  8760. , t = "&utm_source=" + u
  8761. , n = "&utm_showcase_session_id=" + i;
  8762. return e + t + n
  8763. }
  8764. function l() {
  8765. return d + "&sids=" + t + "&lsid=" + t + "&ln=" + encodeURIComponent(n) + "&ld=" + encodeURIComponent(r) + "&display=" + e
  8766. }
  8767. return a.valueFromHash("vrcoll", !1) ? l() + s() : o() + s()
  8768. }
  8769. function r(e, t, i, r) {
  8770. var o = "https://api.branch.io/v1/url"
  8771. , a = n(e, t, i, r)
  8772. , s = {
  8773. responseType: "json",
  8774. data: {
  8775. branch_key: h.appConfig.branch_key,
  8776. data: {
  8777. m: t,
  8778. full_url: a,
  8779. $desktop_url: m,
  8780. $og_app_id: "331853976762864119",
  8781. $og_title: i,
  8782. $og_description: r,
  8783. $og_image_url: location.origin + "/api/v1/player/models/" + t + "/thumb",
  8784. $canonical_url: window.location.href
  8785. }
  8786. }
  8787. };
  8788. c.post(o, s).done(function(t) {
  8789. f[e] = t.url
  8790. }).fail(function(t) {
  8791. f[e] = t
  8792. }
  8793. .bind(this, a))
  8794. }
  8795. function o(e, t, i) {
  8796. for (var r in s) {
  8797. var o = s[r]
  8798. , a = n(o, e, t, i);
  8799. f[o] = a
  8800. }
  8801. }
  8802. var u = a.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8803. , d = g + "/vr/dlist/?ret=" + u
  8804. , p = g + "/vr/show/?ret=" + u
  8805. , m = "";
  8806. switch (e) {
  8807. case l.IOS:
  8808. r(s.CardboardIOS, t.sid, t.name, t.summary);
  8809. break;
  8810. default:
  8811. o(t.sid, t.name, t.summary)
  8812. }
  8813. }
  8814. function r(e) {
  8815. var t = f[e];
  8816. window.open(t, "_blank")
  8817. }
  8818. function o(e) {
  8819. var t = u[e];
  8820. window.open(t, "_blank")
  8821. }
  8822. var a = e("../../util/browser")
  8823. , s = e("../../enum/VRApps")
  8824. , l = e("../../enum/VRPlatforms")
  8825. , c = e("../../util/ajax")
  8826. , h = e("../../settings")
  8827. , u = {};
  8828. u[s.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8829. u[s.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8830. u[s.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=";
  8831. for (var d in s) {
  8832. var p = s[d];
  8833. u[p] += encodeURIComponent(document.referrer + "&display=" + p)
  8834. }
  8835. var f = {}
  8836. , g = function() {
  8837. var e = window.location.host;
  8838. return e.indexOf(".port.com") === -1 && e.indexOf("localhost") === -1 && (e = "my.port.com"),
  8839. "https://" + e
  8840. }();
  8841. t.exports.init = n,
  8842. t.exports.launch = r,
  8843. t.exports.launchStore = o
  8844. }
  8845. , {
  8846. "../../enum/VRApps": 46,
  8847. "../../enum/VRPlatforms": 49,
  8848. "../../settings": 166,
  8849. "../../util/ajax": 181,
  8850. "../../util/browser": 182
  8851. }],
  8852. 87: [function(e, t, i) {
  8853. "use strict";
  8854. function n(e) {
  8855. var t;
  8856. switch (e) {
  8857. case m.IOS:
  8858. return t = p.iosVersion(),
  8859. t.major > 9 || 9 === t.major && t.minor >= 1;
  8860. case m.Android:
  8861. return t = p.androidVersion(),
  8862. t.major > 4 || 4 === t.major && t.minor > 4 || 4 === t.major && 4 === t.minor && t.patch >= 4
  8863. }
  8864. return !1
  8865. }
  8866. function r(e, t) {
  8867. function i(e) {
  8868. K.emit(A.STORE, {
  8869. type: e
  8870. }),
  8871. f.launchStore(e)
  8872. }
  8873. function r(e) {
  8874. switch (e !== _.pageCount && (a(e),
  8875. N.text(e + 1 + " / " + _.pageCount)),
  8876. e) {
  8877. case _.Title:
  8878. O.css("display", "none"),
  8879. L.text(u[e]),
  8880. o(s);
  8881. break;
  8882. case _.Cardboard:
  8883. O.css("display", "block"),
  8884. L.text(u[e]),
  8885. M.filter(".cardboard").off(),
  8886. M.filter(".gearvr").off(),
  8887. c(e, s),
  8888. h(H, X, Z);
  8889. break;
  8890. case _.Gear:
  8891. L.text(u[e]),
  8892. c(e, s),
  8893. T.addClass("lastPage"),
  8894. h(G, X, Z);
  8895. break;
  8896. case _.pageCount:
  8897. T.removeClass("fadeIn"),
  8898. K.emit(A.CLOSED)
  8899. }
  8900. B.filter("[src='']").hide()
  8901. }
  8902. var s = function() {
  8903. return p.detectAndroid() ? p.detectAndroidMobile() && n(m.Android) ? (T.addClass("supported"),
  8904. w = ".show-supported",
  8905. m.Android) : (T.addClass("unsupported"),
  8906. w = ".show-unsupported",
  8907. m.UnsupportedAndroid) : p.detectIPhone() || p.detectIPod() ? (T.addClass("ios"),
  8908. w = ".show-ios",
  8909. _ = v.ios,
  8910. m.IOS) : (T.addClass("desktop"),
  8911. w = ".show-desktop",
  8912. m.Desktop)
  8913. }();
  8914. f.init(s, e, t),
  8915. s !== m.Desktop && T.addClass("mobile");
  8916. var l = function(e) {
  8917. K.emit(A.LAUNCH, {
  8918. vr_platform: s,
  8919. vr_app: e
  8920. }),
  8921. f.launch(e)
  8922. };
  8923. q.cardboardAndroid = l.bind(this, g.CardboardAndroid),
  8924. q.gear = l.bind(this, g.GearVR),
  8925. q.cardboardIOS = l.bind(this, g.CardboardIOS),
  8926. d(),
  8927. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  8928. $(w).show();
  8929. var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS]
  8930. , y = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  8931. s === m.IOS && (u.splice(1, 1),
  8932. y.splice(1, 1)),
  8933. $("#vr").on("click", function(e) {
  8934. e.preventDefault();
  8935. if(!window.vrEnabled) { // 开启VR
  8936. window.vrEnabled = true;
  8937. this.classList.add('active');
  8938. $('#gui div').not('#vrOff').addClass('vrHide');
  8939. $('#vrOffImg').css({'display':'inline-block'});
  8940. }else{
  8941. }
  8942. // T.hasClass("fadeIn") ? K.dismiss() : (b = 0,
  8943. // r(b),
  8944. // T.addClass("fadeIn"),
  8945. // K.emit(A.OPENED))
  8946. });
  8947. $('#vrOff').on('click', function(){
  8948. window.vrEnabled = false;
  8949. $('#gui div').not('#vrOff').removeClass('vrHide');
  8950. $('#vrOffImg').css({'display':'none'});
  8951. $('#player canvas').css({width:'', 'height': ''}); // 清楚vr下给canvas设置的宽高, 避免横竖屏切换的时候出现宽高错误的现象
  8952. $('#vr').removeClass('active'); // 清除vr按钮的激活样式
  8953. })
  8954. var I = "https://my.port.com/vr/show/?m=" + e.sid;
  8955. s === m.IOS ? $(".cardboardLink").on("click", i.bind(this, g.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, g.CardboardAndroid)),
  8956. $(".gearLink").on("click", i.bind(this, g.GearVR)),
  8957. $("span.modelLink").text(I),
  8958. O.on("click", function(e) {
  8959. K.emit(A.PREV),
  8960. b--,
  8961. r(b)
  8962. }),
  8963. L.on("click", function(e) {
  8964. L.text();
  8965. K.emit(A.NEXT, {
  8966. nextAction: y[b]
  8967. }),
  8968. b++,
  8969. r(b)
  8970. }),
  8971. T.find(".close").on("click", K.dismiss)
  8972. }
  8973. function o(e) {
  8974. switch (e) {
  8975. case m.Android:
  8976. M.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8977. M.filter(".gearvr").off().on("click", q.gear),
  8978. s(H, G, "logo-button", "same-line");
  8979. break;
  8980. case m.UnsupportedAndroid:
  8981. s("", z, "", "");
  8982. break;
  8983. case m.IOS:
  8984. M.filter(".cardboard").off().on("click", q.cardboardIOS),
  8985. s(H, "", "logo-button", "");
  8986. break;
  8987. case m.Desktop:
  8988. M.filter(".cardboard").off().on("click", l.bind(this, null, F, U)),
  8989. M.filter(".gearvr").off().on("click", l.bind(this, G, V, null)),
  8990. s(H, G, "logo-button", "same-line"),
  8991. Q.cardboard()
  8992. }
  8993. }
  8994. function a(e) {
  8995. $(".p1, .p2, .p3").hide(),
  8996. x.insertAfter(S),
  8997. T.removeClass("front-page"),
  8998. T.removeClass("details-page"),
  8999. T.removeClass("lastPage"),
  9000. M.removeClass("logo-button"),
  9001. M.removeClass("same-line"),
  9002. S.removeClass("headsetOptions"),
  9003. R.attr("src", ""),
  9004. R.filter(".second").removeClass("gear"),
  9005. R.css("display", "inline-block"),
  9006. R.off(),
  9007. P.filter(".second").css("display", ""),
  9008. D.css("display", "none"),
  9009. $(".p" + (e + 1) + w).show(),
  9010. R.filter(".third").insertBefore(P.filter(".third"))
  9011. }
  9012. function s(e, t, i, n) {
  9013. T.addClass("front-page"),
  9014. R.filter(".first").attr("src", e),
  9015. R.filter(".second").attr("src", t),
  9016. M.filter(".first").addClass(i),
  9017. M.filter(".second").addClass(i),
  9018. M.addClass(n),
  9019. ".show-desktop" === w && S.insertAfter(x)
  9020. }
  9021. function l(e, t, i) {
  9022. S.addClass("headsetOptions"),
  9023. M.off(),
  9024. R.filter(".second").attr("src", t),
  9025. D.css("display", "block"),
  9026. P.filter(".second").css("display", "none"),
  9027. D.on("click", function() {
  9028. a(_.Title),
  9029. o(m.Desktop)
  9030. }),
  9031. e && (K.emit(A.falseICECHOSEN, {
  9032. name: g.GearVR
  9033. }),
  9034. R.filter(".first").attr("src", e),
  9035. R.filter(".second").addClass("gear"),
  9036. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  9037. Q.gearvr()),
  9038. i && (K.emit(A.falseICECHOSEN, {
  9039. name: g.Cardboard
  9040. }),
  9041. R.filter(".third").attr("src", i),
  9042. R.filter(".third").show(),
  9043. R.filter(".third").insertAfter(R.filter(".second")),
  9044. R.filter(".third").addClass("link"),
  9045. R.filter(".second").addClass("link"),
  9046. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  9047. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid)),
  9048. Q.cardboard())
  9049. }
  9050. function c(e, t) {
  9051. switch (t) {
  9052. case m.IOS:
  9053. X = Y,
  9054. Z = j;
  9055. break;
  9056. case m.Desktop:
  9057. e === _.Cardboard ? (X = F,
  9058. Z = U,
  9059. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  9060. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid))) : (X = V,
  9061. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  9062. Z = "");
  9063. break;
  9064. default:
  9065. e === _.Cardboard ? (X = z,
  9066. Z = j) : (X = k,
  9067. Z = W)
  9068. }
  9069. }
  9070. function h(e, t, i) {
  9071. T.find(".inner").addClass("details-page"),
  9072. T.addClass("details-page"),
  9073. R.filter(".first").attr("src", e),
  9074. R.filter(".second").attr("src", t),
  9075. R.filter(".third").attr("src", i)
  9076. }
  9077. function u() {
  9078. T.hasClass("fadeIn") && (T.removeClass("fadeIn"),
  9079. K.emit(A.CLOSED))
  9080. }
  9081. function d() {
  9082. var e = p.aspectRatio() > 1 && p.isMobile();
  9083. T.toggleClass("landscape", e).toggleClass("portrait", !e),
  9084. T.toggleClass("tiny", $("#player").height() <= y.narrowLandscapeHeight),
  9085. T.toggleClass("tinier", $("#player").height() <= y.reallyNarrowLandscapeHeight)
  9086. }
  9087. var p = e("../../util/browser")
  9088. , f = e("./vrLink")
  9089. , g = e("../../enum/VRApps")
  9090. , m = e("../../enum/VRPlatforms")
  9091. , v = e("../../enum/VRPages")
  9092. , A = e("./vrEvent")
  9093. , y = (e("../../settings"),
  9094. e("../../constants"))
  9095. , C = e("../../localization/localize")
  9096. , I = e("../../util/common")
  9097. , E = e("events").EventEmitter
  9098. , b = 0
  9099. , w = null
  9100. , _ = v.standard
  9101. , T = $(".vr-popup")
  9102. , x = T.find(".vr-popup-body")
  9103. , S = T.find(".vr-images")
  9104. , M = T.find(".img-container")
  9105. , R = T.find(".vr-sm-image")
  9106. , P = M.find(".vr-img-caption")
  9107. , O = $(".vr-buttons").find(".prev-button")
  9108. , L = $(".vr-buttons").find(".next-button")
  9109. , D = S.find(".front-close")
  9110. , N = $(".vr-page")
  9111. , B = T.find("img")
  9112. , F = "images/apple-store.png"
  9113. , V = "images/badge-oculus.png"
  9114. , U = "images/badge-cardboard.png"
  9115. , k = "images/logo-samsung.png"
  9116. , H = "images/headset-cardboard.png"
  9117. , G = "images/headset-gearvr.png"
  9118. , z = "images/ico-android-robot.png"
  9119. , W = "images/ico-gearvr.png"
  9120. , j = "images/ico-vr.png"
  9121. , Y = "images/apple-logo-white.svg"
  9122. , X = null
  9123. , Z = null
  9124. , q = {}
  9125. , K = {
  9126. init: r,
  9127. dismiss: u,
  9128. isDeviceSupported: n
  9129. };
  9130. I.extendObject(K, E.prototype),
  9131. $(window).resize(d);
  9132. var Q = function() {
  9133. var e = P.filter(".first").find(".cardboard")
  9134. , t = P.filter(".first").find(".gearvr");
  9135. return {
  9136. cardboard: function() {
  9137. t.addClass("hidden"),
  9138. e.removeClass("hidden")
  9139. },
  9140. gearvr: function() {
  9141. e.addClass("hidden"),
  9142. t.removeClass("hidden")
  9143. }
  9144. }
  9145. }();
  9146. t.exports = K
  9147. }
  9148. , {
  9149. "../../constants": 8,
  9150. "../../enum/VRApps": 46,
  9151. "../../enum/VRPages": 48,
  9152. "../../enum/VRPlatforms": 49,
  9153. "../../localization/localize": 108,
  9154. "../../settings": 166,
  9155. "../../util/browser": 182,
  9156. "../../util/common": 185,
  9157. "./vrEvent": 85,
  9158. "./vrLink": 86,
  9159. events: 202
  9160. }],
  9161. 88: [function(e, t, i) {
  9162. "use strict";
  9163. t.exports = Object.freeze({
  9164. OPENED: "webvr.modal.opened",
  9165. SHOW_TERMS: "webvr.footer.show.terms"
  9166. })
  9167. }
  9168. , {}],
  9169. 89: [function(e, t, i) {
  9170. (function(i) {
  9171. "use strict";
  9172. function n(e, t, i, n) {
  9173. function r(e) {
  9174. e.preventDefault(),
  9175. a(e.currentTarget.id)
  9176. }
  9177. function a(e) {
  9178. ne[e](),
  9179. Object.keys(ne).map(function(t, i) {
  9180. $("#" + t).toggleClass("tabs-underlined", t === e)
  9181. })
  9182. }
  9183. y = i,
  9184. v = t,
  9185. w.init(E.Android, e, n),
  9186. m();
  9187. var l = new RegExp("daydream","i")
  9188. , c = l.test(y.displayName);
  9189. c ? (a("tabdaydream"),
  9190. B.filter(".device-headset-side").attr("src", H),
  9191. D.find(".title").text(x.localizeText("WEBVR_FOR_DAYDREAM"))) : (a("tabcardboard"),
  9192. B.filter(".device-headset-side").attr("src", Y),
  9193. D.find(".title").text(x.localizeText("WEBVR_FOR_CARDBOARD"))),
  9194. $("#vr").on("click", function(e) {
  9195. e.preventDefault(),
  9196. g("click_webvr_button"),
  9197. L.is(":hidden") && (ie.emit(_.OPENED),
  9198. o())
  9199. }),
  9200. $(".webvr-popup .close").on("click", function(e) {
  9201. e.preventDefault(),
  9202. D.hasClass("hidden") ? (g("webvr_help_close"),
  9203. p()) : s()
  9204. }),
  9205. $("#tabcardboard").on("click", r),
  9206. $("#tabdaydream").on("click", r),
  9207. $("#tabnative").on("click", r),
  9208. $(".webvr-popup .open-with-app").on("click", function(e) {
  9209. e.preventDefault(),
  9210. g("webvr_learn_more"),
  9211. a("tabnative"),
  9212. p()
  9213. }),
  9214. $(".webvr-popup .help").on("click", function(e) {
  9215. e.preventDefault(),
  9216. g(D.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9217. p()
  9218. }),
  9219. $(".webvr-popup .terms").on("click", function(e) {
  9220. e.preventDefault(),
  9221. g("webvr_click_terms"),
  9222. s(),
  9223. ie.emit(_.SHOW_TERMS)
  9224. }),
  9225. F.on("click", function(e) {
  9226. e.preventDefault(),
  9227. g(ee),
  9228. window.open(J, "_blank")
  9229. }),
  9230. V.on("click", function(e) {
  9231. e.preventDefault(),
  9232. g("webvr_phone_link"),
  9233. window.open(te, "_blank")
  9234. }),
  9235. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9236. e.preventDefault(),
  9237. g("webvr_cardboard_link"),
  9238. w.launch(b.CardboardAndroid)
  9239. }),
  9240. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9241. e.preventDefault(),
  9242. g("webvr_oculus_link"),
  9243. w.launch(b.GearVR)
  9244. })
  9245. }
  9246. function r() {
  9247. function e() {
  9248. y.isPresenting || (f(),
  9249. window.removeEventListener("vrdisplaypresentchange", e))
  9250. }
  9251. R.info("Headset mounted"),
  9252. v.suspend();
  9253. var t = document.createElement("canvas");
  9254. for (t.getContext("webgl"),
  9255. t.className = "webvr-canvas",
  9256. document.bgColor = "#000",
  9257. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9258. document.body.removeChild(document.body.firstChild);
  9259. document.body.appendChild(t),
  9260. g("webvr_enter_app"),
  9261. y.requestPresent([{
  9262. source: t,
  9263. predistorted: !0
  9264. }]).catch(function(t) {
  9265. R.error("Failed to present: " + t),
  9266. g("webvr_exit_calibrate"),
  9267. e()
  9268. }),
  9269. A.then(function() {
  9270. window.dispatchEvent(new Event("vrapp-start"))
  9271. }),
  9272. window.addEventListener("vrdisplaypresentchange", e)
  9273. }
  9274. function o() {
  9275. O.fadeOut(I.guiAnimationSpeed),
  9276. L.fadeIn(I.guiAnimationSpeed),
  9277. a()
  9278. }
  9279. function a() {
  9280. if (!A) {
  9281. var e = C.valueFromHash("webvr") || I.appConfig.webvr_version
  9282. , t = "https://static.port.com/webvr/" + e + "/js/main.js";
  9283. A = new Promise(function(e, i) {
  9284. var n = document.createElement("script");
  9285. n.type = "text/javascript",
  9286. n.src = t,
  9287. n.onload = e,
  9288. document.head.appendChild(n)
  9289. }
  9290. )
  9291. }
  9292. D.find(".enter-button").on("click", r)
  9293. }
  9294. function s() {
  9295. g("webvr_modal_close"),
  9296. D.find(".enter-button").off("click", r),
  9297. L.fadeOut(I.guiAnimationSpeed, function() {
  9298. D.toggleClass("hidden", !1),
  9299. N.toggleClass("hidden", !0),
  9300. C.exitFullscreen()
  9301. }),
  9302. O.fadeIn(I.guiAnimationSpeed)
  9303. }
  9304. function l() {
  9305. k.toggleClass("hidden", !1),
  9306. U.toggleClass("hidden", !0)
  9307. }
  9308. function c() {
  9309. k.toggleClass("hidden", !0),
  9310. U.toggleClass("hidden", !1)
  9311. }
  9312. function h() {
  9313. B.filter(".device-headset").attr("src", G),
  9314. B.filter(".device-phone").attr("src", z),
  9315. J = Z,
  9316. ee = K,
  9317. F.text(x.localizeText("WEBVR_DAYDREAM_VIEW")),
  9318. V.text(x.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9319. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9320. c()
  9321. }
  9322. function u() {
  9323. B.filter(".badge-cardboard").attr("src", j),
  9324. B.filter(".badge-oculus").attr("src", X),
  9325. l()
  9326. }
  9327. function d() {
  9328. B.filter(".device-headset").attr("src", Y),
  9329. B.filter(".device-phone").attr("src", W),
  9330. J = q,
  9331. ee = Q,
  9332. F.text(x.localizeText("VR_GOOGLE_CARDBOARD")),
  9333. V.text(x.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9334. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9335. c()
  9336. }
  9337. function p() {
  9338. D.toggleClass("hidden"),
  9339. N.toggleClass("hidden")
  9340. }
  9341. function f() {
  9342. R.info("exiting webVR"),
  9343. g("webvr_exit_app"),
  9344. window.location.search.indexOf("&qs=1") === -1 ? window.location = window.location + "&qs=1" : window.location = window.location
  9345. }
  9346. function g(e) {
  9347. var t = C.isLandscape() ? "landscape" : "portrait";
  9348. T.trackAlways("showcase_gui", {
  9349. gui_action: e,
  9350. orientation: t
  9351. })
  9352. }
  9353. function m() {
  9354. var e = C.isLandscape();
  9355. L.toggleClass("landscape", e).toggleClass("portrait", !e)
  9356. }
  9357. var v, A, y, C = e("../../util/browser"), I = e("../../settings"), E = (e("./../gui"),
  9358. e("../../enum/VRPlatforms")), b = e("../../enum/VRApps"), w = e("./../vr/vrLink"), _ = e("./WebVrEvent"), T = e("../../analytics"), x = (e("../../constants"),
  9359. e("../../localization/localize")), S = e("../../util/common"), M = e("../../util/logger"), R = new M(i), P = e("events").EventEmitter, O = $("#gui"), L = $(".webvr-popup"), D = $(".webvr-popup .page.p1"), N = $(".webvr-popup .page.p2"), B = L.find(".image"), F = $(".webvr-popup .detail.headset"), V = $(".webvr-popup .detail.phone"), U = $(".webvr-popup .tab-content.webvr"), k = $(".webvr-popup .tab-content.native"), H = "images/device-daydream-side.png", G = "images/device-daydream.png", z = "images/device-pixel.png", W = "images/ico-android-robot.png", j = "images/badge-cardboard.png", Y = "images/headset-cardboard.png", X = "images/badge-oculus.png", Z = "https://madeby.google.com/vr/", q = "https://vr.google.com/cardboard/get-cardboard/", K = "webvr_daydream_link", Q = "webvr_cardboard_link", J = Z, ee = K, te = "https://vr.google.com/daydream/phones/", ie = {
  9360. init: n
  9361. }, ne = {
  9362. tabcardboard: d,
  9363. tabdaydream: h,
  9364. tabnative: u
  9365. };
  9366. S.extendObject(ie, P.prototype),
  9367. $(window).resize(m),
  9368. t.exports = ie
  9369. }
  9370. ).call(this, "/js/gui/webvr/webVRgui.js")
  9371. }
  9372. , {
  9373. "../../analytics": 4,
  9374. "../../constants": 8,
  9375. "../../enum/VRApps": 46,
  9376. "../../enum/VRPlatforms": 49,
  9377. "../../localization/localize": 108,
  9378. "../../settings": 166,
  9379. "../../util/browser": 182,
  9380. "../../util/common": 185,
  9381. "../../util/logger": 189,
  9382. "./../gui": 65,
  9383. "./../vr/vrLink": 86,
  9384. "./WebVrEvent": 88,
  9385. events: 202
  9386. }],
  9387. 90: [function(e, t, i) {
  9388. "use strict";
  9389. function n(e, t, i, n, o) {
  9390. n || 0 === n ? this.floorId = n : this.floorId = -1,
  9391. this.roomId = o || "",
  9392. this.labelId = e,
  9393. this.position = (new r.Vector3).copy(t),
  9394. this.text = i
  9395. }
  9396. var r = e("three")
  9397. , o = e("../util/browser");
  9398. n.prototype.build = function() {
  9399. var e = window.document.createElement("div");
  9400. o.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9401. var t = window.document.createElement("div");
  9402. t.setAttribute("class", "gui-floorplan-label-text");
  9403. var i = window.document.createTextNode(this.text);
  9404. t.appendChild(i),
  9405. e.appendChild(t),
  9406. window.document.body.appendChild(e),
  9407. this.labelGui = e,
  9408. this.textBlock = t,
  9409. $(this.labelGui).hide();
  9410. var n = window.getComputedStyle(this.labelGui);
  9411. this.initialTransform = n.transform || n.webkitTransform
  9412. }
  9413. ,
  9414. t.exports = n
  9415. }
  9416. , {
  9417. "../util/browser": 182,
  9418. three: 217
  9419. }],
  9420. 91: [function(e, t, i) {
  9421. "use strict";
  9422. function n() {
  9423. this.player = null,
  9424. this.modelManager = null,
  9425. this.container = null
  9426. }
  9427. var r = e("three")
  9428. , o = (e("../util/common"),
  9429. e("../enum/PlayerEvents"))
  9430. , a = (e("../enum/DirectorEvents"),
  9431. e("../enum/ModelManagerEvents"))
  9432. , s = e("../settings")
  9433. , l = e("../enum/Viewmode")
  9434. , c = (e("../enum/WarpStyle"),
  9435. e("../util/transitions"),
  9436. e("../util/lerp"),
  9437. e("../util/browser"));
  9438. //场景初始化
  9439. n.prototype.init = function(e, t, i) {
  9440. this.player = e,
  9441. this.modelManager = t,
  9442. this.container = i,
  9443. this.updateModel(),
  9444. this.bindEvents()
  9445. }
  9446. ,
  9447. n.prototype.bindEvents = function() {
  9448. this.modelManager.on(a.ActiveModelChanged, this.updateModel.bind(this)),
  9449. this.player.on(o.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9450. this.player.on(o.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9451. this.player.on(o.StartInside, this.handleStartInside.bind(this)),
  9452. this.player.on(o.StartOutside, this.handleStartOutside.bind(this))
  9453. }
  9454. ,
  9455. n.prototype.updateModel = function() {
  9456. this.model = this.modelManager.getActiveModel()
  9457. }
  9458. ,
  9459. n.prototype.handlePlayerViewChanged = function() {
  9460. this.updateLabelVisibility(),
  9461. this.updateLabelDisplay()
  9462. }
  9463. ,
  9464. n.prototype.getLabelsForFloor = function(e, t) {
  9465. return t = t || [],
  9466. t.length = 0,
  9467. this.model.labels.forEach(function(i) {
  9468. this.labelVisibleForFloor(i, e) && t.push(i)
  9469. }
  9470. .bind(this)),
  9471. t
  9472. }
  9473. ,
  9474. n.prototype.getLabelsForCurrentFloor = function(e) {
  9475. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9476. }
  9477. ,
  9478. n.prototype.labelVisibleForFloor = function(e, t) {
  9479. var i = c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.mobile || !c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.desktop;
  9480. if (!this.model.showingLabels || !e.labelGui || !i)
  9481. return !1;
  9482. var n = e.floorId === this.model.floors.size() - 1;
  9483. return this.model.allFloorsVisible ? n : e.floorId === t
  9484. }
  9485. ,
  9486. n.prototype.updateLabelVisibility = function(e) {
  9487. this.model.labels.forEach(function(e) {
  9488. this.supportedMode() && this.labelVisibleForFloor(e, this.model.currentFloor.floorIndex) ? this.showLabel(e, s.labels.fadeInDelay, s.labels.fadeInDuration) : this.hideLabel(e, s.labels.fadeOutDelay, s.labels.fadeOutDuration)
  9489. }
  9490. .bind(this))
  9491. }
  9492. ,
  9493. n.prototype.showAllLabels = function(e, t) {
  9494. this.model.labels.forEach(function(i) {
  9495. this.showLabel(i, e, t)
  9496. }
  9497. .bind(this))
  9498. }
  9499. ,
  9500. n.prototype.hideAllLabels = function(e, t) {
  9501. this.model.labels.forEach(function(i) {
  9502. this.hideLabel(i, e, t)
  9503. }
  9504. .bind(this))
  9505. }
  9506. ,
  9507. n.prototype.showLabel = function(e, t, i) {
  9508. this.model.showingLabels && (e.visible || (e.visible = !0,
  9509. e.labelGui.style.display = "block",
  9510. e.labelGui.style.opacity = 0,
  9511. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9512. }
  9513. ,
  9514. n.prototype.hideLabel = function(e, t, i) {
  9515. e.visible && (e.visible = !1,
  9516. c.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9517. }
  9518. ,
  9519. n.prototype.supportedMode = function() {
  9520. return this.player.mode === l.FLOORPLAN
  9521. }
  9522. ,
  9523. n.prototype.updateLabelDisplay = function() {
  9524. var e = (new r.Vector3,
  9525. new r.Vector3,
  9526. []);
  9527. return function() {
  9528. var t = this.player.getLabelScaleFactor()
  9529. , i = .6
  9530. , n = 1.2
  9531. , r = (1 - t) * n + i
  9532. , o = c.isMobile() ? s.labels.zoomTruncateThreshhold.mobile : s.labels.zoomTruncateThreshhold.desktop;
  9533. this.getLabelsForCurrentFloor(e);
  9534. for (var a = 0; a < e.length; a++) {
  9535. var l = e[a];
  9536. this.supportedMode() && l.labelGui && (this.updateProjectedGuiElement(l.labelGui, l.textBlock, l.position, r, r),
  9537. t >= o && l.text.length >= s.labels.minLengthForTruncate ? l.textBlock.innerText = l.text.substring(0, s.labels.truncateLength) + s.labels.truncateSuffix : l.textBlock.innerText = l.text)
  9538. }
  9539. }
  9540. }(),
  9541. n.prototype.updateProjectedGuiElement = function() {
  9542. var e = new r.Vector3;
  9543. new r.Vector3;
  9544. return function(t, i, n, r, o) {
  9545. i.style.fontSize = 100 * o + "%";
  9546. var a = $("#player").width()
  9547. , s = $("#player").height()
  9548. , l = .5 * a
  9549. , c = .5 * s;
  9550. e.copy(n),
  9551. e.project(this.player.camera);
  9552. var h = e.x * l + l
  9553. , u = -(e.y * c) + c;
  9554. h -= t.offsetWidth / 2,
  9555. u -= t.offsetHeight / 2,
  9556. t.style.left = h + "px",
  9557. t.style.top = u + "px"
  9558. }
  9559. }(),
  9560. n.prototype.handleStartInside = function(e) {
  9561. this.updateLabelVisibility()
  9562. }
  9563. ,
  9564. n.prototype.handleStartOutside = function() {
  9565. this.updateLabelVisibility()
  9566. }
  9567. ,
  9568. t.exports = n
  9569. }
  9570. , {
  9571. "../enum/DirectorEvents": 23,
  9572. "../enum/ModelManagerEvents": 33,
  9573. "../enum/PlayerEvents": 40,
  9574. "../enum/Viewmode": 51,
  9575. "../enum/WarpStyle": 52,
  9576. "../settings": 166,
  9577. "../util/browser": 182,
  9578. "../util/common": 185,
  9579. "../util/lerp": 188,
  9580. "../util/transitions": 195,
  9581. three: 217
  9582. }],
  9583. 92: [function(e, t, i) {
  9584. "use strict";
  9585. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9586. if (null == this)
  9587. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9588. if ("function" != typeof e)
  9589. throw new TypeError("predicate must be a function");
  9590. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9591. if (t = i[o],
  9592. e.call(r, t, o, i))
  9593. return o;
  9594. return -1
  9595. }
  9596. ),
  9597. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9598. value: function(e) {
  9599. if (null == this)
  9600. throw new TypeError('"this" is null or not defined');
  9601. var t = Object(this)
  9602. , i = t.length >>> 0;
  9603. if ("function" != typeof e)
  9604. throw new TypeError("predicate must be a function");
  9605. for (var n = arguments[1], r = 0; r < i; ) {
  9606. var o = t[r];
  9607. if (e.call(n, o, r, t))
  9608. return o;
  9609. r++
  9610. }
  9611. }
  9612. })
  9613. }
  9614. , {}],
  9615. 93: [function(e, t, i) {
  9616. "use strict";
  9617. var n = n || {};
  9618. t.exports = n,
  9619. n.gui = n.gui || {},
  9620. n.utils = n.utils || {},
  9621. n.controllers = n.controllers || {},
  9622. n.dom = n.dom || {},
  9623. n.color = n.color || {},
  9624. n.utils.css = function() {
  9625. return {
  9626. load: function(e, t) {
  9627. t = t || document;
  9628. var i = t.createElement("link");
  9629. i.type = "text/css",
  9630. i.rel = "stylesheet",
  9631. i.href = e,
  9632. t.getElementsByTagName("head")[0].appendChild(i)
  9633. },
  9634. inject: function(e, t) {
  9635. t = t || document;
  9636. var i = document.createElement("style");
  9637. i.type = "text/css",
  9638. i.innerHTML = e,
  9639. t.getElementsByTagName("head")[0].appendChild(i)
  9640. }
  9641. }
  9642. }(),
  9643. n.utils.common = function() {
  9644. var e = Array.prototype.forEach
  9645. , t = Array.prototype.slice;
  9646. return {
  9647. BREAK: {},
  9648. extend: function(e) {
  9649. return this.each(t.call(arguments, 1), function(t) {
  9650. for (var i in t)
  9651. this.isUndefined(t[i]) || (e[i] = t[i])
  9652. }, this),
  9653. e
  9654. },
  9655. defaults: function(e) {
  9656. return this.each(t.call(arguments, 1), function(t) {
  9657. for (var i in t)
  9658. this.isUndefined(e[i]) && (e[i] = t[i])
  9659. }, this),
  9660. e
  9661. },
  9662. compose: function() {
  9663. var e = t.call(arguments);
  9664. return function() {
  9665. for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--)
  9666. i = [e[n].apply(this, i)];
  9667. return i[0]
  9668. }
  9669. },
  9670. each: function(t, i, n) {
  9671. if (t)
  9672. if (e && t.forEach && t.forEach === e)
  9673. t.forEach(i, n);
  9674. else if (t.length === t.length + 0) {
  9675. for (var r = 0, o = t.length; r < o; r++)
  9676. if (r in t && i.call(n, t[r], r) === this.BREAK)
  9677. return
  9678. } else
  9679. for (var r in t)
  9680. if (i.call(n, t[r], r) === this.BREAK)
  9681. return
  9682. },
  9683. defer: function(e) {
  9684. setTimeout(e, 0)
  9685. },
  9686. toArray: function(e) {
  9687. return e.toArray ? e.toArray() : t.call(e)
  9688. },
  9689. isUndefined: function(e) {
  9690. return void 0 === e
  9691. },
  9692. isNull: function(e) {
  9693. return null === e
  9694. },
  9695. isNaN: function(e) {
  9696. return e !== e
  9697. },
  9698. isArray: Array.isArray || function(e) {
  9699. return e.constructor === Array
  9700. }
  9701. ,
  9702. isObject: function(e) {
  9703. return e === Object(e)
  9704. },
  9705. isNumber: function(e) {
  9706. return e === e + 0
  9707. },
  9708. isString: function(e) {
  9709. return e === e + ""
  9710. },
  9711. isBoolean: function(e) {
  9712. return e === !1 || e === !0
  9713. },
  9714. isFunction: function(e) {
  9715. return "[object Function]" === Object.prototype.toString.call(e)
  9716. }
  9717. }
  9718. }(),
  9719. n.controllers.Controller = function(e) {
  9720. var t = function(e, t) {
  9721. this.initialValue = e[t],
  9722. this.domElement = document.createElement("div"),
  9723. this.object = e,
  9724. this.property = t,
  9725. this.__onChange = void 0,
  9726. this.__onFinishChange = void 0
  9727. };
  9728. return e.extend(t.prototype, {
  9729. onChange: function(e) {
  9730. return this.__onChange = e,
  9731. this
  9732. },
  9733. onFinishChange: function(e) {
  9734. return this.__onFinishChange = e,
  9735. this
  9736. },
  9737. setValue: function(e) {
  9738. return this.object[this.property] = e,
  9739. this.__onChange && this.__onChange.call(this, e),
  9740. this.updateDisplay(),
  9741. this
  9742. },
  9743. getValue: function() {
  9744. return this.object[this.property]
  9745. },
  9746. updateDisplay: function() {
  9747. return this
  9748. },
  9749. isModified: function() {
  9750. return this.initialValue !== this.getValue()
  9751. }
  9752. }),
  9753. t
  9754. }(n.utils.common),
  9755. n.dom.dom = function(e) {
  9756. function t(t) {
  9757. if ("0" === t || e.isUndefined(t))
  9758. return 0;
  9759. var i = t.match(r);
  9760. return e.isNull(i) ? 0 : parseFloat(i[1])
  9761. }
  9762. var i = {
  9763. HTMLEvents: ["change"],
  9764. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9765. KeyboardEvents: ["keydown"]
  9766. }
  9767. , n = {};
  9768. e.each(i, function(t, i) {
  9769. e.each(t, function(e) {
  9770. n[e] = i
  9771. })
  9772. });
  9773. var r = /(\d+(\.\d+)?)px/
  9774. , o = {
  9775. makeSelectable: function(e, t) {
  9776. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9777. return !1
  9778. }
  9779. : function() {}
  9780. ,
  9781. e.style.MozUserSelect = t ? "auto" : "none",
  9782. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9783. e.unselectable = t ? "on" : "off")
  9784. },
  9785. makeFullscreen: function(t, i, n) {
  9786. e.isUndefined(i) && (i = !0),
  9787. e.isUndefined(n) && (n = !0),
  9788. t.style.position = "absolute",
  9789. i && (t.style.left = 0,
  9790. t.style.right = 0),
  9791. n && (t.style.top = 0,
  9792. t.style.bottom = 0)
  9793. },
  9794. fakeEvent: function(t, i, r, o) {
  9795. r = r || {};
  9796. var a = n[i];
  9797. if (!a)
  9798. throw new Error("Event type " + i + " not supported.");
  9799. var s = document.createEvent(a);
  9800. switch (a) {
  9801. case "MouseEvents":
  9802. var l = r.x || r.clientX || 0
  9803. , c = r.y || r.clientY || 0;
  9804. s.initMouseEvent(i, r.bubbles || !1, r.cancelable || !0, window, r.clickCount || 1, 0, 0, l, c, !1, !1, !1, !1, 0, null);
  9805. break;
  9806. case "KeyboardEvents":
  9807. var h = s.initKeyboardEvent || s.initKeyEvent;
  9808. e.defaults(r, {
  9809. cancelable: !0,
  9810. ctrlKey: !1,
  9811. altKey: !1,
  9812. shiftKey: !1,
  9813. metaKey: !1,
  9814. keyCode: void 0,
  9815. charCode: void 0
  9816. }),
  9817. h(i, r.bubbles || !1, r.cancelable, window, r.ctrlKey, r.altKey, r.shiftKey, r.metaKey, r.keyCode, r.charCode);
  9818. break;
  9819. default:
  9820. s.initEvent(i, r.bubbles || !1, r.cancelable || !0)
  9821. }
  9822. e.defaults(s, o),
  9823. t.dispatchEvent(s)
  9824. },
  9825. bind: function(e, t, i, n) {
  9826. return n = n || !1,
  9827. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9828. o
  9829. },
  9830. unbind: function(e, t, i, n) {
  9831. return n = n || !1,
  9832. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9833. o
  9834. },
  9835. addClass: function(e, t) {
  9836. if (void 0 === e.className)
  9837. e.className = t;
  9838. else if (e.className !== t) {
  9839. var i = e.className.split(/ +/);
  9840. i.indexOf(t) == -1 && (i.push(t),
  9841. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9842. }
  9843. return o
  9844. },
  9845. removeClass: function(e, t) {
  9846. if (t)
  9847. if (void 0 === e.className)
  9848. ;
  9849. else if (e.className === t)
  9850. e.removeAttribute("class");
  9851. else {
  9852. var i = e.className.split(/ +/)
  9853. , n = i.indexOf(t);
  9854. n != -1 && (i.splice(n, 1),
  9855. e.className = i.join(" "))
  9856. }
  9857. else
  9858. e.className = void 0;
  9859. return o
  9860. },
  9861. hasClass: function(e, t) {
  9862. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9863. },
  9864. getWidth: function(e) {
  9865. var i = getComputedStyle(e);
  9866. return t(i["border-left-width"]) + t(i["border-right-width"]) + t(i["padding-left"]) + t(i["padding-right"]) + t(i.width)
  9867. },
  9868. getHeight: function(e) {
  9869. var i = getComputedStyle(e);
  9870. return t(i["border-top-width"]) + t(i["border-bottom-width"]) + t(i["padding-top"]) + t(i["padding-bottom"]) + t(i.height)
  9871. },
  9872. getOffset: function(e) {
  9873. var t = {
  9874. left: 0,
  9875. top: 0
  9876. };
  9877. if (e.offsetParent)
  9878. do
  9879. t.left += e.offsetLeft,
  9880. t.top += e.offsetTop;
  9881. while (e = e.offsetParent);return t
  9882. },
  9883. isActive: function(e) {
  9884. return e === document.activeElement && (e.type || e.href)
  9885. }
  9886. };
  9887. return o
  9888. }(n.utils.common),
  9889. n.controllers.OptionController = function(e, t, i) {
  9890. var n = function(e, r, o) {
  9891. n.superclass.call(this, e, r);
  9892. var a = this;
  9893. if (this.__select = document.createElement("select"),
  9894. i.isArray(o)) {
  9895. var s = {};
  9896. i.each(o, function(e) {
  9897. s[e] = e
  9898. }),
  9899. o = s
  9900. }
  9901. i.each(o, function(e, t) {
  9902. var i = document.createElement("option");
  9903. i.innerHTML = t,
  9904. i.setAttribute("value", e),
  9905. a.__select.appendChild(i)
  9906. }),
  9907. this.updateDisplay(),
  9908. t.bind(this.__select, "change", function() {
  9909. var e = this.options[this.selectedIndex].value;
  9910. a.setValue(e)
  9911. }),
  9912. this.domElement.appendChild(this.__select)
  9913. };
  9914. return n.superclass = e,
  9915. i.extend(n.prototype, e.prototype, {
  9916. setValue: function(e) {
  9917. var t = n.superclass.prototype.setValue.call(this, e);
  9918. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9919. t
  9920. },
  9921. updateDisplay: function() {
  9922. return this.__select.value = this.getValue(),
  9923. n.superclass.prototype.updateDisplay.call(this)
  9924. }
  9925. }),
  9926. n
  9927. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  9928. n.controllers.NumberController = function(e, t) {
  9929. function i(e) {
  9930. return e = e.toString(),
  9931. e.indexOf(".") > -1 ? e.length - e.indexOf(".") - 1 : 0
  9932. }
  9933. var n = function(e, r, o) {
  9934. n.superclass.call(this, e, r),
  9935. o = o || {},
  9936. this.__min = o.min,
  9937. this.__max = o.max,
  9938. this.__step = o.step,
  9939. t.isUndefined(this.__step) ? 0 == this.initialValue ? this.__impliedStep = 1 : this.__impliedStep = Math.pow(10, Math.floor(Math.log(this.initialValue) / Math.LN10)) / 10 : this.__impliedStep = this.__step,
  9940. this.__precision = i(this.__impliedStep)
  9941. };
  9942. return n.superclass = e,
  9943. t.extend(n.prototype, e.prototype, {
  9944. setValue: function(e) {
  9945. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9946. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9947. n.superclass.prototype.setValue.call(this, e)
  9948. },
  9949. min: function(e) {
  9950. return this.__min = e,
  9951. this
  9952. },
  9953. max: function(e) {
  9954. return this.__max = e,
  9955. this
  9956. },
  9957. step: function(e) {
  9958. return this.__step = e,
  9959. this.__impliedStep = e,
  9960. this.__precision = i(e),
  9961. this
  9962. }
  9963. }),
  9964. n
  9965. }(n.controllers.Controller, n.utils.common),
  9966. n.controllers.NumberControllerBox = function(e, t, i) {
  9967. function n(e, t) {
  9968. var i = Math.pow(10, t);
  9969. return Math.round(e * i) / i
  9970. }
  9971. var r = function(e, n, o) {
  9972. function a() {
  9973. var e = parseFloat(d.__input.value);
  9974. i.isNaN(e) || d.setValue(e)
  9975. }
  9976. function s() {
  9977. a(),
  9978. d.__onFinishChange && d.__onFinishChange.call(d, d.getValue())
  9979. }
  9980. function l(e) {
  9981. t.bind(window, "mousemove", c),
  9982. t.bind(window, "mouseup", h),
  9983. u = e.clientY
  9984. }
  9985. function c(e) {
  9986. var t = u - e.clientY;
  9987. d.setValue(d.getValue() + t * d.__impliedStep),
  9988. u = e.clientY
  9989. }
  9990. function h() {
  9991. t.unbind(window, "mousemove", c),
  9992. t.unbind(window, "mouseup", h)
  9993. }
  9994. this.__truncationSuspended = !1,
  9995. r.superclass.call(this, e, n, o);
  9996. var u, d = this;
  9997. this.__input = document.createElement("input"),
  9998. this.__input.setAttribute("type", "text"),
  9999. t.bind(this.__input, "change", a),
  10000. t.bind(this.__input, "blur", s),
  10001. t.bind(this.__input, "mousedown", l),
  10002. t.bind(this.__input, "keydown", function(e) {
  10003. 13 === e.keyCode && (d.__truncationSuspended = !0,
  10004. this.blur(),
  10005. d.__truncationSuspended = !1)
  10006. }),
  10007. this.updateDisplay(),
  10008. this.domElement.appendChild(this.__input)
  10009. };
  10010. return r.superclass = e,
  10011. i.extend(r.prototype, e.prototype, {
  10012. updateDisplay: function() {
  10013. return this.__input.value = this.__truncationSuspended ? this.getValue() : n(this.getValue(), this.__precision),
  10014. r.superclass.prototype.updateDisplay.call(this)
  10015. }
  10016. }),
  10017. r
  10018. }(n.controllers.NumberController, n.dom.dom, n.utils.common),
  10019. n.controllers.NumberControllerSlider = function(e, t, i, n, r) {
  10020. function o(e, t, i, n, r) {
  10021. return n + (r - n) * ((e - t) / (i - t))
  10022. }
  10023. var a = function(e, i, n, r, s) {
  10024. function l(e) {
  10025. t.bind(window, "mousemove", c),
  10026. t.bind(window, "mouseup", h),
  10027. c(e)
  10028. }
  10029. function c(e) {
  10030. e.preventDefault();
  10031. var i = t.getOffset(u.__background)
  10032. , n = t.getWidth(u.__background);
  10033. return u.setValue(o(e.clientX, i.left, i.left + n, u.__min, u.__max)),
  10034. !1
  10035. }
  10036. function h() {
  10037. t.unbind(window, "mousemove", c),
  10038. t.unbind(window, "mouseup", h),
  10039. u.__onFinishChange && u.__onFinishChange.call(u, u.getValue())
  10040. }
  10041. a.superclass.call(this, e, i, {
  10042. min: n,
  10043. max: r,
  10044. step: s
  10045. });
  10046. var u = this;
  10047. this.__background = document.createElement("div"),
  10048. this.__foreground = document.createElement("div"),
  10049. t.bind(this.__background, "mousedown", l),
  10050. t.addClass(this.__background, "slider"),
  10051. t.addClass(this.__foreground, "slider-fg"),
  10052. this.updateDisplay(),
  10053. this.__background.appendChild(this.__foreground),
  10054. this.domElement.appendChild(this.__background)
  10055. };
  10056. return a.superclass = e,
  10057. a.useDefaultStyles = function() {
  10058. i.inject(r)
  10059. }
  10060. ,
  10061. n.extend(a.prototype, e.prototype, {
  10062. updateDisplay: function() {
  10063. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  10064. return this.__foreground.style.width = 100 * e + "%",
  10065. a.superclass.prototype.updateDisplay.call(this)
  10066. }
  10067. }),
  10068. a
  10069. }(n.controllers.NumberController, n.dom.dom, n.utils.css, n.utils.common, "/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\n.slider {\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\n height: 1em;\n border-radius: 1em;\n background-color: #eee;\n padding: 0 0.5em;\n overflow: hidden;\n}\n\n.slider-fg {\n padding: 1px 0 2px 0;\n background-color: #aaa;\n height: 1em;\n margin-left: -0.5em;\n padding-right: 0.5em;\n border-radius: 1em 0 0 1em;\n}\n\n.slider-fg:after {\n display: inline-block;\n border-radius: 1em;\n background-color: #fff;\n border: 1px solid #aaa;\n content: '';\n float: right;\n margin-right: -1em;\n margin-top: -1px;\n height: 0.9em;\n width: 0.9em;\n}"),
  10070. n.controllers.FunctionController = function(e, t, i) {
  10071. var n = function(e, i, r) {
  10072. n.superclass.call(this, e, i);
  10073. var o = this;
  10074. this.__button = document.createElement("div"),
  10075. this.__button.innerHTML = void 0 === r ? "Fire" : r,
  10076. t.bind(this.__button, "click", function(e) {
  10077. return e.preventDefault(),
  10078. o.fire(),
  10079. !1
  10080. }),
  10081. t.addClass(this.__button, "button"),
  10082. this.domElement.appendChild(this.__button)
  10083. };
  10084. return n.superclass = e,
  10085. i.extend(n.prototype, e.prototype, {
  10086. fire: function() {
  10087. this.__onChange && this.__onChange.call(this),
  10088. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10089. this.getValue().call(this.object)
  10090. }
  10091. }),
  10092. n
  10093. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10094. n.controllers.BooleanController = function(e, t, i) {
  10095. var n = function(e, i) {
  10096. function r() {
  10097. o.setValue(!o.__prev)
  10098. }
  10099. n.superclass.call(this, e, i);
  10100. var o = this;
  10101. this.__prev = this.getValue(),
  10102. this.__checkbox = document.createElement("input"),
  10103. this.__checkbox.setAttribute("type", "checkbox"),
  10104. t.bind(this.__checkbox, "change", r, !1),
  10105. this.domElement.appendChild(this.__checkbox),
  10106. this.updateDisplay()
  10107. };
  10108. return n.superclass = e,
  10109. i.extend(n.prototype, e.prototype, {
  10110. setValue: function(e) {
  10111. var t = n.superclass.prototype.setValue.call(this, e);
  10112. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10113. this.__prev = this.getValue(),
  10114. t
  10115. },
  10116. updateDisplay: function() {
  10117. return this.getValue() === !0 ? (this.__checkbox.setAttribute("checked", "checked"),
  10118. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  10119. n.superclass.prototype.updateDisplay.call(this)
  10120. }
  10121. }),
  10122. n
  10123. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10124. n.color.toString = function(e) {
  10125. return function(t) {
  10126. if (1 == t.a || e.isUndefined(t.a)) {
  10127. for (var i = t.hex.toString(16); i.length < 6; )
  10128. i = "0" + i;
  10129. return "#" + i
  10130. }
  10131. return "rgba(" + Math.round(t.r) + "," + Math.round(t.g) + "," + Math.round(t.b) + "," + t.a + ")"
  10132. }
  10133. }(n.utils.common),
  10134. n.color.interpret = function(e, t) {
  10135. var i, n, r = function() {
  10136. n = !1;
  10137. var e = arguments.length > 1 ? t.toArray(arguments) : arguments[0];
  10138. return t.each(o, function(r) {
  10139. if (r.litmus(e))
  10140. return t.each(r.conversions, function(r, o) {
  10141. if (i = r.read(e),
  10142. n === !1 && i !== !1)
  10143. return n = i,
  10144. i.conversionName = o,
  10145. i.conversion = r,
  10146. t.BREAK
  10147. }),
  10148. t.BREAK
  10149. }),
  10150. n
  10151. }, o = [{
  10152. litmus: t.isString,
  10153. conversions: {
  10154. THREE_CHAR_HEX: {
  10155. read: function(e) {
  10156. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10157. return null !== t && {
  10158. space: "HEX",
  10159. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10160. }
  10161. },
  10162. write: e
  10163. },
  10164. SIX_CHAR_HEX: {
  10165. read: function(e) {
  10166. var t = e.match(/^#([A-F0-9]{6})$/i);
  10167. return null !== t && {
  10168. space: "HEX",
  10169. hex: parseInt("0x" + t[1].toString())
  10170. }
  10171. },
  10172. write: e
  10173. },
  10174. CSS_RGB: {
  10175. read: function(e) {
  10176. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10177. return null !== t && {
  10178. space: "RGB",
  10179. r: parseFloat(t[1]),
  10180. g: parseFloat(t[2]),
  10181. b: parseFloat(t[3])
  10182. }
  10183. },
  10184. write: e
  10185. },
  10186. CSS_RGBA: {
  10187. read: function(e) {
  10188. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10189. return null !== t && {
  10190. space: "RGB",
  10191. r: parseFloat(t[1]),
  10192. g: parseFloat(t[2]),
  10193. b: parseFloat(t[3]),
  10194. a: parseFloat(t[4])
  10195. }
  10196. },
  10197. write: e
  10198. }
  10199. }
  10200. }, {
  10201. litmus: t.isNumber,
  10202. conversions: {
  10203. HEX: {
  10204. read: function(e) {
  10205. return {
  10206. space: "HEX",
  10207. hex: e,
  10208. conversionName: "HEX"
  10209. }
  10210. },
  10211. write: function(e) {
  10212. return e.hex
  10213. }
  10214. }
  10215. }
  10216. }, {
  10217. litmus: t.isArray,
  10218. conversions: {
  10219. RGB_ARRAY: {
  10220. read: function(e) {
  10221. return 3 == e.length && {
  10222. space: "RGB",
  10223. r: e[0],
  10224. g: e[1],
  10225. b: e[2]
  10226. }
  10227. },
  10228. write: function(e) {
  10229. return [e.r, e.g, e.b]
  10230. }
  10231. },
  10232. RGBA_ARRAY: {
  10233. read: function(e) {
  10234. return 4 == e.length && {
  10235. space: "RGB",
  10236. r: e[0],
  10237. g: e[1],
  10238. b: e[2],
  10239. a: e[3]
  10240. }
  10241. },
  10242. write: function(e) {
  10243. return [e.r, e.g, e.b, e.a]
  10244. }
  10245. }
  10246. }
  10247. }, {
  10248. litmus: t.isObject,
  10249. conversions: {
  10250. RGBA_OBJ: {
  10251. read: function(e) {
  10252. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b) && t.isNumber(e.a)) && {
  10253. space: "RGB",
  10254. r: e.r,
  10255. g: e.g,
  10256. b: e.b,
  10257. a: e.a
  10258. }
  10259. },
  10260. write: function(e) {
  10261. return {
  10262. r: e.r,
  10263. g: e.g,
  10264. b: e.b,
  10265. a: e.a
  10266. }
  10267. }
  10268. },
  10269. RGB_OBJ: {
  10270. read: function(e) {
  10271. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b)) && {
  10272. space: "RGB",
  10273. r: e.r,
  10274. g: e.g,
  10275. b: e.b
  10276. }
  10277. },
  10278. write: function(e) {
  10279. return {
  10280. r: e.r,
  10281. g: e.g,
  10282. b: e.b
  10283. }
  10284. }
  10285. },
  10286. HSVA_OBJ: {
  10287. read: function(e) {
  10288. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v) && t.isNumber(e.a)) && {
  10289. space: "HSV",
  10290. h: e.h,
  10291. s: e.s,
  10292. v: e.v,
  10293. a: e.a
  10294. }
  10295. },
  10296. write: function(e) {
  10297. return {
  10298. h: e.h,
  10299. s: e.s,
  10300. v: e.v,
  10301. a: e.a
  10302. }
  10303. }
  10304. },
  10305. HSV_OBJ: {
  10306. read: function(e) {
  10307. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v)) && {
  10308. space: "HSV",
  10309. h: e.h,
  10310. s: e.s,
  10311. v: e.v
  10312. }
  10313. },
  10314. write: function(e) {
  10315. return {
  10316. h: e.h,
  10317. s: e.s,
  10318. v: e.v
  10319. }
  10320. }
  10321. }
  10322. }
  10323. }];
  10324. return r
  10325. }(n.color.toString, n.utils.common),
  10326. n.GUI = n.gui.GUI = function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
  10327. function g(e, t, i, o) {
  10328. if (void 0 === t[i])
  10329. throw new Error("Object " + t + ' has no property "' + i + '"');
  10330. var a;
  10331. if (o.color)
  10332. a = new h(t,i);
  10333. else {
  10334. var s = [t, i].concat(o.factoryArgs);
  10335. a = n.apply(e, s)
  10336. }
  10337. o.before instanceof r && (o.before = o.before.__li),
  10338. A(e, a),
  10339. p.addClass(a.domElement, "c");
  10340. var l = document.createElement("span");
  10341. p.addClass(l, "property-name"),
  10342. l.innerHTML = a.property;
  10343. var c = document.createElement("div");
  10344. c.appendChild(l),
  10345. c.appendChild(a.domElement);
  10346. var u = m(e, c, o.before);
  10347. return p.addClass(u, V.CLASS_CONTROLLER_ROW),
  10348. p.addClass(u, typeof a.getValue()),
  10349. v(e, u, a),
  10350. e.__controllers.push(a),
  10351. a
  10352. }
  10353. function m(e, t, i) {
  10354. var n = document.createElement("li");
  10355. return t && n.appendChild(t),
  10356. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10357. e.onResize(),
  10358. n
  10359. }
  10360. function v(e, t, i) {
  10361. if (i.__li = t,
  10362. i.__gui = e,
  10363. f.extend(i, {
  10364. options: function(t) {
  10365. return arguments.length > 1 ? (i.remove(),
  10366. g(e, i.object, i.property, {
  10367. before: i.__li.nextElementSibling,
  10368. factoryArgs: [f.toArray(arguments)]
  10369. })) : f.isArray(t) || f.isObject(t) ? (i.remove(),
  10370. g(e, i.object, i.property, {
  10371. before: i.__li.nextElementSibling,
  10372. factoryArgs: [t]
  10373. })) : void 0
  10374. },
  10375. name: function(e) {
  10376. return i.__li.firstElementChild.firstElementChild.innerHTML = e,
  10377. i
  10378. },
  10379. listen: function() {
  10380. return i.__gui.listen(i),
  10381. i
  10382. },
  10383. remove: function() {
  10384. return i.__gui.remove(i),
  10385. i
  10386. }
  10387. }),
  10388. i instanceof l) {
  10389. var n = new s(i.object,i.property,{
  10390. min: i.__min,
  10391. max: i.__max,
  10392. step: i.__step
  10393. });
  10394. f.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10395. var t = i[e]
  10396. , r = n[e];
  10397. i[e] = n[e] = function() {
  10398. var e = Array.prototype.slice.call(arguments);
  10399. return t.apply(i, e),
  10400. r.apply(n, e)
  10401. }
  10402. }),
  10403. p.addClass(t, "has-slider"),
  10404. i.domElement.insertBefore(n.domElement, i.domElement.firstElementChild)
  10405. } else if (i instanceof s) {
  10406. var r = function(t) {
  10407. return f.isNumber(i.__min) && f.isNumber(i.__max) ? (i.remove(),
  10408. g(e, i.object, i.property, {
  10409. before: i.__li.nextElementSibling,
  10410. factoryArgs: [i.__min, i.__max, i.__step]
  10411. })) : t
  10412. };
  10413. i.min = f.compose(r, i.min),
  10414. i.max = f.compose(r, i.max)
  10415. } else
  10416. i instanceof o ? (p.bind(t, "click", function() {
  10417. p.fakeEvent(i.__checkbox, "click")
  10418. }),
  10419. p.bind(i.__checkbox, "click", function(e) {
  10420. e.stopPropagation()
  10421. })) : i instanceof a ? (p.bind(t, "click", function() {
  10422. p.fakeEvent(i.__button, "click")
  10423. }),
  10424. p.bind(t, "mouseover", function() {
  10425. p.addClass(i.__button, "hover")
  10426. }),
  10427. p.bind(t, "mouseout", function() {
  10428. p.removeClass(i.__button, "hover")
  10429. })) : i instanceof h && (p.addClass(t, "color"),
  10430. i.updateDisplay = f.compose(function(e) {
  10431. return t.style.borderLeftColor = i.__color.toString(),
  10432. e
  10433. }, i.updateDisplay),
  10434. i.updateDisplay());
  10435. i.setValue = f.compose(function(t) {
  10436. return e.getRoot().__preset_select && i.isModified() && T(e.getRoot(), !0),
  10437. t
  10438. }, i.setValue)
  10439. }
  10440. function A(e, t) {
  10441. var i = e.getRoot()
  10442. , n = i.__rememberedObjects.indexOf(t.object);
  10443. if (n != -1) {
  10444. var r = i.__rememberedObjectIndecesToControllers[n];
  10445. if (void 0 === r && (r = {},
  10446. i.__rememberedObjectIndecesToControllers[n] = r),
  10447. r[t.property] = t,
  10448. i.load && i.load.remembered) {
  10449. var o, a = i.load.remembered;
  10450. if (a[e.preset])
  10451. o = a[e.preset];
  10452. else {
  10453. if (!a[L])
  10454. return;
  10455. o = a[L]
  10456. }
  10457. if (o[n] && void 0 !== o[n][t.property]) {
  10458. var s = o[n][t.property];
  10459. t.initialValue = s,
  10460. t.setValue(s)
  10461. }
  10462. }
  10463. }
  10464. }
  10465. function y(e, t) {
  10466. return document.location.href + "." + t
  10467. }
  10468. function C(e) {
  10469. var t = e.__save_row = document.createElement("li");
  10470. p.addClass(e.domElement, "has-save"),
  10471. e.__ul.insertBefore(t, e.__ul.firstChild),
  10472. p.addClass(t, "save-row");
  10473. var i = document.createElement("span");
  10474. i.innerHTML = "&nbsp;",
  10475. p.addClass(i, "button gears");
  10476. var n = document.createElement("span");
  10477. n.innerHTML = "Save",
  10478. p.addClass(n, "button"),
  10479. p.addClass(n, "save");
  10480. var r = document.createElement("span");
  10481. r.innerHTML = "New",
  10482. p.addClass(r, "button"),
  10483. p.addClass(r, "save-as");
  10484. var o = document.createElement("span");
  10485. o.innerHTML = "Revert",
  10486. p.addClass(o, "button"),
  10487. p.addClass(o, "revert");
  10488. var a = e.__preset_select = document.createElement("select");
  10489. if (e.load && e.load.remembered ? f.each(e.load.remembered, function(t, i) {
  10490. w(e, i, i == e.preset)
  10491. }) : w(e, L, !1),
  10492. p.bind(a, "change", function() {
  10493. for (var t = 0; t < e.__preset_select.length; t++)
  10494. e.__preset_select[t].innerHTML = e.__preset_select[t].value;
  10495. e.preset = this.value
  10496. }),
  10497. t.appendChild(a),
  10498. t.appendChild(i),
  10499. t.appendChild(n),
  10500. t.appendChild(r),
  10501. t.appendChild(o),
  10502. D) {
  10503. var s = document.getElementById("dg-save-locally")
  10504. , l = document.getElementById("dg-local-explain");
  10505. s.style.display = "block";
  10506. var c = document.getElementById("dg-local-storage");
  10507. "true" === localStorage.getItem(y(e, "isLocal")) && c.setAttribute("checked", "checked");
  10508. var h = function() {
  10509. l.style.display = e.useLocalStorage ? "block" : "none"
  10510. };
  10511. h(),
  10512. p.bind(c, "change", function() {
  10513. e.useLocalStorage = !e.useLocalStorage,
  10514. h()
  10515. })
  10516. }
  10517. var u = document.getElementById("dg-new-constructor");
  10518. p.bind(u, "keydown", function(e) {
  10519. !e.metaKey || 67 !== e.which && 67 != e.keyCode || S.hide()
  10520. }),
  10521. p.bind(i, "click", function() {
  10522. u.innerHTML = JSON.stringify(e.getSaveObject(), void 0, 2),
  10523. S.show(),
  10524. u.focus(),
  10525. u.select()
  10526. }),
  10527. p.bind(n, "click", function() {
  10528. e.save()
  10529. }),
  10530. p.bind(r, "click", function() {
  10531. var t = prompt("Enter a new preset name.");
  10532. t && e.saveAs(t)
  10533. }),
  10534. p.bind(o, "click", function() {
  10535. e.revert()
  10536. })
  10537. }
  10538. function I(e) {
  10539. function t(t) {
  10540. return t.preventDefault(),
  10541. r = t.clientX,
  10542. p.addClass(e.__closeButton, V.CLASS_DRAG),
  10543. p.bind(window, "mousemove", i),
  10544. p.bind(window, "mouseup", n),
  10545. !1
  10546. }
  10547. function i(t) {
  10548. return t.preventDefault(),
  10549. e.width += r - t.clientX,
  10550. e.onResize(),
  10551. r = t.clientX,
  10552. !1
  10553. }
  10554. function n() {
  10555. p.removeClass(e.__closeButton, V.CLASS_DRAG),
  10556. p.unbind(window, "mousemove", i),
  10557. p.unbind(window, "mouseup", n)
  10558. }
  10559. e.__resize_handle = document.createElement("div"),
  10560. f.extend(e.__resize_handle.style, {
  10561. width: "6px",
  10562. marginLeft: "-3px",
  10563. height: "200px",
  10564. cursor: "ew-resize",
  10565. position: "absolute"
  10566. });
  10567. var r;
  10568. p.bind(e.__resize_handle, "mousedown", t),
  10569. p.bind(e.__closeButton, "mousedown", t),
  10570. e.domElement.insertBefore(e.__resize_handle, e.domElement.firstElementChild)
  10571. }
  10572. function E(e, t) {
  10573. e.domElement.style.width = t + "px",
  10574. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10575. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10576. }
  10577. function b(e, t) {
  10578. var i = {};
  10579. return f.each(e.__rememberedObjects, function(n, r) {
  10580. var o = {}
  10581. , a = e.__rememberedObjectIndecesToControllers[r];
  10582. f.each(a, function(e, i) {
  10583. o[i] = t ? e.initialValue : e.getValue()
  10584. }),
  10585. i[r] = o
  10586. }),
  10587. i
  10588. }
  10589. function w(e, t, i) {
  10590. var n = document.createElement("option");
  10591. n.innerHTML = t,
  10592. n.value = t,
  10593. e.__preset_select.appendChild(n),
  10594. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10595. }
  10596. function _(e) {
  10597. for (var t = 0; t < e.__preset_select.length; t++)
  10598. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10599. }
  10600. function T(e, t) {
  10601. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10602. t ? i.innerHTML = i.value + "*" : i.innerHTML = i.value
  10603. }
  10604. function x(e) {
  10605. 0 != e.length && u(function() {
  10606. x(e)
  10607. }),
  10608. f.each(e, function(e) {
  10609. e.updateDisplay()
  10610. })
  10611. }
  10612. e.inject(i);
  10613. var S, M, R = "dg", P = 72, O = 20, L = "Default", D = function() {
  10614. try {
  10615. return "localStorage"in window && null !== window.localStorage
  10616. } catch (e) {
  10617. return !1
  10618. }
  10619. }(), N = !0, B = !1, F = [], V = function(e) {
  10620. function t() {
  10621. var e = i.getRoot();
  10622. e.width += 1,
  10623. f.defer(function() {
  10624. e.width -= 1
  10625. })
  10626. }
  10627. var i = this;
  10628. this.domElement = document.createElement("div"),
  10629. this.__ul = document.createElement("ul"),
  10630. this.domElement.appendChild(this.__ul),
  10631. p.addClass(this.domElement, R),
  10632. this.__folders = {},
  10633. this.__controllers = [],
  10634. this.__rememberedObjects = [],
  10635. this.__rememberedObjectIndecesToControllers = [],
  10636. this.__listening = [],
  10637. e = e || {},
  10638. e = f.defaults(e, {
  10639. autoPlace: !0,
  10640. width: V.DEFAULT_WIDTH
  10641. }),
  10642. e = f.defaults(e, {
  10643. resizable: e.autoPlace,
  10644. hideable: e.autoPlace
  10645. }),
  10646. f.isUndefined(e.load) ? e.load = {
  10647. preset: L
  10648. } : e.preset && (e.load.preset = e.preset),
  10649. f.isUndefined(e.parent) && e.hideable && F.push(this),
  10650. e.resizable = f.isUndefined(e.parent) && e.resizable,
  10651. e.autoPlace && f.isUndefined(e.scrollable) && (e.scrollable = !0);
  10652. var n, r = D && "true" === localStorage.getItem(y(this, "isLocal"));
  10653. if (Object.defineProperties(this, {
  10654. parent: {
  10655. get: function() {
  10656. return e.parent
  10657. }
  10658. },
  10659. scrollable: {
  10660. get: function() {
  10661. return e.scrollable
  10662. }
  10663. },
  10664. autoPlace: {
  10665. get: function() {
  10666. return e.autoPlace
  10667. }
  10668. },
  10669. preset: {
  10670. get: function() {
  10671. return i.parent ? i.getRoot().preset : e.load.preset
  10672. },
  10673. set: function(t) {
  10674. i.parent ? i.getRoot().preset = t : e.load.preset = t,
  10675. _(this),
  10676. i.revert()
  10677. }
  10678. },
  10679. width: {
  10680. get: function() {
  10681. return e.width
  10682. },
  10683. set: function(t) {
  10684. e.width = t,
  10685. E(i, t)
  10686. }
  10687. },
  10688. name: {
  10689. get: function() {
  10690. return e.name
  10691. },
  10692. set: function(t) {
  10693. e.name = t,
  10694. a && (a.innerHTML = e.name)
  10695. }
  10696. },
  10697. closed: {
  10698. get: function() {
  10699. return e.closed
  10700. },
  10701. set: function(t) {
  10702. e.closed = t,
  10703. e.closed ? p.addClass(i.__ul, V.CLASS_CLOSED) : p.removeClass(i.__ul, V.CLASS_CLOSED),
  10704. this.onResize(),
  10705. i.__closeButton && (i.__closeButton.innerHTML = t ? V.TEXT_OPEN : V.TEXT_CLOSED)
  10706. }
  10707. },
  10708. load: {
  10709. get: function() {
  10710. return e.load
  10711. }
  10712. },
  10713. useLocalStorage: {
  10714. get: function() {
  10715. return r
  10716. },
  10717. set: function(e) {
  10718. D && (r = e,
  10719. e ? p.bind(window, "unload", n) : p.unbind(window, "unload", n),
  10720. localStorage.setItem(y(i, "isLocal"), e))
  10721. }
  10722. }
  10723. }),
  10724. f.isUndefined(e.parent)) {
  10725. if (e.closed = !1,
  10726. p.addClass(this.domElement, V.CLASS_MAIN),
  10727. p.makeSelectable(this.domElement, !1),
  10728. D && r) {
  10729. i.useLocalStorage = !0;
  10730. var o = localStorage.getItem(y(this, "gui"));
  10731. o && (e.load = JSON.parse(o))
  10732. }
  10733. this.__closeButton = document.createElement("div"),
  10734. this.__closeButton.innerHTML = V.TEXT_CLOSED,
  10735. p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
  10736. this.domElement.appendChild(this.__closeButton),
  10737. p.bind(this.__closeButton, "click", function() {
  10738. i.closed = !i.closed
  10739. })
  10740. } else {
  10741. void 0 === e.closed && (e.closed = !0);
  10742. var a = document.createTextNode(e.name);
  10743. p.addClass(a, "controller-name");
  10744. var s = m(i, a)
  10745. , l = function(e) {
  10746. return e.preventDefault(),
  10747. i.closed = !i.closed,
  10748. !1
  10749. };
  10750. p.addClass(this.__ul, V.CLASS_CLOSED),
  10751. p.addClass(s, "title"),
  10752. p.bind(s, "click", l),
  10753. e.closed || (this.closed = !1)
  10754. }
  10755. e.autoPlace && (f.isUndefined(e.parent) && (N && (M = document.createElement("div"),
  10756. p.addClass(M, R),
  10757. p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER),
  10758. document.body.appendChild(M),
  10759. N = !1),
  10760. M.appendChild(this.domElement),
  10761. p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
  10762. this.parent || E(i, e.width)),
  10763. p.bind(window, "resize", function() {
  10764. i.onResize()
  10765. }),
  10766. p.bind(this.__ul, "webkitTransitionEnd", function() {
  10767. i.onResize()
  10768. }),
  10769. p.bind(this.__ul, "transitionend", function() {
  10770. i.onResize()
  10771. }),
  10772. p.bind(this.__ul, "oTransitionEnd", function() {
  10773. i.onResize()
  10774. }),
  10775. this.onResize(),
  10776. e.resizable && I(this),
  10777. n = function() {
  10778. D && "true" === localStorage.getItem(y(i, "isLocal")) && localStorage.setItem(y(i, "gui"), JSON.stringify(i.getSaveObject()))
  10779. }
  10780. ,
  10781. this.saveToLocalStorageIfPossible = n;
  10782. i.getRoot();
  10783. e.parent || t()
  10784. };
  10785. return V.toggleHide = function() {
  10786. B = !B,
  10787. f.each(F, function(e) {
  10788. e.domElement.style.zIndex = B ? -999 : 999,
  10789. e.domElement.style.opacity = B ? 0 : 1
  10790. })
  10791. }
  10792. ,
  10793. V.CLASS_AUTO_PLACE = "a",
  10794. V.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10795. V.CLASS_MAIN = "main",
  10796. V.CLASS_CONTROLLER_ROW = "cr",
  10797. V.CLASS_TOO_TALL = "taller-than-window",
  10798. V.CLASS_CLOSED = "closed",
  10799. V.CLASS_CLOSE_BUTTON = "close-button",
  10800. V.CLASS_DRAG = "drag",
  10801. V.DEFAULT_WIDTH = 245,
  10802. V.TEXT_CLOSED = "Close Controls",
  10803. V.TEXT_OPEN = "Open Controls",
  10804. p.bind(window, "keydown", function(e) {
  10805. "text" === document.activeElement.type || e.which !== P && e.keyCode != P || V.toggleHide()
  10806. }, !1),
  10807. f.extend(V.prototype, {
  10808. add: function(e, t) {
  10809. return g(this, e, t, {
  10810. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10811. })
  10812. },
  10813. addColor: function(e, t) {
  10814. return g(this, e, t, {
  10815. color: !0
  10816. })
  10817. },
  10818. remove: function(e) {
  10819. this.__ul.removeChild(e.__li),
  10820. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10821. var t = this;
  10822. f.defer(function() {
  10823. t.onResize()
  10824. })
  10825. },
  10826. destroy: function() {
  10827. this.autoPlace && M.removeChild(this.domElement)
  10828. },
  10829. addFolder: function(e) {
  10830. if (void 0 !== this.__folders[e])
  10831. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10832. var t = {
  10833. name: e,
  10834. parent: this
  10835. };
  10836. t.autoPlace = this.autoPlace,
  10837. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10838. t.load = this.load.folders[e]);
  10839. var i = new V(t);
  10840. this.__folders[e] = i;
  10841. var n = m(this, i.domElement);
  10842. return p.addClass(n, "folder"),
  10843. i
  10844. },
  10845. open: function() {
  10846. this.closed = !1
  10847. },
  10848. close: function() {
  10849. this.closed = !0
  10850. },
  10851. onResize: function() {
  10852. var e = this.getRoot();
  10853. if (e.scrollable) {
  10854. var t = p.getOffset(e.__ul).top
  10855. , i = 0;
  10856. f.each(e.__ul.childNodes, function(t) {
  10857. e.autoPlace && t === e.__save_row || (i += p.getHeight(t))
  10858. }),
  10859. $("#player").height() - t - O < i ? (p.addClass(e.domElement, V.CLASS_TOO_TALL),
  10860. e.__ul.style.height = $("#player").height() - t - O + "px") : (p.removeClass(e.domElement, V.CLASS_TOO_TALL),
  10861. e.__ul.style.height = "auto")
  10862. }
  10863. e.__resize_handle && f.defer(function() {
  10864. e.__resize_handle.style.height = e.__ul.offsetHeight + "px"
  10865. }),
  10866. e.__closeButton && (e.__closeButton.style.width = e.width + "px")
  10867. },
  10868. remember: function() {
  10869. if (f.isUndefined(S) && (S = new d,
  10870. S.domElement.innerHTML = t),
  10871. this.parent)
  10872. throw new Error("You can only call remember on a top level GUI.");
  10873. var e = this;
  10874. f.each(Array.prototype.slice.call(arguments), function(t) {
  10875. 0 == e.__rememberedObjects.length && C(e),
  10876. e.__rememberedObjects.indexOf(t) == -1 && e.__rememberedObjects.push(t)
  10877. }),
  10878. this.autoPlace && E(this, this.width)
  10879. },
  10880. getRoot: function() {
  10881. for (var e = this; e.parent; )
  10882. e = e.parent;
  10883. return e
  10884. },
  10885. getSaveObject: function() {
  10886. var e = this.load;
  10887. return e.closed = this.closed,
  10888. this.__rememberedObjects.length > 0 && (e.preset = this.preset,
  10889. e.remembered || (e.remembered = {}),
  10890. e.remembered[this.preset] = b(this)),
  10891. e.folders = {},
  10892. f.each(this.__folders, function(t, i) {
  10893. e.folders[i] = t.getSaveObject()
  10894. }),
  10895. e
  10896. },
  10897. save: function() {
  10898. this.load.remembered || (this.load.remembered = {}),
  10899. this.load.remembered[this.preset] = b(this),
  10900. T(this, !1),
  10901. this.saveToLocalStorageIfPossible()
  10902. },
  10903. saveAs: function(e) {
  10904. this.load.remembered || (this.load.remembered = {},
  10905. this.load.remembered[L] = b(this, !0)),
  10906. this.load.remembered[e] = b(this),
  10907. this.preset = e,
  10908. w(this, e, !0),
  10909. this.saveToLocalStorageIfPossible()
  10910. },
  10911. revert: function(e) {
  10912. f.each(this.__controllers, function(t) {
  10913. this.getRoot().load.remembered ? A(e || this.getRoot(), t) : t.setValue(t.initialValue)
  10914. }, this),
  10915. f.each(this.__folders, function(e) {
  10916. e.revert(e)
  10917. }),
  10918. e || T(this.getRoot(), !1)
  10919. },
  10920. listen: function(e) {
  10921. var t = 0 == this.__listening.length;
  10922. this.__listening.push(e),
  10923. t && x(this.__listening)
  10924. }
  10925. }),
  10926. V
  10927. }(n.utils.css, '<div id="dg-save" class="dg dialogue">\n\n Here\'s the new load parameter for your <code>GUI</code>\'s constructor:\n\n <textarea id="dg-new-constructor"></textarea>\n\n <div id="dg-save-locally">\n\n <input id="dg-local-storage" type="checkbox"/> Automatically save\n values to <code>localStorage</code> on exit.\n\n <div id="dg-local-explain">The values saved to <code>localStorage</code> will\n override those passed to <code>dat.GUI</code>\'s constructor. This makes it\n easier to work incrementally, but <code>localStorage</code> is fragile,\n and your friends may not see the same values you do.\n \n </div>\n \n </div>\n\n</div>', ".dg {\n /** Clear list styles */\n /* Auto-place container */\n /* Auto-placed GUI's */\n /* Line items that don't contain folders. */\n /** Folder names */\n /** Hides closed items */\n /** Controller row */\n /** Name-half (left) */\n /** Controller-half (right) */\n /** Controller placement */\n /** Shorter number boxes when slider is present. */\n /** Ensure the entire boolean and function row shows a hand */ }\n .dg ul {\n list-style: none;\n margin: 0;\n padding: 0;\n width: 100%;\n clear: both; }\n .dg.ac {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 0;\n z-index: 0; }\n .dg:not(.ac) .main {\n /** Exclude mains in ac so that we don't hide close button */\n overflow: hidden; }\n .dg.main {\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear; }\n .dg.main.taller-than-window {\n overflow-y: auto; }\n .dg.main.taller-than-window .close-button {\n opacity: 1;\n /* TODO, these are style notes */\n margin-top: -1px;\n border-top: 1px solid #2c2c2c; }\n .dg.main ul.closed .close-button {\n opacity: 1 !important; }\n .dg.main:hover .close-button,\n .dg.main .close-button.drag {\n opacity: 1; }\n .dg.main .close-button {\n /*opacity: 0;*/\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear;\n border: 0;\n position: absolute;\n line-height: 19px;\n height: 20px;\n /* TODO, these are style notes */\n cursor: pointer;\n text-align: center;\n background-color: #000; }\n .dg.main .close-button:hover {\n background-color: #111; }\n .dg.a {\n float: right;\n margin-right: 15px;\n overflow-x: hidden; }\n .dg.a.has-save > ul {\n margin-top: 27px; }\n .dg.a.has-save > ul.closed {\n margin-top: 0; }\n .dg.a .save-row {\n position: fixed;\n top: 0;\n z-index: 1002; }\n .dg li {\n -webkit-transition: height 0.1s ease-out;\n -o-transition: height 0.1s ease-out;\n -moz-transition: height 0.1s ease-out;\n transition: height 0.1s ease-out; }\n .dg li:not(.folder) {\n cursor: auto;\n height: 27px;\n line-height: 27px;\n overflow: hidden;\n padding: 0 4px 0 5px; }\n .dg li.folder {\n padding: 0;\n border-left: 4px solid rgba(0, 0, 0, 0); }\n .dg li.title {\n cursor: pointer;\n margin-left: -4px; }\n .dg .closed li:not(.title),\n .dg .closed ul li,\n .dg .closed ul li > * {\n height: 0;\n overflow: hidden;\n border: 0; }\n .dg .cr {\n clear: both;\n padding-left: 3px;\n height: 27px; }\n .dg .property-name {\n cursor: default;\n float: left;\n clear: left;\n width: 40%;\n overflow: hidden;\n text-overflow: ellipsis; }\n .dg .c {\n float: left;\n width: 60%; }\n .dg .c input[type=text] {\n border: 0;\n margin-top: 4px;\n padding: 3px;\n width: 100%;\n float: right; }\n .dg .has-slider input[type=text] {\n width: 30%;\n /*display: none;*/\n margin-left: 0; }\n .dg .slider {\n float: left;\n width: 66%;\n margin-left: -5px;\n margin-right: 0;\n height: 19px;\n margin-top: 4px; }\n .dg .slider-fg {\n height: 100%; }\n .dg .c input[type=checkbox] {\n margin-top: 9px; }\n .dg .c select {\n margin-top: 5px; }\n .dg .cr.function,\n .dg .cr.function .property-name,\n .dg .cr.function *,\n .dg .cr.boolean,\n .dg .cr.boolean * {\n cursor: pointer; }\n .dg .selector {\n display: none;\n position: absolute;\n margin-left: -9px;\n margin-top: 23px;\n z-index: 10; }\n .dg .c:hover .selector,\n .dg .selector.drag {\n display: block; }\n .dg li.save-row {\n padding: 0; }\n .dg li.save-row .button {\n display: inline-block;\n padding: 0px 6px; }\n .dg.dialogue {\n background-color: #222;\n width: 460px;\n padding: 15px;\n font-size: 13px;\n line-height: 15px; }\n\n/* TODO Separate style and structure */\n#dg-new-constructor {\n padding: 10px;\n color: #222;\n font-family: Monaco, monospace;\n font-size: 10px;\n border: 0;\n resize: none;\n box-shadow: inset 1px 1px 1px #888;\n word-wrap: break-word;\n margin: 12px 0;\n display: block;\n width: 440px;\n overflow-y: scroll;\n height: 100px;\n position: relative; }\n\n#dg-local-explain {\n display: none;\n font-size: 11px;\n line-height: 17px;\n border-radius: 3px;\n background-color: #333;\n padding: 8px;\n margin-top: 10px; }\n #dg-local-explain code {\n font-size: 10px; }\n\n#dat-gui-save-locally {\n display: none; }\n\n/** Main type */\n.dg {\n color: #eee;\n font: 11px 'Lucida Grande', sans-serif;\n text-shadow: 0 -1px 0 #111;\n /** Auto place */\n /* Controller row, <li> */\n /** Controllers */ }\n .dg.main {\n /** Scrollbar */ }\n .dg.main::-webkit-scrollbar {\n width: 5px;\n background: #1a1a1a; }\n .dg.main::-webkit-scrollbar-corner {\n height: 0;\n display: none; }\n .dg.main::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: #676767; }\n .dg li:not(.folder) {\n background: #1a1a1a;\n border-bottom: 1px solid #2c2c2c; }\n .dg li.save-row {\n line-height: 25px;\n background: #dad5cb;\n border: 0; }\n .dg li.save-row select {\n margin-left: 5px;\n width: 108px; }\n .dg li.save-row .button {\n margin-left: 5px;\n margin-top: 1px;\n border-radius: 2px;\n font-size: 9px;\n line-height: 7px;\n padding: 4px 4px 5px 4px;\n background: #c5bdad;\n color: #fff;\n text-shadow: 0 1px 0 #b0a58f;\n box-shadow: 0 -1px 0 #b0a58f;\n cursor: pointer; }\n .dg li.save-row .button.gears {\n background: #c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;\n height: 7px;\n width: 8px; }\n .dg li.save-row .button:hover {\n background-color: #bab19e;\n box-shadow: 0 -1px 0 #b0a58f; }\n .dg li.folder {\n border-bottom: 0; }\n .dg li.title {\n padding-left: 16px;\n background: black url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;\n cursor: pointer;\n border-bottom: 1px solid rgba(255, 255, 255, 0.2); }\n .dg .closed li.title {\n background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==); }\n .dg .cr.boolean {\n border-left: 3px solid #806787; }\n .dg .cr.function {\n border-left: 3px solid #e61d5f; }\n .dg .cr.number {\n border-left: 3px solid #2fa1d6; }\n .dg .cr.number input[type=text] {\n color: #2fa1d6; }\n .dg .cr.string {\n border-left: 3px solid #1ed36f; }\n .dg .cr.string input[type=text] {\n color: #1ed36f; }\n .dg .cr.function:hover, .dg .cr.boolean:hover {\n background: #111; }\n .dg .c input[type=text] {\n background: #303030;\n outline: none; }\n .dg .c input[type=text]:hover {\n background: #3c3c3c; }\n .dg .c input[type=text]:focus {\n background: #494949;\n color: #fff; }\n .dg .c .slider {\n background: #303030;\n cursor: ew-resize; }\n .dg .c .slider-fg {\n background: #2fa1d6; }\n .dg .c .slider:hover {\n background: #3c3c3c; }\n .dg .c .slider:hover .slider-fg {\n background: #44abda; }\n", n.controllers.factory = function(e, t, i, n, r, o, a) {
  10928. return function(s, l) {
  10929. var c = s[l];
  10930. return a.isArray(arguments[2]) || a.isObject(arguments[2]) ? new e(s,l,arguments[2]) : a.isNumber(c) ? a.isNumber(arguments[2]) && a.isNumber(arguments[3]) ? new i(s,l,arguments[2],arguments[3]) : new t(s,l,{
  10931. min: arguments[2],
  10932. max: arguments[3]
  10933. }) : a.isString(c) ? new n(s,l) : a.isFunction(c) ? new r(s,l,"") : a.isBoolean(c) ? new o(s,l) : void 0
  10934. }
  10935. }(n.controllers.OptionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.StringController = function(e, t, i) {
  10936. var n = function(e, i) {
  10937. function r() {
  10938. a.setValue(a.__input.value)
  10939. }
  10940. function o() {
  10941. a.__onFinishChange && a.__onFinishChange.call(a, a.getValue())
  10942. }
  10943. n.superclass.call(this, e, i);
  10944. var a = this;
  10945. this.__input = document.createElement("input"),
  10946. this.__input.setAttribute("type", "text"),
  10947. t.bind(this.__input, "keyup", r),
  10948. t.bind(this.__input, "change", r),
  10949. t.bind(this.__input, "blur", o),
  10950. t.bind(this.__input, "keydown", function(e) {
  10951. 13 === e.keyCode && this.blur()
  10952. }),
  10953. this.updateDisplay(),
  10954. this.domElement.appendChild(this.__input)
  10955. };
  10956. return n.superclass = e,
  10957. i.extend(n.prototype, e.prototype, {
  10958. updateDisplay: function() {
  10959. return t.isActive(this.__input) || (this.__input.value = this.getValue()),
  10960. n.superclass.prototype.updateDisplay.call(this)
  10961. }
  10962. }),
  10963. n
  10964. }(n.controllers.Controller, n.dom.dom, n.utils.common), n.controllers.FunctionController, n.controllers.BooleanController, n.utils.common), n.controllers.Controller, n.controllers.BooleanController, n.controllers.FunctionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.OptionController, n.controllers.ColorController = function(e, t, i, n, r) {
  10965. function o(e, t, i, n) {
  10966. e.style.background = "",
  10967. r.each(l, function(r) {
  10968. e.style.cssText += "background: " + r + "linear-gradient(" + t + ", " + i + " 0%, " + n + " 100%); "
  10969. })
  10970. }
  10971. function a(e) {
  10972. e.style.background = "",
  10973. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  10974. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10975. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10976. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10977. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  10978. }
  10979. var s = function(e, l) {
  10980. function c(e) {
  10981. p(e),
  10982. t.bind(window, "mousemove", p),
  10983. t.bind(window, "mouseup", h)
  10984. }
  10985. function h() {
  10986. t.unbind(window, "mousemove", p),
  10987. t.unbind(window, "mouseup", h)
  10988. }
  10989. function u() {
  10990. var e = n(this.value);
  10991. e !== !1 ? (g.__color.__state = e,
  10992. g.setValue(g.__color.toOriginal())) : this.value = g.__color.toString()
  10993. }
  10994. function d() {
  10995. t.unbind(window, "mousemove", f),
  10996. t.unbind(window, "mouseup", d)
  10997. }
  10998. function p(e) {
  10999. e.preventDefault();
  11000. var i = t.getWidth(g.__saturation_field)
  11001. , n = t.getOffset(g.__saturation_field)
  11002. , r = (e.clientX - n.left + document.body.scrollLeft) / i
  11003. , o = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  11004. return o > 1 ? o = 1 : o < 0 && (o = 0),
  11005. r > 1 ? r = 1 : r < 0 && (r = 0),
  11006. g.__color.v = o,
  11007. g.__color.s = r,
  11008. g.setValue(g.__color.toOriginal()),
  11009. !1
  11010. }
  11011. function f(e) {
  11012. e.preventDefault();
  11013. var i = t.getHeight(g.__hue_field)
  11014. , n = t.getOffset(g.__hue_field)
  11015. , r = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  11016. return r > 1 ? r = 1 : r < 0 && (r = 0),
  11017. g.__color.h = 360 * r,
  11018. g.setValue(g.__color.toOriginal()),
  11019. !1
  11020. }
  11021. s.superclass.call(this, e, l),
  11022. this.__color = new i(this.getValue()),
  11023. this.__temp = new i(0);
  11024. var g = this;
  11025. this.domElement = document.createElement("div"),
  11026. t.makeSelectable(this.domElement, !1),
  11027. this.__selector = document.createElement("div"),
  11028. this.__selector.className = "selector",
  11029. this.__saturation_field = document.createElement("div"),
  11030. this.__saturation_field.className = "saturation-field",
  11031. this.__field_knob = document.createElement("div"),
  11032. this.__field_knob.className = "field-knob",
  11033. this.__field_knob_border = "2px solid ",
  11034. this.__hue_knob = document.createElement("div"),
  11035. this.__hue_knob.className = "hue-knob",
  11036. this.__hue_field = document.createElement("div"),
  11037. this.__hue_field.className = "hue-field",
  11038. this.__input = document.createElement("input"),
  11039. this.__input.type = "text",
  11040. this.__input_textShadow = "0 1px 1px ",
  11041. t.bind(this.__input, "keydown", function(e) {
  11042. 13 === e.keyCode && u.call(this)
  11043. }),
  11044. t.bind(this.__input, "blur", u),
  11045. t.bind(this.__selector, "mousedown", function(e) {
  11046. t.addClass(this, "drag").bind(window, "mouseup", function(e) {
  11047. t.removeClass(g.__selector, "drag")
  11048. })
  11049. });
  11050. var m = document.createElement("div");
  11051. r.extend(this.__selector.style, {
  11052. width: "122px",
  11053. height: "102px",
  11054. padding: "3px",
  11055. backgroundColor: "#222",
  11056. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  11057. }),
  11058. r.extend(this.__field_knob.style, {
  11059. position: "absolute",
  11060. width: "12px",
  11061. height: "12px",
  11062. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  11063. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  11064. borderRadius: "12px",
  11065. zIndex: 1
  11066. }),
  11067. r.extend(this.__hue_knob.style, {
  11068. position: "absolute",
  11069. width: "15px",
  11070. height: "2px",
  11071. borderRight: "4px solid #fff",
  11072. zIndex: 1
  11073. }),
  11074. r.extend(this.__saturation_field.style, {
  11075. width: "100px",
  11076. height: "100px",
  11077. border: "1px solid #555",
  11078. marginRight: "3px",
  11079. display: "inline-block",
  11080. cursor: "pointer"
  11081. }),
  11082. r.extend(m.style, {
  11083. width: "100%",
  11084. height: "100%",
  11085. background: "none"
  11086. }),
  11087. o(m, "top", "rgba(0,0,0,0)", "#000"),
  11088. r.extend(this.__hue_field.style, {
  11089. width: "15px",
  11090. height: "100px",
  11091. display: "inline-block",
  11092. border: "1px solid #555",
  11093. cursor: "ns-resize"
  11094. }),
  11095. a(this.__hue_field),
  11096. r.extend(this.__input.style, {
  11097. outline: "none",
  11098. textAlign: "center",
  11099. color: "#fff",
  11100. border: 0,
  11101. fontWeight: "bold",
  11102. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  11103. }),
  11104. t.bind(this.__saturation_field, "mousedown", c),
  11105. t.bind(this.__field_knob, "mousedown", c),
  11106. t.bind(this.__hue_field, "mousedown", function(e) {
  11107. f(e),
  11108. t.bind(window, "mousemove", f),
  11109. t.bind(window, "mouseup", d)
  11110. }),
  11111. this.__saturation_field.appendChild(m),
  11112. this.__selector.appendChild(this.__field_knob),
  11113. this.__selector.appendChild(this.__saturation_field),
  11114. this.__selector.appendChild(this.__hue_field),
  11115. this.__hue_field.appendChild(this.__hue_knob),
  11116. this.domElement.appendChild(this.__input),
  11117. this.domElement.appendChild(this.__selector),
  11118. this.updateDisplay()
  11119. };
  11120. s.superclass = e,
  11121. r.extend(s.prototype, e.prototype, {
  11122. updateDisplay: function() {
  11123. var e = n(this.getValue());
  11124. if (e !== !1) {
  11125. var t = !1;
  11126. r.each(i.COMPONENTS, function(i) {
  11127. if (!r.isUndefined(e[i]) && !r.isUndefined(this.__color.__state[i]) && e[i] !== this.__color.__state[i])
  11128. return t = !0,
  11129. {}
  11130. }, this),
  11131. t && r.extend(this.__color.__state, e)
  11132. }
  11133. r.extend(this.__temp.__state, this.__color.__state),
  11134. this.__temp.a = 1;
  11135. var a = this.__color.v < .5 || this.__color.s > .5 ? 255 : 0
  11136. , s = 255 - a;
  11137. r.extend(this.__field_knob.style, {
  11138. marginLeft: 100 * this.__color.s - 7 + "px",
  11139. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11140. backgroundColor: this.__temp.toString(),
  11141. border: this.__field_knob_border + "rgb(" + a + "," + a + "," + a + ")"
  11142. }),
  11143. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11144. this.__temp.s = 1,
  11145. this.__temp.v = 1,
  11146. o(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11147. r.extend(this.__input.style, {
  11148. backgroundColor: this.__input.value = this.__color.toString(),
  11149. color: "rgb(" + a + "," + a + "," + a + ")",
  11150. textShadow: this.__input_textShadow + "rgba(" + s + "," + s + "," + s + ",.7)"
  11151. })
  11152. }
  11153. });
  11154. var l = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11155. return s
  11156. }(n.controllers.Controller, n.dom.dom, n.color.Color = function(e, t, i, n) {
  11157. function r(e, t, i) {
  11158. Object.defineProperty(e, t, {
  11159. get: function() {
  11160. return "RGB" === this.__state.space ? this.__state[t] : (a(this, t, i),
  11161. this.__state[t])
  11162. },
  11163. set: function(e) {
  11164. "RGB" !== this.__state.space && (a(this, t, i),
  11165. this.__state.space = "RGB"),
  11166. this.__state[t] = e
  11167. }
  11168. })
  11169. }
  11170. function o(e, t) {
  11171. Object.defineProperty(e, t, {
  11172. get: function() {
  11173. return "HSV" === this.__state.space ? this.__state[t] : (s(this),
  11174. this.__state[t])
  11175. },
  11176. set: function(e) {
  11177. "HSV" !== this.__state.space && (s(this),
  11178. this.__state.space = "HSV"),
  11179. this.__state[t] = e
  11180. }
  11181. })
  11182. }
  11183. function a(e, i, r) {
  11184. if ("HEX" === e.__state.space)
  11185. e.__state[i] = t.component_from_hex(e.__state.hex, r);
  11186. else {
  11187. if ("HSV" !== e.__state.space)
  11188. throw "Corrupted color state";
  11189. n.extend(e.__state, t.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  11190. }
  11191. }
  11192. function s(e) {
  11193. var i = t.rgb_to_hsv(e.r, e.g, e.b);
  11194. n.extend(e.__state, {
  11195. s: i.s,
  11196. v: i.v
  11197. }),
  11198. n.isNaN(i.h) ? n.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = i.h
  11199. }
  11200. var l = function() {
  11201. if (this.__state = e.apply(this, arguments),
  11202. this.__state === !1)
  11203. throw "Failed to interpret color arguments";
  11204. this.__state.a = this.__state.a || 1
  11205. };
  11206. return l.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11207. n.extend(l.prototype, {
  11208. toString: function() {
  11209. return i(this)
  11210. },
  11211. toOriginal: function() {
  11212. return this.__state.conversion.write(this)
  11213. }
  11214. }),
  11215. r(l.prototype, "r", 2),
  11216. r(l.prototype, "g", 1),
  11217. r(l.prototype, "b", 0),
  11218. o(l.prototype, "h"),
  11219. o(l.prototype, "s"),
  11220. o(l.prototype, "v"),
  11221. Object.defineProperty(l.prototype, "a", {
  11222. get: function() {
  11223. return this.__state.a
  11224. },
  11225. set: function(e) {
  11226. this.__state.a = e
  11227. }
  11228. }),
  11229. Object.defineProperty(l.prototype, "hex", {
  11230. get: function() {
  11231. return "HEX" !== !this.__state.space && (this.__state.hex = t.rgb_to_hex(this.r, this.g, this.b)),
  11232. this.__state.hex
  11233. },
  11234. set: function(e) {
  11235. this.__state.space = "HEX",
  11236. this.__state.hex = e
  11237. }
  11238. }),
  11239. l
  11240. }(n.color.interpret, n.color.math = function() {
  11241. var e;
  11242. return {
  11243. hsv_to_rgb: function(e, t, i) {
  11244. var n = Math.floor(e / 60) % 6
  11245. , r = e / 60 - Math.floor(e / 60)
  11246. , o = i * (1 - t)
  11247. , a = i * (1 - r * t)
  11248. , s = i * (1 - (1 - r) * t)
  11249. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11250. return {
  11251. r: 255 * l[0],
  11252. g: 255 * l[1],
  11253. b: 255 * l[2]
  11254. }
  11255. },
  11256. rgb_to_hsv: function(e, t, i) {
  11257. var n, r, o = Math.min(e, t, i), a = Math.max(e, t, i), s = a - o;
  11258. return 0 == a ? {
  11259. h: NaN,
  11260. s: 0,
  11261. v: 0
  11262. } : (r = s / a,
  11263. n = e == a ? (t - i) / s : t == a ? 2 + (i - e) / s : 4 + (e - t) / s,
  11264. n /= 6,
  11265. n < 0 && (n += 1),
  11266. {
  11267. h: 360 * n,
  11268. s: r,
  11269. v: a / 255
  11270. })
  11271. },
  11272. rgb_to_hex: function(e, t, i) {
  11273. var n = this.hex_with_component(0, 2, e);
  11274. return n = this.hex_with_component(n, 1, t),
  11275. n = this.hex_with_component(n, 0, i)
  11276. },
  11277. component_from_hex: function(e, t) {
  11278. return e >> 8 * t & 255
  11279. },
  11280. hex_with_component: function(t, i, n) {
  11281. return n << (e = 8 * i) | t & ~(255 << e)
  11282. }
  11283. }
  11284. }(), n.color.toString, n.utils.common), n.color.interpret, n.utils.common), n.utils.requestAnimationFrame = function() {
  11285. return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11286. window.setTimeout(e, 1e3 / 60)
  11287. }
  11288. }(), n.dom.CenteredDiv = function(e, t) {
  11289. var i = function() {
  11290. this.backgroundElement = document.createElement("div"),
  11291. t.extend(this.backgroundElement.style, {
  11292. backgroundColor: "rgba(0,0,0,0.8)",
  11293. top: 0,
  11294. left: 0,
  11295. display: "none",
  11296. zIndex: "1000",
  11297. opacity: 0,
  11298. WebkitTransition: "opacity 0.2s linear"
  11299. }),
  11300. e.makeFullscreen(this.backgroundElement),
  11301. this.backgroundElement.style.position = "fixed",
  11302. this.domElement = document.createElement("div"),
  11303. t.extend(this.domElement.style, {
  11304. position: "fixed",
  11305. display: "none",
  11306. zIndex: "1001",
  11307. opacity: 0,
  11308. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  11309. }),
  11310. document.body.appendChild(this.backgroundElement),
  11311. document.body.appendChild(this.domElement);
  11312. var i = this;
  11313. e.bind(this.backgroundElement, "click", function() {
  11314. i.hide()
  11315. })
  11316. };
  11317. return i.prototype.show = function() {
  11318. var e = this;
  11319. this.backgroundElement.style.display = "block",
  11320. this.domElement.style.display = "block",
  11321. this.domElement.style.opacity = 0,
  11322. this.domElement.style.webkitTransform = "scale(1.1)",
  11323. this.layout(),
  11324. t.defer(function() {
  11325. e.backgroundElement.style.opacity = 1,
  11326. e.domElement.style.opacity = 1,
  11327. e.domElement.style.webkitTransform = "scale(1)"
  11328. })
  11329. }
  11330. ,
  11331. i.prototype.hide = function() {
  11332. var t = this
  11333. , i = function() {
  11334. t.domElement.style.display = "none",
  11335. t.backgroundElement.style.display = "none",
  11336. e.unbind(t.domElement, "webkitTransitionEnd", i),
  11337. e.unbind(t.domElement, "transitionend", i),
  11338. e.unbind(t.domElement, "oTransitionEnd", i)
  11339. };
  11340. e.bind(this.domElement, "webkitTransitionEnd", i),
  11341. e.bind(this.domElement, "transitionend", i),
  11342. e.bind(this.domElement, "oTransitionEnd", i),
  11343. this.backgroundElement.style.opacity = 0,
  11344. this.domElement.style.opacity = 0,
  11345. this.domElement.style.webkitTransform = "scale(1.1)"
  11346. }
  11347. ,
  11348. i.prototype.layout = function() {
  11349. this.domElement.style.left = $("#player").width() / 2 - e.getWidth(this.domElement) / 2 + "px",
  11350. this.domElement.style.top = $("#player").height() / 2 - e.getHeight(this.domElement) / 2 + "px"
  11351. }
  11352. ,
  11353. i
  11354. }(n.dom.dom, n.utils.common), n.dom.dom, n.utils.common)
  11355. }
  11356. , {}],
  11357. 94: [function(e, t, i) {
  11358. (function(e) {
  11359. "use strict";
  11360. function i(t) {
  11361. function i(e) {
  11362. for (var t = [16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, 14, 13, 16, 24, 40, 57, 69, 56, 14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56, 68, 109, 103, 77, 24, 35, 55, 64, 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72, 92, 95, 98, 112, 100, 103, 99], i = 0; i < 64; i++) {
  11363. var n = _((t[i] * e + 50) / 100);
  11364. n < 1 ? n = 1 : n > 255 && (n = 255),
  11365. T[G[i]] = n
  11366. }
  11367. for (var r = [17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99, 24, 26, 56, 99, 99, 99, 99, 99, 47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99], o = 0; o < 64; o++) {
  11368. var a = _((r[o] * e + 50) / 100);
  11369. a < 1 ? a = 1 : a > 255 && (a = 255),
  11370. x[G[o]] = a
  11371. }
  11372. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11373. for (var h = 0; h < 8; h++)
  11374. S[l] = 1 / (T[G[l]] * s[c] * s[h] * 8),
  11375. M[l] = 1 / (x[G[l]] * s[c] * s[h] * 8),
  11376. l++
  11377. }
  11378. function n(e, t) {
  11379. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11380. for (var a = 1; a <= e[o]; a++)
  11381. r[t[n]] = [],
  11382. r[t[n]][0] = i,
  11383. r[t[n]][1] = o,
  11384. n++,
  11385. i++;
  11386. i *= 2
  11387. }
  11388. return r
  11389. }
  11390. function r() {
  11391. C = n(z, W),
  11392. I = n(X, Z),
  11393. E = n(j, Y),
  11394. b = n(q, K)
  11395. }
  11396. function o() {
  11397. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11398. for (var n = e; n < t; n++)
  11399. P[32767 + n] = i,
  11400. R[32767 + n] = [],
  11401. R[32767 + n][1] = i,
  11402. R[32767 + n][0] = n;
  11403. for (var r = -(t - 1); r <= -e; r++)
  11404. P[32767 + r] = i,
  11405. R[32767 + r] = [],
  11406. R[32767 + r][1] = i,
  11407. R[32767 + r][0] = t - 1 + r;
  11408. e <<= 1,
  11409. t <<= 1
  11410. }
  11411. }
  11412. function a() {
  11413. for (var e = 0; e < 256; e++)
  11414. H[e] = 19595 * e,
  11415. H[e + 256 >> 0] = 38470 * e,
  11416. H[e + 512 >> 0] = 7471 * e + 32768,
  11417. H[e + 768 >> 0] = -11059 * e,
  11418. H[e + 1024 >> 0] = -21709 * e,
  11419. H[e + 1280 >> 0] = 32768 * e + 8421375,
  11420. H[e + 1536 >> 0] = -27439 * e,
  11421. H[e + 1792 >> 0] = -5329 * e
  11422. }
  11423. function s(e) {
  11424. for (var t = e[0], i = e[1] - 1; i >= 0; )
  11425. t & 1 << i && (N |= 1 << B),
  11426. i--,
  11427. B--,
  11428. B < 0 && (255 == N ? (l(255),
  11429. l(0)) : l(N),
  11430. B = 7,
  11431. N = 0)
  11432. }
  11433. function l(e) {
  11434. D.push(e)
  11435. }
  11436. function c(e) {
  11437. l(e >> 8 & 255),
  11438. l(255 & e)
  11439. }
  11440. function h(e, t) {
  11441. var i, n, r, o, a, s, l, c, h, u = 0, d = 8, p = 64;
  11442. for (h = 0; h < d; ++h) {
  11443. i = e[u],
  11444. n = e[u + 1],
  11445. r = e[u + 2],
  11446. o = e[u + 3],
  11447. a = e[u + 4],
  11448. s = e[u + 5],
  11449. l = e[u + 6],
  11450. c = e[u + 7];
  11451. var f = i + c
  11452. , g = i - c
  11453. , m = n + l
  11454. , v = n - l
  11455. , A = r + s
  11456. , y = r - s
  11457. , C = o + a
  11458. , I = o - a
  11459. , E = f + C
  11460. , b = f - C
  11461. , w = m + A
  11462. , _ = m - A;
  11463. e[u] = E + w,
  11464. e[u + 4] = E - w;
  11465. var T = .707106781 * (_ + b);
  11466. e[u + 2] = b + T,
  11467. e[u + 6] = b - T,
  11468. E = I + y,
  11469. w = y + v,
  11470. _ = v + g;
  11471. var x = .382683433 * (E - _)
  11472. , S = .5411961 * E + x
  11473. , M = 1.306562965 * _ + x
  11474. , R = .707106781 * w
  11475. , P = g + R
  11476. , L = g - R;
  11477. e[u + 5] = L + S,
  11478. e[u + 3] = L - S,
  11479. e[u + 1] = P + M,
  11480. e[u + 7] = P - M,
  11481. u += 8
  11482. }
  11483. for (u = 0,
  11484. h = 0; h < d; ++h) {
  11485. i = e[u],
  11486. n = e[u + 8],
  11487. r = e[u + 16],
  11488. o = e[u + 24],
  11489. a = e[u + 32],
  11490. s = e[u + 40],
  11491. l = e[u + 48],
  11492. c = e[u + 56];
  11493. var D = i + c
  11494. , N = i - c
  11495. , B = n + l
  11496. , F = n - l
  11497. , V = r + s
  11498. , U = r - s
  11499. , k = o + a
  11500. , H = o - a
  11501. , G = D + k
  11502. , z = D - k
  11503. , W = B + V
  11504. , j = B - V;
  11505. e[u] = G + W,
  11506. e[u + 32] = G - W;
  11507. var Y = .707106781 * (j + z);
  11508. e[u + 16] = z + Y,
  11509. e[u + 48] = z - Y,
  11510. G = H + U,
  11511. W = U + F,
  11512. j = F + N;
  11513. var X = .382683433 * (G - j)
  11514. , Z = .5411961 * G + X
  11515. , q = 1.306562965 * j + X
  11516. , K = .707106781 * W
  11517. , Q = N + K
  11518. , J = N - K;
  11519. e[u + 40] = J + Z,
  11520. e[u + 24] = J - Z,
  11521. e[u + 8] = Q + q,
  11522. e[u + 56] = Q - q,
  11523. u++
  11524. }
  11525. var $;
  11526. for (h = 0; h < p; ++h)
  11527. $ = e[h] * t[h],
  11528. O[h] = $ > 0 ? $ + .5 | 0 : $ - .5 | 0;
  11529. return O
  11530. }
  11531. function u() {
  11532. c(65504),
  11533. c(16),
  11534. l(74),
  11535. l(70),
  11536. l(73),
  11537. l(70),
  11538. l(0),
  11539. l(1),
  11540. l(1),
  11541. l(0),
  11542. c(1),
  11543. c(1),
  11544. l(0),
  11545. l(0)
  11546. }
  11547. function d(e, t) {
  11548. c(65472),
  11549. c(17),
  11550. l(8),
  11551. c(t),
  11552. c(e),
  11553. l(3),
  11554. l(1),
  11555. l(17),
  11556. l(0),
  11557. l(2),
  11558. l(17),
  11559. l(1),
  11560. l(3),
  11561. l(17),
  11562. l(1)
  11563. }
  11564. function p() {
  11565. c(65499),
  11566. c(132),
  11567. l(0);
  11568. for (var e = 0; e < 64; e++)
  11569. l(T[e]);
  11570. l(1);
  11571. for (var t = 0; t < 64; t++)
  11572. l(x[t])
  11573. }
  11574. function f() {
  11575. c(65476),
  11576. c(418),
  11577. l(0);
  11578. for (var e = 0; e < 16; e++)
  11579. l(z[e + 1]);
  11580. for (var t = 0; t <= 11; t++)
  11581. l(W[t]);
  11582. l(16);
  11583. for (var i = 0; i < 16; i++)
  11584. l(j[i + 1]);
  11585. for (var n = 0; n <= 161; n++)
  11586. l(Y[n]);
  11587. l(1);
  11588. for (var r = 0; r < 16; r++)
  11589. l(X[r + 1]);
  11590. for (var o = 0; o <= 11; o++)
  11591. l(Z[o]);
  11592. l(17);
  11593. for (var a = 0; a < 16; a++)
  11594. l(q[a + 1]);
  11595. for (var s = 0; s <= 161; s++)
  11596. l(K[s])
  11597. }
  11598. function g() {
  11599. c(65498),
  11600. c(12),
  11601. l(3),
  11602. l(1),
  11603. l(0),
  11604. l(2),
  11605. l(17),
  11606. l(3),
  11607. l(17),
  11608. l(0),
  11609. l(63),
  11610. l(0)
  11611. }
  11612. function m(e, t, i, n, r) {
  11613. for (var o, a = r[0], l = r[240], c = 16, u = 63, d = 64, p = h(e, t), f = 0; f < d; ++f)
  11614. L[G[f]] = p[f];
  11615. var g = L[0] - i;
  11616. i = L[0],
  11617. 0 == g ? s(n[0]) : (o = 32767 + g,
  11618. s(n[P[o]]),
  11619. s(R[o]));
  11620. for (var m = 63; m > 0 && 0 == L[m]; m--)
  11621. ;
  11622. if (0 == m)
  11623. return s(a),
  11624. i;
  11625. for (var v, A = 1; A <= m; ) {
  11626. for (var y = A; 0 == L[A] && A <= m; ++A)
  11627. ;
  11628. var C = A - y;
  11629. if (C >= c) {
  11630. v = C >> 4;
  11631. for (var I = 1; I <= v; ++I)
  11632. s(l);
  11633. C &= 15
  11634. }
  11635. o = 32767 + L[A],
  11636. s(r[(C << 4) + P[o]]),
  11637. s(R[o]),
  11638. A++
  11639. }
  11640. return m != u && s(a),
  11641. i
  11642. }
  11643. function v() {
  11644. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11645. k[t] = e(t)
  11646. }
  11647. function A(e) {
  11648. if (e <= 0 && (e = 1),
  11649. e > 100 && (e = 100),
  11650. w != e) {
  11651. var t = 0;
  11652. t = e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e),
  11653. i(t),
  11654. w = e
  11655. }
  11656. }
  11657. function y() {
  11658. var e = (new Date).getTime();
  11659. t || (t = 50),
  11660. v(),
  11661. r(),
  11662. o(),
  11663. a(),
  11664. A(t);
  11665. (new Date).getTime() - e
  11666. }
  11667. var C, I, E, b, w, _ = (Math.round,
  11668. Math.floor), T = new Array(64), x = new Array(64), S = new Array(64), M = new Array(64), R = new Array(65535), P = new Array(65535), O = new Array(64), L = new Array(64), D = [], N = 0, B = 7, F = new Array(64), V = new Array(64), U = new Array(64), k = new Array(256), H = new Array(2048), G = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63], z = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], W = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], j = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125], Y = [1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250], X = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], Z = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], q = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119], K = [0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250];
  11669. this.encode = function(t, i) {
  11670. var n = ((new Date).getTime(),
  11671. i.quality);
  11672. n && A(n),
  11673. D = new Array,
  11674. N = 0,
  11675. B = 7,
  11676. c(65496),
  11677. u(),
  11678. p(),
  11679. d(t.width, t.height),
  11680. f(),
  11681. g();
  11682. var r = 0
  11683. , o = 0
  11684. , a = 0;
  11685. N = 0,
  11686. B = 7,
  11687. this.encode.displayName = "_encode_";
  11688. for (var l, h, v, y, w, _, T, x, R, P = t.data, O = t.width, L = t.height, k = i.flipY, G = 4 * O, z = k ? L : 0, W = k ? -8 : 8; k && z > 0 || !k && z < L; ) {
  11689. for (l = 0; l < G; ) {
  11690. for (w = G * z + l,
  11691. _ = w,
  11692. T = -1,
  11693. x = 0,
  11694. R = 0; R < 64; R++)
  11695. x = (k ? 63 - R : R) >> 3,
  11696. T = 4 * (7 & R),
  11697. _ = w + x * G + T,
  11698. z + x >= L && (_ -= G * (z + 1 + x - L)),
  11699. l + T >= G && (_ -= l + T - G + 4),
  11700. h = P[_++],
  11701. v = P[_++],
  11702. y = P[_++],
  11703. F[R] = (H[h] + H[v + 256 >> 0] + H[y + 512 >> 0] >> 16) - 128,
  11704. V[R] = (H[h + 768 >> 0] + H[v + 1024 >> 0] + H[y + 1280 >> 0] >> 16) - 128,
  11705. U[R] = (H[h + 1280 >> 0] + H[v + 1536 >> 0] + H[y + 1792 >> 0] >> 16) - 128;
  11706. r = m(F, S, r, C, E),
  11707. o = m(V, M, o, I, b),
  11708. a = m(U, M, a, I, b),
  11709. l += 32
  11710. }
  11711. z += W
  11712. }
  11713. if (B >= 0) {
  11714. var j = [];
  11715. j[1] = B + 1,
  11716. j[0] = (1 << B + 1) - 1,
  11717. s(j)
  11718. }
  11719. return c(65497),
  11720. new e(D)
  11721. }
  11722. ,
  11723. y()
  11724. }
  11725. function n(e, t) {
  11726. t = t || {},
  11727. t.quality = t.quality || 50;
  11728. var n = t.quality
  11729. , r = new i(n)
  11730. , o = r.encode(e, t);
  11731. return {
  11732. data: o,
  11733. width: e.width,
  11734. height: e.height
  11735. }
  11736. }
  11737. t.exports.encode = n
  11738. }
  11739. ).call(this, e("buffer").Buffer)
  11740. }
  11741. , {
  11742. buffer: 198
  11743. }],
  11744. 95: [function(e, t, i) {
  11745. "use strict";
  11746. !function() {
  11747. if ("performance"in window == !1 && (window.performance = {}),
  11748. Date.now = Date.now || function() {
  11749. return (new Date).getTime()
  11750. }
  11751. ,
  11752. "now"in window.performance == !1) {
  11753. var e = Date.now();
  11754. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11755. window.performance.now = function() {
  11756. return Date.now() - e
  11757. }
  11758. }
  11759. }()
  11760. }
  11761. , {}],
  11762. 96: [function(e, t, i) {
  11763. "use strict";
  11764. var n = e("three");
  11765. n.EffectComposer = function(e, t) {
  11766. if (this.renderer = e,
  11767. void 0 === t) {
  11768. var i = {
  11769. minFilter: n.LinearFilter,
  11770. magFilter: n.LinearFilter,
  11771. format: n.RGBAFormat,
  11772. stencilBuffer: !1
  11773. }
  11774. , r = e.getSize();
  11775. t = new n.WebGLRenderTarget(r.width,r.height,i)
  11776. }
  11777. this.renderTarget1 = t,
  11778. this.renderTarget2 = t.clone(),
  11779. this.writeBuffer = this.renderTarget1,
  11780. this.readBuffer = this.renderTarget2,
  11781. this.passes = [],
  11782. void 0 === n.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11783. this.copyPass = new n.ShaderPass(n.CopyShader)
  11784. }
  11785. ,
  11786. n.EffectComposer.prototype = {
  11787. swapBuffers: function() {
  11788. var e = this.readBuffer;
  11789. this.readBuffer = this.writeBuffer,
  11790. this.writeBuffer = e
  11791. },
  11792. addPass: function(e) {
  11793. this.passes.push(e)
  11794. },
  11795. insertPass: function(e, t) {
  11796. this.passes.splice(t, 0, e)
  11797. },
  11798. render: function(e) {
  11799. this.writeBuffer = this.renderTarget1,
  11800. this.readBuffer = this.renderTarget2;
  11801. var t, i, r = !1, o = this.passes.length;
  11802. for (i = 0; i < o; i++)
  11803. if (t = this.passes[i],
  11804. t.enabled) {
  11805. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, r),
  11806. t.needsSwap) {
  11807. if (r) {
  11808. var a = this.renderer.context;
  11809. a.stencilFunc(a.NOTEQUAL, 1, 4294967295),
  11810. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11811. a.stencilFunc(a.EQUAL, 1, 4294967295)
  11812. }
  11813. this.swapBuffers()
  11814. }
  11815. t instanceof n.MaskPass ? r = !0 : t instanceof n.ClearMaskPass && (r = !1)
  11816. }
  11817. },
  11818. reset: function(e) {
  11819. if (void 0 === e) {
  11820. var t = this.renderer.getSize();
  11821. e = this.renderTarget1.clone(),
  11822. e.setSize(t.width, t.height)
  11823. }
  11824. this.renderTarget1.dispose(),
  11825. this.renderTarget2.dispose(),
  11826. this.renderTarget1 = e,
  11827. this.renderTarget2 = e.clone(),
  11828. this.writeBuffer = this.renderTarget1,
  11829. this.readBuffer = this.renderTarget2
  11830. },
  11831. setSize: function(e, t) {
  11832. this.renderTarget1.setSize(e, t),
  11833. this.renderTarget2.setSize(e, t)
  11834. }
  11835. }
  11836. }
  11837. , {
  11838. three: 217
  11839. }],
  11840. 97: [function(e, t, i) {
  11841. "use strict";
  11842. var n = e("three");
  11843. n.MaskPass = function(e, t) {
  11844. this.scene = e,
  11845. this.camera = t,
  11846. this.enabled = !0,
  11847. this.clear = !0,
  11848. this.needsSwap = !1,
  11849. this.inverse = !1
  11850. }
  11851. ,
  11852. n.MaskPass.prototype = {
  11853. render: function(e, t, i, n) {
  11854. var r = e.context;
  11855. r.colorMask(!1, !1, !1, !1),
  11856. r.depthMask(!1);
  11857. var o, a;
  11858. this.inverse ? (o = 0,
  11859. a = 1) : (o = 1,
  11860. a = 0),
  11861. r.enable(r.STENCIL_TEST),
  11862. r.stencilOp(r.REPLACE, r.REPLACE, r.REPLACE),
  11863. r.stencilFunc(r.ALWAYS, o, 4294967295),
  11864. r.clearStencil(a),
  11865. e.render(this.scene, this.camera, i, this.clear),
  11866. e.render(this.scene, this.camera, t, this.clear),
  11867. r.colorMask(!0, !0, !0, !0),
  11868. r.depthMask(!0),
  11869. r.stencilFunc(r.EQUAL, 1, 4294967295),
  11870. r.stencilOp(r.KEEP, r.KEEP, r.KEEP)
  11871. }
  11872. },
  11873. n.ClearMaskPass = function() {
  11874. this.enabled = !0
  11875. }
  11876. ,
  11877. n.ClearMaskPass.prototype = {
  11878. render: function(e, t, i, n) {
  11879. var r = e.context;
  11880. r.disable(r.STENCIL_TEST)
  11881. }
  11882. }
  11883. }
  11884. , {
  11885. three: 217
  11886. }],
  11887. 98: [function(e, t, i) {
  11888. "use strict";
  11889. var n = e("three");
  11890. n.RenderPass = function(e, t, i, r, o) {
  11891. this.scene = e,
  11892. this.camera = t,
  11893. this.overrideMaterial = i,
  11894. this.clearColor = r,
  11895. this.clearAlpha = void 0 !== o ? o : 1,
  11896. this.oldClearColor = new n.Color,
  11897. this.oldClearAlpha = 1,
  11898. this.enabled = !0,
  11899. this.clear = !0,
  11900. this.needsSwap = !1
  11901. }
  11902. ,
  11903. n.RenderPass.prototype = {
  11904. render: function(e, t, i, n) {
  11905. this.scene.overrideMaterial = this.overrideMaterial,
  11906. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11907. this.oldClearAlpha = e.getClearAlpha(),
  11908. e.setClearColor(this.clearColor, this.clearAlpha)),
  11909. e.render(this.scene, this.camera, i, this.clear),
  11910. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11911. this.scene.overrideMaterial = null
  11912. }
  11913. }
  11914. }
  11915. , {
  11916. three: 217
  11917. }],
  11918. 99: [function(e, t, i) {
  11919. "use strict";
  11920. var n = e("three");
  11921. n.ShaderPass = function(e, t) {
  11922. this.textureID = void 0 !== t ? t : "tDiffuse",
  11923. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11924. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11925. this.material = new n.ShaderMaterial({
  11926. defines: e.defines || {},
  11927. uniforms: this.uniforms,
  11928. vertexShader: e.vertexShader,
  11929. fragmentShader: e.fragmentShader
  11930. })),
  11931. this.renderToScreen = !1,
  11932. this.enabled = !0,
  11933. this.needsSwap = !0,
  11934. this.clear = !1,
  11935. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11936. this.scene = new n.Scene,
  11937. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11938. this.scene.add(this.quad)
  11939. }
  11940. ,
  11941. n.ShaderPass.prototype = {
  11942. render: function(e, t, i, n) {
  11943. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11944. this.quad.material = this.material,
  11945. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11946. }
  11947. }
  11948. }
  11949. , {
  11950. three: 217
  11951. }],
  11952. 100: [function(e, t, i) {
  11953. "use strict";
  11954. var n = e("three");
  11955. n.CopyShader = {
  11956. uniforms: {
  11957. tDiffuse: {
  11958. type: "t",
  11959. value: null
  11960. },
  11961. opacity: {
  11962. type: "f",
  11963. value: 1
  11964. }
  11965. },
  11966. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11967. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11968. }
  11969. }
  11970. , {
  11971. three: 217
  11972. }],
  11973. 101: [function(e, t, i) {
  11974. "use strict";
  11975. var n = e("three");
  11976. n.HorizontalBlurShader = {
  11977. uniforms: {
  11978. tDiffuse: {
  11979. type: "t",
  11980. value: null
  11981. },
  11982. h: {
  11983. type: "f",
  11984. value: 1 / 512
  11985. }
  11986. },
  11987. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11988. fragmentShader: ["uniform sampler2D tDiffuse;", "uniform float h;", "varying vec2 vUv;", "void main() {", "vec4 sum = vec4( 0.0 );", "sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;", "sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;", "sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;", "gl_FragColor = sum;", "}"].join("\n")
  11989. }
  11990. }
  11991. , {
  11992. three: 217
  11993. }],
  11994. 102: [function(e, t, i) {
  11995. "use strict";
  11996. var n = e("three");
  11997. n.VerticalBlurShader = {
  11998. uniforms: {
  11999. tDiffuse: {
  12000. type: "t",
  12001. value: null
  12002. },
  12003. v: {
  12004. type: "f",
  12005. value: 1 / 512
  12006. }
  12007. },
  12008. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12009. fragmentShader: ["uniform sampler2D tDiffuse;", "uniform float v;", "varying vec2 vUv;", "void main() {", "vec4 sum = vec4( 0.0 );", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;", "gl_FragColor = sum;", "}"].join("\n")
  12010. }
  12011. }
  12012. , {
  12013. three: 217
  12014. }],
  12015. 103: [function(e, t, i) {
  12016. "use strict";
  12017. var n = e("three");
  12018. !function() {
  12019. if ("performance"in window == 0 && (window.performance = {}),
  12020. "now"in window.performance == 0) {
  12021. var e = Date.now();
  12022. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  12023. window.performance.now = function() {
  12024. return Date.now() - e
  12025. }
  12026. }
  12027. }(),
  12028. n.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  12029. var t, i = this.extensions, r = this.context;
  12030. if (e === n.RepeatWrapping)
  12031. return r.REPEAT;
  12032. if (e === n.ClampToEdgeWrapping)
  12033. return r.CLAMP_TO_EDGE;
  12034. if (e === n.MirroredRepeatWrapping)
  12035. return r.MIRRORED_REPEAT;
  12036. if (e === n.NearestFilter)
  12037. return r.NEAREST;
  12038. if (e === n.NearestMipMapNearestFilter)
  12039. return r.NEAREST_MIPMAP_NEAREST;
  12040. if (e === n.NearestMipMapLinearFilter)
  12041. return r.NEAREST_MIPMAP_LINEAR;
  12042. if (e === n.LinearFilter)
  12043. return r.LINEAR;
  12044. if (e === n.LinearMipMapNearestFilter)
  12045. return r.LINEAR_MIPMAP_NEAREST;
  12046. if (e === n.LinearMipMapLinearFilter)
  12047. return r.LINEAR_MIPMAP_LINEAR;
  12048. if (e === n.UnsignedByteType)
  12049. return r.UNSIGNED_BYTE;
  12050. if (e === n.UnsignedShort4444Type)
  12051. return r.UNSIGNED_SHORT_4_4_4_4;
  12052. if (e === n.UnsignedShort5551Type)
  12053. return r.UNSIGNED_SHORT_5_5_5_1;
  12054. if (e === n.UnsignedShort565Type)
  12055. return r.UNSIGNED_SHORT_5_6_5;
  12056. if (e === n.ByteType)
  12057. return r.BYTE;
  12058. if (e === n.ShortType)
  12059. return r.SHORT;
  12060. if (e === n.UnsignedShortType)
  12061. return r.UNSIGNED_SHORT;
  12062. if (e === n.IntType)
  12063. return r.INT;
  12064. if (e === n.UnsignedIntType)
  12065. return r.UNSIGNED_INT;
  12066. if (e === n.FloatType)
  12067. return r.FLOAT;
  12068. if (t = i.get("OES_texture_half_float"),
  12069. null !== t && e === n.HalfFloatType)
  12070. return t.HALF_FLOAT_OES;
  12071. if (e === n.AlphaFormat)
  12072. return r.ALPHA;
  12073. if (e === n.RGBFormat)
  12074. return r.RGB;
  12075. if (e === n.RGBAFormat)
  12076. return r.RGBA;
  12077. if (e === n.LuminanceFormat)
  12078. return r.LUMINANCE;
  12079. if (e === n.LuminanceAlphaFormat)
  12080. return r.LUMINANCE_ALPHA;
  12081. if (e === n.AddEquation)
  12082. return r.FUNC_ADD;
  12083. if (e === n.SubtractEquation)
  12084. return r.FUNC_SUBTRACT;
  12085. if (e === n.ReverseSubtractEquation)
  12086. return r.FUNC_REVERSE_SUBTRACT;
  12087. if (e === n.ZeroFactor)
  12088. return r.ZERO;
  12089. if (e === n.OneFactor)
  12090. return r.ONE;
  12091. if (e === n.SrcColorFactor)
  12092. return r.SRC_COLOR;
  12093. if (e === n.OneMinusSrcColorFactor)
  12094. return r.ONE_MINUS_SRC_COLOR;
  12095. if (e === n.SrcAlphaFactor)
  12096. return r.SRC_ALPHA;
  12097. if (e === n.OneMinusSrcAlphaFactor)
  12098. return r.ONE_MINUS_SRC_ALPHA;
  12099. if (e === n.DstAlphaFactor)
  12100. return r.DST_ALPHA;
  12101. if (e === n.OneMinusDstAlphaFactor)
  12102. return r.ONE_MINUS_DST_ALPHA;
  12103. if (e === n.DstColorFactor)
  12104. return r.DST_COLOR;
  12105. if (e === n.OneMinusDstColorFactor)
  12106. return r.ONE_MINUS_DST_COLOR;
  12107. if (e === n.SrcAlphaSaturateFactor)
  12108. return r.SRC_ALPHA_SATURATE;
  12109. if (t = i.get("WEBGL_compressed_texture_s3tc"),
  12110. null !== t) {
  12111. if (e === n.RGB_S3TC_DXT1_Format)
  12112. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  12113. if (e === n.RGBA_S3TC_DXT1_Format)
  12114. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  12115. if (e === n.RGBA_S3TC_DXT3_Format)
  12116. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  12117. if (e === n.RGBA_S3TC_DXT5_Format)
  12118. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  12119. }
  12120. if (t = i.get("WEBGL_compressed_texture_pvrtc"),
  12121. null !== t) {
  12122. if (e === n.RGB_PVRTC_4BPPV1_Format)
  12123. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  12124. if (e === n.RGB_PVRTC_2BPPV1_Format)
  12125. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  12126. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  12127. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  12128. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  12129. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  12130. }
  12131. if (t = i.get("WEBGL_compressed_texture_etc1"),
  12132. null !== t && e === n.RGB_ETC1_Format)
  12133. return t.COMPRESSED_RGB_ETC1_WEBGL;
  12134. if (t = i.get("EXT_blend_minmax"),
  12135. null !== t) {
  12136. if (e === n.MinEquation)
  12137. return t.MIN_EXT;
  12138. if (e === n.MaxEquation)
  12139. return t.MAX_EXT
  12140. }
  12141. return 0
  12142. }
  12143. ,
  12144. n.WebGLState = function(e, t, i) {
  12145. var r = this
  12146. , o = new n.Vector4
  12147. , a = e.getParameter(e.MAX_VERTEX_ATTRIBS)
  12148. , s = new Uint8Array(a)
  12149. , l = new Uint8Array(a)
  12150. , c = new Uint8Array(a)
  12151. , h = {}
  12152. , u = null
  12153. , d = null
  12154. , p = null
  12155. , f = null
  12156. , g = null
  12157. , m = null
  12158. , v = null
  12159. , A = null
  12160. , y = !1
  12161. , C = null
  12162. , I = null
  12163. , E = null
  12164. , b = null
  12165. , w = null
  12166. , _ = null
  12167. , T = null
  12168. , x = null
  12169. , S = null
  12170. , M = null
  12171. , R = null
  12172. , P = null
  12173. , O = null
  12174. , L = null
  12175. , D = null
  12176. , N = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  12177. , B = void 0
  12178. , F = {}
  12179. , V = new n.Vector4
  12180. , U = null
  12181. , k = null
  12182. , H = new n.Vector4
  12183. , G = new n.Vector4;
  12184. this.init = function() {
  12185. this.clearColor(0, 0, 0, 1),
  12186. this.clearDepth(1),
  12187. this.clearStencil(0),
  12188. this.enable(e.DEPTH_TEST),
  12189. e.depthFunc(e.LEQUAL),
  12190. e.frontFace(e.CCW),
  12191. e.cullFace(e.BACK),
  12192. this.enable(e.CULL_FACE),
  12193. this.enable(e.BLEND),
  12194. e.blendEquation(e.FUNC_ADD),
  12195. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  12196. }
  12197. ,
  12198. this.initAttributes = function() {
  12199. for (var e = 0, t = s.length; e < t; e++)
  12200. s[e] = 0
  12201. }
  12202. ,
  12203. this.enableAttribute = function(i) {
  12204. if (s[i] = 1,
  12205. 0 === l[i] && (e.enableVertexAttribArray(i),
  12206. l[i] = 1),
  12207. 0 !== c[i]) {
  12208. var n = t.get("ANGLE_instanced_arrays");
  12209. n.vertexAttribDivisorANGLE(i, 0),
  12210. c[i] = 0
  12211. }
  12212. }
  12213. ,
  12214. this.enableAttributeAndDivisor = function(t, i, n) {
  12215. s[t] = 1,
  12216. 0 === l[t] && (e.enableVertexAttribArray(t),
  12217. l[t] = 1),
  12218. c[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  12219. c[t] = i)
  12220. }
  12221. ,
  12222. this.disableUnusedAttributes = function() {
  12223. for (var t = 0, i = l.length; t < i; t++)
  12224. l[t] !== s[t] && (e.disableVertexAttribArray(t),
  12225. l[t] = 0)
  12226. }
  12227. ,
  12228. this.enable = function(t) {
  12229. h[t] !== !0 && (e.enable(t),
  12230. h[t] = !0)
  12231. }
  12232. ,
  12233. this.disable = function(t) {
  12234. h[t] !== !1 && (e.disable(t),
  12235. h[t] = !1)
  12236. }
  12237. ,
  12238. this.getCompressedTextureFormats = function() {
  12239. if (null === u && (u = [],
  12240. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  12241. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  12242. u.push(i[n]);
  12243. return u
  12244. }
  12245. ,
  12246. this.setBlending = function(t, r, o, a, s, l, c, h) {
  12247. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  12248. t === d && h === y || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12249. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  12250. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12251. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12252. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12253. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12254. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12255. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12256. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  12257. d = t,
  12258. y = h),
  12259. t === n.CustomBlending ? (s = s || r,
  12260. l = l || o,
  12261. c = c || a,
  12262. r === p && s === m || (e.blendEquationSeparate(i(r), i(s)),
  12263. p = r,
  12264. m = s),
  12265. o === f && a === g && l === v && c === A || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  12266. f = o,
  12267. g = a,
  12268. v = l,
  12269. A = c)) : (p = null,
  12270. f = null,
  12271. g = null,
  12272. m = null,
  12273. v = null,
  12274. A = null)
  12275. }
  12276. ,
  12277. this.setDepthFunc = function(t) {
  12278. if (C !== t) {
  12279. if (t)
  12280. switch (t) {
  12281. case n.NeverDepth:
  12282. e.depthFunc(e.NEVER);
  12283. break;
  12284. case n.AlwaysDepth:
  12285. e.depthFunc(e.ALWAYS);
  12286. break;
  12287. case n.LessDepth:
  12288. e.depthFunc(e.LESS);
  12289. break;
  12290. case n.LessEqualDepth:
  12291. e.depthFunc(e.LEQUAL);
  12292. break;
  12293. case n.EqualDepth:
  12294. e.depthFunc(e.EQUAL);
  12295. break;
  12296. case n.GreaterEqualDepth:
  12297. e.depthFunc(e.GEQUAL);
  12298. break;
  12299. case n.GreaterDepth:
  12300. e.depthFunc(e.GREATER);
  12301. break;
  12302. case n.NotEqualDepth:
  12303. e.depthFunc(e.NOTEQUAL);
  12304. break;
  12305. default:
  12306. e.depthFunc(e.LEQUAL)
  12307. }
  12308. else
  12309. e.depthFunc(e.LEQUAL);
  12310. C = t
  12311. }
  12312. }
  12313. ,
  12314. this.setDepthTest = function(t) {
  12315. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  12316. }
  12317. ,
  12318. this.setDepthWrite = function(t) {
  12319. I !== t && (e.depthMask(t),
  12320. I = t)
  12321. }
  12322. ,
  12323. this.setColorWrite = function(t) {
  12324. E !== t && (e.colorMask(t, t, t, t),
  12325. E = t)
  12326. }
  12327. ,
  12328. this.setStencilFunc = function(t, i, n) {
  12329. w === t && _ === i && T === n || (e.stencilFunc(t, i, n),
  12330. w = t,
  12331. _ = i,
  12332. T = n)
  12333. }
  12334. ,
  12335. this.setStencilOp = function(t, i, n) {
  12336. x === t && S === i && M === n || (e.stencilOp(t, i, n),
  12337. x = t,
  12338. S = i,
  12339. M = n)
  12340. }
  12341. ,
  12342. this.setStencilTest = function(t) {
  12343. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  12344. }
  12345. ,
  12346. this.setStencilWrite = function(t) {
  12347. b !== t && (e.stencilMask(t),
  12348. b = t)
  12349. }
  12350. ,
  12351. this.setFlipSided = function(t) {
  12352. R !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  12353. R = t)
  12354. }
  12355. ,
  12356. this.setLineWidth = function(t) {
  12357. t !== P && (e.lineWidth(t),
  12358. P = t)
  12359. }
  12360. ,
  12361. this.setPolygonOffset = function(t, i, n) {
  12362. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  12363. !t || O === i && L === n || (e.polygonOffset(i, n),
  12364. O = i,
  12365. L = n)
  12366. }
  12367. ,
  12368. this.getScissorTest = function() {
  12369. return D
  12370. }
  12371. ,
  12372. this.setScissorTest = function(t) {
  12373. D = t,
  12374. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  12375. }
  12376. ,
  12377. this.activeTexture = function(t) {
  12378. void 0 === t && (t = e.TEXTURE0 + N - 1),
  12379. B !== t && (e.activeTexture(t),
  12380. B = t)
  12381. }
  12382. ,
  12383. this.bindTexture = function(t, i) {
  12384. void 0 === B && r.activeTexture();
  12385. var n = F[B];
  12386. void 0 === n && (n = {
  12387. type: void 0,
  12388. texture: void 0
  12389. },
  12390. F[B] = n),
  12391. n.type === t && n.texture === i || (e.bindTexture(t, i),
  12392. n.type = t,
  12393. n.texture = i)
  12394. }
  12395. ,
  12396. this.compressedTexImage2D = function() {
  12397. try {
  12398. e.compressedTexImage2D.apply(e, arguments)
  12399. } catch (e) {
  12400. console.error(e)
  12401. }
  12402. }
  12403. ,
  12404. this.texImage2D = function() {
  12405. try {
  12406. e.texImage2D.apply(e, arguments)
  12407. } catch (e) {
  12408. console.error(e)
  12409. }
  12410. }
  12411. ,
  12412. this.clearColor = function(t, i, n, r) {
  12413. o.set(t, i, n, r),
  12414. V.equals(o) === !1 && (e.clearColor(t, i, n, r),
  12415. V.copy(o))
  12416. }
  12417. ,
  12418. this.clearDepth = function(t) {
  12419. U !== t && (e.clearDepth(t),
  12420. U = t)
  12421. }
  12422. ,
  12423. this.clearStencil = function(t) {
  12424. k !== t && (e.clearStencil(t),
  12425. k = t)
  12426. }
  12427. ,
  12428. this.scissor = function(t) {
  12429. H.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  12430. H.copy(t))
  12431. }
  12432. ,
  12433. this.viewport = function(t) {
  12434. G.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  12435. G.copy(t))
  12436. }
  12437. ,
  12438. this.reset = function() {
  12439. for (var t = 0; t < l.length; t++)
  12440. 1 === l[t] && (e.disableVertexAttribArray(t),
  12441. l[t] = 0);
  12442. h = {},
  12443. u = null,
  12444. B = void 0,
  12445. F = {},
  12446. d = null,
  12447. E = null,
  12448. I = null,
  12449. b = null,
  12450. R = null
  12451. }
  12452. }
  12453. }
  12454. , {
  12455. three: 217
  12456. }],
  12457. 104: [function(e, t, i) {
  12458. (function(i, n) {
  12459. "use strict";
  12460. function r(e) {
  12461. this.urls = e;
  12462. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12463. this.builder = a.loadProto(t),
  12464. this.decoder = this.builder.build("binary_mesh")
  12465. }
  12466. var o = e("three")
  12467. , a = e("protobufjs")
  12468. , s = e("../util/logger")
  12469. , l = (e("../util/common"),
  12470. e("../util/ajax"))
  12471. , c = e("../objects/Chunk")
  12472. , h = new s(n);
  12473. r.prototype = {
  12474. constructor: r,
  12475. load: function(e, t, i, n) {
  12476. return h.time("download"),
  12477. l.get(e, {
  12478. responseType: "arraybuffer"
  12479. }).done(function(r) {
  12480. h.timeEnd("download"),
  12481. this.parse(r, e, t, i, n)
  12482. }
  12483. .bind(this)).fail(n)
  12484. },
  12485. parse: function(e, t, i, n, r) {
  12486. var o = this.readProtobuf(e);
  12487. if (!o)
  12488. return r();
  12489. try {
  12490. h.time("convert to webgl"),
  12491. this.convertProtobufToSceneObject(o, t, i, n, r),
  12492. h.timeEnd("convert to webgl")
  12493. } catch (e) {
  12494. return h.error("failed parsing .dam"),
  12495. h.error(e.message),
  12496. r()
  12497. }
  12498. },
  12499. readProtobuf: function(e) {
  12500. var t;
  12501. try {
  12502. h.time("parse proto"),
  12503. t = this.decoder.decode(e),
  12504. h.timeEnd("parse proto")
  12505. } catch (e) {
  12506. return h.error("failed parsing proto for .dam"),
  12507. h.error(e.message),
  12508. null
  12509. }
  12510. return t
  12511. },
  12512. convertProtobufToSceneObject: function(e, t, i, n, r) {
  12513. function a(e) {
  12514. var i = new o.BufferGeometry;
  12515. return i.addAttribute("position", new o.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12516. e.vertices.uv.length > 0 && i.addAttribute("uv", new o.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12517. i.setIndex(new o.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12518. i.applyMatrix(s),
  12519. i.computeBoundingBox(),
  12520. new c({
  12521. geometry: i,
  12522. textureName: e.material_name,
  12523. name: e.chunk_name,
  12524. meshUrl: t
  12525. })
  12526. }
  12527. if (0 === e.chunk.length)
  12528. return h.warn("No chunks in damfile..."),
  12529. i([]);
  12530. var s = new o.Matrix4;
  12531. s.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12532. var l = e.chunk.map(a);
  12533. return l ? i(l) : (h.error(".dam protobuf came out with no chunks..."),
  12534. r())
  12535. }
  12536. },
  12537. t.exports = r
  12538. }
  12539. ).call(this, e("buffer").Buffer, "/js/loaders/DamLoader.js")
  12540. }
  12541. , {
  12542. "../objects/Chunk": 144,
  12543. "../util/ajax": 181,
  12544. "../util/common": 185,
  12545. "../util/logger": 189,
  12546. buffer: 198,
  12547. protobufjs: 214,
  12548. three: 217
  12549. }],
  12550. 105: [function(e, t, i) {
  12551. (function(i) {
  12552. "use strict";
  12553. var n = (e("three"),
  12554. e("../settings"),
  12555. e("../util/browser"),
  12556. e("./DamLoader"))
  12557. , r = e("../util/logger")
  12558. , o = (e("../ab"),
  12559. new r(i));
  12560. t.exports = {
  12561. getLoaders: function() {
  12562. return [["_50k", ".dam", n], ["", ".dam", n]]
  12563. },
  12564. load: function(e, t, i, n, r, a) {
  12565. var s = this.getLoaders();
  12566. a = a || 0;
  12567. var l = s[a];
  12568. if (!l)
  12569. return void (r && r("No suitable model file found..."));
  12570. var c = l[0]
  12571. , h = l[1]
  12572. , u = new l[2](t)
  12573. , d = t.get(e + c + h);
  12574. d ? (o.debug("Trying " + c + h),
  12575. u.load(d, i, n, function() {
  12576. this.load(e, t, i, n, r, ++a)
  12577. }
  12578. .bind(this))) : (o.debug("Skipping " + h + ", not available"),
  12579. this.load(e, t, i, n, r, ++a))
  12580. }
  12581. }
  12582. }
  12583. ).call(this, "/js/loaders/ModelLoader.js")
  12584. }
  12585. , {
  12586. "../ab": 3,
  12587. "../settings": 166,
  12588. "../util/browser": 182,
  12589. "../util/logger": 189,
  12590. "./DamLoader": 104,
  12591. three: 217
  12592. }],
  12593. 106: [function(e, t, i) {
  12594. (function(i) {
  12595. "use strict";
  12596. var n = e("../util/common")
  12597. , r = e("../util/texture")
  12598. , o = e("../util/browser")
  12599. , a = e("../util/logger")
  12600. , s = e("../settings")
  12601. , l = new a(i);
  12602. t.exports = {
  12603. load: function(e, t) {
  12604. function i(e, i) {
  12605. e || (t.push(i),
  12606. p++,
  12607. d.notify(p, a),
  12608. p === a && d.resolve())
  12609. }
  12610. if (!e.chunks[0] || !e.chunks[0].meshUrl)
  12611. return $.when();
  12612. var a = n.countUnique(e.chunks.map(function(e) {
  12613. return e.textureName
  12614. }))
  12615. , c = e.chunks[0].meshUrl.indexOf("_50k") !== -1 ? "_50k" : ""
  12616. , h = "_50k" === c ? "high" : "low";
  12617. s.minimalMemoryMode && "high" === h && (o.detectSamsungS6() ? (l.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12618. h = "low") : a > s.maxMobileTextures && (l.warn("Model probably too large for mobile, turning down quality."),
  12619. h = "low"));
  12620. var u = e.data.job.uuid + c + "_texture_jpg_" + h + "/"
  12621. , d = $.Deferred()
  12622. , p = 0;
  12623. return e.chunks.forEach(function(t) {
  12624. if (!t.material.map && t.textureName) {
  12625. var n = e.urls.get(u + t.textureName);
  12626. t.setTextureMap(r.load(n, i.bind(this, r.isLoaded(n))))
  12627. }
  12628. }),
  12629. d.promise()
  12630. }
  12631. }
  12632. }
  12633. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12634. }
  12635. , {
  12636. "../settings": 166,
  12637. "../util/browser": 182,
  12638. "../util/common": 185,
  12639. "../util/logger": 189,
  12640. "../util/texture": 194
  12641. }],
  12642. 107: [function(e, t, i) {
  12643. (function(i, n) {
  12644. "use strict";
  12645. function r(e) {
  12646. this.model = e,
  12647. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  12648. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12649. var t = i("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12650. , n = o.loadProto(t);
  12651. this.decoder = n.build("VisionModeldata")
  12652. }
  12653. var o = e("protobufjs")
  12654. , a = e("../util/ajax")
  12655. , s = (e("../util/common"),
  12656. e("../util/math"))
  12657. , l = e("../util/logger")
  12658. , c = new l(n);
  12659. r.prototype.load = function() {
  12660. return this.modelDataPath ? (c.info("Using vision.modeldata"),
  12661. this.loadVisionModelData()) : this.sweepLocationsPath ? (c.warn("Using sweep_locations.csv"),
  12662. this.loadSweepLocationsCSV()) : (c.warn("No sweep file found"),
  12663. $.when([]))
  12664. }
  12665. ,
  12666. r.prototype.loadVisionModelData = function() {
  12667. return a.get(this.modelDataPath, {
  12668. responseType: "arraybuffer"
  12669. }).then(function(e) {
  12670. var t;
  12671. try {
  12672. t = this.decoder.decode(e)
  12673. } catch (e) {
  12674. return c.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12675. this.loadSweepLocationsCSV()
  12676. }
  12677. var i = t.sweepLocations.map(function(e) {
  12678. return {
  12679. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12680. position: {
  12681. x: e.pose.translation.x,
  12682. y: e.pose.translation.y,
  12683. z: e.pose.translation.z
  12684. },
  12685. quaternion: {
  12686. x: e.pose.rotation.x,
  12687. y: e.pose.rotation.y,
  12688. z: e.pose.rotation.z,
  12689. w: e.pose.rotation.w
  12690. },
  12691. puck: {
  12692. x: e.puck.x,
  12693. y: e.puck.y,
  12694. z: e.puck.z
  12695. },
  12696. floor: e.group,
  12697. neighbours: e.visibles,
  12698. alignmentType: e.alignment_type
  12699. }
  12700. }).map(function(e) {
  12701. return e.position = s.convertVisionVector(e.position),
  12702. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  12703. e.puck = s.convertVisionVector(e.puck),
  12704. e
  12705. });
  12706. return i.forEach(function(e) {
  12707. e.neighbours = e.neighbours.map(function(e) {
  12708. return i[e].uuid
  12709. })
  12710. }),
  12711. i
  12712. }
  12713. .bind(this), function() {
  12714. return c.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12715. this.loadSweepLocationsCSV()
  12716. }
  12717. .bind(this))
  12718. }
  12719. ,
  12720. r.prototype.loadSweepLocationsCSV = function() {
  12721. return a.get(this.sweepLocationsPath).then(function(e) {
  12722. var t = e.split("\n").map(function(e) {
  12723. return e.split(", ")
  12724. }).filter(function(e) {
  12725. return e.length > 1
  12726. }).map(function(e) {
  12727. return {
  12728. uuid: e[0],
  12729. position: {
  12730. x: parseFloat(e[1]),
  12731. y: parseFloat(e[2]),
  12732. z: parseFloat(e[3])
  12733. },
  12734. quaternion: {
  12735. x: parseFloat(e[4]),
  12736. y: parseFloat(e[5]),
  12737. z: parseFloat(e[6]),
  12738. w: parseFloat(e[7])
  12739. }
  12740. }
  12741. }).map(function(e) {
  12742. return e.position = s.convertVisionVector(e.position),
  12743. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  12744. e
  12745. });
  12746. return t
  12747. }).fail(function() {
  12748. c.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12749. })
  12750. }
  12751. ,
  12752. t.exports = r
  12753. }
  12754. ).call(this, e("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12755. }
  12756. , {
  12757. "../util/ajax": 181,
  12758. "../util/common": 185,
  12759. "../util/logger": 189,
  12760. "../util/math": 190,
  12761. buffer: 198,
  12762. protobufjs: 214
  12763. }],
  12764. 108: [function(e, t, i) {
  12765. (function(i) {
  12766. "use strict";
  12767. function n() {
  12768. this.locale = null
  12769. }
  12770. var r = e("../settings")
  12771. , o = e("../util/common")
  12772. , a = e("../util/logger")
  12773. , s = e("../enum/Locale")
  12774. , l = new a(i);
  12775. n.prototype.init = function() {
  12776. var t;
  12777. switch (r.languageTag) {
  12778. case null:
  12779. case "en":
  12780. case s.EN_US:
  12781. this.locale = s.EN_US,
  12782. t = e("./strings-en-US");
  12783. break;
  12784. case "es":
  12785. case s.ES_MX:
  12786. this.locale = s.ES_MX,
  12787. t = e("./strings-es-MX");
  12788. break;
  12789. case "fr":
  12790. case s.FR_FR:
  12791. this.locale = s.FR_FR,
  12792. t = e("./strings-fr-FR");
  12793. break;
  12794. case "de":
  12795. case s.DE_DE:
  12796. this.locale = s.DE_DE,
  12797. t = e("./strings-de-DE");
  12798. break;
  12799. case "ru":
  12800. case s.RU_RU:
  12801. this.locale = s.RU_RU,
  12802. t = e("./strings-ru-RU");
  12803. break;
  12804. case "cn":
  12805. case s.CN_CN:
  12806. this.locale = s.CN_CN,
  12807. t = e("./strings-cn-CN");
  12808. break;
  12809. case "jp":
  12810. case s.JP_JP:
  12811. this.locale = s.JP_JP,
  12812. t = e("./strings-jp-JP");
  12813. break;
  12814. default:
  12815. l.info("Unsupported language tag, defaulting to 'en-US'"),
  12816. this.locale = s.EN_US,
  12817. t = e("./strings-en-US")
  12818. }
  12819. l.info("Using locale '" + this.locale + "'"),
  12820. o.extendObject(this, t)
  12821. }
  12822. ,
  12823. n.prototype.localizeGUI = function() {
  12824. var e = document.querySelector("#gui-parent");
  12825. this.localizeTree(e),
  12826. this.localizeLoadingText()
  12827. }
  12828. ,
  12829. n.prototype.localizeLoadingText = function() {
  12830. // var e = document.querySelector("#loader-cont")
  12831. // , t = e.getAttribute("title");
  12832. // e.removeAttribute("title"),
  12833. // e.setAttribute("data-status", t),
  12834. // e.classList.add(this.locale),
  12835. document.querySelector("#help-dialog").classList.add(this.locale),
  12836. document.querySelector("#interaction-modal").classList.add(this.locale),
  12837. document.querySelector("#gui").classList.add(this.locale);
  12838. }
  12839. ,
  12840. n.prototype.localizeTree = function(e) {
  12841. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12842. if (e.nodeType === Node.TEXT_NODE)
  12843. t = e.data.match(n),
  12844. t && (i = t[1],
  12845. e.data = this.localizeText(i) || i);
  12846. else if (e.nodeType === Node.ELEMENT_NODE) {
  12847. var r = e.getAttribute("title");
  12848. r && (t = r.match(n),
  12849. t && (i = t[1],
  12850. e.setAttribute("title", this.localizeText(i) || i)))
  12851. }
  12852. for (e = e.firstChild; e; )
  12853. this.localizeTree(e),
  12854. e = e.nextSibling
  12855. }
  12856. ,
  12857. n.prototype.localizeText = function(t) {
  12858. var i = this[t];
  12859. return i || this.locale === s.EN_US || (l.warn("Localization key '" + t + "' not available for locale '" + this.locale + "', defaulting to English."),
  12860. i = e("./strings-en-US")[t]),
  12861. i || l.warn("Localization key '" + t + "' not available for locale 'en-US'"),
  12862. i
  12863. }
  12864. ,
  12865. t.exports = new n
  12866. }
  12867. ).call(this, "/js/localization/localize.js")
  12868. }
  12869. , {
  12870. "../enum/Locale": 31,
  12871. "../settings": 166,
  12872. "../util/common": 185,
  12873. "../util/logger": 189,
  12874. "./strings-cn-CN": 109,
  12875. "./strings-de-DE": 110,
  12876. "./strings-en-US": 111,
  12877. "./strings-es-MX": 112,
  12878. "./strings-fr-FR": 113,
  12879. "./strings-jp-JP": 114,
  12880. "./strings-ru-RU": 115
  12881. }],
  12882. 109: [function(e, t, i) {
  12883. "use strict";
  12884. t.exports = {
  12885. PAGE_TITLE: "",
  12886. LOADING: "正在加载",
  12887. PRESENTED_BY_CAPS: "呈现者:",
  12888. POWERED_BY: "技术支持:",
  12889. POWERED_BY_CAPS: "技术支持:",
  12890. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12891. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12892. PRESENTED_BY: "呈现者:",
  12893. MORE: "更多 ",
  12894. LESS: "更少 ",
  12895. TAG_CONTENT: "tag™ 内容",
  12896. SHOW: "显示",
  12897. HIDE: "隐藏",
  12898. DOLLHOUSE: "场景屋",
  12899. FLOOR_PLAN: "楼层平面图",
  12900. OPEN_HIGHLIGHTS: "打开精彩片段",
  12901. CLOSE_HIGHLIGHTS: "关闭",
  12902. PREVIOUS: "上一个",
  12903. PLAY: "播放",
  12904. PAUSE: "暂停",
  12905. NEXT: "下一个",
  12906. EXPLORE_3D_SPACE: "探索 3D 空间",
  12907. VIEW_DOLLHOUSE: "观看场景屋",
  12908. SOCIAL_SHARING: "分享这个空间",
  12909. VIEW_IN_VR: "以 VR 观看",
  12910. VIEW_FULLSCREEN: "全屏观看",
  12911. EXIT_FULLSCREEN: " 退出全屏",
  12912. ZOOM_IN: "放大",
  12913. ZOOM_OUT: "缩小",
  12914. FLOOR_NAME: "楼层",
  12915. FLOOR_ALL: "ALL",
  12916. FLOOR_Lang: ["Floor",""],
  12917. TERMS: "条款",
  12918. PORT_TERMS: "port 条款",
  12919. TERMS_OF_USE: "使用条款",
  12920. CLOSE_TERMS: "关闭",
  12921. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12922. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12923. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12924. WEBVR_ENTER_WEBVR: "进入 VR",
  12925. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12926. WEBVR_LEARN_MORE: "了解更多",
  12927. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12928. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12929. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12930. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12931. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12932. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12933. VR_LEARN_MORE_CAPS: "了解更多",
  12934. VR_PREVIOUS_CAPS: "上一个’,",
  12935. VR_NEXT_CAPS: "下一个",
  12936. VR_GOT_IT_CAPS: "明白了",
  12937. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12938. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12939. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12940. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12941. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12942. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12943. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12944. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12945. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12946. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12947. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12948. VR_APP: "port VR 应用程序",
  12949. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12950. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12951. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12952. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12953. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12954. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12955. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12956. VR_ANDROID_DVICES: "Android 设备",
  12957. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12958. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12959. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12960. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12961. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12962. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12963. VR_DOWNLOAD_HERE: "在此下载",
  12964. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12965. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12966. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12967. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12968. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12969. SHARE_TO: "分享到",
  12970. SHARE_LINK: "直接链接",
  12971. SHARE_EXPLORE: "探索",
  12972. SHARE_AT: "在",
  12973. SHARE_WITH: "使用",
  12974. SHARE_3D: "以 3D",
  12975. SHARE_COPIED: "已复制!",
  12976. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12977. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12978. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12979. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12980. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12981. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12982. ERROR_GENERIC_ACTIONS_3: " 或",
  12983. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12984. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12985. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12986. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12987. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12988. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12989. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12990. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12991. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12992. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  12993. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  12994. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  12995. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  12996. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  12997. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  12998. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  12999. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  13000. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  13001. LINK_TO_LOCATION: "地点链接",
  13002. MENU_COPY: "复制",
  13003. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  13004. ROTATE: "旋转",
  13005. MOVE: "移动",
  13006. INSIDE: "内部",
  13007. ZOOM: "缩放",
  13008. HELP: "小帮手",
  13009. HELP_NAVIGATION_TAB: "导航",
  13010. HELP_MORE_HELP_TAB: "更多帮助",
  13011. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  13012. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  13013. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  13014. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  13015. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  13016. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  13017. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  13018. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  13019. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  13020. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  13021. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  13022. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  13023. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  13024. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  13025. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  13026. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  13027. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  13028. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  13029. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  13030. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  13031. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  13032. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  13033. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  13034. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  13035. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  13036. HELP_MORE_HLR_A: "精彩片段集锦",
  13037. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  13038. HELP_MORE_DOLLHOUSE_A: "场景屋",
  13039. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  13040. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  13041. HELP_MORE_FLOORS_A: "楼层选择器",
  13042. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  13043. HELP_MORE_TAG_A: "tag™ 贴文",
  13044. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  13045. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  13046. HELP_MORE_ZOOM_A: "缩放控件",
  13047. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  13048. HELP_MORE_TOUR_A: "导览控件",
  13049. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  13050. HELP_MORE_INSIDE_A: "内部视图",
  13051. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  13052. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  13053. HELP_MORE_VR_A: "VR 模式",
  13054. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  13055. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  13056. HELP_MORE_360_A: "360° 视图",
  13057. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  13058. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  13059. HELP_MORE_FULLSCREEN_A: "全屏",
  13060. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  13061. CLOSE: "关闭"
  13062. }
  13063. }
  13064. , {}],
  13065. 110: [function(e, t, i) {
  13066. "use strict";
  13067. t.exports = {
  13068. PAGE_TITLE: "",
  13069. LOADING: "Lädt",
  13070. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  13071. POWERED_BY: "Angetrieben von",
  13072. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  13073. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13074. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13075. PRESENTED_BY: "Präsentiert von ",
  13076. MORE: "Mehr ",
  13077. LESS: "Weniger ",
  13078. TAG_CONTENT: "tag™ Inhalt",
  13079. SHOW: "Anzeigen",
  13080. HIDE: "Verbergen",
  13081. DOLLHOUSE: "Puppenhaus",
  13082. FLOOR_PLAN: "Grundriss",
  13083. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  13084. CLOSE_HIGHLIGHTS: "Schließen",
  13085. PREVIOUS: "Vorheriges",
  13086. PLAY: "Abspielen",
  13087. PAUSE: "Pausieren",
  13088. NEXT: "Nächstes",
  13089. EXPLORE_3D_SPACE: "Innenraum betreten",
  13090. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  13091. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  13092. VIEW_IN_VR: "In VR ansehen",
  13093. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  13094. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  13095. ZOOM_IN: "Vergrößern",
  13096. ZOOM_OUT: "Verkleinern",
  13097. FLOOR_NAME: "Etage ",
  13098. FLOOR_ALL: "Alle",
  13099. TERMS: "Bedingungen",
  13100. PORT_TERMS: "port Bedingungen",
  13101. TERMS_OF_USE: "Nutzungsbedingungen",
  13102. TERMS_TEXT_FILE: "terms-de-DE.html",
  13103. CLOSE_TERMS: "Schließen",
  13104. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  13105. HELP: "Hilfe",
  13106. HELP_NAVIGATION_TAB: "Navigation",
  13107. HELP_MORE_HELP_TAB: "Hilfe-Details",
  13108. CLOSE: "Schließen",
  13109. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  13110. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  13111. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13112. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  13113. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  13114. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  13115. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  13116. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  13117. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  13118. HELP_DESKTOP_DOLLHOUSE_2A: "Klicken mit der rechten Maustaste und ziehen Sie nach links, rechts, oben und unten um die Position des Puppenhauses zu ändern.",
  13119. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13120. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  13121. HELP_DESKTOP_FLOORPLAN_1A: "Klicken mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um die Position des Grundrisses auf zu ändern.",
  13122. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  13123. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13124. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  13125. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  13126. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  13127. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  13128. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  13129. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  13130. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  13131. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  13132. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  13133. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  13134. HELP_MORE_HLR_A: "Liste das Highlight",
  13135. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  13136. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  13137. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13138. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13139. HELP_MORE_FLOORS_A: "Etage auswählen",
  13140. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  13141. HELP_MORE_TAG_A: "tag™ Posts",
  13142. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  13143. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  13144. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  13145. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  13146. HELP_MORE_TOUR_A: "Tour Steuerung",
  13147. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  13148. HELP_MORE_INSIDE_A: "Innenansicht",
  13149. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  13150. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  13151. HELP_MORE_VR_A: "VR Modus",
  13152. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  13153. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  13154. HELP_MORE_360_A: "360° Views Ansicht ",
  13155. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13156. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13157. HELP_MORE_FULLSCREEN_A: "Vollbild",
  13158. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  13159. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  13160. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  13161. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  13162. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  13163. WEBVR_LEARN_MORE: "Mehr Infos",
  13164. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13165. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13166. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13167. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  13168. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  13169. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13170. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13171. VR_APP: "port VR App",
  13172. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  13173. VR_COMPATIBLE_ANDROID_LONG: "Kompatibles Android Gerät mit Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13174. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  13175. VR_APP_FOR_ANDROID: "port VR app für Android",
  13176. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  13177. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13178. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  13179. VR_PREVIOUS_CAPS: "ZURÜCK",
  13180. VR_NEXT_CAPS: "WEITER",
  13181. VR_GOT_IT_CAPS: "VERSTANDEN",
  13182. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  13183. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  13184. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  13185. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  13186. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  13187. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  13188. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13189. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13190. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13191. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  13192. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  13193. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  13194. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13195. VR_ANDROID_DVICES: "Android Geräte",
  13196. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  13197. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  13198. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  13199. VR_DOWNLOAD_HERE: "Hier runterladen",
  13200. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  13201. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  13202. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  13203. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  13204. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  13205. SHARE_TO: "Teilen auf",
  13206. SHARE_LINK: "Direkter Link",
  13207. SHARE_EXPLORE: "Umsehen",
  13208. SHARE_AT: "auf",
  13209. SHARE_WITH: "mit",
  13210. SHARE_3D: "in 3D",
  13211. SHARE_COPIED: "Kopiert!",
  13212. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  13213. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  13214. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  13215. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  13216. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13217. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  13218. ERROR_GENERIC_ACTIONS_3: " oder ",
  13219. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13220. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  13221. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  13222. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  13223. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  13224. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  13225. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  13226. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  13227. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  13228. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  13229. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  13230. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  13231. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  13232. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  13233. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13234. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13235. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  13236. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  13237. LINK_TO_LOCATION: "Link zu",
  13238. MENU_COPY: "Kopieren",
  13239. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  13240. ROTATE: "Drehen",
  13241. INSIDE: "Drinnen",
  13242. MOVE: "Bewegen",
  13243. ZOOM: "Vergrößern"
  13244. }
  13245. }
  13246. , {}],
  13247. 111: [function(e, t, i) {
  13248. "use strict";
  13249. t.exports = {
  13250. PAGE_TITLE: "",
  13251. LOADING: "Loading",
  13252. PRESENTED_BY_CAPS: "PRESENTED BY",
  13253. POWERED_BY: "powered by ",
  13254. POWERED_BY_CAPS: "POWERED BY",
  13255. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  13256. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  13257. PRESENTED_BY: "Presented by ",
  13258. MORE: "More ",
  13259. LESS: "Less ",
  13260. TAG_CONTENT: "tag™ Content",
  13261. SHOW: "Show",
  13262. HIDE: "Hide",
  13263. DOLLHOUSE: "Dollhouse",
  13264. FLOOR_PLAN: "Floor plan",
  13265. OPEN_HIGHLIGHTS: "Open Highlights",
  13266. CLOSE_HIGHLIGHTS: "Close",
  13267. PREVIOUS: "Previous",
  13268. PLAY: "Play",
  13269. PAUSE: "Pause",
  13270. NEXT: "Next",
  13271. EXPLORE_3D_SPACE: "Explore 3D Space",
  13272. VIEW_DOLLHOUSE: "View dollhouse",
  13273. SOCIAL_SHARING: "Share this Space",
  13274. VIEW_IN_VR: "View in VR",
  13275. VIEW_FULLSCREEN: "全屏",
  13276. EXIT_FULLSCREEN: "退出全屏",
  13277. ZOOM_IN: "Zoom in",
  13278. ZOOM_OUT: "Zoom out",
  13279. FLOOR_NAME: "Floor ",
  13280. FLOOR_ALL: "全部",
  13281. TERMS: "Terms",
  13282. PORT_TERMS: "port terms",
  13283. TERMS_OF_USE: "Terms of Use",
  13284. TERMS_TEXT_FILE: "terms-en-US.html",
  13285. CLOSE_TERMS: "Close",
  13286. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13287. HELP: "Help",
  13288. HELP_NAVIGATION_TAB: "Navigation",
  13289. HELP_MORE_HELP_TAB: "More Help",
  13290. CLOSE: "Close",
  13291. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13292. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13293. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13294. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13295. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13296. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13297. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13298. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13299. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13300. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13301. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13302. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13303. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13304. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13305. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13306. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13307. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13308. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13309. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13310. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13311. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13312. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13313. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13314. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13315. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13316. HELP_MORE_HLR_A: "Highlight Reel",
  13317. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13318. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13319. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13320. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13321. HELP_MORE_FLOORS_A: "Floor Selector",
  13322. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13323. HELP_MORE_TAG_A: "tag™ Posts",
  13324. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13325. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13326. HELP_MORE_ZOOM_A: "Zoom Controls",
  13327. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13328. HELP_MORE_TOUR_A: "Tour Controls",
  13329. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13330. HELP_MORE_INSIDE_A: "Inside View",
  13331. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13332. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13333. HELP_MORE_VR_A: "VR Mode",
  13334. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13335. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13336. HELP_MORE_360_A: "360° Views",
  13337. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13338. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13339. HELP_MORE_FULLSCREEN_A: "Full screen",
  13340. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13341. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13342. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13343. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13344. WEBVR_ENTER_WEBVR: "ENTER VR",
  13345. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13346. WEBVR_LEARN_MORE: "Learn more",
  13347. WEBVR_VIEW_SPACE: "View Space in VR",
  13348. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13349. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13350. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13351. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13352. VR_PREVIOUS_CAPS: "PREVIOUS",
  13353. VR_NEXT_CAPS: "NEXT",
  13354. VR_GOT_IT_CAPS: "GOT IT",
  13355. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13356. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13357. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13358. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13359. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13360. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13361. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13362. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13363. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13364. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13365. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13366. VR_APP: "port VR App",
  13367. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13368. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13369. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13370. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13371. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13372. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13373. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13374. VR_ANDROID_DVICES: "Android Devices",
  13375. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13376. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13377. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13378. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13379. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13380. VR_APP_OPEN: "Open with the port VR app instead",
  13381. VR_DOWNLOAD_HERE: "Download here",
  13382. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13383. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13384. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13385. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13386. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13387. SHARE_TO: "Share to",
  13388. SHARE_LINK: "Direct Link",
  13389. SHARE_EXPLORE: "Explore ",
  13390. SHARE_AT: "at",
  13391. SHARE_WITH: "with",
  13392. SHARE_3D: " in 3D",
  13393. SHARE_COPIED: "Copied!",
  13394. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13395. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13396. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13397. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13398. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13399. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13400. ERROR_GENERIC_ACTIONS_3: " or ",
  13401. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13402. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13403. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13404. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13405. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13406. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13407. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13408. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13409. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13410. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13411. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13412. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13413. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13414. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13415. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13416. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13417. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13418. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13419. LINK_TO_LOCATION: "Link to location",
  13420. MENU_COPY: "Copy",
  13421. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13422. ROTATE: "Rotate",
  13423. INSIDE: "Inside",
  13424. MOVE: "Move",
  13425. ZOOM: "Zoom"
  13426. }
  13427. }
  13428. , {}],
  13429. 112: [function(e, t, i) {
  13430. "use strict";
  13431. t.exports = {
  13432. PAGE_TITLE: "",
  13433. LOADING: "Cargando",
  13434. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13435. POWERED_BY: "potenciando por ",
  13436. POWERED_BY_CAPS: "POTENCIADO POR ",
  13437. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13438. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13439. PRESENTED_BY: "Presentado por ",
  13440. MORE: "Más ",
  13441. LESS: "Menos ",
  13442. TAG_CONTENT: "Contenido de tag™",
  13443. SHOW: "Mostrar",
  13444. HIDE: "Ocultar",
  13445. DOLLHOUSE: "Dollhouse",
  13446. FLOOR_PLAN: "Planos",
  13447. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13448. CLOSE_HIGHLIGHTS: "Cerrar",
  13449. PREVIOUS: "Anterior",
  13450. PLAY: "Play",
  13451. PAUSE: "Pausa",
  13452. NEXT: "Siguiente",
  13453. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13454. VIEW_DOLLHOUSE: "Ver dollhouse",
  13455. SOCIAL_SHARING: "Compartir este espacio",
  13456. VIEW_IN_VR: "Ver en realidad virtual",
  13457. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13458. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13459. ZOOM_IN: "Acercar",
  13460. ZOOM_OUT: "Alejar",
  13461. FLOOR_NAME: "Piso ",
  13462. FLOOR_ALL: "Todas",
  13463. TERMS: "Condiciones",
  13464. PORT_TERMS: "port términos de uso",
  13465. TERMS_OF_USE: "Términos de uso",
  13466. TERMS_TEXT_FILE: "terms-es-MX.html",
  13467. CLOSE_TERMS: "Cerrar",
  13468. TERMS_FAIL: "No se han podido obtener las condiciones. Asegúrese de tener una conexión a Internet para ver los términos de uso.",
  13469. HELP: "Ayuda",
  13470. HELP_NAVIGATION_TAB: "Navegación",
  13471. HELP_MORE_HELP_TAB: "Más Ayuda",
  13472. CLOSE: "Cerrar",
  13473. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13474. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13475. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13476. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13477. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13478. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13479. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13480. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13481. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13482. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13483. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13484. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13485. HELP_DESKTOP_FLOORPLAN_1A: "Haga clic con izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición de la planta.",
  13486. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13487. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13488. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13489. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13490. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13491. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13492. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13493. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13494. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13495. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13496. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13497. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13498. HELP_MORE_HLR_A: "Galería destacada",
  13499. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13500. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13501. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13502. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13503. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13504. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13505. HELP_MORE_TAG_A: "tag™ Posts",
  13506. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13507. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13508. HELP_MORE_ZOOM_A: "Controles de zoom",
  13509. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13510. HELP_MORE_TOUR_A: "Controles de recorrido",
  13511. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13512. HELP_MORE_INSIDE_A: "Vista interior",
  13513. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13514. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13515. HELP_MORE_VR_A: "Modo de realidad virtual",
  13516. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13517. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13518. HELP_MORE_360_A: "360° Views",
  13519. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13520. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13521. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13522. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13523. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13524. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13525. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13526. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13527. WEBVR_LEARN_MORE: "Más información",
  13528. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13529. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13530. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13531. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13532. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13533. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13534. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13535. VR_APP: "port VR App",
  13536. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13537. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13538. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13539. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13540. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13541. VR_PREVIOUS_CAPS: "ANTERIOR",
  13542. VR_NEXT_CAPS: "SIGUIENTE",
  13543. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13544. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13545. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13546. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13547. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13548. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13549. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13550. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13551. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13552. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13553. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13554. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13555. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13556. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13557. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13558. VR_ANDROID_DVICES: "Dispositivos Android",
  13559. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13560. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13561. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13562. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13563. VR_DOWNLOAD_HERE: "Descargar aquí",
  13564. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13565. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13566. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13567. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13568. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13569. SHARE_TO: "Compartir en",
  13570. SHARE_LINK: "Enlace directo",
  13571. SHARE_EXPLORE: "Explorar ",
  13572. SHARE_AT: "en",
  13573. SHARE_WITH: "con",
  13574. SHARE_3D: " en 3D",
  13575. SHARE_COPIED: "¡Copiado!",
  13576. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13577. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13578. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13579. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13580. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13581. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13582. ERROR_GENERIC_ACTIONS_3: " o ",
  13583. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13584. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13585. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13586. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13587. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13588. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13589. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13590. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13591. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13592. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13593. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13594. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13595. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13596. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13597. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13598. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13599. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13600. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13601. LINK_TO_LOCATION: "Enlace a la ubicación",
  13602. MENU_COPY: "Copiar",
  13603. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13604. ROTATE: "Girar",
  13605. INSIDE: "Interior",
  13606. MOVE: "Moverse",
  13607. ZOOM: "Acercar o alejar"
  13608. }
  13609. }
  13610. , {}],
  13611. 113: [function(e, t, i) {
  13612. "use strict";
  13613. t.exports = {
  13614. PAGE_TITLE: "",
  13615. LOADING: "Chargement",
  13616. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13617. POWERED_BY: "alimenté par ",
  13618. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13619. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13620. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13621. PRESENTED_BY: "Présenté par ",
  13622. MORE: "Plus ",
  13623. LESS: "Moins ",
  13624. TAG_CONTENT: "Contenu tag™",
  13625. SHOW: "Montrer",
  13626. HIDE: "Cacher",
  13627. DOLLHOUSE: "Dollhouse",
  13628. FLOOR_PLAN: "Plan de sol",
  13629. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13630. CLOSE_HIGHLIGHTS: "Fermer",
  13631. PREVIOUS: "Précédent",
  13632. PLAY: "Lecture",
  13633. PAUSE: "Pause",
  13634. NEXT: "Suivant",
  13635. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13636. VIEW_DOLLHOUSE: "Voir dollhouse",
  13637. SOCIAL_SHARING: "Partager cet espace",
  13638. VIEW_IN_VR: "Voir en VR",
  13639. VIEW_FULLSCREEN: "Plein écran",
  13640. EXIT_FULLSCREEN: "Fermer plein écran",
  13641. ZOOM_IN: "Zoom avant",
  13642. ZOOM_OUT: "Zoom arrière",
  13643. FLOOR_NAME: "Étage ",
  13644. FLOOR_ALL: "Tous",
  13645. TERMS: "Mentions légales",
  13646. PORT_TERMS: "port mentions légales",
  13647. TERMS_OF_USE: "Conditions d'utilisation",
  13648. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13649. CLOSE_TERMS: "Fermer",
  13650. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13651. HELP: "Aide",
  13652. HELP_NAVIGATION_TAB: "Navigation",
  13653. HELP_MORE_HELP_TAB: "Aide",
  13654. CLOSE: "Fermer",
  13655. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13656. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13657. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13658. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13659. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13660. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13661. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13662. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13663. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13664. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13665. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13666. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13667. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13668. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13669. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13670. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13671. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13672. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13673. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13674. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13675. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13676. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13677. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13678. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13679. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13680. HELP_MORE_HLR_A: "Carrousel",
  13681. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13682. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13683. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13684. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13685. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13686. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13687. HELP_MORE_TAG_A: "tag™ Posts",
  13688. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13689. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13690. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13691. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13692. HELP_MORE_TOUR_A: "Commandes de la visite",
  13693. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13694. HELP_MORE_INSIDE_A: "Vue intérieure",
  13695. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13696. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13697. HELP_MORE_VR_A: "Mode RV",
  13698. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13699. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13700. HELP_MORE_360_A: "Vues 360°",
  13701. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13702. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13703. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13704. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13705. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13706. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13707. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13708. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13709. WEBVR_LEARN_MORE: "En savoir plus",
  13710. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13711. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13712. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13713. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13714. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13715. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13716. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13717. VR_NEXT_CAPS: "SUIVANT",
  13718. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13719. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13720. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13721. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13722. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13723. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13724. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13725. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13726. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13727. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13728. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13729. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13730. VR_APP: "port VR App",
  13731. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13732. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13733. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13734. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13735. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13736. VR_COMPATIBLE_ANDROID_LONG: "Compatible avec les écrans des appareils Android de 11,5 à 14 cm (4,5 à 5,5 po) fonctionnant sous Android OS 4.4.4 et plus",
  13737. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13738. VR_ANDROID_DVICES: "Appareils Android",
  13739. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13740. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13741. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13742. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13743. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13744. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13745. VR_DOWNLOAD_HERE: "Télécharger ici",
  13746. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13747. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13748. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13749. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13750. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13751. SHARE_TO: "Partager sur",
  13752. SHARE_LINK: "Lien direct",
  13753. SHARE_EXPLORE: "Explorer ",
  13754. SHARE_AT: "à",
  13755. SHARE_WITH: "avec",
  13756. SHARE_3D: " en 3D",
  13757. SHARE_COPIED: "Copié!",
  13758. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13759. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13760. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13761. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13762. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13763. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13764. ERROR_GENERIC_ACTIONS_3: " ou ",
  13765. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13766. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13767. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13768. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13769. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13770. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13771. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13772. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13773. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13774. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13775. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13776. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13777. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13778. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13779. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13780. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13781. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13782. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13783. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13784. MENU_COPY: "Copie",
  13785. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13786. ROTATE: "Faire pivoter",
  13787. INSIDE: "Intérieure",
  13788. MOVE: "Se déplacer",
  13789. ZOOM: "Zoom"
  13790. }
  13791. }
  13792. , {}],
  13793. 114: [function(e, t, i) {
  13794. "use strict";
  13795. t.exports = {
  13796. PAGE_TITLE: "",
  13797. LOADING: "読み込み中",
  13798. PRESENTED_BY_CAPS: "PRESENTED BY",
  13799. POWERED_BY: "powered by",
  13800. POWERED_BY_CAPS: "POWERED BY",
  13801. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13802. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13803. PRESENTED_BY: "Presented by ",
  13804. MORE: "全て表示 ",
  13805. LESS: "閉じる ",
  13806. TAG_CONTENT: "tag™コンテンツ ",
  13807. SHOW: "表示",
  13808. HIDE: "非表示",
  13809. DOLLHOUSE: "ドールハウス",
  13810. FLOOR_PLAN: "フロアプラン",
  13811. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13812. CLOSE_HIGHLIGHTS: "閉じる",
  13813. PREVIOUS: "前へ",
  13814. PLAY: "再生",
  13815. PAUSE: "一時停止",
  13816. NEXT: "次へ",
  13817. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13818. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13819. SOCIAL_SHARING: "このSpaceを共有する",
  13820. VIEW_IN_VR: "VRで表示",
  13821. VIEW_FULLSCREEN: "フルスクリーン表示",
  13822. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13823. ZOOM_IN: "ズームイン",
  13824. ZOOM_OUT: "ズームアウト",
  13825. FLOOR_NAME: "フロア ",
  13826. FLOOR_ALL: "すべて",
  13827. TERMS: "規約",
  13828. PORT_TERMS: "port規約",
  13829. TERMS_OF_USE: "利用規約",
  13830. CLOSE_TERMS: "閉じる",
  13831. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13832. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13833. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13834. WEBVR_ENTER_WEBVR: "VRに入る",
  13835. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13836. WEBVR_LEARN_MORE: "もっと詳しく",
  13837. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13838. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13839. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13840. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13841. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13842. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13843. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13844. VR_PREVIOUS_CAPS: "前へ",
  13845. VR_NEXT_CAPS: "次へ",
  13846. VR_GOT_IT_CAPS: "了解",
  13847. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13848. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13849. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13850. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13851. VR_WHAT_YOU_NEED: "必要なもの",
  13852. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13853. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13854. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13855. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13856. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13857. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13858. VR_APP: "port VRアプリ",
  13859. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13860. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13861. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13862. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13863. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13864. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13865. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13866. VR_ANDROID_DVICES: "Androidデバイス",
  13867. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13868. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13869. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13870. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13871. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13872. VR_APP_OPEN: "port VRアプリで開く",
  13873. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13874. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13875. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13876. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13877. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13878. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13879. SHARE_TO: "共有先",
  13880. SHARE_LINK: "ダイレクトリンク",
  13881. SHARE_EXPLORE: "探索",
  13882. SHARE_AT: "場所",
  13883. SHARE_WITH: "使用アプリ",
  13884. SHARE_3D: "3Dで",
  13885. SHARE_COPIED: "コピーされました!",
  13886. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13887. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13888. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13889. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13890. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13891. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13892. ERROR_GENERIC_ACTIONS_3: "または",
  13893. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13894. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13895. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13896. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13897. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13898. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13899. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13900. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13901. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13902. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13903. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13904. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13905. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13906. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13907. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13908. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13909. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13910. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13911. LINK_TO_LOCATION: "ロケーションへのリンク",
  13912. MENU_COPY: "コピー",
  13913. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13914. ROTATE: "回転",
  13915. MOVE: "移動",
  13916. INSIDE: "内側",
  13917. ZOOM: "ズーム",
  13918. HELP: "ヘルプ",
  13919. HELP_NAVIGATION_TAB: "ナビゲーション",
  13920. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13921. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13922. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13923. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13924. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13925. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13926. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13927. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13928. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13929. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13930. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13931. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13932. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13933. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13934. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13935. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13936. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13937. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13938. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13939. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13940. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13941. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13942. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13943. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13944. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13945. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13946. HELP_MORE_HLR_A: "ハイライト",
  13947. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13948. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13949. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13950. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13951. HELP_MORE_FLOORS_A: "フロアセレクター",
  13952. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13953. HELP_MORE_TAG_A: "tag™ Posts",
  13954. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13955. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13956. HELP_MORE_ZOOM_A: "ズームコントロール",
  13957. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13958. HELP_MORE_TOUR_A: "ツアーコントロール",
  13959. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13960. HELP_MORE_INSIDE_A: "内側ビュー",
  13961. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13962. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13963. HELP_MORE_VR_A: "VRモード",
  13964. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13965. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13966. HELP_MORE_360_A: "360° Views",
  13967. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13968. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13969. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13970. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13971. CLOSE: "閉じる"
  13972. }
  13973. }
  13974. , {}],
  13975. 115: [function(e, t, i) {
  13976. "use strict";
  13977. t.exports = {
  13978. PAGE_TITLE: "",
  13979. LOADING: "Загрузка",
  13980. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13981. POWERED_BY: "разработано на платформе ",
  13982. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13983. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13984. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13985. PRESENTED_BY: "Представлено ",
  13986. MORE: "Больше ",
  13987. LESS: "Меньше ",
  13988. TAG_CONTENT: "tag™ Контент",
  13989. SHOW: "Показать",
  13990. HIDE: "Скрыть",
  13991. DOLLHOUSE: "Dollhouse",
  13992. FLOOR_PLAN: "Планировка",
  13993. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  13994. CLOSE_HIGHLIGHTS: "Закрыть",
  13995. PREVIOUS: "Предыдущий",
  13996. PLAY: "Воспроизвести",
  13997. PAUSE: "Пауза",
  13998. NEXT: "Следующий",
  13999. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  14000. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  14001. SOCIAL_SHARING: "Поделиться этой моделью",
  14002. VIEW_IN_VR: "Посмотреть в VR",
  14003. VIEW_FULLSCREEN: "Полный экран",
  14004. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  14005. ZOOM_IN: "Увеличить",
  14006. ZOOM_OUT: "Уменьшить",
  14007. FLOOR_NAME: "Этаж ",
  14008. FLOOR_ALL: "Все",
  14009. TERMS: "Условия",
  14010. PORT_TERMS: "Правила пользования",
  14011. TERMS_OF_USE: "Условия использования",
  14012. TERMS_TEXT_FILE: "terms-ru-RU.html",
  14013. CLOSE_TERMS: "Закрыть",
  14014. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  14015. HELP: "Помощь",
  14016. HELP_NAVIGATION_TAB: "Навигация",
  14017. HELP_MORE_HELP_TAB: "Доп. Помощь",
  14018. CLOSE: "Закрыть",
  14019. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  14020. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  14021. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  14022. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  14023. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  14024. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  14025. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  14026. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  14027. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  14028. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  14029. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  14030. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  14031. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  14032. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  14033. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  14034. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  14035. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  14036. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  14037. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  14038. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  14039. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  14040. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  14041. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  14042. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  14043. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  14044. HELP_MORE_HLR_A: "Фотоколлаж",
  14045. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  14046. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  14047. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  14048. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  14049. HELP_MORE_FLOORS_A: "Выбор Этажа",
  14050. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  14051. HELP_MORE_TAG_A: "tag™ Posts",
  14052. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  14053. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  14054. HELP_MORE_ZOOM_A: "Масштаб",
  14055. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  14056. HELP_MORE_TOUR_A: "Управление Туром",
  14057. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  14058. HELP_MORE_INSIDE_A: "Вид Изнутри",
  14059. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  14060. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  14061. HELP_MORE_VR_A: "Режим VR",
  14062. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  14063. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  14064. HELP_MORE_360_A: "360° Views",
  14065. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14066. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14067. HELP_MORE_FULLSCREEN_A: "Полный экран",
  14068. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  14069. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  14070. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  14071. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  14072. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  14073. WEBVR_LEARN_MORE: "Узнать больше",
  14074. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  14075. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  14076. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14077. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  14078. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  14079. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14080. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14081. VR_APP: "port VR App",
  14082. VR_APP_OPEN: "Или открыть через приложение port VR",
  14083. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  14084. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  14085. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  14086. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  14087. VR_VIEW_SPACE: "Запустить модель в VR",
  14088. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  14089. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  14090. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  14091. VR_GOT_IT_CAPS: "ЯСНО",
  14092. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  14093. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  14094. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  14095. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  14096. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  14097. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  14098. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14099. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14100. VR_COMPATIBLE_IPHONES_1: "iPhones",
  14101. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  14102. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  14103. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  14104. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  14105. VR_ANDROID_DVICES: "Android устройства",
  14106. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  14107. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  14108. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  14109. VR_DOWNLOAD_HERE: "Скачать здесь",
  14110. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  14111. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  14112. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  14113. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  14114. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  14115. SHARE_TO: "Поделиться",
  14116. SHARE_LINK: "Прямая ссылка",
  14117. SHARE_EXPLORE: "просмотреть",
  14118. SHARE_AT: "на",
  14119. SHARE_WITH: "с",
  14120. SHARE_3D: "в 3D",
  14121. SHARE_COPIED: "Скопировано!",
  14122. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  14123. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  14124. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  14125. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  14126. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  14127. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  14128. ERROR_GENERIC_ACTIONS_3: " или ",
  14129. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  14130. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  14131. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  14132. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  14133. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  14134. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  14135. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  14136. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  14137. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  14138. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  14139. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  14140. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  14141. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  14142. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  14143. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  14144. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  14145. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  14146. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  14147. LINK_TO_LOCATION: "Ссылка на местоположение",
  14148. MENU_COPY: "Копировать",
  14149. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  14150. ROTATE: "Вращать",
  14151. MOVE: "Передвигаться",
  14152. INSIDE: "Вид изнутри",
  14153. ZOOM: "Масштаб"
  14154. }
  14155. }
  14156. , {}],
  14157. 116: [function(e, t, i) {//main.js
  14158. (function(t) {
  14159. "use strict";
  14160. var modelProgressBase = 0.4;
  14161. var progressUpdate = function(e){ // 0 <= e <= 1
  14162. console.log('e1:'+e)
  14163. e = Math.round(modelProgressBase * e * 100);
  14164. console.log('e2:'+e)
  14165. var t = $('.progressbar');
  14166. t.find('.bar').css('width',e+'%');
  14167. t.find('.label').css('left', t.width() * e / 100 - 15 + 'px' ); //上面跟着的字的百分比
  14168. t.find('.perc').text(e +'%'); //具体数字的百分比
  14169. }
  14170. $('#gui-loading').fadeIn(200);
  14171. progressUpdate(0.1)
  14172. var fileName = g_version ? 'modeldata.js' : 'someData.json' ;
  14173. $.ajax(g_Prefix + "data/"+window.number+"/"+fileName+"?"+randomTime().getTime(),{dataType: "json"}).done( function(e){ //改
  14174. var data = matcher(e);
  14175. data.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}",window.number);
  14176. data.user = {
  14177. "is_authenticated": false,
  14178. "flags": ["payment_show_past_due", "sc_imgopt_100", "mattertags", "labels", "fastly_v2_urls", "vr", "uhql", "sc_segment_100", "show_segment_metrics", "content_distribution", "workshop_webgl", "show360views", "showcase_vr", "ws_zooming", "model_settings", "ws_360snapshots", "img_multi_dl", "vrworkshop", "tag_links", "ws_img_multi_dl", "mattertag_links", "billing_tab_hidden", "static_cloud_ui", "metrics", "mattertag_media", "img_size_download", "show_360snapshots", "floorplan", "sc_tilegen_0", "showcase_webvr", "sc_mixpanel_0", "show_clickbait", "zooming", "showcase_tiling", "list_signed_urls_default_3", "fastly_image_opto"]
  14179. }
  14180. try{//处理一下导览数据,旧的曾有第一个导览数据是错误的,将它删除
  14181. if(data.model.images[0] && !data.model.images[0].thumbnail_signed_src){
  14182. data.model.images = data.model.images.slice(1);
  14183. }
  14184. }catch(e){console.log(e) }
  14185. window.MP_PREFETCHED_MODELDATA = data;
  14186. progressUpdate(0.7);
  14187. StartLoad(); //xzw someData.js是我整合的 原本在html里 但这样每个场景的html都不一样了
  14188. })
  14189. function StartLoad(){//当加载完data后
  14190. function i() {
  14191. var e = Y.getModelIDFromQueryString();
  14192. if (!e)
  14193. return b(null, "loading-failed");
  14194. var t = Y.parseSidUrl(e)
  14195. , i = l()
  14196. , a = c()
  14197. , s = o()
  14198. , u = V.quickstart.enabled
  14199. , g = null
  14200. , m = null
  14201. , v = null
  14202. , w = null
  14203. , T = null
  14204. , x = null
  14205. , S = null
  14206. , M = null
  14207. , R = null
  14208. , P = null
  14209. , O = null
  14210. , L = null
  14211. , N = new ue;
  14212. r(s);
  14213. h({ //MP开头写法
  14214. urlBase: t.urlBase
  14215. }).then(function() {
  14216. return re.init(),
  14217. d(t, e) //getModel and load
  14218. }).then(function(e) {
  14219. progressUpdate(0.9)
  14220. return P = e,
  14221. p(P, V.appConfig.segment_key, V.appConfig.keen_write_key, V.appConfig.keen_project_id, {
  14222. startSource: i,
  14223. autoplay: V.autoplay,
  14224. quickstart: u
  14225. }),
  14226. P.urls.init()
  14227. }).then(function() {
  14228. return P.loadPanos()
  14229. }).then(function() {
  14230. m = X.getStartCameraOptions(P, P.panos),
  14231. S = A(P),
  14232. O = y(u, m.mode),
  14233. v = O.controls,
  14234. w = O.player,
  14235. T = O.director,
  14236. x = O.tagManager,
  14237. M = O.tileDownloader,
  14238. R = O.qualityManager,
  14239. L = O.panoRenderer,
  14240. C(P, S, O, s),
  14241. w.director = T,//xzw add
  14242. P.supportsTiles && M.start(),
  14243. !u || m.mode === D.PANORAMA && m.pano || (de.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14244. u = !1);
  14245. var e = null;
  14246. if (u) {
  14247. de.warn("Quickstart engaged. Hold on to your knickers.");
  14248. var t = v.controls[D.PANORAMA];
  14249. g = new ie(R,S.scene,S.camera,t,s),
  14250. _(S, s, P),
  14251. e = g.load(m).then(function() {
  14252. S.addComponent(g),
  14253. S.once(le.AfterRender, function() {
  14254. de.warn("First render after quickstart load finished.")
  14255. })
  14256. })
  14257. }
  14258. window.flyToFirst = function(){//xzw add
  14259. var pano = w.model.panos.get("8d778e19657f433fb9cf8947d823bb70");
  14260. var q = new _x.Quaternion(0.7099827027821568,-0.07708150183830938,0.6958985789714591,0.07555241737970636);
  14261. var lookAtPoint = new _x.Vector3(0,0,-1).applyQuaternion(q).add(pano.position);
  14262. w.flyToPano({pano:pano, lookAtPoint:lookAtPoint})
  14263. };
  14264. return $.when(e, U.startLoading(P, w, T, V.autoplay, u, N))
  14265. }).then(function() {
  14266. return f(P, U.onProgress, i, !u, a)
  14267. }).then(function() {
  14268. if (m.quickstart = u,
  14269. I(P, S, O, s),
  14270. S.started || _(S, s, P),
  14271. H.modelLoaded(P, w, v, V.autoplay),
  14272. E(w, P, m, V.autoplay).done(function() {
  14273. T.autoTour()
  14274. }),
  14275. !P.supportsTiles) {
  14276. var e = new Z(P,w);
  14277. e.start()
  14278. }
  14279. u && (S.removeComponent(g),
  14280. g.destroy(),
  14281. m.pano.enter()),
  14282. U.init(P, T, w, v, S, m, H.getSessionId()),
  14283. U.endLoading(P, T, x),
  14284. S.once(le.AfterRender, function() {
  14285. N.setAppReadyTime();
  14286. var e = N.calcFullLoadingTime();
  14287. de.warn("Total load time: " + e / 1e3),
  14288. H.loadComplete(e),
  14289. de.warn("First render after model load finished.")
  14290. }),
  14291. S.on(le.MemoryUsageUpdated, n)
  14292. }).fail(b.bind(this, e))
  14293. }
  14294. function n(e) {
  14295. ce.update(e)
  14296. }
  14297. function r(e) {
  14298. de.info("Version", "2.25.6-0-gd87e5b1"),
  14299. q.defaultMaxListeners = 1e3,
  14300. a(e),
  14301. s()
  14302. }
  14303. function o() {
  14304. return document.getElementById("player")
  14305. }
  14306. function a(e) {
  14307. e.addEventListener("dragenter", T, !1),
  14308. e.addEventListener("dragover", T, !1)
  14309. }
  14310. function s() {
  14311. F.valueFromHash("title", !0) || $(document).ready(function() {
  14312. var e = $(".model-title");
  14313. e.hide()
  14314. })
  14315. }
  14316. function l() {
  14317. return F.valueFromHash("play", !1) ? "autoplay" : F.inIframe() ? "click" : "fullpage"
  14318. }
  14319. function c() {
  14320. return {
  14321. panoElementsToLoad: 6,
  14322. modelElementsToLoad: 0,
  14323. totalElementsLoaded: 0,
  14324. totalElementsToLoad: 0,
  14325. totalPercentageLoaded: 0,
  14326. progressCallback: null
  14327. }
  14328. }
  14329. function h(e) {
  14330. return K.loadFeatureFlags(e).done(function(e) {
  14331. K.updateDependentSettings(e, V)
  14332. })
  14333. }
  14334. // function u(e) {
  14335. // return Q.get(e.urlBase + "/api/v1/config/showcase", {
  14336. // responseType: "json",
  14337. // prefetchFrom: "config"
  14338. // }).then(function(e) {
  14339. // return e ? void j.extendObject(V.appConfig, e) : {}
  14340. // }, function(e) {
  14341. // return de.warn("Failed loading runtime config, using defaults."),
  14342. // $.when({})
  14343. // })
  14344. // }
  14345. function d(e, t) {
  14346. var i = B.getModel({
  14347. url: t,
  14348. floors: F.valueFromHash("f", !0),
  14349. autoload: !1
  14350. })
  14351. ;
  14352. return $.when(i, n).then(null, function(e) {
  14353. return this
  14354. })
  14355. }
  14356. function p(e, t, i, n, r) {
  14357. de.info("Model data loaded"),
  14358. de.debug("UUID: " + e.data.job.uuid),
  14359. J.init(K.getFlags()),
  14360. i && H.initKeen({
  14361. token: i,
  14362. appId: n
  14363. }),
  14364. H.initSegment({
  14365. model: e.sid,
  14366. version: "2.25.6-0-gd87e5b1",
  14367. startSource: r.startSource,
  14368. token: t,
  14369. autoplay: r.autoplay,
  14370. quickstart: r.quickstart
  14371. })
  14372. }
  14373. function f(e, t, i, n, r) {
  14374. return r.progressCallback = t,
  14375. H.sessionStart(),
  14376. e.load(n).progress(g.bind(this, r))
  14377. }
  14378. function g(e, t) {
  14379. e.modelElementsToLoad = t[1],
  14380. v(e),
  14381. m(e)
  14382. }
  14383. function m(e) {
  14384. e.totalElementsLoaded++,
  14385. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14386. //----许钟文-----------------模型进度条向后调整
  14387. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0);
  14388. e.totalPercentageLoaded = modelProgressBase + (1-modelProgressBase)*e.totalPercentageLoaded;
  14389. console.log('pro:'+e.totalPercentageLoaded)
  14390. //---------------------------
  14391. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14392. }
  14393. function v(e) {
  14394. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14395. }
  14396. function A(e) {
  14397. var t = new x.PerspectiveCamera;
  14398. t.layers.enable(he.PANOMARKERS),
  14399. t.layers.enable(he.RETICULE),
  14400. t.layers.enable(he.TAG);
  14401. var i = new x.Scene
  14402. , n = new x.AmbientLight(16777215);
  14403. i.add(n),
  14404. i.skybox = new W,
  14405. i.add(i.skybox),
  14406. i.plane = new x.Mesh(new x.PlaneBufferGeometry(1e5,1e5),new x.RawShaderMaterial({
  14407. side: x.DoubleSide
  14408. })),
  14409. i.plane.position.y = 0,
  14410. i.plane.rotateX(-Math.PI / 2),
  14411. i.plane.material.visible = !1,
  14412. i.add(i.plane),
  14413. i.updateMatrixWorld(),
  14414. V.showScreenshotLocations && e.data.images.forEach(function(e) {
  14415. if (e.metadata && e.metadata.camera_position) {
  14416. var t = e.metadata.camera_position
  14417. , n = new x.Mesh(new x.BoxGeometry(.3,.3,.3));
  14418. n.position = t.clone(),
  14419. i.add(n);
  14420. var r = e.metadata.camera_quaternion
  14421. , o = new x.Vector3(0,0,-1).applyQuaternion(r);
  14422. i.add(new x.ArrowHelper(o,t.clone(),1,16711680))
  14423. }
  14424. }),
  14425. V.showAxis && (i.add(new x.ArrowHelper(new x.Vector3(0,1,0),new x.Vector3(0,0,0),1,255)),
  14426. i.add(new x.ArrowHelper(new x.Vector3(0,0,1),new x.Vector3(0,0,0),1,16711680)),
  14427. i.add(new x.ArrowHelper(new x.Vector3(1,0,0),new x.Vector3(0,0,0),1,65280)));
  14428. var r = new te(i,t,z);
  14429. return r
  14430. }
  14431. function y(e, t) {
  14432. var i = e ? 1 : 1e3
  14433. , n = J.tilegen || J.imgopt ? 6 : 2;
  14434. n = F.valueFromHash("tileconc", n);
  14435. var r = new ne
  14436. , o = new ae({
  14437. concurrentDownloads: n
  14438. })
  14439. , a = new se
  14440. , s = new P
  14441. , l = new M
  14442. , c = new S(t)
  14443. , h = new R
  14444. , u = new O(i)
  14445. , d = new L
  14446. , p = new oe;
  14447. return {
  14448. qualityManager: r,
  14449. panoRenderer: a,
  14450. tileDownloader: o,
  14451. player: c,
  14452. director: l,
  14453. modelManager: s,
  14454. tagManager: p,
  14455. displayController: u,
  14456. labelDisplayController: d,
  14457. controls: h
  14458. }
  14459. }
  14460. function C(e, t, i, n) {
  14461. var r = i.controls
  14462. , o = i.qualityManager
  14463. , a = i.panoRenderer
  14464. , s = i.tileDownloader
  14465. , l = i.modelManager;
  14466. r.init(n, l),
  14467. ee.init(i.director, r, i.player, l, t),
  14468. o.init(l),
  14469. s.init(o),
  14470. a.init(t, s, o),
  14471. l.init(s, a, o),
  14472. l.addModel(e),
  14473. t.addComponent(G)
  14474. }
  14475. function I(e, t, i, n) {
  14476. var r = i.qualityManager
  14477. , o = i.panoRenderer
  14478. , a = i.tileDownloader
  14479. , s = i.modelManager
  14480. , l = i.player
  14481. , c = i.director
  14482. , h = i.tagManager
  14483. , u = i.displayController
  14484. , d = i.labelDisplayController
  14485. , p = i.controls;
  14486. t.scene.add(e),
  14487. t.qualityManager = r;
  14488. var f = {
  14489. camera: t.camera,
  14490. director: c,
  14491. modelManager: s,
  14492. tileDownloader: a,
  14493. panoRenderer: o,
  14494. qualityManager: r,
  14495. tagManager: h,
  14496. container: n,
  14497. controls: p
  14498. };
  14499. l.init(f),
  14500. l.setScene(t.scene),
  14501. h.init(s, l),
  14502. c.init(l, s),
  14503. u.init(c, l, s, h, n),
  14504. d.init(l, s, n),
  14505. z.bindEvents(l),
  14506. t.addComponent(h),
  14507. t.addComponent(l),
  14508. t.addComponent(o),
  14509. l.sceneRenderer = t; //xzw add 方便resize
  14510. }
  14511. function E(e, t, i, n) {
  14512. return de.info("Starting player in " + i.mode),
  14513. H.report(t.sid, "started-playing", n, i.quickstart),
  14514. e.start(i)
  14515. }
  14516. function b(e, t) {
  14517. de.error(t),
  14518. k.error(t),
  14519. H.report(e, "error-" + t)
  14520. }
  14521. function w(e) {
  14522. var t = F.details();
  14523. t && "Safari" === t.name && t.version > 500 && t.version < 600 ? (k.error("webgl-safari"),
  14524. H.report(e, "error-webgl-safari")) : (k.error("webgl-generic"),
  14525. H.report(e, "error-webgl-generic"))
  14526. }
  14527. function _(e, t, i) {
  14528. try {
  14529. e.start(t)
  14530. } catch (e) {
  14531. throw de.warn(e.message),
  14532. w(i.sid),
  14533. e
  14534. }
  14535. }
  14536. function T(e) {
  14537. e.stopPropagation(),
  14538. e.preventDefault()
  14539. }
  14540. //czj 判断someData 有没有hoticon字段 修改热点的样式
  14541. if (window.MP_PREFETCHED_MODELDATA.hoticon){
  14542. /* g_HotImage = {
  14543. "point": window.MP_PREFETCHED_MODELDATA.hoticon.default,
  14544. "point2": window.MP_PREFETCHED_MODELDATA.hoticon.higt
  14545. } */
  14546. g_HotImage = {
  14547. point: "https://super.4dage.com/images/4dagePoint2.png",//window.MP_PREFETCHED_MODELDATA.hoticon.default,
  14548. point2: "https://super.4dage.com/images/4dagePoint.png"//window.MP_PREFETCHED_MODELDATA.hoticon.higt
  14549. } ;
  14550. }
  14551. //czj 判断someData 有没有backgroundMusic 添加音乐
  14552. if (window.MP_PREFETCHED_MODELDATA.backgroundMusic) {
  14553. g_bgAudio.src = window.MP_PREFETCHED_MODELDATA.backgroundMusic.substr(0,4)=="http" ? window.MP_PREFETCHED_MODELDATA.backgroundMusic : "//" + window.MP_PREFETCHED_MODELDATA.backgroundMusic;
  14554. $("#volume").show();
  14555. }else if (g_version === "one"){
  14556. g_bgAudio.src = g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3";
  14557. }
  14558. //隐藏公司logo
  14559. if(window.MP_PREFETCHED_MODELDATA.loadlogo){
  14560. showLogo();
  14561. }
  14562. e("./lib/three75-shim"),
  14563. e("./lib/array-polyfill"),
  14564. e("./lib/performance-polyfill"),
  14565. e("./lib/shaders/CopyShader.js"),
  14566. e("./lib/shaders/HorizontalBlurShader.js"),
  14567. e("./lib/shaders/VerticalBlurShader.js"),
  14568. e("./lib/postprocessing/EffectComposer.js"),
  14569. e("./lib/postprocessing/RenderPass.js"),
  14570. e("./lib/postprocessing/MaskPass.js"),
  14571. e("./lib/postprocessing/ShaderPass.js"),
  14572. window.Promise || (window.Promise = e("promise-polyfill"));
  14573. var x = e("three")
  14574. , _x = e("three")
  14575. , S = (e("./util/sentry"),
  14576. e("./player"))
  14577. , M = e("./director")
  14578. , R = e("./controls/CameraControls")
  14579. , P = e("./model/ModelManager")
  14580. , O = e("./DisplayController")
  14581. , L = e("./label/LabelDisplayController")
  14582. , D = e("./enum/Viewmode")
  14583. , N = e("./util/logger")
  14584. , B = e("./showcase")
  14585. , F = e("./util/browser")
  14586. , V = e("./settings")
  14587. , U = e("./gui/gui")
  14588. , k = e("./gui/error")
  14589. , H = e("./analytics")
  14590. , G = e("./util/transitions")
  14591. , z = e("./effects")
  14592. , W = e("./objects/Skybox")
  14593. , j = e("./util/common")
  14594. , Y = (e("./util/PanoramaCollection"),
  14595. e("./util/math"),
  14596. e("./util/showcase"))
  14597. , X = e("./util/camera")
  14598. , Z = (e("./objects/Panorama"),
  14599. e("./cameras/PanoramaCamera"),
  14600. e("./preloaders"))
  14601. , q = e("events").EventEmitter
  14602. , K = e("./featureflags")
  14603. , Q = (e("./util/lerp"),
  14604. e("./util/ajax"))
  14605. , J = e("./ab")
  14606. , ee = e("./sdk/automation.js")
  14607. , te = e("./scene/SceneRenderer")
  14608. , ie = e("./scene/QuickstartManager")
  14609. , ne = e("./tile/QualityManager.js")
  14610. , re = e("./localization/localize")
  14611. , oe = e("./tag/tagManager")
  14612. , ae = e("./tile/TileDownloader")
  14613. , se = e("./tile/PanoRenderer")
  14614. , le = (e("./enum/PanoSizeClass"),
  14615. e("./enum/PanoramaEvents"),
  14616. e("./enum/SceneRendererEvents"))
  14617. , ce = e("./gui/memoryUsage")
  14618. , he = e("./enum/RenderLayers")
  14619. , ue = e("./TimingData")
  14620. , de = new N(t);
  14621. N.level = V.logLevel,
  14622. N.consoleEnabled = V.console,
  14623. i()
  14624. }
  14625. }
  14626. ).call(this, "/js/main.js")
  14627. }
  14628. , {
  14629. "./DisplayController": 1,
  14630. "./TimingData": 2,
  14631. "./ab": 3,
  14632. "./analytics": 4,
  14633. "./cameras/PanoramaCamera": 7,
  14634. "./controls/CameraControls": 9,
  14635. "./director": 15,
  14636. "./effects": 16,
  14637. "./enum/PanoSizeClass": 36,
  14638. "./enum/PanoramaEvents": 37,
  14639. "./enum/RenderLayers": 41,
  14640. "./enum/SceneRendererEvents": 43,
  14641. "./enum/Viewmode": 51,
  14642. "./featureflags": 59,
  14643. "./gui/error": 64,
  14644. "./gui/gui": 65,
  14645. "./gui/memoryUsage": 73,
  14646. "./label/LabelDisplayController": 91,
  14647. "./lib/array-polyfill": 92,
  14648. "./lib/performance-polyfill": 95,
  14649. "./lib/postprocessing/EffectComposer.js": 96,
  14650. "./lib/postprocessing/MaskPass.js": 97,
  14651. "./lib/postprocessing/RenderPass.js": 98,
  14652. "./lib/postprocessing/ShaderPass.js": 99,
  14653. "./lib/shaders/CopyShader.js": 100,
  14654. "./lib/shaders/HorizontalBlurShader.js": 101,
  14655. "./lib/shaders/VerticalBlurShader.js": 102,
  14656. "./lib/three75-shim": 103,
  14657. "./localization/localize": 108,
  14658. "./tag/tagManager": 124,
  14659. "./model/ModelManager": 140,
  14660. "./objects/Panorama": 148,
  14661. "./objects/Skybox": 152,
  14662. "./player": 155,
  14663. "./preloaders": 156,
  14664. "./scene/QuickstartManager": 157,
  14665. "./scene/SceneRenderer": 158,
  14666. "./sdk/automation.js": 164,
  14667. "./settings": 166,
  14668. "./showcase": 168,
  14669. "./tile/PanoRenderer": 169,
  14670. "./tile/QualityManager.js": 170,
  14671. "./tile/TileDownloader": 171,
  14672. "./util/PanoramaCollection": 178,
  14673. "./util/ajax": 181,
  14674. "./util/browser": 182,
  14675. "./util/camera": 183,
  14676. "./util/common": 185,
  14677. "./util/lerp": 188,
  14678. "./util/logger": 189,
  14679. "./util/math": 190,
  14680. "./util/sentry": 192,
  14681. "./util/showcase": 193,
  14682. "./util/transitions": 195,
  14683. events: 202,
  14684. "promise-polyfill": 213,
  14685. three: 217
  14686. }],
  14687. 117: [function(e, t, i) {
  14688. "use strict";
  14689. function n(e) {
  14690. e = e || {},
  14691. r.RawShaderMaterial.call(this, a.extendObject({
  14692. fragmentShader: o.cube.fragmentShader,
  14693. vertexShader: o.cube.vertexShader,
  14694. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14695. name: "CubemapMaterial"
  14696. }, e))
  14697. }
  14698. var r = e("three")
  14699. , o = e("../shaders")
  14700. , a = e("../util/common");
  14701. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  14702. n.prototype.constructor = n,
  14703. t.exports = n
  14704. }
  14705. , {
  14706. "../shaders": 167,
  14707. "../util/common": 185,
  14708. three: 217
  14709. }],
  14710. 118: [function(e, t, i) {
  14711. "use strict";
  14712. function n(e) {
  14713. e = e || {},
  14714. r.RawShaderMaterial.call(this, a.extendObject({
  14715. fragmentShader: o.model.fragmentShader,
  14716. vertexShader: o.model.vertexShader,
  14717. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14718. name: "ModelTextureMaterial"
  14719. }, e))
  14720. }
  14721. var r = e("three")
  14722. , o = e("../shaders")
  14723. , a = e("../util/common");
  14724. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  14725. n.prototype.constructor = n,
  14726. n.prototype.setProjectedPanos = function(e, t, i) {
  14727. i && (this.uniforms.progress.value = 0),
  14728. e.ensureSkyboxReadyForRender(),
  14729. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14730. this.uniforms.pano0Position.value.copy(e.position),
  14731. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14732. t.ensureSkyboxReadyForRender(),
  14733. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14734. this.uniforms.pano1Position.value.copy(t.position),
  14735. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14736. }
  14737. ,
  14738. t.exports = n
  14739. }
  14740. , {
  14741. "../shaders": 167,
  14742. "../util/common": 185,
  14743. three: 217
  14744. }],
  14745. 119: [function(e, t, i) {
  14746. (function(i) {
  14747. "use strict";
  14748. function n(e, t, i, n) {
  14749. this.div = null,
  14750. this.body = null,
  14751. this.label = e,
  14752. this.description = t,
  14753. this.parsedDescription = [],
  14754. this.media = i || {
  14755. type: null
  14756. },
  14757. this.loadingSpinner = null,
  14758. this.parser = new r({
  14759. supportLinks: !u.valueFromHash("mls"),
  14760. keepLinkLabels: !0
  14761. }),
  14762. this.state = I.CLOSED,
  14763. this.orientation = "",
  14764. this.initialTransform = "",
  14765. this.hovering = !1,
  14766. this.openTransition = null,
  14767. this.closeTransition = null,
  14768. this.openPromise = null,
  14769. this.closePromise = null,
  14770. this.animationTransition = null,
  14771. this.animationScale = 0
  14772. }
  14773. var r = e("../Parser/DescriptionParser")
  14774. , o = e("../Media/Link")
  14775. , a = e("../Media/Image")
  14776. , s = e("../Media/EmbedlyPlayer")
  14777. , l = e("../Media/EmbedlyEmbed")
  14778. , c = e("../../util/transitions")
  14779. , h = e("../../util/lerp")
  14780. , u = e("../../util/browser")
  14781. , d = e("./BillboardEvent")
  14782. , p = e("../Media/MediaEvent")
  14783. , f = e("../Parser/DescriptionChunkType")
  14784. , g = e("events").EventEmitter
  14785. , m = e("./billboardSettings")
  14786. , v = e("./overlaySettings")
  14787. , A = e("../../util/logger")
  14788. , y = new A(i)
  14789. , C = document.getElementById("tag-billboards");
  14790. C.addEventListener("touchend", function(e) {
  14791. C.style.pointerEvents = "none"
  14792. }),
  14793. C.addEventListener("touchcancel", function(e) {
  14794. C.style.pointerEvents = "none"
  14795. });
  14796. var I = {
  14797. CLOSED: "closed",
  14798. OPENING: "opening",
  14799. OPEN: "open",
  14800. CLOSING: "closing",
  14801. ACTIVE: "active"
  14802. };
  14803. n.prototype = Object.create(g.prototype),
  14804. n.prototype.build = function(e) {
  14805. this.parsedDescription = this.parser.parse(this.description);
  14806. var t = document.createElement("div");
  14807. t.className = "tag-container has-hotzone",
  14808. this.div = t,
  14809. this.body = document.createElement("div"),
  14810. this.body.className = "tag-body";
  14811. var i = document.createElement("div");
  14812. i.classList.add("tag-content");
  14813. var n = document.createElement("div");
  14814. n.classList.add("tag-text-content");
  14815. var r = document.createElement("div");
  14816. r.className = "tag-label",
  14817. r.textContent = this.label,
  14818. n.appendChild(r);
  14819. var o = document.createElement("div");
  14820. o.className = "tag-desc",
  14821. n.appendChild(o),
  14822. i.appendChild(n),
  14823. this.body.appendChild(i),
  14824. this.appendDescriptionElements(this.parsedDescription, o),
  14825. this.appendMedia(),
  14826. t.appendChild(this.body),
  14827. C.appendChild(t),
  14828. this.bindEvents(t, this.body)
  14829. }
  14830. ,
  14831. n.prototype.bindEvents = function(e, t) {
  14832. var i = function(e) {
  14833. return function(t) {
  14834. if (!this.div.classList.contains("overlay")) {
  14835. var i, n = document.getElementById("player");
  14836. try {
  14837. i = new MouseEvent(e,t)
  14838. } catch (n) {
  14839. i = document.createEvent("MouseEvents"),
  14840. i.initMouseEvent(e, t.bubbles, t.cancelable, t.view, t.detail, t.screenX, t.screenY, t.clientX, t.clientY, t.ctrlKey, t.altKey, t.shiftKey, t.metaKey, t.button, t.relatedTarget)
  14841. }
  14842. n.dispatchEvent(i)
  14843. }
  14844. }
  14845. };
  14846. t.addEventListener("mousedown", function(e) {
  14847. e.stopPropagation()
  14848. }),
  14849. t.addEventListener("mouseup", function(e) {
  14850. e.stopPropagation()
  14851. }),
  14852. e.addEventListener("touchstart", function(e) {
  14853. C.style.pointerEvents = "auto"
  14854. }),
  14855. e.addEventListener("mousedown", i("mousedown").bind(this)),
  14856. e.addEventListener("mouseup", i("mouseup").bind(this)),
  14857. t.addEventListener("mouseover", function(t) {
  14858. this.state === I.OPEN && e.classList.remove("has-hotzone")
  14859. }
  14860. .bind(this)),
  14861. e.addEventListener("mouseenter", function(e) {
  14862. this.state !== I.CLOSING && (this.hovering = !0,
  14863. this.emit(d.ENTER))
  14864. }
  14865. .bind(this)),
  14866. e.addEventListener("mouseleave", function(e) {
  14867. this.hovering = !1,
  14868. this.emit(d.LEAVE)
  14869. }
  14870. .bind(this)),
  14871. e.addEventListener("gesturestart", function(e) {
  14872. e.preventDefault()
  14873. });
  14874. var n = e.querySelector(".tag-text-content")
  14875. , r = 0;
  14876. n.addEventListener("touchstart", function(e) {
  14877. r = e.changedTouches[0].clientY
  14878. }),
  14879. n.addEventListener("touchmove", function(t) {
  14880. function i(e) {
  14881. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight === 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  14882. }
  14883. return e.classList.contains("overlay") ? i(this.querySelector(".tag-desc")) : void i(this)
  14884. }),
  14885. e.addEventListener("touchmove", function(e) {
  14886. 0 === (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14887. })
  14888. }
  14889. ,
  14890. n.prototype.appendDescriptionElements = function(e, t) {
  14891. e.length > 0 && this.div.classList.add("has-text"),
  14892. e.forEach(function(e, i) {
  14893. switch (e.type) {
  14894. case f.TEXT:
  14895. t.appendChild(this.createTextElement(e.text));
  14896. break;
  14897. case f.LINK:
  14898. t.appendChild(this.createLinkElement(e.link))
  14899. }
  14900. }
  14901. .bind(this))
  14902. }
  14903. ,
  14904. n.prototype.appendLoadingSpinner = function() {
  14905. this.loadingSpinner = document.createElement("div"),
  14906. this.loadingSpinner.classList.add("loading-spinner");
  14907. var e = document.createElement("div");
  14908. e.classList.add("gui-spinner-icon"),
  14909. this.loadingSpinner.appendChild(e),
  14910. this.body.appendChild(this.loadingSpinner)
  14911. }
  14912. ,
  14913. n.prototype.onMediaLoadFinished = function() {
  14914. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  14915. this.applyOrientation(this.orientation),
  14916. this.loadingSpinner = null)
  14917. }
  14918. ,
  14919. n.prototype.appendMedia = function() {
  14920. if (this.media && this.media.type && "error" !== this.media.type && (!u.valueFromHash("mls", 0) || this.media.type === f.IMAGE)) {
  14921. this.appendLoadingSpinner();
  14922. var e = document.createElement("div");
  14923. e.classList.add("tag-media-content");
  14924. var t = document.createElement("i");
  14925. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  14926. t.classList.add(e)
  14927. }),
  14928. this.body.appendChild(t),
  14929. this.body.appendChild(e),
  14930. this.media.type) {
  14931. case f.IMAGE:
  14932. e.appendChild(this.createImageElement(this.media, this.body));
  14933. break;
  14934. case f.VIDEO:
  14935. e.appendChild(this.createVideoElement(this.media, this.body));
  14936. break;
  14937. case f.RICH:
  14938. e.appendChild(this.createEmbedElement(this.media, this.body))
  14939. }
  14940. }
  14941. }
  14942. ,
  14943. n.prototype.createTextElement = function(e) {
  14944. var t = document.createElement("span");
  14945. return t.textContent = e,
  14946. t
  14947. }
  14948. ;
  14949. n.prototype.createLinkElement = function(e) {
  14950. var t = new o(e);
  14951. return t.on(p.LINK_CLICK, this.emit.bind(this, p.LINK_CLICK)),
  14952. t.createDomElement()
  14953. }
  14954. ,
  14955. n.prototype.createImageElement = function(e, t) {
  14956. function i() {
  14957. function e() {
  14958. m || (r.classList.remove("view-image"),
  14959. c.classList.add("overlay"),
  14960. i(),
  14961. window.addEventListener("resize", b),
  14962. c.addEventListener("click", a),
  14963. g.addEventListener("click", l),
  14964. f.addEventListener("click", s),
  14965. m = !0,
  14966. o.emit(p.IMAGE_OPENED))
  14967. }
  14968. function i() {
  14969. t.classList.add("show-info"),
  14970. h.classList.remove("collapsible"),
  14971. h.style.height = "";
  14972. var e = parseFloat(getComputedStyle(I).lineHeight)
  14973. , i = y + e
  14974. , r = c.clientWidth - 2 * v.boundaryWidth - C
  14975. , a = c.clientHeight - 2 * v.boundaryHeight - C - i
  14976. , s = a
  14977. , l = s * n.aspect;
  14978. l > r && (l = r,
  14979. s = l / n.aspect),
  14980. s > a && (s = a,
  14981. l = s * n.aspect),
  14982. l += C,
  14983. s += C + i,
  14984. t.style.width = l + "px",
  14985. t.style.height = s + "px",
  14986. u.style.paddingTop = e + C + "px",
  14987. o.description.length > 0 && (h.classList.add("collapsible"),
  14988. h.style.height = h.clientHeight + 12 + "px",
  14989. E.style.height = "calc(100% - " + I.clientHeight + "px)")
  14990. }
  14991. function a(e) {
  14992. e.target === c && s()
  14993. }
  14994. function s() {
  14995. m && (m = !1,
  14996. r.classList.add("view-image"),
  14997. c.classList.remove("overlay"),
  14998. h.style.height = "",
  14999. u.style.paddingTop = "",
  15000. t.style.width = "",
  15001. t.style.height = "",
  15002. window.removeEventListener("resize", b),
  15003. c.removeEventListener("click", a),
  15004. g.removeEventListener("click", l),
  15005. f.removeEventListener("click", s),
  15006. o.emit(p.IMAGE_CLOSED),
  15007. o.close(!0))
  15008. }
  15009. function l(e) {
  15010. t.classList.toggle("show-info")
  15011. }
  15012. var c = o.div
  15013. , h = c.getElementsByClassName("tag-content")[0]
  15014. , u = c.getElementsByClassName("tag-media-content")[0]
  15015. , f = t.getElementsByClassName("close")[0]
  15016. , g = h.getElementsByClassName("tag-label")[0];
  15017. c.classList.add("has-image"),
  15018. r.classList.add("view-image"),
  15019. c.classList.add(n.aspect >= 1 ? "image-landscape" : "image-portrait"),
  15020. o.applyOrientation(o.orientation);
  15021. var m = !1
  15022. , A = getComputedStyle(h)
  15023. , y = parseFloat(A.paddingTop) + parseFloat(A.paddingBottom)
  15024. , C = 2 * parseFloat(getComputedStyle(u).paddingLeft)
  15025. , I = h.querySelector(".tag-label")
  15026. , E = h.querySelector(".tag-desc")
  15027. , b = function() {
  15028. var e, t, n = 0;
  15029. return function() {
  15030. clearInterval(e),
  15031. clearTimeout(t),
  15032. e = setInterval(function() {
  15033. var e = c.clientHeight;
  15034. n !== e && (i(),
  15035. n = e)
  15036. }, 100),
  15037. t = setTimeout(clearInterval.bind(this, e), 1e3)
  15038. }
  15039. }();
  15040. n.on(p.IMAGE_OPENING, e),
  15041. o.on(d.ACTIVATE, e),
  15042. o.on(p.IMAGE_CLOSED, n.onClosed.bind(n)),
  15043. o.on(d.CLOSING, s)
  15044. }
  15045. var n = new a
  15046. , r = n.createDomElement();
  15047. this.once(d.OPENED, function() {
  15048. n.load(e.src).then(i).catch(function(t) {
  15049. y.warn("Failed to load image:", e.src),
  15050. y.warn("with error:", t)
  15051. }).then(this.onMediaLoadFinished.bind(this))
  15052. });
  15053. var o = this;
  15054. return r
  15055. }
  15056. ,
  15057. n.prototype.createVideoElement = function(e, t) {
  15058. var i = new s({
  15059. autoPlay: !0,
  15060. autoResume: !0,
  15061. startMuted: !1,
  15062. loop: !1
  15063. })
  15064. , n = i.createDomElement();
  15065. return this.once(d.OPENED, function() {
  15066. i.load(e.src).then(function() {
  15067. this.div.classList.add("has-video"),
  15068. this.state !== I.OPEN && this.state !== I.ACTIVE || (i.show(),
  15069. i.play()),
  15070. this.on(d.OPENING, i.show.bind(i)),
  15071. this.on(d.OPENED, i.play.bind(i)),
  15072. this.on(d.CLOSING, i.pause.bind(i)),
  15073. this.on(d.CLOSED, i.hide.bind(i))
  15074. }
  15075. .bind(this)).catch(function(t) {
  15076. y.warn("Failed to embed video:", e.src),
  15077. y.warn("with error:", t)
  15078. }).then(this.onMediaLoadFinished.bind(this))
  15079. }
  15080. .bind(this)),
  15081. n
  15082. }
  15083. ,
  15084. n.prototype.createEmbedElement = function(e, t) {
  15085. var i = new l
  15086. , n = i.createDomElement();
  15087. return this.once(d.OPENED, function() {
  15088. i.load(e.src).then(function() {
  15089. this.div.classList.add("has-embed"),
  15090. this.state !== I.OPEN && this.state !== I.ACTIVE || i.show(),
  15091. this.applyOrientation(this.orientation),
  15092. this.on(d.OPENING, i.show.bind(i)),
  15093. this.on(d.CLOSED, i.hide.bind(i))
  15094. }
  15095. .bind(this)).catch(function(t) {
  15096. y.warn("Failed to embed:", e.src),
  15097. y.warn("with error:", t)
  15098. }).then(this.onMediaLoadFinished.bind(this))
  15099. }
  15100. .bind(this)),
  15101. n
  15102. }
  15103. ,
  15104. n.prototype.open = function(e) {
  15105. return this.openPromise = $.Deferred(),
  15106. this.state === I.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  15107. this.openTransition ? e && this.setActiveState() : this.openTransition = c.setTimeout(function() {
  15108. this.state !== I.OPEN && (this.emit(d.OPENING),
  15109. e && this.emit(d.ACTIVATING),
  15110. this.state = I.OPENING,
  15111. this.animateOpen(function() {
  15112. e && this.setActiveState(),
  15113. this.openPromise.resolve()
  15114. }
  15115. .bind(this)))
  15116. }
  15117. .bind(this), m.animation.openDelay),
  15118. c.cancel(this.closeTransition),
  15119. this.closePromise && this.closePromise.reject(),
  15120. this.closeTransition = void 0,
  15121. this.openPromise.promise())
  15122. }
  15123. ,
  15124. n.prototype.close = function(e) {
  15125. return this.closePromise = $.Deferred(),
  15126. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = c.setTimeout(function() {
  15127. this.state !== I.CLOSED && (this.emit(d.CLOSING),
  15128. this.state = I.CLOSING,
  15129. this.animateClose())
  15130. }
  15131. .bind(this), m.animation.closeDelay)),
  15132. c.cancel(this.openTransition),
  15133. this.openPromise && this.openPromise.reject(),
  15134. this.openTransition = void 0,
  15135. this.closePromise.resolve(),
  15136. this.closePromise.promise())
  15137. }
  15138. ,
  15139. n.prototype.setActiveState = function() {
  15140. this.state !== I.CLOSED && (this.state = I.ACTIVE,
  15141. this.emit(d.ACTIVATE),
  15142. this.div.classList.remove("has-hotzone"))
  15143. }
  15144. ,
  15145. n.prototype.animateOpen = function(e) {
  15146. if (this.state === I.OPENING) {
  15147. if (c.cancel(this.animationTransition),
  15148. u.detectSamsungNative())
  15149. return this.boardOrientation = null,
  15150. this.div.style.visibility = "visible",
  15151. this.emit(d.OPENED),
  15152. this.state = I.OPEN,
  15153. void (e && e());
  15154. this.div.style.webkitTransform = "scale(0)",
  15155. this.div.style.transform = "scale(0)",
  15156. this.div.style.visibility = "visible",
  15157. this.animationTransition = c.start(h.property(this, "animationScale", 1), m.animation.openDuration, function() {
  15158. this.emit(d.OPENED),
  15159. this.state = I.OPEN,
  15160. e && e()
  15161. }
  15162. .bind(this))
  15163. }
  15164. }
  15165. ,
  15166. n.prototype.animateClose = function(e) {
  15167. this.state === I.CLOSING && (c.cancel(this.animationTransition),
  15168. this.animationTransition = c.start(h.property(this, "animationScale", 0), m.animation.closeDuration, function() {
  15169. this.emit(d.CLOSED),
  15170. this.state = I.CLOSED,
  15171. this.div.style.visibility = "hidden",
  15172. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  15173. e && e()
  15174. }
  15175. .bind(this)))
  15176. }
  15177. ,
  15178. n.prototype.needsUpdate = function() {
  15179. return this.state !== I.CLOSED
  15180. }
  15181. ,
  15182. n.prototype.update = function(e, t) {
  15183. if (this.needsUpdate()) {
  15184. var i = (this.updateOrientation(e),
  15185. this.calcScale(t))
  15186. , n = {
  15187. x: (e.x + 1) * $("#player").width() / 2,
  15188. y: (e.y + 1) * $("#player").height() / 2
  15189. };
  15190. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  15191. this.div.style.webkitTransform = this.div.screenTransform,
  15192. this.div.style.transform = this.div.screenTransform
  15193. }
  15194. }
  15195. ,
  15196. n.prototype.getDimensions = function() {
  15197. return this.div.getBoundingClientRect()
  15198. }
  15199. ,
  15200. n.prototype.calcScale = function(e) {
  15201. return Math.sqrt(e / 40) * m.boardToDiscRatio
  15202. }
  15203. ,
  15204. n.prototype.updateOrientation = function(e) {
  15205. if (this.state !== I.ACTIVE) {
  15206. var t = 1 / 3
  15207. , i = e.y < -t ? 0 : e.y < t ? 1 : 2
  15208. , n = e.x < -t ? 0 : e.x < t ? 1 : 2
  15209. , r = "";
  15210. r += 0 === n ? "right" : 2 === n ? "left" : "",
  15211. r += 0 === i ? "-down" : 2 === i ? "-up" : "",
  15212. 1 === n && (r = 0 === i ? "bottom" : 2 === i ? "top" : "",
  15213. 1 === i && (r = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  15214. 1 === n && 1 === i && r === this.orientation || this.applyOrientation(r)
  15215. }
  15216. }
  15217. ,
  15218. n.prototype.applyOrientation = function(e) {
  15219. this.div.style.transform = this.div.style.webkitTransform = "",
  15220. this.div.classList.remove("tag-container-" + this.orientation),
  15221. this.div.classList.add("tag-container-" + e);
  15222. var t = window.getComputedStyle(this.div);
  15223. this.initialTransform = t.transform || t.webkitTransform,
  15224. "none" === this.initialTransform && (this.initialTransform = "");
  15225. var i = t.transform.slice(7, -1).split(",")
  15226. , n = -i[4]
  15227. , r = -i[5];
  15228. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  15229. this.div.style.transformOrigin = n + "px " + r + "px",
  15230. this.orientation = e
  15231. }
  15232. ,
  15233. t.exports = n
  15234. }
  15235. ).call(this, "/js/tag/Billboard/Billboard.js")
  15236. }
  15237. , {
  15238. "../../util/browser": 182,
  15239. "../../util/lerp": 188,
  15240. "../../util/logger": 189,
  15241. "../../util/transitions": 195,
  15242. "../Media/EmbedlyEmbed": 125,
  15243. "../Media/EmbedlyPlayer": 126,
  15244. "../Media/Image": 128,
  15245. "../Media/Link": 129,
  15246. "../Media/MediaEvent": 131,
  15247. "../Parser/DescriptionChunkType": 133,
  15248. "../Parser/DescriptionParser": 134,
  15249. "./BillboardEvent": 120,
  15250. "./billboardSettings": 121,
  15251. "./overlaySettings": 122,
  15252. events: 202
  15253. }],
  15254. 120: [function(e, t, i) {
  15255. "use strict";
  15256. t.exports = Object.freeze({
  15257. ENTER: "billboard.enter",
  15258. LEAVE: "billboard.leave",
  15259. OPENING: "billboard.opening",
  15260. OPENED: "billboard.open",
  15261. CLOSING: "billboard.closing",
  15262. CLOSED: "billboard.closed",
  15263. ACTIVATING: "billboard.activating",
  15264. ACTIVATE: "billboard.activate"
  15265. })
  15266. }
  15267. , {}],
  15268. 121: [function(e, t, i) {
  15269. "use strict";
  15270. t.exports = Object.freeze({
  15271. animation: Object.freeze({
  15272. hoverOnClosing: !1,
  15273. openDelay: 100,
  15274. closeDelay: 50,
  15275. openDuration: 200,
  15276. closeDuration: 100
  15277. }),
  15278. boardToDiscRatio: 1.2
  15279. })
  15280. }
  15281. , {}],
  15282. 122: [function(e, t, i) {
  15283. "use strict";
  15284. t.exports = Object.freeze({
  15285. boundaryWidth: 30,
  15286. boundaryHeight: 0
  15287. })
  15288. }
  15289. , {}],
  15290. /*********************************创建热点模型************************************************** */
  15291. "hot": [function(e, t, i) {//热点
  15292. "use strict";
  15293. function hot(sid,d,model){
  15294. this.sid = sid;
  15295. this.position = this.conversionArray(d.position);
  15296. this.rotation = this.conversionArray(d.rotation);
  15297. this.link = d.link;
  15298. this.model = model;
  15299. this.size = d.size;
  15300. this.styleTex = [] // 存储热点icon的图片 [{src:...}, {src:...} ] 最多两个,里面是带有src的object, 可以是img
  15301. this.build();
  15302. this.changeTex()
  15303. }
  15304. var r = e("three")
  15305. , f = e("../shaders")
  15306. , a = e("../settings")
  15307. , s = e("../enum/Viewmode")
  15308. , p = e("../objects/Panorama")
  15309. , te = e("../util/texture");
  15310. var raycaster = new r.Raycaster;
  15311. //热点大小
  15312. var geometry = new r.PlaneBufferGeometry( g_HotMeshSize.g_HotMeshWidth, g_HotMeshSize.g_HotMeshHeight,1,1);
  15313. var defaultTex1 = te.load(g_HotImage.point);
  15314. var defaultTex2 = te.load(g_HotImage.point2);
  15315. hot.prototype.changeTex = function(){
  15316. var u = this.mesh.material.uniforms
  15317. if(this.styleTex.length){
  15318. u.texture1.value = te.load(this.styleTex[0].src);
  15319. u.texture2.value = te.load(this.styleTex[1]&&this.styleTex[1].src || this.styleTex[0].src);
  15320. }else{
  15321. u.texture1.value = defaultTex1;
  15322. u.texture2.value = defaultTex2;
  15323. console.log(this.sid)
  15324. }
  15325. }
  15326. hot.prototype.initStyleImg = function(t){
  15327. this.styleTex = []
  15328. t.styleImg = t.styleImg || [];
  15329. t.styleImg.forEach((src)=>{
  15330. this.styleTex.push({src:src})
  15331. })
  15332. this.changeTex()
  15333. }
  15334. //绘制热点
  15335. hot.prototype.build = function(){
  15336. var t = r.UniformsUtils.clone(f.hot.uniforms);
  15337. var shaderMaterial = new r.ShaderMaterial({
  15338. uniforms: t,
  15339. vertexShader: f.hot.vertexShader,
  15340. fragmentShader: f.hot.fragmentShader,
  15341. transparent: !0
  15342. })
  15343. var sprite = new r.Mesh( geometry, shaderMaterial );
  15344. var hotIconScale = parseFloat(window.MP_PREFETCHED_MODELDATA.hotIconScale);
  15345. sprite.dynamic = true;
  15346. sprite.position.copy(new r.Vector3().fromArray(this.position));
  15347. sprite.rotation.copy(new r.Euler().fromArray(this.rotation));
  15348. hotIconScale && sprite.scale.set(hotIconScale, hotIconScale, hotIconScale)
  15349. // this.size && sprite.scale.set(this.size,this.size,this.size);
  15350. sprite.name = this.sid;
  15351. sprite.type = "hotSprite";
  15352. sprite.belongHot = this;
  15353. if(this.link) sprite.hotLink = this.link;
  15354. this.mesh = sprite;
  15355. this.model.add(sprite);
  15356. g_HotMeshes.push(sprite);
  15357. }
  15358. hot.prototype.closestPanoTowardTag = function(e, t) {
  15359. var i = []
  15360. , o = []
  15361. , l = this.mesh.position;
  15362. if (e === s.PANORAMA) {
  15363. var c = .5
  15364. , h = t.position.clone().sub(l).normalize();
  15365. // 方奕卓 注释掉下面的筛选条件, 使热点列表能点击过渡
  15366. // i.push(p.filters.isPanoAligned()),
  15367. // i.push(p.filters.inPanoDirection(l, h, c)),
  15368. // i.push(p.filters.isNeighbourPanoTo(t)),
  15369. o.push(p.scoreFunctions.direction(l, h))
  15370. }
  15371. var u = new r.Vector3
  15372. , d = function(e) {
  15373. u.copy(l).sub(e.position);
  15374. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  15375. , i = a.tags.navigate.tiltTolerance;
  15376. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  15377. }
  15378. , f = function(e) {
  15379. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  15380. };
  15381. i.push(f, d, (pano)=>{ // add
  15382. return player.checkHasNeighbor(pano)
  15383. }),
  15384. o.push(p.scoreFunctions.distanceSquared(this.mesh, -2));
  15385. var g = t.model.panos.sortByScore(i, o);
  15386. if (g && a.tags.navigate.lineOfSight) {
  15387. for (var m = 0; m < g.length; m++) {
  15388. var v = g[m].pano
  15389. , A = v.position.distanceTo(l);
  15390. raycaster.set(v.position, l.clone().sub(v.position).normalize());
  15391. var y = raycaster.intersectObjects(t.model.colliders);
  15392. // return g[0].pano;
  15393. if (0 === y.length || y[0].distance > A) {
  15394. console.log(m);
  15395. return v
  15396. }
  15397. }
  15398. return null
  15399. }
  15400. return g && g.length > 0 && g[0].pano
  15401. },
  15402. hot.prototype.examine = function(e, hotListSta) {
  15403. var hotPop = document.getElementById('popup');
  15404. //获取那个热点的链接
  15405. if(this.link){
  15406. g_currentHot = this;
  15407. hotPop.style.display = "block";
  15408. hotPop.classList.add("wait");
  15409. var myElement = document.createElement("iframe");
  15410. //打开热点的时候把背景音乐关闭了,避免与热点里面的音乐冲突
  15411. //g_bgAudio && g_bgAudio.pause();
  15412. if(g_bgAudio && !g_bgAudio.paused){
  15413. manage.switchBgmState(false);
  15414. g_bgAudio.pauseByHot = true
  15415. }
  15416. if(g_tourAudio)g_tourAudio.pause()
  15417. //给热点后面加上随机数,让热点确保是最新的
  15418. var hotLinkParameter = this.link.substring(this.link.indexOf("html")+4);
  15419. //如果热点的内容是英文版的
  15420. var lang = manage.number("lang") == "en" ? "&lang="+ manage.number("lang") : "" ;
  15421. hotLinkParameter.indexOf("?") == -1 ? myElement.src = this.link + "?time="+randomTime().getTime() + "&id=" + window.number +lang : myElement.src = this.link + "&time="+randomTime().getTime() + "&id=" + window.number + lang;
  15422. myElement.id = "id1";
  15423. myElement.allowTransparency = "true";
  15424. // myElement.scrolling = "no";
  15425. var element=document.getElementById("id1"); //判断页面是否有iframe
  15426. if (typeof(element)== "undefined" || element == null){
  15427. document.querySelector(".popup-content").appendChild(myElement);
  15428. //移动端自动播放
  15429. var videoLoaddingResult = false
  15430. window.loaddingSuccess = function() {
  15431. videoLoaddingResult = true
  15432. }
  15433. setTimeout(function func() {
  15434. if (videoLoaddingResult) {
  15435. var $iframe = document.querySelector('#id1').contentWindow.document;
  15436. if($iframe.querySelector('video')){
  15437. $iframe.querySelector('video').play();
  15438. // alert($iframe.querySelector('video'));
  15439. if(!$iframe.querySelector('video').paused && $iframe.querySelector('.playPause')){
  15440. $iframe.querySelector('.playPause').classList.add("fa-pause");
  15441. }
  15442. }
  15443. if($iframe.querySelector('audio')){
  15444. $iframe.querySelector('audio').play();
  15445. }
  15446. } else {
  15447. setTimeout(func, 300)
  15448. }
  15449. }, 800);
  15450. }
  15451. //setTimeout(function(){$('#player').on("click",e.closePopup);},20)
  15452. }
  15453. // if(hotListSta) {
  15454. // hotPop.classList.remove("wait");
  15455. // return;
  15456. // }
  15457. var t = e.mode
  15458. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  15459. , n = this.mesh.position;
  15460. e.flyingToTag = true;
  15461. var o = function() {
  15462. e.flyingToTag = false;
  15463. if(this.link){
  15464. hotPop.classList.remove("wait");
  15465. }
  15466. }.bind(this);
  15467. if (t === s.PANORAMA){
  15468. var l = {
  15469. pano: i,
  15470. lookAtPoint: n,
  15471. duration: null,
  15472. maxDistanceOverride: null,
  15473. skipWarpingCheck: !1
  15474. };
  15475. e.flyToPano(l, o)
  15476. }else {
  15477. var c = {
  15478. pano: i
  15479. };
  15480. if (n) {
  15481. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  15482. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  15483. }
  15484. c.callback = o,
  15485. c.duration = 1500,
  15486. c.mode = s.PANORAMA,
  15487. e.flyToNewMode(c)
  15488. }
  15489. },
  15490. //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
  15491. // if(window.MP_PREFETCHED_MODELDATA.special){
  15492. // specialScene.special().beforeImplement();
  15493. // }
  15494. //czj 判断是否是数组 如果不是将对象转换为数组
  15495. hot.prototype.conversionArray = function(obj){
  15496. if(Object.prototype.toString.call(obj)=='[object Array]') return obj;
  15497. var arr = []
  15498. for (var i in obj) {
  15499. arr.push(obj[i]); //属性
  15500. }
  15501. return arr
  15502. }
  15503. t.exports = hot;
  15504. }
  15505. , {
  15506. three: 217,
  15507. "../shaders":167,
  15508. "../enum/Viewmode":51,
  15509. "../objects/Panorama":148,
  15510. "../util/texture":194,
  15511. "../settings":166
  15512. }],
  15513. /************************************创建热点模型************************************ */
  15514. 123: [function(e, t, i) {//tag
  15515. (function(i) {
  15516. "use strict";
  15517. function n(e, t, i) {
  15518. var n = i.version || "0";
  15519. "0" !== n && I.info("tag defined using version " + n),
  15520. this.model = e,
  15521. this.sid = t,
  15522. this.color = (new r.Color).set(i.color || l.tagDefault),
  15523. this.hoverColor = l._darken(this.color, .2),
  15524. this.floor = null,
  15525. this.floorIndex = i.floor,
  15526. this.mode = s.PANORAMA,
  15527. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15528. this.obj3d = null,
  15529. this.disc = null,
  15530. this.materials = {
  15531. disc: null,
  15532. pole: null
  15533. },
  15534. this.position = (new r.Vector3).copy(i.position),
  15535. this.discPosition = (new r.Vector3).copy(i.stem.direction),
  15536. this.discWorldPosition = null,
  15537. this.discScale = .05,
  15538. this.poleEnabled = i.stem.enabled,
  15539. this.billboard = new o(i.label,i.description,i.media,this),
  15540. this.visibleTransition = null,
  15541. this.hoveringDisc = !1
  15542. }
  15543. var r = e("three")
  15544. , o = e("./Billboard/Billboard")
  15545. , a = e("../settings")
  15546. , s = e("../enum/Viewmode")
  15547. , l = e("../enum/Colors")
  15548. , c = e("../enum/RenderLayers")
  15549. , h = e("../enum/RenderOrder")
  15550. , u = (e("../util/common"),
  15551. e("../util/math"))
  15552. , d = e("../util/texture")
  15553. , p = e("../objects/Panorama")
  15554. , f = e("../shaders")
  15555. , g = e("../util/transitions")
  15556. , m = e("../util/lerp")
  15557. , v = e("../util/easing")
  15558. , A = e("./Billboard/BillboardEvent")
  15559. , y = e("events").EventEmitter
  15560. , C = e("../util/logger")
  15561. , I = new C(i)
  15562. , E = d.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QYPFigDGhCnowAABQFJREFUeNrtXTtyFEEMHXX5FK7iAiYFQ+KAiMyZCQnxRXwVFwkngSKD2BQXEYlNLXaZnZ7RX0/xbrek96RW9/RnWSCthSoaxcys4iwiAgGagN2FFATQe5OBAHpvMhBA700GAvC9iUBVgZd2dmTd9siIAvxOB9/RI9GI3kftf3a0t0YG2OOEaOk0qy2UyWFZKutMthGc09tWiuyQKkuvke2miE6ouOYe1QcE4HsTgSIY2gX4iP4ZHcFn5kt+KpfmFfhK2zXXDMgR/FdE9D3ivNyaqMz8YlmW3x46kIfjNQyxXlnzskG6X8psQJjlVGObJPtLqXj1DSGWvhyZFI70EUVTv3tf3VkEAWmDLwV8xmmehe17+6DIymFHkL6fKaJS2BFk5+8RzUlVwY9qG0ViY2XwLfyzpV2KoEQX4C18NdsmAfzeJBiRDekg3ruGhpCi7wC+eXH4XqI9kc+Rs4wE+DZ+XNPeiKY0MoHtUHCyU6nTLOBnISoz84yuRETP6bqmLdrjiMhOjXw0zJKsx9oaxcC/1j4atizLdaah4GidYEEAbfC9NpVGsmsrVgTwe5PgZEkqUbaSP+iRds9CxuiPeo4ggr2z2A1Efg/dNs0CokV/Bgd7b3mf7X9EWQCpFF2ZhqiZDHDqFf0p79/zXYhajRWt7cgr/Wc/OOrli7U4DmllAb6eDRr4jKhAVDoyHtl/otNAfOrNt9YwIoJX8lr2QDYdYh1xIehN4QB+G46YUtW/2GHF4tfFWPvpGK7RMsCvBsP4F2SAptHv4atVGQDVe9/ZxLEh4AOiP+aMYMLnH48OAUj/fYeBsUBaCwgAAtQYEzvWAcgAEBAA4kwArCHknkkgAyADQEAACAgAAQEgIMC8dH3vJ4JI+B4ZABkAAgI4S8fFpCg2IwMgA0BAgOfT1BVclH6o+S+GR++3wbawmOO/BC5/t4RhLt93DWFUiwxU/ygCIZIEsH4FnJk/FY5+Edsk6zJa82McEI2V/qUKwH8yQNTz6wBfrwAUrwEwm7AFz6wI9GBvpSwQ2X9Dml3RbsWqBL4GPjOvhp2hHsihOzO/1FgH+Dnx2/PuJFDQecanP1ZnhBnlcVl0Dttn8Btahnnfmg3w5YcAzKcLDlVp3wyKNhxkfC1kWRK/GfRgbPVHo7RlbGGedy3wWBdmvnEA/qb0s3GSw4BlpFgQLqIdKgTISgINIrR8OnZFxxeRa4RDsf6/oZ27MCBthlUrmipFv8g6gMeb9wBfLphEnoxh5luQwBz8W4n2TNMNhgMb3820J7YUvAVMZAL/wBHvHJnAF/zZNkkj2rdGdhciaPlnS7ubUzBIkB980RpAaoGicl2wA3y1U9q0E2TWBLNKNtD2w572h6Zh96uoF3vaz5wR9urPzBfaQSZ1no8NouD1sixfk2B/TkTfovtUjACWCkceGiztk+rL/JNpxYMj1jZJ9ueyc7fCjmEvG1zOBko75r44vJXu91C0CjqN9pn51itw1Cps64slJHSLpIuVbmoLQTOXGFjvLKJnxBj4iwhBQlEY7hWBHhLJJ9TRaADvQIAtlXoVIkS2m6I7IzMRMthqfjh0S8F1sDv7LAHoZ1u2knt990h7rq7S4VBPWyi787ycWOVy7DCvh0t8M38kV4JgX0meFIr0mTtkcVV1W1jEYjZ0dY0dQc0JkJkMWaaubebXAL0QASKRIftqJa5lbwQ2BPJE/gA4gL5xbiNHuQAAAABJRU5ErkJggg==")
  15563. , b = d.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QYPFgoIKnA4CwAAAkVJREFUeNrt3Uluw0AMRFHTvv+NrSibBAgyILGjodn16gbS/yxyYUOXi0SnZnyodV3XXV5WVREgBHaKFAV6tgwFerYMBXq2DAV8tggFfLYIBXy2CAV8tggFfrYEBXy2CAV+tgQFfrYEBXy2CAV+tgQFfrYEBX62BAV+tgQFfrYEBX62BAV+tgQFfrYEBX62BAV+tgRXry5cHNOf3QIFfrYEBX62BG4AN4DpT26BAj9bAivACjD9yS2gATSA6U9uAQ2gAUx/cgtoAA1g+pNbQAOEhwBWgPpPXgMawAoQK0D9x64BDWAFiBWg/mPXgAawAoQAQgAJPgIdgLmHoAawAoQAQgAhgBBACCAEEAIIAYQAQgAhgBBACCAEEAIIAYQAQgAhgEwQfw1LBe+vYUIAIQAB3rIsy4vXEXwEOgTzDkArQAhgBXyKNZBT/xpACGAFfBNrIKP+NYAQwAr4IdbA/PWvAcR3A5OnXwOIbwcnT78GkN8bQAvMO/1/bgA/FglvAC0w5/Q/JAAJ5oPvCJTHGkALzDX9TwlAgnngPy0ACeaA7waQ5xtAC/Sf/n8LQILe8DcRgAR94W8mAAl6wt9UABL0g7+5ACToBX8XAUjQB/5uApCgB/xdBSDB+PB3F4AEY8M/RAAijAn+cAFIMB78wwUgwVjwTxGACGOAf8/1zAf2a+Nz4Z/aANrgXPBDCZAmwgjghxRgdhFGAj+0ALOJMCL4FgJ0lmFk6C0F6CBDF+jtBfiY+/2+3G63K+ihAhzZEN1hi3zJK04kLKvtOfg1AAAAAElFTkSuQmCC")
  15564. , w = new r.PlaneBufferGeometry(1,1);
  15565. n.prototype = Object.create(y.prototype),
  15566. n.raycaster = new r.Raycaster,
  15567. n.prototype.bindEvents = function() {
  15568. this.billboard.on(A.ENTER, this.setHoverState.bind(this)),
  15569. this.billboard.on(A.LEAVE, this.setFreeState.bind(this))
  15570. }
  15571. ,
  15572. n.prototype.build = function() {
  15573. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15574. this.floor && (this.billboard.build(this.model.sid),
  15575. this.obj3d = this.buildObject3D(),
  15576. this.floor.add(this.obj3d)),
  15577. this
  15578. }
  15579. ,
  15580. n.prototype.buildObject3D = function() {
  15581. var e = new r.Object3D;
  15582. e.position.copy(this.position);
  15583. var t = r.UniformsUtils.clone(f.tagDisc.uniforms);
  15584. t.bg.value = b,
  15585. t.mask.value = E,
  15586. t.color.value.copy(this.color),
  15587. this.materials.disc = new r.RawShaderMaterial({
  15588. transparent: !0,
  15589. vertexShader: f.tagDisc.vertexShader,
  15590. fragmentShader: f.tagDisc.fragmentShader,
  15591. uniforms: t
  15592. }),
  15593. this.disc = new r.Mesh(w,this.materials.disc),
  15594. this.disc.layers.set(c.TAG),
  15595. this.disc.position.copy(this.discPosition),
  15596. this.disc.renderOrder = h.tagDisc,
  15597. this.disc.tag = this;
  15598. var i = this.buildPole();
  15599. return i.layers.set(c.TAG),
  15600. i.renderOrder = h.tagStem,
  15601. e.add(i),
  15602. e.layers.set(c.TAG),
  15603. e.add(this.disc)
  15604. }
  15605. ,
  15606. n.prototype.buildPole = function() {
  15607. var e = new r.BufferGeometry
  15608. , t = new Float32Array(6);
  15609. return t[0] = t[1] = t[2] = 0,
  15610. t[3] = this.discPosition.x,
  15611. t[4] = this.discPosition.y,
  15612. t[5] = this.discPosition.z,
  15613. e.addAttribute("position", new r.BufferAttribute(t,3)),
  15614. this.materials.pole = new r.LineBasicMaterial({
  15615. linewidth: a.tags.pole.width,
  15616. color: a.tags.pole.color,
  15617. opacity: 0,
  15618. visible: this.poleEnabled,
  15619. transparent: !0,
  15620. depthWrite: !1
  15621. }),
  15622. new r.Line(e,this.materials.pole)
  15623. }
  15624. ,
  15625. n.prototype.setFreeState = function(e) {
  15626. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15627. this.materials.disc.uniforms.color.value = this.color
  15628. }
  15629. .bind(this))
  15630. }
  15631. ,
  15632. n.prototype.setHoverState = function(e) {
  15633. this.billboard.open(e),
  15634. this.materials.disc.uniforms.color.value = this.hoverColor
  15635. }
  15636. ,
  15637. n.prototype.hide = function(e, t) {
  15638. var i = $.Deferred();
  15639. if (0 === this.materials.disc.uniforms.opacity.value && !g.isRunning(this.visibleTransition))
  15640. return i.resolve().promise();
  15641. e = e || 0,
  15642. t = t || 0,
  15643. g.cancel(this.visibleTransition);
  15644. var n = this.materials.disc.uniforms.opacity.value / a.tags.disc.opacity
  15645. , r = t + e
  15646. , o = t / r;
  15647. return this.visibleTransition = g.start(function(e) {
  15648. var t = m.property(e.materials.disc.uniforms.opacity, "value", 0)
  15649. , i = m.property(e.materials.pole, "opacity", 0);
  15650. return function(n) {
  15651. t(n),
  15652. e.materials.pole && i(n)
  15653. }
  15654. }(this), r * n, function() {
  15655. i.resolve()
  15656. }, o, v[a.warp.blendEasing]),
  15657. i.promise()
  15658. }
  15659. ,
  15660. n.prototype.show = function(e, t) {
  15661. var i = $.Deferred();
  15662. if (this.materials.disc.uniforms.opacity.value === a.tags.disc.opacity && !g.isRunning(this.visibleTransition))
  15663. return i.resolve().promise();
  15664. e = e || 0,
  15665. t = t || 0,
  15666. g.cancel(this.visibleTransition);
  15667. var n = (a.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / a.tags.disc.opacity
  15668. , r = t + e
  15669. , o = t / r;
  15670. return this.visibleTransition = g.start(function(e) {
  15671. var t = m.property(e.materials.disc.uniforms.opacity, "value", a.tags.disc.opacity)
  15672. , i = m.property(e.materials.pole, "opacity", a.tags.pole.opacity);
  15673. return function(n) {
  15674. t(n),
  15675. e.materials.pole && i(n)
  15676. }
  15677. }(this), r * n, function() {
  15678. i.resolve()
  15679. }, o, v[a.warp.blendEasing]),
  15680. i.promise()
  15681. }
  15682. ,
  15683. n.prototype.closestPanoTowardTag = function(e, t) {
  15684. var i = []
  15685. , o = []
  15686. , l = this.disc.getWorldPosition();
  15687. if (e === s.PANORAMA) {
  15688. var c = .5
  15689. , h = t.position.clone().sub(l).normalize();
  15690. i.push(p.filters.isPanoAligned()),
  15691. i.push(p.filters.inPanoDirection(l, h, c)),
  15692. i.push(p.filters.isNeighbourPanoTo(t)),
  15693. o.push(p.scoreFunctions.direction(l, h))
  15694. }
  15695. var u = new r.Vector3
  15696. , d = function(e) {
  15697. u.copy(l).sub(e.position);
  15698. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  15699. , i = a.tags.navigate.tiltTolerance;
  15700. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  15701. }
  15702. , f = function(e) {
  15703. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  15704. };
  15705. i.push(f, d),
  15706. o.push(p.scoreFunctions.distanceSquared(this, -2));
  15707. var g = this.model.panos.sortByScore(i, o);
  15708. if (a.tags.navigate.lineOfSight) {
  15709. for (var m = 0; m < g.length; m++) {
  15710. var v = g[m].pano
  15711. , A = v.position.distanceTo(l);
  15712. if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance)
  15713. return null;
  15714. n.raycaster.set(v.position, l.clone().sub(v.position).normalize());
  15715. var y = n.raycaster.intersectObjects(this.model.colliders);
  15716. if (0 === y.length || y[0].distance > A)
  15717. return v
  15718. }
  15719. return null
  15720. }
  15721. return g.length > 0 && g[0].pano
  15722. }
  15723. ,
  15724. n.prototype.examine = function(e) {
  15725. var t = e.mode
  15726. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  15727. , n = this.disc.getWorldPosition();
  15728. this.billboard.setActiveState();
  15729. var o = function() {
  15730. var t = this.billboard.getDimensions()
  15731. , n = new r.Vector3;
  15732. u.convertScreenPositionToNDC(t.left + t.width / 2, t.top + t.height / 2, n),
  15733. n.unproject(e.camera),
  15734. e.flyToPano({
  15735. pano: i,
  15736. lookAtPoint: n
  15737. })
  15738. }
  15739. .bind(this);
  15740. if (t === s.PANORAMA)
  15741. if (i !== e.currentPano) {
  15742. var l = {
  15743. pano: i,
  15744. lookAtPoint: n,
  15745. duration: null,
  15746. maxDistanceOverride: null,
  15747. skipWarpingCheck: !1
  15748. };
  15749. e.flyToPano(l, o)
  15750. } else
  15751. setTimeout(function() {
  15752. this.billboard.open().then(function() {
  15753. o()
  15754. })
  15755. }
  15756. .bind(this), 0);
  15757. else {
  15758. var c = {
  15759. pano: i
  15760. };
  15761. if (n) {
  15762. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  15763. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  15764. }
  15765. c.callback = o,
  15766. c.duration = 1500,
  15767. c.mode = s.PANORAMA,
  15768. e.flyToNewMode(c)
  15769. }
  15770. }
  15771. ,
  15772. n.prototype.update = function(e, t) {
  15773. var i = new r.Vector3;
  15774. return function(e, t) {
  15775. this.discWorldPosition = this.disc.getWorldPosition(),
  15776. this.updateDisc(e, t),
  15777. this.billboard.needsUpdate() && (i.copy(this.discWorldPosition).project(t),
  15778. i.z < 1 && (i.y *= -1,
  15779. this.billboard.update(i, this.getDiscRadius(i, t))))
  15780. }
  15781. }(),
  15782. n.prototype.updateDisc = function(e, t) {
  15783. var i = new r.Vector3
  15784. , o = new r.Vector3
  15785. , l = new r.Vector3
  15786. , c = new r.Vector3
  15787. , h = new r.Vector3;
  15788. return function(e, t) {
  15789. var u = a.tags.visibility
  15790. , d = a.tags.disc.scale
  15791. , p = e === s.DOLLHOUSE || e === s.FLOORPLAN ? a.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15792. if (this.obj3d.visible = 0 !== this.disc.material.opacity && (u.anyDistance || p <= u.visibleDistance || e === s.TRANSITIONING) && (!u.hideViaFloor || this.tagVisibleOnCurrentFloor(e)) && (!u.hideOffScreenDisc || !this.offScreen(this.disc, t)) && (!u.hideOffScreenObject || !this.offScreen(this.obj3d, t)),
  15793. this.obj3d.visible) {
  15794. this.disc.quaternion.copy(t.quaternion);
  15795. var f = d.maxSize - (d.maxSize - d.minSize) * r.Math.smoothstep(p, d.nearBound, d.farBound);
  15796. i.copy(this.discWorldPosition).project(t),
  15797. o.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(i),
  15798. l.set(f / 2, 0, 0).add(o),
  15799. c.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(l),
  15800. h.copy(c).unproject(t);
  15801. var g = h.distanceTo(this.discWorldPosition)
  15802. , m = 1 + a.tags.disc.scale.responsiveness / 100 * (n.viewportScale() - 1);
  15803. this.discScale = g * m,
  15804. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15805. }
  15806. }
  15807. }(),
  15808. n.prototype.getDiscRadius = function(e, t) {
  15809. var i = new r.Vector3;
  15810. return function(e, t) {
  15811. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15812. Math.abs(e.x - i.x) * $("#player").width()
  15813. }
  15814. }(),
  15815. n.prototype.tagVisibleOnCurrentFloor = function(e) {
  15816. return !(e === s.DOLLHOUSE || e === s.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15817. }
  15818. ,
  15819. n.prototype.offScreen = function(e, t) {
  15820. var i = e.getWorldPosition().project(t);
  15821. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15822. }
  15823. ,
  15824. n.viewportScale = function() {
  15825. return n.viewportWidth === $("#player").width() && n.viewportHeight === $("#player").height() || (n.viewportWidth = $("#player").width(),
  15826. n.viewportHeight = $("#player").height(),
  15827. n.currentViewportScale = Math.sqrt(Math.min(n.viewportWidth, n.viewportHeight) / a.tags.disc.scale.baseViewportSize)),
  15828. n.currentViewportScale
  15829. }
  15830. ,
  15831. t.exports = n
  15832. }
  15833. ).call(this, "/js/tag/tag.js")
  15834. }
  15835. , {
  15836. "../enum/Colors": 19,
  15837. "../enum/RenderLayers": 41,
  15838. "../enum/RenderOrder": 42,
  15839. "../enum/Viewmode": 51,
  15840. "../objects/Panorama": 148,
  15841. "../settings": 166,
  15842. "../shaders": 167,
  15843. "../util/common": 185,
  15844. "../util/easing": 186,
  15845. "../util/lerp": 188,
  15846. "../util/logger": 189,
  15847. "../util/math": 190,
  15848. "../util/texture": 194,
  15849. "../util/transitions": 195,
  15850. "./Billboard/Billboard": 119,
  15851. "./Billboard/BillboardEvent": 120,
  15852. events: 202,
  15853. three: 217
  15854. }],
  15855. 124: [function(e, t, i) {
  15856. (function(i) {
  15857. "use strict";
  15858. function n() {
  15859. this.tagState = y.IDLE,
  15860. this.intersectTag = null,
  15861. this.hoveredTag = null,
  15862. this.activeTag = null,
  15863. this.tagDiscs = [],
  15864. this.raycaster = new r.Raycaster,
  15865. this.modelManager = null,
  15866. this.player = null,
  15867. this.totaltags = 0,
  15868. this.navigatingViaTag = !1,
  15869. this.enabled = !1
  15870. }
  15871. var r = e("three")
  15872. , o = e("../util/logger")
  15873. , a = e("../util/common")
  15874. , s = e("../controls/serializer")
  15875. , l = e("../objects/Snapshot")
  15876. , c = e("../settings")
  15877. , h = e("./Billboard/BillboardEvent")
  15878. , u = e("./Media/MediaEvent")
  15879. , d = e("./Media/LinkType")
  15880. , p = e("../enum/Viewmode")
  15881. , f = e("../enum/WarpStyle")
  15882. , g = e("../enum/BlackoutStyle")
  15883. , m = e("../enum/ModelManagerEvents")
  15884. , v = e("../enum/tagEvents")
  15885. , A = e("../enum/PlayerEvents")
  15886. , y = (e("../util/lerp"),
  15887. e("../enum/TagStates"))
  15888. , C = e("events").EventEmitter
  15889. , I = new o(i);
  15890. a.extend(n, C),
  15891. n.prototype.init = function(e, t) {
  15892. this.modelManager = e,
  15893. this.player = t,
  15894. this.updateModel(),
  15895. this.bindEvents()
  15896. }
  15897. ,
  15898. n.prototype.update = function(e) {
  15899. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15900. }
  15901. ,
  15902. n.prototype.updateTags = function(e, t, i, n) {
  15903. for (var r in this.model.tags)
  15904. this.model.tags[r].update(e, t, i, n)
  15905. }
  15906. ,
  15907. n.prototype.updateModel = function() {
  15908. this.model = this.modelManager.getActiveModel(),
  15909. this.gettagsFromModel(),
  15910. this.totaltags = Object.keys(this.model.tags).length
  15911. }
  15912. ,
  15913. n.prototype.gettagsFromModel = function() {
  15914. this.tagDiscs = [];
  15915. for (var e in this.model.tags) {
  15916. var t = this.model.tags[e].disc;
  15917. t && this.tagDiscs.push(t)
  15918. }
  15919. }
  15920. ,
  15921. n.prototype.bindEvents = function() {
  15922. function e() {
  15923. Object.keys(this.model.tags).forEach(function(e) {
  15924. var t = this.model.tags[e];
  15925. t.bindEvents(),
  15926. t.billboard.on(u.LINK_CLICK, function(e) {
  15927. e.type === d.NAVIGATION && this.navigateViaLink(e.url)
  15928. }
  15929. .bind(this)),
  15930. t.billboard.on(u.IMAGE_OPENED, function() {
  15931. this.tagState = y.EXAMINE,
  15932. this.emit(u.IMAGE_OPENED)
  15933. }
  15934. .bind(this)),
  15935. t.billboard.on(h.CLOSING, this.dismissExaminedTag.bind(this))
  15936. }
  15937. .bind(this))
  15938. }
  15939. this.modelManager.on(m.ActiveModelChanged, this.updateModel.bind(this)),
  15940. this.modelManager.on(m.ActiveModelChanged, e.bind(this)),
  15941. this.player.on(A.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15942. this.player.on(A.PanoChosen, this.onPanoChange.bind(this)),
  15943. this.player.on(A.Ready, this.onPlayerReady.bind(this)),
  15944. this.player.on(A.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15945. this.player.on(A.WarpStarted, this.handleWarpStart.bind(this)),
  15946. this.player.on(A.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15947. e.call(this)
  15948. }
  15949. ,
  15950. n.prototype.navigateViaLink = function(e) {
  15951. var t = s.deserialize(e);
  15952. if (t)
  15953. if (t.mode === p.PANORAMA) {
  15954. try {
  15955. this.player.model.panos.get(t.panoId)
  15956. } catch (e) {
  15957. return void I.warn("Unable to find panorama location", t.panoId)
  15958. }
  15959. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, f.BLACK)
  15960. } else {
  15961. var i = {
  15962. cameraMode: t.mode,
  15963. position: t.position,
  15964. quaternion: t.quaternion,
  15965. scanId: t.panoId,
  15966. orthoZoom: t.zoom,
  15967. floorVisibility: t.floorVisibility,
  15968. thumbUrl: null,
  15969. name: null
  15970. };
  15971. this.player.flyToNewMode({
  15972. mode: t.mode,
  15973. duration: c.warp.outsideTime,
  15974. warpDest: new l(i),
  15975. force: !0
  15976. })
  15977. }
  15978. }
  15979. ,
  15980. n.prototype.handleWarpStart = function(e, t, i, n) {
  15981. this.dismissExaminedTag(),
  15982. t === f.BLACK && (null !== n && void 0 !== n || (n = c.warp.teleportTime),
  15983. e && (i = g.END),
  15984. this.hideShowTagsForBlackoutStyle(i, n))
  15985. }
  15986. ,
  15987. n.prototype.handleWarpInterruption = function(e, t, i) {
  15988. null !== i && void 0 !== i || (i = c.warp.teleportTime),
  15989. this.hideShowTagsForBlackoutStyle(t, i)
  15990. }
  15991. ,
  15992. n.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15993. var i = 0
  15994. , n = 0
  15995. , r = t / 2;
  15996. switch (null !== e && void 0 !== e || (e = g.MIDDLE),
  15997. e) {
  15998. case g.END:
  15999. this.hideAlltags(r);
  16000. break;
  16001. case g.BEGINNING:
  16002. this.hideAlltags().done(this.showAlltags.bind(this, r));
  16003. break;
  16004. case g.NONE:
  16005. break;
  16006. case g.MIDDLE:
  16007. i = r,
  16008. n = r,
  16009. this.hideAlltags(n),
  16010. setTimeout(function() {
  16011. this.showAlltags(i)
  16012. }
  16013. .bind(this), n);
  16014. break;
  16015. case g.FADEIN:
  16016. setTimeout(function() {
  16017. this.showAlltags(r)
  16018. }
  16019. .bind(this), r)
  16020. }
  16021. }
  16022. ,
  16023. n.prototype.onPlayerModeChanging = function(e, t) {
  16024. t !== p.PANORAMA && this.dismissExaminedTag(),
  16025. t === p.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = p.OUTDOOR);
  16026. var i = t !== p.OUTDOOR;
  16027. i !== this.model.tagsShown && (i ? this.showAlltags(c.tags.startup.fadeInDuration) : this.hideAlltags(c.tags.startup.fadeInDuration))
  16028. }
  16029. ,
  16030. n.prototype.onPanoChange = function(e, t) {
  16031. var i = this.navigatingViaTag;
  16032. if (this.navigatingViaTag = !1,
  16033. !i) {
  16034. this.dismissExaminedTag();
  16035. var n = e && !e.isAligned() ? p.OUTDOOR : p.PANORAMA
  16036. , r = t && !t.isAligned() ? p.OUTDOOR : p.PANORAMA;
  16037. n !== r && (r === p.PANORAMA ? this.showAlltags(c.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(c.tags.startup.fadeInDuration))
  16038. }
  16039. }
  16040. ,
  16041. n.prototype.onPlayerReady = function(e, t, i) {
  16042. this.startAlltags(e, t ? i : null)
  16043. }
  16044. ,
  16045. n.prototype.onPlayerFlyingEnded = function(e, t) {
  16046. this.updateClosestTags(e)
  16047. }
  16048. ,
  16049. n.prototype.dismissExaminedTag = function() {
  16050. this.activeTag && this.tagState === y.EXAMINE && this.dismissActiveTag(),
  16051. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  16052. this.hoveredTag = null)
  16053. }
  16054. ,
  16055. n.prototype.startAlltags = function(e, t) {
  16056. this.model.shouldShowtags = c.tags.enabled,
  16057. this.enabled = !0,
  16058. e || (this.showAlltags(c.tags.startup.fadeInDuration, c.tags.startup.fadeInDelay),
  16059. t && setTimeout(function() {
  16060. this.activateTag(this.model.getTagBySid(t))
  16061. }
  16062. .bind(this), c.tags.startup.fadeInDuration / 2))
  16063. }
  16064. ,
  16065. n.prototype.showAlltags = function(e, t, i) {
  16066. function n() {
  16067. o++,
  16068. o === this.totaltags && (this.model.tagsShown = !0,
  16069. r.resolve())
  16070. }
  16071. var r = $.Deferred();
  16072. if (!i && this.player.mode === p.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  16073. return r.resolve().promise();
  16074. var o = 0;
  16075. for (var a in this.model.tags) {
  16076. var s = this.model.tags[a];
  16077. s.show(e, t).done(n.bind(this))
  16078. }
  16079. return r.promise()
  16080. }
  16081. ,
  16082. n.prototype.hideAlltags = function(e, t) {
  16083. function i() {
  16084. r++,
  16085. r === this.totaltags && (this.model.tagsShown = !1,
  16086. n.resolve())
  16087. }
  16088. var n = $.Deferred()
  16089. , r = 0;
  16090. for (var o in this.model.tags) {
  16091. var a = this.model.tags[o];
  16092. a.hide(e, t).done(i.bind(this)),
  16093. a === this.activeTag && this.dismissActiveTag()
  16094. }
  16095. return n.promise()
  16096. }
  16097. ,
  16098. n.prototype.enableHovering = function() {
  16099. this.enabled = !0
  16100. }
  16101. ,
  16102. n.prototype.disableHovering = function() {
  16103. this.enabled = !1
  16104. }
  16105. ,
  16106. n.prototype.activateTag = function(e, t) {
  16107. t = t || y.EXAMINE,
  16108. this.activeTag = e,
  16109. this.activeTag.hoveringDisc = !0,
  16110. this.activeTag.setHoverState(t === y.EXAMINE),
  16111. this.tagState = t,
  16112. this.emit(v.TagActivated, e)
  16113. }
  16114. ,
  16115. n.prototype.dismissActiveTag = function() {
  16116. this.activeTag.hoveringDisc = !1,
  16117. this.activeTag.setFreeState(!0);
  16118. var e = this.activeTag;
  16119. this.activeTag = null,
  16120. this.tagState = y.IDLE,
  16121. this.emit(v.TagDismissed, e)
  16122. }
  16123. ,
  16124. n.prototype.clickedOnTag = function(e) {
  16125. var t = function() {
  16126. this.navigatingViaTag = !0,
  16127. this.activeTag.examine(this.player),
  16128. this.emit(v.TagNavigation, this.activeTag)
  16129. }
  16130. .bind(this);
  16131. return this.tagState !== y.EXAMINE ? (this.activateTag(this.intersectTag, y.EXAMINE),
  16132. this.activeTag = this.intersectTag,
  16133. t(),
  16134. !0) : (this.dismissActiveTag(),
  16135. !1)
  16136. }
  16137. ,
  16138. n.prototype.intersecttag = function() {
  16139. var e = new r.Vector3
  16140. , t = new r.Vector3
  16141. , i = new r.Vector3;
  16142. return function(n, r, o) {
  16143. if (!this.enabled)
  16144. return null;
  16145. var a = null
  16146. , s = this.tagDiscs.filter(function(e) {
  16147. return e.parent.visible
  16148. });
  16149. if (s.length > 0) {
  16150. var l = this.model.floors.reduce(function(e, t) {
  16151. return t.hidden ? e : e.concat(t.collider.children)
  16152. }, s);
  16153. e.set(n.x, n.y, -1).unproject(o),
  16154. t.set(n.x, n.y, 1).unproject(o),
  16155. i.copy(t).sub(e).normalize(),
  16156. this.raycaster.set(e, i);
  16157. var c = this.raycaster.intersectObjects(l);
  16158. c.length > 0 && s.indexOf(c[0].object) !== -1 && (a = c[0].object.tag)
  16159. }
  16160. return this.intersectTag = a,
  16161. r && (this.activeTag && a !== this.activeTag && (this.tagState === y.BROWSE || this.tagState === y.EXAMINE && a) && this.dismissActiveTag(),
  16162. a && a !== this.activeTag && (a.listeners(h.ENTER).length < 1 && (a.billboard.on(h.ENTER, function() {
  16163. this.hoveredTag = a
  16164. }
  16165. .bind(this)),
  16166. a.billboard.on(h.LEAVE, function() {
  16167. this.hoveredTag = null
  16168. }
  16169. .bind(this))),
  16170. this.activateTag(a, y.BROWSE))),
  16171. a
  16172. }
  16173. }(),
  16174. n.prototype.rankedtagInDirection = function() {
  16175. var e = []
  16176. , t = []
  16177. , i = new r.Vector3
  16178. , n = new r.Vector3
  16179. , o = new r.Vector3;
  16180. return function(r, a, s, l) {
  16181. var c = 0;
  16182. t.length = 0;
  16183. for (var h = 0; h < this.closesttags.length; h++) {
  16184. var u = this.closesttags[h];
  16185. n.copy(u.position),
  16186. n.add(u.discPosition),
  16187. i.copy(a),
  16188. i.sub(n).negate(),
  16189. i.normalize();
  16190. var d = i.dot(l);
  16191. if (d >= 0) {
  16192. o.copy(n),
  16193. o.project(s);
  16194. var p = this.intersecttag(o, !1, s);
  16195. if (p) {
  16196. if (c >= e.length)
  16197. for (var f = 0; f < 64; f++)
  16198. e.push({
  16199. tag: u,
  16200. dot: d
  16201. });
  16202. var g = e[c];
  16203. g.tag = u,
  16204. g.dot = d,
  16205. g.position = math.projectPositionToCanvas(n, s),
  16206. t.push(g),
  16207. c++
  16208. }
  16209. }
  16210. }
  16211. return t.sort(function(e, t) {
  16212. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  16213. }),
  16214. r < t.length ? t[r].tag : null
  16215. }
  16216. }(),
  16217. n.prototype.updateClosestTags = function() {
  16218. var e = new r.Vector3
  16219. , t = 30;
  16220. return function(i) {
  16221. this.closesttags || (this.closesttags = []),
  16222. this.closesttags.length = 0;
  16223. var n = this.model.tags;
  16224. if (n)
  16225. for (var r in n)
  16226. if (n.hasOwnProperty(r)) {
  16227. var o = n[r]
  16228. , a = o.position;
  16229. e.copy(i),
  16230. e.sub(a).negate();
  16231. var s = e.lengthSq();
  16232. s < t && this.closesttags.push(o)
  16233. }
  16234. }
  16235. }(),
  16236. t.exports = n
  16237. }
  16238. ).call(this, "/js/tag/tagManager.js")
  16239. }
  16240. , {
  16241. "../controls/serializer": 14,
  16242. "../enum/BlackoutStyle": 18,
  16243. "../enum/tagEvents": 32,
  16244. "../enum/ModelManagerEvents": 33,
  16245. "../enum/PlayerEvents": 40,
  16246. "../enum/TagStates": 44,
  16247. "../enum/Viewmode": 51,
  16248. "../enum/WarpStyle": 52,
  16249. "../objects/Snapshot": 153,
  16250. "../settings": 166,
  16251. "../util/common": 185,
  16252. "../util/lerp": 188,
  16253. "../util/logger": 189,
  16254. "./Billboard/BillboardEvent": 120,
  16255. "./Media/LinkType": 130,
  16256. "./Media/MediaEvent": 131,
  16257. events: 202,
  16258. three: 217
  16259. }],
  16260. 125: [function(e, t, i) {
  16261. (function(i) {
  16262. "use strict";
  16263. function n() {
  16264. this.embedWrapper = null,
  16265. this.embedElement = null
  16266. }
  16267. var r = e("../../util/ajax")
  16268. , o = e("./mediaSettings")
  16269. , a = e("../../settings")
  16270. , s = e("../../util/logger")
  16271. , l = new s(i);
  16272. n.prototype.createDomElement = function() {
  16273. return this.embedWrapper = document.createElement("div"),
  16274. this.embedWrapper.classList.add("tag-embed"),
  16275. this.embedWrapper.classList.add("hidden"),
  16276. this.embedWrapper
  16277. }
  16278. ,
  16279. n.prototype.load = function(e) {
  16280. var t = "https://api.embedly.com/1/oembed?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + o.maxEmbedWidth;
  16281. return new Promise(function(e, i) {
  16282. r.get(t).then(function(t) {
  16283. if (t = JSON.parse(t),
  16284. t.html && t.html.indexOf("<script") === -1) {
  16285. this.embedWrapper.innerHTML = t.html;
  16286. var n = Math.min(t.width, o.maxEmbedWidth) || o.maxEmbedWidth;
  16287. if (this.embedWrapper.style.width = n + "px",
  16288. t.height) {
  16289. var r = t.height / t.width;
  16290. this.embedWrapper.style.height = n * r + "px"
  16291. }
  16292. this.embedElement = this.embedWrapper.firstChild;
  16293. var a = [];
  16294. try {
  16295. a = [].slice.call(this.embedElement.querySelectorAll("a"))
  16296. } catch (e) {
  16297. l.debug("Error getting `a` elements for embed; was it an iframe?")
  16298. }
  16299. a.forEach(function(e) {
  16300. e.setAttribute("target", "_blank")
  16301. }),
  16302. this.embedElement.classList.add("hidden"),
  16303. this.embedWrapper.classList.remove("hidden"),
  16304. e()
  16305. } else
  16306. i("Not a valid embed")
  16307. }
  16308. .bind(this), function(e) {
  16309. i(e.response)
  16310. })
  16311. }
  16312. .bind(this))
  16313. }
  16314. ,
  16315. n.prototype.show = function() {
  16316. this.embedElement && this.embedElement.classList.remove("hidden")
  16317. }
  16318. ,
  16319. n.prototype.hide = function() {
  16320. this.embedElement && this.embedElement.classList.add("hidden")
  16321. }
  16322. ,
  16323. t.exports = n
  16324. }
  16325. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  16326. }
  16327. , {
  16328. "../../settings": 166,
  16329. "../../util/ajax": 181,
  16330. "../../util/logger": 189,
  16331. "./mediaSettings": 132
  16332. }],
  16333. 126: [function(e, t, i) {
  16334. (function(i) {
  16335. "use strict";
  16336. function n(e) {
  16337. o.call(this),
  16338. this.options = e,
  16339. this.playerControls = null,
  16340. this.state = s.NOT_READY
  16341. }
  16342. var r = e("../../util/browser")
  16343. , o = e("./EmbedlyEmbed")
  16344. , a = e("../../util/logger")
  16345. , s = (new a(i),
  16346. Object.freeze({
  16347. NOT_READY: "player.not.ready",
  16348. CUED: "player.cued",
  16349. PLAYING: "player.playing",
  16350. PAUSED: "player.paused"
  16351. }));
  16352. n.prototype = Object.create(o.prototype),
  16353. n.prototype.createDomElement = function() {
  16354. return this.embedWrapper = document.createElement("div"),
  16355. this.embedWrapper.classList.add("tag-video"),
  16356. this.embedWrapper.classList.add("hidden"),
  16357. this.embedWrapper
  16358. }
  16359. ,
  16360. n.prototype.load = function(e) {
  16361. var t = function() {
  16362. function e(e) {
  16363. this.playerState = s.CUED,
  16364. this.options.startMuted && this.playerControls.mute()
  16365. }
  16366. function t(e) {
  16367. this.playerState = e
  16368. }
  16369. function i(e) {
  16370. this.playerControls.setCurrentTime(0),
  16371. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  16372. }
  16373. this.playerControls = new playerjs.Player(this.embedElement),
  16374. this.playerControls.on("ready", e.bind(this)),
  16375. this.playerControls.on("play", t.bind(this, s.PLAYING)),
  16376. this.playerControls.on("pause", t.bind(this, s.PAUSED)),
  16377. this.playerControls.on("ended", i.bind(this))
  16378. }
  16379. .bind(this);
  16380. return o.prototype.load.call(this, e).then(t.bind(this))
  16381. }
  16382. ,
  16383. n.prototype.play = function() {
  16384. var e = r.isMobile();
  16385. return function() {
  16386. this.playerState !== s.NOT_READY && this.playerControls && !e && (this.state === s.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  16387. }
  16388. }(),
  16389. n.prototype.pause = function() {
  16390. this.playerState !== s.NOT_READY && this.playerControls && this.playerControls.pause()
  16391. }
  16392. ,
  16393. t.exports = n
  16394. }
  16395. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  16396. }
  16397. , {
  16398. "../../util/browser": 182,
  16399. "../../util/logger": 189,
  16400. "./EmbedlyEmbed": 125
  16401. }],
  16402. 127: [function(e, t, i) {
  16403. (function(i) {
  16404. "use strict";
  16405. function n(e) {
  16406. function t() {
  16407. return a.debug("requesting file from embedly:", e.href),
  16408. r.get(e.href, {
  16409. responseType: e.responseType
  16410. }).then(function(t) {
  16411. return a.debug("requesting file finished:", e.href),
  16412. t
  16413. })
  16414. }
  16415. function i() {}
  16416. return s = new Promise(function(e, n) {
  16417. s.catch(i).then(function() {
  16418. t().then(e, n)
  16419. })
  16420. }
  16421. )
  16422. }
  16423. var r = e("../../util/ajax")
  16424. , o = (e("./mediaSettings"),
  16425. e("../../util/logger"))
  16426. , a = new o(i)
  16427. , s = Promise.resolve();
  16428. t.exports.enqueue = n
  16429. }
  16430. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  16431. }
  16432. , {
  16433. "../../util/ajax": 181,
  16434. "../../util/logger": 189,
  16435. "./mediaSettings": 132
  16436. }],
  16437. 128: [function(e, t, i) {
  16438. (function(i) {
  16439. "use strict";
  16440. function n() {
  16441. this.imageWrapper = null,
  16442. this.width = 0,
  16443. this.height = 0,
  16444. this.aspect = 1
  16445. }
  16446. var r = e("./MediaEvent")
  16447. , o = e("./EmbedlyQueue")
  16448. , a = e("events").EventEmitter
  16449. , s = e("../../util/logger")
  16450. , l = e("../../settings");
  16451. new s(i);
  16452. n.prototype = Object.create(a.prototype),
  16453. n.prototype.createDomElement = function() {
  16454. return this.imageWrapper = document.createElement("div"),
  16455. this.imageWrapper.classList.add("tag-image"),
  16456. this.imageWrapper.classList.add("hidden"),
  16457. this.imageWrapper.addEventListener("click", function(e) {
  16458. e.stopPropagation(),
  16459. this.emit(r.IMAGE_OPENING),
  16460. this.imageWrapper.style.pointerEvents = "none"
  16461. }
  16462. .bind(this)),
  16463. this.imageWrapper
  16464. }
  16465. ,
  16466. n.prototype.onClosed = function() {
  16467. this.imageWrapper.style.pointerEvents = "auto"
  16468. }
  16469. ,
  16470. n.prototype.load = function(e) {
  16471. var t = Math.max(window.screen.height, window.screen.width)
  16472. , i = "https://i.embed.ly/1/display/resize?key=" + l.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  16473. return new Promise(function(e, t) {
  16474. function n(t) {
  16475. var i = t.target;
  16476. this.width = i.naturalWidth,
  16477. this.height = i.naturalHeight,
  16478. this.aspect = this.width / this.height;
  16479. var n = t.target.src;
  16480. this.imageWrapper.style.backgroundImage = 'url("' + n + '")',
  16481. this.imageWrapper.style.width = this.width + "px",
  16482. this.imageWrapper.style.height = this.height + "px",
  16483. this.imageWrapper.classList.remove("hidden"),
  16484. e()
  16485. }
  16486. o.enqueue({
  16487. href: i,
  16488. responseType: "arraybuffer"
  16489. }).then(function(e) {
  16490. var t = new Uint8Array(e)
  16491. , i = new Blob([t])
  16492. , r = new window.Image;
  16493. r.addEventListener("load", n.bind(this));
  16494. var o = URL.createObjectURL(i);
  16495. r.src = o
  16496. }
  16497. .bind(this), t)
  16498. }
  16499. .bind(this))
  16500. }
  16501. ,
  16502. t.exports = n
  16503. }
  16504. ).call(this, "/js/tag/Media/Image.js")
  16505. }
  16506. , {
  16507. "../../settings": 166,
  16508. "../../util/logger": 189,
  16509. "./EmbedlyQueue": 127,
  16510. "./MediaEvent": 131,
  16511. events: 202
  16512. }],
  16513. 129: [function(e, t, i) {
  16514. "use strict";
  16515. function n(e) {
  16516. this.label = e.label,
  16517. this.href = e.url,
  16518. this.type = this.updateLinkForType(),
  16519. this.domElement = null,
  16520. this.id = c++
  16521. }
  16522. var r = e("./LinkType")
  16523. , o = e("./MediaEvent")
  16524. , a = e("../../util/browser")
  16525. , s = e("../../analytics")
  16526. , l = e("events").EventEmitter
  16527. , c = 0;
  16528. n.prototype = Object.create(l.prototype),
  16529. n.prototype.updateLinkForType = function() {
  16530. function e(e) {
  16531. var t = new RegExp("[#&?]start=([^#&?]*)")
  16532. , i = t.exec(e);
  16533. return i[1]
  16534. }
  16535. function t(e) {
  16536. return e + "&play=1"
  16537. }
  16538. var i = a.valueFromHash("m") || a.valueFromHash("model");
  16539. return this.href.indexOf("port.com/show") !== -1 || this.href.indexOf(window.location.host + "/show") !== -1 ? this.href.indexOf(i) !== -1 && this.href.indexOf("start=") !== -1 ? (this.href = e(this.href),
  16540. r.NAVIGATION) : (this.href = t(this.href),
  16541. r.MODEL) : r.EXT_LINK
  16542. }
  16543. ;
  16544. var h = {};
  16545. n.prototype.createDomElement = function() {
  16546. function e(e) {
  16547. switch (e.stopPropagation(),
  16548. h[this.id] = !0,
  16549. s.trackAlways("click_tag_link", {
  16550. link_type: this.type,
  16551. link_count: c,
  16552. links_clicked: Object.keys(h).length
  16553. }),
  16554. this.type) {
  16555. case r.MODEL:
  16556. window.location.replace(this.href);
  16557. break;
  16558. case r.EXT_LINK:
  16559. window.open(this.href, "_blank")
  16560. }
  16561. this.emit(o.LINK_CLICK, {
  16562. type: this.type,
  16563. url: this.href
  16564. })
  16565. }
  16566. if (this.domElement = document.createElement("a"),
  16567. this.domElement.classList.add("tag-link"),
  16568. this.domElement.textContent = this.label,
  16569. this.type === r.EXT_LINK) {
  16570. this.domElement.textContent += " ";
  16571. var t = document.createElement("i");
  16572. t.classList.add("icon-ext-link"),
  16573. t.title = "Link to external web site",
  16574. this.domElement.appendChild(t)
  16575. }
  16576. return this.domElement.addEventListener("click", e.bind(this)),
  16577. this.domElement
  16578. }
  16579. ,
  16580. t.exports = n
  16581. }
  16582. , {
  16583. "../../analytics": 4,
  16584. "../../util/browser": 182,
  16585. "./LinkType": 130,
  16586. "./MediaEvent": 131,
  16587. events: 202
  16588. }],
  16589. 130: [function(e, t, i) {
  16590. "use strict";
  16591. t.exports = {
  16592. NAVIGATION: "navigation",
  16593. MODEL: "model",
  16594. EXT_LINK: "ext-link"
  16595. }
  16596. }
  16597. , {}],
  16598. 131: [function(e, t, i) {
  16599. "use strict";
  16600. t.exports = Object.freeze({
  16601. LINK_CLICK: "mtmedia.link",
  16602. IMAGE_LOADED: "mtmedia.image.loaded",
  16603. IMAGE_OPENING: "mtmedia.image.opening",
  16604. IMAGE_OPENED: "mtmedia.image.opened",
  16605. IMAGE_CLOSING: "mtmedia.image.closing",
  16606. IMAGE_CLOSED: "mtmedia.image.closed",
  16607. VIDEO_START: "mtmedia.video.start",
  16608. VIDEO_PAUSE: "mtmedia.video.pause",
  16609. VIDEO_ENDED: "mtmedia.video.end"
  16610. })
  16611. }
  16612. , {}],
  16613. 132: [function(e, t, i) {
  16614. "use strict";
  16615. t.exports = Object.freeze({
  16616. maxEmbedWidth: 350,
  16617. defaultAspectRatio: .75
  16618. })
  16619. }
  16620. , {}],
  16621. 133: [function(e, t, i) {
  16622. "use strict";
  16623. t.exports = Object.freeze({
  16624. TEXT: "text",
  16625. LINK: "link",
  16626. IMAGE: "photo",
  16627. VIDEO: "video",
  16628. RICH: "rich"
  16629. })
  16630. }
  16631. , {}],
  16632. 134: [function(e, t, i) {
  16633. "use strict";
  16634. function n(e) {
  16635. this.capabilities = {
  16636. links: {
  16637. enable: e.supportLinks,
  16638. keepLabels: e.keepLinkLabels
  16639. }
  16640. }
  16641. }
  16642. var r = e("./DescriptionChunkType");
  16643. n.prototype.parse = function(e, t) {
  16644. var i = []
  16645. , n = e.split("[").map(function(e, t) {
  16646. return 0 === t ? e : "[" + e
  16647. });
  16648. return n.forEach(function(e) {
  16649. var n = this.findMarkdown(e);
  16650. if (n) {
  16651. if (n.url.indexOf("javascript:") !== -1)
  16652. return;
  16653. this.addLinkChunk(i, n, t),
  16654. this.addTextChunk(i, e.slice(n.markdown.length))
  16655. } else
  16656. this.addTextChunk(i, e)
  16657. }
  16658. .bind(this)),
  16659. i
  16660. }
  16661. ,
  16662. n.prototype.findMarkdown = function(e) {
  16663. var t = /\[([^\]]*)\]\((.*)\)/
  16664. , i = e.match(t);
  16665. if (i) {
  16666. for (var n = i[2], r = 1, o = 0; o < n.length && ("(" === n[o] ? r++ : ")" === n[o] && r--,
  16667. 0 !== r); )
  16668. o++;
  16669. var a = n.length - o;
  16670. return {
  16671. markdown: i[0].substring(0, i[0].length - a),
  16672. label: i[1],
  16673. url: i[2].substring(0, o)
  16674. }
  16675. }
  16676. }
  16677. ,
  16678. n.prototype.addTextChunk = function(e, t) {
  16679. 0 !== t.length && e.push({
  16680. type: r.TEXT,
  16681. text: t
  16682. })
  16683. }
  16684. ,
  16685. n.prototype.addLinkChunk = function(e, t) {
  16686. if (!this.capabilities.links.enable)
  16687. return void (this.capabilities.links.keepLabels && this.addTextChunk(e, t.label));
  16688. var i = {
  16689. label: t.label,
  16690. url: t.url
  16691. };
  16692. i.url.indexOf("://") === -1 && (i.url = "http://" + i.url),
  16693. e.push({
  16694. type: r.LINK,
  16695. link: i
  16696. })
  16697. }
  16698. ,
  16699. t.exports = n
  16700. }
  16701. , {
  16702. "./DescriptionChunkType": 133
  16703. }],
  16704. 135: [function(e, t, i) {
  16705. (function(i) {
  16706. "use strict";
  16707. var n = e("../util/logger")
  16708. , r = new n(i)
  16709. , o = {
  16710. parseIdsFromChunkName: function(e, t) {
  16711. t.floorId = o.parseFloor(e),
  16712. t.roomId = o.parseRoom(e)
  16713. },
  16714. parseFloor: function(e) {
  16715. var t = e.match(/_group([0-9]+)/);
  16716. if (!t)
  16717. return 0;
  16718. try {
  16719. return parseInt(t[1], 10)
  16720. } catch (e) {
  16721. return r.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16722. 0
  16723. }
  16724. },
  16725. parseRoom: function(e) {
  16726. var t = e.match(/_sub([0-9]+)/);
  16727. if (!t)
  16728. return -1;
  16729. try {
  16730. return parseInt(t[1], 10)
  16731. } catch (e) {
  16732. return r.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16733. 0
  16734. }
  16735. }
  16736. };
  16737. t.exports = o
  16738. }
  16739. ).call(this, "/js/model/Chunks.js")
  16740. }
  16741. , {
  16742. "../util/logger": 189
  16743. }],
  16744. 136: [function(e, t, i) {
  16745. (function(i) {
  16746. "use strict";
  16747. function n(e) {
  16748. s.call(this),
  16749. this.model = e,
  16750. this.exploded = !1
  16751. }
  16752. var r = e("../objects/Floor")
  16753. , o = (e("../settings"),
  16754. e("../util/logger"))
  16755. , a = e("../util/transitions")
  16756. , s = e("../util/IndexedCollection")
  16757. , l = e("../util/common")
  16758. , c = e("../util/easing");
  16759. new o(i);
  16760. l.inherit(n, s),
  16761. n.prototype.add = function(e) {
  16762. s.prototype.add.call(this, e),
  16763. this.model.add(e)
  16764. }
  16765. ,
  16766. n.prototype.getIndex = function(e) {
  16767. return e.floorIndex
  16768. }
  16769. ,
  16770. n.prototype.build = function() {
  16771. this.list.forEach(function(e) {
  16772. e.build()
  16773. })
  16774. }
  16775. ,
  16776. n.prototype.size = function() {
  16777. return this.length
  16778. }
  16779. ,
  16780. n.prototype.sort = function() {
  16781. s.prototype.sort.call(this, function(e, t) {
  16782. return e.floorIndex - t.floorIndex
  16783. })
  16784. }
  16785. ,
  16786. n.prototype.nextFloor = function(e, t) {
  16787. return this.index[e.floorIndex + t] || null
  16788. }
  16789. ,
  16790. n.prototype.getFloorAtPoint = function(e) {
  16791. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16792. var r = this.list[n]
  16793. , o = r.distanceToPoint(e);
  16794. (!t || i > o) && (i = o,
  16795. t = r)
  16796. }
  16797. return t
  16798. }
  16799. ,
  16800. n.prototype.getOrMakeFloor = function(e) {
  16801. var t = this.index[e];
  16802. return t || (t = new r(this.model,e),
  16803. this.add(t)),
  16804. t
  16805. }
  16806. ,
  16807. n.prototype.hide = function() {
  16808. this.list.forEach(function(e) {
  16809. e.hide()
  16810. })
  16811. }
  16812. ,
  16813. n.prototype.show = function() {
  16814. this.list.forEach(function(e) {
  16815. e.show()
  16816. })
  16817. }
  16818. ,
  16819. n.prototype.names = function() {
  16820. return this.list.reduce(function(e, t) {
  16821. return e.concat(t.name)
  16822. }, [])
  16823. }
  16824. ,
  16825. n.prototype.toggleExplodeHorizontal = function() {
  16826. function e(e, t) {
  16827. r.copy(e.position),
  16828. e.position.x = i[e.floorIndex] * t,
  16829. e.position.y = 1 * e.floorIndex * t,
  16830. r.sub(e.position).multiplyScalar(-1),
  16831. e.panos.forEach(function(e) {
  16832. e.translate(r)
  16833. })
  16834. }
  16835. var t, i = [], n = 0;
  16836. this.list.forEach(function(e, r, o) {
  16837. t = r > 0 ? Math.max(o[r - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16838. n += t,
  16839. i[r] = n
  16840. }),
  16841. i = i.map(function(e) {
  16842. return e - n / 2
  16843. });
  16844. var r = this.list[0].position.clone();
  16845. this.exploded ? this.list.forEach(function(t) {
  16846. a.start(function(i) {
  16847. e(t, 1 - i)
  16848. }, 1500, null, 0, c.easeOutExpo)
  16849. }) : this.list.forEach(function(t) {
  16850. a.start(function(i) {
  16851. e(t, i)
  16852. }, 1500, null, 0, c.easeOutExpo)
  16853. }),
  16854. this.exploded = !this.exploded
  16855. }
  16856. ,
  16857. n.prototype.toggleExplodeVertical = function() {
  16858. function e(e, i) {
  16859. var n = n.copy(e.position);
  16860. e.position.y = (5 * e.floorIndex - t.y / 2) * i,
  16861. n.sub(e.position).multiplyScalar(-1),
  16862. e.panos.forEach(function(e) {
  16863. e.translate(n)
  16864. })
  16865. }
  16866. var t = this.model.size;
  16867. this.list[0].position.clone();
  16868. this.exploded ? this.list.forEach(function(t) {
  16869. a.start(function(i) {
  16870. e(t, 1 - i)
  16871. }, 1500, null, 0, c.easeOutExpo)
  16872. }) : this.list.forEach(function(t) {
  16873. a.start(function(i) {
  16874. e(t, i)
  16875. }, 1500, null, 0, c.easeOutExpo)
  16876. }),
  16877. this.exploded = !this.exploded
  16878. }
  16879. ,
  16880. t.exports = n
  16881. }
  16882. ).call(this, "/js/model/FloorCollection.js")
  16883. }
  16884. , {
  16885. "../objects/Floor": 146,
  16886. "../settings": 166,
  16887. "../util/IndexedCollection": 175,
  16888. "../util/common": 185,
  16889. "../util/easing": 186,
  16890. "../util/logger": 189,
  16891. "../util/transitions": 195
  16892. }],
  16893. 137: [function(e, t, i) {
  16894. (function(i) {
  16895. "use strict";
  16896. function n() {
  16897. c.call(this)
  16898. }
  16899. var r = e("../settings")
  16900. , o = e("../util/logger")
  16901. , a = e("../enum/Viewmode")
  16902. , s = e("../objects/Snapshot")
  16903. , l = (e("../util/math"),
  16904. e("../util/common"))
  16905. , c = e("../util/IndexedCollection")
  16906. , h = new o(i);
  16907. l.inherit(n, c),
  16908. n.prototype.getImage = function(e) {
  16909. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16910. }
  16911. ,
  16912. n.prototype.filterByModesAndReel = function(e, t) {
  16913. for (var i = [], n = 0; n < t.length; n += 1) {
  16914. var r = t[n]
  16915. , o = this.index[r.sid];
  16916. o && i.push(o)
  16917. }
  16918. var s = e[a.DOLLHOUSE]
  16919. , l = e[a.FLOORPLAN];
  16920. i = i.filter(function(e) {
  16921. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16922. return !0;
  16923. var t;
  16924. try {
  16925. t = a.convertWorkshopModeInt(e.metadata.camera_mode)
  16926. } catch (e) {
  16927. return h.debug(e.message),
  16928. !1
  16929. }
  16930. return t === a.PANORAMA || t === a.FLOORPLAN && l || t === a.DOLLHOUSE && s
  16931. }),
  16932. i.length !== this.list.length && h.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16933. this.list = i,
  16934. this.reIndex()
  16935. }
  16936. ,
  16937. n.prototype.getHeroLocations = function(e) {
  16938. if (0 === this.list.length)
  16939. return [];
  16940. for (var t = [], i = 0; i < this.list.length; ++i) {
  16941. var o = this.list[i]
  16942. , l = o.thumbnail_signed_src
  16943. , c = o.name || '';
  16944. if (o.metadata && void 0 !== o.metadata.camera_quaternion) {
  16945. if (!r.show360Views.enabled && o.metadata.scan_id) {
  16946. var h = e.get(o.metadata.scan_id);
  16947. if (h && !h.isAligned())
  16948. continue
  16949. }
  16950. var u = a.convertWorkshopModeInt(o.metadata.camera_mode);
  16951. if (u === a.MESH)
  16952. continue;
  16953. var d = {
  16954. cameraMode: u,
  16955. position: o.metadata.camera_position,
  16956. quaternion: o.metadata.camera_quaternion,
  16957. zoom: o.metadata.zoom,
  16958. panoId: o.metadata.scan_id,
  16959. orthoZoom: o.metadata.ortho_zoom,
  16960. floorVisibility: void 0 !== o.metadata.floor_visibility ? o.metadata.floor_visibility.slice(0) : [],
  16961. thumbUrl: g_version === "one" ? g_Prefix + l + "?"+ randomTime().getTime() : (l.substr(0,4)=="http" ? l + "?"+ randomTime().getTime() : '//' + l + "?"+ randomTime().getTime()),
  16962. name: n.filterImageName(c),
  16963. sid: o.sid //xzw add g_tourAudio要用,
  16964. }
  16965. , p = new s(d);
  16966. t.push(p)
  16967. }
  16968. }
  16969. return t
  16970. }
  16971. ,
  16972. n.prototype.getIndex = function(e) {
  16973. return e.sid
  16974. }
  16975. ,
  16976. n.filterImageName = function(e) {
  16977. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16978. }
  16979. ,
  16980. t.exports = n
  16981. }
  16982. ).call(this, "/js/model/ImageCollection.js")
  16983. }
  16984. , {
  16985. "../enum/Viewmode": 51,
  16986. "../objects/Snapshot": 153,
  16987. "../settings": 166,
  16988. "../util/IndexedCollection": 175,
  16989. "../util/common": 185,
  16990. "../util/logger": 189,
  16991. "../util/math": 190
  16992. }],
  16993. 138: [function(e, t, i) {
  16994. (function(i) {
  16995. "use strict";
  16996. function n() {
  16997. u.call(this)
  16998. }
  16999. var r = e("../label/Label")
  17000. , o = e("../settings")
  17001. , a = e("../util/logger")
  17002. , s = e("../util/math")
  17003. , l = e("../util/ajax")
  17004. , c = e("./RoomCollection")
  17005. , h = e("../util/common")
  17006. , u = e("../util/IndexedCollection");
  17007. new a(i);
  17008. h.inherit(n, u),
  17009. n.prototype.getIndex = function(e) {
  17010. return e.labelId
  17011. }
  17012. ,
  17013. n.prototype.associateWithRooms = function(e) {
  17014. this.forEach(function(t) {
  17015. e.forEach(function(e) {
  17016. e.roomId === t.roomId && (t.room = e)
  17017. })
  17018. })
  17019. }
  17020. ,
  17021. n.prototype.createFromLabelData = function(e) {
  17022. e.forEach(function(e) {
  17023. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  17024. t = c.generateRoomId(e.floorId, t);
  17025. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  17026. i.position = s.convertWorkshopVector(i.position),
  17027. this.add(i),
  17028. i.build()
  17029. }
  17030. .bind(this))
  17031. }
  17032. ,
  17033. n.prototype.load = function(e, t) {
  17034. return l.get(e, {
  17035. responseType: "json",
  17036. auth: t ? o.authorizationHeader : null
  17037. }).done(function(e) {
  17038. var t = [];
  17039. for (var i in e) {
  17040. var n = e[i];
  17041. t.push(n)
  17042. }
  17043. this.createFromLabelData(t)
  17044. }
  17045. .bind(this))
  17046. }
  17047. ,
  17048. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  17049. var t = -1;
  17050. if (e) {
  17051. var i = e.split("_");
  17052. t = parseInt(i[0])
  17053. }
  17054. return t
  17055. }
  17056. ,
  17057. t.exports = n
  17058. }
  17059. ).call(this, "/js/model/LabelCollection.js")
  17060. }
  17061. , {
  17062. "../label/Label": 90,
  17063. "../settings": 166,
  17064. "../util/IndexedCollection": 175,
  17065. "../util/ajax": 181,
  17066. "../util/common": 185,
  17067. "../util/logger": 189,
  17068. "../util/math": 190,
  17069. "./RoomCollection": 141
  17070. }],
  17071. 139: [function(e, t, i) {
  17072. (function(i) {
  17073. "use strict";
  17074. function n(e, t) {
  17075. o.Object3D.call(this)
  17076. this.sid = window.number;//t.sid,
  17077. this.data = t,
  17078. this.options = e,
  17079. this.urls = new s(e.urlFiles),
  17080. this.isPublic = void 0 !== t.is_public && t.is_public,
  17081. this.images = new _(this),
  17082. this.images.extend(t.images),
  17083. this.heroImage = this.images.getImage(t.icon),
  17084. this.heroLocations = [],
  17085. this.outdoorPanoLocations = [],
  17086. this.floors = new d(this),
  17087. this.floorsEnabled = void 0 === e.floors || e.floors,
  17088. this.changingFloor = !1,
  17089. this.chunks = [],
  17090. this.panos = new A,
  17091. this.colliders = [],
  17092. this.loadPanosPromise = null,
  17093. this.loadMeshTexturesPromise = null,
  17094. this.auxDataPromise = null,
  17095. this.meshTexturesLoaded = !1,
  17096. this.meshTextures = [],
  17097. this.tags = {},
  17098. this.tagsShown = !1,
  17099. this.shouldShowtags = !1,
  17100. this.has360Views = !1,
  17101. this.showingLabels = f.labels.enabled && t.player_options.labels,
  17102. this.supportedModes = {},
  17103. this.supportedModes[c.PANORAMA] = !0,
  17104. this.supportedModes[c.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && w.valueFromHash("dh", 1),
  17105. this.supportedModes[c.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && w.valueFromHash("dh", 1),
  17106. this.supportedModes[c.TRANSITIONING] = !0,
  17107. this.supportsTiles = this.configureTiling(),
  17108. // this.supportsVR = t.is_vr,
  17109. this.supportsVR = window.MP_PREFETCHED_MODELDATA.supportsVR || true; // 方奕卓 VR功能可配置
  17110. this.mode = c.DOLLHOUSE,
  17111. this.size = null,
  17112. this.center = null,
  17113. this.boundingBox = new o.Box3,
  17114. this.currentFloor = null,
  17115. this.allFloorsVisible = !0,
  17116. this.projectedPano0 = null,
  17117. this.projectedPano1 = null,
  17118. this.floorsEnabled && t.floors && t.floors.indexOf(",") !== -1 && t.floors.split(",").forEach(function(e, t) {
  17119. this.addFloor(new u(this,t,e.trim()))
  17120. }
  17121. .bind(this)),
  17122. this.waitQueue = [],
  17123. this.on("load", function(e) {
  17124. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  17125. return !e.isLoadedCallback()
  17126. }),
  17127. 0 === this.waitQueue.length && this.emit("waiting-done"))
  17128. }
  17129. .bind(this)),
  17130. this.setupCustomProperties()
  17131. this.hots = {};
  17132. }
  17133. function r() {
  17134. try {
  17135. var e = document.createElement("canvas")
  17136. , t = e.getContext("webgl");
  17137. t || (t = e.getContext("experimental-webgl"));
  17138. var i = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE);
  17139. return i
  17140. } catch (e) {
  17141. return 0
  17142. }
  17143. }
  17144. var o = e("three")
  17145. , a = e("../util/ajax")
  17146. , s = e("../util/ModelUrls")
  17147. , l = e("../objects/BoundingTextureSkybox")
  17148. , c = e("../enum/Viewmode")
  17149. , h = e("../enum/RenderOrder")
  17150. , u = (e("../enum/AlignmentType"),
  17151. e("../objects/Floor"))
  17152. , d = e("./FloorCollection")
  17153. , p = e("../objects/Chunk")
  17154. , f = (e("../objects/Room"),
  17155. e("../objects/Snapshot"),
  17156. e("../label/Label"),
  17157. e("../util/math"),
  17158. e("../settings"))
  17159. ,ss = e("../shaders")
  17160. , g = e("../util/logger")
  17161. , m = e("../tag/tag")
  17162. , v = (e("../tag/tagManager"),
  17163. e("../objects/Panorama"))
  17164. , A = e("../util/PanoramaCollection")
  17165. , y = e("../loaders/ModelLoader")
  17166. , C = e("../loaders/ModelTextureLoader")
  17167. , I = e("../loaders/SweepDataLoader")
  17168. , E = e("../util/transitions")
  17169. , b = (e("../util/easing"),
  17170. e("../util/lerp"),
  17171. e("../util/common"))
  17172. , w = (e("../util/texture"),
  17173. e("./../util/browser"))
  17174. , _ = e("./ImageCollection")
  17175. , T = e("./RoomCollection")
  17176. , x = e("./LabelCollection")
  17177. , S = e("./Chunks")
  17178. , M = e("./../util/showcase")
  17179. , R = e("../exception/BasicException")
  17180. , P = (e("../constants")
  17181. ,e("events").EventEmitter)
  17182. ,Hot = e("hot")
  17183. , O = new g(i);
  17184. n.prototype = Object.create(o.Object3D.prototype),
  17185. b.extend(n, P),
  17186. n.prototype.setupCustomProperties = function() {
  17187. var e = f.modelAlpha;
  17188. Object.defineProperty(this, "alpha", {
  17189. get: function() {
  17190. return e
  17191. },
  17192. set: function(t) {
  17193. e = t,
  17194. this.chunks.forEach(function(t) {
  17195. t.material && t.material.uniforms.modelAlpha && (t.material.uniforms.modelAlpha.value = e)
  17196. })
  17197. }
  17198. })
  17199. }
  17200. ,
  17201. n.prototype.configureTiling = function() {
  17202. var e = r();
  17203. if (e < 2048)
  17204. return !1;
  17205. O.warn("Max cube texture size: " + e);
  17206. for (var t = 0; t < f.tiling.tilingFlagNames.length; t++) {
  17207. var i = f.tiling.tilingFlagNames[t];
  17208. if ("1" === w.valueFromHash(i, null))
  17209. return !0;
  17210. if ("0" === w.valueFromHash(i, null))
  17211. return !1
  17212. }
  17213. //--------------------------------------------许钟文-------------------------------------------
  17214. //return true;
  17215. return !!M.modelDataPromisesTiles(this.data) //免去访问mdoeldata.json的vision_version,不明白这是什么
  17216. //--------------------------------------------e n d -------------------------------------------
  17217. }
  17218. ,
  17219. n.prototype.toggleAlpha = function() {
  17220. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  17221. }
  17222. ,
  17223. n.prototype.load = function(e) {
  17224. var t = function() {
  17225. return $.when(this.loadPanos(), this.loadMesh())
  17226. }
  17227. , i = this.urls.init().then(t.bind(this));
  17228. return e ? i = i.then(this.loadMeshTextures.bind(this)) : i.then(this.loadMeshTextures.bind(this)),
  17229. this.auxDataPromise = $.when( /*this.loadHighlightReel(), this.loadtags() */this.loadhots(), this.loadLabels()),
  17230. $.when(i, this.auxDataPromise).done(this.build.bind(this)) //不要另外使用active_reel文件
  17231. }
  17232. ,
  17233. n.prototype.loadMesh = function() {
  17234. function e(e) {
  17235. O.error(e),
  17236. n.reject("loading-failed")
  17237. }
  17238. function t(e, t) {
  17239. n.notify(e, t)
  17240. }
  17241. function i(e, t) {
  17242. if (0 === e.length) {
  17243. O.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  17244. r.supportedModes[c.DOLLHOUSE] = !1,
  17245. r.supportedModes[c.FLOORPLAN] = !1;
  17246. var i = new p({
  17247. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  17248. });
  17249. i.material.visible = !1,
  17250. i.rotateX(-Math.PI / 2),
  17251. i.geometry.computeBoundingBox(),
  17252. e = [i]
  17253. }
  17254. e.forEach(function(e) {
  17255. var t = r.floorsEnabled ? S.parseFloor(e.name) : 0;
  17256. r.addChunk(t, e)
  17257. }),
  17258. r.floors.sort(),
  17259. n.resolve(r)
  17260. }
  17261. var n = $.Deferred()
  17262. , r = this;
  17263. return y.load(r.data.job.uuid, r.urls, i, t, e),
  17264. n.promise()
  17265. }
  17266. ,
  17267. n.prototype.loadMeshTextures = function() {
  17268. return this.loadTexturesPromise ? this.loadTexturesPromise : (this.loadTexturesPromise = C.load(this, this.meshTextures).then(function() {
  17269. this.meshTexturesLoaded = !0
  17270. }
  17271. .bind(this)),
  17272. this.loadTexturesPromise)
  17273. }
  17274. ,
  17275. /* n.prototype.loadtags = function() {//xzw改
  17276. var e = $.Deferred();
  17277. if (!f.tags.enabled)
  17278. return e.resolve();
  17279. //var t = this.options.urlBase + "/api/v1/jsonstore/model/tags/" + this.sid;
  17280. t = "data/" + this.sid + "/tags.json"
  17281. return a.get(t, {
  17282. responseType: "json",
  17283. auth: this.isPublic ? null : f.authorizationHeader
  17284. }).done(function(t) {
  17285. var i = 0
  17286. , n = 0;
  17287. for (var r in t) {
  17288. var o = t[r];
  17289. o.enabled && (n++,
  17290. (o.label.length || o.description.length) && (this.tags[r] = new m(this,r,o),
  17291. i++))
  17292. }
  17293. i !== n && O.warn("Disallowed " + (n - i) + " tags with no text data"),
  17294. e.resolve()
  17295. }
  17296. .bind(this)).fail(function() {
  17297. O.warn("Getting tags failed, not displaying tags."),
  17298. e.resolve()
  17299. }),
  17300. e
  17301. } */
  17302. n.prototype.shineHots = function(){ //xzw
  17303. E.trigger({
  17304. func: function(e) {
  17305. var opa = e <= .5 ? 2 * e : -2 * e + 2
  17306. for(var i in this.hots){
  17307. this.hots[i].mesh.material.uniforms.opac.value = opa;
  17308. }
  17309. }.bind(this),
  17310. cycling: true,
  17311. duration: 3000,
  17312. //easing: "easeInOutQuad",
  17313. name: "hotShine"
  17314. })
  17315. },
  17316. n.prototype.createHotItem = function(data, hots) {
  17317. var docFragment = document.createDocumentFragment();
  17318. var keyAry = Object.keys(data);
  17319. for(var i = 0; i < keyAry.length; i++){
  17320. var li = document.createElement('li');
  17321. var span = document.createElement('span');
  17322. span.innerHTML = data[keyAry[i]].title || '热点';
  17323. // console.log(span.innerHTML);
  17324. li.hot = hots[keyAry[i]]; // 列表每一项对应一个热点
  17325. li.appendChild(span);
  17326. docFragment.appendChild(li);
  17327. }
  17328. var ul = document.querySelector('#hotListContent ul');
  17329. ul.appendChild(docFragment);
  17330. console.log(docFragment);
  17331. }
  17332. n.prototype.loadOverlays = function(overlays){
  17333. var overlays = window.data2 && window.data2.overlays
  17334. overlays && overlays.forEach((info)=>{
  17335. new Overlay(info)
  17336. })
  17337. }
  17338. n.prototype.loadhots = function() {//xzw
  17339. var e = $.Deferred();
  17340. var t = g_Prefix+"data/" + this.sid + "/data2.js" +'?'+ randomTime().getTime();
  17341. return a.get(t, {
  17342. responseType: "json",
  17343. auth: this.isPublic ? null : f.authorizationHeader
  17344. }).done(function(t) {
  17345. window.data2 = t;
  17346. g_data2 = hotMatcher(t);
  17347. this.hotsCount = 0;
  17348. for(var i in t.hots){
  17349. this.hotsCount ++;
  17350. this.hots[i] = new Hot(i, t.hots[i], this);
  17351. };
  17352. g_index = w.valueFromHash("m");
  17353. if(t.tourAudio){
  17354. g_tourAudio = new Audio;
  17355. g_tourAudio.loop = false;
  17356. g_tourAudio.addEventListener('ended', function () {
  17357. var ev = document.createEvent("MouseEvent");
  17358. ev.initEvent("tourAudioEnded",true,true);
  17359. window.dispatchEvent(ev);
  17360. });
  17361. };
  17362. /***************************方奕卓 请求data.js数据, 用于初始化热点列表 ****************************/
  17363. var dataJsPromise = $.Deferred();
  17364. var dataJsUrl = g_Prefix+"data/" + this.sid + "/hot/js/data.js" +'?'+ randomTime().getTime();
  17365. a.get(dataJsUrl,{
  17366. responseType: "json",
  17367. auth: this.isPublic ? null : f.authorizationHeader
  17368. }).done(function(data) {
  17369. window.hotData = data;
  17370. this.createHotItem(data, this.hots);
  17371. for(let i in this.hots){//add
  17372. data[i] && this.hots[i].initStyleImg(data[i]);
  17373. }
  17374. dataJsPromise.resolve();
  17375. }.bind(this)).fail(function(){
  17376. console.log('Data.js is empty');
  17377. dataJsPromise.resolve();
  17378. })
  17379. if(t.weixinDesc){
  17380. g_weixinObj.desc = t.weixinDesc;
  17381. }
  17382. window.wx && manage.weixinShare();
  17383. e.resolve();
  17384. }.bind(this)).fail(function() {
  17385. console.log('没有热点');
  17386. window.wx && manage.weixinShare();
  17387. e.resolve()
  17388. }),
  17389. e
  17390. }
  17391. ,
  17392. n.prototype.loadPanos = function() {
  17393. if (this.loadPanosPromise)
  17394. return this.loadPanosPromise;
  17395. var e = new I(this);
  17396. return this.loadPanosPromise = e.load().then(function(e) {
  17397. return this.data.sweeps && Object.keys(this.data.sweeps).length > 0 && (e = e.filter(function(e) {
  17398. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  17399. else console.log(e.uuid)
  17400. }
  17401. .bind(this))),
  17402. this.panos.extend(e.map(function(e) {
  17403. return new v(this,e.uuid,e,this.supportsTiles)
  17404. }
  17405. .bind(this))),
  17406. this.panos.forEach(function(e) {
  17407. e.neighbourUUIDs && (e.neighbourUUIDs.forEach(function(t) {
  17408. var i = this.panos.get(t);
  17409. i && this.panos.setNeighbour(e, i, !0)
  17410. }
  17411. .bind(this)),
  17412. e.neighbourPanos = this.panos.getNeighbours(e) || this.panos.setNeighbour(e, e, !0))
  17413. }
  17414. .bind(this)),
  17415. 0 === this.panos.length && (O.warn("Model has no panos, turning off inside mode"),
  17416. this.supportedModes[c.PANORAMA] = !1),
  17417. $.when(this)
  17418. }
  17419. .bind(this)),
  17420. this.loadPanosPromise
  17421. }
  17422. ,
  17423. n.prototype.loadHighlightReel = function() {//xzw
  17424. var e = $.Deferred()
  17425. // , t = this.options.urlBase + "/api/v1/jsonstore/model/highlights/" + this.sid + "/active_reel";
  17426. ,t = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  17427. return a.get(t, {
  17428. responseType: "json",
  17429. auth: this.isPublic ? null : f.authorizationHeader
  17430. }).done(function(t) {
  17431. t.reel ? (O.info("Got highlight reel with " + t.reel.length + " items"),
  17432. this.images.filterByModesAndReel(this.supportedModes, t.reel)) : O.info("No highlight reel found"),
  17433. e.resolve()
  17434. }
  17435. .bind(this)).fail(function() {
  17436. O.warn("Getting highlight reel failed, no highlights available"),
  17437. e.resolve()
  17438. }),
  17439. e
  17440. }
  17441. ,
  17442. n.prototype.waitForLoad = function(e, t) {
  17443. t() || (this.waitQueue.push({
  17444. object: e,
  17445. isLoadedCallback: t
  17446. }),
  17447. 1 === this.waitQueue.length && this.emit("waiting"))
  17448. }
  17449. ,
  17450. n.prototype.hide = function() {
  17451. this.floors.hide()
  17452. }
  17453. ,
  17454. n.prototype.show = function() {
  17455. this.floors.show()
  17456. }
  17457. ,
  17458. n.prototype.floorNames = function() {
  17459. return this.floors.names()
  17460. }
  17461. ,
  17462. n.prototype.warpDestFloors = function(e, t) {
  17463. if (!e || this.floors.length !== e.length)
  17464. return void this.toggleAllFloors(!0);
  17465. var i = e.findIndex(function(e) {
  17466. return e
  17467. }
  17468. .bind(this));
  17469. i !== -1 && this.setFloor(this.floors.list[i], null, t)
  17470. }
  17471. ,
  17472. n.prototype.setFloor = function(e, t, i) {
  17473. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  17474. this.allFloorsVisible = !1,
  17475. this._setFloor(e, t, i)
  17476. }
  17477. ,
  17478. n.prototype.toggleAllFloors = function(e) {
  17479. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  17480. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  17481. this._setFloor(this.currentFloor)
  17482. }
  17483. ,
  17484. n.prototype._setFloor = function(e, t, i) {
  17485. t = t || this.mode,
  17486. this.emit("floor.changed", e, t, this.currentFloor),
  17487. this.currentFloor = e;
  17488. var n;
  17489. if (t === c.PANORAMA) {
  17490. if (this.show(),
  17491. this.shouldShowtags && this.tagsShown)
  17492. for (n in this.tags)
  17493. this.tags[n].show(f.showFloorDuration)
  17494. } else if ((t === c.FLOORPLAN || t === c.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  17495. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  17496. }
  17497. .bind(this)),
  17498. this.shouldShowtags && this.tagsShown))
  17499. for (n in this.tags) {
  17500. var r = this.tags[n];
  17501. this.allFloorsVisible ? r.show(f.showFloorDuration) : r.floor === this.currentFloor ? r.show(f.showFloorDuration, f.showFloorDelay) : r.hide(f.hideFloorDuration, f.hideFloorDelay)
  17502. }
  17503. var o = this
  17504. , a = e;
  17505. E.start(function() {}, f.showFloorDelay, function() {
  17506. o.floors.forEach(function(e) {
  17507. e.chunks.forEach(function(t) {
  17508. t.renderOrder = e === a ? h.visibleFloor : h.ghostFloor
  17509. })
  17510. })
  17511. }
  17512. .bind(this))
  17513. }
  17514. ,
  17515. n.prototype.toggleExplode = function() {
  17516. this.floors.toggleExplodeHorizontal()
  17517. }
  17518. ,
  17519. n.prototype.toggleExplodeUp = function() {
  17520. this.floors.toggleExplodeVertical()
  17521. }
  17522. ,
  17523. n.prototype.nextFloor = function(e) {
  17524. return this.floors.nextFloor(this.currentFloor, e)
  17525. }
  17526. ,
  17527. n.prototype.addFloor = function(e) {
  17528. this.floors.add(e)
  17529. }
  17530. ,
  17531. n.prototype.getFloorAtPoint = function(e) {
  17532. return this.floors.getFloorAtPoint(e)
  17533. }
  17534. ,
  17535. n.prototype.getTagBySid = function(e) {
  17536. return this.tags[e]
  17537. }
  17538. ,
  17539. n.prototype.addChunk = function(e, t) {
  17540. this.floors.getOrMakeFloor(e).addChunk(t),
  17541. this.chunks.push(t)
  17542. }
  17543. ,
  17544. n.prototype.setMode = function(e) {
  17545. if (!this.supportedModes[e])
  17546. throw new R("Mode not supported for this model: " + e);
  17547. this.mode = e,
  17548. this.chunks.forEach(function(t) {
  17549. t.setMode(e)
  17550. })
  17551. }
  17552. ,
  17553. n.prototype.build = function() {
  17554. this.heroLocations = this.images.getHeroLocations(this.panos);
  17555. var e = function() {
  17556. return !!(this.heroImage && this.heroImage.metadata && this.heroImage.metadata.scan_id && this.panos.get(this.heroImage.metadata.scan_id)) && !this.panos.get(this.heroImage.metadata.scan_id).isAligned()
  17557. }
  17558. .bind(this)();
  17559. this.has360Views = f.show360Views.enabled && this.heroLocations.some(function(e) {
  17560. return e.cameraMode === c.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17561. }
  17562. .bind(this)) || e,
  17563. null === this.heroImage && O.warn("No hero image defined."),
  17564. this.currentFloor = this.floors.last(),
  17565. this.floors.build(),
  17566. this.colliders = this.floors.reduce(function(e, t) {
  17567. return e.concat(t.collider.children)
  17568. }, []),
  17569. this.panos.forEach(function(e) {
  17570. e.build1(),
  17571. e.on("enter", function() {
  17572. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17573. }
  17574. .bind(this))
  17575. }
  17576. .bind(this)),
  17577. this.panos.forEach(function(e) {
  17578. e.build2()
  17579. }),
  17580. this.floors.forEach(function(e) {
  17581. this.boundingBox.union(e.boundingBox)
  17582. }
  17583. .bind(this)),
  17584. this.size = this.boundingBox.size(),
  17585. this.center = this.boundingBox.center(),
  17586. this.floors.forEach(function(e) {
  17587. O.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  17588. }
  17589. .bind(this)),
  17590. this.panos.populate_path_graph(),
  17591. this.skybox = new l(this.boundingBox),
  17592. this.skybox.matrixWorldNeedsUpdate = !0,
  17593. this.add(this.skybox);
  17594. setTimeout(function(){
  17595. this.hotsCount && this.shineHots();
  17596. }.bind(this),1300);//xzw 热点开始闪烁
  17597. for (var t in this.tags)
  17598. this.tags[t].build();
  17599. return O.debug("Done building model"),
  17600. v.raycastsDone > 0 && (O.warn("raycasts: " + v.raycastsDone),
  17601. O.warn("raycasts skipped: " + v.raycastsSkipped)),
  17602. this.buildRooms(),
  17603. this.labels.associateWithRooms(this.rooms),
  17604. $.when(this)
  17605. }
  17606. ,
  17607. n.prototype.loadLabels = function() {//xzw
  17608. this.labels = new x(this);
  17609. var e = $.Deferred();
  17610. //加载俯视图的标签 注释这个备注就会加载
  17611. window.MP_PREFETCHED_MODELDATA.model.player_options.labels ? this.showingLabels = true : '';
  17612. if (!this.showingLabels)
  17613. return e.resolve();
  17614. // var t = this.options.urlBase + "/api/v1/jsonstore/model/labels/" + this.sid;
  17615. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  17616. console.log(t);
  17617. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  17618. O.warn("Getting labels failed, not displaying labels."),
  17619. e.resolve()
  17620. }),
  17621. e
  17622. }
  17623. ,
  17624. n.prototype.buildRooms = function() {
  17625. this.rooms = new T(this),
  17626. this.rooms.createFromChunks(this.chunks),
  17627. this.rooms.calcRoomBoundaries()
  17628. }
  17629. ,
  17630. n.prototype.updateProjectedPanos = function() {
  17631. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  17632. }
  17633. ,
  17634. n.prototype.setProjectedPanos = function(e, t, i) {
  17635. void 0 !== i && null !== i || (i = !0),
  17636. i = !!i,
  17637. this.projectedPano0 = e,
  17638. this.projectedPano1 = t,
  17639. this.skybox.material.setProjectedPanos(e, t, i),
  17640. this.chunks.forEach(function(n) {
  17641. n.materialInside.setProjectedPanos(e, t, i)
  17642. })
  17643. }
  17644. ,
  17645. n.prototype.setSide = function(e) {
  17646. this.floors.forEach(function(t) {
  17647. t.collider.material.side = e
  17648. })
  17649. }
  17650. ,
  17651. n.prototype.heroCount = function() {
  17652. return this.heroLocations ? this.heroLocations.length : 0
  17653. }
  17654. ,
  17655. n.prototype.getHeroDescriptorByIndex = function(e) {
  17656. if (e < 0)
  17657. return O.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  17658. null;
  17659. var t = this.heroCount();
  17660. if (t < 1)
  17661. return O.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  17662. null;
  17663. var i = this.heroLocations[e];
  17664. return void 0 === i ? (O.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  17665. null) : i
  17666. }
  17667. ,
  17668. n.prototype.findPanoramicHero = function() {
  17669. for (var e in this.heroLocations)
  17670. if (this.heroLocations[e].cameraMode === c.PANORAMA)
  17671. return this.heroLocations[e];
  17672. return null
  17673. }
  17674. ,
  17675. n.prototype.listImagePanos = function() {
  17676. var e = []
  17677. , t = this;
  17678. return this.images.forEach(function(i) {
  17679. if (i.metadata && i.metadata.scan_id) {
  17680. var n = t.panos.get(i.metadata.scan_id);
  17681. n && (t.supportsTiles || n.isLoaded("high") || e.push(n))
  17682. }
  17683. }),
  17684. e
  17685. }
  17686. ,
  17687. n.prototype.fadePanoMarkers = function(e, t) {
  17688. this.panos.fadeMarkerOpacity(e, t)
  17689. }
  17690. ,
  17691. n.prototype.setSweepVisibility = function(e) {
  17692. this.panos.forEach(function(t) {
  17693. t.marker && (t.marker.visible = e)
  17694. })
  17695. }
  17696. ,
  17697. n.prototype.outsideAllowed = function() {
  17698. return this.supportedModes[c.DOLLHOUSE] && this.supportedModes[c.FLOORPLAN]
  17699. }
  17700. ,
  17701. t.exports = n
  17702. }
  17703. ).call(this, "/js/model/Model.js")
  17704. }
  17705. , {
  17706. "../constants": 8,
  17707. "../enum/AlignmentType": 17,
  17708. "../enum/RenderOrder": 42,
  17709. "../enum/Viewmode": 51,
  17710. "../exception/BasicException": 55,
  17711. "../label/Label": 90,
  17712. "../loaders/ModelLoader": 105,
  17713. "../loaders/ModelTextureLoader": 106,
  17714. "../loaders/SweepDataLoader": 107,
  17715. "../tag/tag": 123,
  17716. "../tag/tagManager": 124,
  17717. "../objects/BoundingTextureSkybox": 143,
  17718. "../objects/Chunk": 144,
  17719. "../objects/Floor": 146,
  17720. "../objects/Panorama": 148,
  17721. "../objects/Room": 150,
  17722. "../objects/Snapshot": 153,
  17723. "../settings": 166,
  17724. "../shaders": 167,
  17725. "../util/ModelUrls": 177,
  17726. "../util/PanoramaCollection": 178,
  17727. "../util/ajax": 181,
  17728. "../util/common": 185,
  17729. "../util/easing": 186,
  17730. "../util/lerp": 188,
  17731. "../util/logger": 189,
  17732. "../util/math": 190,
  17733. "../util/texture": 194,
  17734. "../util/transitions": 195,
  17735. "./../util/browser": 182,
  17736. "./../util/showcase": 193,
  17737. "./Chunks": 135,
  17738. "./FloorCollection": 136,
  17739. "./ImageCollection": 137,
  17740. "./LabelCollection": 138,
  17741. "./RoomCollection": 141,
  17742. events: 202,
  17743. three: 217,
  17744. "hot": "hot"
  17745. }],
  17746. 140: [function(e, t, i) {
  17747. "use strict";
  17748. function n() {
  17749. this.modelMap = {},
  17750. this.activeModel = null,
  17751. this.modelCount = 0,
  17752. this.tileDownloader = null,
  17753. this.panoRenderer = null
  17754. }
  17755. var r = (e("three"),
  17756. e("../util/common"))
  17757. , o = e("../exception/BasicException")
  17758. , a = e("../enum/ModelManagerEvents")
  17759. , s = e("../enum/PanoRendererEvents")
  17760. , l = e("events").EventEmitter;
  17761. n.prototype.init = function(e, t, i) {
  17762. this.tileDownloader = e,
  17763. this.panoRenderer = t,
  17764. this.qualityManager = i,
  17765. this.bindEvents()
  17766. }
  17767. ,
  17768. n.prototype.bindEvents = function() {
  17769. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17770. }
  17771. ,
  17772. n.prototype.onTileRendered = function(e, t, i, n) {}
  17773. ,
  17774. n.prototype.addModel = function(e) {
  17775. this.modelMap[e.sid] = e,
  17776. 0 === this.modelCount && this.activateModel(e.sid),
  17777. this.modelCount++,
  17778. this.emit(a.ModelAdded)
  17779. }
  17780. ,
  17781. n.prototype.getModel = function(e) {
  17782. return this.modelMap[e]
  17783. }
  17784. ,
  17785. n.prototype.activateModel = function(e) {
  17786. var t = this.modelMap[e];
  17787. if (!t)
  17788. throw new o("Tried to activate invalid model!");
  17789. var i = this.activeModel;
  17790. this.activeModel = t,
  17791. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  17792. this.tileDownloader.setUrls(t.urls),
  17793. t.panos.forEach(function(e) {
  17794. e.attachToPanoRenderer(this.panoRenderer),
  17795. e.tileDownloader = this.tileDownloader,
  17796. e.qualityManager = this.qualityManager
  17797. }
  17798. .bind(this)),
  17799. this.emit(a.ActiveModelChanged, {
  17800. oldModel: i,
  17801. model: t
  17802. })
  17803. }
  17804. ,
  17805. n.prototype.getActiveModel = function() {
  17806. return this.activeModel
  17807. }
  17808. ,
  17809. r.extend(n, l),
  17810. t.exports = n
  17811. }
  17812. , {
  17813. "../enum/ModelManagerEvents": 33,
  17814. "../enum/PanoRendererEvents": 35,
  17815. "../exception/BasicException": 55,
  17816. "../util/common": 185,
  17817. events: 202,
  17818. three: 217
  17819. }],
  17820. 141: [function(e, t, i) {
  17821. (function(i) {
  17822. "use strict";
  17823. function n() {
  17824. s.call(this)
  17825. }
  17826. var r = e("../objects/Room")
  17827. , o = (e("../settings"),
  17828. e("../util/logger"))
  17829. , a = (e("../util/transitions"),
  17830. e("../util/easing"),
  17831. e("../util/common"))
  17832. , s = e("../util/IndexedCollection")
  17833. , l = e("./Chunks");
  17834. new o(i);
  17835. a.inherit(n, s),
  17836. n.prototype.getIndex = function(e) {
  17837. return e.roomId
  17838. }
  17839. ,
  17840. n.prototype.calcRoomBoundaries = function() {
  17841. this.forEach(function(e) {
  17842. e.calcBoundaries()
  17843. })
  17844. }
  17845. ,
  17846. n.prototype.createFromChunks = function(e) {
  17847. var t = {
  17848. floorId: -1,
  17849. roomId: -1
  17850. }
  17851. , i = {};
  17852. e.forEach(function(e) {
  17853. l.parseIdsFromChunkName(e.name, t);
  17854. var o = i[t.roomId];
  17855. if (!o) {
  17856. var a = n.generateRoomId(t.floorId, t.roomId);
  17857. o = new r(t.floorId,a),
  17858. this.add(o),
  17859. i[t.roomId] = o
  17860. }
  17861. o.addChunk(e)
  17862. }
  17863. .bind(this)),
  17864. this.calcRoomBoundaries()
  17865. }
  17866. ,
  17867. n.generateRoomId = function(e, t) {
  17868. return e + "_" + t
  17869. }
  17870. ,
  17871. t.exports = n
  17872. }
  17873. ).call(this, "/js/model/RoomCollection.js")
  17874. }
  17875. , {
  17876. "../objects/Room": 150,
  17877. "../settings": 166,
  17878. "../util/IndexedCollection": 175,
  17879. "../util/common": 185,
  17880. "../util/easing": 186,
  17881. "../util/logger": 189,
  17882. "../util/transitions": 195,
  17883. "./Chunks": 135
  17884. }],
  17885. 142: [function(e, t, i) {
  17886. "use strict";
  17887. function n(e, t, i) {
  17888. e = e.clone();
  17889. var n = e.size()
  17890. , o = new r.BoxGeometry(n.x,n.y,n.z);
  17891. o.boundingBox = e,
  17892. r.Mesh.call(this, o, t),
  17893. this.position.copy(e.center()),
  17894. this.frustumCulled = !1,
  17895. i && this.add(new r.WireframeHelper(this))
  17896. }
  17897. var r = e("three");
  17898. n.prototype = Object.create(r.Mesh.prototype),
  17899. n.prototype.constructor = n,
  17900. t.exports = n
  17901. }
  17902. , {
  17903. three: 217
  17904. }],
  17905. 143: [function(e, t, i) {
  17906. (function(i) {
  17907. "use strict";
  17908. function n(e) {
  17909. h.time("Computing a nice bounding cubemap");
  17910. var t = new a({
  17911. side: r.BackSide,
  17912. transparent: !0
  17913. });
  17914. t.uniforms.modelAlpha.value = 0,
  17915. t.uniforms.opacity.value = 1 - s.modelAlpha,
  17916. this.renderOrder = l.boundingSkybox,
  17917. o.call(this, e, t),
  17918. h.timeEnd("Computing a nice bounding cubemap")
  17919. }
  17920. var r = e("three")
  17921. , o = (e("../enum/Viewmode"),
  17922. e("../shaders"),
  17923. e("./BoundingMesh"))
  17924. , a = e("../materials/ModelTextureMaterial")
  17925. , s = e("../settings")
  17926. , l = e("../enum/RenderOrder")
  17927. , c = e("../util/logger")
  17928. , h = new c(i);
  17929. n.prototype = Object.create(o.prototype),
  17930. n.prototype.constructor = n,
  17931. t.exports = n
  17932. }
  17933. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  17934. }
  17935. , {
  17936. "../enum/RenderOrder": 42,
  17937. "../enum/Viewmode": 51,
  17938. "../materials/ModelTextureMaterial": 118,
  17939. "../settings": 166,
  17940. "../shaders": 167,
  17941. "../util/logger": 189,
  17942. "./BoundingMesh": 142,
  17943. three: 217
  17944. }],
  17945. 144: [function(e, t, i) {
  17946. "use strict";
  17947. function n(e) {
  17948. this.materialInside = new s({
  17949. side: r.DoubleSide
  17950. });
  17951. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  17952. this.materialOutside = new r.RawShaderMaterial({
  17953. fragmentShader: o.modelOutside.fragmentShader,
  17954. vertexShader: o.modelOutside.vertexShader,
  17955. uniforms: t,
  17956. side: r.FrontSide,
  17957. name: "chunkOut"
  17958. }),
  17959. r.Mesh.call(this, e.geometry, this.materialInside),
  17960. this.name = e.name || "",
  17961. this.textureName = e.textureName,
  17962. this.meshUrl = e.meshUrl
  17963. }
  17964. var r = e("three")
  17965. , o = e("../shaders")
  17966. , a = e("../enum/Viewmode")
  17967. , s = e("../materials/ModelTextureMaterial");
  17968. n.prototype = Object.create(r.Mesh.prototype),
  17969. n.prototype.setTextureMap = function(e) {
  17970. this.materialInside.uniforms.map.value = e,
  17971. this.materialOutside.uniforms.map.value = e
  17972. }
  17973. ,
  17974. n.prototype.setMode = function(e) {
  17975. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  17976. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  17977. t.transparent = this.material.transparent,
  17978. t.uniforms.opacity.value = this.material.uniforms.opacity.value,
  17979. this.material = t
  17980. }
  17981. ,
  17982. t.exports = n
  17983. }
  17984. , {
  17985. "../enum/Viewmode": 51,
  17986. "../materials/ModelTextureMaterial": 118,
  17987. "../shaders": 167,
  17988. three: 217
  17989. }],
  17990. 145: [function(e, t, i) {
  17991. "use strict";
  17992. function n(e) {
  17993. this.chunksize = e || 10,
  17994. this.chunks = {},
  17995. this.boundingBoxes = {},
  17996. this.children = [],
  17997. this.offset = new r.Vector3(0,.5,0),
  17998. this.material = new r.MeshBasicMaterial({
  17999. color: 16777215 * Math.random(),
  18000. side: r.DoubleSide
  18001. })
  18002. }
  18003. var r = e("three");
  18004. e("../enum/Viewmode");
  18005. n.prototype.add = function(e) {
  18006. var t, i, n, o, a, s, l, c, h, u, d, p, f, g, m = e.attributes;
  18007. m ? (t = m.position.array,
  18008. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  18009. n = e.faces);
  18010. var v = new r.Vector3;
  18011. if (i)
  18012. for (o = 0,
  18013. a = i.length; o < a; o += 3) {
  18014. var A = 3 * i[o]
  18015. , y = 3 * i[o + 1]
  18016. , C = 3 * i[o + 2];
  18017. s = (t[A] + t[y] + t[C]) / 3,
  18018. l = (t[A + 1] + t[y + 1] + t[C + 1]) / 3,
  18019. c = (t[A + 2] + t[y + 2] + t[C + 2]) / 3,
  18020. h = Math.floor(s / this.chunksize),
  18021. u = Math.floor(l / this.chunksize),
  18022. d = Math.floor(c / this.chunksize),
  18023. p = h + "." + u + "." + d,
  18024. p in this.chunks ? (g = this.chunks[p],
  18025. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  18026. f = this.boundingBoxes[p] = new r.Box3),
  18027. g.push(t[A], t[A + 1], t[A + 2], t[y], t[y + 1], t[y + 2], t[C], t[C + 1], t[C + 2]),
  18028. f.expandByPoint(v.set(t[A], t[A + 1], t[A + 2])),
  18029. f.expandByPoint(v.set(t[y], t[y + 1], t[y + 2])),
  18030. f.expandByPoint(v.set(t[C], t[C + 1], t[C + 2]))
  18031. }
  18032. else
  18033. for (o = 0,
  18034. a = t.length; o < a; o += 9)
  18035. s = (t[o] + t[o + 3] + t[o + 6]) / 3,
  18036. l = (t[o + 1] + t[o + 4] + t[o + 7]) / 3,
  18037. c = (t[o + 2] + t[o + 5] + t[o + 8]) / 3,
  18038. h = Math.floor(s / this.chunksize),
  18039. u = Math.floor(l / this.chunksize),
  18040. d = Math.floor(c / this.chunksize),
  18041. p = h + "." + u + "." + d,
  18042. p in this.chunks ? (g = this.chunks[p],
  18043. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  18044. f = this.boundingBoxes[p] = new r.Box3),
  18045. g.push(t[o], t[o + 1], t[o + 2], t[o + 3], t[o + 4], t[o + 5], t[o + 6], t[o + 7], t[o + 8]),
  18046. f.expandByPoint(v.set(t[o], t[o + 1], t[o + 2])),
  18047. f.expandByPoint(v.set(t[o + 3], t[o + 4], t[o + 5])),
  18048. f.expandByPoint(v.set(t[o + 6], t[o + 7], t[o + 8]))
  18049. }
  18050. ,
  18051. n.prototype.build = function() {
  18052. var e = new r.Object3D;
  18053. e.material = this.material;
  18054. for (var t in this.chunks) {
  18055. var i = this.chunks[t]
  18056. , n = new r.BufferGeometry;
  18057. n.addAttribute("position", new r.BufferAttribute(new Float32Array(i),3)),
  18058. n.boundingBox = this.boundingBoxes[t];
  18059. var o = new r.Mesh(n,this.material);
  18060. o.material.visible = !1,
  18061. e.add(o),
  18062. this.chunks[t] = []
  18063. }
  18064. return e
  18065. }
  18066. ,
  18067. t.exports = n
  18068. }
  18069. , {
  18070. "../enum/Viewmode": 51,
  18071. three: 217
  18072. }],
  18073. 146: [function(e, t, i) {
  18074. "use strict";
  18075. var r = e("three")
  18076. , o = e("../settings")
  18077. , a = e("../util/common")
  18078. , s = e("../util/lerp")
  18079. , l = e("./ChunkedCollider")
  18080. , c = e("../util/transitions")
  18081. , h = e("../util/easing")
  18082. , u = (e("../objects/Panorama"),
  18083. e("../enum/RenderOrder"))
  18084. , d = e("../localization/localize");
  18085. function n(e, t, i) {
  18086. r.Object3D.call(this),
  18087. this.model = e,
  18088. this.floorIndex = t,
  18089. this.lang = o.languageTag,
  18090. this.name = i || o.languageTag === "cn" ? "Floor " + (t + 1) + "" : "第" + (t + 1) + "层",
  18091. this.panos = [],
  18092. this.chunks = [],
  18093. this.colliderBuilder = new l(3),
  18094. this.collider = null,
  18095. this.center = null,
  18096. this.boundingBox = new r.Box3,
  18097. this.size = null,
  18098. this.hidden = !1,
  18099. this.conservativeBoundingBox = new r.Box3,
  18100. this.debugColor = 16777215 * Math.random(),
  18101. this.transition = null
  18102. }
  18103. n.prototype = Object.create(r.Object3D.prototype),
  18104. n.prototype.enter = function(e) {
  18105. this.model.setFloor(this, e)
  18106. }
  18107. ,
  18108. n.prototype.hide = function(e) {
  18109. if (!this.hidden || this.transition) {
  18110. this.chunks.forEach(function(e) {
  18111. e.material.transparent = !0
  18112. }),
  18113. c.cancel(this.transition);
  18114. var t = e ? 0 : o.hideFloorDuration + o.hideFloorDelay
  18115. , i = e ? 0 : o.hideFloorDelay / t;
  18116. this.transition = c.start(s.allUniforms(this.chunks, "opacity", .08), t, function() {
  18117. this.hidden = !0
  18118. }
  18119. .bind(this), i, h.easeInOutQuad)
  18120. }
  18121. }
  18122. ,
  18123. n.prototype.show = function(e) {
  18124. if (this.hidden || this.transition) {
  18125. this.hidden = !1,
  18126. c.cancel(this.transition);
  18127. var t = e ? o.showFloorDuration : o.showFloorDuration + o.showFloorDelay
  18128. , i = e ? 0 : o.showFloorDelay / t;
  18129. this.transition = c.start(s.allUniforms(this.chunks, "opacity", 1), t, function() {
  18130. this.hidden || this.chunks.forEach(function(e) {
  18131. e.material.transparent = !1
  18132. })
  18133. }
  18134. .bind(this), i, h.easeInOutQuad)
  18135. }
  18136. }
  18137. ,
  18138. n.prototype.toggle = function(e, t) {
  18139. e = void 0 === e ? this.hidden : e,
  18140. e ? this.show(t) : this.hide(t)
  18141. }
  18142. ,
  18143. n.prototype.containsPoint = function(e) {
  18144. return this.collider.children.some(function(t) {
  18145. return t.geometry.boundingBox || t.geometry.computeBoundingBox(),
  18146. t.geometry.boundingBox.containsPoint(e)
  18147. })
  18148. }
  18149. ,
  18150. n.prototype.distanceToPoint = function(e) {
  18151. var t = null
  18152. , i = 1 / 0;
  18153. return this.collider.children.forEach(function(n) {
  18154. n.geometry.boundingBox || n.geometry.computeBoundingBox();
  18155. var r = n.geometry.boundingBox.distanceToPoint(e);
  18156. (!t || i > r) && (i = r,
  18157. t = n)
  18158. }),
  18159. i
  18160. }
  18161. ,
  18162. n.prototype.addChunk = function(e) {
  18163. e.renderOrder = u.ghostFloor,
  18164. this.add(e),
  18165. this.chunks.push(e),
  18166. this.boundingBox.union(e.geometry.boundingBox),
  18167. this.size = this.boundingBox.size(),
  18168. this.colliderBuilder.add(e.geometry)
  18169. }
  18170. ,
  18171. n.prototype.addPano = function(e) {
  18172. this.panos.push(e),
  18173. this.add(e.skyboxMesh),
  18174. e.marker && this.add(e.marker);
  18175. var t = new r.Vector3(1,1,1)
  18176. , i = (new r.Box3).setFromCenterAndSize(e.position, t);
  18177. this.boundingBox.union(i)
  18178. }
  18179. ,
  18180. n.prototype.build = function() {
  18181. this.collider = this.colliderBuilder.build(!0),
  18182. this.add(this.collider),
  18183. this.center = this.boundingBox.center(),
  18184. this.conservativeBoundingBox.copy(this.boundingBox),
  18185. this.conservativeBoundingBox.min.y = a.lowerMedian(this.collider.children.map(function(e) {
  18186. return e.geometry.boundingBox.min.y
  18187. }), 5),
  18188. this.conservativeBoundingBox.max.y = a.lowerMedian(this.collider.children.map(function(e) {
  18189. return e.geometry.boundingBox.max.y
  18190. }), 5),
  18191. this.colliderBuilder = null
  18192. }
  18193. ,
  18194. n.prototype.toShortString = function() {
  18195. return a.nth(this.floorIndex + 1)
  18196. }
  18197. ,
  18198. n.prototype.toString = function() {
  18199. return this.name
  18200. }
  18201. ,
  18202. t.exports = n
  18203. }
  18204. , {
  18205. "../enum/RenderOrder": 42,
  18206. "../localization/localize": 108,
  18207. "./strings-cn-CN": 109,
  18208. "../objects/Panorama": 148,
  18209. "../settings": 166,
  18210. "../util/common": 185,
  18211. "../util/easing": 186,
  18212. "../util/lerp": 188,
  18213. "../util/transitions": 195,
  18214. "./ChunkedCollider": 145,
  18215. three: 217
  18216. }],
  18217. 147: [function(e, t, i) {
  18218. "use strict";
  18219. function n(e) {
  18220. this.player = e,
  18221. this.obj3d = null,
  18222. this.UP = new r.Vector3(0,1,0)
  18223. }
  18224. var r = e("three")
  18225. , o = e("../settings");
  18226. n.prototype.prefs = {
  18227. linewidth: 3,
  18228. height: .07,
  18229. opacity: .45,
  18230. endScale: .05
  18231. },
  18232. n.prototype.discard = function() {
  18233. if (this.obj3d) {
  18234. var e = this.obj3d.parent;
  18235. e && e.remove(this.obj3d)
  18236. }
  18237. this.obj3d = null
  18238. }
  18239. ,
  18240. n.prototype.draw = function() {
  18241. if (this.discard(),
  18242. o.showNeighbors) {
  18243. var e = this.player.currentPano.floor;
  18244. this.obj3d = new r.Object3D;
  18245. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  18246. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  18247. i.y += this.prefs.height;
  18248. var n = .1525
  18249. , a = .127
  18250. , s = .0127
  18251. , l = .1
  18252. , c = .19
  18253. , h = .2032
  18254. , u = .2286
  18255. , d = .255
  18256. , p = new r.Matrix4;
  18257. for (var f in t)
  18258. if (t[f]) {
  18259. var g = this.player.model.panos.get(f)
  18260. , m = (g.position.clone().sub(this.player.model.position),
  18261. g.position.clone().sub(g.floorPosition))
  18262. , v = g.floorPosition.clone().sub(this.player.model.position);
  18263. v.y += this.prefs.height;
  18264. var A = new r.Geometry;
  18265. A.vertices.push(new r.Vector3(0,-s,0), new r.Vector3(-s,0,0), new r.Vector3(0,s,0), new r.Vector3(s,0,0), new r.Vector3(0,-s,0)),
  18266. A.vertices.push(new r.Vector3(0,-d,0), new r.Vector3(d,-d,0), new r.Vector3(d,n,0), new r.Vector3(-n,n,0), new r.Vector3(-n,a,0), new r.Vector3(-c,l,0), new r.Vector3(-c,-h,0), new r.Vector3(-n,-u,0), new r.Vector3(-n,-d,0), new r.Vector3(0,-d,0)),
  18267. p.identity().setPosition(m),
  18268. A.applyMatrix(p),
  18269. A.vertices.push(new r.Vector3(0,-this.prefs.endScale,0)),
  18270. A.vertices.push(new r.Vector3(-this.prefs.endScale,-this.prefs.endScale,0), new r.Vector3(-this.prefs.endScale,this.prefs.endScale,0), new r.Vector3(this.prefs.endScale,this.prefs.endScale,0), new r.Vector3(this.prefs.endScale,-this.prefs.endScale,0)),
  18271. p.lookAt(v, i, this.UP).setPosition(v),
  18272. A.applyMatrix(p),
  18273. A.vertices.push(v, i);
  18274. var y = new r.Line(A,new r.LineBasicMaterial({
  18275. color: g.debugColor.getHex(),
  18276. transparent: !0,
  18277. opacity: this.prefs.opacity,
  18278. depthWrite: !1,
  18279. name: "sLine" + f,
  18280. linewidth: this.prefs.linewidth
  18281. }));
  18282. this.obj3d.add(y)
  18283. }
  18284. e.add(this.obj3d)
  18285. }
  18286. }
  18287. ,
  18288. n.prototype.update = function() {
  18289. o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  18290. }
  18291. ,
  18292. t.exports = n
  18293. }
  18294. , {
  18295. "../settings": 166,
  18296. three: 217
  18297. }],
  18298. 148: [function(e, t, i) {
  18299. (function(i) {
  18300. "use strict";
  18301. function n(e, t, i, n) {
  18302. this.model = e,
  18303. this.id = t,
  18304. this.alignmentType = i.alignmentType || l.ALIGNED,
  18305. this.neighbourUUIDs = i.neighbours || null,
  18306. this.neighbourPanos = null,
  18307. this.floor = null,
  18308. this.floorIndex = i.floor,
  18309. this.failedLoadingAt = 0,
  18310. this.maxLoadRetries = 4,
  18311. this.origin = i.position.clone(),
  18312. this.position = this.alignmentType === l.UNALIGNED ? new r.Vector3(0,-5,0) : i.position.clone(),
  18313. this.quaternion = i.quaternion.clone(),
  18314. this.skyboxMesh = new r.Mesh(E),
  18315. this.skyboxMesh.position.copy(this.position),
  18316. this.skyboxMesh.quaternion.copy(this.quaternion),
  18317. this.skyboxMesh.name = "skybox",
  18318. this.skyboxMesh.visible = !1,
  18319. this.skyboxMesh.updateMatrix(),
  18320. this.skyboxMesh.updateMatrixWorld(),
  18321. this.marker = null,
  18322. this.showFloorMarker = (typeof window.MP_PREFETCHED_MODELDATA.hideFloorMarker === 'undefined')?true: (window.MP_PREFETCHED_MODELDATA.hideFloorMarker === 'false')?true:false;
  18323. this.isAligned() && (this.marker = new r.Mesh(b,new r.MeshBasicMaterial({
  18324. map: w,
  18325. side: r.DoubleSide,
  18326. opacity: 0,
  18327. transparent: !0,
  18328. depthWrite: !1,
  18329. visible:this.showFloorMarker // 隐藏/显示地面标志
  18330. })),
  18331. this.marker.renderOrder = s.panoMarker,
  18332. this.marker.name = "marker",
  18333. this.marker.pano = this,
  18334. this.marker.layers.set(v.PANOMARKERS),
  18335. this.marker.updateMatrixWorld(),
  18336. a.colorMarkerOnLoad && this.on("load", function() {
  18337. this.marker.material.color.set(65280)
  18338. })),
  18339. this.debugColor = (new r.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  18340. this.floorPosition = i.puck ? i.puck.clone() : null,
  18341. this.tiled = n,
  18342. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new r.Texture([null, null, null, null, null, null]),
  18343. this.solidSkybox.flipY = !1,
  18344. a.minimalMemoryMode && (this.solidSkybox.minFilter = r.LinearFilter,
  18345. this.solidSkybox.magFilter = r.LinearFilter,
  18346. this.solidSkybox.generateMipmaps = !1)),
  18347. this.zoomed = !1,
  18348. this.panoRenderer = null,
  18349. this.qualityManager = null,
  18350. this.tileDownloader = null,
  18351. this.tiledPanoRenderTarget = null,
  18352. this.minimumTiledPanoLoaded = !1,
  18353. this.highestPartialTileRenderOpCompleted = 0,
  18354. this.highestFullTileRenderOpCompleted = 0,
  18355. this.shouldRedrawOnBaseLoaded = !1,
  18356. this.lockUntilRenderingComplete = !1,
  18357. a.colorMarkerOnLoad && this.on("load", function() {
  18358. this.marker.material.color.set(65280)
  18359. });
  18360. /********************************************************************fyz改vr from徐世廷*************************************************************/
  18361. var e = new r.TextureLoader;
  18362. e.setCrossOrigin(!0);
  18363. var g = e.load("images/texture.jpg");
  18364. if (this.vrMarker = new r.Mesh(new r.OctahedronGeometry(.1,0),new r.MeshLambertMaterial({
  18365. color: 16777215,
  18366. transparent: !0,
  18367. opacity: .75,
  18368. map: g
  18369. })),
  18370. this.vrMarker.boluoType = "vr",
  18371. this.vrMarker.position.z = 1,
  18372. this.vrMarker.enabled = !0,
  18373. this.vrMarker.visible = !1,
  18374. window.vrMarkers = window.vrMarkers || [],
  18375. window.vrMarkers.push(this.vrMarker),
  18376. this.marker && this.marker.add(this.vrMarker),
  18377. a.showAxis && (this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0,1,0),new r.Vector3(0,0,0),1,255)),
  18378. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0,0,1),new r.Vector3(0,0,0),1,16711680)),
  18379. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(1,0,0),new r.Vector3(0,0,0),1,65280))),
  18380. this.adjustAngleEnable) {
  18381. var i = new r.Quaternion;
  18382. i.setFromAxisAngle(new r.Vector3(1,0,0), this.adjustAngleX),
  18383. this.skyboxMesh.quaternion.multiply(i);
  18384. var m = new r.Quaternion;
  18385. m.setFromAxisAngle(new r.Vector3(0,1,0), this.adjustAngleY),
  18386. this.skyboxMesh.quaternion.multiply(m);
  18387. var n = new r.Quaternion;
  18388. n.setFromAxisAngle(new r.Vector3(0,0,1), this.adjustAngleZ),
  18389. this.skyboxMesh.quaternion.multiply(n),
  18390. this.skyboxMesh.updateMatrix(),
  18391. this.skyboxMesh.updateMatrixWorld(),
  18392. this.model.updateProjectedPanos()
  18393. }
  18394. /**************************************************************************************************************************************/
  18395. }
  18396. var r = e("three")
  18397. , o = e("../util/logger")
  18398. , a = e("../settings")
  18399. , s = (e("../enum/Viewmode"),
  18400. e("../enum/RenderOrder"))
  18401. , l = e("../enum/AlignmentType")
  18402. , c = (e("../util/common"),
  18403. e("../util/transitions"))
  18404. , h = e("../util/lerp")
  18405. , u = e("../util/ajax")
  18406. , d = e("../util/texture")
  18407. , p = e("../util/panorama")
  18408. , f = (e("../enum/TileDownloaderEvents"),
  18409. e("../enum/PanoramaEvents"))
  18410. , g = e("../enum/PanoRendererEvents")
  18411. , m = e("../enum/PanoSizeClass")
  18412. , v = e("../enum/RenderLayers")
  18413. , A = (e("../scene/SceneRenderer"),
  18414. e("../enum/GLCubeFaces"),
  18415. e("../exception/BasicException"))
  18416. , y = e("../tile/TileUtils")
  18417. , C = e("events").EventEmitter
  18418. , I = new o(i)
  18419. , E = new r.SphereBufferGeometry(.1)
  18420. , b = new r.PlaneBufferGeometry(.4,.4,1,1)
  18421. , w = d.load("images/marker-256x256.png");
  18422. n.prototype = Object.create(C.prototype),
  18423. n.prototype.enter = function() {
  18424. var e = null;
  18425. return function() {
  18426. this.setZoomed(!1),
  18427. this.emit("enter", {
  18428. oldPano: e,
  18429. newPano: this
  18430. }),
  18431. e = this
  18432. }
  18433. }(),
  18434. n.prototype.exit = function() {
  18435. this.tiled ? (this.clearWaitDeferreds(),
  18436. this.minimumTiledPanoLoaded = !1,
  18437. this.tiledPanoRenderTarget = null,
  18438. this.setZoomed(!1),
  18439. this.panoRenderer.deactivateTiledPano(this),
  18440. this.highestPartialTileRenderOpCompleted = 0,
  18441. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  18442. this.solidSkybox.loaded = !1,
  18443. this.solidSkybox.version = 0),
  18444. this.emit("exit")
  18445. }
  18446. ,
  18447. n.prototype.hoverOn = function(e) {
  18448. this.marker && (c.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  18449. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  18450. }
  18451. ,
  18452. n.prototype.hoverOff = function(e) {
  18453. this.marker && c.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  18454. }
  18455. ,
  18456. n.prototype.build1 = function() {
  18457. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
  18458. this.floor.addPano(this),
  18459. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  18460. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  18461. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  18462. }
  18463. ,
  18464. n.prototype.build2 = function() {
  18465. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  18466. this.height = this.position.distanceTo(this.floorPosition),
  18467. this.placeMarker()
  18468. }
  18469. ,
  18470. n.prototype.interpolateFloorPosition = function() {
  18471. var e = this.model.panos.filter(n.filters.isNeighbourPanoTo(this)).filter(function(e) {
  18472. return !!e.floorPosition
  18473. }).sort(function(e, t) {
  18474. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  18475. }
  18476. .bind(this))
  18477. , t = this.position.clone();
  18478. return e.length >= 2 ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  18479. t
  18480. }
  18481. ,
  18482. n.prototype.raycastFloorPosition = function() {
  18483. I.warn("Performance warning: Raycasting to find floor position");
  18484. var e = new r.Raycaster(this.position,new r.Vector3(0,-1,0))
  18485. , t = e.intersectObjects(this.model.colliders);
  18486. return t.length ? t[0].point : null
  18487. }
  18488. ,
  18489. n.prototype.raycastToFindFloor = function() {
  18490. var e = [new r.Vector3(0,-1,0), new r.Vector3(1,-1,0), new r.Vector3(0,-1,1), new r.Vector3(-1,-1,0), new r.Vector3(0,-1,-1), new r.Vector3(1,0,0), new r.Vector3(0,0,1), new r.Vector3(-1,0,0), new r.Vector3(0,0,-1)];
  18491. return function() {
  18492. I.warn("Performance warning: Raycasting to find floor index");
  18493. for (var t = 0; t < e.length; t++) {
  18494. var i = new r.Raycaster(this.position.clone(),e[t].clone())
  18495. , n = i.intersectObjects(this.model.colliders);
  18496. if (n.length)
  18497. return n[0].object.parent.parent
  18498. }
  18499. return null
  18500. }
  18501. }(),
  18502. n.prototype.placeMarker = function() {
  18503. this.marker && (this.marker.position.copy(this.floorPosition),
  18504. this.marker.position.y += .05,
  18505. this.marker.lookAt(new r.Vector3(0,1,0).add(this.marker.position)))
  18506. }
  18507. ,
  18508. n.prototype.translate = function(e) {
  18509. this.position.add(e),
  18510. this.floorPosition.add(e)
  18511. }
  18512. ,
  18513. n.prototype.findClosestMidtpointPanoTo = function(e) {
  18514. (new r.Vector3).addVectors(this.position, e.position).divideScalar(2);
  18515. return this.model.panos.find([n.filters.notIn([this, e])], [n.sortFunctions.distanceToPoint(point)])
  18516. }
  18517. ,
  18518. n.prototype.attachToPanoRenderer = function(e) {
  18519. this.panoRenderer = e,
  18520. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  18521. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  18522. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  18523. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  18524. }
  18525. ;
  18526. var _ = {};
  18527. n.prototype.getWaitDeferred = function(e) {
  18528. var t = _[this.id];
  18529. t || (t = {},
  18530. _[this.id] = t);
  18531. var i = t[e];
  18532. return i || (i = {
  18533. deferred: $.Deferred(),
  18534. active: !1
  18535. },
  18536. t[e] = i),
  18537. i
  18538. }
  18539. ,
  18540. n.prototype.resetWaitDeferred = function(e) {
  18541. var t = this.getWaitDeferred(e);
  18542. t.active = !1,
  18543. t.deferred = $.Deferred()
  18544. }
  18545. ,
  18546. n.prototype.clearWaitDeferreds = function() {
  18547. var e = _[this.id];
  18548. e || (e = {},
  18549. _[this.id] = e);
  18550. for (var t in e)
  18551. if (e.hasOwnProperty(t)) {
  18552. var i = e[t];
  18553. i.active = !1,
  18554. i.deferred = $.Deferred()
  18555. }
  18556. }
  18557. ,
  18558. n.prototype.loadTiledPano = function() {
  18559. var e = (new r.Vector3,
  18560. [])
  18561. , t = [];
  18562. return function(i, n, r, o, a, s) {
  18563. null !== o && void 0 !== o || (o = !0),
  18564. null !== a && void 0 !== a || (a = !0);
  18565. var l = this.getWaitDeferred(i)
  18566. , c = l.deferred
  18567. , h = null
  18568. , u = null;
  18569. if (r && ("number" == typeof r ? h = r : (h = r.hFov,
  18570. u = r.vFov)),
  18571. !this.isLoaded(i)) {
  18572. if (!l.active) {
  18573. if (l.active = !0,
  18574. r) {
  18575. var d = y.matchingTilesInDirection(this, i, n, h, u);
  18576. e[this.id + ":" + i] = {
  18577. tileCount: 0,
  18578. targetTileCount: d
  18579. },
  18580. I.info("Loading partial pano: " + this.id + " with " + d + " tiles")
  18581. }
  18582. t[this.id] || (t[this.id] = !0,
  18583. this.on(f.LoadComplete, function(e, t) {
  18584. var i = this.getWaitDeferred(e).deferred;
  18585. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  18586. this.resetWaitDeferred(e))
  18587. }
  18588. .bind(this)),
  18589. this.on(f.LoadFailed, function(e) {
  18590. var t = this.getWaitDeferred(e).deferred;
  18591. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  18592. this.resetWaitDeferred(e))
  18593. }
  18594. .bind(this)),
  18595. this.on(f.TileLoaded, function(t, i, n) {
  18596. var r = this.getWaitDeferred(t).deferred;
  18597. if (r && "pending" === r.state()) {
  18598. r.notify(t, i, n);
  18599. var o = e[this.id + ":" + t];
  18600. o && (o.tileCount++,
  18601. o.tileCount === o.targetTileCount && (this.onPanoRendered(this.id, t, n, !0),
  18602. r.resolve(t, n),
  18603. this.resetWaitDeferred(t)))
  18604. }
  18605. }
  18606. .bind(this)))
  18607. }
  18608. this.tileDownloader.clearForceQueue(),
  18609. this.tileDownloader.forceQueueTilesForPano(this, i, n, h, u, s),
  18610. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), o),
  18611. this.panoRenderer.renderPanoTiles(this.id, n, a)
  18612. }
  18613. return c.promise()
  18614. }
  18615. }(),
  18616. n.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  18617. if (e === this.id) {
  18618. var n = this.qualityManager.getPanoSize(m.BASE);
  18619. t === n && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  18620. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  18621. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  18622. }
  18623. }
  18624. ,
  18625. n.prototype.onTileRendered = function(e, t, i, n) {
  18626. e === this.id && this.emit(f.TileLoaded, t, i, n)
  18627. }
  18628. ,
  18629. n.prototype.onPanoRendered = function(e, t, i, n) {
  18630. e === this.id && (this.minimumTiledPanoLoaded = !0,
  18631. this.updateSkyboxForZoomLevel(),
  18632. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  18633. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  18634. this.emit("load", t),
  18635. this.model.emit("load", this),
  18636. this.emit(f.LoadComplete, t, i))
  18637. }
  18638. ,
  18639. n.prototype.setZoomed = function(e) {
  18640. this.zoomed = e,
  18641. this.updateSkyboxForZoomLevel()
  18642. }
  18643. ,
  18644. n.prototype.ensureSkyboxReadyForRender = function() {
  18645. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  18646. this.solidSkybox.loaded = !0)
  18647. }
  18648. ,
  18649. n.prototype.updateSkyboxForZoomLevel = function() {
  18650. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  18651. }
  18652. ,
  18653. n.prototype.getSkyboxTexture = function() {
  18654. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  18655. }
  18656. ,
  18657. n.prototype.onTileRenderFail = function(e, t, i) {
  18658. e === this.id && this.emit(f.LoadFailed, t)
  18659. }
  18660. ,
  18661. n.prototype.isLoaded = function(e) {
  18662. if (this.tiled) {
  18663. if (e && "string" == typeof e)
  18664. throw new A("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  18665. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  18666. }
  18667. if (e && "number" == typeof e)
  18668. throw new A("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  18669. return !!this.solidSkybox.high || e in this.solidSkybox
  18670. }
  18671. ,
  18672. n.prototype.loadCube = function(e) {
  18673. if (this.isLoaded(e))
  18674. return I.info("Skipping load of pano, already loaded"),
  18675. $.when();
  18676. this.emit("loading", e),
  18677. this.model.emit("loading", this);
  18678. var t = p.getCubemapUrls(this.model.urls, this.id, e)
  18679. , i = t.filter(function(e) {
  18680. return !e
  18681. });
  18682. "low" === e && i.length > 0 && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  18683. e = "high",
  18684. t = p.getCubemapUrls(this.model.urls, this.id, e));
  18685. var n = 0
  18686. , r = [0, 1, 2, 3, 4, 5].map(function(e, i, n) {
  18687. return u.getImage(t[i])
  18688. }
  18689. .bind(this));
  18690. return $.when(r[0], r[1], r[2], r[3], r[4], r[5]).then(function(t, i, n, r, o, a) {
  18691. return this.solidSkybox[e] = [t, i, n, r, o, a],
  18692. "high" !== e && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[e],
  18693. this.solidSkybox.low = null),
  18694. this.solidSkybox.needsUpdate = !0,
  18695. this.emit("load", e),
  18696. this.model.emit("load", this),
  18697. this
  18698. }
  18699. .bind(this), function() {
  18700. I.error("Downloading cubemap for pano", this.id, "failed"),
  18701. this.failedLoadingAt = Date.now()
  18702. }
  18703. .bind(this), function() {
  18704. return $.when(++n, 6)
  18705. })
  18706. }
  18707. ,
  18708. n.raycastsSkipped = 0,
  18709. n.raycastsDone = 0,
  18710. n.prototype.findNeighourPanos = function() {
  18711. return this.model.panos.setNeighbour(this.id, this.id, !1),
  18712. this.model.panos.forEach(function(e) {
  18713. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  18714. var t = this.position.distanceTo(e.position);
  18715. if (t > a.panoramaNeighbourMaxDistance)
  18716. return this.model.panos.setNeighbour(this, e, !1),
  18717. void n.raycastsSkipped++;
  18718. var i = e.position.clone().sub(this.position).normalize()
  18719. , o = new r.Raycaster(this.position,i.clone(),0,t)
  18720. , s = o.intersectObjects(this.model.colliders);
  18721. n.raycastsDone++,
  18722. this.model.panos.setNeighbour(this, e, 0 === s.length),
  18723. a.showNeighbourRaycasts && (s.length ? this.floor.model.add(new r.ArrowHelper(i,this.position,s[0].distance,16711680)) : this.floor.model.add(new r.ArrowHelper(i,this.position,t,16777215,0,0)))
  18724. }
  18725. }
  18726. .bind(this)),
  18727. this.model.panos.neighbourMap[this.id]
  18728. }
  18729. ,
  18730. n.prototype.worldPosition = function() {
  18731. return this.position
  18732. }
  18733. ,
  18734. n.prototype.addTextSprite = function(e, t) {
  18735. this.removeTextSprite();
  18736. var i = document.createElement("canvas")
  18737. , n = i.getContext("2d");
  18738. i.width = 256,
  18739. i.height = 256;
  18740. var o = "Arial"
  18741. , a = 60;
  18742. n.font = "bold " + a + "px " + o,
  18743. n.fillStyle = "white";
  18744. var s = n.measureText(e).width;
  18745. n.fillText(e, (i.width - s) / 2, (i.height + a) / 2);
  18746. var l = new r.Texture(i);
  18747. l.needsUpdate = !0;
  18748. var c = new r.SpriteMaterial({
  18749. map: l,
  18750. color: t || 16428055
  18751. });
  18752. this.text3d = new r.Sprite(c),
  18753. this.text3d.position.copy(this.skyboxMesh.position),
  18754. this.floor.add(this.text3d)
  18755. }
  18756. ,
  18757. n.prototype.removeTextSprite = function() {
  18758. this.text3d && (this.floor.remove(this.text3d),
  18759. this.text3d = null)
  18760. }
  18761. ,
  18762. n.prototype.isAligned = function() {
  18763. return this.alignmentType === l.ALIGNED
  18764. }
  18765. ,
  18766. n.filters = {
  18767. inDirection: function(e, t, i) {
  18768. return function(n) {
  18769. var r = n.position.clone().sub(e).normalize();
  18770. return r.dot(t) > i
  18771. }
  18772. },
  18773. inFloorDirection: function(e, t, i) {
  18774. return function(n) {
  18775. var r = n.floorPosition.clone().sub(e).normalize();
  18776. return r.dot(t) > i
  18777. }
  18778. },
  18779. inPanoDirection: function(e, t, i) {
  18780. return i = a.navigation.panoScores ? a.navigation.filterStrictness : i,
  18781. function(n) {
  18782. var r = n.floorPosition.clone().sub(e).normalize()
  18783. , o = n.position.clone().sub(e).normalize();
  18784. return r.dot(t) > i || o.dot(t) > i
  18785. }
  18786. },
  18787. atFloor: function(e) {
  18788. return function(t) {
  18789. return !e || t.floor === e
  18790. }
  18791. },
  18792. not: function(e) {
  18793. return function(t) {
  18794. return t !== e
  18795. }
  18796. },
  18797. notIn: function(e) {
  18798. return function(t) {
  18799. return e.indexOf(t) === -1
  18800. }
  18801. },
  18802. isLoaded: function() {
  18803. return function(e) {
  18804. return e.isLoaded()
  18805. }
  18806. },
  18807. isNotLoaded: function() {
  18808. return function(e) {
  18809. return !e.isLoaded()
  18810. }
  18811. },
  18812. isCloseEnoughTo: function(e, t) {
  18813. return function(i) {
  18814. return e.distanceTo(i.floorPosition) < t
  18815. }
  18816. },
  18817. hasMinimumHeightDifferenceTo: function(e, t) {
  18818. return function(i) {
  18819. return Math.abs(i.position.y - e.y) > t
  18820. }
  18821. },
  18822. isNotBehindNormal: function(e, t) {
  18823. var i = new r.Vector3;
  18824. return t = t.clone(),
  18825. function(n) {
  18826. var r = i.copy(n.position).sub(e).normalize();
  18827. return r.dot(t) > 0
  18828. }
  18829. },
  18830. isNeighbourPanoTo: function(e) {
  18831. return function(t) {
  18832. return !e || !e.neighbourPanos || !!e.neighbourPanos[t.id]
  18833. }
  18834. },
  18835. isNeighbourOfNeighbourTo: function(e) {
  18836. return function(t) {
  18837. return !!e.neighbourPanos[t.id] || e.neighbourUUIDs.some(function(i) {
  18838. var n = e.model.panos.get(i);
  18839. return !!n && n.neighbourPanos[t.id]
  18840. })
  18841. }
  18842. },
  18843. isNotRecentlyFailed: function(e) {
  18844. return function(t) {
  18845. return Date.now() - t.failedLoadingAt > e
  18846. }
  18847. },
  18848. isOnVisibleFloor: function() {
  18849. return function(e) {
  18850. return !e.floor.hidden
  18851. }
  18852. },
  18853. isPanoAligned: function() {
  18854. return function(e) {
  18855. return e.isAligned()
  18856. }
  18857. }
  18858. },
  18859. n.sortFunctions = {
  18860. distanceToPoint: function(e) {
  18861. return function(t, i) {
  18862. return t.position.distanceTo(e) - i.position.distanceTo(e)
  18863. }
  18864. },
  18865. floorDistanceToPoint: function(e) {
  18866. return function(t, i) {
  18867. return t.floorPosition.distanceTo(e) - i.floorPosition.distanceTo(e)
  18868. }
  18869. },
  18870. choose: function(e) {
  18871. return function(t, i) {
  18872. return e.id === t.id ? -1 : e.id === i.id ? 1 : 0
  18873. }
  18874. }
  18875. },
  18876. n.scoreFunctions = {
  18877. distance: function(e, t) {
  18878. return t = t || a.navigation.distanceFactor,
  18879. function(i) {
  18880. return e ? e.position.distanceTo(i.position) * t : 0
  18881. }
  18882. },
  18883. distanceSquared: function(e, t) {
  18884. return t = t || a.navigation.distanceFactor,
  18885. function(i) {
  18886. return e ? e.position.distanceToSquared(i.position) * t : 0
  18887. }
  18888. },
  18889. direction: function(e, t) {
  18890. return function(i) {
  18891. var n = i.position.clone().sub(e).normalize();
  18892. return n.dot(t) * a.navigation.directionFactor
  18893. }
  18894. },
  18895. angle: function(e, t) {
  18896. return function(i) {
  18897. var n = i.position.clone().sub(e).normalize();
  18898. return n.angleTo(t) * a.navigation.angleFactor
  18899. }
  18900. },
  18901. inFieldOfView: function(e, t) {
  18902. return function(i) {
  18903. var n = i.position.clone().sub(e).normalize();
  18904. return n.dot(t) > .75 ? 10 : -1
  18905. }
  18906. },
  18907. optionality: function(e) {
  18908. return function(t) {
  18909. var i = t.neighbourUUIDs.filter(function(t) {
  18910. return !(t in e.neighbourUUIDs) && t !== e.id
  18911. });
  18912. return i.length * a.navigation.optionalityFactor
  18913. }
  18914. },
  18915. penalizeHeightDifferenceUnder: function(e, t) {
  18916. return function(i) {
  18917. return e.y - i.position.y < t ? -20 : 0
  18918. }
  18919. }
  18920. },
  18921. t.exports = n
  18922. }
  18923. ).call(this, "/js/objects/Panorama.js")
  18924. }
  18925. , {
  18926. "../enum/AlignmentType": 17,
  18927. "../enum/GLCubeFaces": 25,
  18928. "../enum/PanoRendererEvents": 35,
  18929. "../enum/PanoSizeClass": 36,
  18930. "../enum/PanoramaEvents": 37,
  18931. "../enum/RenderLayers": 41,
  18932. "../enum/RenderOrder": 42,
  18933. "../enum/TileDownloaderEvents": 45,
  18934. "../enum/Viewmode": 51,
  18935. "../exception/BasicException": 55,
  18936. "../scene/SceneRenderer": 158,
  18937. "../settings": 166,
  18938. "../tile/TileUtils": 174,
  18939. "../util/ajax": 181,
  18940. "../util/common": 185,
  18941. "../util/lerp": 188,
  18942. "../util/logger": 189,
  18943. "../util/panorama": 191,
  18944. "../util/texture": 194,
  18945. "../util/transitions": 195,
  18946. events: 202,
  18947. three: 217
  18948. }],
  18949. 149: [function(e, t, i) {
  18950. "use strict";
  18951. function n(e) {
  18952. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  18953. t.map.value = d,
  18954. t.opacity.value = 0,
  18955. t.color.value.set(o.reticuleColor),
  18956. t.showMouseMarker =(typeof window.MP_PREFETCHED_MODELDATA.hideMouseMarker === 'undefined')?true: (window.MP_PREFETCHED_MODELDATA.hideMouseMarker === 'false')?true:false;
  18957. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  18958. side: r.DoubleSide,
  18959. depthWrite: !1,
  18960. depthTest: !1,
  18961. transparent: !0,
  18962. vertexShader: c.waypoint.vertexShader,
  18963. fragmentShader: c.waypoint.fragmentShader,
  18964. uniforms: t,
  18965. name: "waypoint",
  18966. opacity: 0,
  18967. visible: t.showMouseMarker // 显示/隐藏鼠标标志
  18968. })),
  18969. this.layers.set(h.RETICULE),
  18970. this.renderOrder = u.reticule,
  18971. this.player = e,
  18972. this.direction = new r.Vector3,
  18973. this.hidden = !0,
  18974. this.mouseLastMoveTime = Date.now()
  18975. }
  18976. var r = e("three")
  18977. , o = e("../settings")
  18978. , a = e("../util/transitions")
  18979. , s = e("../util/texture")
  18980. , l = e("../util/lerp")
  18981. , c = e("../shaders")
  18982. , h = e("../enum/RenderLayers")
  18983. , u = e("../enum/RenderOrder")
  18984. , d = s.load("images/reticule-256x256.png");
  18985. n.prototype = Object.create(r.Mesh.prototype),
  18986. n.prototype.move = function(e, t, i) {
  18987. this.hidden = i,
  18988. this.mouseLastMoveTime = Date.now()
  18989. }
  18990. ,
  18991. n.prototype.hide = function() {
  18992. this.hidden || (this.hidden = !0,
  18993. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  18994. }
  18995. ,
  18996. n.prototype.show = function() {
  18997. this.hidden = !1,
  18998. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  18999. }
  19000. ,
  19001. n.prototype.update = function() {
  19002. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  19003. }
  19004. ,
  19005. n.prototype.updatePosition = function(e, t) {
  19006. if (!this.hidden) {
  19007. if (!t)
  19008. return this.hide();
  19009. var i = t.point
  19010. , n = e.distanceTo(i)
  19011. , r = 1 + .01 * n;
  19012. n < 1 && (r -= 1 - n),
  19013. this.show(),
  19014. this.scale.set(r, r, r),
  19015. this.direction = this.direction.multiplyScalar(.8),
  19016. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  19017. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  19018. this.lookAt(this.position.clone().add(this.direction))
  19019. }
  19020. }
  19021. ,
  19022. n.prototype.writeAstag = function() {
  19023. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  19024. , t = new Date;
  19025. this.tagCount = "undefined" == typeof this.tagCount ? 1 : this.tagCount + 1;
  19026. var i = {
  19027. enabled: !0,
  19028. version: "0",
  19029. created: t.toISOString(),
  19030. created_by: "APITest",
  19031. position: this.position.clone(),
  19032. stem: {
  19033. enabled: o.tags.pole.enabled,
  19034. direction: this.direction.multiplyScalar(o.tags.pole.height)
  19035. },
  19036. label: "tag " + this.tagCount,
  19037. description: "Description " + e,
  19038. floor: function(e) {
  19039. if (e.currentFloor) {
  19040. var t = e.floors.indexOf(e.currentFloor);
  19041. return t > -1 ? t : void 0
  19042. }
  19043. }(this.player.model),
  19044. type: "info",
  19045. metadata: {
  19046. preferred_camera: {
  19047. mode: this.player.mode
  19048. }
  19049. }
  19050. };
  19051. console.log("--------------------------"),
  19052. console.log(JSON.stringify(i));
  19053. var n = this.player.model.addtag(e, i).build();
  19054. n && (n.disc && this.player.tagDiscs.push(n.disc),
  19055. n.visible || n.show(o.tags.startup.fadeInDuration))
  19056. }
  19057. ,
  19058. t.exports = n
  19059. }
  19060. , {
  19061. "../enum/RenderLayers": 41,
  19062. "../enum/RenderOrder": 42,
  19063. "../settings": 166,
  19064. "../shaders": 167,
  19065. "../util/lerp": 188,
  19066. "../util/texture": 194,
  19067. "../util/transitions": 195,
  19068. three: 217
  19069. }],
  19070. 150: [function(e, t, i) {
  19071. "use strict";
  19072. function n(e, t) {
  19073. this.chunks = [],
  19074. this.floorId = e,
  19075. this.roomId = t,
  19076. this.position = new r.Vector3
  19077. }
  19078. var r = e("three");
  19079. n.prototype.addChunk = function(e) {
  19080. this.chunks.push(e)
  19081. }
  19082. ,
  19083. n.prototype.calcBoundaries = function() {
  19084. for (var e = new r.Vector3, t = new r.Vector3(0,0,0), i = new r.Vector3(0,0,0), n = new r.Vector3(0,0,0), o = 0, a = 0; a < this.chunks.length; a++) {
  19085. var s = this.chunks[a]
  19086. , l = s.geometry.attributes.position;
  19087. if (l)
  19088. for (var c = 0; c < l.array.length; c += 3)
  19089. e.set(l.array[c], l.array[c + 1], l.array[c + 2]),
  19090. t.add(e),
  19091. 0 === c ? (i.copy(e),
  19092. n.copy(e)) : (i.max(e),
  19093. n.min(e)),
  19094. o++
  19095. }
  19096. o > 0 ? (t.multiplyScalar(1 / o),
  19097. this.average = t) : this.average = null,
  19098. this.boundsMax = i,
  19099. this.boundsMin = n,
  19100. this.center = new r.Vector3,
  19101. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  19102. }
  19103. ,
  19104. t.exports = n
  19105. }
  19106. , {
  19107. three: 217
  19108. }],
  19109. 151: [function(e, t, i) {
  19110. (function(i) {
  19111. "use strict";
  19112. function n(e, t, i) {
  19113. this.obj3d = null,
  19114. this.nodes = [],
  19115. this.colorHull = [],
  19116. this.shortPaths = {},
  19117. this.floorHull = null,
  19118. this.cameraHull = null,
  19119. this.floorPathDistance = 0,
  19120. this.floorCurvePoints = null,
  19121. this.floorCurveColors = null,
  19122. this.camCurvePoints = null,
  19123. this.warpDestHeroLoc = null,
  19124. this.warpDestPano = null,
  19125. this.warpPathPoints = null,
  19126. this.warpPathLengths = [0],
  19127. this.warpLength = 0,
  19128. this.closeWarpDistance = 4,
  19129. this.UP = A.UP.clone(),
  19130. this.longestStep = 0,
  19131. this.upcomingTransType = null,
  19132. this.burnsDir = 1,
  19133. this.prevNextDist = 0,
  19134. this.nextI = 0,
  19135. this.activeTransType = null,
  19136. this.lastTransType = null,
  19137. this.bunnyObj = null,
  19138. this.director = e,
  19139. this.player = t,
  19140. this.playerControls = i,
  19141. this.modelManager = t.modelManager,
  19142. this.updateModel(),
  19143. this.updateDefaultsFromModelData(),
  19144. this.bindEvents(),
  19145. this.warping = !1,
  19146. this.waitingToWarp = !1,
  19147. this.warpInterrupted = !1,
  19148. this.warpInterruptionBlackoutStyle = null,
  19149. this.warpInterruptionTravelTime = null
  19150. }
  19151. var r = e("three")
  19152. , o = e("../util/logger")
  19153. , a = e("../enum/Viewmode")
  19154. , s = e("../enum/RenderOrder")
  19155. , l = e("../enum/WarpStyle")
  19156. , c = e("../settings")
  19157. , h = e("../util/math")
  19158. , u = e("../util/lerp")
  19159. , d = e("../util/easing")
  19160. , p = e("../util/transitions")
  19161. , f = e("../objects/Snapshot")
  19162. , g = e("../effects")
  19163. , m = e("../shaders")
  19164. , v = (e("../gui/gui"),
  19165. e("../util/texture"))
  19166. , A = e("../enum/Vectors")
  19167. , y = (e("../model/ModelManager"),
  19168. new o(i))
  19169. , C = e("../enum/PlayerEvents")
  19170. , I = e("../enum/BlackoutStyle")
  19171. , E = e("../enum/ModelManagerEvents")
  19172. , b = e("../constants")
  19173. , w = {
  19174. path: v.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAAAgCAYAAADaInAlAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKxGlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjarZZnUFP5Gsbfc046CS0hAlJCb4IU6dJrAAXpYCMkIQmEEFJQsKEiruBaEBHBsqIrIAquBZC1IBZsi2DvC7IoqOtiwYbK/cAS7r1z74c7c9+ZM/ObZ97/c57/OV8eAOogRyoVo5oA2RKFLDYskJWcksoi/g54oIEmUMCUw5VLA2JiouA/DwLw4Q4gAAA37TlSqRj+t9Hi8eVcACQGANJ5cm42AHIMAOniSmUKAKwIAMwWKaQKAKwOABiy5JRUAOwkADAE49wNAIz0cf4DABiy+NggAOwTAInK4cgEAFQcALDyuAIFANUcABwlPJEEgBoPAL5cIYcHQC0HgGnZ2Tk8AGo7AFin/5OP4F8801WeHI5AxeN3AQAAUrBILhVz8uH/Pdli5cQ7TAGAKpSFxwKAJQBSl5UTqWJJ+uzoCRbxACZYqAxPmGCuPCh1gnmc4MgJVmYlBEwwRzZ5VqRgx0+wLCdW5c+Xh8Sp/PnsKFUG8WwVZ4hC2RNcIIxPmuA8UeLsCZZnxUVO7gSpdJkyVpU5QxaqumO2fDIblzOZQSGMD5/MlqzKwOMHh6h0SYJqX6oIVHlKxTGqfb44TKXL8+JUZxWyeJWeyYmImfSJUX0fiAchKEECPOCDDNIhB8SgABYEgwjkIAUxcCAfQMFfrAAACMqR5stEAqGCFSCVivkstoTrMI3l7OjkCpCcksoa/+XvmIAAAMK8MqnltgN4lgAggkmNYwZw4hkA/cOkZvYWgLoJ4FQ3VynLG9dwAAB4oIAGMEAPjMAMrMEenMENvMEfQiACoiEeUmABcEEI2SCDRbAUVkIxlMIm2ApVsBv2Qh0cgiPQAifhLFyEq9ANt+Eh9MIAvIRh+ACjCIIQERpCR/QQY8QCsUOcEQ/EFwlBopBYJAVJQwSIBFEiS5HVSClShlQhe5B65BfkBHIWuYz0IPeRPmQIeYt8QTGUijJQQ9QSnY56oAFoJBqPzkcFaC5agBahG9BKtAY9iDajZ9Gr6G20F32JjmCAqWFMzASzxzywICwaS8UyMBm2HCvBKrAarBFrwzqxm1gv9gr7jCPg6DgWzh7njQvHJeC4uFzcctx6XBWuDteMO4+7ievDDeO+42l4A7wd3gvPxifjBfhF+GJ8BX4//jj+Av42fgD/gUAgMAlWBHdCOCGFkElYQlhP2EloIrQTegj9hBEikahHtCP6EKOJHKKCWEzcTjxIPEO8QRwgfiKpkYxJzqRQUipJQlpFqiAdIJ0m3SA9J42SNckWZC9yNJlHzidvJO8jt5GvkwfIoxQtihXFhxJPyaSspFRSGikXKI8o79TU1EzVPNXmqInUCtUq1Q6rXVLrU/tM1abaUoOo86hK6gZqLbWdep/6jkajWdL8aak0BW0DrZ52jvaE9kmdru6gzlbnqa9Qr1ZvVr+h/lqDrGGhEaCxQKNAo0LjqMZ1jVeaZE1LzSBNjuZyzWrNE5p3NUe06FpOWtFa2VrrtQ5oXdYa1CZqW2qHaPO0i7T3ap/T7qdjdDN6EJ1LX03fR79AH2AQGFYMNiOTUco4xOhiDOto68zQSdRZrFOtc0qnl4kxLZlsppi5kXmEeYf5ZYrhlIAp/CnrpjROuTHlo+5UXX9dvm6JbpPubd0veiy9EL0svc16LXqP9XH6tvpz9Bfp79K/oP9qKmOq91Tu1JKpR6Y+MEANbA1iDZYY7DW4ZjBiaGQYZig13G54zvCVEdPI3yjTqNzotNGQMd3Y11hkXG58xvgFS4cVwBKzKlnnWcMmBibhJkqTPSZdJqOmVqYJpqtMm0wfm1HMPMwyzMrNOsyGzY3NZ5kvNW8wf2BBtvCwEFpss+i0+GhpZZlkudayxXLQSteKbVVg1WD1yJpm7Weda11jfcuGYONhk2Wz06bbFrV1tRXaVttet0Pt3OxEdjvteqbhp3lOk0yrmXbXnmofYJ9n32Df58B0iHJY5dDi8Hq6+fTU6Zund07/7ujqKHbc5/jQSdspwmmVU5vTW2dbZ65ztfMtF5pLqMsKl1aXNzPsZvBn7Jpxz5XuOst1rWuH6zc3dzeZW6PbkLu5e5r7Dve7HgyPGI/1Hpc88Z6Bnis8T3p+9nLzUngd8frL2947y/uA9+BMq5n8mftm9vuY+nB89vj0+rJ803x/8u31M/Hj+NX4PfU38+f57/d/HmATkBlwMOB1oGOgLPB44Mcgr6BlQe3BWHBYcElwV4h2SEJIVciTUNNQQWhD6HCYa9iSsPZwfHhk+Obwu2xDNpddzx6OcI9YFnE+khoZF1kV+TTKNkoW1TYLnRUxa8usR7MtZktmt0RDNDt6S/TjGKuY3Jhf5xDmxMypnvMs1il2aWxnHD1uYdyBuA/xgfEb4x8mWCcoEzoSNRLnJdYnfkwKTipL6k2enrws+WqKfooopTWVmJqYuj91ZG7I3K1zB+a5ziued2e+1fzF8y8v0F8gXnBqocZCzsKjafi0pLQDaV850Zwazkg6O31H+jA3iLuN+5LnzyvnDfF9+GX85xk+GWUZgwIfwRbBkNBPWCF8JQoSVYneZIZn7s78mBWdVZs1Jk4SN2WTstOyT0i0JVmS8zlGOYtzeqR20mJpb65X7tbcYVmkbL8ckc+XtyoYCqnimtJauUbZl+ebV533aVHioqOLtRZLFl/Lt81fl/+8ILTg5yW4JdwlHUtNlq5c2rcsYNme5cjy9OUdK8xWFK0YKAwrrFtJWZm18rdVjqvKVr1fnbS6rciwqLCof03YmoZi9WJZ8d213mt3/4D7QfRD1zqXddvXfS/hlVwpdSytKP26nrv+yo9OP1b+OLYhY0PXRreNuzYRNkk23dnst7muTKusoKx/y6wtzeWs8pLy91sXbr1cMaNi9zbKNuW23sqoytbt5ts3bf9aJay6XR1Y3bTDYMe6HR938nbe2OW/q3G34e7S3V9+Ev10b0/YnuYay5qKvYS9eXuf7Uvc1/mzx8/1+/X3l+7/Viup7a2LrTtf715ff8DgwMYGtEHZMHRw3sHuQ8GHWhvtG/c0MZtKD8Nh5eEXv6T9cudI5JGOox5HG49ZHNtxnH68pBlpzm8ebhG29LamtPaciDjR0ebddvxXh19rT5qcrD6lc2rjacrpotNjZwrOjLRL21+dFZzt71jY8fBc8rlb5+ec77oQeeHSxdCL5zoDOs9c8rl08rLX5RNXPK60XHW72nzN9drx31x/O97l1tV83f16a7dnd1vPzJ7TN/xunL0ZfPPiLfatq7dn3+65k3Dn3t15d3vv8e4N3hfff/Mg78How8JH+EcljzUfVzwxeFLzu83vTb1uvaf6gvuuPY17+rCf2//yD/kfXweKntGeVTw3fl4/6Dx4cih0qPvF3BcDL6UvR18V/6n1547X1q+P/eX/17Xh5OGBN7I3Y2/Xv9N7V/t+xvuOkZiRJx+yP4x+LPmk96nus8fnzi9JX56PLvpK/Fr5zeZb2/fI74/GssfGpBwZBwAAMABAMzIA3tYC0FIA6N0AFPXxzvx310cmW/9/4/FeDQAAbgC1/gAJhQBR7QC72gEsCse7dQwAxPsD6uKiev4eeYaL87gXVQaA/zQ29s4QgNgG8E02Nja6c2zs2z4A7D5Ae+54VwcAIGgClFnpWusMd8e8L/z3zvwPWFMLsyHkoksAAD+UaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/Pgo8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjYtYzA2NyA3OS4xNTc3NDcsIDIwMTUvMDMvMzAtMjM6NDA6NDIgICAgICAgICI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIKICAgICAgICAgICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICAgICAgICAgICB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIKICAgICAgICAgICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgICAgICAgICAgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiCiAgICAgICAgICAgIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwveG1wOkNyZWF0b3JUb29sPgogICAgICAgICA8eG1wOkNyZWF0ZURhdGU+MjAxNS0wNy0yMVQxODoyMDo1My0wNzowMDwveG1wOkNyZWF0ZURhdGU+CiAgICAgICAgIDx4bXA6TWV0YWRhdGFEYXRlPjIwMTUtMDctMjFUMTg6MjE6MzgtMDc6MDA8L3htcDpNZXRhZGF0YURhdGU+CiAgICAgICAgIDx4bXA6TW9kaWZ5RGF0ZT4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC94bXA6TW9kaWZ5RGF0ZT4KICAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9wbmc8L2RjOmZvcm1hdD4KICAgICAgICAgPHhtcE1NOkluc3RhbmNlSUQ+eG1wLmlpZDoyYWI5MzcwNS0xYjZjLTQ1ZGMtYTQyNy1jYWQzOGNiZTUxYjM8L3htcE1NOkluc3RhbmNlSUQ+CiAgICAgICAgIDx4bXBNTTpEb2N1bWVudElEPmFkb2JlOmRvY2lkOnBob3Rvc2hvcDpjYjc1NjFhOC03MDlhLTExNzgtOTQ1Zi1kNDlkZmJlYjBjMWE8L3htcE1NOkRvY3VtZW50SUQ+CiAgICAgICAgIDx4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3htcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPHhtcE1NOkhpc3Rvcnk+CiAgICAgICAgICAgIDxyZGY6U2VxPgogICAgICAgICAgICAgICA8cmRmOmxpIHJkZjpwYXJzZVR5cGU9IlJlc291cmNlIj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmFjdGlvbj5jcmVhdGVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6Y2Y4NGFiMzItZTUwNi00ZGM1LThlMWQtNTI4MTI4YTdjZTljPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIwOjUzLTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6MWIzNzcxZGMtZGU3Ni00YTQ4LTkzNjEtMGQ4NzdkOWY0ODkwPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPmNvbnZlcnRlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6cGFyYW1ldGVycz5mcm9tIGFwcGxpY2F0aW9uL3ZuZC5hZG9iZS5waG90b3Nob3AgdG8gaW1hZ2UvcG5nPC9zdEV2dDpwYXJhbWV0ZXJzPgogICAgICAgICAgICAgICA8L3JkZjpsaT4KICAgICAgICAgICAgICAgPHJkZjpsaSByZGY6cGFyc2VUeXBlPSJSZXNvdXJjZSI+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDphY3Rpb24+ZGVyaXZlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6cGFyYW1ldGVycz5jb252ZXJ0ZWQgZnJvbSBhcHBsaWNhdGlvbi92bmQuYWRvYmUucGhvdG9zaG9wIHRvIGltYWdlL3BuZzwvc3RFdnQ6cGFyYW1ldGVycz4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6MmFiOTM3MDUtMWI2Yy00NWRjLWE0MjctY2FkMzhjYmU1MWIzPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgIDwvcmRmOlNlcT4KICAgICAgICAgPC94bXBNTTpIaXN0b3J5PgogICAgICAgICA8eG1wTU06RGVyaXZlZEZyb20gcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICA8c3RSZWY6aW5zdGFuY2VJRD54bXAuaWlkOjFiMzc3MWRjLWRlNzYtNGE0OC05MzYxLTBkODc3ZDlmNDg5MDwvc3RSZWY6aW5zdGFuY2VJRD4KICAgICAgICAgICAgPHN0UmVmOmRvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3N0UmVmOmRvY3VtZW50SUQ+CiAgICAgICAgICAgIDxzdFJlZjpvcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3N0UmVmOm9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPC94bXBNTTpEZXJpdmVkRnJvbT4KICAgICAgICAgPHBob3Rvc2hvcDpDb2xvck1vZGU+MzwvcGhvdG9zaG9wOkNvbG9yTW9kZT4KICAgICAgICAgPHBob3Rvc2hvcDpJQ0NQcm9maWxlPkRpc3BsYXk8L3Bob3Rvc2hvcDpJQ0NQcm9maWxlPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICAgICA8dGlmZjpYUmVzb2x1dGlvbj43MjAwMDAvMTAwMDA8L3RpZmY6WFJlc29sdXRpb24+CiAgICAgICAgIDx0aWZmOllSZXNvbHV0aW9uPjcyMDAwMC8xMDAwMDwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgICAgPHRpZmY6UmVzb2x1dGlvblVuaXQ+MjwvdGlmZjpSZXNvbHV0aW9uVW5pdD4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT42NTUzNTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8ZXhpZjpQaXhlbFhEaW1lbnNpb24+MTI4PC9leGlmOlBpeGVsWERpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6UGl4ZWxZRGltZW5zaW9uPjMyPC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9InciPz6SKsKfAAAAIGNIUk0AAG11AABzoAAA/N0AAINkAABw6AAA7GgAADA+AAAQkOTsmeoAAAOCSURBVHja7FtRi9ZADJxETzkQRf3/P9FTREQ9bXwpUvYyk+x3PiawtPS6/UozmUyyexYROO0OwItzOICX57g7j68u4/U57pfzewDvAXxcjh8AvAPwFsCb83ljuf0G8A3A13N8AvAZwMN5/gDgC4DvAH4s4+d5fATw6xyPAP5cjtfx6JcfjuRl7Lxu5GXjcp8lc7Nnx/hY2rGcW/JNlU+c+Mmyb+/EYdlEBpDKjABkjH8vFWxVAAW5toIgGFquL2FLlDNErUyRzTnGt20LcW7NAFTs/G+uF2hhP+KCKa7zjuQ5wwR7LGDi75mTbbkWimFcUHYkkRwLSNRLZekjRgO0GSAKBr4y7yGeIwOuKwI7uSrIvLhBNwwD8MCCCFBbwGCVCPeGas9yfZYmgoDGyH1jmgGy75h9a1tYg6Vny0Dhzei2BTSWRPmKNicIHOs5nwWlCjQIFo+MNZQIZKVHCJa4vtQxOf9Z9B8b6ZcBKEQpHkwDmEgHVb8gA5VNBXAzC1jBBkyrHYSln1Rj3mwmdOlGiZVhg9t6AJ0G3CHmKuBQAFTlBFP4saA3EqEyVqcAE9VUFdVW9A7QqQKqvn6QFzVRekxLuA+AaDR/lJ+iUVmEEoHsWizAMdK06LDHWG4H8kWfTipQ5XkKHm+gMaOnIDUmGtXD2F4TKDYYuttClhrARPSuVBJCcIAgeVLAfi+ARXrcEHBWlYEg9T2aFAQiTGJRrGO6CjiEAOyIvRDs0C4DoxB1IdgkCmCM5eaLg00wg9Jrnvgy1kDsVgHMwUaYIjufdYB9HRBLjW8bDBJFKvEqBWTNhm6f2gn9T/T3HFh1ZdVyPBORqU7zotbPqAmiCcQ0wUT/bTqAAcFEeraiX1NWAQwMCkms73y93wcEWzoA4Ov+rETMloplC943Kagj8kB+eNLAXjMoim+WNdiOokfwBAzVaiCr7x29JUlLxOCwQC0A15EtrWe7fzos29IAlbiIhgaYrWDPF4HVPUpzKT+VKSCj8o6g6+wDHCDsCUGgXvQxUSGorfo0BWRUrh6OQm3OruD9FACiqyqwOPQ+AroaaM2HZ6jKjtYUk2M5vXvh8Crdtpp83U2h1b8lOZ5uCwv09reN1WW4LeLbGvpKtfFlCsjyjxGVupYfFVCGBfZKwayFfv3G3mQUxhyt/QBRqFRD/m9hPj78byxggnUrMW7Kn38HAONAllI0EmS1AAAAAElFTkSuQmCC"),
  19175. pathEnd: v.load("images/End.png"),
  19176. pathStart: v.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAM6VJREFUeAHtfQl0HNWZ7r3VXd2SLLEa2xgc2ySGxwOMiSRsC2IsG1vbMCGGsCYsWcibGSAhEEJeFkyIhyRAkknmvXOGJBMggQAhDAlIsjFY4NjCtqSwH55xDjYDAWN2JGvp6q77vr/UMpLcS3V3Lbeqbx3L3V1177989///uvvlTF2BRmBx96uVNbFpsyMiMpcx83Cu8UOh0FQm6FMcyuk7YwcLxivwGWOcxXEvxgSLW7/xH64E7o8I+hRshH5zJobx+R7uvc0Yf4dx8Q5+vy1M+tTeSPHUzv7EnleebJg1hPvqCigCsAV1yY7A0q6uaGVlw9EiwuZzTTueC34UnBsOz+dwzmb4Kb8QbDdk2QVZdgouXham+TxPsWeHhrpferyxMemnbIp3fgRUAMiPkacplnbtrKioObIOBbOQMz4fzjWfcX4sftMbOzAXag4jTIgXERieFUzgj20d7n+t9/HGuVSzUJckCKgA4HNBtGzsP4xVVZ4CRz9F4wyfvBYixXwWyy32CejZZwq2GXpuZoNDmzuX1LzlFjNFNz8CKgDkx8jRFLW9vfoMduKpqDq3oPregrf78Y4yCBoxIZ4HFp3AonM3e2ZTX12dETQVgiyvCgAelN6KTXtn6nH9DDg7nJ4vB8tqD9gGkcWAEOIxNB06jRHjofWnTnk9iEoESWYVAFwqreVbBqbH9djZ6LA7V3B+KoBWWBeANfoM0KcoNuG/e0eMxP2PLap+s4DsKqlNBJRR2gTKTrKm7g8OieiVn8Wb/ly86U9DHs1OPpUmLwImagZPoGZwb8oY+sO6hgPfzZtDJbCFgAoAtmDKnai5x1iqcf5lpFqFtiyNt6vLJQTQX0CjCA8gIvxybb3+uEtsyoasCgBFFvXKzf3TIrGKSzSNfQm1+3lFklHZSkJA7DBN9qtUYvj2R06p2VMSqTLNrAJAgQXftDVxYiSqXY0Zc+fhba8XmF0ldwEB1AoM9LDck0qat65bGHvGBRahJakCgM2ibe4zmiKMXYO3/ek2s6hkviAgHk0xdsvaWn2dL+wDxlQFgFwFdt99kZa5Z16IDr1r8HdCrqTqmVwIoNPwOfzd0rnzwbvYOecgJqgrEwIqAGRCZfVqrbXtW+cyrq2G4x+dKYm6FwwEEAReYsJc3dF+071s9WozGFJ7J6UKABOx5q09SfTkixswlHfcxEfqV6AREOIFIfj1HfXRB6AHphmoixBQASBtB609xgqg8WO88Rco0wgvAqgRPA33v7ajXl8fXi3ta1b2AWDFluF5uh65FSvvzrAPm0oZdASwQvEhw0hdvX5RxY6g61KK/GUbAFq2vHMAix7wXUzguRIAhnX1XSm2UQ55E5hQ9HOW/PDGzkWHflgOCk/WsSwDQOu2xKUsov0Qyk+bDIj6XX4IoENgD0uZ13WcHPtNuWlfVgGgqXv4E5FY5Da08xvLraCVvvkRQP9AVyqRumxdQ8Xf8qcOR4qyCADWllrVp34d1f3V6OirDEfRKS1cQUCwITQLVg8NbPpJOWxpFvoA0NKTOAlv/F/j7yRXDEYRDSUCqA08hb8vdtbHngqlgmmlQr1ctaUv8TXOta3K+cNswu7oRjZDtkM25A4HOaiGsgbQ9pf3DxaVU36DQvy0HDArKYKMAGoCf+JDey9t/9RB7wVZj0yyhy4AtPYmFmIK771QbHYmhdU9hUAxCGCk4BVMKT63oy62tZj8suYJVROgtdf4Ojbh+YtyflnNLbhyjdqU9pdRGwuuHpMlD0UNwNqKK151u5rNN7l41W83EKBZhKmRwUvCsDVZ4ANA81ZjcSTC78Hw3sfcKGxFUyGQEQHB/juVEuetXag/mfF5QG4GuQnAW/uMb2gRvlE5f0CsLUxi4oVDtkc2CLUC+yINpOB0fFbVAUfehSr/qjDZlNIlmAigSfDA4IevXRjEY88CFwBO7333wBiv+TOcf0kwzUVJHUYEEAQ2JkT/Pz5ad8gHQdIvUAGgqXfv4REeWwvnx6GZ6lIIyIUAgsCzKZFoXlc35Q25JMsuTWACwOi6/egjEHhOdnXUE4WAvwhgvsAuw0iuDMo+A4EIAK1bE3UsqnVA2MP8LV7FXSGQHwEEgbdY0mztWBjrzZ/a3xTSjwK09Rin86jWpZzfX0NR3O0jQLZKNku2az+XPymlDgDNPSPnMY23Axp1mq4/9qG4Fo9ANdmuZcPF03A9p7QBoK03cYWmRe4GAmq7LtfNQDFwCYEY2TDZskv0SyYrZR8AJldcj57+1SVrV2YE0PbcixN0X8IqyO3Y1OIljYm3hckGBNf6hSb6IymGT7PfNMx+QzP6d7/yaj9BNGP2rBrd1Gs0XavhplaTijB88houzBqusWqT8anYTOVorIo7BtulHw2jmVJm0JasLkYIVnfU6jeUTMhhAtIFACtacu3nDusZNnKvw9Gfg8Nv50xsT5l8OzeN7Z2Lql7zQtGWLYNHCk0/JqKJYwTjx8CIKDDQyUkzveAfWB7CvLK9LvYLmeSXKgBQe4mqTBBKKrn8LjCrV1mwLixH3WCkzA2yDjFZQ7URbRmWY+OPNaIQ1ajNOONBOQrTTF2wtj5+z7jbvn6VxtGsHtPRDj/V5mfsfVS3n4C9bMBfV0dd/HlYCewnUBdv7R05HrG8EX/L0Cw5DdIfFCgN3BE2wUzR1l6vP+oO+cKoShEAaJyfhk0gevn29gu0zzm73zTFnWvb12wM3Tl2OG+xue3bSzSNX8QFOxs1hJrCTDVUqQdE0myUYZ6A7wEgPcNvMwQpv+qiYCnBxXpmmne+Z+x58MmGWUOhMvMsyizufrXyYH3amUzTEAw4HcmGk9fL60J17i3MGDzF7+acrwFgdG5/vBtCzCmz4n9GCHYnM0fu7ji5end56T5R29ZtAzOYFr+Ac3YRmgonTnwa7l8IArtSYqTBz7UDvgWA9Kq+jWW0sMdEz/0DjIsfttfG+sJt2sVp19aXqGWCX4cRBVrmLe0cleK0y5yLFhBhFeESv1YR+hIA0uv515XDkl686ZOo4v6eJ1I3tS+Ov5jZDNTd8Qi0PTlyrIhFvoVuz/NRM4iOfxbG7wgCG7GfQJMf+wn4EQB4W6/xR0T5z4SxMMfplMD3242k8cNHFlbuHHdffbWJwMqtQ3P1qH4dkl+Cv1CPDiEIPICJQmdDT7QMvLs8DwAtPca16An+kXcqesxJsEFU9W8bMoxbNjRU/d1j7qFkt6x78IhKXb8GL43LUJuqCqWSUApB4FoEgZu91M/TAEAbeNI+aqGt1gn2h6FE4irl+O6YsBUIYrGfIgh81h0O/lKl5qKZEku83GjUswBAW3dHY1OeQuGFcPdescMU7PLOOv0Rf02oPLi39BorNc7+HaMG80KnMXYbTib2nuTVluNe9bTyCPbtD53zj54k+z3zzV0nKOf3zhUJa8IcC56+h3pzuOZO4AVp+YpHcHpSA0DEvhqryW7xSCdP2GCqbnsylbxCdfB5AndWJtRRGI1Ef4Gpxm1ZEwXwAYLbNQh0t7otuusBAKerLuJCo3a/7rYyntAX7E201b7SUR/9kyf8FBNbCLT2JD8NG/sP1DKn28ogeSLYmCG4uaSzNrbFTVFdDQDWKb1V1U+ByWw3lfCKNt76XZi9d0G5z97zCu9C+aRnFd6N2kBjoXllTI/xwFf44MBJbp5K7GofgHVEdzic3xSmuKHj4TWnK+eX0VVGZaKyoTKissIdU15J7UlGL07yIXupi0sFHu5crT2Jq7im/cQd6t5RRVVsNxbsXNhZq2NprrqCgkBLn7EMC43uQrNgRlBkzianycyr0BT4Wbbnpdx3JQA09SY+GWHaluC3+8Vjw8bIhY8tqn6zFJBVXn8QWL5lYHqFHr8Lw4XL/ZHAGa5Wf4AwF3bWx55yhuJHVBxvAizt6opGGP9VkJ0fbS9MyhLXtz+0ZqVy/o+MJWjfqOyoDKksrTINmgJpecmX0K/xa/Itp1VwvAYQ9Km+FG1NkbpIpm2bnC70cqRnbTfHI3cG+cWEzWK+2Vmv/9jJ8nM0ADR1D38iGos+i6GYSieF9JDWADqQVnXU6+s95KlYeYRAa4+xgmv8AbAL5s5TmPSUTCTnr2uo+JtTkDnaBIjEIrcF1flRRXzL2qZJOb9TtiUdHQrsVMZU1tIJZ0cgvFgtH7OT1mYaxwJAS0/iC0Edf4VB7GLJ5Kky7NFms9xUsiIRsMoYZW2VeZE0/MxGPta6LXGpUzI40gRo2fLOAVw/cAeITXNKMK/oYHLPcymWaPJzWyavdFV8PkLA2o6OxdbBoeg8g0BdCF57hPHBvM5Fh35YquDO1ACiB3w3kM7PRPdg/8AS5fylmlHw8lOZU9ljuKc7aNJbvgafc0LukmsAtKtvTI/SvvWB2rGF3vxkAI83Hvy+E0AqGsFEYGnXewdV1VRjrUrgagKJhJE8vtRdhUuuAeh6hFYsBcv5aTdWVPuV8wfTaZ2UmmyAbCGAfQKxtO+VBEdJNYD0sEqgNsFAQb812uFX8VJJyKnMoUKgdevw0Swa3QSHCNT5FBi2XlnKsHUpNQBs6sscnZTggUUNYNOl1o6Fyvk9wDpQLCybgG1A6IFACT7qg0W/yIsOAFh/vQrtpgVBAcuaT02TfBbGeoMis5LTWwTINmgiGNmKt5yL50Y+SL5YLIXiAgDOeePcWnJZLF9P86Haj3JNXVRKVclTgRUz3xAgGyFbIZvxTYgCGVu+CJ8sMJuVvKiqQ2vPyPkcx3gXw9CPPLR3HLZXutEP3opnMBHA2RXfwzbkNwRFeoFjxzvq478vVN7Co8Z992Gxn7a6UEb+pRePdT68Zo1//BXnICLQ/vCaH6AS8FhgZCefJN8s8Cq4BoApvxdpmnZHgXx8SY623O6R5PACtaQ3M/y0XyM9cXvfuczc5b9L+wnEoxVPYwVhIDYVMU3zYuwZcGchyBZcA0Dj/xuFMPAxrUk7+Sjnz14CGtO+Sn/ZU5T3E7IdsiGgEIjtxdAheE2hJVZQAGjuM5rQLjq+UCZ+pEev341qG6/syK/YtHcmakhn0R99z56yvJ+QDZEtBQEFms1o+WgBwhYUANDAKDjCFCCLY0lp996O9jXfd4xgCAnF4rF/Gd1phun0PYQqOqYS2ZK1I7RjFN0jVKiP2u4DaNqaODEa1Z52T3SHKNO+/ebwArV7b3Y86Xj2KTWzXsVErqlWKsHe3tv/6iw/jqfOLqVcT2jLca5VPA3MpD93IJk0F6xbGHvGDoK2awCRqHa1HYJ+p0GV9ivK+XOXwpTqIy7c5/yUFIHAupc7W1k/JZsi2woCCIX4qq0AQL2hmBZxnuzKo5r2sDqxJ38pCY1fOTlVpnuT05T7b7It2Fi79DjAVy2ftSGorQAQi8Qvln4zRdovLZXcz7BtYFBWSTDBpRGLOOZPVpru0bPJ99XviQjQeZCyH0hKvko+O1HyzL9sBQBNY1/KnF2eu9jY4V/VQZ35ywPzW7MO++V6lp9yeaQgGzOZuEl2be36bN4A0NxjLJX/HHaxQ+zZdbPsheK3fHSSLoaKzsgmBz2jNNmeq/tpBPbswipYsUNuPPi8Ud/NLWXeAICJP1/OTcL/p6Zgl3e2zhvxXxK5JYhGo1dAwlxlrqXTyK2Iz9KRrZHN+SxGXvZ2fDfnMGBT9weHROJTXkeieF5ufiUQ7A/tddFz/GIfFL5Lu/ZUV9Uc8hrahwfmkhk93R8M9r975OON04K1Lj6XUi49a+tN3ocRlM+6RL5ksijL4VRi7xHrGg58NxuxXG8DFolVniO58w8OJRJXZVNO3f8Igcrqgy7J5/yUmtJQ2o9yqm/ZELBsT7DBbM/9vo+yrCAfziVHzgAAc8iZORdhT54JcduGhqq/e8Ir2EzQvOdU/bd1pdPmrB3aIhTyRJbtwQblVjO3D2cNANbMJ85Pk1i5xJBh3CKxfNKI1tyTbIFTH21XIEpLeeymL+d0aRtMyIoByvI08uVs8mUNAKj/n4VM2Z9no+jRfQxZ/Ua9/e2BrXGRdegvG4Vi8mSjFeb7ZINkixLrqKV9OaOIWR2cC35uxhwS3ETnRjKZNH4kgSjSi7Cyd+R/oGG/omBBkcfKW3DG8stAtkg2KavmuXw5YwCwlopyfqqsCqHn9fdq0o+90omyyFfRmC+4PU95KK89LuWdyrJF2KSsKAj4crYl3xkDgB7XzyjGaDwCwOSJlPQzsTzCIicbOvUGrv/5nIlyPURei0auNOqZhUDaJqXcOIR8mXw6U1FlDACoMsrbASTEA+2L4y9mUkbdm4hA1QHVX0bhT5l41/4vyks07Oco35SWTcI2pUUgi0/vFwBqe3t19Bwul1WRZADmYUuBnbVBJHdgow/QKGKzSSkw8FoILn7oNUu7/Minybcnp98vAMxgJ1Lbv3pyQjl+i2fW1cX+KocsckvROnfVmXiDzy5VSqJBtEqlUw7522tjfVgjYGsjDh/wqE779gTW+wUA9GZKW/2HbHdOkF79yIoADotwrAPPSVpZBQ7JA5ltNJNv7xcAMH1QzgAgWIqZI4E5jMRPe27dlliAfpxPOSYDaFk0HSMYYkJko2SrEl6ZfHtCAGjZ2H8YDEfKXX+xPfN6tdWXPavimvY1eyntp3KDpn3uwUlpbR0GW5VSYvi25ePjhJsQAFhV5Snjnsn11TRV9d9Giazc3D9NcOe3byOaRNuGCCqJzLY6yccnBgAm5AwAgvW/Z+x5UFlWfgT0eMX/Qsed48u3iSbRzi+BSmHZKmxWTiQm+viEAKBxJmUAwNvn/icbZg3JCag8UtEwj2DcNScl2pmGkuRBQA5JyFbJZuWQZqIUk318XwCgveIxYah2YnI5fpmmUNV/G0UxwzzhXHT0HG4jaVFJiDbxKCpzmWWS12Z57aivjxbIvgBQUXNkHW7FJCyn99e2r9kooVzSiSQi2pVuC+UFD7d18IJ+2mbf94JXgTxiaV+3su0LAGjjLSyQkCfJsQ/7E2z1ainnWHsCgE0mbduMBmztXW8zedHJiAfxKppAuWSEzVq2K6G+4319XADYf694OWQXG+SQQ24pcLCHYxN/8mnqJa98ssj9XE7bHX8uxL4AgCmM82UEMynkBFEmrFq2DB4JeVZ5KNOqNE8PWQaPlby2+5GvWwFgaVdXFBOAjpUNYuy08tYj9fEXZJNLNnl4VKeTfqNeyUW8iKdX/ILKh2yXbFg6+eHrls9DMCsAVFY2HO3G2HHJigvWBRrAUF3ZEFjc/WolqnSeL9klnsQ7m1zqvoUADqyybFgqOMjXyedJKCsAiAiTsvrPhKna/3lM56D49M9h049D8yRz/jF4WrydpxwuipLa8JjPWwEA87ylnP9vpFQAyOcNmtj/pN98eZx67idvp3Rwm46sNjzm81YA0Bj/uNtAFEH/9fWLKnYUka9ssjRvM5b7ungLi0ssGcoG8cIVTdvw64XndDcHNgo9ijiMNgGEmOMuuyKoC/FcEbnKKosWyX7Sr1dAyCCDV7oWzUdKWxZzSR8rAGAK8Bx8l+pCz992qQSSTJiW3uGPoyOuzW+xSAaSxW85ZOYvpy3zOYSZZvUic5b15BBK5MfFmVABIAfwnEXynfSbI7ejj7C+xJLFUaJhIiajLWModwb5vlYTmzZbRrBTJlcBIEvBnLLprRrU2i7N8tiH2/zSUZl8YB0AlrLaMvm+FhERqy0gG47cNFQAyFIoB1YceCki+AFZHnt+m2QhmTxnHBCGstoy+T76AMzDZcMRbaa9nYuqXpNNLknkwQ7P/HJJZNknRlomvu+G+rIPAbJlsul9N6T5Yh6ucY17P4kkDwBcqPZ/Noha+5Lo+OPzsj337z6fNyqbfxJIzVmIl2STj3yfRgGmyiYYdp5R1f8shYIOJc9W/WURIettmWXLKrRnD/j/84yVfUZTNSbkqwEwCaOlfUzdS9myZeR/4u1/unscSqXMTx+VsVQ64cuPRQHyTWqD76MGIKSrAeAginfCZwKla6Tp8p/WGwQZSy+JwingTft24bncziGmYgzXh4UkefTChor9eZKU3eOm7g8Owcqyz0mvOGS0ZJVeUG8FlNGmyfexnoMd4i0UNriZmgoAk2CKxqq+jFV/VZNuy/cTMlqyyieZvxLJadMHUx+A43vIl4o0TgFSAWA8iDidFx2jgdmAw5JVnSg8vgThZvLZNMqpgkYB5AsAKdUEGG89bUetWoXJNrPG35P5O8lKMssso9eyCTltOo6VwPJtBa5FzAGvC0hmfuhBlnboLxtuQZQ5my5O3JfSpuH71Ako3VkApmGqJkDa6tr6ErWYZSfliU25HINkJtlzpSmnZzLaNPk++gDkawIYmqECQNo7BNMC9/Yfc+wgyz6mg1OfUto0fJ/6AKSrAex+5VUVAFAwy7cMTEeUDuxRXCQ76eCUEwWZjqQ2jRqAuqRFIB6J/xOEky5AFwBYLK1DAVlUUi8RoACQ8JKhHV4zZs/Cevfyvo6774UY2tGunfTrFbqkA+niFT9Z+Uhq0wkaBRiRDTTd1Ms+AHxs7rzzUDbBrz5DB0sX2YzMY3mktGn4voZ1ytLVADRdK/sAoGn+bffttG+ESZdisZHRpsn3aRRAuhoAN8s7ADT3Gqdi1V+IhtB47ahOxbpP8PNJadPwfSn7AFIRVtY1gAjzf7tvp10ujDoVgpGkNp3ARCAxXIgiXqTlJi/bALBy2yCm/PLPeIGztzz4Z0Z185arLNxktGnyfaoBvCcLSGNycGGWbQCIRvTL0fmHF2bILuhk6RYyteyqI6lNv0edgO/YVcKrdFxj1V7xkolPbe/rVVg29iWZZHJUFuhm6ego0WAQk9Gm4ftvowbApdupxGRcul2KvDCz6WLq57GSTr79GRxSnnQjHR0iFygycto0fwfzAOTbfkvj/OhAla5TwoZo6C8rJOWgYwblpbRp+D71AUhXAxBCHJMBw1Dfau0xVuCcPWz6Ge6LdCRdw63l/tpJatNva8KUrwaAI6/LrwbAwzf0t78bpO+Uk65jIEho0+T7qAFob4zJKMsnVpFNadkyeKQs8rgtR1P38CcQ9Frd5iMNfehq6SyNQO4KQrZMNu0ul2Koa29oKZ7aWUxWt/MITS+bZoAWi14JA8G/8rhIV9K5PLTFxvuS2jL5vtaf2POKjAUR0cqjH6BlyzsHoBp2iYxl4KZMpDPp7iYPWWjLasvk+9qTDbOGhGC7ZQFrTA7sWFoeNQC95gt495ffxCfSmXQvg0tGWyafJ99HIKZL7LI+JPoP1cTwB4DVqzUutMslgt1TUSzdgYGnTH1gJqctj/p8GnwuXz8A5yf4UFaesmxu+84/YHLMxz1lKhEz0p0wkEgkd0SR0pZHfd4KADi04GV3NC+J6swVW4YlPAa7JJ0mZMbrP7Abfk5QpIQfYccgbcMzS4DIlaxjPj8aAEzzeVe4lEhUj2jLSiQhbfaVPSPHY7us0OpnF3jCgLCwmz5o6WS1YZH2eSsA8BR7VkpgeXgDQJTLf9KvVzYRaiwkteExn7cCwNBQ90tYGSTdzkDoHW+EEaIPJVzX8q0fHgqlLgyXVsVrQ1gQJsVTkDYnZj5bNiyVgOTr5PMklBUAHm9sTDIhXpRKSggDwzgM1cPjZJOrVHnikcrLoFxlqXRCkx9YWJiERqFRRVp70cyDDUunFnzd8nkIZgWAUQG5lM2AaMjayUu7uqIIbf8snVH4LhD/51FsfBfEQQF4o4PEHCT1ka/vCwA4zFHKAABnWeag5r6TqpzScBaGv8pmnYNdwAkTwsZu+mCkk9N2x/v6uADAtsoIKnqJT2MhmiyiRYJ71p/b9hEqbGiSF9muhBf6APb5+r4AMNz/Wi9kle6MAMh0UHPbt5dIiGPBIjVvS9SjRrO44Ixlk4EvHsUo+AqnbfYgCTVJpH3dEm1fAHi8cS52BxZ9EgrMcLDERTLKVahMEU29/fNhFhaM5LVZ0Tfq66MlsS8A0E9TsM35CsiP51ywsxd3vxroXvOm3r2Ho+p1jh/4BYknYURYBUnmybKSrZLNTr4vw+/JPj4hAKB6KmUAwJBZzcH6tDNlALBYGaIs9k/o6NKLzV8u+QgjwirI+lq2Sqsdpbwm+vjEADA4JGcAICA1LbDNgJaOHXHB+VektAcJhSKsCDMJRbMnksy2OsnHJwSAziU1b2FCkJTrArjgK1q3DcywVwJypeLTZ5+PCSHT5JJKXmkIK8JMXgmzS0Y2SraaPYWPT+Dblo+PE2FCAKD72Cigc9xzeb7SaTla/AJ5BCpAEsHLftVfAWiNJg0qZmSjkp7slMm39wsAaIPJGQBgFpAtcM2A1m3GEowHLyjYAco8A2FG2AUNBpltNJNv7xcAdrNnNgH0ATmB5ye29SWCdWx2pIy2+3baaAKG3aht8hOdhsEhegNp355Abr8A0FdXZ+AQg8cmpJLph+DXySROLllaNw/NRnvw07nSqGfZESDsCMPsKSR7IrFtkk+Tb09GbL8AYCUQQtpmANoBq9qeHDl2siIy/hbxaDhP+vUKbLSlLQy94lcCH8smYZslkHA3axafzhgAjBHjIUzIwD8pL03EIt+SUrJxQq1ct3sKJoPLfdIvjfhIOuozBiVhSFiO/Zb1M22TGf3Jb5nJl8mnM8mRUeD1p055nQtBfQFyXoKdv3Lr0Fw5hRuVKnLoIdRhKd1ccPQEv4u//5tKmSe31+kn0B99p3v0TEJMD0pjKaFooyJZtgiblFVA8mXy6UzyZQwAlBCbBt6bKYMM99CbGdWjusx9ATgOnktz8g0cmzZ86UCd7pxXXt5+eEdd9F/WnhzrGStL+k736BmlobRWnrEEPn+mscT0ADkvskWySTmly+3LWUFdvmVgeoVeQVEja5DwWeHE0EjiqA0NVX/3WY792Df3GU0Rxtfu98DrG6jeC87uZKmR33acXF3Q4S/WpKtI/POY034R+l1837QzxUTz2lp9ndcQ5uO3rHvwiMp47GWki+VL69Nzc9gYnvnYouo3M/HP6tyUAT2HT2TKJMm9WKWuXyOJLBPEAKj+TfwR7B1hsv8jkmY9Ve87avWbC3V+UobyUF6iQbSIJmoH70xQ1MMfvmKaQ8+0Dcrq/KjMiSeyOT+plTUAWDoLeZsBlnycX0YR2PouyX+tW4ePxpSlZi/Foeo6CrrdNNlnd728fWZHffTyjoUx2t/BkYtoEU2iTTyIl/dNBN48iq0jKjlCxLI92KAjxNwikseHc7ZbUsbQHyKxKT9D+6bCLflKostZVWUs9lPQkGeZrebhSb+jPfh3jCRHfpsrypeE8bjML5xzXOIFxu7HrfutJmI0/nl8v9iLJgLaqjhJzDpR+PJxIvn61bI92KCvQuRgjiA9TD6cIwltvJv7au1N3oUAIPUcfFOIps46/ZHcmrj/9PTedw+M8wNeA6dq17hRNZyz32P3htvba2NSbOAyOgNOuwRNhPMhm5vbew+MiA+PfLTukA9cw9cm4ZZeYyWGKKXrkxgvPgLA3ejczbn9fO4mAKjBuX45nqiM3zXO/l2G5aMxVvNF4OO486er+A+jHX42VcPba6NXyOL8ZA8kC8lEspGMaCI87FIToTqNsa9mSLZGNuerEDaY2/HdvDUA4tPWZ7yEGtg8Gzx9SwJlv4dawI2+CYBNINv+4Tt/wxtwrlMywJGewySOOxLJkd95UcV3Sm6iQ02EWDT+ORjYxVjYc4JjtAXb2f7wDz6BjWJNx2gWSAhv/+/i7f/9ArN5nFzsaK/V0R+V+7IVAFp6jGuxx9mPcpPy+algQ0bKOO6RhZU7/ZCkpTd5Jt4K/1Uyb1TxYdl3m6jir6uL/bVkehIQaOpNfFJj2iWobtJS2ZKbCNjW6jOdddEH/VCNJv3oEf0F6FHpB3+7PE1TfLOzXv9xvvR5mwBEIJUYvh1Vuv0WEuQj7ulzFEg0Ev2FpzzHMdNY8Sf9WlV8Jh5iKXYWVaNh3FeGxfkJItKFdCLdSEfsS/9QKU2EUrAeV2RFfbVsTHLnJ18ln7WjoK0aABFq7UveicTU6yv1hTbomRiy+pOXQjZvGZkf0SPPFMrTOqBBsDuSI8O/e+SUmj2F5g9y+pWb+6dF4xWfw5v0YhygN79QXVJG6sS1i+KeHmbjWC2vUGULTI9m4287aqM0FT3vZTsANG1NnBiNak/npeh3AsHeFObwgmImvxQreltf8tfI+wVb+QV7G45/N9r3t3fWx56ylSfkiVp6Eiehn+ASBAJqIky1qe5/ouOROl09uaytvrSKpyHfdE8YlsAkmTQXrFsYs/VCstUEIFlGCYpHS5DLm6xUQFr8bq9OE1ra++FUVLlyDpOOVnfFn1OMrdrNnp7ZUad/VTn/R+ZAWBAmhA1hhNnrf87XRCDMCfuPqLj4jU6mIpsKgPMDu0ftOj8hZrsGQImlmeNOwuS5hClu6KjXV+dJVvLjth7j20zjP8hMSDwDOe4QQyO/m7wZY+b06u4YAi0b+w/jlRhF0PjFMNMTx+5P+DTFd9rr9TUT7rnwo7XHWA05rneBtOMkC10zUVAAIGlbe41nHR3WcRyCfQQxa1Ws6KzVN+y74/CX2t5efQZfsAtkZ+4jPVrFvwsTKG7vODkmf5Npn+DyfmndlliAIHsJmggX4pU1/q3/+m7x9JxMO904pU1Ln7EMqxHXg57t2rJTvAulQ8PGqEkV1J9SsFJgckuhgvmUXsOWUnfReLRb/KeLE84G7ZmojtI2an+i4al0Ff9ryvmdQ52whGF/jbAljAlrwpywT5eBc8zGUSLbIRvCrYL9ZBwZ774KcXOhzApWrHPng3ehADAxSP4LU5hnVOjxu1zrD9Aip2G8/ioxOHQEDPRMGpt2820kP+LuSkjYEsaENWFO2DOUgStc0e4n2yEbcoW+w0TJJzt2Pnh3oWQLbgIQg9aekfO5FimYWaHCOZZeiOuxrPX7jtFThEKPQFuv8T0scrohKIoKM3VBR30ca0QKuwquARD5jvab7sVCYywMC8aFo6ZWN/eMnBcMaZWUfiNAtkI247cctvnDFy2ftJ3ho4RF1QAoe2tP8izse3X/R6Tk/ma1GYVow8gAdeioSyGQEQH0+K/Am78dVX89YwIJb9ICLEx++2MxohUdAMCMY0TgrxgRWFAMY5/yDGB3m0YnN8vwSQ/F1gUEWrcm6nhU6wJpx1d0uiCuRRJtf+og/SR+iGJ4FNUESDPChDZ2bTFMfcxTzaJah2w7y/iIh2KdRsCyCdgGfgbG+S3RR32wKOen/KUEAEbVaVrYYQkSkP9Q5TmMRaPrmnr3Hh4QkZWYLiNg2QJswrINl3k5SZ58r9QmbUkBgJQxjNTV+Eg4qZjbtFDQcyIstm5p13sHuc1L0ZcbAbIBsgWyCbkl3U+6RNr39ntQyI2SA8D6RRU7sBnHzwthKkNams1YdUB1uwoCMpSGPzJQ2ZMNBGRm6wSQyOfI9ybcLOJHyQHA4pn88EY0QgK3nBVTSxuqaqo3quZAEZYT8CxU5lT2ZANBU8XyNficE3I7EgA6Fx36IUuZMp/UkxUriv4RHu9WHYNZIQrdAyprKvMgvvmtwoCvWT7nQMmg6ePchWHBDQC10TmK3lFCVH2LJc1WNUToHeZ+cKKhPhoJguEf5gf/Unli2K8Lw37LSqUzlt+RGsAYsVQidRmGBofGfgfpkwyCxoCtiSBBElzJahsBKlsq46A6P/mW5WO2Nc6f0NEAsK6h4m/onFidn620KappFpiaNixt+RQtmFWmKFsQCNY4/ziNybfIx8bdKvmrowGApBka2PQTVFMCu9UVTQHVsNDJWgxCO8GoK9gI0HbtWNhDZRqk6b2TQSefIt+afL/U36gNOX+N7vGmbQ0y4KOoiMeGjZELg7Ynv/MlGkyK1vFltByc8eXB1CBthdZ+E+ZCN7aRc+UNR4IKbgZtmnAGG+HL49GKp2lXmAwP1S2JEaAyo7ILuvMTxORLbjg/0XYlABDhztrYz1Bt8XR7buLr9IVazAzaEor2hXNtYxGnhS5neqjyU1lRmVHZBR0K8iHyJbf0cKUJMCZs21/eP1hUVT8FJrPH7gX5E4XRxcyRC7zccjzIeHktO23dTbv3BnUoejJeGJp+hQ8OnNT+qYPem/zMqd+uBgASsrU3sRAVjb8Evz8gDTmdOyDYV7w+fMSpAg8rHexP8WnY2H9g01DX9oD0ErvRPQ/NT3XUxba6ydf1AEDCY4LQ1xGVb3VTEa9pozbQnkwlr/DrLEKv9ZWVH53VR8d1wb7aZJWxGLlgX1djwo/jvf6TZfEkABDT1j7jz5h3fcZkAQL9GxMzsCTzX8WeXTd3ts4bCbQuAROejujm0+Z8Azb1v/HWl/qgzkKhtZb51ur/WGi+YtK71gk4WZjUyOAlmMn035PvB/o3DA9vnhu16XOew5HRKwOtS4CEJ6wJc8I+bM5PPmL5ikfl4VkNgPRp3mos1iJ8I9pqUY/085aNYH8YSiSu2tBQ9XdvGZcHt2Xdg0dUxmI/hdN/Nowao92fNFNiydqF+pNe6edpACCl0BSgalvec8u9AsBxPoINYsfk24YM4xYVCJxB13J8Xb8G07Qvg/NXOUNVPiqo+l/bUasXfLhHKZp4HgAgLEcQuB9BAIdAhvpKYBjnN8mk8SPVUVhcOVMHnx7VaZn5JfiLFUclGLng/A/A+emkKZiNd5cfAYAt7dpZUXXAkdiGiS/xTlV/OFG1Dm+t3/NE6qb2xfEX/ZEiWFzbnhw5VsQi34IrnB/a5uK4IoHzbxz88LWmxxvnDo+77clXXwIAaXZ677sHxngN7chS0GGGnqDiDhOcVSoeYFz8sL021ucOi2BTbetL1GLe63Wo6lPt0LMOaj9Rg/M/mxD9Sx6tO+QDP+TwLQCQsrQtk7UzC2Nz/FDeP544NlywOzGr8O5yn1WYnr13Ad70F6F1mPkYcP8KylXOqOvvSomRhnV1U95wlVEO4r4GAJJrxZbheboe3QxBArlDSw5s8z8SLCW4WM9M8873jD0PPtkwK5CbqeRXdGKKxd2vVh6sTzuTadpFOH0XJ/GwyMQU4f8F53/LMJKnOLGxZylo+R4ASPggnshSCugZ8wrWLzi73zTFnWvb12zEwiMzY7qg3sQinea2by/RNA6nZ2fD6WuCqooDcktzQpUUAYAAbesxTmeatWNLqHt7bRrP+5gK+gQ6hDckhdjwSH38BeTztHfYppy5kvGVPSPHRTlfhqr9MkzaOQ2J1TkMdIaGKdra6/VHc4Hn1TNpAgApTNs2WTu3wGK8AiAIfKi6CPfvYsLcYKTMDX5XG7NhZjXnItoyxumPNaIQy69Zlw0c3Ec5ChPHeK+tj9+TI5mnj6RztLbexBUwoMAdNOJpqTH2OkYUnoNBbedMbE+ZfDs3je2di6pe80KOli2DRwpNPyaiiWME48fAiI5Bz/0J4D3TC/6B5SHMK9vrYr+QSX7pAgCBg4lC12N4cLVMQAVBFgSEvVyI7XBK/IkdGhNvo1+hn5ka+hdEv0ixfi1iDpiG2W9oRv/uV17tJ71mzJ5Vo5t6jaZrNWZKq+YRVoPOuRqmmfhkNSbjU1Ee8xBsjhHccvgpQcBDKhmFuL69Tv++VDJBGCkDAIFENQHBtX+DgNLKKFthKnnkQ4Cq/VyYX5XtzT+GlNTORX0CES1yB4RVHYNjJaY+g4RAImWmLpapzT8ZPKkDAAmbHh34L3wN7H7uk0FXv8sCgQH09n9Glt7+bIhLHwBI8KAf55QNfHU/nAig2h+YY+YCEQDITNIzBh+BwHPCaTZKqzAgAOffhRl+K2Udqp2McWAWXBCgNG+aFk9MVkL9VgjIgADZJtloUJyfMAtMACBhadEErZwC0Bvpt7oUArIgQDZJtunnwp5isAhUACAFadkkrZ0G4A8Uo7DKoxBwGgGyRbJJv5b0lqJPYPoAMijJW3qwvRjna8ph04gM+qtbPiNAm71gzca3O+utbbzQ/A/eFeQAYKFNG41GIvweTBf6WPDgVxIHFgHavTclzvNyA083sApcE2AyCFQAycTek1ANe2jyM/VbIeAGAmRrZHNBd37CJvA1gHEFzLFf/NcxZ/0mNAn0cffVV4WAIwigym/A+b/VOXpiTyCr/JOBCFMAsHSzziLk2r1QbPZkZdVvhUCxCMDbX8Fi3nPdPquvWPmKzRf4JsBkxamA6ERVdM4E/mjyybqp3/4gQLZENhU25yc0Q1cDGG8irT2Jq7C3wI9Uk2A8Kuq7XQSoyo+3/jc76nEaUUivUAcAKrOWnsRJGCr8Nf5OCmkZKrVcQABv/afw98XO+thTLpCXhmTomgCTkaUCHOzfdDI22/wm9mQqi113J2OgfheAAGyEbIVsJuzOT6iEvgYwvuibuoc/EYlFbkNtoHH8ffVdIUAI4I3flUqkLlvXUPG3ckGkrALAWKGiWfAFrmk3QflpY/fUZ/kigB7+PSxlXtdxcuw35YZC6JsAmQoUVbv/FMYH80whbsHzRKY06l5ZIJAgGyBbKEfnpxIuyxrAeNMe3WcgcismEJ0x/r76Hm4EaDafYaSuDtLSXTdKpOwDwBiorT0GHVH1Y/QPLBi7pz7DhwDa+U+jM/jajnp9ffi0K1wjFQAmYsZbe5KrOBc3YJ/74yY+Ur8CjYAQLwjBr++oj9IycjT71UUIlGUfQI6iFzCQP7Y/vGa+wAkueFu8lCOtehQABKgMqSypTKlsIbJy/nHlpmoA48DY7+t990Va5p55ocb5N1AjOH6/5+qGvAgI8Tw6+G7u3PngXeycc1LyCuqvZCoA2MS/uc9owhnW16Df9HSbWVQyXxAQj8Lbb1lbq6/zhX3AmKoAUGCBNW1NnBiJalejInmeWmNQIHguJbfm7HN2Typp3rpuYewZl9iEkqwKAEUW6/ItA9NjkfjFmsa+hFrBvCLJqGwlISB2mCb7VSI1csdji6rfLIlUmWZWAcCBgm/uMZain+DLGEY8C4DGHSCpSGRBAD14I6h9/RHt+1+urdcfz5JM3baJgAoANoGyk6yp+4NDIrHKc1AjOAfzCU5DHjXKYge4/Gng7+IJdODfl0oM3beu4cB382dRKewgoAKAHZSKSNO6bWAGi8TOwjHb5+JI7VMBtMK6ABzxpsepumIT/ruXpRJ/7Di5encB2VVSmwgoo7QJVCnJVmzaO1OP62dgKLEFNYPloKUOOs0M6ADe9I9hWV6nMWI8tP7UKa9nTqbuOoWACgBOIWmTznH3vRCbc9TRp6DnGsGAtZT9/AKM1wOLTmDRuZs9s6mvrs6wCaVK5gACKgA4AGIpJFo29h/GqipPQY33FI0zfPJa0IuVQlPivFh5KfpMwTZDz81scGhz55KatySWN/SiqQAgWREv7dpZUVFzZB0KZiFWKM6Hw8xHLeFY/A7U6MJob714EY7+LFbe4Y9tHe5/rffxxrnDkkFe1uKoABCA4l/a1RWtrGw4WkTYfGxkcjw6Fo9CYJgL55qDqvMMP1VA9R2dc2IXZNmJDruXhWk+z1Ps2aGh7pceb2xM+imb4p0fARUA8mMkdYrF3a9W1sSmzY6ICAKCeTjX+KEQeCr60PEppqKA6ffBgvEKfMYxFhHDvRjG0qlGMdbUSOD+CN7SCdynDVJGOBP0pn4P996Bc7/NuMAne1uY9Km9keKpnf2JPa882TBL7bMIYIJ6/X8QmpCW0hsGOwAAAABJRU5ErkJggg==")
  19177. };
  19178. n.prototype.setScene = function(e) {
  19179. this.createCpm(e),
  19180. this.createBunnyObj(e)
  19181. }
  19182. ,
  19183. n.prototype.updateModel = function() {
  19184. this.model = this.modelManager.getActiveModel()
  19185. }
  19186. ,
  19187. n.prototype.bindEvents = function() {
  19188. this.modelManager.on(E.ActiveModelChanged, this.updateModel.bind(this))
  19189. }
  19190. ,
  19191. n.prototype.updateDefaultsFromModelData = function() {
  19192. this.model.data
  19193. }
  19194. ,
  19195. n.prototype.pointPathDistance = function(e) {
  19196. for (var t = 0, i = 1; i < e.length; i += 1)
  19197. t += e[i - 1].distanceTo(e[i]);
  19198. return t
  19199. }
  19200. ,
  19201. n.prototype.pointPathLengths = function(e) {
  19202. for (var t = [0], i = 1; i < e.length; i += 1)
  19203. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  19204. return t
  19205. }
  19206. ,
  19207. n.prototype.interpAlongPath = function(e, t, i) {
  19208. var n, o = new r.Vector3, a = t[t.length - 1];
  19209. if (i < 1) {
  19210. n = i * a;
  19211. for (var s = 1; s < t.length; s += 1)
  19212. if (t[s] > n) {
  19213. var l = (n - t[s - 1]) / (t[s] - t[s - 1]);
  19214. return o.copy(e[s]),
  19215. o.sub(e[s - 1]),
  19216. o.multiplyScalar(l),
  19217. o.add(e[s - 1]),
  19218. o
  19219. }
  19220. } else
  19221. o.copy(e[e.length - 1]);
  19222. return o
  19223. }
  19224. ,
  19225. n.prototype.pathHeight = function() {
  19226. return this.player.mode !== a.FLOORPLAN ? c.path.height : c.path.outsideHeight
  19227. }
  19228. ,
  19229. n.prototype.createBunnyObj = function(e) {
  19230. this.bunnyObj || (this.bunnyObj = new r.AxisHelper(.1),
  19231. this.bunnyObj.visible = c.warp.showBunny),
  19232. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  19233. e.add(this.bunnyObj)
  19234. }
  19235. ,
  19236. n.prototype.createCpm = function(e) {
  19237. if (!this.currentPanoMarker) {
  19238. var t = this.makeWaypointObj(w.pathEnd, "Current");
  19239. t.material.uniforms.opacity.value = 0,
  19240. this.currentPanoMarker = {
  19241. mesh: t,
  19242. placed: !1
  19243. }
  19244. }
  19245. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  19246. this.placeCpm(),
  19247. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  19248. }
  19249. ,
  19250. n.prototype.placeCpm = function() {
  19251. if (c.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  19252. var e = this.player.currentPano.floor;
  19253. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  19254. e.add(this.currentPanoMarker.mesh)),
  19255. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  19256. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  19257. this.currentPanoMarker.placed = !0
  19258. } else
  19259. this.popOutCpm()
  19260. }
  19261. ,
  19262. n.prototype.fadeInCpm = function(e) {
  19263. this.player.mode === a.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || c.path.mapGuides && this.currentPanoMarker.placed && p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 1), e)
  19264. }
  19265. ,
  19266. n.prototype.fadeOutCpm = function(e) {
  19267. p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  19268. }
  19269. ,
  19270. n.prototype.popInCpm = function() {
  19271. c.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  19272. }
  19273. ,
  19274. n.prototype.popOutCpm = function() {
  19275. this.fadeOutCpm(2)
  19276. }
  19277. ,
  19278. n.prototype.brushPrefs = {
  19279. linewidth: 7,
  19280. strokeWidth: 15,
  19281. cvSegments: 48,
  19282. paveStep: .1,
  19283. paveWidth: .2,
  19284. lookBlendDist: 3,
  19285. maxTurn: r.Math.degToRad(2)
  19286. },
  19287. n.prototype.panoPathDistance = function(e) {
  19288. var t = this.model.panos;
  19289. if (!e || e.length < 2)
  19290. return 0;
  19291. for (var i = [], n = 0; n < e.length; n += 1)
  19292. i.push(t.get(e[n]).floorPosition);
  19293. return this.pointPathDistance(i)
  19294. }
  19295. ,
  19296. n.prototype.loadTileTexture = function(e) {
  19297. var t = v.load(e, function(t) {
  19298. t.wrapS = r.RepeatWrapping,
  19299. t.wrapT = r.RepeatWrapping,
  19300. t.needsUpdate = !0,
  19301. y.debug('path texture "' + e + '" is ready')
  19302. }, function() {
  19303. y.error('path texture "' + e + '" failed')
  19304. });
  19305. return t.mapping = r.UVMapping,
  19306. t
  19307. }
  19308. ,
  19309. n.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  19310. var a = {
  19311. cameraMode: n,
  19312. position: e,
  19313. quaternion: t,
  19314. panoId: i,
  19315. orthoZoom: o,
  19316. floorVisibility: r,
  19317. thumbUrl: null,
  19318. name: null
  19319. };
  19320. return new f(a)
  19321. }
  19322. ,
  19323. n.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  19324. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  19325. }
  19326. ,
  19327. n.prototype.setWarpDestination = function(e) {
  19328. this.warpDestHeroLoc = e
  19329. }
  19330. ,
  19331. n.prototype.setWarpDestinationByHeroIndex = function(e) {
  19332. var t = this.getHeroDescriptorByHeroIndex(e);
  19333. return null !== t && (this.setWarpDestination(t),
  19334. !0)
  19335. }
  19336. ,
  19337. n.prototype.setWarpDestinationByPano = function(e, t) {
  19338. var i = this.model.panos.get(e.id);
  19339. return !!i && this.setWarpDestinationByPanoId(e.id, t)
  19340. }
  19341. ,
  19342. n.prototype.setWarpDestinationByPanoId = function(e, t) {
  19343. var i = this.model.panos.get(e);
  19344. if (i) {
  19345. t = t || new r.Quaternion;
  19346. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  19347. return this.setWarpDestination(n),
  19348. !0
  19349. }
  19350. return !1
  19351. }
  19352. ,
  19353. n.prototype.getHeroDescriptorByHeroIndex = function(e) {
  19354. var t = this.model.heroCount();
  19355. if (null !== this.warpDestHeroLoc && t < 2)
  19356. return y.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  19357. this.model.getHeroDescriptorByIndex(0);
  19358. var i = this.model.getHeroDescriptorByIndex(e);
  19359. if (i) {
  19360. var n = i.isPano() ? i.panoId : i.cameraMode;
  19361. y.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  19362. }
  19363. return i
  19364. }
  19365. ,
  19366. n.prototype.getHeroDescriptorByPano = function(e) {
  19367. var t = this.model.panos.get(e.id);
  19368. return t ? this.getHeroDescriptorByPanoId(e.id) : null
  19369. }
  19370. ,
  19371. n.prototype.getHeroDescriptorByPanoId = function(e) {
  19372. var t = this.getHeroIndexFromPanoId(e);
  19373. return this.getHeroDescriptorByHeroIndex(t)
  19374. }
  19375. ,
  19376. n.prototype.getHeroIndexFromPanoId = function(e) {
  19377. for (var t = 0; t < this.model.heroLocations.length; t++) {
  19378. var i = this.model.heroLocations[t]
  19379. , n = this.getHeroId(i);
  19380. if (n && n === e)
  19381. return t
  19382. }
  19383. return -1
  19384. }
  19385. ,
  19386. n.prototype.getHeroPano = function(e) {
  19387. if (null === e)
  19388. return y.warn("getHeroPano(): no destination"),
  19389. null;
  19390. var t = this.getHeroId(e)
  19391. , i = this.model.panos.get(t);
  19392. return void 0 === i && (i = null,
  19393. "" !== t && y.debug('unable to find pano "' + t + '"')),
  19394. i
  19395. }
  19396. ,
  19397. n.prototype.getHeroId = function(e) {
  19398. return e.panoId
  19399. }
  19400. ,
  19401. n.prototype.setWarpDestPano = function() {
  19402. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  19403. this.warpDestPano
  19404. }
  19405. ,
  19406. n.prototype.brushToWarpPano = function(e, t) {
  19407. if (this.discardPathObject(),
  19408. !this.setWarpDestPano())
  19409. return !1;
  19410. if (this.warpDestHeroLoc.cameraMode !== a.PANORAMA && y.warn("Can only brush from pano to pano"),
  19411. !this.warpDestPano)
  19412. return y.info("No brush"),
  19413. !1;
  19414. if (!this.player.currentPano)
  19415. return y.debug("No current pano, visibility undefined"),
  19416. !1;
  19417. if (!this.warpDestPano)
  19418. return y.info("No wPano, visibility undefined"),
  19419. !1;
  19420. if (!this.warpDestPano.isAligned())
  19421. return y.debug("Cannot brush to unaligned pano"),
  19422. !1;
  19423. var i = (e === l.STD || e === l.WALK) && c.path.mapGuides
  19424. , n = !0;
  19425. if (this.player.currentPano.id === this.warpDestPano.id)
  19426. y.debug("Already at destination pano");
  19427. else {
  19428. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19429. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  19430. this.obj3d = new r.Object3D,
  19431. y.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  19432. n ? (y.info('No "walkable" route, using fall-back warp style transition'),
  19433. e = t) : (this.setPathHulls(this.nodes),
  19434. this.setFloorCurves(),
  19435. i && ("chevron" === c.path.style ? this.obj3d.add(this.drawPathPavement(this.floorCurvePoints)) : "ribbon" === c.path.style && this.obj3d.add(this.drawPathRibbon(this.floorCurvePoints, this.floorCurveColors)))),
  19436. this.player.currentPano.floor.add(this.obj3d);
  19437. var o = this.player.mode === a.DOLLHOUSE || this.player.mode === a.FLOORPLAN
  19438. , s = e === l.STD;
  19439. if (!n && (i || s)) {
  19440. if (o) {
  19441. var h = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  19442. this.obj3d.add(h)
  19443. }
  19444. var u = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  19445. this.obj3d.add(u)
  19446. }
  19447. this.appearSlow()
  19448. }
  19449. return this.upcomingTransType = e,
  19450. !n
  19451. }
  19452. ,
  19453. n.prototype.findShortestPath = function(e, t) {
  19454. if (!e || !t)
  19455. return null;
  19456. var i = c.warp.walkExtraPanosDistance
  19457. , n = e.id + ":" + t.id + ":" + i;
  19458. if (this.shortPaths.hasOwnProperty(n))
  19459. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  19460. var r = t.id + ":" + e.id + ":" + i;
  19461. if (this.shortPaths.hasOwnProperty(r))
  19462. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  19463. var o = this.model.panos.aStarSearch(e, t);
  19464. return this.model.panos.includeNodesNearPath(o, i),
  19465. this.shortPaths[n] = o ? o.slice() : null,
  19466. o
  19467. }
  19468. ,
  19469. n.prototype.makePathHulls = function(e) {
  19470. var t, i, n, r, o, a = 0, s = [], l = [], h = [], u = this.model.panos;
  19471. t = u.get(e[0]),
  19472. r = t.floor.floorIndex;
  19473. for (var d = 0; d < e.length; d += 1)
  19474. t = u.get(e[d]),
  19475. i = t.floorPosition.clone().sub(this.model.position),
  19476. i.y += this.pathHeight(),
  19477. s.push(i),
  19478. l.push(t.position.clone()),
  19479. n = t.floor.floorIndex,
  19480. h.push(n > r ? c.path.colorUp : n < r ? c.path.colorDown : c.path.color),
  19481. d > 0 && (o = l[d].distanceTo(l[d - 1]),
  19482. o > a && (a = o));
  19483. return a > this.longestStep && (this.longestStep = a,
  19484. y.debug("path contains " + a + " meter segment")),
  19485. {
  19486. floor: s,
  19487. camera: l,
  19488. color: h
  19489. }
  19490. }
  19491. ,
  19492. n.prototype.makeFloorCurves = function(e, t, i) {
  19493. var n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  19494. , o = this.pointPathDistance(e) - 2 * n
  19495. , s = e.slice(0)
  19496. , l = s[1].clone().sub(s[0]);
  19497. l.y = 0,
  19498. l.normalize().multiplyScalar(n),
  19499. s[0] = (new r.Vector3).copy(s[0]).add(l),
  19500. l = s[s.length - 2].clone().sub(s[s.length - 1]),
  19501. l.y = 0,
  19502. l.normalize().multiplyScalar(n),
  19503. s[s.length - 1] = (new r.Vector3).copy(s[s.length - 1]).add(l);
  19504. var h = new r.CatmullRomCurve3(s)
  19505. , u = Math.floor(o / i);
  19506. u = 4 * Math.floor(u / 4),
  19507. u = Math.max(4, u);
  19508. for (var d, p, f, g = h.getSpacedPoints(u), m = [], v = new r.Vector3, A = 0; A < g.length; A += 1) {
  19509. f = 0,
  19510. d = g[A].distanceTo(e[0]);
  19511. for (var y = 1; y < e.length; y += 1)
  19512. v.copy(g[A]).sub(e[y]),
  19513. v.y *= 4,
  19514. p = v.length(),
  19515. p < d && (f = y);
  19516. m.push(t[f])
  19517. }
  19518. return {
  19519. distance: o,
  19520. points: g,
  19521. colors: m
  19522. }
  19523. }
  19524. ,
  19525. n.prototype.makeCameraCurvePoints = function(e, t) {
  19526. var i = this.pointPathDistance(e)
  19527. , n = new r.CatmullRomCurve3(e);
  19528. return n.getSpacedPoints(Math.max(2, Math.floor(i / t)))
  19529. }
  19530. ,
  19531. n.prototype.makeCameraCurveTangents = function(e, t) {
  19532. var i = this.pointPathDistance(e)
  19533. , n = new r.CatmullRomCurve3(e)
  19534. , o = Math.max(2, Math.floor(i / t));
  19535. o || (o = 5);
  19536. for (var a = [], s = 0; s <= o; s++)
  19537. a.push(n.getTangentAt(s / o));
  19538. return a
  19539. }
  19540. ,
  19541. n.prototype.setPathHulls = function(e) {
  19542. var t = this.makePathHulls(e);
  19543. this.floorHull = t.floor,
  19544. this.cameraHull = t.camera,
  19545. this.colorHull = t.color
  19546. }
  19547. ,
  19548. n.prototype.setFloorCurves = function() {
  19549. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  19550. this.floorPathDistance = e.distance,
  19551. this.floorCurvePoints = e.points,
  19552. this.floorCurveColors = e.colors
  19553. }
  19554. ,
  19555. n.prototype.setCameraCurvePoints = function() {
  19556. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, c.warp.stepFactor * this.brushPrefs.paveStep)
  19557. }
  19558. ,
  19559. n.prototype.chooseWarpPath = function(e) {
  19560. var t, i, n, o = this.playerControls.cameras[a.PANORAMA];
  19561. if (this.player.currentPano === this.warpDestPano || !e)
  19562. return this.warpPathPoints = null,
  19563. this.warpLength = 0,
  19564. !1;
  19565. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19566. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (y.debug("warp path to unreachable node"),
  19567. t = this.warpDestPano.position.clone().sub(o.position),
  19568. i = t.clone().negate(),
  19569. t.multiplyScalar(.15).add(o.position),
  19570. i.multiplyScalar(.15).add(this.warpDestPano.position),
  19571. t.y = o.position.y,
  19572. i.y = this.warpDestPano.position.y,
  19573. n = new r.CubicBezierCurve3(o.position.clone(),t,i,this.warpDestPano.position.clone()),
  19574. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (y.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  19575. this.setCameraCurvePoints(),
  19576. this.warpPathPoints = this.camCurvePoints.slice(0)),
  19577. this.warpLength = 0,
  19578. this.warpPathLengths = [0];
  19579. for (var s = new r.Vector3, l = new r.Vector3, h = Math.cos(r.Math.degToRad(c.warp.minBrakeAngle)), u = Math.cos(r.Math.degToRad(c.warp.maxBrakeAngle)), d = 1; d < this.warpPathPoints.length; d += 1) {
  19580. s.copy(this.warpPathPoints[d - 1]).sub(this.warpPathPoints[d]);
  19581. var p = s.length();
  19582. s.y *= c.warp.climbEffort;
  19583. var f = s.length() / p;
  19584. if (d > 1) {
  19585. s.setY(0).normalize(),
  19586. l.copy(this.warpPathPoints[d - 2]).sub(this.warpPathPoints[d - 1]).setY(0).normalize();
  19587. var g = Math.min(1, s.dot(l))
  19588. , m = 1 + (c.warp.brakeStrength - 1) * (1 - r.Math.smoothstep(g, u, h));
  19589. f = Math.max(m, f)
  19590. }
  19591. this.warpLength += p * f,
  19592. this.warpPathLengths[d] = this.warpLength
  19593. }
  19594. return !0
  19595. }
  19596. ,
  19597. n.prototype.drawPathRibbon = function(e, t) {
  19598. this.bunnyObj.visible = c.warp.showBunny;
  19599. for (var i = .6 * c.path.ribbonWidth * .5, n = new r.Vector3, o = new r.Vector3(0,this.pathHeight(),0), l = new r.Geometry, h = new r.Vector3, u = 0; u < e.length; u += 1) {
  19600. h.copy(e[u]),
  19601. 0 === u ? h.sub(e[u + 1]) : h.sub(e[u - 1]).negate(),
  19602. h.normalize(),
  19603. n.crossVectors(h, A.UP),
  19604. n.multiplyScalar(i);
  19605. var d = (new r.Vector3).copy(e[u]).add(o);
  19606. d.sub(n),
  19607. l.vertices.push(d),
  19608. d = (new r.Vector3).copy(e[u]).add(o),
  19609. d.add(n),
  19610. l.vertices.push(d)
  19611. }
  19612. var p, f = 0;
  19613. for (u = 0; u < e.length - 1; u += 1) {
  19614. var g = 2 * u
  19615. , v = f;
  19616. f += e[u + 1].distanceTo(e[u]);
  19617. var y = f
  19618. , C = t[u]
  19619. , I = t[u + 1];
  19620. p = new r.Face3(g,g + 1,g + 2),
  19621. p.vertexColors = [new r.Color(C), new r.Color(C), new r.Color(I)],
  19622. l.faces.push(p),
  19623. l.faceVertexUvs[0].push([new r.Vector2(0,v), new r.Vector2(1,v), new r.Vector2(0,y)]),
  19624. p = new r.Face3(g + 2,g + 1,g + 3),
  19625. p.vertexColors = [new r.Color(I), new r.Color(C), new r.Color(I)],
  19626. l.faces.push(p),
  19627. l.faceVertexUvs[0].push([new r.Vector2(0,y), new r.Vector2(1,v), new r.Vector2(1,y)])
  19628. }
  19629. l.computeFaceNormals(),
  19630. l.computeVertexNormals();
  19631. var E, b;
  19632. this.player.mode === a.PANORAMA ? (b = r.UniformsUtils.clone(m.ribbon.uniforms),
  19633. b.map.value = w.path,
  19634. b.opacity.value = 0,
  19635. b.color.value.set(c.path.color),
  19636. E = new r.RawShaderMaterial({
  19637. side: r.DoubleSide,
  19638. depthWrite: !1,
  19639. transparent: !0,
  19640. vertexShader: m.ribbon.vertexShader,
  19641. fragmentShader: m.ribbon.fragmentShader,
  19642. uniforms: b,
  19643. name: "ribbonT",
  19644. opacity: 0
  19645. })) : E = new r.MeshBasicMaterial({
  19646. color: 16777215,
  19647. side: r.DoubleSide,
  19648. name: "ribbonOut",
  19649. vertexColors: r.VertexColors
  19650. });
  19651. var _ = new r.Mesh(l,E);
  19652. return _.name = "ribbon",
  19653. this.player.mode === a.PANORAMA && (_.renderOrder = s.ribbon),
  19654. _
  19655. }
  19656. ,
  19657. n.prototype.drawPathPavement = function(e) {
  19658. for (var t, i = .25, n = new r.Vector3, o = new r.Geometry, s = new r.Vector3, l = 0; l < e.length; l += 1)
  19659. s.copy(e[l]),
  19660. 0 === l ? s.sub(e[l + 1]).negate() : s.sub(e[l - 1]),
  19661. s.normalize(),
  19662. n.crossVectors(s, A.UP),
  19663. n.multiplyScalar(this.brushPrefs.paveWidth),
  19664. t = (new r.Vector3).copy(e[l]),
  19665. t.sub(n),
  19666. o.vertices.push(t),
  19667. o.vertices.push((new r.Vector3).copy(e[l])),
  19668. t = (new r.Vector3).copy(e[l]),
  19669. t.add(n),
  19670. o.vertices.push(t);
  19671. var h, u, d;
  19672. for (l = 0; l < e.length - 1; l += 1)
  19673. h = 3 * l + 1,
  19674. u = l * i,
  19675. d = u + i,
  19676. o.faces.push(new r.Face3(h - 1,h,h + 3)),
  19677. o.faceVertexUvs[0].push([new r.Vector2(0,u), new r.Vector2(.5,u), new r.Vector2(.5,d)]),
  19678. o.faces.push(new r.Face3(h + 3,h + 2,h - 1)),
  19679. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(0,d), new r.Vector2(0,u)]),
  19680. o.faces.push(new r.Face3(h + 3,h,h + 1)),
  19681. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(.5,u), new r.Vector2(1,u)]),
  19682. o.faces.push(new r.Face3(h + 3,h + 1,h + 4)),
  19683. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(1,u), new r.Vector2(1,d)]);
  19684. var p = this.player.mode === a.PANORAMA ? new r.MeshBasicMaterial({
  19685. color: c.path.color,
  19686. side: r.DoubleSide,
  19687. transparent: !0,
  19688. depthWrite: !1,
  19689. opacity: 0,
  19690. name: "paveT",
  19691. map: w.path
  19692. }) : new r.MeshBasicMaterial({
  19693. color: c.path.color,
  19694. side: r.DoubleSide,
  19695. transparent: !0,
  19696. depthWrite: !1,
  19697. opacity: 1,
  19698. name: "paveO",
  19699. map: w.path
  19700. });
  19701. return new r.Mesh(o,p)
  19702. }
  19703. ,
  19704. n.prototype.hintPrefs = {
  19705. rad: .18,
  19706. width: .0125,
  19707. depth: .0625,
  19708. setBack: -.04,
  19709. markRad: .25,
  19710. markInnerRad: .16
  19711. },
  19712. n.prototype.makeWaypointObj = function(e, t) {
  19713. var i = new r.Geometry
  19714. , n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  19715. , o = this.pathHeight();
  19716. i.vertices.push(new r.Vector3(-n,o,n), new r.Vector3(-n,o,-n), new r.Vector3(n,o,-n), new r.Vector3(n,o,n)),
  19717. i.faces.push(new r.Face3(0,1,2), new r.Face3(2,3,0)),
  19718. i.faceVertexUvs[0].push([new r.Vector2(0,0), new r.Vector2(1,0), new r.Vector2(1,1)]),
  19719. i.faceVertexUvs[0].push([new r.Vector2(1,1), new r.Vector2(0,1), new r.Vector2(0,0)]);
  19720. var s = r.UniformsUtils.clone(m.waypoint.uniforms);
  19721. s.map.value = e,
  19722. s.opacity.value = 0,
  19723. s.color.value.set(c.path.color);
  19724. var l = {
  19725. side: r.DoubleSide,
  19726. depthWrite: !1,
  19727. transparent: !0,
  19728. vertexShader: m.waypoint.vertexShader,
  19729. fragmentShader: m.waypoint.fragmentShader,
  19730. uniforms: s,
  19731. name: "waypoint",
  19732. opacity: 0
  19733. };
  19734. this.player.mode !== a.PANORAMA && (l.depthTest = !1,
  19735. l.name = "wayPtOut");
  19736. var h = new r.RawShaderMaterial(l)
  19737. , u = new r.Mesh(i,h);
  19738. return u.name = t,
  19739. u
  19740. }
  19741. ,
  19742. n.prototype.makeStartMarker = function(e, t) {
  19743. var i = (new r.Vector3).copy(t[1]).sub(t[0]);
  19744. i.y = 0,
  19745. i.normalize();
  19746. var n = Math.acos(i.x)
  19747. , o = this.makeWaypointObj(w.pathStart, "Start");
  19748. return o.rotateOnAxis(new r.Vector3(0,1,0), n),
  19749. o.position.copy(e),
  19750. o
  19751. }
  19752. ,
  19753. n.prototype.makeEndMarker = function(e) {
  19754. var t = this.makeWaypointObj(w.pathEnd, "End")
  19755. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  19756. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  19757. return i < n ? t.material.uniforms.color.value.set(c.path.colorUp) : i > n && t.material.uniforms.color.value.set(c.path.colorDown),
  19758. t.position.copy(e),
  19759. t
  19760. }
  19761. ,
  19762. n.prototype.pathClean = function(e) {
  19763. if (e) {
  19764. for (var t in e.children)
  19765. this.pathClean(e.children[t]);
  19766. e.geometry && e.geometry.dispose(),
  19767. e.material && e.material.dispose()
  19768. }
  19769. }
  19770. ,
  19771. n.prototype.discardPathObject = function() {
  19772. if (this.obj3d) {
  19773. var e = this.obj3d.parent;
  19774. e && e.remove(this.obj3d),
  19775. this.pathClean(this.obj3d)
  19776. }
  19777. this.obj3d = null,
  19778. this.popInCpm()
  19779. }
  19780. ,
  19781. n.prototype.discardSlow = function() {
  19782. if (this.obj3d) {
  19783. if (this.player.mode !== a.PANORAMA)
  19784. return void this.discardPathObject();
  19785. for (var e, t = this, i = 0, n = function() {
  19786. this.discardPathObject()
  19787. }
  19788. .bind(this), r = 0; r < t.obj3d.children.length; r += 1)
  19789. e = t.obj3d.children[r],
  19790. void 0 !== e.material && e.material.transparent === !0 && (void 0 !== e.material.uniforms ? p.start(u.property(e.material.uniforms.opacity, "value", 0), c.path.fadeOutTime, n, 0, d[c.warp.blendEasing]) : p.start(u.property(e.material, "opacity", 0), c.path.fadeOutTime, n, 0, d[c.warp.blendEasing]),
  19791. i += 1,
  19792. n = null);
  19793. 0 === i && this.discardPathObject(),
  19794. this.player.mode !== a.PANORAMA && this.fadeInCpm(c.path.fadeInTime - 3)
  19795. }
  19796. }
  19797. ,
  19798. n.prototype.appearSlow = function() {
  19799. var e, t = this;
  19800. this.fadeOutCpm(c.path.fadeInTime);
  19801. for (var i = this.player.mode === a.PANORAMA ? c.path.opacity : 1, n = 0; n < t.obj3d.children.length; n += 1)
  19802. e = t.obj3d.children[n],
  19803. void 0 !== e.material && e.material.transparent === !0 && (void 0 !== e.material.uniforms ? p.start(u.property(e.material.uniforms.opacity, "value", i), c.path.fadeInTime, null, 0, d[c.warp.blendEasing]) : p.start(u.property(e.material, "opacity", i), c.path.fadeInTime, null, 0, d[c.warp.blendEasing]))
  19804. }
  19805. ,
  19806. n.prototype.update = function() {
  19807. this.obj3d && this.obj3d.updateMatrixWorld()
  19808. }
  19809. ,
  19810. n.prototype.calcBurnsAmount = function(e) {
  19811. var t = r.Math.degToRad(c.warp.burnsAngle);
  19812. if (this.player.mode === a.PANORAMA) {
  19813. var i = this.burnsDir * t;
  19814. if (this.upcomingTransType === l.BLACK)
  19815. return i;
  19816. var n = e;
  19817. if (null === n)
  19818. return y.warn("Transition request for non-highlight"),
  19819. i;
  19820. var o = this.getHeroDescriptorByHeroIndex(n);
  19821. if (null === o)
  19822. return i;
  19823. if (!o.isPano())
  19824. return i;
  19825. var s = this.getHeroPano(o)
  19826. , h = this.playerControls.cameras[a.PANORAMA]
  19827. , u = A.FORWARD.clone().applyQuaternion(h.quaternion).setY(0).normalize()
  19828. , d = Math.min(r.Math.degToRad(c.warp.minBurnsAngle), t)
  19829. , p = function(e) {
  19830. var i = Math.acos(Math.min(1, e.dot(u)))
  19831. , n = (new r.Vector3).crossVectors(u, e);
  19832. return Math.max(d, Math.min(Math.abs(i), t)) * Math.sign(n.y)
  19833. };
  19834. if (s === this.player.currentPano)
  19835. return i = p(A.FORWARD.clone().applyQuaternion(o.quaternion).setY(0).normalize());
  19836. var f = this.findShortestPath(this.player.currentPano, s);
  19837. if (void 0 === f || null === f || f.length < 1)
  19838. return y.debug("Empty path ahead..."),
  19839. i;
  19840. var g = this.makePathHulls(f)
  19841. , m = new r.CatmullRomCurve3(g.camera)
  19842. , v = Math.min(.1, c.warp.lookAheadDist / m.getLength());
  19843. return i = p(m.getPointAt(v).clone().sub(h.position).setY(0).normalize())
  19844. }
  19845. return this.player.mode === a.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir
  19846. }
  19847. ,
  19848. n.prototype.waitNextStep = function(e, t, time) {//xzw 改时间
  19849. var i = (time==void 0)? c.warp.tourStepDelay : time;
  19850. i || (i = this.lastTransType === l.BLACK ? b.tourStepDelaySlideShow : b.tourStepDelayDefault);
  19851. var n = new r.Euler
  19852. , o = new r.Vector3;
  19853. y.debug("Starting wait: " + (void 0 !== t));
  19854. var s = this.calcBurnsAmount(e)
  19855. , h = function() {
  19856. this.endWarpState(),
  19857. this.player.mode === a.DOLLHOUSE && (this.playerControls.cameras[a.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  19858. t && t()
  19859. }
  19860. .bind(this)
  19861. , u = function(e, t) {
  19862. if (this.warpInterrupted)
  19863. return h(),
  19864. !0;
  19865. var r = t || 1e3 / 60;
  19866. if (c.warp.doBurns)
  19867. if (this.player.mode === a.PANORAMA) {
  19868. var l = this.playerControls.cameras[a.PANORAMA];
  19869. n.setFromQuaternion(l.quaternion, c.warp.eOrder);
  19870. var u = r * s / i;
  19871. n.y += u,
  19872. o.set(0, 0, -1),
  19873. o.applyEuler(n),
  19874. o.add(l.position),
  19875. l.controls.lookAt(o),
  19876. l.controls.lookVector.copy(o)
  19877. ,l.lookAt(o)
  19878. } else
  19879. this.player.mode === a.DOLLHOUSE ? this.playerControls.controls[a.DOLLHOUSE].rotationAcceleration.x = s : this.playerControls.controls[a.FLOORPLAN].absoluteScale *= .9996
  19880. }
  19881. .bind(this);
  19882. this.startWarpState(),
  19883. p.start(u, i, h, 0, d.easeInOutQuad, "wait")
  19884. //zoom动画
  19885. var currentGuide = player.model.heroLocations[app.director.currentItem];
  19886. this.player.zoomEnabled = true;
  19887. var zoom = function(e, d) {
  19888. this.player.zoomTo(e * currentGuide.zoom.toFixed(2), true)
  19889. }.bind(this)
  19890. p.start(zoom, 2000, null, 0, d.easeOutQuad, "zoom")
  19891. }
  19892. ,
  19893. n.prototype.warpToNonPano = function(e) {
  19894. if (this.discardPathObject(),
  19895. this.warpDestHeroLoc.cameraMode === a.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === a.FLOORPLAN) {
  19896. var t = function() {
  19897. e && e()
  19898. }
  19899. .bind(this);
  19900. this.player.flyToNewMode({
  19901. mode: this.warpDestHeroLoc.cameraMode,
  19902. duration: c.warp.outsideTime,
  19903. warpDest: this.warpDestHeroLoc,
  19904. callback: t,
  19905. force: !0
  19906. })
  19907. } else
  19908. y.warn("no warp destination!!!"),
  19909. e && e()
  19910. }
  19911. ,
  19912. n.prototype._resetWarpShaderParams = function(e) {
  19913. this.player.mode === a.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  19914. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  19915. }
  19916. ,
  19917. n.prototype._clearWarpShading = function() {
  19918. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  19919. this._resetWarpShaderParams(e[t]),
  19920. e[t].visible = !0;
  19921. this._resetWarpShaderParams(this.model.skybox)
  19922. }
  19923. ,
  19924. n.prototype._warpStopFlying = function() {
  19925. this.activeTransType = null,
  19926. this.placeCpm()
  19927. }
  19928. ,
  19929. n.prototype._wrapupTravelOnlyBits = function() {
  19930. this._warpStopFlying(),
  19931. this.warpPathPoints && (this.player.currentPano.exit(),
  19932. this.warpDestPano.enter(),
  19933. this.player.currentPano = this.warpDestPano),
  19934. this.player.spider.draw(),
  19935. this.placeCpm()
  19936. }
  19937. ,
  19938. n.prototype._wrapupTravel = function(e) {
  19939. this._wrapupTravelOnlyBits(),
  19940. this.warpCameraAim(e)
  19941. }
  19942. ,
  19943. n.prototype._wrapupWarpShading = function(e) {
  19944. this._clearWarpShading(),
  19945. this._wrapupTravel(e)
  19946. }
  19947. ,
  19948. n.prototype.wrapupWarpShadingOnly = function(e, t) {
  19949. t !== I.END && this._clearWarpShading(),
  19950. this._wrapupTravelOnlyBits(),
  19951. this.upcomingTransType = null,
  19952. e && e()
  19953. }
  19954. ,
  19955. n.prototype._warpCameraAim = function(e, t) {
  19956. var i = this.warpDestHeroLoc.quaternion
  19957. , n = this.playerControls.cameras[a.PANORAMA]
  19958. , o = new r.Vector3(0,0,1).applyQuaternion(i).normalize()
  19959. , s = new r.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize()
  19960. , l = s.dot(o)
  19961. , u = r.Math.radToDeg(Math.acos(l))
  19962. , f = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(i, c.warp.eOrder)
  19963. , g = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  19964. , m = new r.Euler(f.x - g.x,f.y - g.y,f.z - g.z,c.warp.eOrder);
  19965. m.y = h.constrainedTurn(m.y),
  19966. this.burnsDir = Math.sign(m.y);
  19967. var v = new r.Euler(0,0,0,c.warp.eOrder)
  19968. , A = new r.Vector3
  19969. , C = function(e, t) {
  19970. return !!this.warpInterrupted || (v.x = g.x + e * m.x,
  19971. v.y = g.y + e * m.y,
  19972. v.z = g.z + e * m.z,
  19973. A.set(0, 0, -1),
  19974. A.applyEuler(v),
  19975. A.add(n.position),
  19976. n.controls.lookAt(A),
  19977. n.controls.lookVector.copy(A),
  19978. void n.lookAt(A))
  19979. }
  19980. .bind(this);
  19981. return u > c.warp.minRotation ? p.start(C, e, t, 0, d[c.warp.movementEasing]) : (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  19982. ,void (t && t())
  19983. )
  19984. }
  19985. ,
  19986. n.prototype._warpBendAim = function(e, t, i, n) {
  19987. var o = n || 0
  19988. , s = this.playerControls.cameras[a.PANORAMA]
  19989. , l = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  19990. , u = (new r.Euler).setFromQuaternion(s.quaternion, c.warp.eOrder)
  19991. , f = new r.Euler(l.x - u.x,l.y - u.y,l.z - u.z,c.warp.eOrder);
  19992. f.y = h.constrainedTurn(f.y);
  19993. var g = Math.min(r.Math.degToRad(c.warp.softBendTilt), Math.abs(f.x));
  19994. f.x = g * Math.sign(f.x),
  19995. g = Math.min(r.Math.degToRad(Math.max(0, c.warp.softBendAngle)), g),
  19996. this.burnsDir = Math.sign(f.y),
  19997. g *= Math.sign(f.y),
  19998. f.y = g;
  19999. var m = new r.Euler(0,0,0,c.warp.eOrder)
  20000. , v = new r.Vector3
  20001. , A = function(e, t) {
  20002. if (e < .5)
  20003. m.x = u.x + e * f.x,
  20004. m.y = u.y + e * f.y,
  20005. m.z = u.z + e * f.z;
  20006. else {
  20007. var i = (1 - e) * c.warp.softBendEnd;
  20008. m.x = l.x - i * f.x,
  20009. m.y = l.y - i * f.y,
  20010. m.z = l.z - i * f.z
  20011. }
  20012. v.set(0, 0, -1),
  20013. v.applyEuler(m),
  20014. v.add(s.position);
  20015. s.controls.lookAt(v),
  20016. s.controls.lookVector.copy(v),
  20017. s.lookAt(v);
  20018. }
  20019. .bind(this);
  20020. return p.start(A, t, i, o, d[c.warp.movementEasing])
  20021. }
  20022. ,
  20023. n.prototype._warpStepCameraAim = function(e, t, i) {
  20024. var n = this.playerControls.cameras[a.PANORAMA]
  20025. , o = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20026. , s = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  20027. , l = new r.Euler(o.x - s.x,o.y - s.y,o.z - s.z,c.warp.eOrder);
  20028. l.y = h.constrainedTurn(l.y),
  20029. this.burnsDir = Math.sign(l.y);
  20030. var u = new r.Euler(0,0,0,c.warp.eOrder)
  20031. , f = new r.Vector3
  20032. , g = function(e, t) {
  20033. e < .5 ? u.copy(s) : u.copy(o),
  20034. f.set(0, 0, -1),
  20035. f.applyEuler(u),
  20036. f.add(n.position),
  20037. n.controls.lookAt(f),
  20038. n.controls.lookVector.copy(f),
  20039. n.lookAt(f)
  20040. }
  20041. .bind(this);
  20042. return p.start(g, t, i, 0, d[c.warp.movementEasing])
  20043. }
  20044. ,
  20045. n.prototype.setBurnsDir = function() {
  20046. var e = this.playerControls.cameras[a.PANORAMA]
  20047. , t = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20048. , i = (new r.Euler).setFromQuaternion(e.quaternion, c.warp.eOrder)
  20049. , n = new r.Euler(t.x - i.x,t.y - i.y,t.z - i.z,c.warp.eOrder);
  20050. n.y = h.constrainedTurn(n.y),
  20051. this.burnsDir = Math.sign(n.y)
  20052. }
  20053. ,
  20054. n.prototype.stepWarpPath = function(e, t) {
  20055. var i = this.playerControls.cameras[a.PANORAMA];
  20056. if (!this.warpPathPoints)
  20057. return i.position.copy(this.warpDestPano.position),
  20058. !0;
  20059. var n = this.warpPathPoints[0]
  20060. , o = this.warpDestPano.position;
  20061. if (null !== this.nodes && this.cameraHull.length > 1) {
  20062. var s = new r.Vector3;
  20063. e < .5 ? s.copy(this.cameraHull[1]).sub(n).normalize().multiplyScalar(c.warp.softPushDist * e).add(n) : s.copy(this.cameraHull[this.cameraHull.length - 2]).sub(o).normalize().multiplyScalar(c.warp.softPushDist * c.warp.softPushEnd * (1 - e)).add(o),
  20064. i.position.copy(s)
  20065. } else
  20066. e < .5 ? i.position.copy(n) : i.position.copy(o)
  20067. }
  20068. ,
  20069. n.prototype.interruptAndFastForward = function(e, t) {
  20070. this.warping && (this.warpInterrupted = !0,
  20071. this.warpInterruptionBlackoutStyle = e,
  20072. this.warpInterruptionTravelTime = t,
  20073. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = I.MIDDLE),
  20074. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = c.minWarpTime))
  20075. }
  20076. ,
  20077. n.prototype.warpCameraAim = function(e) {
  20078. var t = c.warp.minWarpTime;
  20079. if (this.upcomingTransType === l.BLACK)
  20080. t = c.warp.teleportTime;
  20081. else {
  20082. var i = this.playerControls.cameras[a.PANORAMA]
  20083. , n = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20084. , o = (new r.Euler).setFromQuaternion(i.quaternion, c.warp.eOrder)
  20085. , s = new r.Euler(n.x - o.x,n.y - o.y,n.z - o.z,c.warp.eOrder);
  20086. s.y = h.constrainedTurn(s.y);
  20087. var u = 1e3 * Math.abs(s.y) / r.Math.degToRad(c.warp.maxAimPerSec);
  20088. t = Math.max(t, u)
  20089. }
  20090. var d = function() {
  20091. this._warpStopFlying(),
  20092. this.discardSlow(),
  20093. e && e()
  20094. }
  20095. .bind(this);
  20096. this._warpCameraAim(t, d)
  20097. }
  20098. ,
  20099. n.prototype.warpCommonParameters = function(e, t, i, n) {
  20100. this.model.skybox.material.uniforms.blackout.value = n;
  20101. var r = u.uniform(this.model.skybox, "progress", 1)
  20102. , o = u.allUniforms(this.model.chunks, "progress", 1)
  20103. , a = !1
  20104. , s = function() {
  20105. if (this.warpInterrupted)
  20106. return a = !0,
  20107. !0
  20108. }
  20109. .bind(this)
  20110. , l = function(e, t) {
  20111. return i && a ? (this.model.skybox.material.uniforms.progress.value = 0,
  20112. !0) : void r(e, t)
  20113. }
  20114. .bind(this)
  20115. , h = function(e, t) {
  20116. return i && a ? (o(0),
  20117. !0) : void o(e, t)
  20118. }
  20119. .bind(this);
  20120. p.start(s, e, null, t, null, "safeHaltWatch"),
  20121. p.start(l, e, null, t, d[c.warp.blendEasing], "skyboxProgress"),
  20122. p.start(h, e, null, t, d[c.warp.blendEasing], "chunkProgress")
  20123. }
  20124. ,
  20125. n.prototype.warpTravel_STD = function(e) {
  20126. var t, i = Math.min(c.warp.lookAheadMax, c.warp.lookAheadDist / this.warpLength), n = this.playerControls.cameras[a.PANORAMA], o = (Math.min(.25, 3 / this.warpLength),
  20127. Math.min(.35, 7 / this.warpLength)), s = new r.Euler(0,0,0,c.warp.eOrder), f = new r.Vector3, m = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder), v = (new r.Euler).copy(m), C = n.position.clone(), E = new r.Matrix4, b = new r.Euler, w = c.warp.minWarpTime;
  20128. w += this.warpLength * c.warp.timePerMeter,
  20129. c.warp.flySpeed > .01 && (w = 1e3 * this.warpLength / c.warp.flySpeed);
  20130. var _ = !1
  20131. , T = this.warpDestHeroLoc.quaternion
  20132. , x = new r.Vector3(0,0,-1).applyQuaternion(T).normalize()
  20133. , S = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  20134. , M = S.dot(x)
  20135. , R = r.Math.radToDeg(Math.acos(M))
  20136. , P = function(e) {
  20137. var t = o
  20138. , i = r.Math.smoothstep(e, 0, t) * (1 - r.Math.smoothstep(e, 1 - t, 1));
  20139. return i
  20140. }
  20141. , O = function() {
  20142. return E.lookAt(C, t, A.UP),
  20143. s.setFromRotationMatrix(E, c.warp.eOrder),
  20144. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  20145. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  20146. h.constrainedTurn(b.y)
  20147. }
  20148. .bind(this)
  20149. , L = function(e, t) {
  20150. if (this.warpInterrupted)
  20151. return _ = !0,
  20152. !0
  20153. }
  20154. .bind(this)
  20155. , D = function(e, t) {
  20156. return _ || !this.warpPathPoints ? (g.blur(0),
  20157. !0) : void g.blur(e)
  20158. }
  20159. .bind(this)
  20160. , N = u.allUniforms(this.model.chunks, "modelAlpha", 1)
  20161. , B = function(e, t) {
  20162. return _ || !this.warpPathPoints ? (N(0),
  20163. !0) : void N(e, t)
  20164. }
  20165. .bind(this)
  20166. , F = function(e, t) {
  20167. if (!this.warpPathPoints)
  20168. return n.position.copy(this.warpDestPano.position),
  20169. !0;
  20170. if (_)
  20171. return !0;
  20172. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  20173. n.position.copy(i),
  20174. C = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  20175. }
  20176. .bind(this)
  20177. , V = function(e, n) {
  20178. return this.warpPathPoints ? !!_ || void (t = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + i, 1))) : (y.debug("Lost bunny."),
  20179. !0)
  20180. }
  20181. .bind(this)
  20182. , U = function(e, o) {
  20183. if (_)
  20184. return y.debug(">>>> Walkthrough interupted at t=" + e),
  20185. !0;
  20186. if (!this.warpPathPoints)
  20187. return !0;
  20188. var a = this.warpLength * e
  20189. , l = r.Math.smoothstep(a, 0, this.brushPrefs.lookBlendDist)
  20190. , u = r.Math.smoothstep(a, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  20191. c.warp.matchCam && (l *= 1 - u),
  20192. E.lookAt(C, t, A.UP),
  20193. s.setFromRotationMatrix(E, c.warp.eOrder),
  20194. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  20195. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  20196. b.y = h.constrainedTurn(b.y),
  20197. s.x = m.x + l * b.x,
  20198. s.y = m.y + l * b.y,
  20199. s.z = m.z + l * b.z,
  20200. b.set(s.x - v.x, s.y - v.y, s.z - v.z, c.warp.eOrder),
  20201. b.y = h.constrainedTurn(b.y);
  20202. var d = r.Math.degToRad(c.warp.maxTurnPerSec) * o / 1e3;
  20203. b.y = Math.sign(b.y) * Math.min(d, Math.abs(b.y)),
  20204. v.x = v.x + b.x * c.warp.turnFriction,
  20205. v.y = v.y + b.y * c.warp.turnFriction,
  20206. v.z = v.z + b.z * c.warp.turnFriction,
  20207. v.x = Math.max(r.Math.degToRad(c.warp.minDownAngle), v.x);
  20208. var p = t.clone().sub(C).normalize();
  20209. if (R < c.warp.maxAimRotation && u > 0) {
  20210. var g = 1 - u;
  20211. p.x = p.x * g + u * S.x,
  20212. p.y = p.y * g + u * S.y,
  20213. p.z = p.z * g + u * S.z,
  20214. p.normalize()
  20215. }
  20216. this.bunnyObj.position.copy(n.position).add(p),
  20217. f.set(0, 0, -1).applyEuler(v).normalize(),
  20218. f.multiplyScalar(8),
  20219. f.add(n.position),
  20220. e > 1 - i && c.warp.matchCam || (n.controls.lookAt(f),
  20221. n.controls.lookVector.copy(f),
  20222. n.lookAt(f))
  20223. }
  20224. .bind(this)
  20225. , k = function() {
  20226. _ ? (this.discardSlow(),
  20227. this.upcomingTransType = l.BLACK,
  20228. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, I.BEGINNING, e)) : this._wrapupWarpShading(e)
  20229. }
  20230. .bind(this);
  20231. V(0);
  20232. var H = c.warp.motionLeadTime + 1e3 * Math.abs(O()) / r.Math.degToRad(c.warp.maxTurnPerSec);
  20233. w += H;
  20234. var G = H / w;
  20235. this.warpCommonParameters(w, G, !0, I.NONE),
  20236. p.start(L, w, null, 0, null, "_haltWatcher"),
  20237. c.warp.blur > 0 && (g.blurStrength = c.warp.blur,
  20238. p.start(D, w, null, G, P, "blurring")),
  20239. p.start(B, w, null, G, P, "modelAlpha"),
  20240. p.start(F, w, null, G, d[c.warp.blendEasing], "followPath"),
  20241. p.start(V, w, null, G, d[c.warp.blendEasing], "goBunny"),
  20242. p.start(U, w, k, 0, d[c.warp.blendEasing], "lookAtBunny")
  20243. }
  20244. ,
  20245. n.prototype.warpTravel_BLACK = function(e, t, i, n) {
  20246. var r = e || 0;
  20247. void 0 !== t && null !== t || (t = c.warp.teleportTime),
  20248. this.warpCommonParameters(t, r, !1, i),
  20249. this.model.chunks.forEach(function(e) {
  20250. e.material.uniforms.blackout.value = i
  20251. }),
  20252. this._warpBendAim(null, t, null, r);
  20253. var o = function() {
  20254. this.wrapupWarpShadingOnly(n, i);
  20255. }
  20256. .bind(this);
  20257. p.start(this.stepWarpPath.bind(this), t, o, r, d[c.warp.blendEasing], "stepMotion")
  20258. }
  20259. ,
  20260. n.prototype.flightStepWalk = function(e, t, i) {
  20261. var n = .001
  20262. , o = 1
  20263. , a = 1.2
  20264. , s = new r.Vector3
  20265. , h = new r.Vector3
  20266. , u = function(e, t) {
  20267. var i = Math.min(this.player.position.distanceTo(e.position), c.transition.flytimeMaxDistanceThreshold)
  20268. , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
  20269. h.copy(A.FORWARD),
  20270. this.player.getDirection(h),
  20271. s.copy(t).sub(e.position).normalize();
  20272. var l = s.dot(h)
  20273. , u = Math.acos(l)
  20274. , d = u / r;
  20275. return d > n && (r *= d / n,
  20276. u < o && (r *= a)),
  20277. r
  20278. };
  20279. return function(e, t, i) {
  20280. if (this.warpInterrupted)
  20281. i && i();
  20282. else if (this.activeTransType !== l.WALK)
  20283. this._clearWarpShading(),
  20284. this._warpStopFlying(),
  20285. this.player.spider.draw(),
  20286. this.placeCpm(),
  20287. i && i();
  20288. else if (this.player.currentPano !== e) {
  20289. var n = {
  20290. pano: e,
  20291. lookAtPoint: t,
  20292. duration: null,
  20293. maxDistanceOverride: c.warp.walkMaxDist,
  20294. skipWarpingCheck: !1,
  20295. constantMoveSpeed: !0
  20296. };
  20297. n.duration = u.call(this, e, t),
  20298. this.player.nonInterruptingFlyToPano(n, i)
  20299. } else
  20300. i && i()
  20301. }
  20302. }(),
  20303. n.prototype.makeWalkFlightFunc = function(e, t, i) {
  20304. return this.flightStepWalk.bind(this, e, t, i)
  20305. }
  20306. ,
  20307. n.prototype.warpTravel_WALK = function() {
  20308. var e = [];
  20309. return function(t) {
  20310. var i = this.player.model.panos;
  20311. e.length = 0;
  20312. for (var n = null, o = !1, a = 0; a < this.nodes.length; a++) {
  20313. var s = this.nodes[a]
  20314. , l = i.get(s);
  20315. a === this.nodes.length - 1;
  20316. o = n && l.position.distanceTo(n.position) < c.warp.walkMinDist,
  20317. n && o || (e.push(s),
  20318. n = l)
  20319. }
  20320. o && this.nodes.length > 1 && (e[e.length - 1] = this.nodes[this.nodes.length - 1]);
  20321. var h = e.length
  20322. , u = i.get(e[h - 1])
  20323. , d = new Array(h + 1);
  20324. d[d.length - 1] = function() {
  20325. t && t()
  20326. }
  20327. .bind(this);
  20328. for (var p = h - 1, f = d.length - 1; f > 0; f -= 1) {
  20329. var g = e[p];
  20330. u = i.get(g);
  20331. var m = new r.Vector3;
  20332. this.getLookAtForWalkingTourNode(e, p, m),
  20333. d[f - 1] = this.makeWalkFlightFunc(u, m, d[f]),
  20334. p--
  20335. }
  20336. d[0]()
  20337. }
  20338. }(),
  20339. n.prototype.getLookAtForWalkingTourNode = function() {
  20340. var e = new r.Vector3
  20341. , t = new r.Vector3
  20342. , i = new r.Vector3
  20343. , n = new r.Vector3
  20344. , o = new r.Vector3
  20345. , a = .65
  20346. , s = .75
  20347. , l = .2
  20348. , c = .4
  20349. , h = .2
  20350. , u = 3;
  20351. return function(r, d, p) {
  20352. var f = r.length;
  20353. if (d >= f)
  20354. return !1;
  20355. var g = 1
  20356. , m = 1;
  20357. t.set(0, 0, 0),
  20358. o.set(0, 0, 0);
  20359. for (var v = null, A = d; A < d + u && !(A >= f); A++) {
  20360. if (v = this.player.model.panos.get(r[A]),
  20361. this.getOrientationForWalkingTourNode(r, A, i),
  20362. A === d && e.copy(i),
  20363. n.copy(i),
  20364. A > d) {
  20365. var y = n.dot(e) < a;
  20366. g *= y ? l : s,
  20367. m *= y ? h : c
  20368. }
  20369. i.multiplyScalar(g),
  20370. t.add(i),
  20371. o.lerp(v.position, m)
  20372. }
  20373. return t.normalize(),
  20374. p.copy(o),
  20375. p.add(t),
  20376. !0
  20377. }
  20378. }(),
  20379. n.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  20380. var n = e.length;
  20381. if (t >= n)
  20382. return !1;
  20383. if (t === n - 1)
  20384. i.copy(A.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  20385. else {
  20386. var r = this.player.model.panos.get(e[t])
  20387. , o = this.player.model.panos.get(e[t + 1]);
  20388. i.copy(o.position).sub(r.position)
  20389. }
  20390. return i.normalize(),
  20391. !0
  20392. }
  20393. ,
  20394. n.prototype.warpCameraTravel = function(e, t, i, n) {
  20395. if (this.activeTransType = this.upcomingTransType,
  20396. this.lastTransType = this.activeTransType,
  20397. this.upcomingTransType = null,
  20398. !e) {
  20399. var r = function() {
  20400. this._wrapupTravel(n)
  20401. }
  20402. .bind(this)
  20403. , o = {
  20404. pano: this.warpDestPano,
  20405. lookAtPoint: null,
  20406. duration: null,
  20407. maxDistanceOverride: null,
  20408. skipWarpingCheck: !1
  20409. };
  20410. return void this.player.flyToPano(o, r)
  20411. }
  20412. this.activeTransType === l.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === l.WALK ? this.warpTravel_WALK(function() {
  20413. this._clearWarpShading(),
  20414. this._warpStopFlying(),
  20415. this.player.spider.draw(),
  20416. this.placeCpm(),
  20417. n && n()
  20418. }
  20419. .bind(this)) : this.warpTravel_STD(n)
  20420. }
  20421. ,
  20422. n.prototype.startWarpState = function() {
  20423. this.warping = !0,
  20424. this.warpInterrupted = !1,
  20425. this.warpInterruptionBlackoutStyle = null,
  20426. this.warpInterruptionTravelTime = null
  20427. }
  20428. ,
  20429. n.prototype.endWarpState = function() {
  20430. this.warping = !1
  20431. }
  20432. ,
  20433. n.prototype.warpToPano = function(e, t, i, n) {
  20434. if (this.warping)
  20435. return void y.warn("Cannot warp when already warping");
  20436. if (this.upcomingTransType = e,
  20437. this.activeTransType = null,
  20438. !this.setWarpDestPano())
  20439. return this.upcomingTransType = null,
  20440. void this.warpToNonPano(n);
  20441. if (this.player.mode !== a.PANORAMA)
  20442. return this.upcomingTransType = null,
  20443. this.discardSlow(),
  20444. void this.player.flyToNewMode({
  20445. mode: a.PANORAMA,
  20446. pano: this.warpDestPano,
  20447. duration: c.warp.outsideTime,
  20448. warpDest: this.warpDestHeroLoc,
  20449. callback: n,
  20450. force: !0
  20451. });
  20452. if (!this.warpDestPano)
  20453. return y.warn("no warp destination, callback dropped"),
  20454. void (this.upcomingTransType = null);
  20455. var r = !(this.model.panos.isNeighbour(this.player.currentPano, this.warpDestPano) && this.warpDestPano !== this.player.currentPano && this.warpDestPano.position.distanceTo(this.player.currentPano.position) < c.warp.nearPanoDist)
  20456. , o = this.chooseWarpPath(r);
  20457. if (o && this.upcomingTransType !== l.WALK) {
  20458. var s = function() {
  20459. this.waitingToWarp = !1,
  20460. this.warpToPano(e, t, i, n)
  20461. }
  20462. .bind(this);
  20463. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, s))
  20464. return void (this.waitingToWarp = !0)
  20465. }
  20466. this.player.currentPano || (y.warn("Arrived at a very strange spot!"),
  20467. this.player.currentPano = this.warpDestPano,
  20468. this.placeCpm(),
  20469. this.fadeOutCpm(c.path.fadeOutTime),
  20470. this.player.spider.draw()),
  20471. y.debug("Warping to pano ", this.warpDestPano.position),
  20472. this.upcomingTransType !== l.WALK && this.player.emit(C.PanoChosen, this.player.currentPano, this.warpDestPano),
  20473. this.startWarpState();
  20474. var h = function() {
  20475. this.endWarpState(),
  20476. n && n()
  20477. }
  20478. .bind(this);
  20479. o ? this.warpCameraTravel(r, t, i, h) : this.warpCameraAim(h)
  20480. //this.player.smoothZoomToDefault(c.zoom.restoreTime);
  20481. }
  20482. ,
  20483. t.exports = n
  20484. }
  20485. ).call(this, "/js/objects/ShowPath.js")
  20486. }
  20487. , {
  20488. "../constants": 8,
  20489. "../effects": 16,
  20490. "../enum/BlackoutStyle": 18,
  20491. "../enum/ModelManagerEvents": 33,
  20492. "../enum/PlayerEvents": 40,
  20493. "../enum/RenderOrder": 42,
  20494. "../enum/Vectors": 50,
  20495. "../enum/Viewmode": 51,
  20496. "../enum/WarpStyle": 52,
  20497. "../gui/gui": 65,
  20498. "../model/ModelManager": 140,
  20499. "../objects/Snapshot": 153,
  20500. "../settings": 166,
  20501. "../shaders": 167,
  20502. "../util/easing": 186,
  20503. "../util/lerp": 188,
  20504. "../util/logger": 189,
  20505. "../util/math": 190,
  20506. "../util/texture": 194,
  20507. "../util/transitions": 195,
  20508. three: 217
  20509. }],
  20510. 152: [function(e, t, i) {
  20511. "use strict";
  20512. function n() {
  20513. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  20514. , t = new r.RawShaderMaterial({
  20515. fragmentShader: o.skysphere.fragmentShader,
  20516. vertexShader: o.skysphere.vertexShader,
  20517. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  20518. side: r.BackSide,
  20519. name: "skysphere"
  20520. });
  20521. t.uniforms.radius.value = e.parameters.radius,
  20522. r.Mesh.call(this, e, t)
  20523. }
  20524. var r = e("three")
  20525. , o = e("../shaders")
  20526. , a = e("../settings");
  20527. n.prototype = Object.create(r.Mesh.prototype),
  20528. n.prototype.constructor = n,
  20529. t.exports = n
  20530. }
  20531. , {
  20532. "../settings": 166,
  20533. "../shaders": 167,
  20534. three: 217
  20535. }],
  20536. 153: [function(e, t, i) {
  20537. (function(i) {
  20538. "use strict";
  20539. function n(e) {
  20540. o.call(this, e),
  20541. this.sid = e.sid,//xzw add
  20542. this.panoId = e.panoId,
  20543. this.orthoZoom = e.orthoZoom,
  20544. this.floorVisibility = e.floorVisibility,
  20545. this.thumbUrl = e.thumbUrl,
  20546. this.name = e.name,
  20547. this.zoom = e.zoom
  20548. }
  20549. var r = (e("three"),
  20550. e("../util/logger"))
  20551. , o = (e("../settings"),
  20552. e("../enum/Viewmode"),
  20553. e("../util/common"),
  20554. e("../util/transitions"),
  20555. e("../util/lerp"),
  20556. e("../util/ajax"),
  20557. e("../util/texture"),
  20558. e("./View"));
  20559. e("events").EventEmitter,
  20560. new r(i);
  20561. n.prototype = Object.create(o.prototype),
  20562. n.prototype.isPano = function() {
  20563. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  20564. }
  20565. ,
  20566. t.exports = n
  20567. }
  20568. ).call(this, "/js/objects/Snapshot.js")
  20569. }
  20570. , {
  20571. "../enum/Viewmode": 51,
  20572. "../settings": 166,
  20573. "../util/ajax": 181,
  20574. "../util/common": 185,
  20575. "../util/lerp": 188,
  20576. "../util/logger": 189,
  20577. "../util/texture": 194,
  20578. "../util/transitions": 195,
  20579. "./View": 154,
  20580. events: 202,
  20581. three: 217
  20582. }],
  20583. 154: [function(e, t, i) {
  20584. (function(i) {
  20585. "use strict";
  20586. function n(e) {
  20587. e = e || {},
  20588. this.position = new r.Vector3,
  20589. this.quaternion = new r.Quaternion,
  20590. this.update(e)
  20591. }
  20592. var r = e("three")
  20593. , o = e("../util/logger")
  20594. , a = (e("../settings"),
  20595. e("../enum/Viewmode"),
  20596. e("../util/common"),
  20597. e("../util/transitions"),
  20598. e("../util/lerp"),
  20599. e("../util/ajax"),
  20600. e("../util/texture"),
  20601. e("events").EventEmitter);
  20602. new o(i);
  20603. n.prototype = Object.create(a.prototype),
  20604. n.prototype.isValid = function() {
  20605. return !!this.cameraMode
  20606. }
  20607. ,
  20608. n.prototype.update = function(e) {
  20609. return this.cameraMode = e.cameraMode || this.cameraMode,
  20610. this.pano = e.pano || this.pano,
  20611. e.position && this.position.copy(e.position),
  20612. e.quaternion && this.quaternion.copy(e.quaternion),
  20613. this
  20614. }
  20615. ,
  20616. t.exports = n
  20617. }
  20618. ).call(this, "/js/objects/View.js")
  20619. }
  20620. , {
  20621. "../enum/Viewmode": 51,
  20622. "../settings": 166,
  20623. "../util/ajax": 181,
  20624. "../util/common": 185,
  20625. "../util/lerp": 188,
  20626. "../util/logger": 189,
  20627. "../util/texture": 194,
  20628. "../util/transitions": 195,
  20629. events: 202,
  20630. three: 217
  20631. }],
  20632. 155: [function(e, t, i) {//player.js
  20633. (function(i) {
  20634. "use strict";
  20635. function n(e) {
  20636. this.currentPano = null,
  20637. this.nextPano = null,
  20638. this.camera = null,
  20639. this.paused = !1,
  20640. this.flying = !1,
  20641. this.sceneIntersectionPlane = null,
  20642. this.target = new r.Vector3,
  20643. this.mouse = new r.Vector3(1.1,1.1,.5),
  20644. this.mouseAtMouseDown = new r.Vector2,
  20645. this.mouseCouldBeClickToMove = !1,
  20646. this.mouseLastMoveTime = Date.now(),
  20647. this.mouseDown = !1,
  20648. this.mouseDownTimer = null,
  20649. this.couldBeLongTap = !1,
  20650. this.containsMouse = !0,
  20651. this.isTouchEvent = !1,
  20652. this.isPanoHover = !1,
  20653. this.reticule = new a(this),
  20654. this.panoMarkers = [],
  20655. this.spider = new h(this),
  20656. this.quaternion = new r.Quaternion,
  20657. this.position = new r.Vector3(15,10,15),
  20658. this.previousState = null,
  20659. this.lastInsideView = new c,
  20660. this.last360View = new c,
  20661. this.raycaster = new r.Raycaster,
  20662. this.intersect = null,
  20663. this.lastChangeTime = Date.now(),
  20664. this.history = new I,
  20665. this.cameraControls = null,
  20666. this.path = null,
  20667. this.model = null,
  20668. this.domElement = null,
  20669. this.cachedPanoCandidates = null,
  20670. this.basePanoSize = 0,
  20671. this.standardPanoSize = 0,
  20672. this.highPanoSize = 0,
  20673. this.ultraHighPanoSize = 0,
  20674. this.zoomLevel = 1,
  20675. this.zooming = 0,
  20676. this.zoomSpeed = .5,
  20677. this.scrollZoomSpeed = .06,
  20678. this.zoomSpeedAdjust = .05,
  20679. this.defaultZoomIncrement = .2,
  20680. this.baseFov = f.insideFOV,
  20681. this.zoomFov = this.baseFov,
  20682. this.zoomEnabled = !0,
  20683. this.preRenderingEnabled = !1,
  20684. this.setupCustomProperties(e),
  20685. this.zoomStats = new L
  20686. }
  20687. var r = e("three")
  20688. , o = e("./util/logger")
  20689. , a = e("./objects/Reticule")
  20690. , s = e("./objects/Panorama")
  20691. , l = e("./objects/ShowPath")
  20692. , c = e("./objects/View")
  20693. , h = (e("./objects/Snapshot"),
  20694. e("./objects/NSpider"))
  20695. , u = e("./enum/Viewmode")
  20696. , d = (e("./enum/TagStates"),
  20697. e("./enum/Vectors"))
  20698. , p = e("./enum/Keys")
  20699. , f = (e("./enum/AlignmentType"),
  20700. e("./settings"))
  20701. , g = e("./util/common")
  20702. , m = (e("./util/browser"),
  20703. e("./util/math"))
  20704. , v = e("./util/lerp")
  20705. , A = e("./util/easing")
  20706. , y = e("./util/transitions")
  20707. , C = e("events").EventEmitter
  20708. , I = (e("./shaders"),
  20709. e("./util/history"))
  20710. , E = (e("./util/camera"),
  20711. e("./model/ModelManager"),
  20712. e("./enum/PathDiscardMode"))
  20713. , b = e("./enum/PathDisplayMode")
  20714. , w = e("./enum/PlayerEvents")
  20715. , _ = e("./enum/ControlEvents")
  20716. , T = e("./enum/ModelManagerEvents")
  20717. , x = e("./enum/WarpStyle")
  20718. , S = e("./enum/BlackoutStyle")
  20719. , M = e("./exception/BasicException")
  20720. , R = e("./enum/PanoSizeClass")
  20721. , P = (e("./tile/TileDownloader"),
  20722. e("./tile/TilePrioritizer"))
  20723. , O = (e("./enum/PanoramaEvents"),
  20724. e("./enum/ZoomEvents"))
  20725. , L = e("./util/ZoomStats")
  20726. , D = e("./constants")
  20727. , N = e("./util/common")
  20728. , B = e("./util/cameraLight")
  20729. , Hot = e('hot')
  20730. , F = new o(i)
  20731. , V = Object.freeze({
  20732. FlyToPano: y.getUniqueId(),
  20733. FlyToNewMode: y.getUniqueId(),
  20734. FlyToSameMode: y.getUniqueId(),
  20735. FlyToViewFloor: y.getUniqueId(),
  20736. LookTransition: y.getUniqueId(),
  20737. ZoomTransition: y.getUniqueId()
  20738. });
  20739. n.prototype = Object.create(C.prototype),
  20740. n.prototype.init = function(e) {
  20741. window.player = this
  20742. this.modelManager = e.modelManager,
  20743. this.tileDownloader = e.tileDownloader,
  20744. this.panoRenderer = e.panoRenderer,
  20745. this.qualityManager = e.qualityManager,
  20746. this.domElement = e.container,
  20747. this.camera = e.camera,
  20748. this.tagManager = e.tagManager,
  20749. this.cameraControls = e.controls,
  20750. this.path = new l(e.director,this,e.controls),
  20751. this.basePanoSize = this.qualityManager.getPanoSize(R.BASE),
  20752. this.standardPanoSize = this.qualityManager.getPanoSize(R.STANDARD),
  20753. this.highPanoSize = this.qualityManager.getPanoSize(R.HIGH),
  20754. this.ultraHighPanoSize = this.qualityManager.getPanoSize(R.ULTRAHIGH),
  20755. this.tileDownloader.processPriorityQueue = !1,
  20756. this.tileDownloader.tilePrioritizer = new P(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  20757. this.bindEvents(e.container),
  20758. this.updateModel()
  20759. }
  20760. //xzw add: 截图
  20761. function dataURLtoBlob(dataurl) {
  20762. var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
  20763. bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
  20764. while(n--){
  20765. u8arr[n] = bstr.charCodeAt(n);
  20766. };
  20767. return new Blob([u8arr], {type:mime});
  20768. }
  20769. n.prototype.screenShot = function(o){
  20770. if(this.flying || this.flyingToTag) return;
  20771. var R = this.sceneRenderer;
  20772. R.updateScreenSize(o);
  20773. for(var i in this.model.panos.index){
  20774. if(!this.model.panos.index[i].marker) continue;
  20775. this.model.panos.index[i].marker.forceHide = this.model.panos.index[i].marker.visible;
  20776. this.model.panos.index[i].marker.visible = false;
  20777. }
  20778. for(var i in this.model.hots){
  20779. this.model.hots[i].mesh.visible = false;
  20780. }
  20781. this.reticule.visible = false;
  20782. this.reticule.forceUnvisible = true;
  20783. this.path.currentPanoMarker.mesh.visible = false;
  20784. setTimeout(function(){//因resize效用没办法立即生效(原因未知),故而延后
  20785. R.renderer.clear(true,true,true);
  20786. R.renderer.render(R.scene, R.camera);
  20787. var imgData = R.renderer.domElement.toDataURL(o.type,0.9);
  20788. o.f && o.f(imgData)
  20789. R.updateScreenSize({resize:true});
  20790. this.reticule.visible = true;
  20791. for(var i in this.model.hots){
  20792. this.model.hots[i].mesh.visible = true;
  20793. }
  20794. for(var i in this.model.panos.index){
  20795. this.model.panos.index[i].marker.visible = this.model.panos.index[i].marker.forceHide;
  20796. }
  20797. this.path.currentPanoMarker.mesh.visible = true;
  20798. R.renderer.render(R.scene, R.camera);
  20799. }.bind(this),30) //这个数字不能太小
  20800. }
  20801. var scaleImg = e("scaleImg");
  20802. var ResizeImg = function(img, option){
  20803. var img2; //不能直接改img 否则可能触发第二次img.onload
  20804. var compress = function(ratio,type){
  20805. var image = img2 || img;
  20806. var c = document.createElement('canvas');
  20807. c.width = image.width; c.height = image.height;
  20808. var ctx = c.getContext('2d');
  20809. ctx.drawImage(image,0,0,image.width,image.height);
  20810. img2 = scaleImg(ratio/* option.maxSize/oldSize */, c, type/* option.type||"png" */);//最大不能超过0.8M
  20811. }
  20812. var reCom = function(){ //如果有了img2 就只需要img2 否则创造新的img2
  20813. var image = img2 || img;
  20814. var blob = dataURLtoBlob(image.src);
  20815. if(option.maxWeight && blob.size > option.maxWeight){
  20816. compress(option.maxWeight/blob.size, "jpeg")
  20817. blob = dataURLtoBlob(image.src);
  20818. }
  20819. if(!img2){
  20820. img2 = new Image();
  20821. }
  20822. img2.base64Src = image.src;
  20823. img2.src = window.URL.createObjectURL(blob);
  20824. }
  20825. var oldSize = Math.max(img.width, img.height);
  20826. if(option.toType != "png"){//不是非要png的话
  20827. if(option.oldType == "jpeg"){//jpeg先判断尺寸,然后是尺寸
  20828. if(oldSize > option.maxSize){
  20829. compress(option.maxSize/oldSize, "jpeg");
  20830. }
  20831. reCom();
  20832. }else if(option.oldType == "png"){//png先判断数据量 如果数据量达标,就无视大小(有可能超出大小)
  20833. if(option.maxWeight && option.weight > option.maxWeight){//如果一开始大小不大就不压缩 还是png
  20834. compress(oldSize>option.maxSize ? option.maxSize/oldSize : 1, "jpeg");
  20835. reCom();
  20836. }
  20837. }
  20838. }else{
  20839. //?貌似png会越压缩越大?
  20840. }
  20841. return img2 || img;
  20842. }
  20843. var _fixType=function(type) {
  20844. type = type.toLowerCase().replace(/jpg/i, 'jpeg');
  20845. var r = type.match(/png|jpeg|bmp|gif/)[0];
  20846. return 'image/' + r;
  20847. };
  20848. var saveFile=function(data, filename){
  20849. var save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
  20850. save_link.href = data;
  20851. save_link.download = filename;
  20852. var event = document.createEvent('MouseEvents');
  20853. event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  20854. save_link.dispatchEvent(event);
  20855. };
  20856. n.prototype.getWrapShot = function(){ //获取导览点截图/初始画面和信息
  20857. var info = this.getSnapAngleInfo();
  20858. var str = ',{\r\t' + info;
  20859. var arg = arguments[0];
  20860. this.screenShot({ width:g_snapShotWidth*4, height:g_snapShotHeight*4, type:"image/jpeg", f:function(imgData){
  20861. if (arg && arg.__callback) {
  20862. return arg.__callback(imgData, info)
  20863. }
  20864. var img = new Image();
  20865. img.src = imgData;
  20866. img.onload = function(){
  20867. var img2 = ResizeImg(this,{maxSize: g_snapShotWidth, oldType:"jpeg"}); //暂定缩略图大小
  20868. img2.src.replace(_fixType("image/jpeg"),'image/octet-stream');
  20869. var filename = "snap" + (new Date()).getTime();
  20870. saveFile(img2.src,filename + ".jpg");
  20871. str +=(',\r\t"thumbnail_signed_src":"'+filename+'.jpg",');
  20872. str +=('\r\t"sid":"'+filename+'",');
  20873. str +=('\r\t"name":"'+filename+'"\r}');
  20874. logData(str)
  20875. }
  20876. }});
  20877. }
  20878. ,
  20879. n.prototype.getSnapAngleInfo = function(){
  20880. var info = {};
  20881. var str = '"metadata":{';
  20882. var q = this.camera.quaternion.clone();
  20883. switch (this.mode) {
  20884. case "panorama":
  20885. info.scan_id = this.currentPano.id;
  20886. str += ('"scan_id":"'+this.currentPano.id+'",');
  20887. break;
  20888. case "floorplan":
  20889. info.camera_mode = 1;
  20890. q = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  20891. q.multiply(this.camera.quaternion);
  20892. str += ('"camera_mode":1,');
  20893. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  20894. str += ('"ortho_zoom":'+ m.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  20895. break;
  20896. case "dollhouse":
  20897. info.camera_mode = 2;
  20898. str += ('"camera_mode":2,');
  20899. break;
  20900. }
  20901. info.camera_position = m.toPrecision(this.camera.position.toArray(),4);
  20902. console.log(info.camera_position)
  20903. if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的
  20904. /**fyz 对相机截屏的角度进行校对 */
  20905. var out = new r.Quaternion(q.x, q.y, q.z, q.w)
  20906. out.multiply(new r.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  20907. out.x *= -1;
  20908. out.w *= -1;
  20909. info.camera_quaternion = m.toPrecision(out.toArray(),4);
  20910. }else{
  20911. info.camera_quaternion = m.toPrecision(q.toArray(),4);;
  20912. }
  20913. info.zoom = this.zoomLevel;
  20914. console.log(info.camera_quaternion)
  20915. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  20916. // fyz 扩展编辑页面, 加上导览点缩放值
  20917. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  20918. return str;
  20919. }
  20920. //------end
  20921. n.prototype.closePopup = function() {//xzw 关闭热点页面
  20922. if(!g_currentHot) return;
  20923. g_currentHot = null;
  20924. var hotPop = document.getElementById('popup');
  20925. hotPop.style.display = "none";
  20926. document.querySelector(".popup-content").removeChild(document.getElementById("id1"));
  20927. $("#popup iframe:last").remove();
  20928. var _bgaudio = document.getElementById("bgaudio");
  20929. //判断音乐是否暂停或者是否存在
  20930. /* if(g_bgAudio && g_bgAudio.paused && g_bgAudio.readyState != 0 && g_play === 1)
  20931. {
  20932. //g_bgAudio.play();
  20933. manage.switchBgmState(true)
  20934. }; */
  20935. if(g_bgAudio && g_bgAudio.pauseByHot){
  20936. manage.switchBgmState(true)
  20937. }
  20938. //$('#player').off("click",this.closePopup);
  20939. return false
  20940. }
  20941. n.prototype.setupCustomProperties = function(e) {
  20942. var t = e || u.PANORAMA;
  20943. Object.defineProperty(this, "mode", {
  20944. get: function() {
  20945. return t
  20946. },
  20947. set: function(e) {
  20948. var i = t;
  20949. t = e,
  20950. this.onModeUpdated(i, t)
  20951. }
  20952. })
  20953. }
  20954. ,
  20955. n.prototype.isInMode = function() {
  20956. for (var e = 0; e < arguments.length; e++)
  20957. if (this.mode === arguments[e])
  20958. return !0;
  20959. return !1
  20960. }
  20961. ,
  20962. n.prototype.isOutsideMode = function(e) {
  20963. return e = e || this.mode,
  20964. e === u.DOLLHOUSE || e === u.FLOORPLAN
  20965. }
  20966. ,
  20967. n.prototype.is360View = function(e, t) {
  20968. return e === u.PANORAMA && t && !t.isAligned()
  20969. }
  20970. ,
  20971. n.prototype.setScene = function(e) {
  20972. this.sceneIntersectionPlane = e.plane,
  20973. this.path.setScene(e),
  20974. this.moveReticuleToScene(e)
  20975. }
  20976. ,
  20977. n.prototype.moveReticuleToScene = function(e) {
  20978. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  20979. e.add(this.reticule)
  20980. }
  20981. ,
  20982. n.prototype.updateModel = function() {
  20983. function e(e, t, n) {
  20984. this.mode === u.DOLLHOUSE && e !== n && i.call(this, e.center.y)
  20985. }
  20986. function t(e, t) {
  20987. if (this.mode === u.DOLLHOUSE) {
  20988. var n = e ? this.model.center.y : n = t.center.y;
  20989. i.call(this, n)
  20990. }
  20991. }
  20992. function i(e) {
  20993. var t = this.cameraControls.cameras[u.DOLLHOUSE]
  20994. , i = this.cameraControls.controls[u.DOLLHOUSE]
  20995. , n = t.position.y + (e - i.target.y)
  20996. , r = f.showFloorDuration + f.showFloorDelay;
  20997. y.start(v.property(i.target, "y", e), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor),
  20998. y.start(v.property(t.position, "y", n), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor)
  20999. }
  21000. this.model = this.modelManager.getActiveModel(),
  21001. this.model.on("floor.changed", e.bind(this)),
  21002. this.model.on("allfloors.toggled", t.bind(this)),
  21003. this.on(w.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  21004. /*******************************************************************VR fyz改 from徐世廷*******************************************************************/
  21005. var e2 = this;
  21006. this.model.panos.list.forEach(function(a) {
  21007. a.vrMarker.addEventListener("click", function() {
  21008. e2.flyToPano({
  21009. pano: a
  21010. })
  21011. })
  21012. })
  21013. /********************************************************************************************************************************************/
  21014. }
  21015. ,
  21016. n.prototype.updateModelDependentData = function() {
  21017. this.cameraControls.setModelForControls(this.model),
  21018. this.getPanoMarkersFromModel(this.model)
  21019. }
  21020. ,
  21021. n.prototype.onModelChanged = function() {
  21022. this.updateModel(),
  21023. this.updateModelDependentData()
  21024. }
  21025. ,
  21026. n.prototype.getPanoMarkersFromModel = function(e) {
  21027. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  21028. return t.marker ? e.concat(t.marker) : e
  21029. }, [])
  21030. }
  21031. ,
  21032. n.prototype.handleControlMove = function(e) {
  21033. this.emit(w.Move, e)
  21034. }
  21035. ,
  21036. n.prototype.handleControlInputStart = function(e) {
  21037. this.emit(w.InputStart, e)
  21038. }
  21039. ,
  21040. n.prototype.onModeUpdated = function(e, t) {
  21041. this.cameraControls.activateControls(t),
  21042. this.emit(w.ModeChanged, e, t)
  21043. }
  21044. ,
  21045. n.prototype.isWarping = function() {
  21046. return this.path.warping
  21047. }
  21048. ,
  21049. n.prototype.isWaitingToWarp = function() {
  21050. return this.path.waitingToWarp
  21051. }
  21052. ,
  21053. n.prototype.getLabelScaleFactor = function() {
  21054. if (this.isOutsideMode()) {
  21055. var e = 10
  21056. , t = Math.sqrt(this.cameraControls.controls[u.FLOORPLAN].currentScale / e);
  21057. return t
  21058. }
  21059. return .5
  21060. }
  21061. ,
  21062. n.prototype.changeMusic = function() {//xzw add
  21063. /* if(!this.director.tourIsPlaying && g_play && g_bgAudio){
  21064. g_playAudio = g_bgAudio;
  21065. //g_bgAudio.play();
  21066. manage.switchBgmState(true)
  21067. }else{
  21068. if(!g_play){
  21069. g_playAudio = g_bgAudio;
  21070. }else{//防止再次播放时重播一遍
  21071. g_playAudio = null;
  21072. }
  21073. } */
  21074. /* if(!this.director.tourIsPlaying && g_bgAudio){
  21075. manage.switchBgmState(true)
  21076. } */
  21077. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  21078. }
  21079. ,
  21080. n.prototype.bindEvents = function(e) {
  21081. e !== document && e.setAttribute("tabindex", -1),
  21082. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  21083. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  21084. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  21085. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  21086. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  21087. this.modelManager.on(T.ActiveModelChanged, this.onModelChanged.bind(this)),
  21088. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  21089. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  21090. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  21091. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  21092. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  21093. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  21094. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  21095. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  21096. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  21097. this.cameraControls.on(_.Move, this.handleControlMove.bind(this)),
  21098. this.cameraControls.on(_.InputStart, this.handleControlInputStart.bind(this)),
  21099. this.cameraControls.on(_.Pinch, this.handleControlPinch.bind(this)),
  21100. this.cameraControls.on(_.Scroll, this.handleControlScroll.bind(this)),
  21101. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),//xzw add
  21102. window.addEventListener("tourAudioEnded", this.changeMusic.bind(this));//xzw add
  21103. // lzb
  21104. window.getSeft && getSeft(this);
  21105. //判断是否是移动端,如果是给关闭按钮添加touchstart事件
  21106. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  21107. $('#closepop').on("touchstart",this.closePopup.bind(this));
  21108. }else{
  21109. $('#closepop').on("click",this.closePopup.bind(this));
  21110. }
  21111. }
  21112. ,
  21113. n.prototype.onMouseDown = function(e) {
  21114. e.currentTarget !== document && e.currentTarget.focus(),
  21115. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  21116. this.updateIntersect())
  21117. }
  21118. ,
  21119. n.prototype.onMouseMove = function(e) {
  21120. this.isTouchEvent = !1,
  21121. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  21122. }
  21123. ,
  21124. n.prototype.onMouseOver = function(e) {
  21125. this.containsMouse = !0,
  21126. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  21127. }
  21128. ,
  21129. n.prototype.onMouseOut = function(e) {
  21130. this.containsMouse = !1
  21131. }
  21132. ,
  21133. n.prototype.onMouseUp = function(e) {
  21134. this.handleInputEnd.call(this, e.clientX, e.clientY, !1);
  21135. }
  21136. ,
  21137. n.prototype.onTouchStart = function(e) {
  21138. if (e.currentTarget !== document && e.currentTarget.focus(),
  21139. !this.mouseDown) {
  21140. this.couldBeLongTap = !0;
  21141. var t = g.average(e.changedTouches, "clientX")
  21142. , i = g.average(e.changedTouches, "clientY");
  21143. this.handleInputStart.call(this, t, i, !0),
  21144. this.mouseDownTimer = setTimeout(function() {
  21145. this.updateIntersect(),
  21146. this.handleInputEnd.call(this, t, i, !0)
  21147. }
  21148. .bind(this), f.input.longTapThreshold)
  21149. }
  21150. }
  21151. ,
  21152. n.prototype.onTouchMove = function(e) {
  21153. var t = g.average(e.changedTouches, "clientX")
  21154. , i = g.average(e.changedTouches, "clientY");
  21155. this.handleInputMove.call(this, t, i, !0)
  21156. }
  21157. ,
  21158. n.prototype.onTouchEnd = function(e) {
  21159. if (clearTimeout(this.mouseDownTimer),
  21160. this.mouseDown) {
  21161. this.couldBeLongTap = !1,
  21162. this.updateIntersect();
  21163. var t = g.average(e.changedTouches, "clientX")
  21164. , i = g.average(e.changedTouches, "clientY");
  21165. this.handleInputEnd.call(this, t, i, !0)
  21166. }
  21167. }
  21168. ,
  21169. n.prototype.onPointerDown = function(e) {
  21170. return e.currentTarget !== document && e.currentTarget.focus(),
  21171. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  21172. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  21173. void (this.mouseDownTimer = setTimeout(function() {
  21174. this.updateIntersect(),
  21175. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  21176. }
  21177. .bind(this), f.input.longTapThreshold)))
  21178. }
  21179. ,
  21180. n.prototype.onPointerMove = function(e) {
  21181. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  21182. }
  21183. ,
  21184. n.prototype.onPointerUp = function(e) {
  21185. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  21186. this.couldBeLongTap = !1,
  21187. this.updateIntersect(),
  21188. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  21189. }
  21190. ,
  21191. n.prototype.onPointerOut = function(e) {
  21192. this.mouseDown = !1
  21193. }
  21194. ,
  21195. n.prototype.onPointerCancel = function(e) {
  21196. this.mouseDown = !1
  21197. }
  21198. ,
  21199. n.prototype.onKeyDown = function(e) {
  21200. var t = function() {
  21201. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, "key")
  21202. }
  21203. .bind(this)
  21204. , i = e.which;
  21205. switch (i) {
  21206. case p.F:
  21207. t(),
  21208. this.changeFloor(-1);
  21209. break;
  21210. case p.R:
  21211. t(),
  21212. this.changeFloor(1)
  21213. }
  21214. if (this.mode === u.PANORAMA)
  21215. switch (i) {
  21216. case p.UPARROW:
  21217. case p.W:
  21218. this.flyLocalDirection(d.FORWARD.clone());
  21219. break;
  21220. case p.DOWNARROW:
  21221. case p.S:
  21222. this.flyLocalDirection(d.BACK.clone());
  21223. break;
  21224. case p.A:
  21225. this.flyLocalDirection(d.LEFT.clone());
  21226. break;
  21227. case p.D:
  21228. this.flyLocalDirection(d.RIGHT.clone())
  21229. }
  21230. }
  21231. ,
  21232. n.prototype.handleScrollPinchZoom = function() {
  21233. return function(e) {
  21234. var t = e
  21235. , i = this.zoomLevel;
  21236. this.zoomBy(t),
  21237. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  21238. }
  21239. }(),
  21240. n.prototype.handleControlPinch = function(e) {
  21241. f.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new r.Vector3(0,0,e).normalize())
  21242. }
  21243. ,
  21244. n.prototype.handleControlScroll = function(e) {
  21245. f.zoom.enabled ? (e > 0 ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  21246. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new r.Vector3(0,0,-e).normalize())
  21247. }
  21248. ,
  21249. n.prototype.handleInputStart = function(e, t, i) {
  21250. //许钟文加
  21251. var pad = this.handelPadding(e, t);
  21252. e = pad.x;
  21253. t = pad.y;
  21254. this.isTouchEvent = i,
  21255. m.convertScreenPositionToNDC(e, t, this.mouse),
  21256. m.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  21257. this.mouseCouldBeClickToMove = !0,
  21258. this.mouseDown = !0;
  21259. if (this.mouseCouldBeClickToMove) {
  21260. //window.DownInterface && new DownInterface().state(this,Hot);
  21261. window.Hotpoint && new Hotpoint().state(this,Hot);
  21262. }
  21263. if(!this.overlayInitedPlay /* && !settings.isEdit */ && this.overlayGroup.children.length){
  21264. this.overlayGroup.children.forEach((overlay)=>{overlay.plane.material.map.image.play()})
  21265. this.overlayInitedPlay = true
  21266. }
  21267. }
  21268. ,
  21269. n.prototype.handelPadding = function(x, y) {
  21270. //去除player左边和上面的宽高,因为pc的player左上有其他element 许钟文
  21271. if (!this.pad)
  21272. this.pad = {
  21273. x: dom.getOffset("left", $("#player")[0]),
  21274. y: dom.getOffset("top", $("#player")[0])
  21275. }
  21276. return {
  21277. x: x - this.pad.x,
  21278. y: y - this.pad.y
  21279. }
  21280. }
  21281. n.prototype.handleInputMove = function(e, t, i) {
  21282. //许钟文加
  21283. var pad = this.handelPadding(e, t);
  21284. e = pad.x;
  21285. t = pad.y;
  21286. this.isTouchEvent = i,
  21287. m.convertScreenPositionToNDC(e, t, this.mouse),
  21288. this.mouseAtMouseDown.distanceTo(this.mouse) > f.input.moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  21289. this.couldBeLongTap = !1,
  21290. clearTimeout(this.mouseDownTimer)),
  21291. this.mouseLastMoveTime = Date.now(),
  21292. this.reticule.move(e, t, i)
  21293. }
  21294. ,
  21295. n.prototype.handleInputEnd = function(e, t, i) {//xzw
  21296. if (this.isTouchEvent = i,
  21297. this.mouseDown = !1,
  21298. this.cameraControls.controls[u.PANORAMA].emit("interaction.direct"),
  21299. !i && this.couldBeLongTap)
  21300. return !0;
  21301. if (this.handleLongTap())
  21302. return !0;
  21303. if (this.mouseCouldBeClickToMove) {
  21304. if (this.flying)
  21305. return this.path.activeTransType === x.WALK && this.emit(w.WarpInterruptedWithFlyTo, this.path.activeTransType),
  21306. !0;
  21307. //add----
  21308. if(this.hoveringPlane){
  21309. this.clickOverlay(this.hoveringPlane)
  21310. return;
  21311. }
  21312. if(this.checkHotClick())//add
  21313. return !0;
  21314. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, this.isTouchEvent ? "touch" : "mouse"),
  21315. this.history.invalidate(),
  21316. this.intersect)
  21317. return this.flyToPanoClosestToMouse();
  21318. if (this.mode === u.PANORAMA) {
  21319. var n = this.closestPanoInDirection(this.getMouseDirection());
  21320. return n ? this.flyToPano({
  21321. pano: n
  21322. }) : this.bump(this.getMouseDirection())
  21323. }
  21324. }
  21325. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  21326. }
  21327. ,
  21328. n.prototype.handleLongTap = function() {
  21329. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== u.PANORAMA))
  21330. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.LongTap, "touch"),
  21331. !0
  21332. }
  21333. ,
  21334. n.prototype.checktagClick = function() {
  21335. if (this.tagManager.intersectTag) {
  21336. var e = this.isTouchEvent
  21337. , t = this.tagManager.clickedOnTag(e, this);
  21338. return e || t || y.cancelById(V.LookTransition),
  21339. !0
  21340. }
  21341. if (this.tagManager.activeTag)
  21342. return this.tagManager.dismissActiveTag(),
  21343. !1
  21344. }
  21345. ,
  21346. n.prototype.rankedtagInDirection = function(e, t) {
  21347. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  21348. }
  21349. ,
  21350. n.prototype.start = function(e) {
  21351. //-------------------
  21352. window.initOverlay(r)
  21353. this.model.loadOverlays()
  21354. //-------------------
  21355. var t = e.mode
  21356. , i = e.pano
  21357. , n = e.position
  21358. , rr = e.quaternion
  21359. , o = e.tag
  21360. , a = e.quickstart
  21361. , s = $.Deferred();
  21362. this.updateModelDependentData(),
  21363. this.updateFromControls(),
  21364. this.findDefaultViews();
  21365. var l = this.is360View(t, i);
  21366. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, rr, o, s) : this.startOutside(e, s),
  21367. s.done(function(e) {
  21368. this.emit(w.Ready, l, e, o)
  21369. }
  21370. .bind(this)),
  21371. s.promise()
  21372. }
  21373. ,
  21374. n.prototype.startOutside = function(e, t) {
  21375. var i = e.mode
  21376. , n = e.pano
  21377. , r = e.position
  21378. , o = e.quaternion
  21379. , a = e.zoom
  21380. , s = e.floorVisibility
  21381. , l = e.tag;
  21382. this.emit(w.StartOutside, f[i].transitionTime),
  21383. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  21384. y.cancelById(V.FlyToViewFloor),
  21385. i === u.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  21386. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  21387. }
  21388. ,
  21389. n.prototype.startInside = function(e, t, i, n, r) {
  21390. r = r || $.Deferred(),
  21391. this.currentPano = e;
  21392. var o = e && !e.isAligned();
  21393. if (t = o ? e.position : t || e.position,
  21394. i = i || e.quaternion,
  21395. e) {
  21396. var a = this.startInside.bind(this, e, t, i, n, r);
  21397. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  21398. return
  21399. }
  21400. return this.mode = u.PANORAMA,
  21401. e.floor.enter(this.mode),
  21402. this.emit(w.PanoChosen, this.currentPano, this.currentPano),
  21403. this.switchCameraMode(this.mode, i),
  21404. this.emit(w.StartInside, o),
  21405. r.resolve(!0),
  21406. r
  21407. }
  21408. ,
  21409. n.prototype.startInsideWithFlyin = function(e, t, i, n, r) {
  21410. if (r = r || $.Deferred(),
  21411. this.dollhouseMode(),
  21412. !e)
  21413. return F.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  21414. r.resolve(!1),
  21415. r;
  21416. t = t || e.position;
  21417. var o = i || this.cameraControls.activeControl.camera.quaternion
  21418. , a = e.position;
  21419. return this.fitDollhouse(a, t, o),
  21420. setTimeout(function(t) {
  21421. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = t);
  21422. var n = {
  21423. mode: u.PANORAMA,
  21424. pano: e,
  21425. quaternion: i,
  21426. callback: function() {
  21427. this.emit(w.FlyinFinished),
  21428. r.resolve(!0)
  21429. }
  21430. .bind(this)
  21431. };
  21432. this.flyToNewMode(n)
  21433. }.bind(this, this.cameraControls.activeControl.maxDistance), f.startupFlyinDelay),
  21434. r
  21435. }
  21436. ,
  21437. n.prototype.checkAndWaitForPanoLoad = function() {
  21438. var e = {}
  21439. , t = {}
  21440. , i = 5e3
  21441. , n = function() {
  21442. for (var n in e)
  21443. if (e.hasOwnProperty(n) && e[n]) {
  21444. var r = performance.now() - t[n];
  21445. if (r < i)
  21446. return !0
  21447. }
  21448. return !1
  21449. };
  21450. return function(r, o, a, s, l, c, h, u, d, p) {
  21451. if (n())
  21452. return !0;
  21453. var f = function(t, i, n) {
  21454. N.delayOneFrame(function() {
  21455. e[t] = !1,
  21456. l && l(i, n)
  21457. }
  21458. .bind(this))
  21459. }
  21460. .bind(this, r.id)
  21461. , g = function(t, i) {
  21462. N.delayOneFrame(function() {
  21463. e[t] = !1,
  21464. c && c(i)
  21465. }
  21466. .bind(this))
  21467. }
  21468. .bind(this, r.id);
  21469. try {
  21470. return null !== u && void 0 !== u || (u = !0),
  21471. this.model.supportsTiles ? e[r.id] = this.checkAndWaitForTiledPanoLoad(r, s, f, g, h, u, d, p) : e[r.id] = this.checkAndWaitForWholePanoLoad(r, o, a, f, u),
  21472. e[r.id] && (t[r.id] = performance.now()),
  21473. e[r.id]
  21474. } catch (n) {
  21475. throw e[r.id] = !1,
  21476. t[r.id] = performance.now() - i,
  21477. n
  21478. }
  21479. }
  21480. }(),
  21481. n.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  21482. if (!e)
  21483. throw new M("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  21484. return r && this.model.waitForLoad(e, function() {
  21485. return e.isLoaded(i)
  21486. }),
  21487. !e.isLoaded(t) && (e.loadCube(t).done(n),
  21488. !0)
  21489. }
  21490. ,
  21491. n.prototype.checkAndWaitForTiledPanoLoad = function() {
  21492. var e = new r.Vector3;
  21493. return function(t, i, n, r, o, a, s, l) {
  21494. if (!t)
  21495. throw new M("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  21496. return e.copy(d.FORWARD),
  21497. this.getDirection(e),
  21498. !t.isLoaded(i) && (a && this.model.waitForLoad(t, function() {
  21499. return t.isLoaded(i)
  21500. }),
  21501. t.loadTiledPano(i, e, null, s, l).done(function(e, t) {
  21502. n && n(e, t)
  21503. }
  21504. .bind(this)).fail(function(e) {
  21505. r && r(e)
  21506. }
  21507. .bind(this)).progress(function(e, t, i) {
  21508. o && o(e, t, i)
  21509. }
  21510. .bind(this)),
  21511. !0)
  21512. }
  21513. }(),
  21514. n.prototype.switchCameraMode = function(e, t) {
  21515. var i = this.cameraControls.controls[e]
  21516. , n = i.camera;
  21517. switch (e) {
  21518. case u.PANORAMA:
  21519. n.position.copy(this.currentPano.position);
  21520. var o = t ? d.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  21521. i.lookAt(o.add(n.position));
  21522. break;
  21523. case u.DOLLHOUSE:
  21524. var a = this.position.clone();
  21525. this.mode === u.PANORAMA ? a.add(new r.Vector3(0,6,0)).add(this.getDirection().multiplyScalar(-10)) : a.add(d.DOWN.clone().applyQuaternion(this.quaternion).multiplyScalar(6)).setY(6),
  21526. n.position.copy(a),
  21527. i.target.copy(this.target.clone().setY(this.model.center.y));
  21528. break;
  21529. case u.FLOORPLAN:
  21530. n.position.copy(this.model.center).setY(f.floorplan.cameraHeight),
  21531. i.target.copy(this.model.center).setY(0),
  21532. i.zoomToContain(this.model.size),
  21533. i.rotateToView(this.model.size, this.getDirection())
  21534. }
  21535. i.update(0)
  21536. }
  21537. ,
  21538. n.prototype.update = function() {
  21539. var e = (new r.Vector3,
  21540. {})
  21541. , t = [];
  21542. return function(i) {
  21543. this.updatePersistentZooming(i),
  21544. this.updateFromControls(i),
  21545. this.getCurrentNodePanos(t),
  21546. this.hasChanged(e) && (this.lastChangeTime = Date.now(),
  21547. !this.mouseDown && this.containsMouse && this.updateIntersect(),
  21548. this.emit(w.ViewChanged)),
  21549. this.model.supportsTiles && (this.updateTileDownloader(t),
  21550. this.updatePanoRenderer(t)),
  21551. this.updatePreRendering(t),
  21552. this.reticule.update(),
  21553. this.path.update(),
  21554. this.spider.update(),
  21555. this.cachedPanoCandidates && f.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  21556. this.updateControlLocks(),
  21557. this.model.supportsTiles && this.updateZoomPano()
  21558. }
  21559. }(),
  21560. n.prototype.updatePersistentZooming = function(e) {
  21561. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : this.zooming === -1 && this.zoomBy(1 - this.zoomSpeed * e)
  21562. }
  21563. ,
  21564. n.prototype.updateControlLocks = function() {
  21565. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[u.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  21566. }
  21567. ,
  21568. n.prototype.updatePanoRenderer = function() {
  21569. var e = new r.Vector3;
  21570. return function(t) {
  21571. var i = this.nextPano || this.currentPano;
  21572. this.panoRenderer.hasQueuedTiles() && i && (e.copy(d.FORWARD),
  21573. this.getDirection(e),
  21574. this.panoRenderer.updateDirection(e))
  21575. }
  21576. }(),
  21577. n.prototype.cleanupInactivePanos = function() {
  21578. var e = []
  21579. , t = [];
  21580. return function() {
  21581. e.length = 0,
  21582. e.push(this.currentPano),
  21583. this.nextPano && e.push(this.nextPano),
  21584. t.length = 0;
  21585. for (var i = 0; i < this.panoRenderer.activePanos.length; i++)
  21586. t.push(this.panoRenderer.activePanos[i]);
  21587. for (var n = 0; n < t.length; n++) {
  21588. for (var r = t[n], o = !0, a = 0; a < e.length; a++)
  21589. r.id === e[a].id && (o = !1);
  21590. o && r.exit()
  21591. }
  21592. }
  21593. }(),
  21594. n.prototype.updatePreRendering = function() {
  21595. var e = {};
  21596. return function(t) {
  21597. if (1 === f.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  21598. var i = this.nextPano || this.currentPano;
  21599. if (i && t && t.length > 1) {
  21600. var n = t.findIndex(function(e) {
  21601. if (e.id === i.id)
  21602. return !0
  21603. });
  21604. if (n >= 0 && n + 1 < t.length) {
  21605. var r = t[n + 1];
  21606. r.isLoaded(this.basePanoSize) || e[r.id] || (window.setTimeout(function(t) {
  21607. this.checkAndWaitForPanoLoad(t, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  21608. window.setTimeout(function(t) {
  21609. e[t.id] = !1
  21610. }
  21611. .bind(this, t), f.tiling.panoPreRenderRepeatDelay)
  21612. }
  21613. .bind(this, r), f.tiling.panoPreRenderDelay),
  21614. e[r.id] = !0)
  21615. }
  21616. }
  21617. }
  21618. }
  21619. }(),
  21620. n.prototype.enablePreRendering = function() {
  21621. this.preRenderingEnabled = !0
  21622. }
  21623. ,
  21624. n.prototype.disablePreRendering = function() {
  21625. this.preRenderingEnabled = !1,
  21626. this.cleanupInactivePanos()
  21627. }
  21628. ,
  21629. n.prototype.updateTileDownloader = function() {
  21630. var e = new r.Vector3;
  21631. return function(t) {
  21632. var i = this.nextPano || this.currentPano;
  21633. i && (e.copy(d.FORWARD),
  21634. this.getDirection(e),
  21635. this.tileDownloader.tilePrioritizer.updateCriteria(i, this.position, e, t.length > 0 ? t : null),
  21636. this.tileDownloader.processPriorityQueue = !0)
  21637. }
  21638. }(),
  21639. n.prototype.updateFromControls = function(e) {
  21640. null !== e && void 0 !== e || (e = 0),
  21641. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  21642. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  21643. this.position.copy(this.cameraControls.activeControl.camera.position),
  21644. this.target.copy(this.cameraControls.activeControl.target),
  21645. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  21646. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  21647. this.camera.position.copy(this.position),
  21648. this.camera.quaternion.copy(this.quaternion),
  21649. this.camera.updateMatrix(),
  21650. this.camera.updateMatrixWorld()
  21651. }
  21652. ,
  21653. n.prototype.hasChanged = function(e) {
  21654. if (!this.previousState)
  21655. return this.previousState = {
  21656. allFloorsVisible: this.model.allFloorsVisible,
  21657. position: this.position.clone(),
  21658. quaternion: this.quaternion.clone(),
  21659. mouse: this.mouse.clone(),
  21660. labelScaleFactor: this.getLabelScaleFactor(),
  21661. currentFloor: this.model.currentFloor,
  21662. projectionMatrix: this.camera.projectionMatrix.clone(),
  21663. worldMatrix: this.camera.matrixWorld.clone(),
  21664. mode: this.mode,
  21665. modelPosition: this.model.position.clone(),
  21666. modelCenter: this.model.center.clone(),
  21667. zoomLevel: this.zoomLevel
  21668. },
  21669. !0;
  21670. var t = this.model.allFloorsVisible === this.previousState.allFloorsVisible && this.position.equals(this.previousState.position) && this.quaternion.equals(this.previousState.quaternion) && this.mouse.equals(this.previousState.mouse) && this.getLabelScaleFactor() === this.previousState.labelScaleFactor && this.model.currentFloor === this.previousState.currentFloor && this.camera.projectionMatrix.equals(this.previousState.projectionMatrix) && this.camera.matrixWorld.equals(this.previousState.worldMatrix) && this.mode === this.previousState.mode && this.model.position.equals(this.previousState.modelPosition) && this.model.center.equals(this.previousState.modelCenter) && null === this.nextPano && this.zoomLevel === this.previousState.zoomLevel;
  21671. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  21672. e.moved = !this.position.equals(this.previousState.position),
  21673. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  21674. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  21675. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  21676. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  21677. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  21678. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  21679. e.modeChanged = this.mode !== this.previousState.mode,
  21680. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  21681. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  21682. e.nextPanoActive = null !== this.nextPano,
  21683. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  21684. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  21685. this.previousState.position.copy(this.position),
  21686. this.previousState.quaternion.copy(this.quaternion),
  21687. this.previousState.mouse.copy(this.mouse),
  21688. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  21689. this.previousState.currentFloor = this.model.currentFloor,
  21690. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  21691. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  21692. this.previousState.mode = this.mode,
  21693. this.previousState.modelPosition.copy(this.model.position),
  21694. this.previousState.modelCenter.copy(this.model.center),
  21695. this.previousState.zoomLevel = this.zoomLevel,
  21696. !t
  21697. }
  21698. ,
  21699. n.prototype.updateIntersect = function() {
  21700. var e = this.flying || this.isWarping()
  21701. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  21702. , i = y.getById(V.LookTransition)
  21703. , n = !(e || t || this.isTouchEvent || i.length && i[0].running);
  21704. //this.tagManager.intersecttag(this.mouse, n, this.camera) || (this.intersect = this.getMouseIntersect(),//--MP
  21705. this.intersect = this.getMouseIntersect(); //xzw change
  21706. this.intersect && this.updateClosestPano(this.intersect),
  21707. // this.intersect && console.log(this.intersect.point),
  21708. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  21709. f.navigation.panoScores && !f.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  21710. }
  21711. ,
  21712. n.prototype.checkHotClick = function() {
  21713. if(this.intersectHot){
  21714. this.intersectHot.examine(this);
  21715. /* g_touraudio.pause();
  21716. g_bgaudio = false;
  21717. document.getElementById("bgaudio").pause();
  21718. var sWidth = document.body.scrollWidth;
  21719. var sHeight = document.body.scrollHeight;
  21720. var pop1 = document.getElementById('popup');
  21721. pop1.style.display = "block";
  21722. var myElement = document.createElement("iframe");
  21723. myElement.src = g_HotMeshes[i].hotLink;
  21724. myElement.id = "id1";
  21725. myElement.allowTransparency = "true";
  21726. myElement.style.width = "100%";
  21727. myElement.style.height = "100%";
  21728. myElement.scrolling = "no";
  21729. var element=document.getElementById("id1");
  21730. if (typeof(element)== "undefined" || element == null){
  21731. document.getElementById("popup").appendChild(myElement);
  21732. }
  21733. var oClose = document.getElementById("closepop");
  21734. oClose.onclick = function() {
  21735. pop1.style.display = "none";
  21736. document.getElementById("popup").removeChild(document.getElementById("id1"));
  21737. $("#popup iframe:last").remove();
  21738. document.getElementById("bgaudio").play();
  21739. } */
  21740. return true;
  21741. }
  21742. },
  21743. n.prototype.getMouseDirection = function(e) {
  21744. e = e || this.mouse;
  21745. var t = new r.Vector3(e.x,e.y,-1).unproject(this.camera)
  21746. , i = new r.Vector3(e.x,e.y,1).unproject(this.camera);
  21747. return i.sub(t).normalize()
  21748. }
  21749. ,
  21750. n.prototype.hoverOverlay = function(mesh){
  21751. if(!mesh){
  21752. this.hoveringPlane = null;
  21753. $("#player").css("cursor",this.currentCursor || "" );
  21754. }else{
  21755. var overlay = mesh.parent;
  21756. $("#player").css("cursor","pointer");
  21757. this.hoveringPlane = overlay;
  21758. return true;
  21759. }
  21760. },
  21761. n.prototype.clickOverlay = function(overlay){
  21762. if(this.openOverlay && !overlay)return;
  21763. var plane = overlay.plane;
  21764. if(overlay.overlayType == "video"){
  21765. if(plane.material.map.image.paused)plane.material.map.image.play()
  21766. else plane.material.map.image.pause();
  21767. }
  21768. /* if(window.EditOverlay &&EditOverlay.editing){
  21769. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  21770. $('#overlayProp').removeClass('atRight').removeClass('hide')
  21771. EditOverlay.endAddPlane();
  21772. EditOverlay.updateOverlayPanel(overlay)
  21773. EditOverlay.controlSelectOverlay(overlay)
  21774. return;
  21775. } */
  21776. },
  21777. n.prototype.getMouseIntersect = function(e, t) {//xzw change
  21778. e = e || this.mouse.clone(),
  21779. t = t || this.model.floors.reduce(function(e, t) {
  21780. return t.hidden ? e : e.concat(t.collider.children)
  21781. }, this.mode === u.PANORAMA ? this.panoMarkers : []);
  21782. for(var i in this.model.hots){
  21783. t.push(this.model.hots[i].mesh);
  21784. }
  21785. this.overlayGroup && (t = t.concat(this.overlayGroup.children));
  21786. var i = new r.Vector3(e.x,e.y,-1).unproject(this.camera);
  21787. this.raycaster.set(i, this.getMouseDirection(e));
  21788. var n = this.raycaster.intersectObjects(t, true);//add true
  21789. // n[0] && console.log(n[0].point);
  21790. if(g_HotStatus=="add"){
  21791. var points = this.raycaster.intersectObjects(window.player.model.chunks);
  21792. console.log(points[0]);
  21793. points.length >= 1? ($('#player').css('cursor', 'cell'),window.hotPointPos = points[0].point): ($('#player').css('cursor', 'not-allowed'), window.hotPointsPos = false)
  21794. }
  21795. if (0 === n.length){
  21796. this.intersectHot = null; //add
  21797. if(g_HotStatus!="add") $("#player").css("cursor","");
  21798. return null;
  21799. }
  21800. var o = n[0];
  21801. if(o.object.type == "hotSprite"){ //add
  21802. this.intersectHot = o.object.belongHot;
  21803. $("#player").css("cursor","pointer");
  21804. return;
  21805. }
  21806. this.intersectHot = null;
  21807. var intersect = this.hoverOverlay(this.overlayGroup && o && o.object.parent.parent == this.overlayGroup && o.object)
  21808. if(!intersect && g_HotStatus!="add") $("#player").css("cursor","");
  21809. if (o.face) {
  21810. o.normal = o.face.normal.applyQuaternion(o.object.quaternion);
  21811. var a = this.position.clone().sub(o.point);
  21812. a.dot(o.normal) < 0 && o.normal.negate(),
  21813. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  21814. o.horizontal = o.normal.y > .8
  21815. }
  21816. // console.log(o.point);
  21817. return o
  21818. }
  21819. ,
  21820. n.prototype.updateClosestPano = function(e) {
  21821. var t = [s.filters.isPanoAligned()];
  21822. if (this.mode === u.PANORAMA) {
  21823. if (!this.currentPano)
  21824. return;
  21825. t.push(s.filters.not(this.currentPano)),
  21826. t.push(s.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  21827. t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  21828. t.push(s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)),
  21829. t.push(s.filters.isNotBehindNormal(e.point, e.normal))
  21830. } else{
  21831. t.push((pano)=>{ // add
  21832. return this.checkHasNeighbor(pano)
  21833. })
  21834. t.push(s.filters.isOnVisibleFloor()),
  21835. this.mode !== u.FLOORPLAN && t.push(s.filters.inDirection(this.position, this.getDirection(), .25));
  21836. }
  21837. var i = this.model.panos.find(t, [s.sortFunctions.floorDistanceToPoint(e.point)]);
  21838. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  21839. this.emit(w.ClosestPanoChanging, this.closestPano, i, this.mode),
  21840. this.closestPano = i) : this.isPanoHover = !1
  21841. }
  21842. ,
  21843. n.prototype.dollhouseMode = function(e, t) {
  21844. this.emit(w.ModeChanging, this.mode, u.DOLLHOUSE),
  21845. this.mode = u.DOLLHOUSE,
  21846. this.cameraControls.controls[u.DOLLHOUSE].reset();
  21847. var i = new r.Vector3(this.model.center.x,0,this.model.center.z)
  21848. , n = new r.Vector3(15,10,15);
  21849. if (e && t) {
  21850. var o = d.FORWARD.clone().applyQuaternion(t)
  21851. , a = this.model.center.clone().sub(e)
  21852. , s = a.dot(o);
  21853. s > 0 ? (i = o.clone().multiplyScalar(s).add(e),
  21854. n.copy(e)) : F.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  21855. }
  21856. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0, !0),
  21857. this.cameraControls.controls[u.DOLLHOUSE].target.copy(i),
  21858. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(n),
  21859. this.updateFromControls(),
  21860. this.model.alpha = 1,
  21861. this.model.skybox.material.uniforms.opacity.value = 0
  21862. }
  21863. ,
  21864. n.prototype.insideMode = function(e, t) {
  21865. var i = $.Deferred()
  21866. , n = t || null;
  21867. if (this.mode !== u.PANORAMA && this.mode !== u.TRANSITIONING) {
  21868. var r = [s.filters.isPanoAligned()];
  21869. this.model.currentFloor && r.push(s.filters.atFloor(this.model.currentFloor)),
  21870. e = e || this.currentPano || this.model.panos.find(r, [s.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  21871. this.flyToNewMode({
  21872. mode: u.PANORAMA,
  21873. pano: e,
  21874. callback: n
  21875. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  21876. } else {
  21877. var o = this.mode === u.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  21878. i.reject(o)
  21879. }
  21880. return i.promise()
  21881. }
  21882. ,
  21883. n.prototype.fitDollhouse = function(e, t, i) {//许钟文改 飞入前寻找和初始视角最合适的位置
  21884. //if(urlHasValue('oldEntry')){
  21885. //搬自一代。
  21886. var n = d.FORWARD.clone().applyQuaternion(i)
  21887. , i = n.clone().add(e);
  21888. this.cameraControls.activeControl.target.copy(i),
  21889. this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(e).add(n.multiplyScalar(-10))
  21890. //return;
  21891. //}//下面是二代代码,看不太懂。因为有的场景在靠近一端的某个方向截取的初始视角会甩镜头,也就是不是下去之后的方向
  21892. //直接用一代的这个 效果和二代几乎一样,且不会甩
  21893. /* var n = d.FORWARD.clone().applyQuaternion(i);
  21894. this.cameraControls.activeControl.target.copy(n).add(e);
  21895. var o = d.RIGHT.clone().applyQuaternion(i)
  21896. , a = d.UP.clone()
  21897. , s = o.clone().applyAxisAngle(a, Math.PI / 2)
  21898. , l = this.model.boundingBox.max.clone()
  21899. , c = this.model.boundingBox.min.clone()
  21900. , h = [new r.Vector3(l.x,0,l.z).sub(e), new r.Vector3(l.x,0,c.z).sub(e), new r.Vector3(c.x,0,l.z).sub(e), new r.Vector3(c.x,0,c.z).sub(e)]
  21901. , u = 0
  21902. , p = 0
  21903. , g = 0;
  21904. h.forEach(function(e, t, i) {
  21905. var n = Math.abs(e.dot(o))
  21906. , r = e.dot(s);
  21907. n > u && (u = n,
  21908. p = r),
  21909. r > g && (g = r)
  21910. });
  21911. var m = Math.max(Math.abs(new r.Vector3(0,l.y,0).sub(e).dot(a)), Math.abs(new r.Vector3(0,c.y,0).sub(e).dot(a)))
  21912. , v = s.clone().multiplyScalar(p).add(t)
  21913. , A = s.clone().multiplyScalar(g).add(t);
  21914. p = u / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * this.cameraControls.activeControl.camera.aspect * (Math.PI / 180));
  21915. g = m / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * (Math.PI / 180));
  21916. p = Math.max(p, 10),
  21917. g = Math.max(g, 10);
  21918. var y = n.clone().multiplyScalar(-p).add(v).sub(t).length()
  21919. , C = n.clone().multiplyScalar(-g).add(v).sub(t).length();
  21920. this.cameraControls.activeControl.maxDistance = f.skyboxRadius - 1;
  21921. y >= C ? this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(v).add(n.multiplyScalar(1.1 * -p))
  21922. : this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(A).add(n.multiplyScalar(1.1 * -g))
  21923. */
  21924. }
  21925. ,
  21926. n.prototype.floorplanMode = function(e, t, i) {
  21927. this.mode = u.FLOORPLAN;
  21928. var n = this.cameraControls.controls[u.FLOORPLAN];
  21929. n.reset();
  21930. var r = e ? e : this.model.center;
  21931. if (n.target.copy(r).setY(0),
  21932. n.camera.position.copy(r).setY(f.floorplan.cameraHeight),
  21933. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  21934. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  21935. t) {
  21936. var o = d.LEFT.clone().applyQuaternion(t);
  21937. n.rotateLeft(-Math.atan2(o.x, o.z))
  21938. } else
  21939. n.rotateToView(this.model.size, this.getDirection());
  21940. n.update(0)
  21941. }
  21942. ,
  21943. n.prototype.nonInterruptingFlyToPano = function(e, t) {
  21944. return e.skipWarpingCheck = !0,
  21945. this.flyToPano(e, t)
  21946. }
  21947. ,
  21948. n.prototype.updateMarkerVisi = function() {//加
  21949. if(this.mode != "panorama")return;
  21950. this.model.panos.list.forEach((pano)=>{
  21951. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  21952. })
  21953. }
  21954. ,
  21955. n.prototype.flyToPano = function(e, t) {
  21956. var i = e.pano
  21957. , n = e.lookAtPoint
  21958. , o = e.duration
  21959. , a = e.aimDuration
  21960. , s = e.maxDistanceOverride
  21961. , l = e.skipWarpingCheck
  21962. , c = e.constantMoveSpeed
  21963. , h = null
  21964. , p = null;
  21965. window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(i);
  21966. if (this.isWarping() && !l && (this.path.activeTransType === x.BLACK || this.path.activeTransType === x.STD))
  21967. return F.warn("Player.flyToPano() -> Cannot fly when warping"),
  21968. t && t(),
  21969. !1;
  21970. if (this.updateLastView(),
  21971. this.mode !== u.PANORAMA) {
  21972. var m;
  21973. return n && (m = (new r.Quaternion).setFromUnitVectors(d.FORWARD, n.sub(i.position).normalize())),
  21974. void this.flyToNewMode({
  21975. mode: u.PANORAMA,
  21976. pano: i,
  21977. duration: o,
  21978. quaternion: m,
  21979. callback: t
  21980. })
  21981. }
  21982. if (!i || (h = g.deepExtend(e),
  21983. p = function() {
  21984. N.delayOneFrame(function() {
  21985. this.flyToPano(h, t)
  21986. }
  21987. .bind(this))
  21988. }
  21989. .bind(this),
  21990. !this.checkAndWaitForPanoLoad(i, "high", "low", this.basePanoSize, p))) {
  21991. var C = function(e) {
  21992. t && t(e)
  21993. }
  21994. .bind(this);
  21995. this.currentPano || (this.currentPano = i,
  21996. this.path.placeCpm(),
  21997. this.path.fadeOutCpm(f.path.fadeOutTime),
  21998. this.spider.draw());
  21999. var I = o;
  22000. if ("number" != typeof o) {
  22001. var E = s || f.transition.flytimeMaxDistanceThreshold;
  22002. I = Math.min(this.currentPano.position.distanceTo(i.position), E) * f.transition.flytimeDistanceMultiplier + f.transition.flyTime
  22003. }
  22004. if (f.transition.flySpeed > .01 && (I = 1e3 * this.currentPano.position.distanceTo(i.position) / f.transition.flySpeed),
  22005. 1 !== this.zoomLevel)
  22006. switch (f.zoom.transitionStyle) {
  22007. case 1:
  22008. this.smoothZoomToDefault(I / 2);
  22009. break;
  22010. case 2:
  22011. return h = g.deepExtend(e),
  22012. p = this.flyToPano.bind(this, h, t),
  22013. void this.smoothZoomToDefault(f.zoom.restoreTime * (this.zoomLevel - 1), p)
  22014. }
  22015. if (n) {
  22016. y.cancelById(V.LookTransition),
  22017. I *= f.transition.aimSlowFactor;
  22018. var b = this.cameraControls.activeControl.camera.quaternion.clone()
  22019. , _ = (new r.Matrix4).lookAt(i.position, n, d.UP)
  22020. , T = (new r.Quaternion).setFromRotationMatrix(_)
  22021. , S = b.clone()
  22022. , M = new r.Vector3;
  22023. if (i === this.currentPano) {
  22024. var R = d.FORWARD.clone().applyQuaternion(b)
  22025. , P = d.FORWARD.clone().applyQuaternion(T)
  22026. , O = R.angleTo(P);
  22027. return void 0 !== a && null !== a || (a = 1 * Math.sqrt(O) / f.tags.navigate.rotateSpeedFactor * 1e3),
  22028. void y.start(function(e) {
  22029. S.copy(b),
  22030. v.quaternion(S, T)(e),
  22031. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  22032. this.cameraControls.activeControl.lookAt(M)
  22033. }
  22034. .bind(this), a, C, 0, A[f.transition.movementEasing], null, V.LookTransition)
  22035. }
  22036. }
  22037. if (i === this.currentPano || this.flying)
  22038. return void C();
  22039. this.flying = !0;
  22040. var L = this.position.clone()
  22041. , D = this.currentPano;
  22042. F.debug("Flying to pano ", i.position),
  22043. this.emit(w.PanoChosen, this.currentPano, i),
  22044. this.emit(w.FlyingStarted, i.position, L, i, D),
  22045. n && y.start(function(e) {
  22046. S.copy(b),
  22047. v.quaternion(S, T)(e),
  22048. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  22049. this.cameraControls.activeControl.lookAt(M)
  22050. }
  22051. .bind(this), I, null, 0, A[f.transition.movementEasing], null, V.LookTransition);
  22052. var B = c ? null : A[f.transition.movementEasing];
  22053. this.nextPano = i,
  22054. y.start(v.uniform(this.model.skybox, "progress", 1), I, null, 0, A[f.transition.blendEasing], "skyFly", V.FlyToPano),
  22055. y.start(v.allUniforms(this.model.chunks, "progress", 1), I, null, 0, A[f.transition.blendEasing], "chunkFly", V.FlyToPano),
  22056. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, i.position), I, function(e) {
  22057. this.flying = !1,
  22058. this.currentPano !== i && this.currentPano.exit(),
  22059. i.enter(),
  22060. this.currentPano = i,
  22061. this.nextPano = null,
  22062. this.path.placeCpm(),
  22063. this.path.fadeOutCpm(f.path.fadeOutTime),
  22064. this.spider.draw(),
  22065. this.emit(w.FlyingEnded, i.position, L, i, D),
  22066. this.updateMarkerVisi(),//add
  22067. C(e)
  22068. }
  22069. .bind(this), 0, B, "camFly", V.FlyToPano)
  22070. }
  22071. }
  22072. ,
  22073. n.prototype.fastForwardActivePanoFlight = function(e) {
  22074. e = e || f.transition.fastForwardFactor / 10 * 4 + 1,
  22075. y.adjustSpeed(V.FlyToPano, e),
  22076. y.adjustSpeed(V.LookTransition, e)
  22077. }
  22078. ,
  22079. n.prototype.flyToPanoClosestToMouse = function() {
  22080. if (Date.now() - this.mouseLastMoveTime > 50 && (this.intersect = this.getMouseIntersect(),
  22081. this.intersect && this.updateClosestPano(this.intersect)),
  22082. this.closestPano)
  22083. return this.flyToPano({
  22084. pano: this.closestPano
  22085. });
  22086. var e = this.getMouseDirection();
  22087. this.flyDirection(e) || this.flyToPano({
  22088. pano: this.currentPano
  22089. })
  22090. }
  22091. ,
  22092. n.prototype.flyLocalDirection = function(e) {
  22093. var t = this.getDirection(e)
  22094. , i = 1 === e.z ? .4 : .75
  22095. , n = 1 === Math.abs(e.x);
  22096. return this.flyDirection(t, i, n)
  22097. }
  22098. ,
  22099. n.prototype.flyDirection = function(e, t, i) {
  22100. this.closePopup();//xzw add
  22101. var n = $.Deferred();
  22102. this.history.invalidate();
  22103. var r = this.closestPanoInDirection(e, t, i);
  22104. return r ? this.flyToPano({
  22105. pano: r
  22106. }, n.resolve.bind(n, !0)) : (this.bump(e),
  22107. n.resolve(!1)),
  22108. n.promise()
  22109. }
  22110. ,
  22111. n.prototype.closestPanoInDirection = function(e, t, i) {
  22112. return this.rankedPanoInDirection(0, e, t, i)
  22113. }
  22114. ,
  22115. n.prototype.rankedPanoInDirection = function() {
  22116. var e = {
  22117. pano: null,
  22118. candidates: []
  22119. };
  22120. return function(t, i, n, r) {
  22121. t || (t = 0),
  22122. n = void 0 !== n ? n : .75;
  22123. var o = r ? "angle" : "direction";
  22124. return this.model.panos.findRankedByScore(t, [s.filters.isPanoAligned(), s.filters.inPanoDirection(this.position, i, n), s.filters.isNeighbourPanoTo(this.currentPano), s.filters.not(this.currentPano)], [s.scoreFunctions.distanceSquared(this.currentPano), s.scoreFunctions[o](this.position, i)], e),
  22125. this.cachedPanoCandidates = e.candidates,
  22126. e.pano
  22127. }
  22128. }(),
  22129. n.prototype.bump = function(e) {
  22130. if (this.mode === u.PANORAMA && !this.flying && !this.isWarping()) {
  22131. var t, i, n, r = f.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e), s = Math.abs(a) > .5;
  22132. if (s)
  22133. t = function() {
  22134. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", a > 0 ? 1.04 : .96), o, i, 0, A.easeInOutSine, "bumpZStart")
  22135. }
  22136. .bind(this),
  22137. i = function() {
  22138. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", 1), 5 * o, n, 0, A.easeInOutSine, "bumpZRelax")
  22139. }
  22140. .bind(this);
  22141. else {
  22142. var l = this.camera.position.clone()
  22143. , c = e.clone();
  22144. this.raycaster.set(l, c);
  22145. var h = this.model.floors.reduce(function(e, t) {
  22146. return e.concat(t.collider.children)
  22147. }, [])
  22148. , d = this.raycaster.intersectObjects(h)
  22149. , p = d.length > 0 ? d[0].distance / 25 : .04
  22150. , g = l.clone().add(c.multiplyScalar(p));
  22151. t = function() {
  22152. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, g), o, i, 0, A.easeInOutSine, "bumpTStart")
  22153. }
  22154. .bind(this),
  22155. i = function() {
  22156. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, l), 5 * o, n, 0, A.easeInOutSine, "bumpTRelax")
  22157. }
  22158. .bind(this)
  22159. }
  22160. n = function() {
  22161. this.flying = !1
  22162. }
  22163. .bind(this),
  22164. this.flying = !0,
  22165. t()
  22166. }
  22167. }
  22168. ,
  22169. n.prototype.changeFloor = function(e) {
  22170. if (!this.is360View(this.mode, this.currentPano))
  22171. if (this.mode === u.PANORAMA) {
  22172. var t = this.history.reversePano(e);
  22173. t && t.isAligned() ? this.flyToPano({
  22174. pano: t
  22175. }) : this.changeFloorByScore(e)
  22176. } else
  22177. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  22178. }
  22179. ,
  22180. n.prototype.changeFloorByScore = function() {
  22181. var e = {
  22182. pano: null,
  22183. candidates: []
  22184. };
  22185. return function(t) {
  22186. var i = this.model.nextFloor(t);
  22187. return i ? (this.model.panos.lowestByScore([s.filters.atFloor(i), s.filters.isPanoAligned()], [s.scoreFunctions.distance(this.currentPano), s.scoreFunctions.direction(this.position, new r.Vector3(0,t,0)), s.scoreFunctions.penalizeHeightDifferenceUnder(this.position, .5)], e),
  22188. void (e.pano ? (this.cachedPanoCandidates = e.candidates,
  22189. this.history.push(t, this.currentPano),
  22190. this.flyToPano({
  22191. pano: e.pano
  22192. })) : F.warn("No pano found on selected floor, not moving there."))) : void F.debug("player.changeFloor(" + t + "): no such floor")
  22193. }
  22194. }(),
  22195. n.prototype.gotoFloor = function(e) {
  22196. var t = e - this.model.currentFloor.floorIndex;
  22197. this.changeFloor(t)
  22198. }
  22199. ,
  22200. n.prototype.getDirection = function(e) {
  22201. return e = e ? e : (new r.Vector3).copy(d.FORWARD),
  22202. e.applyQuaternion(this.camera.quaternion)
  22203. }
  22204. ,
  22205. n.prototype.flyToSameMode = function(e, t, i, n, o) {
  22206. if (o = o || $.Deferred(),
  22207. this.mode === u.TRANSITIONING)
  22208. return F.warn("should not be transitioning here"),
  22209. n && n(!1),
  22210. o.reject().promise();
  22211. var a = i || !1
  22212. , s = i ? i.position : this.position
  22213. , l = this.position.clone()
  22214. , c = this.currentPano;
  22215. if (F.debug("New pose in mode " + this.mode),
  22216. !e || (retryCallback = function() {
  22217. N.delayOneFrame(function() {
  22218. this.flyToSameMode(e, t, i, n, o)
  22219. }
  22220. .bind(this))
  22221. }
  22222. .bind(this),
  22223. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  22224. var h = function() {
  22225. this.emit(w.FlyingEnded, s, l, e, c),
  22226. n && n(!0)
  22227. }
  22228. .bind(this)
  22229. , d = f[this.mode]
  22230. , p = void 0 !== t ? t : d.transitionTime
  22231. , g = new r.Vector3
  22232. , C = new r.Vector3;
  22233. if (this.emit(w.FlyingStarted, s, l, e, c),
  22234. this.mode === u.PANORAMA)
  22235. F.warn("we should not be here for panorama views");
  22236. else if (this.mode === u.DOLLHOUSE)
  22237. if (a) {
  22238. var I = new r.Vector3(0,1,0);
  22239. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  22240. this.model.warpDestFloors(i.floorVisibility),
  22241. C.copy(i.position);
  22242. var E = new r.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  22243. , b = new r.Raycaster(C.clone(),E.clone(),0,1 / 0)
  22244. , _ = b.intersectObjects(this.model.colliders)
  22245. , T = 3;
  22246. _.length ? (g.copy(_[0].point),
  22247. T = .75 * C.distanceTo(g)) : (g.copy(E).multiplyScalar(3).add(C),
  22248. F.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  22249. var x = (new r.Matrix4).lookAt(C, g, I)
  22250. , S = (new r.Euler).setFromRotationMatrix(x, f.warp.eOrder)
  22251. , M = g.distanceTo(C)
  22252. , R = (new r.Matrix4).lookAt(this.cameraControls.cameras[u.DOLLHOUSE].position, this.cameraControls.controls[u.DOLLHOUSE].target, I)
  22253. , P = (new r.Euler).setFromRotationMatrix(R, f.warp.eOrder)
  22254. , O = this.cameraControls.cameras[u.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[u.DOLLHOUSE].target);
  22255. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(Math.min(O, T), !0);
  22256. var L = new r.Euler(S.x - P.x,S.y - P.y,S.z - P.z,f.warp.eOrder);
  22257. L.y = L.y > Math.PI ? L.y -= 2 * Math.PI : L.y < -Math.PI ? L.y += 2 * Math.PI : L.y,
  22258. this.path.burnsDir = Math.sign(L.y);
  22259. var D = new r.Euler(0,0,0,f.warp.eOrder)
  22260. , B = new r.Vector3;
  22261. y.start(v.vector(this.cameraControls.controls[u.DOLLHOUSE].target, g), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  22262. y.start(function(e, t) {
  22263. D.x = P.x + e * L.x,
  22264. D.y = P.y + e * L.y,
  22265. D.z = P.z + e * L.z;
  22266. var i = O + e * (M - O);
  22267. B.set(0, 0, i).applyEuler(D).add(this.cameraControls.controls[u.DOLLHOUSE].target),
  22268. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(B).add(this.model.position)
  22269. }
  22270. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  22271. y.start(function(e, t) {
  22272. this.cameraControls.controls[u.DOLLHOUSE].update(),
  22273. this.quaternion.copy(this.cameraControls.cameras[u.DOLLHOUSE].quaternion),
  22274. this.position.copy(this.cameraControls.cameras[u.DOLLHOUSE].position)
  22275. }
  22276. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  22277. } else
  22278. F.warn("invalid warp destination in flyToSameMode()? ignore it then");
  22279. else if (this.path.placeCpm(),
  22280. this.path.fadeInCpm(f.path.fadeInTime),
  22281. i) {
  22282. this.model.warpDestFloors(i.floorVisibility);
  22283. var U = this.cameraControls.cameras[u.FLOORPLAN]
  22284. , k = this.cameraControls.controls[u.FLOORPLAN]
  22285. , H = k.target.clone()
  22286. , G = i.position.clone().sub(H)
  22287. , z = U.position.clone().sub(k.target)
  22288. , W = z.length()
  22289. , j = new r.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  22290. , Y = Math.atan2(k.offset.x, k.offset.z)
  22291. , X = Math.atan2(j.x, j.z)
  22292. , Z = k.absoluteScale
  22293. , q = m.convertWorkshopOrthoZoom(i.orthoZoom);
  22294. y.start(function(e, t) {
  22295. k.target.copy(G).multiplyScalar(e).add(H);
  22296. var i = Y + (X - Y) * e;
  22297. k.offset.x = W * Math.sin(i),
  22298. k.offset.z = W * Math.cos(i),
  22299. U.position.copy(k.target).add(k.offset),
  22300. k.absoluteScale = Z + e * (q - Z),
  22301. k.update(),
  22302. this.quaternion.copy(U.quaternion),
  22303. this.position.copy(U.position),
  22304. this.target.copy(k.target),
  22305. this.camera.projectionMatrix.copy(U.projectionMatrix)
  22306. }
  22307. .bind(this), p, null, 0, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  22308. } else
  22309. F.info("flyToSameMode() funny floorplan view? skipping");
  22310. return y.setTimeout(function(e) {
  22311. this.mode = e,
  22312. h(),
  22313. o.resolve(!0)
  22314. }
  22315. .bind(this, this.mode), p, V.FlyToSameMode),
  22316. this.mode = u.TRANSITIONING,
  22317. o.promise()
  22318. }
  22319. }
  22320. ,
  22321. n.prototype.flyToNewMode = function(e, t) {
  22322. e = e || {};
  22323. var i = e.mode
  22324. , n = e.pano
  22325. , o = e.duration
  22326. , a = e.warpDest
  22327. , s = e.callback
  22328. , l = e.force
  22329. , c = e.quaternion;
  22330. if (t = t || $.Deferred(),
  22331. this.isWarping())
  22332. return F.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  22333. s && s(!1),
  22334. t.reject("Cannot change mode during tour transition").promise();
  22335. if (this.mode === u.TRANSITIONING)
  22336. return s && s(!1),
  22337. t.reject("Cannot change mode during mode transition").promise();
  22338. if (i === this.mode)
  22339. return l ? (this.flyToSameMode(n, o, a, s).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  22340. t.promise()) : (s && s(!1),
  22341. t.reject("Already in " + i + " mode").promise());
  22342. var h = a || !1;
  22343. F.debug("Switching mode to " + i);
  22344. var d = function() {
  22345. N.delayOneFrame(function() {
  22346. this.flyToNewMode(e, t)
  22347. }
  22348. .bind(this))
  22349. }
  22350. .bind(this);
  22351. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, d))
  22352. return t.promise();
  22353. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  22354. return F.info("Waiting for model textures to be loaded before going out to dollhouse"),
  22355. this.model.waitForLoad(this.model, function() {
  22356. return this.model.meshTexturesLoaded;
  22357. }
  22358. .bind(this)),
  22359. this.model.loadMeshTextures().done(d),
  22360. t.promise();
  22361. this.history.invalidate(),
  22362. this.updateLastView();
  22363. var p = this.mode
  22364. , C = this.cameraControls.cameras[i];
  22365. e = g.deepExtend({}, f[i], f[p + "-" + i]);
  22366. var I = void 0 !== o ? o : e.transitionTime;
  22367. this.emit(w.ModeChanging, p, i, n),
  22368. n && (this.currentPano = n),
  22369. this.switchCameraMode(i, c),
  22370. y.cancelById(V.LookTransition);
  22371. var _ = (new r.Vector3).copy(this.position);
  22372. if (i === u.PANORAMA)
  22373. this.emit(w.PanoChosen, n, n),
  22374. setTimeout(function() {
  22375. n.floor.enter(i)
  22376. }
  22377. .bind(this), I / 2),
  22378. this.path.fadeOutCpm(f.path.fadeOutTime);
  22379. else if (i === u.DOLLHOUSE) {
  22380. if (h && (this.model.stayPut = !0),
  22381. a ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  22382. this.model.warpDestFloors(a.floorVisibility)) : this.model.toggleAllFloors(!0),
  22383. this.path.placeCpm(),
  22384. this.path.fadeInCpm(f.path.fadeInTime),
  22385. h) {
  22386. var T = new r.Vector3(this.model.center.x,0,this.model.center.z);
  22387. _.set(15, 10, 15);
  22388. var M = new r.Vector3(0,0,-1).applyQuaternion(a.quaternion)
  22389. , R = new r.Raycaster(a.position.clone(),M.clone(),0,1 / 0)
  22390. , P = R.intersectObjects([this.sceneIntersectionPlane]);
  22391. P.length ? (T.copy(P[0].point),
  22392. _.copy(a.position),
  22393. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(.75 * _.distanceTo(T), !0)) : (F.warn("Tried to restore dollhouse mode that did not intersect...", a.position, a.quaternion),
  22394. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(3, !0)),
  22395. this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
  22396. _.add(this.model.position),
  22397. C.position.copy(_),
  22398. this.cameraControls.controls[u.DOLLHOUSE].update()
  22399. }
  22400. } else if (this.path.placeCpm(),
  22401. this.path.fadeInCpm(f.path.fadeInTime),
  22402. a) {
  22403. this.model.warpDestFloors(a.floorVisibility);
  22404. var O = this.cameraControls.cameras[u.FLOORPLAN]
  22405. , L = this.cameraControls.controls[u.FLOORPLAN]
  22406. , D = O.position.clone().sub(L.target)
  22407. , B = new r.Vector3(-1,0,0).applyQuaternion(a.quaternion).normalize()
  22408. , U = Math.atan2(B.x, B.z);
  22409. L.target.copy(a.position);
  22410. var k = D.length();
  22411. L.offset.x = k * Math.sin(U),
  22412. L.offset.y = 0,
  22413. L.offset.z = k * Math.cos(U),
  22414. O.position.copy(L.target).add(L.offset);
  22415. L.target.clone().sub(C.position);
  22416. C.quaternion.copy(a.quaternion),
  22417. L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom),
  22418. L.absoluteScale = L.currentScale,
  22419. L.update()
  22420. } else
  22421. this.model.currentFloor.enter(i);
  22422. var H = this.currentPano
  22423. , G = this.position.clone();
  22424. return this.emit(w.FlyingStarted, _, G, n, this.currentPano),
  22425. this.flying = !0,
  22426. this.isOutsideMode(i) && this.is360View(p, H) ? (h || i !== u.DOLLHOUSE || (C.position.set(15, 10, 15),
  22427. C.controls.target.set(this.model.center.x, 0, this.model.center.z),
  22428. C.controls.update()),
  22429. e.blackoutStyle = S.FADEIN,
  22430. I = f.show360Views.transitionTime,
  22431. this.fade360View(I, C, e)) : this.isOutsideMode(p) && this.is360View(i, n) ? (h && this.switchCameraMode(i, h.quaternion),
  22432. this.mode = i,
  22433. this.path && this.path.popOutCpm(),
  22434. e.blackoutStyle = S.END,
  22435. I = f.show360Views.transitionTime,
  22436. this.fade360View(I, C, e)) : (y.start(v.property(this.model, "alpha", e.modelAlpha, null), I * e.modelAlphaLength, null, e.modelAlphaDelay, null, V.FlyToNewMode),
  22437. y.start(v.vector(this.position, C.position), I, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToNewMode),
  22438. y.start(v.quaternion(this.quaternion, C.quaternion), I * e.rotationDuration, null, e.rotationDelay, A[f.flydown.rotationEasing], null, V.FlyToNewMode),
  22439. y.start(v.matrix4(this.camera.projectionMatrix, C.projectionMatrix), I * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, V.FlyToNewMode),
  22440. y.start(v.uniform(this.model.skybox, "opacity", e.skyboxOpacity), I * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, V.FlyToNewMode),
  22441. y.start(v.property(this.reticule.material.uniforms.opacity, "value", 0), I, null, V.FlyToNewMode)),
  22442. y.setTimeout(function() {
  22443. this.flying = !1,
  22444. p === u.PANORAMA && i !== u.PANORAMA ? this.currentPano.exit() : p !== u.PANORAMA && i === u.PANORAMA && (this.currentPano !== H && H.exit(),
  22445. this.currentPano.enter(),
  22446. this.path.placeCpm(),
  22447. this.path.fadeOutCpm(f.path.fadeOutTime),
  22448. this.spider.draw()),
  22449. p === u.DOLLHOUSE && this.cameraControls.controls[u.DOLLHOUSE].resetRanges(),
  22450. this.mode = i,
  22451. this.emit(w.FlyingEnded, _, G, this.currentPano, H),
  22452. this.updateMarkerVisi()//add
  22453. h && p !== u.PANORAMA && i === u.PANORAMA ? this.startWarp(b.Retain, E.Retain, x.BLACK, null, null, s) : (s && s(),
  22454. t.resolve())
  22455. }
  22456. .bind(this), I, V.FlyToNewMode),
  22457. this.mode = u.TRANSITIONING,
  22458. t.promise()
  22459. }
  22460. ,
  22461. n.prototype.fade360View = function(e, t, i) {
  22462. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  22463. $(this.domElement).fadeOut(.5 * e, function() {
  22464. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  22465. this.model.alpha = i.modelAlpha,
  22466. this.position.copy(t.position),
  22467. this.quaternion.copy(t.quaternion),
  22468. this.camera.projectionMatrix.copy(t.projectionMatrix),
  22469. $(this.domElement).fadeIn(.5 * e)
  22470. }
  22471. .bind(this))
  22472. }
  22473. ,
  22474. n.prototype.findDefaultViews = function() {
  22475. this.findDefaultView(this.lastInsideView, !0),
  22476. this.findDefaultView(this.last360View, !1)
  22477. }
  22478. ,
  22479. n.prototype.findDefaultView = function(e, t) {
  22480. var i, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  22481. if (e.cameraMode !== u.PANORAMA)
  22482. return !1;
  22483. var i = r.get(e.panoId);
  22484. return i && i.isAligned() === t
  22485. });
  22486. o >= 0 ? (i = r.get(n[o].panoId),
  22487. e.update({
  22488. cameraMode: u.PANORAMA,
  22489. pano: i,
  22490. position: n[o].position,
  22491. quaternion: n[o].quaternion
  22492. })) : (o = r.list.findIndex(function(e) {
  22493. return e.isAligned() === t
  22494. }),
  22495. o >= 0 ? (i = r.list[o],
  22496. e.update({
  22497. cameraMode: u.PANORAMA,
  22498. pano: i,
  22499. position: i.position
  22500. })) : F.warn("There are no", t ? "inside" : "360º", "views in this model"))
  22501. }
  22502. ,
  22503. n.prototype.updateLastView = function() {
  22504. if (this.mode === u.PANORAMA) {
  22505. var e = this.currentPano.isAligned() ? this.lastInsideView : this.last360View;
  22506. e.update({
  22507. pano: this.currentPano,
  22508. position: this.position,
  22509. quaternion: this.quaternion
  22510. })
  22511. }
  22512. }
  22513. ,
  22514. n.prototype.goToLastView = function(e, t) {
  22515. var i = $.Deferred()
  22516. , n = i.resolve.bind(i)
  22517. , r = i.reject.bind(i)
  22518. , o = e ? this.lastInsideView : this.last360View;
  22519. return this.isInMode(u.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  22520. this.isInMode(u.PANORAMA) ? (this.path && this.path.popOutCpm(),
  22521. this.fadeToView(e, o, f.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  22522. mode: o.cameraMode,
  22523. pano: o.pano,
  22524. quaternion: o.quaternion,
  22525. callback: t
  22526. }).done(n).fail(r),
  22527. i.promise()
  22528. }
  22529. ,
  22530. n.prototype.fadeToView = function(e, t, i, n) {
  22531. var r = $.Deferred()
  22532. , o = r.resolve.bind(r)
  22533. , a = r.reject.bind(r);
  22534. if (!t.isValid() || t.cameraMode === u.PANORAMA && !t.pano)
  22535. return F.warn("Tried to fade to an illegal view", t.cameraMode),
  22536. a("Cannot go to illegal view"),
  22537. r.promise();
  22538. var s = (f[t.cameraMode],
  22539. function() {
  22540. $(this.domElement).fadeIn(.5 * i),
  22541. n && n(),
  22542. o()
  22543. }
  22544. .bind(this))
  22545. , l = e ? S.FADEIN : S.END;
  22546. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  22547. $(this.domElement).fadeOut(.5 * i, function() {
  22548. this.model.fadePanoMarkers(e ? f.panorama.markerOpacity : 0),
  22549. t.cameraMode === u.PANORAMA ? this.flyToPano({
  22550. pano: t.pano,
  22551. lookAtPoint: d.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  22552. duration: 0
  22553. }, s) : this.flyToNewMode({
  22554. mode: t.cameraMode,
  22555. quaternion: t.quaternion,
  22556. duration: 0,
  22557. callback: s
  22558. })
  22559. }
  22560. .bind(this)),
  22561. r.promise()
  22562. }
  22563. ,
  22564. n.prototype.startWarp = function(e, t, i, n, r, o) {
  22565. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  22566. this.flying)
  22567. return F.warn("Player.startWarp() -> Cannot warp when flying"),
  22568. o && o(),
  22569. !1;
  22570. null !== e && void 0 !== e || (e = b.Show),
  22571. this.history.invalidate()
  22572. e !== b.Retain ? this.path.brushToWarpPano(i, x.BLACK) || (i = x.BLACK) : i = this.path.upcomingTransType;
  22573. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  22574. return this.emit(w.WarpStarted, a, i, n, r),
  22575. n = n || S.MIDDLE,
  22576. this.path.warpToPano(i, n, r, function() {
  22577. t === E.Slow ? this.path.discardSlow() : t === E.Standard && this.path.discardPathObject(),
  22578. this.emit(w.WarpEnded, i),
  22579. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  22580. o && o()
  22581. }
  22582. .bind(this)),
  22583. e === b.Hide && this.path.discardPathObject(),
  22584. !0
  22585. }
  22586. ,
  22587. n.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  22588. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (F.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  22589. s && s(),
  22590. !1)
  22591. }
  22592. ,
  22593. n.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  22594. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (F.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22595. a && a(),
  22596. !1)
  22597. }
  22598. ,
  22599. n.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  22600. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  22601. }
  22602. ,
  22603. n.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  22604. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  22605. !0) : (F.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22606. t && t(),
  22607. !1)
  22608. }
  22609. ,
  22610. n.prototype.aimTourCamera = function(e, t, i, n) {
  22611. return F.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  22612. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  22613. }
  22614. ,
  22615. n.prototype.showPathToHeroLocation = function(e) {
  22616. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(x.STD, x.BLACK)
  22617. }
  22618. ,
  22619. n.prototype.tourInterlude = function(e, t) {
  22620. this.history.invalidate();
  22621. this.path.discardSlow();
  22622. //xzw:
  22623. var a = g_data2.tourAudio && g_data2.tourAudio[this.model.heroLocations[this.director.currentItem].sid];
  22624. var currTime = g_tourAudio ? g_tourAudio.currentTime * 1000 : 0;
  22625. var rotTime = (a && a.music) ? a.time - currTime : 2000;
  22626. this.path.waitNextStep(e, function() {
  22627. t && t()
  22628. }.bind(this), rotTime)
  22629. }
  22630. ,
  22631. n.prototype.stopInterlude = function() {
  22632. this.interruptAndFastForward(null, 0)
  22633. }
  22634. ,
  22635. n.prototype.interruptAndFastForward = function(e, t) {
  22636. this.isWarping() && this.emit(w.WarpInterrupted, this.path.activeTransType, e, t),
  22637. this.flying && this.emit(w.FlyingInterrupted),
  22638. this.path.interruptAndFastForward(e, t)
  22639. }
  22640. ,
  22641. n.prototype.setSize = function(e, t) {
  22642. var i = e / t;
  22643. this.baseFov = B.clampVFOV(f.insideFOV, f.insideFOVMax, e, t);
  22644. var n = B.getHFOVFromVFOV(f.insideFOV, e, t);
  22645. n > f.insideFOVMax ? this.baseFov = B.getVFOVFromHFOV(f.insideFOVMax, e, t) : this.baseFov = f.insideFOV;
  22646. for (var r in this.cameraControls.cameras) {
  22647. var o = this.cameraControls.cameras[r];
  22648. o.fov = this.baseFov * (1 / this.zoomLevel),
  22649. o.updateAspect(i)
  22650. }
  22651. }
  22652. ,
  22653. n.prototype.toJSON = function() {
  22654. var e = {};
  22655. return this.cameraControls.activeControl ? (e = this.cameraControls.activeControl.toJSON(),
  22656. e.camera_mode = u.toInt(this.mode),
  22657. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  22658. return e.hidden ? 0 : 1
  22659. }) : u.PANORAMA && (e.scan_id = this.currentPano.id),
  22660. e) : e
  22661. }
  22662. ,
  22663. n.prototype.getCurrentNodePanos = function(e) {
  22664. this.model.panos.map;
  22665. if (e.length = 0,
  22666. this.path.nodes)
  22667. for (var t = 0; t < this.path.nodes.length; t++) {
  22668. var i = this.path.nodes[t];
  22669. e.push(this.model.panos.get(i))
  22670. }
  22671. }
  22672. ,
  22673. n.prototype.zoomIncrementally = function(e) {
  22674. var t = this.zoomLevel;
  22675. this.zoomTo(this.zoomLevel + e),
  22676. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  22677. }
  22678. ,
  22679. n.prototype.zoomInIncrementally = function(e) {
  22680. e = e || this.defaultZoomIncrement,
  22681. this.zoomIncrementally(e)
  22682. }
  22683. ,
  22684. n.prototype.zoomOutIncrementally = function(e) {
  22685. e = e || -this.defaultZoomIncrement,
  22686. this.zoomIncrementally(e)
  22687. }
  22688. ,
  22689. n.prototype.zoomBy = function(e) {
  22690. this.zoomTo(this.zoomLevel * e)
  22691. }
  22692. ,
  22693. n.prototype.zoomIn = function() {
  22694. this.zoomBy(1 + this.zoomSpeed)
  22695. }
  22696. ,
  22697. n.prototype.zoomOut = function() {
  22698. this.zoomBy(1 - this.zoomSpeed)
  22699. }
  22700. ,
  22701. n.prototype.zoomTo = function(e, t) {
  22702. if (t || f.zoom.enabled && this.mode === u.PANORAMA && this.zoomEnabled) {
  22703. if (e < f.zoom.min && (e = f.zoom.min),
  22704. e > f.zoom.max && (e = f.zoom.max),
  22705. e > this.zoomLevel ? (this.emit(O.ZoomIn),
  22706. e === f.zoom.max && this.emit(O.ZoomMax)) : e < this.zoomLevel && (this.emit(O.ZoomOut),
  22707. e === f.zoom.min && this.emit(O.ZoomMin)),
  22708. this.cameraControls.activeControl) {
  22709. var i = this.cameraControls.activeControl.camera;
  22710. this.zoomLevel = e,
  22711. i.fov = this.baseFov * (1 / this.zoomLevel),
  22712. i.updateProjectionMatrix(),
  22713. this.zoomFov = i.fov
  22714. }
  22715. }
  22716. }
  22717. ,
  22718. n.prototype.increaseZoomSpeed = function() {
  22719. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  22720. }
  22721. ,
  22722. n.prototype.decreaseZoomSpeed = function() {
  22723. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  22724. }
  22725. ,
  22726. n.prototype.clampZoomSpeed = function(e) {
  22727. return e < 0 ? 0 : e
  22728. }
  22729. ,
  22730. n.prototype.activatePersistentZooming = function(e) {
  22731. this.zooming = e ? 1 : -1
  22732. }
  22733. ,
  22734. n.prototype.deactivatePersistentZooming = function() {
  22735. this.zooming = 0
  22736. }
  22737. ,
  22738. n.prototype.zoomDefault = function() {
  22739. this.zoomTo(1, !0)
  22740. }
  22741. ,
  22742. n.prototype.smoothZoomToDefault = function(e, t) {
  22743. var i, n = this.zoomLevel,
  22744. r = function(e) {
  22745. e > 1 && (e = 1),
  22746. i = n * (1 - e) + e,
  22747. this.zoomTo(i, !0)
  22748. }.bind(this),
  22749. o = function() {
  22750. this.zoomDefault(),
  22751. t && window.setTimeout(t, 50)
  22752. }.bind(this);
  22753. y.start(r, e, o, null, 0, A[f.transition.blendEasing])
  22754. }
  22755. ,
  22756. n.prototype.updateZoomPano = function() {
  22757. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === u.PANORAMA) {
  22758. var e = this.currentPano;
  22759. if (e) {
  22760. var t = this.zoomLevel > f.zoom.activationThreshold
  22761. , i = this.flying && this.nextPano && this.nextPano !== this.currentPano
  22762. , n = !i && !this.isWarping()
  22763. , r = t /*&& n*/; // 允许flying状态下加载4K图
  22764. this.tileDownloader.tilePrioritizer.setZoomingActive(r),
  22765. this.panoRenderer.setZoomingActive(r, e, !0);
  22766. var o = function(e, t) {
  22767. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  22768. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  22769. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  22770. e.setZoomed(t)
  22771. }
  22772. .bind(this);
  22773. r && !e.zoomed ? (o(e, !0),
  22774. this.panoRenderer.enableUltraHighQualityMode(function() {
  22775. this.qualityManager.useUltraHighResolutionPanos && !f.zoom.overridemax && (f.zoom.max = D.ultraHighQualityMaxZoom),
  22776. r && o(e, !0)
  22777. }
  22778. .bind(this))) : !t && e.zoomed && o(e, !1)
  22779. }
  22780. }
  22781. },
  22782. n.prototype.checkHasNeighbor = function(pano){//add
  22783. for(var i in pano.neighbourPanos ){
  22784. if(i == pano.id)continue;
  22785. if(pano.neighbourPanos[i]){
  22786. return true;
  22787. }
  22788. }
  22789. }
  22790. ,
  22791. t.exports = n
  22792. }
  22793. ).call(this, "/js/player.js")
  22794. }
  22795. , {
  22796. "./constants": 8,
  22797. "./enum/AlignmentType": 17,
  22798. "./enum/BlackoutStyle": 18,
  22799. "./enum/ControlEvents": 21,
  22800. "./enum/Keys": 30,
  22801. "./enum/ModelManagerEvents": 33,
  22802. "./enum/PanoSizeClass": 36,
  22803. "./enum/PanoramaEvents": 37,
  22804. "./enum/PathDiscardMode": 38,
  22805. "./enum/PathDisplayMode": 39,
  22806. "./enum/PlayerEvents": 40,
  22807. "./enum/TagStates": 44,
  22808. "./enum/Vectors": 50,
  22809. "./enum/Viewmode": 51,
  22810. "./enum/WarpStyle": 52,
  22811. "./enum/ZoomEvents": 53,
  22812. "./exception/BasicException": 55,
  22813. "./model/ModelManager": 140,
  22814. "./objects/NSpider": 147,
  22815. "./objects/Panorama": 148,
  22816. "./objects/Reticule": 149,
  22817. "./objects/ShowPath": 151,
  22818. "./objects/Snapshot": 153,
  22819. "./objects/View": 154,
  22820. "./settings": 166,
  22821. "./shaders": 167,
  22822. "./tile/TileDownloader": 171,
  22823. "./tile/TilePrioritizer": 172,
  22824. "./util/ZoomStats": 179,
  22825. "./util/browser": 182,
  22826. "./util/camera": 183,
  22827. "./util/cameraLight": 184,
  22828. "./util/common": 185,
  22829. "./util/easing": 186,
  22830. "./util/history": 187,
  22831. "./util/lerp": 188,
  22832. "./util/logger": 189,
  22833. "./util/math": 190,
  22834. "./util/transitions": 195,
  22835. "hot":"hot",
  22836. "scaleImg":"scaleImg",
  22837. events: 202,
  22838. three: 217
  22839. }],
  22840. "scaleImg":[function(t, e){// xzw
  22841. var OUTPUT = e;
  22842. (function(){function t(t,a,i,r){function h(){B="object"==typeof i?i:a.src||r?u:document.createElement("canvas"),B.width=s,B.height=f,G=B.getContext("2d")}
  22843. function n(t){if(t){var e,a=G.getImageData(0,0,s,f),i=a.data;for(e=0;at>e;e+=4)
  22844. i[e]=t[e]*it|0,i[e+1]=t[e+1]*it|0,i[e+2]=t[e+2]*it|0,i[e+3]=t[e+3]*it|0;return delete t,a}
  22845. return G.getImageData(0,0,s,f)}
  22846. function o(t,e,a,i,r){return.5*(i-e+(2*e-5*a+4*i-r+(3*(a-i)+r-e)*t)*t)*t+a}
  22847. a||(a=t.input,i=t.output,r=t.inputRemovable,t.scale&&(t=t.scale));var u,d;if(a.src)
  22848. if(u=document.createElement("canvas"),null!=a.naturalWidth)
  22849. u.width=a.naturalWidth,u.height=a.naturalHeight;else if(null!=a.runtimeStyle){var l=a.runtimeStyle,c=l.width,g=l.height;l.width="auto",l.height="auto",u.width=a.width,u.height=a.height,l.width=c,l.height=g}else{var c=a.width,g=a.height;a.removeAttribute&&(a.removeAttribute("width"),a.removeAttribute("height")),u.width=a.width,u.height=a.height,a.width=c,a.height=g}
  22850. else
  22851. u=a;d=u.getContext("2d"),a.src&&d.drawImage(a,0,0);var s,f,m=u.width,w=u.height,p=d.getImageData(0,0,m,w).data;if(!m||!w)
  22852. return!1;(a.src||r)&&u.clearRect(0,0,m,w),"object"==typeof t?t.width?(s=t.width+.5|0,f=t.height+.5|0):(s=m*t.scaleX+.5|0,f=w*t.scaleY+.5|0):(s=t*m+.5|0,f=t*w+.5|0);var v,b,y,x,D,I,A,j,R,k,C,E,F,L,S,U,W,H,alpha,X,Y,q,z,B,G,J,K,M,N,O,P,Q,T,V,Z,$=s<<2,_=m<<2,tt=0,et=0,at=$*f,it=255.99/255,rt=s/m,ht=f/w,nt=rt*ht;if(rt>1||ht>1)
  22853. for(h(),J=n(),K=J.data,x=0;f>x;x++)
  22854. for(b=x/ht,R=0|b,q=b-R,N=R*_,M=1>R?N:N-_,w-2>R?(O=N+_,P=(R+2)*_):O=P=R>w-2?N:N+_,y=0;s>y;y++,et+=4)
  22855. v=y/rt,j=0|v,z=v-j,T=j<<2,Q=1>j?T:T-4,m-2>j?(V=T+4,Z=T+8):V=Z=j>m-2?T:T+4,H=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,++Q,++T,++V,++Z,X=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,++Q,++T,++V,++Z,Y=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,++Q,++T,++V,++Z,alpha=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,K[et]=H>=0?256>H?H:255:0,K[et+1]=X>=0?256>X?X:255:0,K[et+2]=Y>=0?256>Y?Y:255:0,K[et+3]=alpha>=0?256>alpha?alpha:255:0;else{if(e.Float32Array)
  22856. W=new Float32Array(at);else
  22857. for(W=[],et=0;at>et;++et)
  22858. W[et]=0;for(b=0;w>b;b++)
  22859. for(x=b*ht,A=0|x,D=A*$,U=!!((A-(x+ht|0))*(w-1-b))<<1,U&&(F=A+1-x,L=x+ht-A-1),v=0;m>v;v++,tt+=4)
  22860. switch(y=v*rt,I=0|y,et=D+(I<<2),S=!!((I-(y+rt|0))*(m-1-v)),S&&(C=I+1-y,E=y+rt-I-1),H=p[tt],X=p[tt+1],Y=p[tt+2],alpha=p[tt+3],S+U){case 0:W[et]+=H*nt,W[et+1]+=X*nt,W[et+2]+=Y*nt,W[et+3]+=alpha*nt;break;case 1:k=C*ht,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=E*ht,W[et+4]+=H*k,W[et+5]+=X*k,W[et+6]+=Y*k,W[et+7]+=alpha*k;break;case 2:k=rt*F,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=rt*L,et+=$,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k;break;default:k=C*F,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=E*F,W[et+4]+=H*k,W[et+5]+=X*k,W[et+6]+=Y*k,W[et+7]+=alpha*k,k=C*L,et+=$,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=E*L,W[et+4]+=H*k,W[et+5]+=X*k,W[et+6]+=Y*k,W[et+7]+=alpha*k;}
  22861. delete p,h(),J=n(W)}
  22862. if(G.putImageData(J,0,0),"string"==typeof i){if("png"===i||"jpeg"===i){var ot;return ot=r&&a.src?a:new Image,ot.width=s,ot.height=f,ot.src=B.toDataURL("image/"+i,0.85),ot}
  22863. if("png-src"===i||"jpeg-src"===i)
  22864. return B.toDataURL("image/"+i.split("-")[0],0.85)}
  22865. return B}
  22866. var e=this;"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=t),exports.scale=t):c=t}).call(this);
  22867. OUTPUT.exports = c;
  22868. }, {}
  22869. ],
  22870. 156: [function(e, t, i) {
  22871. (function(i) {
  22872. "use strict";
  22873. function n(e, t) {
  22874. this.model = e,
  22875. this.panos = e.panos,
  22876. this.player = t,
  22877. this.imagePanos = this.listImagePanos(),
  22878. this.retryMinimumTime = 1e4
  22879. }
  22880. var r = (e("three"),
  22881. e("./enum/Viewmode"))
  22882. , o = (e("./settings"),
  22883. e("./objects/Panorama"))
  22884. , a = e("./util/logger")
  22885. , s = new a(i);
  22886. n.prototype.start = function() {
  22887. this.loadNextPano(function(e) {
  22888. e ? this.start() : (s.debug("No suitable pano loaded, waiting a little while before looking again"),
  22889. setTimeout(function() {
  22890. this.start()
  22891. }
  22892. .bind(this), 1e3))
  22893. }
  22894. .bind(this))
  22895. }
  22896. ,
  22897. n.prototype.validLoadTarget = function(e) {
  22898. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  22899. }
  22900. ,
  22901. n.prototype.listImagePanos = function() {
  22902. var e = []
  22903. , t = this;
  22904. return this.model.images.forEach(function(i) {
  22905. if (i.metadata && i.metadata.scan_id) {
  22906. var n = t.model.panos.get(i.metadata.scan_id);
  22907. n && !n.isLoaded("high") && e.push(n)
  22908. }
  22909. }),
  22910. e
  22911. }
  22912. ,
  22913. n.prototype.nextNotLoadedImage = function() {
  22914. for (; this.imagePanos.length > 0; ) {
  22915. var e = this.imagePanos[0];
  22916. if (!e.isLoaded("high"))
  22917. return e;
  22918. this.imagePanos.shift()
  22919. }
  22920. return null
  22921. }
  22922. ,
  22923. n.prototype.loadNextPano = function(e) {
  22924. var t, i, n = this.model.waitQueue.filter(function(e) {
  22925. return e.object instanceof o
  22926. });
  22927. n.length > 0 ? (t = n[0].object,
  22928. s.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  22929. s.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  22930. s.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  22931. t = this.imagePanos[0],
  22932. s.debug("Overrode pano selection: Highlight image " + t.id)) : this.player.mode === r.PANORAMA && (t = this.panos.lowestByScore([this.validLoadTarget.bind(this), o.filters.isNeighbourPanoTo(this.player.currentPano)], [o.scoreFunctions.distance(this.player.currentPano), o.scoreFunctions.direction(this.player.position, this.player.getDirection()), o.scoreFunctions.inFieldOfView(this.player.position, this.player.getDirection())]),
  22933. t && s.debug("Normal pano selection: neighbor " + t.id)),
  22934. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  22935. s.debug("Preloading " + i + "-res pano " + t.id),
  22936. t.loadCube(i).done(e).fail(function() {
  22937. s.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  22938. e()
  22939. })) : e && e(null)
  22940. }
  22941. ,
  22942. t.exports = n
  22943. }
  22944. ).call(this, "/js/preloaders.js")
  22945. }
  22946. , {
  22947. "./enum/Viewmode": 51,
  22948. "./objects/Panorama": 148,
  22949. "./settings": 166,
  22950. "./util/logger": 189,
  22951. three: 217
  22952. }],
  22953. 157: [function(e, t, i) {
  22954. (function(i) {
  22955. "use strict";
  22956. function n(e, t, i, n, r) {
  22957. this.qualityManager = e,
  22958. this.scene = t,
  22959. this.camera = i,
  22960. this.container = r,
  22961. this.controls = n,
  22962. this.controls.enabled = !0,
  22963. this.controls.locked = !0,
  22964. this.quickstartCamera = n.camera,
  22965. this.quickstartCamera.fov = h.clampVFOV(a.insideFOV, a.insideFOVMax, $("#player").width(), $("#player").height()),
  22966. this.skybox = null
  22967. }
  22968. var r = e("three")
  22969. , o = e("../util/logger")
  22970. , a = e("../constants")
  22971. , s = (e("../util/transitions"),
  22972. e("../util/lerp"),
  22973. e("../util/easing"),
  22974. e("../enum/Vectors"))
  22975. , l = e("../enum/PanoSizeClass")
  22976. , c = (e("../materials/ModelTextureMaterial"),
  22977. e("../materials/CubemapMaterial"))
  22978. , h = (e("../cameras/PanoramaCamera"),
  22979. e("../controls/PanoramaControls"),
  22980. e("../tile/TileUtils"),
  22981. e("../util/camera"),
  22982. e("../util/cameraLight"))
  22983. , u = (e("../util/browser"),
  22984. e("../settings"),
  22985. e("../gui/helpManager"),
  22986. new o(i));
  22987. n.prototype.load = function(e) {
  22988. e.pano.shouldRedrawOnBaseLoaded = !0;
  22989. var t, i, n = this, r = s.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  22990. this.controls.lookAt(r.add(this.quickstartCamera.position));
  22991. var a = this.qualityManager.getPanoSize(l.BASE)
  22992. , c = this.qualityManager.getPanoSize(l.STANDARD);
  22993. if (e.pano.tiled) {
  22994. u.warn("Loading startPano, TILED", e.pano.id);
  22995. var d = h.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  22996. , p = this.quickstartCamera.fov;
  22997. u.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + d + ", vertical FOV: " + p + "]"),
  22998. t = e.pano.loadTiledPano(c, r, {
  22999. hFov: d,
  23000. vFov: p
  23001. }, !1, !1, !0),
  23002. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  23003. } else
  23004. u.warn("Loading startPano", e.pano.id),
  23005. t = e.pano.loadCube("high");
  23006. return $.when(t).then(function() {
  23007. n.init(e.pano, e.quaternion),
  23008. e.pano.tiled ? i.done(function() {
  23009. e.pano.lockUntilRenderingComplete = !1,
  23010. this.controls.locked = !1
  23011. }
  23012. .bind(this)) : this.controls.locked = !1
  23013. }
  23014. .bind(this))
  23015. }
  23016. ,
  23017. n.prototype.init = function(e, t) {
  23018. u.info("Quickstart done loading, adding scene objects"),
  23019. e.lockUntilRenderingComplete = !0,
  23020. this.skybox = new r.Mesh(new r.CubeGeometry(1,1,1),new c({
  23021. side: r.BackSide
  23022. })),
  23023. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  23024. this.skybox.quaternion.copy(e.quaternion),
  23025. this.scene.add(this.skybox),
  23026. $(this.container).show()
  23027. }
  23028. ,
  23029. n.prototype.update = function(e) {
  23030. this.controls.update(e),
  23031. this.camera.copy(this.quickstartCamera)
  23032. }
  23033. ,
  23034. n.prototype.setSize = function(e, t) {
  23035. this.quickstartCamera.updateAspect(e / t)
  23036. }
  23037. ,
  23038. n.prototype.destroy = function() {
  23039. this.scene.remove(this.skybox)
  23040. }
  23041. ,
  23042. t.exports = n
  23043. }
  23044. ).call(this, "/js/scene/QuickstartManager.js")
  23045. }
  23046. , {
  23047. "../cameras/PanoramaCamera": 7,
  23048. "../constants": 8,
  23049. "../controls/PanoramaControls": 13,
  23050. "../enum/PanoSizeClass": 36,
  23051. "../enum/Vectors": 50,
  23052. "../gui/helpManager": 68,
  23053. "../materials/CubemapMaterial": 117,
  23054. "../materials/ModelTextureMaterial": 118,
  23055. "../settings": 166,
  23056. "../tile/TileUtils": 174,
  23057. "../util/browser": 182,
  23058. "../util/camera": 183,
  23059. "../util/cameraLight": 184,
  23060. "../util/easing": 186,
  23061. "../util/lerp": 188,
  23062. "../util/logger": 189,
  23063. "../util/transitions": 195,
  23064. three: 217
  23065. }],
  23066. 158: [function(e, t, i) {
  23067. "use strict";
  23068. function n(e, t, i) {
  23069. this.scene = e,
  23070. this.camera = t,
  23071. this.renderer = null,
  23072. this.effects = i,
  23073. this.animateCallback = null,
  23074. this.composer = null,
  23075. this.qualityManager = null,
  23076. e.renderWidth = 0,
  23077. e.renderHeight = 0,
  23078. this.updateClock = new r.Clock,
  23079. this.components = [],
  23080. this.updateListeners = [],
  23081. this.resizeListeners = [],
  23082. this.forceUpdateSize = !1,
  23083. this.started = !1,
  23084. this.textures = {},
  23085. this.suspendedObjects = []
  23086. }
  23087. var r = e("three")
  23088. , o = e("../shaders")
  23089. , a = e("../enum/SceneRendererEvents")
  23090. , s = e("../enum/GLTextureType")
  23091. , l = e("../enum/GLCubeFaces")
  23092. , c = e("../exception/BasicException")
  23093. , h = e("../exception/RendererCreationException")
  23094. /**********************************************************************fyz改 from徐世廷**********************************************************************/
  23095. , m = e("../util/browser")
  23096. /**************************************************************************************************************************************************/
  23097. , u = e("../settings")
  23098. , d = e("events").EventEmitter;
  23099. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  23100. n.prototype = Object.create(d.prototype),
  23101. n.prototype.addComponent = function(e) {
  23102. this.components.push(e),
  23103. e.update && this.updateListeners.push(e),
  23104. e.setSize && (this.resizeListeners.push(e),
  23105. this.forceUpdateSize = !0)
  23106. }
  23107. ,
  23108. n.prototype.removeComponent = function(e) {
  23109. var t = function(t) {
  23110. return t !== e
  23111. };
  23112. this.components = this.components.filter(t),
  23113. this.updateListeners = this.updateListeners.filter(t),
  23114. this.resizeListeners = this.resizeListeners.filter(t)
  23115. }
  23116. ,
  23117. n.prototype.start = function(e) {
  23118. if (this.started)
  23119. throw new c("Can't start SceneRenderer, already started");
  23120. this.createContext(e),
  23121. /***************************************************VR fyz改 from徐世廷**********************************************************************/
  23122. this.boluoVrInit(),
  23123. /*******************************************************************************************************************************/
  23124. this.initComposer(),
  23125. this.started = !0,
  23126. (p = p.bind(this))()
  23127. }
  23128. ,
  23129. n.prototype.createContext = function(e) {
  23130. try {
  23131. this.renderer = new r.WebGLRenderer({antialias: !m.isMobile()}),
  23132. this.renderer.autoClear = !0,
  23133. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  23134. this.renderer.setSize($("#player").width(), $("#player").height(), false), //改
  23135. this.emit(a.ContextCreated)
  23136. } catch (e) {
  23137. throw new h("Unable to create a WebGL rendering context")
  23138. }
  23139. u.profiling.enabled && this.overrideTextures(),
  23140. e.appendChild(this.renderer.domElement)
  23141. }
  23142. ,
  23143. n.prototype.overrideTextures = function() {
  23144. var e = this.renderer.context
  23145. , t = 0
  23146. , i = e.createTexture;
  23147. e.createTexture = function() {
  23148. var n = i.call(e);
  23149. return n.id = t++,
  23150. this.textures[n.id] = n,
  23151. n
  23152. }
  23153. .bind(this);
  23154. var n = e.texImage2D;
  23155. e.texImage2D = function(t, i, r, o, a, l, c, h, u) {
  23156. var d, p = this.getTextureTypeFromTarget(e, t);
  23157. d = p === s.TextureCube ? e.getParameter(e.TEXTURE_BINDING_CUBE_MAP) : e.getParameter(e.TEXTURE_BINDING_2D),
  23158. void 0 !== c ? n.call(e, t, i, r, o, a, l, c, h, u) : (c = o,
  23159. h = a,
  23160. u = l,
  23161. o = u.naturalWidth,
  23162. a = u.naturalHeight,
  23163. n.call(e, t, i, r, c, h, u));
  23164. var f = this.textures[d.id];
  23165. f.width = p === s.TextureCube ? 6 * o : o,
  23166. f.height = a
  23167. }
  23168. .bind(this);
  23169. var r = e.deleteTexture;
  23170. e.deleteTexture = function(t) {
  23171. delete this.textures[t.id],
  23172. r.call(e, t)
  23173. }
  23174. .bind(this)
  23175. }
  23176. ,
  23177. n.prototype.updateTextureMemory = function() {
  23178. var e = null;
  23179. return function() {
  23180. var t = 0;
  23181. for (var i in this.textures) {
  23182. var n = this.textures[i];
  23183. n.width && n.height && (t += n.width * n.height * 4)
  23184. }
  23185. t !== e && this.emit(a.MemoryUsageUpdated, t),
  23186. e = t
  23187. }
  23188. }(),
  23189. n.prototype.getTextureTypeFromTarget = function(e, t) {
  23190. switch (t) {
  23191. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  23192. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  23193. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  23194. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23195. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  23196. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23197. return s.TextureCube;
  23198. case e.TEXTURE_2D:
  23199. return s.Texture2D;
  23200. default:
  23201. return null
  23202. }
  23203. }
  23204. ,
  23205. n.prototype.initComposer = function() {
  23206. this.composer = new r.EffectComposer(this.renderer),
  23207. this.composer.addPass(new r.RenderPass(this.scene,this.camera)),
  23208. this.composer.addPass(this.effects.hblurPass),
  23209. this.composer.addPass(this.effects.vblurPass)
  23210. }
  23211. ,
  23212. n.prototype.setSize = function(e, t, devicePixelRatio) {
  23213. this.renderWidth = e,
  23214. this.renderHeight = t,
  23215. this.effects.aspect = e / t,
  23216. /* this.renderer.setSize(e, t), -----MP */
  23217. this.renderer.setSize(e, t, false, devicePixelRatio), //改 为了防止给canvas设置宽高
  23218. this.composer.setSize(e, t);
  23219. for (var i = 0; i < this.resizeListeners.length; i++)
  23220. this.resizeListeners[i].setSize(e, t)
  23221. }
  23222. ,
  23223. n.prototype.render = function() {
  23224. this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  23225. }
  23226. ,
  23227. /******************************************************************************************************徐世廷**********************************************************************/
  23228. n.prototype.boluoVrInit = function() {
  23229. console.log("boluoVrInit")
  23230. this.isHuawei5X = m.detectHUAWEI5X(),
  23231. this.oldRenderer = this.renderer,
  23232. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera);
  23233. window.panoCamera = this.camera;
  23234. var a = this;
  23235. window._vrEnabled = !1,
  23236. Object.defineProperty(window, "vrEnabled", {
  23237. get: function() {
  23238. return window._vrEnabled
  23239. },
  23240. set: function(b) {
  23241. b = !!b,
  23242. b ? (a.renderer = a.newRenderer,
  23243. window.vrMarkers.forEach(function(a) {
  23244. a.visible = !0
  23245. })) : (a.renderer = a.oldRenderer,
  23246. window.vrMarkers.forEach(function(a) {
  23247. a.visible = !1
  23248. })),
  23249. a.cursor.visible = b,
  23250. a.setSize(window.innerWidth, window.innerHeight),
  23251. window._vrEnabled = b
  23252. setTimeout(function(){console.log(player.cameraControls.activeControl.camera.fov)},500)
  23253. }
  23254. }),
  23255. this.createCursor(.5, !1, 1, 16777215, 0);
  23256. var b = {
  23257. setSize: function(b, c) {
  23258. a.camera.aspect = b / c
  23259. }
  23260. };
  23261. this.resizeListeners.push(b),
  23262. this.vrLoadingInit()
  23263. }
  23264. ,
  23265. n.prototype.vrLoadingInit = function() {
  23266. var a = function() {
  23267. var a = this
  23268. , b = new r.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  23269. , c = new r.MeshBasicMaterial({
  23270. color: 4967932,
  23271. side: r.DoubleSide
  23272. })
  23273. , d = new r.Mesh(b,c);
  23274. this.mesh = d,
  23275. d.position.z = -2,
  23276. d.scale.set(.08, .08, .08),
  23277. d.visible = !1,
  23278. // camera.add(d),
  23279. window.player.camera.add(d),
  23280. a.enabled = !1,
  23281. this.update = function(b) {
  23282. 1 == a.enabled && (d.rotation.z += 15 * b)
  23283. }
  23284. }
  23285. , a = new a(this.camera);
  23286. window.Loading = a,
  23287. this.updateListeners.push(a)
  23288. }
  23289. ,
  23290. n.prototype.createCursor = function(a, b, c, d, e) {
  23291. var g, h = new r.SpriteMaterial({
  23292. opacity: c,
  23293. color: d,
  23294. transparent: b,
  23295. map: this.boluoGetTexture("images/cursor.png"),
  23296. needsUpdate: !0,
  23297. side: r.DoubleSide
  23298. });
  23299. h.map.offset = new r.Vector2(1 / 17 * e,0),
  23300. h.map.repeat = new r.Vector2(1 / 17,1),
  23301. h.depthTest = !1,
  23302. h.blending = r.AdditiveBlending,
  23303. g = new r.Sprite(h),
  23304. // g.scale.set(a, a, a),
  23305. g.scale.set(.3,.3,.3)
  23306. g.position.z = -2,
  23307. g.visible = !1,
  23308. g.name = "cursor",
  23309. this.camera.add(g),
  23310. this.scene.add(this.camera),
  23311. this.cursor = g;
  23312. var i = new this.CursorAnimation(this.scene,g,this.camera);
  23313. this.cursor.triggerTargetEvent = i.triggerTargetEvent,
  23314. this.updateListeners.push(i)
  23315. }
  23316. ,
  23317. n.prototype.CursorAnimation = function(a, b, c) {
  23318. function d() {
  23319. g.orient = r.Math.degToRad(window.orientation || 0)
  23320. }
  23321. function e(a) {
  23322. //console.log("ro")
  23323. var b = r.Math.degToRad(a.alpha)
  23324. , c = r.Math.degToRad(a.beta)
  23325. , d = r.Math.degToRad(a.gamma);
  23326. if (this.isHuawei5X ? (-1e3 === g.alpha && (g.alpha = b),
  23327. -1e3 === g.beta && (g.beta = c),
  23328. -1e3 === g.gamma && (g.gamma = d),
  23329. Math.abs(b - g.alpha) > .06 && (g.alpha = b),
  23330. Math.abs(c - g.beta) > .006 && (g.beta = c),
  23331. Math.abs(d - g.gamma) > .006 && (g.gamma = d)) : (g.alpha = b,
  23332. g.beta = c,
  23333. g.gamma = d),
  23334. n.vrDebug) {
  23335. $("#info-device-orientation").css("display", "block");
  23336. var e = "";
  23337. e += "alpha=(" + g.alpha + ")<BR/>",
  23338. e += "beta=(" + g.beta + ")<BR/>",
  23339. e += "gamma=" + g.gamma + "<BR/>",
  23340. document.getElementById("info-device-orientation").innerHTML = e
  23341. }
  23342. }
  23343. this.cursor = b,
  23344. this.raycaster = new r.Raycaster,
  23345. this.targetEventObj = {},
  23346. this.type = 1,
  23347. this.tweenFlag = !0;
  23348. var g = this;
  23349. this.target = c,
  23350. console.log(c.uuid),
  23351. this.euler = new r.Euler,
  23352. this.q0 = new r.Quaternion,
  23353. this.q1 = new r.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  23354. this.zee = new r.Vector3(0,0,1),
  23355. this.alpha = -1e3,
  23356. this.beta = -1e3,
  23357. this.gamma = -1e3,
  23358. this.orient = r.Math.degToRad(window.orientation || 0),
  23359. window.addEventListener("orientationchange", d),
  23360. window.addEventListener("deviceorientation", e),
  23361. this.setObjectQuaternion = function(a, b, d, e, f) {
  23362. g.euler.set(d, b, -e, "YXZ"),
  23363. a.setFromEuler(g.euler),
  23364. a.multiply(g.q1),
  23365. a.multiply(g.q0.setFromAxisAngle(g.zee, -f)),
  23366. c.updateMatrixWorld()
  23367. }
  23368. ,
  23369. parent !== window && window.addEventListener("message", function(a) {
  23370. var b = JSON.parse(a.data)
  23371. , c = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  23372. b && b.alpha && b.beta && b.gamma && function(a) {
  23373. var c = r.Math.degToRad(b.alpha)
  23374. , d = r.Math.degToRad(b.beta)
  23375. , e = r.Math.degToRad(b.gamma);
  23376. a ? (-1e3 === g.alpha && (g.alpha = c),
  23377. -1e3 === g.beta && (g.beta = d),
  23378. -1e3 === g.gamma && (g.gamma = e),
  23379. Math.abs(c - g.alpha) > .06 && (g.alpha = c),
  23380. Math.abs(d - g.beta) > .006 && (g.beta = d),
  23381. Math.abs(e - g.gamma) > .006 && (g.gamma = e)) : (g.alpha = c,
  23382. g.beta = d,
  23383. g.gamma = e)
  23384. }(c)
  23385. }),
  23386. this.update = function(a) {
  23387. TWEEN.update(),
  23388. window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient),
  23389. this.triggerTargetEvent())
  23390. }
  23391. ,
  23392. this.triggerTargetEvent = function() {
  23393. var a = this.choseObj()
  23394. , b = a ? a.object : void 0;
  23395. this.targetEventObj.currentObj = b,
  23396. b !== this.targetEventObj.lastObj && (b && this.autoCursorPosition(a),
  23397. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  23398. b && b.enabled && this.startAnimate(function() {
  23399. this.clickCallback(b)
  23400. }
  23401. .bind(this))) : this.type,
  23402. this.targetEventObj.lastObj = b)
  23403. }
  23404. ,
  23405. this.choseObj = function() {
  23406. this.raycaster.setFromCamera({
  23407. x: 0,
  23408. y: 0
  23409. }, c);
  23410. var a = (this.raycaster.ray,
  23411. window.vrMarkers)
  23412. , b = this.raycaster.intersectObjects(a);
  23413. if (b.length > 0)
  23414. return b[0]
  23415. }
  23416. ,
  23417. this.clickCallback = function(a) {
  23418. this.runTHREEAction(a, "onclick")
  23419. }
  23420. ,
  23421. this.runTHREEAction = function(a, b) {
  23422. switch (b) {
  23423. case "onclick":
  23424. a._listeners && a._listeners.click && a._listeners.click.forEach(function(a) {
  23425. a()
  23426. });
  23427. break;
  23428. case "onhover":
  23429. a._listeners && a._listeners.hover && a._listeners.hover.forEach(function(a) {
  23430. a()
  23431. });
  23432. break;
  23433. case "onout":
  23434. a._listeners && a._listeners.out && a._listeners.out.forEach(function(a) {
  23435. a()
  23436. })
  23437. }
  23438. }
  23439. ,
  23440. this.startAnimate = function(a) {
  23441. this.tweenFlag && this.initAnimation(a)
  23442. }
  23443. ,
  23444. this.initAnimation = function(a) {
  23445. var b = this
  23446. , c = this.cursor.material.map.offset
  23447. , d = function(a) {
  23448. return Math.floor(17 * a) / 17
  23449. };
  23450. b.tweenFlag = !1,
  23451. this.cursorAnimate = new TWEEN.Tween(c).to({
  23452. x: 1
  23453. }, 1e3).onStart(function() {
  23454. b.tweenFlag = !1
  23455. }).onStop(function() {
  23456. b.tweenFlag = !0,
  23457. this.x = 0,
  23458. c.x = 0
  23459. }).onUpdate(function() {}).onComplete(function() {
  23460. a(),
  23461. c.x = 0,
  23462. setTimeout(function() {
  23463. b.tweenFlag = !0
  23464. }, 1500)
  23465. }),
  23466. this.cursorAnimate.easing(d),
  23467. this.cursorAnimate.start()
  23468. }
  23469. ,
  23470. this.autoCursorPosition = function(a) {
  23471. // var b = Math.abs(a.distance - 10);
  23472. // this.cursor.position.z = -b,
  23473. // b /= 10;
  23474. // alert(b);
  23475. // this.cursor.scale.set(b, b, b)
  23476. this.cursor.scale.set(.3,.3,.3)
  23477. }
  23478. }
  23479. ,
  23480. n.prototype.vrRenderer = function(a, b, c) {
  23481. var d = new b.vrCamera(c);
  23482. d.bananaAspect = .8,
  23483. this.width,
  23484. this.height;
  23485. var b = this;
  23486. this.setSize = function(c, d) {
  23487. a.setSize.call(this, c, d),
  23488. b.width = c,
  23489. b.height = d
  23490. }
  23491. ,
  23492. this.render = function(b, c, e, f) {
  23493. window.cameraQua = c.quaternion.clone();
  23494. var g, h;
  23495. if (c.__RESS__SKIP__STEREO__)
  23496. return a.render(b, c, e, f);
  23497. if ("PerspectiveCamera" === c.type)
  23498. g = d.cameraL,
  23499. h = d.cameraR,
  23500. b.updateMatrixWorld(),
  23501. null === c.parent && c.updateMatrixWorld(),
  23502. d.vrCameraUpdate(c);
  23503. else {
  23504. if ("OrthographicCamera" !== c.type)
  23505. return DEBUG && console.error("Unsupported renderer: ", c.type);
  23506. g = h = c
  23507. }
  23508. a.setScissorTest(!0),
  23509. a.setScissor(0, 0, this.width / 2, this.height),
  23510. a.setViewport(0, 0, this.width / 2, this.height),
  23511. a.render.call(this, b, g, e, f),
  23512. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  23513. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  23514. a.render.call(this, b, h, e, f),
  23515. a.setScissorTest(!1)
  23516. }
  23517. ,
  23518. this.__proto__ = {
  23519. __proto__: a
  23520. }
  23521. }
  23522. ,
  23523. n.prototype.vrCamera = function(a) {
  23524. this.type = "StereoCamera",
  23525. this._aspect = 1,
  23526. this._overlap = .064,
  23527. this.cameraL = new r.PerspectiveCamera,
  23528. this.cameraL.layers.enable(1),
  23529. this.cameraL.matrixAutoUpdate = !1,
  23530. this.cameraR = new r.PerspectiveCamera,
  23531. this.cameraR.layers.enable(2),
  23532. this.cameraR.matrixAutoUpdate = !1,
  23533. this.eyeRight = new r.Matrix4,
  23534. this.eyeLeft = new r.Matrix4,
  23535. this.vrCameraNeedsUpdate = !0,
  23536. window.vrCameraL = this.cameraL; // fyz 记录vr相机
  23537. Object.defineProperty(this, "bananaAspect", {
  23538. get: function() {
  23539. return this._aspect
  23540. },
  23541. set: function(a) {
  23542. this._aspect !== a && (this.vrCameraNeedsUpdate = !0),
  23543. this._aspect = a
  23544. }
  23545. }),
  23546. Object.defineProperty(this, "overlap", {
  23547. get: function() {
  23548. return this._overlap
  23549. },
  23550. set: function(a) {
  23551. this._overlap !== a && (this.vrCameraNeedsUpdate = !0),
  23552. this._overlap = a
  23553. }
  23554. }),
  23555. this.vrCameraUpdate = function(a) {
  23556. this.vrCameraNeedsUpdate = true;
  23557. if (this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== a.fov || this.bananaReal_aspect !== a.aspect * this.bananaAspect || this.bananaNear !== a.near || this.bananaFar !== a.far,
  23558. this.vrCameraNeedsUpdate) {
  23559. this.vrCameraNeedsUpdate = !1,
  23560. console.debug("vrCameraUpdate"),
  23561. this.bananaFocus = a.focus,
  23562. this.bananaFov = a.fov,
  23563. this.bananaReal_aspect = a.aspect * this.bananaAspect,
  23564. this.bananaNear = a.near,
  23565. this.bananaFar = a.far,
  23566. console.debug(a.aspect),
  23567. this.bananaFocus = 10;
  23568. var b, c, d = a.projectionMatrix.clone(), e = this.overlap / 2, f = e * this.bananaNear / this.bananaFocus, g = this.bananaNear * Math.tan(Math.PI / 180 * this.bananaFov * .5);
  23569. this.eyeLeft.elements[12] = -e,
  23570. this.eyeRight.elements[12] = e,
  23571. b = -g * this.bananaReal_aspect + f,
  23572. c = g * this.bananaReal_aspect + f,
  23573. d.elements[0] = 2 * this.bananaNear / (c - b),
  23574. d.elements[8] = (c + b) / (c - b),
  23575. this.cameraL.projectionMatrix.copy(d),
  23576. b = -g * this.bananaReal_aspect - f,
  23577. c = g * this.bananaReal_aspect - f,
  23578. d.elements[0] = 2 * this.bananaNear / (c - b),
  23579. d.elements[8] = (c + b) / (c - b),
  23580. this.cameraR.projectionMatrix.copy(d)
  23581. }
  23582. this.cameraL.matrixWorld.copy(a.matrixWorld).multiply(this.eyeLeft),
  23583. this.cameraR.matrixWorld.copy(a.matrixWorld).multiply(this.eyeRight)
  23584. }
  23585. }
  23586. ,
  23587. n.prototype.boluoGetTexture = function(a) {
  23588. var b = new r.TextureLoader;
  23589. return b.crossOrigin = "anonymous",
  23590. b.load(a)
  23591. }
  23592. ,
  23593. /***********************************************************************************************************************************************************************************/
  23594. n.prototype.updateScreenSize = function() {//xzw 改 为了截屏 要改canvas大小 以及缩放时不模糊
  23595. var W,H;//当截屏时有setTimeout 期间不能恢复大小,所以要用W,H记录正常大小
  23596. return function(o){
  23597. var render = false;
  23598. var ratio;
  23599. var w, h; //记录应当render的大小
  23600. if(o && !o.resize && o.width!= void 0 && o.height!= void 0){
  23601. w = o.width, h = o.height, render = true, ratio=1;
  23602. }else{
  23603. w = $('#player').width();
  23604. h = $('#player').height();
  23605. o && o.resize && (W = this.renderWidth, H = this.renderHeight);
  23606. (w !== W || h !== H || this.forceUpdateSize) &&
  23607. (W = w, H = h, render = true, ratio = window.devicePixelRatio);
  23608. }
  23609. if(render){
  23610. this.setSize(w, h, ratio);
  23611. this.forceUpdateSize = !1
  23612. }
  23613. }
  23614. }()
  23615. ,
  23616. n.prototype.updateComponents = function() {
  23617. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  23618. this.updateListeners[t].update(e)
  23619. }
  23620. ,
  23621. n.prototype.suspend = function() {
  23622. this.started = !1,
  23623. this.suspendedObjects = this.scene.children.map(function(e) {
  23624. return this.scene.remove(e),
  23625. e
  23626. }
  23627. .bind(this)),
  23628. this.render()
  23629. }
  23630. ,
  23631. n.prototype.resume = function() {
  23632. this.suspendedObjects.forEach(function(e) {
  23633. this.scene.add(e)
  23634. }
  23635. .bind(this)),
  23636. this.suspendedObjects = [],
  23637. this.started = !0,
  23638. p()
  23639. }
  23640. ;
  23641. var p = function() {
  23642. this.started && (window.requestAnimationFrame(p),
  23643. this.updateScreenSize(), // fyz resize
  23644. this.updateComponents(),
  23645. this.updateTextureMemory(),
  23646. this.render(),
  23647. this.emit(a.AfterRender))
  23648. };
  23649. n.prototype.getImageData = function() {
  23650. var e = document.createElement("canvas")
  23651. , t = e.getContext("2d");
  23652. return function(i, n, r) {
  23653. return e.width === n && e.height === r || (e.width = n,
  23654. e.height = r),
  23655. t.drawImage(i, 0, 0, n, r),
  23656. t.getImageData(0, 0, n, r)
  23657. }
  23658. }(),
  23659. n.prototype.initSizedTexture2D = function(e, t, i) {
  23660. var n = this.renderer
  23661. , o = n.context
  23662. , a = n.state
  23663. , s = new r.Texture(null);
  23664. s.flipY = !1,
  23665. i !== !0 && (i = !1),
  23666. s.generateMipmaps = i;
  23667. var l = n.paramThreeToGL(s.format)
  23668. , c = n.paramThreeToGL(s.type)
  23669. , h = n.properties.get(s)
  23670. , u = o.createTexture();
  23671. a.bindTexture(o.TEXTURE_2D, u),
  23672. o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, s.flipY),
  23673. o.texImage2D(o.TEXTURE_2D, 0, l, e, e, 0, l, c, null),
  23674. s.wrapS = t,
  23675. s.wrapT = t;
  23676. var d = n.paramThreeToGL(t);
  23677. return o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, d),
  23678. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, d),
  23679. i ? (s.magFilter = r.LinearFilter,
  23680. s.minFilter = r.LinearMipMapLinearFilter,
  23681. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  23682. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR_MIPMAP_NEAREST),
  23683. o.generateMipmap(o.TEXTURE_2D)) : (s.magFilter = r.LinearFilter,
  23684. s.minFilter = r.LinearFilter,
  23685. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  23686. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR)),
  23687. a.bindTexture(o.TEXTURE_2D, null),
  23688. h.__webglTexture = u,
  23689. s
  23690. }
  23691. ,
  23692. n.prototype.initSizedCubeMap = function(e, t) {
  23693. var i = this.renderer
  23694. , n = i.context
  23695. , o = i.state
  23696. , a = new r.CubeTexture([null, null, null, null, null, null]);
  23697. a.flipY = !1,
  23698. a.generateMipmaps = t;
  23699. var s = i.paramThreeToGL(a.format)
  23700. , l = i.paramThreeToGL(a.type)
  23701. , c = i.properties.get(a)
  23702. , h = n.createTexture();
  23703. o.bindTexture(n.TEXTURE_CUBE_MAP, h),
  23704. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, a.flipY);
  23705. for (var u = 0; u < 6; u++)
  23706. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + u, 0, s, e, e, 0, s, l, null);
  23707. return t ? (a.magFilter = r.LinearFilter,
  23708. a.minFilter = r.LinearMipMapLinearFilter,
  23709. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23710. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  23711. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  23712. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (a.magFilter = r.LinearFilter,
  23713. a.minFilter = r.LinearFilter,
  23714. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23715. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  23716. o.bindTexture(n.TEXTURE_CUBE_MAP, null),
  23717. c.__image__webglTextureCube = h,
  23718. a
  23719. }
  23720. ,
  23721. n.prototype.deallocateCubeTexture = function(e) {
  23722. var t = this.renderer
  23723. , i = t.context
  23724. , n = t.properties.get(e);
  23725. i.deleteTexture(n.__image__webglTextureCube)
  23726. }
  23727. ,
  23728. n.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  23729. var a = this.renderer
  23730. , s = a.context
  23731. , l = a.state
  23732. , c = a.properties.get(t);
  23733. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  23734. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23735. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  23736. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  23737. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  23738. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  23739. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  23740. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  23741. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  23742. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  23743. l.bindTexture(s.TEXTURE_2D, null)
  23744. }
  23745. ,
  23746. n.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  23747. var s = this.renderer
  23748. , l = s.context
  23749. , c = s.state
  23750. , h = s.properties.get(t);
  23751. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  23752. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23753. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  23754. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  23755. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  23756. }
  23757. ,
  23758. n.prototype.rebuildMipMaps2D = function(e) {
  23759. var t = this.renderer
  23760. , i = t.context
  23761. , n = t.state;
  23762. t.properties.get(e);
  23763. i.generateMipmap(i.TEXTURE_2D),
  23764. n.bindTexture(i.TEXTURE_2D, null)
  23765. }
  23766. ,
  23767. n.prototype.rebuildMipMaps3D = function(e) {
  23768. var t = this.renderer
  23769. , i = t.context
  23770. , n = t.state
  23771. , r = t.properties.get(e);
  23772. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  23773. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  23774. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  23775. }
  23776. ,
  23777. n.prototype.renderToCubeMap = function() {
  23778. var e = !1
  23779. , t = null
  23780. , i = null
  23781. , n = null
  23782. , a = null
  23783. , s = null
  23784. , l = 1;
  23785. return function(c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w) {
  23786. var _ = this.renderer;
  23787. _.context;
  23788. e || (i = new r.OrthographicCamera(l / -2,l / 2,l / 2,l / -2,-200,200),
  23789. i.position.z = 150,
  23790. t = new r.Scene,
  23791. t.add(i),
  23792. n = new r.ShaderMaterial({
  23793. uniforms: {
  23794. tDiffuse: {
  23795. type: "t",
  23796. value: null
  23797. },
  23798. alpha: {
  23799. type: "f",
  23800. value: 1
  23801. }
  23802. },
  23803. vertexShader: o.basicTextured.vertexShader,
  23804. fragmentShader: o.basicTextured.fragmentShader,
  23805. depthWrite: !1,
  23806. depthTest: !1,
  23807. side: r.DoubleSide
  23808. }),
  23809. a = new r.PlaneBufferGeometry(l,l),
  23810. s = new r.Mesh(a,n),
  23811. s.position.z = 0,
  23812. t.add(s),
  23813. e = !0);
  23814. var T = a.getAttribute("uv");
  23815. T.setDynamic(!0),
  23816. T.needsUpdate = !0;
  23817. var x = T.array
  23818. , S = p / u
  23819. , M = f / d
  23820. , R = g / u
  23821. , P = m / d;
  23822. x[0] = S,
  23823. x[1] = M + P,
  23824. x[2] = S + R,
  23825. x[3] = M + P,
  23826. x[4] = S,
  23827. x[5] = M,
  23828. x[6] = S + R,
  23829. x[7] = M;
  23830. var O = a.getAttribute("position");
  23831. O.setDynamic(!0),
  23832. O.needsUpdate = !0;
  23833. var L = O.array
  23834. , D = v / h.width - l / 2
  23835. , N = A / h.height - l / 2
  23836. , B = y / h.width
  23837. , F = C / h.height;
  23838. L[0] = D,
  23839. L[1] = N + F,
  23840. L[3] = D + B,
  23841. L[4] = N + F,
  23842. L[6] = D,
  23843. L[7] = N,
  23844. L[9] = D + B,
  23845. L[10] = N;
  23846. this.renderer.properties.get(c);
  23847. n.uniforms.tDiffuse.value = c,
  23848. n.blending = E || r.NoBlending,
  23849. n.transparent = !!b,
  23850. void 0 !== w && null !== w || (w = 1),
  23851. n.uniforms.alpha.value = w,
  23852. n.needUpdate = !0,
  23853. h.activeCubeFace = I,
  23854. h.viewport.set(0, 0, h.width, h.height);
  23855. var V = this.renderer.autoClear;
  23856. this.renderer.autoClear = !1,
  23857. this.renderer.render(t, i, h, !1),
  23858. this.renderer.autoClear = V
  23859. }
  23860. }(),
  23861. n.prototype.copyCubeMap = function() {
  23862. var e = !1
  23863. , t = null
  23864. , i = null
  23865. , a = null
  23866. , s = null
  23867. , l = null
  23868. , c = new r.Euler;
  23869. new r.Vector3;
  23870. return function(h, u, d, p, f, g, m, v, A) {
  23871. this.renderer;
  23872. if (!e) {
  23873. var y = 2;
  23874. i = new r.OrthographicCamera(y / -2,y / 2,y / 2,y / -2,0,200),
  23875. i.position.set(0, 0, 0),
  23876. t = new r.Scene,
  23877. t.add(i),
  23878. a = new r.ShaderMaterial({
  23879. uniforms: {
  23880. tDiffuse: {
  23881. type: "t",
  23882. value: null
  23883. },
  23884. alpha: {
  23885. type: "f",
  23886. value: 1
  23887. }
  23888. },
  23889. vertexShader: o.copyCubeMap.vertexShader,
  23890. fragmentShader: o.copyCubeMap.fragmentShader,
  23891. depthWrite: !1,
  23892. depthTest: !1,
  23893. side: r.DoubleSide
  23894. }),
  23895. s = new r.BoxGeometry(y,y,y),
  23896. l = new r.Mesh(s,a),
  23897. t.add(l),
  23898. e = !0
  23899. }
  23900. for (var C = 0; C < 6; C++)
  23901. n.getCubeOrientationForCubeFace(C, c),
  23902. l.rotation.copy(c),
  23903. l.matrixWorldNeedsUpdate = !0,
  23904. l.updateMatrixWorld(),
  23905. a.uniforms.tDiffuse.value = h,
  23906. a.blending = m || r.NoBlending,
  23907. a.transparent = !!v,
  23908. void 0 !== A && null !== A || (A = 1),
  23909. a.uniforms.alpha.value = A,
  23910. a.needUpdate = !0,
  23911. u.activeCubeFace = C,
  23912. u.viewport.set(0, 0, f, g),
  23913. this.renderer.render(t, i, u, !1)
  23914. }
  23915. }(),
  23916. n.getLookAtForCubeFace = function(e, t) {
  23917. switch (e) {
  23918. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23919. t.set(1, 0, 0);
  23920. break;
  23921. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23922. t.set(-1, 0, 0);
  23923. break;
  23924. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23925. t.set(0, 1, 0);
  23926. break;
  23927. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23928. t.set(0, -1, 0);
  23929. break;
  23930. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23931. t.set(0, 0, 1);
  23932. break;
  23933. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23934. t.set(0, 0, -1)
  23935. }
  23936. }
  23937. ,
  23938. n.getCubeOrientationForCubeFace = function(e, t) {
  23939. switch (e) {
  23940. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23941. t.set(0, -Math.PI / 2, 0);
  23942. break;
  23943. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23944. t.set(0, Math.PI / 2, 0);
  23945. break;
  23946. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23947. t.set(Math.PI / 2, Math.PI, 0);
  23948. break;
  23949. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23950. t.set(-Math.PI / 2, Math.PI, 0);
  23951. break;
  23952. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23953. t.set(0, -Math.PI, 0);
  23954. break;
  23955. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23956. t.set(0, 0, 0)
  23957. }
  23958. }
  23959. ,
  23960. t.exports = n
  23961. }
  23962. , {
  23963. "../enum/GLCubeFaces": 25,
  23964. "../enum/GLTextureType": 26,
  23965. "../enum/SceneRendererEvents": 43,
  23966. "../exception/BasicException": 55,
  23967. "../exception/RendererCreationException": 57,
  23968. "../settings": 166,
  23969. "../shaders": 167,
  23970. /********************************************************************fyz改 from徐世廷**********************************************************************/
  23971. "../util/browser": 182,
  23972. /************************************************************************************************************************************************/
  23973. events: 202,
  23974. three: 217
  23975. }],
  23976. 159: [function(e, t, i) {
  23977. "use strict";
  23978. function n(e) {
  23979. this.messenger = new a(e),
  23980. this.clientKey = null
  23981. }
  23982. var r = e("../util/ajax")
  23983. , o = e("./PostMessageType")
  23984. , a = e("./postmessage")
  23985. , s = e("./VersionInfo")
  23986. , l = e("events").EventEmitter
  23987. , c = window.location.origin + "/api/v1/user/";
  23988. n.prototype = Object.create(l.prototype),
  23989. n.prototype.bindEvents = function() {
  23990. this.messenger.on(o.ACTION, this.onMessageReceived.bind(this))
  23991. }
  23992. ,
  23993. n.prototype.waitForConnection = function() {
  23994. var e = new Promise(function(e, t) {
  23995. this.messenger.on(o.CONNECT, function(i) {
  23996. this.onConnectionReceived(i).then(e.bind(this, i.sdkVersion), t.bind())
  23997. }
  23998. .bind(this))
  23999. }
  24000. .bind(this));
  24001. return e
  24002. }
  24003. ,
  24004. n.prototype.onConnectionReceived = function(e) {
  24005. return this.messenger.setTarget(e.source, e.origin),
  24006. this.verifyConnection(e).then(function(t, i) {
  24007. this.messenger.send({
  24008. type: o.ACCEPT,
  24009. toId: e.fromId,
  24010. warning: i
  24011. }),
  24012. this.clientKey = t,
  24013. this.messenger.removeAllListeners(o.CONNECT),
  24014. this.bindEvents()
  24015. }
  24016. .bind(this), function(t) {
  24017. this.messenger.send({
  24018. type: o.REJECT,
  24019. toId: e.fromId,
  24020. reason: t
  24021. }),
  24022. this.messenger.setTarget()
  24023. }
  24024. .bind(this))
  24025. }
  24026. ,
  24027. n.prototype.verifyConnection = function(e) {
  24028. return new Promise(function(t, i) {
  24029. var n;
  24030. if (s.isDeprecated(e.sdkVersion))
  24031. n = "这个版本正在被弃用";
  24032. else if (!s.isSupported(e.sdkVersion))
  24033. return i("不支持此版本的SDK");
  24034. var o = {
  24035. cache: !1,
  24036. headers: {
  24037. "X-port-Application-Key": e.applicationKey,
  24038. "X-port-Referrer": e.origin
  24039. }
  24040. };
  24041. r.get(c, o).done(t.bind(this, e.applicationKey, n)).fail(i.bind(this, "key/referrer mismatch"))
  24042. }
  24043. )
  24044. }
  24045. ,
  24046. n.prototype.onMessageReceived = function(e) {
  24047. if (this.validateClientApplicationKey(e.applicationKey)) {
  24048. var t = this;
  24049. e.onDone = function(i) {
  24050. i.toId = e.fromId,
  24051. i.uid = e.uid,
  24052. i.type = o.RESPONSE,
  24053. t.messenger.send(i)
  24054. }
  24055. ,
  24056. this.emit(o.ACTION, e)
  24057. }
  24058. }
  24059. ,
  24060. n.prototype.validateClientApplicationKey = function(e) {
  24061. return this.clientKey === e
  24062. }
  24063. ,
  24064. n.prototype.sendEvent = function(e, t) {
  24065. this.messenger.send({
  24066. type: o.EVENT,
  24067. eventType: e,
  24068. eventData: t
  24069. })
  24070. }
  24071. ,
  24072. t.exports = n
  24073. }
  24074. , {
  24075. "../util/ajax": 181,
  24076. "./PostMessageType": 160,
  24077. "./VersionInfo": 163,
  24078. "./postmessage": 165,
  24079. events: 202
  24080. }],
  24081. 160: [function(e, t, i) {
  24082. "use strict";
  24083. t.exports = Object.freeze({
  24084. CONNECT: "postmessage.connect",
  24085. ACCEPT: "postmessage.accept",
  24086. REJECT: "postmessage.reject",
  24087. ACTION: "postmessage.action",
  24088. RESPONSE: "postmessage.response",
  24089. EVENT: "postmessage.event"
  24090. })
  24091. }
  24092. , {}],
  24093. 161: [function(e, t, i) {
  24094. "use strict";
  24095. t.exports = Object.freeze({
  24096. MOVE: "sdk.move",
  24097. ENTER_PANO: "sdk.enterpano",
  24098. MODEL_LOADED: "sdk.modelloaded"
  24099. })
  24100. }
  24101. , {}],
  24102. 162: [function(e, t, i) {
  24103. "use strict";
  24104. t.exports = Object.freeze({
  24105. FLY: "transition.fly",
  24106. FADEOUT: "transition.fade",
  24107. INSTANT: "transition.instant"
  24108. })
  24109. }
  24110. , {}],
  24111. 163: [function(e, t, i) {
  24112. "use strict";
  24113. t.exports = {
  24114. current: "1.0",
  24115. supported: ["1.0"],
  24116. deprecated: [],
  24117. isSupported: function(e) {
  24118. return this.supported.indexOf(e) !== -1
  24119. },
  24120. isDeprecated: function(e) {
  24121. return this.deprecated.indexOf(e) !== -1
  24122. },
  24123. isValid: function(e) {
  24124. return this.isSupported(e) || this.isDeprecated(e)
  24125. }
  24126. }
  24127. }
  24128. , {}],
  24129. 164: [function(e, t, i) {
  24130. (function(i) {
  24131. "use strict";
  24132. function n(e, t, i) {
  24133. e && (e = e.toLowerCase().trim());
  24134. var n = new I.UP.clone
  24135. , r = Math.PI / 3
  24136. , o = Math.PI / 2;
  24137. switch (e) {
  24138. case "left":
  24139. i.copy(t),
  24140. i.applyAxisAngle(n, o);
  24141. break;
  24142. case "right":
  24143. i.copy(t),
  24144. i.applyAxisAngle(n, -o);
  24145. break;
  24146. case "forwardleft":
  24147. i.copy(t),
  24148. i.applyAxisAngle(n, r);
  24149. break;
  24150. case "forwardright":
  24151. i.copy(t),
  24152. i.applyAxisAngle(n, -r);
  24153. break;
  24154. case "forward":
  24155. default:
  24156. i.copy(t)
  24157. }
  24158. return i
  24159. }
  24160. function r(e, t) {
  24161. if (e) {
  24162. var i = {
  24163. pano: e,
  24164. lookAtPoint: null,
  24165. duration: null,
  24166. maxDistanceOverride: null,
  24167. skipWarpingCheck: !1
  24168. };
  24169. this.player.flyToPano(i, function() {
  24170. t && t({
  24171. success: !0,
  24172. message: "Transition complete."
  24173. })
  24174. })
  24175. } else
  24176. R.warn("Showcase -> clickPanoObject: Unable to find pano."),
  24177. t && t({
  24178. success: !1,
  24179. error: "Unable to find pano."
  24180. })
  24181. }
  24182. function o(e, t) {
  24183. var i = this.findRankedPano(e, t);
  24184. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  24185. null)
  24186. }
  24187. function a(e, t) {
  24188. var i = this.findRankedtag(e, t);
  24189. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  24190. null)
  24191. }
  24192. function s(e, t) {
  24193. t.copy(I.FORWARD),
  24194. e.getDirection(t)
  24195. }
  24196. function l(e) {
  24197. function t(e) {
  24198. var t = (new c.Euler).setFromQuaternion(e.quaternion, "YXZ");
  24199. return {
  24200. x: c.Math.radToDeg(t._x),
  24201. y: c.Math.radToDeg(t._y),
  24202. z: c.Math.radToDeg(t._z)
  24203. }
  24204. }
  24205. var i = function(e) {
  24206. return e.alignmentType !== m.ALIGNED ? null : {
  24207. x: e.position.x,
  24208. y: e.position.y,
  24209. z: e.position.z
  24210. }
  24211. };
  24212. return {
  24213. panos: e.panos.list.map(function(n) {
  24214. var r = y.getCubemapUrls(e.urls, n.id, "high")[C.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  24215. return {
  24216. uuid: n.id,
  24217. aligned: n.alignmentType === m.ALIGNED,
  24218. neighbourUUIDs: n.neighbourUUIDs.slice(),
  24219. position: i(n),
  24220. rotation: t(n),
  24221. thumbnail: r
  24222. }
  24223. })
  24224. }
  24225. }
  24226. var c = e("three")
  24227. , h = e("./ApiHost")
  24228. , u = e("../util/logger")
  24229. , d = e("../util/common")
  24230. , p = e("../util/math")
  24231. , f = e("../enum/ModelManagerEvents")
  24232. , g = e("./PostMessageType")
  24233. , m = e("../enum/AlignmentType")
  24234. , v = e("../enum/Direction")
  24235. , A = e("./TransitionStyles")
  24236. , y = e("../util/panorama")
  24237. , C = e("../enum/GLCubeFaces")
  24238. , I = e("../enum/Vectors")
  24239. , E = e("../enum/Viewmode")
  24240. , b = e("../enum/WarpStyle")
  24241. , w = (e("../enum/Keys"),
  24242. e("../enum/PlayerEvents"))
  24243. , _ = e("../sdk/SdkEvents")
  24244. , I = e("../enum/Vectors")
  24245. , T = e("../enum/ControlEvents")
  24246. , x = e("../enum/RenderLayers")
  24247. , S = (e("../constants"),
  24248. e("../settings"))
  24249. , M = e("../lib/jpeg_encoder")
  24250. , R = new u(i)
  24251. , P = function() {
  24252. var e = function e() {
  24253. e.playerDirection.copy(e.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  24254. e.player.getDirection(e.playerDirection),
  24255. e.projectVectors();
  24256. var t = e.playerDirection.angleTo(e.lastFacingDirection);
  24257. if (e.angleTravelled += Math.abs(t),
  24258. e.angleTravelled >= Math.abs(e.angle)) {
  24259. if (e.active = !1,
  24260. e.onDone) {
  24261. var i = e.onDone;
  24262. i()
  24263. }
  24264. } else
  24265. e.lastFacingDirection.copy(e.playerDirection),
  24266. window.setTimeout(e, 4)
  24267. };
  24268. return e.active = !1,
  24269. e.angle = 0,
  24270. e.angleTravelled = 0,
  24271. e.playerDirection = new c.Vector3,
  24272. e.lastFacingDirection = new c.Vector3,
  24273. e.onDone = null,
  24274. e.player = null,
  24275. e.start = function(t, i, n, r) {
  24276. e.active = !0,
  24277. t && i && (i = 0),
  24278. e.angle = t || i,
  24279. e.xAngle = t,
  24280. e.yAngle = i,
  24281. e.angleTravelled = 0,
  24282. e.playerDirection.copy(n.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  24283. n.getDirection(e.playerDirection),
  24284. e.lastFacingDirection.copy(e.playerDirection),
  24285. e.projectVectors(),
  24286. e.onDone = r,
  24287. e.player = n,
  24288. e()
  24289. }
  24290. ,
  24291. e.projectVectors = function() {
  24292. e.xAngle && (e.playerDirection.projectOnPlane(I.UP),
  24293. e.lastFacingDirection.projectOnPlane(I.UP))
  24294. }
  24295. ,
  24296. e
  24297. }()
  24298. , O = function() {
  24299. var e = new c.Vector3;
  24300. return function(t) {
  24301. t ? (e.copy(t.position),
  24302. e.add(t.discPosition),
  24303. p.projectPositionToCanvas(e, this.player.camera, e),
  24304. this.click(e.x, e.y)) : R.warn("Showcase -> clicktagObject: Unable to find tag.")
  24305. }
  24306. }()
  24307. , L = function() {
  24308. return this.player.mode === E.PANORAMA ? S.insideLookLimitUp : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.minPolarAngle) : null
  24309. }
  24310. , D = function() {
  24311. return this.player.mode === E.PANORAMA ? S.insideLookLimitDown : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.maxPolarAngle) : null
  24312. }
  24313. , N = function(e) {
  24314. var t = new c.Vector3;
  24315. return function(e) {
  24316. var i = this.player.getDirection();
  24317. t.copy(i);
  24318. var n = t.y;
  24319. t.y = 0,
  24320. t.normalize();
  24321. var r = c.Math.radToDeg(t.angleTo(i)) * (n < 0 ? -1 : 1);
  24322. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.PANORAMA)
  24323. return 0 !== e && R.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  24324. 0;
  24325. this.player.mode === E.DOLLHOUSE && (r = -r);
  24326. var o = L.call(this) - .1
  24327. , a = D.call(this) + .1
  24328. , s = r + e;
  24329. s > o ? s = o : s < a && (s = a);
  24330. var l = s - r;
  24331. return e > 0 && l < .01 && (l = 0),
  24332. e < 0 && l > -.01 && (l = 0),
  24333. l
  24334. }
  24335. }()
  24336. , B = function() {
  24337. var e = new c.Euler;
  24338. return function(t) {
  24339. return e.setFromQuaternion(t.quaternion, "YXZ"),
  24340. {
  24341. position: {
  24342. x: t.position.x,
  24343. y: t.position.y,
  24344. z: t.position.z
  24345. },
  24346. rotation: {
  24347. x: c.Math.radToDeg(e.x),
  24348. y: c.Math.radToDeg(e.y),
  24349. z: 0
  24350. },
  24351. pano: t.currentPano ? t.currentPano.id : null,
  24352. mode: t.mode
  24353. }
  24354. }
  24355. }()
  24356. , F = null;
  24357. t.exports = {
  24358. init: function(e, t, i, n, r) {
  24359. V.init(e, t, i, r),
  24360. F = new Promise(function(e, t) {
  24361. i.on(w.Ready, function() {
  24362. e()
  24363. })
  24364. }
  24365. .bind(this));
  24366. var o = new h(window)
  24367. , a = o.waitForConnection();
  24368. a.then(function(e) {
  24369. o.on(g.ACTION, V.onMessageReceive.bind(V))
  24370. });
  24371. var s = function() {
  24372. var e = Date.now();
  24373. return function() {
  24374. if (!(Date.now() - e < 100)) {
  24375. var t = B(i);
  24376. o.sendEvent(_.MOVE, {
  24377. state: t
  24378. }),
  24379. e = Date.now()
  24380. }
  24381. }
  24382. }();
  24383. i.on(w.Move, s),
  24384. i.on(w.ViewChanged, s),
  24385. n.on(f.ActiveModelChanged, function(e) {
  24386. function t(e) {
  24387. var t, i = e.newPano.id;
  24388. e.oldPano && (t = e.oldPano.id),
  24389. i !== t && o.sendEvent(_.ENTER_PANO, {
  24390. oldPano: t,
  24391. newPano: i
  24392. })
  24393. }
  24394. var i = e.model
  24395. , n = e.oldModel;
  24396. V.model = i,
  24397. a.then(function() {
  24398. o.sendEvent(_.MODEL_LOADED, {
  24399. metadata: l(i)
  24400. })
  24401. }),
  24402. n && n.panos.forEach(function(e) {
  24403. e.removeEventListener("enter", t)
  24404. }),
  24405. i.panos.forEach(function(e) {
  24406. e.on("enter", t)
  24407. })
  24408. })
  24409. }
  24410. };
  24411. var V = {
  24412. director: null,
  24413. player: null,
  24414. controls: null,
  24415. sceneRenderer: null,
  24416. model: null,
  24417. init: function(e, t, i, n) {
  24418. this.director = e,
  24419. this.player = i,
  24420. this.controls = t,
  24421. this.sceneRenderer = n
  24422. },
  24423. handleToObject: {},
  24424. objectToHandle: {},
  24425. handleCount: 0,
  24426. onMessageReceive: function(e) {
  24427. if (e) {
  24428. var t = e.targetFunction
  24429. , i = e.params
  24430. , n = e.onDone;
  24431. t && this[t] && this[t](i, n)
  24432. }
  24433. },
  24434. waitForInit: function(e, t) {
  24435. F.then(t.bind({
  24436. success: !0,
  24437. message: "Init complete."
  24438. }))
  24439. },
  24440. moveToPano: function(e, t) {
  24441. var i = new c.Euler(0,0,0,"YXZ")
  24442. , n = new c.Quaternion;
  24443. return function(e, t) {
  24444. var r = e.pano
  24445. , o = e.rotation
  24446. , a = e.transition;
  24447. if (!this.model)
  24448. return t({
  24449. success: !1,
  24450. error: "The model has not been loaded yet"
  24451. });
  24452. var s = this.model.panos.get(r);
  24453. if (!s)
  24454. return t({
  24455. success: !1,
  24456. error: r + " does not exist in this model"
  24457. });
  24458. if (!o)
  24459. return t({
  24460. sucess: !1,
  24461. erorr: o + " is not a valid rotation"
  24462. });
  24463. i.set(c.Math.degToRad(o.x || 0), c.Math.degToRad(o.y || 0), c.Math.degToRad(o.z || 0), "YXZ"),
  24464. console.log(o.z);
  24465. var l = {
  24466. success: !0,
  24467. message: r
  24468. };
  24469. if (a === A.FADEOUT)
  24470. n.setFromEuler(i),
  24471. this.player.warpToPano(s, n, null, null, b.BLACK, null, null, t.bind(this, l));
  24472. else {
  24473. var h, u;
  24474. a === A.INSTANT && (h = 0,
  24475. u = 0);
  24476. var d = I.FORWARD.clone().applyEuler(i).add(s.position);
  24477. this.player.flyToPano({
  24478. pano: s,
  24479. lookAtPoint: d,
  24480. duration: h,
  24481. aimDuration: u
  24482. }, t.bind(this, l))
  24483. }
  24484. }
  24485. }(),
  24486. moveInDirection: function(e, t) {
  24487. var i = e.direction;
  24488. return "undefined" == typeof v[i] ? (R.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  24489. void (t && t({
  24490. success: !1,
  24491. error: "Invalid direction."
  24492. }))) : void this.player.flyLocalDirection(I[i].clone()).then(function(e) {
  24493. t(e ? {
  24494. success: !0,
  24495. message: "moved " + i
  24496. } : {
  24497. success: !1,
  24498. error: "Cannot move in direction: " + i
  24499. })
  24500. })
  24501. },
  24502. getPose: function(e, t) {
  24503. this.player.camera.position,
  24504. (new c.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ");
  24505. return t({
  24506. success: !0,
  24507. message: B(this.player)
  24508. })
  24509. },
  24510. takeScreenShot: function() {
  24511. var e = new c.PerspectiveCamera
  24512. , t = new c.WebGLRenderTarget;
  24513. return function(i, n) {
  24514. if (!i.resolution)
  24515. return n({
  24516. success: !1,
  24517. error: "An invalid resolution was specified"
  24518. });
  24519. if (i.resolution.width === -1 || i.resolution.height === -1) {
  24520. var r = this.sceneRenderer.renderer.getSize();
  24521. i.resolution.width = r.width,
  24522. i.resolution.height = r.height
  24523. }
  24524. e.layers.set(x.DEFAULT),
  24525. i.visibleObjects && (i.visibleObjects.showtags && e.layers.enable(x.TAG),
  24526. i.visibleObjects.showPucks && e.layers.enable(x.PANOMARKERS),
  24527. i.visibleObjects.showReticule && e.layers.enable(x.RETICULE));
  24528. var o = i.resolution.width
  24529. , a = i.resolution.height
  24530. , s = o / a;
  24531. e.position.copy(this.sceneRenderer.camera.position),
  24532. e.quaternion.copy(this.sceneRenderer.camera.quaternion),
  24533. e.projectionMatrix.copy(this.player.camera.projectionMatrix),
  24534. e.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / s,
  24535. t.setSize(o, a),
  24536. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, e, t);
  24537. var l = new Uint8Array(o * a * 4);
  24538. this.sceneRenderer.renderer.readRenderTargetPixels(t, 0, 0, o, a, l);
  24539. var c = M.encode({
  24540. data: l,
  24541. width: o,
  24542. height: a,
  24543. heading: 180,
  24544. pitch: 0
  24545. }, {
  24546. quality: 75,
  24547. flipY: !0
  24548. })
  24549. , h = "data:image/jpg;base64," + d.uint8ToBase64(c.data);
  24550. n({
  24551. success: !0,
  24552. message: h
  24553. })
  24554. }
  24555. }(),
  24556. findRankedPano: function(e, t) {
  24557. var i = new c.Vector3
  24558. , r = new c.Vector3;
  24559. return function(e, t) {
  24560. s(this.player, r),
  24561. n(t, r, i);
  24562. var o = this.player.rankedPanoInDirection(e, i);
  24563. if (o) {
  24564. var a = this.objectToHandle[o.id];
  24565. return a || (this.objectToHandle[o.id] = a = this.handleCount++,
  24566. this.handleToObject[a] = o),
  24567. a
  24568. }
  24569. return R.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  24570. -1
  24571. }
  24572. }(),
  24573. findRankedtag: function(e, t) {
  24574. var i = new c.Vector3
  24575. , r = new c.Vector3;
  24576. return function(e, t) {
  24577. s(this.player, r),
  24578. n(t, r, i);
  24579. var o = this.player.rankedtagInDirection(e, i);
  24580. if (o) {
  24581. var a = this.objectToHandle[o.sid];
  24582. return a || (this.objectToHandle[o.sid] = a = this.handleCount++,
  24583. this.handleToObject[a] = o),
  24584. a
  24585. }
  24586. return R.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  24587. -1
  24588. }
  24589. }(),
  24590. clickNearesttag: function(e) {
  24591. this.clickRankedtag(0, e)
  24592. },
  24593. clickRankedtag: function(e, t) {
  24594. var i = a.call(this, e, t);
  24595. i && O.call(this, i)
  24596. },
  24597. clickNearestPano: function(e, t) {
  24598. this.clickRankedPano(0, e, t)
  24599. },
  24600. clickRankedPano: function(e, t, i) {
  24601. var n = o.call(this, e, t);
  24602. n ? r.call(this, n, i) : i(null)
  24603. },
  24604. clickPano: function(e, t) {
  24605. var i = this.handleTable[e];
  24606. i ? r.call(this, i, t) : t(null)
  24607. },
  24608. rotateDirection: function() {
  24609. return function(e, t) {
  24610. var i = e.direction
  24611. , n = e.angle;
  24612. if (!P.active) {
  24613. var r = 0
  24614. , o = 0
  24615. , a = 0
  24616. , s = 0;
  24617. if (!n || isNaN(n))
  24618. return R.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  24619. void (t && t({
  24620. success: !1,
  24621. error: "Invalid rotation angle."
  24622. }));
  24623. if (this.player.mode === E.TRANSITIONING)
  24624. return R.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  24625. void (t && t({
  24626. success: !1,
  24627. error: "Cannot rotate while transitioning"
  24628. }));
  24629. if (i === v.RIGHT || i === v.LEFT)
  24630. i === v.RIGHT && (n = -n),
  24631. r = n > 0 ? -1 : 1,
  24632. a = n;
  24633. else {
  24634. if (i !== v.UP && i !== v.DOWN)
  24635. return R.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  24636. void (t && t({
  24637. success: !1,
  24638. error: "Invalid direction for rotation."
  24639. }));
  24640. if (this.player.mode === E.FLOORPLAN)
  24641. return R.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  24642. void (t && t({
  24643. success: !1,
  24644. error: "Cannot rotate " + i + " in floorplan mode"
  24645. }));
  24646. if (i === v.DOWN && (n = -n),
  24647. n = N.call(this, n),
  24648. 0 === n)
  24649. return R.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  24650. void (t && t({
  24651. success: !1,
  24652. error: "Already at maximum rotation in direction: " + i
  24653. }));
  24654. o = n > 0 ? 1 : -1,
  24655. s = n
  24656. }
  24657. var l = n;
  24658. n = c.Math.degToRad(n),
  24659. a = c.Math.degToRad(a),
  24660. s = c.Math.degToRad(s);
  24661. var h = this.controls.activeControl
  24662. , u = function() {
  24663. h.stopRotating(!0),
  24664. t && t({
  24665. success: !0,
  24666. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  24667. })
  24668. };
  24669. h.startRotating(r, o),
  24670. P.start(a, s, this.player, u)
  24671. }
  24672. }
  24673. }(),
  24674. rotate: function() {
  24675. var e = new c.Vector3
  24676. , t = new c.Vector3;
  24677. return function(i, n) {
  24678. var r = i.xAngle
  24679. , o = i.yAngle;
  24680. if (!P.active) {
  24681. if (r = r || 0,
  24682. o = o || 0,
  24683. isNaN(r) || isNaN(o))
  24684. return R.warn("Showcase -> rotate: Invalid rotation angle."),
  24685. void (n && n({
  24686. success: !1,
  24687. error: "Invalid rotation angle."
  24688. }));
  24689. if (this.player.mode === E.TRANSITIONING)
  24690. return R.warn("Automation -> rotate: Cannot rotate while transitioning"),
  24691. void (n && n({
  24692. success: !1,
  24693. error: "Cannot rotate while transitioning"
  24694. }));
  24695. Math.abs(r) < .01 && (r = 0),
  24696. Math.abs(o) < .01 && (o = 0);
  24697. var a = o;
  24698. o = N.call(this, o),
  24699. r = -r;
  24700. var s = a > 0 ? "UP" : "DOWN";
  24701. if (!r && a && !o)
  24702. return R.warn("Showcase -> rotate: Already at maximum rotation in direction: " + s),
  24703. void (n && n({
  24704. success: !1,
  24705. error: "Already at maximum rotation in direction: " + s
  24706. }));
  24707. a > o && R.warn("Showcase -> rotate: Reached maximum rotation in direction: " + s);
  24708. var l = o;
  24709. o = c.Math.degToRad(o),
  24710. r = c.Math.degToRad(r),
  24711. e.copy(this.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  24712. this.player.getDirection(e),
  24713. t.copy(e).applyAxisAngle(I.UP, r),
  24714. t.applyAxisAngle(I.RIGHT, o);
  24715. var h = (e.angleTo(t),
  24716. r > 0 ? -1 : r < 0 ? 1 : 0)
  24717. , u = o > 0 ? 1 : o < 0 ? -1 : 0;
  24718. Math.abs(r) > Math.abs(o) ? u *= Math.abs(o / r) : Math.abs(o) > Math.abs(r) && (h *= Math.abs(r / o));
  24719. var d = this.controls.activeControl
  24720. , p = function() {
  24721. d.stopRotating(!0),
  24722. n && n({
  24723. success: !0,
  24724. message: "Rotated " + i.xAngle.toFixed(2) + "° horizontally, " + l.toFixed(2) + "° vertically"
  24725. })
  24726. };
  24727. d.startRotating(h, u),
  24728. P.start(r, o, this.player, p)
  24729. }
  24730. }
  24731. }(),
  24732. panCamera: function(e, t) {
  24733. function i(e) {
  24734. switch (r.removeAllListeners(T.AutoPanComplete),
  24735. r.removeAllListeners(T.AutoPanInterrupt),
  24736. r.removeAllListeners(T.AutoPanClamped),
  24737. e) {
  24738. case T.AutoPanInterrupt:
  24739. t({
  24740. success: !0,
  24741. message: "Camera panning interrupted."
  24742. });
  24743. break;
  24744. case T.AutoPanClamped:
  24745. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  24746. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  24747. return void t({
  24748. success: !1,
  24749. error: "Already at edge of current model bounds."
  24750. });
  24751. var i = "The view point is outside the bounds for the current model. ";
  24752. i += "The view point was clamped to " + o(r.target.x, r.target.z),
  24753. console.warn(i)
  24754. }
  24755. case T.AutoPanComplete:
  24756. t({
  24757. success: !0,
  24758. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  24759. })
  24760. }
  24761. }
  24762. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.FLOORPLAN)
  24763. return t({
  24764. success: !1,
  24765. error: "Camera panning is not available in the current mode: " + this.player.mode
  24766. });
  24767. var n = e.position
  24768. , r = this.player.control;
  24769. r.setAutoPanPosition(n.x, n.z),
  24770. r.autoPan = !0;
  24771. var o = function(e, t) {
  24772. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  24773. };
  24774. r.on(T.AutoPanComplete, i.bind(this, T.AutoPanComplete)),
  24775. r.on(T.AutoPanInterrupt, i.bind(this, T.AutoPanInterrupt)),
  24776. r.on(T.AutoPanClamped, i.bind(this, T.AutoPanClamped))
  24777. },
  24778. click: function(e, t) {
  24779. var i = e.x
  24780. , n = e.y
  24781. , r = e.percentage;
  24782. r === !0 && (i = i / 100 * $("#player").width(),
  24783. n = n / 100 * $("#player").height()),
  24784. this.player.handleInputStart(i, n),
  24785. this.player.updateIntersect(),
  24786. this.player.handleInputEnd(i, n)
  24787. },
  24788. mouseOver: function(e, t) {
  24789. var i = e.x
  24790. , n = e.y
  24791. , r = e.percentage;
  24792. r === !0 && (i = i / 100 * $("#player").width(),
  24793. n = n / 100 * $("#player").height()),
  24794. this.player.handleInputMove(i, n),
  24795. this.player.updateIntersect()
  24796. },
  24797. moveToMode: function(e, t) {
  24798. function i(e) {
  24799. t(e ? {
  24800. success: !1,
  24801. error: "Failed to load new mode: " + e
  24802. } : {
  24803. success: !0,
  24804. message: "Moved to new mode: " + n
  24805. })
  24806. }
  24807. var n = e.mode;
  24808. n === E.PANORAMA || n === E.DOLLHOUSE || n === E.FLOORPLAN ? this.director.changeMode(n).then(function() {
  24809. i()
  24810. }, function(e) {
  24811. i(e)
  24812. }) : t({
  24813. success: !1,
  24814. error: "Invalid mode selection"
  24815. })
  24816. }
  24817. }
  24818. }
  24819. ).call(this, "/js/sdk/automation.js")
  24820. }
  24821. , {
  24822. "../constants": 8,
  24823. "../enum/AlignmentType": 17,
  24824. "../enum/ControlEvents": 21,
  24825. "../enum/Direction": 22,
  24826. "../enum/GLCubeFaces": 25,
  24827. "../enum/Keys": 30,
  24828. "../enum/ModelManagerEvents": 33,
  24829. "../enum/PlayerEvents": 40,
  24830. "../enum/RenderLayers": 41,
  24831. "../enum/Vectors": 50,
  24832. "../enum/Viewmode": 51,
  24833. "../enum/WarpStyle": 52,
  24834. "../lib/jpeg_encoder": 94,
  24835. "../sdk/SdkEvents": 161,
  24836. "../settings": 166,
  24837. "../util/common": 185,
  24838. "../util/logger": 189,
  24839. "../util/math": 190,
  24840. "../util/panorama": 191,
  24841. "./ApiHost": 159,
  24842. "./PostMessageType": 160,
  24843. "./TransitionStyles": 162,
  24844. three: 217
  24845. }],
  24846. 165: [function(e, t, i) {
  24847. "use strict";
  24848. function n(e) {
  24849. this.sourceWindow = e,
  24850. this.targetWindow = null,
  24851. this.targetOrigin = null,
  24852. this.id = Math.floor(1e5 * Math.random()),
  24853. this.bindEvents()
  24854. }
  24855. var r = e("./PostMessageType")
  24856. , o = e("events").EventEmitter;
  24857. n.prototype = Object.create(o.prototype),
  24858. n.prototype.bindEvents = function() {
  24859. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  24860. }
  24861. ,
  24862. n.prototype.setTarget = function(e, t) {
  24863. this.targetWindow = e,
  24864. this.targetOrigin = t
  24865. }
  24866. ,
  24867. n.prototype.onPostmessageReceived = function(e) {
  24868. var t = e.origin || e.originalEvent.origin
  24869. , i = e.source;
  24870. switch (e.data.type) {
  24871. case r.CONNECT:
  24872. break;
  24873. case r.RESPONSE:
  24874. if (this.id !== e.data.toId)
  24875. return;
  24876. default:
  24877. if (!this.validateMessageOrigin(t))
  24878. return
  24879. }
  24880. var n = e.data;
  24881. n.source = i,
  24882. n.origin = t,
  24883. n.timestamp = Date.now(),
  24884. this.emit(e.data.type, n)
  24885. }
  24886. ,
  24887. n.prototype.validateMessageOrigin = function(e) {
  24888. return "*" === this.targetOrigin || e === this.targetOrigin
  24889. }
  24890. ,
  24891. n.prototype.send = function(e) {
  24892. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  24893. this.targetWindow.postMessage(e, this.targetOrigin))
  24894. }
  24895. ,
  24896. t.exports = n
  24897. }
  24898. , {
  24899. "./PostMessageType": 160,
  24900. events: 202
  24901. }],
  24902. 166: [function(e, t, i) {
  24903. "use strict";
  24904. var n = e("three")
  24905. , r = e("./util/browser")
  24906. , o = e("./enum/Viewmode")
  24907. , a = e("./enum/VROption")
  24908. , s = e("./enum/Colors")
  24909. , l = e("./enum/WarpStyle")
  24910. , c = e("./util/easing")
  24911. , h = e("./util/common")
  24912. , u = e("./util/showcase")
  24913. , d = e("./constants")
  24914. , p = {
  24915. debug: !1,
  24916. version: "2.25.6-0-gd87e5b1",
  24917. languageTag: r.valueFromHash("lang", null),
  24918. pageTitle: "四维虚拟漫游",
  24919. authorizationHeader: u.getAuthorizationHeader(),
  24920. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  24921. logLevel: r.valueFromHash("log", 2),
  24922. skyboxRadius: 2500,
  24923. modelBoundsPadding: 5,
  24924. showNeighbors: !1,
  24925. brand: r.valueFromHash("brand", !0),
  24926. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  24927. startHighlights: r.valueFromHash("hl", -1),
  24928. specialEdition: r.valueFromHash("bn", 0),
  24929. useWheel: r.valueFromHash("wh", !0),
  24930. crossOrigin: "anonymous",
  24931. fancierTransition: !1,
  24932. wireframe: !1,
  24933. skyboxWireframe: !1,
  24934. modelAlpha: 1,
  24935. highlightPanoSelection: !1,
  24936. showSweeps: !0,
  24937. showSkyboxes: !1,
  24938. showMesh: !0,
  24939. showFloors: !1,
  24940. showFloorDuration: 300,
  24941. showFloorDelay: 300,
  24942. hideFloorDuration: 300,
  24943. hideFloorDelay: 0,
  24944. reticuleOpacityTransitionTime: 250,
  24945. reticuleColor: window.MP_PREFETCHED_MODELDATA.mouseMarkerColor || s.newBlue, // 方奕卓 配置鼠标标志颜色
  24946. markerOpacityTransitionTime: 500,
  24947. guiAnimationSpeed: 250,
  24948. highlightAnimationDuration: 500,
  24949. modelComponentLoadSpinnerDelay: 150,
  24950. captureErrors: !1,
  24951. maxMobileTextures: 6,
  24952. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  24953. startupFlyinDelay: 3e3,
  24954. dollhouseDefault: {
  24955. minDistance: 15,
  24956. maxDistance: 50,
  24957. minPolarAngle: n.Math.degToRad(10),
  24958. maxPolarAngle: n.Math.degToRad(90)
  24959. },
  24960. hideReticuleTimeout: 1e3,
  24961. analytics: {
  24962. inactivityThreshold: 30,
  24963. sessionTrackingRate: .15,
  24964. maxTrackedErrors: 20,
  24965. sessionDurationPingFrequency: 10,
  24966. sessionDurationTimeout: 15
  24967. },
  24968. flydown: {
  24969. movementEasing: "easeInOutQuad",
  24970. movementDelay: .001,
  24971. rotationEasing: "easeInOutQuad",
  24972. rotationDelay: .5,
  24973. modelTextureDelay: .75,
  24974. skyboxDelay: .75
  24975. },
  24976. transition: {
  24977. flySpeed: .001,
  24978. flyTime: 750,
  24979. flytimeMaxDistanceThreshold: 5,
  24980. flytimeDistanceMultiplier: 150,
  24981. aimTime: 1500,
  24982. aimSlowFactor: 1.5,
  24983. blur: 0.8,
  24984. movementEasing: "easeInOutQuad",
  24985. blendEasing: "easeInOutQuad",
  24986. fastForwardFactor: 3//r.valueFromHash("mfis", 3)
  24987. },
  24988. show360Views: {
  24989. enabled: !0,
  24990. transitionTime: 1e3
  24991. },
  24992. quickstart: {
  24993. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  24994. animation: 1400,
  24995. showTextDelay: 500,
  24996. fadeOutDelay: 3e3,
  24997. fovChange: 10
  24998. },
  24999. appConfig: {
  25000. webvr_version: null,
  25001. segment_key: null,
  25002. embedly_key: null,
  25003. branch_key: null,
  25004. keen_write_key: null,
  25005. keen_project_id: null
  25006. },
  25007. vr: {
  25008. enabled: !0,
  25009. allowWebVR: !1,
  25010. option: r.valueFromHash("vr", a.CONTEXTUAL)
  25011. },
  25012. share: {
  25013. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  25014. },
  25015. input: {
  25016. longTapThreshold: 200,
  25017. moveToleranceNDC: .08,
  25018. touchMoveThreshold: 25
  25019. },
  25020. help: {
  25021. modalStayDuration: 600
  25022. },
  25023. immersive: {
  25024. timeToShowAgain: 1250,
  25025. uiStayDuration: 600
  25026. },
  25027. tourInteraction: {
  25028. disabled: "0" === r.valueFromHash("tourcta", null),
  25029. showPauseButton: 1e3,
  25030. showModal: 1500,
  25031. allowNextClick: 200,
  25032. largeModal: "1" === r.valueFromHash("tourcta", null),
  25033. smallModal: "2" === r.valueFromHash("tourcta", null)
  25034. },
  25035. labels: {
  25036. enabled: !1,
  25037. hideUntilStart: !0,
  25038. fadeInDuration: 250,
  25039. fadeInDelay: 250,
  25040. fadeOutDuration: 250,
  25041. fadeOutDelay: 0,
  25042. zoomHideThreshhold: {
  25043. mobile: r.isSmallScreen() ? .45 : .6,
  25044. desktop: 2
  25045. },
  25046. zoomTruncateThreshhold: {
  25047. mobile: r.isSmallScreen() ? .35 : .45,
  25048. desktop: .85
  25049. },
  25050. minLengthForTruncate: 16,
  25051. truncateLength: 12,
  25052. truncateSuffix: "..."
  25053. },
  25054. tags: {
  25055. enabled: r.valueFromHash("mt", 1),
  25056. startup: {
  25057. hideUntilStart: !0,
  25058. fadeInDuration: 500,
  25059. fadeInDelay: 100
  25060. },
  25061. visibility: {
  25062. anyDistance: !0,
  25063. visibleDistance: 8,
  25064. cameraClearance: .1,
  25065. alphaTestLevel: .05,
  25066. hideViaFloor: !0,
  25067. hideOffScreenDisc: !1,
  25068. hideOffScreenObject: !1
  25069. },
  25070. disc: {
  25071. opacity: 1,
  25072. disabledOpacity: .5,
  25073. scale: {
  25074. nearBound: 1.5,
  25075. farBound: 4.8,
  25076. linkFarBound: !1,
  25077. linkPercent: 40,
  25078. maxSize: 80,
  25079. minSize: 40,
  25080. baseViewportSize: 800,
  25081. responsiveness: 100
  25082. }
  25083. },
  25084. pole: {
  25085. enabled: !0,
  25086. height: .5,
  25087. width: 2,
  25088. opacity: .5,
  25089. color: "white"
  25090. },
  25091. navigate: {
  25092. nearestPano: !0,
  25093. lineOfSight: !0,
  25094. reactivate: !0,
  25095. aimAt: "disc",
  25096. tiltTolerance: 25,
  25097. rotateSpeedFactor: .6
  25098. }
  25099. },
  25100. path: {
  25101. color: window.MP_PREFETCHED_MODELDATA.floorMarkerColor || s.newBlue, // 方奕卓 配置导览标志颜色
  25102. colorUp: s._desat(s.newBlue, .5),
  25103. colorDown: s._darken(s.newBlue, .35),
  25104. opacity: .5,
  25105. style: "ribbon",
  25106. height: .025,
  25107. ribbonWidth: .24,
  25108. outsideHeight: .5,
  25109. waypointRadius: .5,
  25110. waypointIndoorRadius: .24,
  25111. waypointPulse: 1e3,
  25112. typ: l.BLACK,
  25113. meshFree: r.valueFromHash("mf", 1),
  25114. mapGuides: r.valueFromHash("guides", !0),
  25115. fadeInTime: 400,
  25116. fadeOutTime: 300
  25117. },
  25118. warp: {
  25119. nearPanoDist: .1,
  25120. matchCam: !1,
  25121. blur: .33,
  25122. fastTime: 1500,
  25123. teleportTime: 1500,
  25124. outsideTime: 2e3,
  25125. lookAheadMax: .3,
  25126. lookAheadDist: 2.5,
  25127. softPushDist: .37,
  25128. softPushEnd: .3,
  25129. softBendAngle: 8,
  25130. softBendTilt: 4,
  25131. softBendEnd: .3,
  25132. doBurns: true, //r.valueFromHash("kb", !0),
  25133. burnsAngle: 8,
  25134. minBurnsAngle: 35,
  25135. minDownAngle: -35,
  25136. maxTurnPerSec: 280,
  25137. maxAimPerSec: 35,
  25138. minRotation: 12,
  25139. maxAimRotation: 33.2,
  25140. turnFriction: .2,
  25141. flySpeed: .01,
  25142. minWarpTime: 1200,
  25143. warpInterruptionRedirectTime: 500,
  25144. tourStepDelay: r.valueFromHash("st", 0),
  25145. walkDelay: 0,
  25146. walkMaxDist: 50,
  25147. walkMinDist: .8,
  25148. walkSlideShowThreshhold: 3000,
  25149. walkExtraPanosDistance: .4,
  25150. timePerMeter: 1200,
  25151. motionLeadTime: 5000,
  25152. movementEasing: "easeInOutQuad",
  25153. blendEasing: "easeInOutQuad",
  25154. showBunny: !1,
  25155. loop: r.valueFromHash("lp", !1),
  25156. auto: r.valueFromHash("ts", -1),
  25157. eOrder: 'YXZ', //"YXZ",
  25158. stepFactor: .25,
  25159. brakeStrength: 2,
  25160. minBrakeAngle: .1,
  25161. maxBrakeAngle: 1.8,
  25162. climbEffort: 4
  25163. },
  25164. rotationFriction: .05,
  25165. rotationAccelerationInside: 4.5,
  25166. rotationAccelerationOutside: .15,
  25167. rotationAfterMoveMultiplier: 40,
  25168. rotationAfterMoveHistoryCount: 5,
  25169. panFriction: .09,
  25170. panAccelerationOutside: 60,
  25171. onload: r.valueFromHash("onload", o.PANORAMA),
  25172. zoomNearLimit: .1,
  25173. zoomFarLimit: 10,
  25174. navigation: {
  25175. panoScores: !1,
  25176. mouseDirection: !0,
  25177. filterStrictness: .75,
  25178. angleFactor: -30,
  25179. directionFactor: 10,
  25180. distanceFactor: -1,
  25181. optionalityFactor: 3
  25182. },
  25183. sdkInit: !1,
  25184. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  25185. console: r.valueFromHash("console", !1),
  25186. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  25187. panoramaNeighbourMaxDistance: 5,
  25188. panoFloorClickRadius: .35,
  25189. showScreenshotLocations: !1,
  25190. showAxis: !1,
  25191. showNeighbourRaycasts: !1,
  25192. colorMarkerOnLoad: !1,
  25193. colorMarkerByFloor: !1,
  25194. tiling: {
  25195. panoPreRenderRepeatDelay: 2500,
  25196. panoPreRenderDelay: 500,
  25197. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  25198. tilingFlagNames: ["usetiles", "tiles"],
  25199. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  25200. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  25201. overlayStyle: r.valueFromHash("tileoverlay", 0),
  25202. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  25203. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  25204. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  25205. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  25206. customCompression: r.valueFromHash("tilecustcomp", 0),
  25207. // mobileHighQualityOverride: !1,
  25208. mobileHighQualityOverride: 1,
  25209. allowUltraHighResolution: true
  25210. },
  25211. zoom: {
  25212. enabled: true,
  25213. forceOff: r.valueFromHash("nozoom", 0),
  25214. overridemax: r.valueFromHash("maxzoom", null),
  25215. overridemin: r.valueFromHash("minzoom", null),
  25216. max: d.highQualityMaxZoom,
  25217. min: 1,
  25218. transitionStyle: r.valueFromHash("zoomtrans", 1),
  25219. activationThreshold: 1.1,
  25220. restoreTime: 500
  25221. },
  25222. profiling: {
  25223. enabled: r.valueFromHash("mem", !1)
  25224. }
  25225. };
  25226. p = h.deepExtend(p, d, {
  25227. insideFOV: r.valueFromHash("fov", d.insideFOV),
  25228. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  25229. panorama: {
  25230. transitionTime: 1e3,
  25231. modelAlpha: 0,
  25232. modelAlphaDelay: p.flydown.modelTextureDelay,
  25233. modelAlphaLength: 1,
  25234. skyboxOpacity: 1,
  25235. skyboxOpacityDelay: p.flydown.skyboxDelay,
  25236. skyboxOpacityLength: .9,
  25237. fovLength: 1,
  25238. fovDelay: 0,
  25239. cameraMatrixDuration: .8,
  25240. cameraMatrixDelay: 0,
  25241. cameraMatrixEase: c.easeInCubic,
  25242. reticuleOpacity: 1,
  25243. markerOpacity: .3,
  25244. markerOpacityOnHover: 1
  25245. },
  25246. dollhouse: {
  25247. transitionTime: 1e3,
  25248. modelAlpha: 1,
  25249. modelAlphaDelay: 0,
  25250. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  25251. skyboxOpacity: 0,
  25252. skyboxOpacityDelay: 0,
  25253. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  25254. fovLength: 1,
  25255. fovDelay: 0,
  25256. cameraMatrixDuration: .8,
  25257. cameraMatrixDelay: .3,
  25258. cameraMatrixEase: c.easeInCubic,
  25259. reticuleOpacity: 1,
  25260. markerOpacity: 0,
  25261. markerOpacityOnHover: 0
  25262. },
  25263. floorplan: {
  25264. transitionTime: 1e3,
  25265. modelAlpha: 1,
  25266. modelAlphaDelay: 0,
  25267. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  25268. skyboxOpacity: 0,
  25269. skyboxOpacityDelay: 0,
  25270. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  25271. fovLength: 1,
  25272. fovDelay: 0,
  25273. cameraMatrixDuration: .5,
  25274. cameraMatrixDelay: 0,
  25275. cameraMatrixEase: c.easeOutCubic,
  25276. reticuleOpacity: 1,
  25277. markerOpacity: 0,
  25278. markerOpacityOnHover: 0,
  25279. cameraHeight: 50
  25280. },
  25281. transitioning: {
  25282. reticuleOpacity: 0,
  25283. markerOpacity: .3,
  25284. markerOpacityOnHover: 1
  25285. },
  25286. "floorplan-dollhouse": {
  25287. rotationDelay: 0,
  25288. rotationDuration: 1
  25289. },
  25290. "floorplan-panorama": {
  25291. rotationDelay: .5,
  25292. rotationDuration: 1
  25293. },
  25294. "dollhouse-panorama": {
  25295. rotationDelay: .5,
  25296. rotationDuration: 1
  25297. },
  25298. "dollhouse-floorplan": {
  25299. rotationDelay: 0,
  25300. rotationDuration: 1,
  25301. cameraMatrixDuration: 1.05,
  25302. cameraMatrixDelay: .5
  25303. },
  25304. "panorama-dollhouse": {
  25305. rotationDelay: 0,
  25306. rotationDuration: .5
  25307. },
  25308. "panorama-floorplan": {
  25309. transitionTime: 1500,
  25310. rotationDelay: 0,
  25311. rotationDuration: .5
  25312. }
  25313. }),
  25314. p.path.meshFree && (p.path.typ = l.WALK),
  25315. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  25316. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  25317. t.exports = p
  25318. }
  25319. , {
  25320. "./constants": 8,
  25321. "./enum/Colors": 19,
  25322. "./enum/VROption": 47,
  25323. "./enum/Viewmode": 51,
  25324. "./enum/WarpStyle": 52,
  25325. "./util/browser": 182,
  25326. "./util/common": 185,
  25327. "./util/easing": 186,
  25328. "./util/showcase": 193,
  25329. three: 217
  25330. }],
  25331. 167: [function(e, t, i) {
  25332. "use strict";
  25333. var n = e("three")
  25334. , r = e("./settings")
  25335. , o = "precision highp float;\nprecision highp int;\n\nuniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n"
  25336. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  25337. t.exports = {
  25338. basicTextured: {
  25339. uniforms: {
  25340. tDiffuse: {
  25341. type: "t",
  25342. value: null
  25343. },
  25344. alpha: {
  25345. type: "f",
  25346. value: 1
  25347. }
  25348. },
  25349. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25350. fragmentShader: "varying vec2 vUv;\nuniform float alpha;\nuniform sampler2D tDiffuse;\nvoid main() {\n vec4 texColor = texture2D(tDiffuse, vUv);\n gl_FragColor = vec4(texColor.rgb, texColor.a * alpha);\n}"
  25351. },
  25352. copyCubeMap: {
  25353. uniforms: {
  25354. tDiffuse: {
  25355. type: "t",
  25356. value: null
  25357. },
  25358. alpha: {
  25359. type: "f",
  25360. value: 1
  25361. }
  25362. },
  25363. vertexShader: "varying vec3 vWorldPos;\nvoid main() {\n vWorldPos = vec3(-position.x, -position.y, position.z);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25364. fragmentShader: "varying vec3 vWorldPos;\nuniform float alpha;\nuniform samplerCube tDiffuse;\nvoid main() {\n vec4 texColor = textureCube(tDiffuse, vWorldPos);\n gl_FragColor = vec4(texColor.rgb, texColor.a * alpha);\n}"
  25365. },
  25366. cube: {
  25367. uniforms: {
  25368. map: {
  25369. type: "t",
  25370. value: null
  25371. },
  25372. opacity: {
  25373. type: "f",
  25374. value: 1
  25375. }
  25376. },
  25377. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  25378. fragmentShader: a + "uniform samplerCube map;\nuniform float opacity;\n\nvarying vec3 vWorldPosition;\n\nvoid main() {\n vec4 color = textureCube( map, vec3( -vWorldPosition.x, vWorldPosition.yz ) );\n gl_FragColor = vec4(color.rgb, opacity);\n}\n"
  25379. },
  25380. model: {
  25381. uniforms: {
  25382. map: {
  25383. type: "t",
  25384. value: null
  25385. },
  25386. modelAlpha: {
  25387. type: "f",
  25388. value: r.modelAlpha
  25389. },
  25390. opacity: {
  25391. type: "f",
  25392. value: 1
  25393. },
  25394. progress: {
  25395. type: "f",
  25396. value: 0
  25397. },
  25398. blackout: {
  25399. type: "i",
  25400. value: 0
  25401. },
  25402. pano0Map: {
  25403. type: "t",
  25404. value: null
  25405. },
  25406. pano0Position: {
  25407. type: "v3",
  25408. value: new n.Vector3
  25409. },
  25410. pano0Matrix: {
  25411. type: "m4",
  25412. value: new n.Matrix4
  25413. },
  25414. pano1Map: {
  25415. type: "t",
  25416. value: null
  25417. },
  25418. pano1Position: {
  25419. type: "v3",
  25420. value: new n.Vector3
  25421. },
  25422. pano1Matrix: {
  25423. type: "m4",
  25424. value: new n.Matrix4
  25425. }
  25426. },
  25427. vertexShader: o + "uniform vec3 pano0Position;\nuniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\nuniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\n\nvoid main() {\n\n vUv = uv;\n vec4 worldPosition = modelMatrix * vec4(position, 1.0);\n\n vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;\n vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;\n vWorldPosition0.x *= -1.0;\n\n vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;\n vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;\n vWorldPosition1.x *= -1.0;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25428. fragmentShader: a + "uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\nuniform float progress;\nuniform int blackout;\n\nuniform vec3 pano0Position;\nuniform samplerCube pano0Map;\n\nuniform vec3 pano1Position;\nuniform samplerCube pano1Map;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\n\nvoid main() {\n\tconst vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);\n\tconst vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);\n\n\tvec4 colorFromPanos;\n\tvec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);\n\tvec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);\n\n\tif (blackout == 0) {\n\t\tcolorFromPanos = mix(colorFromPano0, colorFromPano1, progress);\n\t} else if (blackout == 1) {\n\t\tcolorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));\n\t\tcolorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));\n\t} else if (blackout == 2) {\n\t\tcolorFromPanos = mix(colorFromPano0, BLACK, progress);\n\t} else if (blackout == 3) {\n\t\tcolorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));\n\t} \n\n\tvec4 colorFromTexture = texture2D( map, vUv );\n\tcolorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);\n\n\tfloat whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);\n\tcolorFromPanos = mix(colorFromPanos, GREY, whiteness);\n\tgl_FragColor = vec4(colorFromPanos.rgb, opacity);\n}\n"
  25429. },
  25430. hot:{
  25431. uniforms:{
  25432. color:{
  25433. type: "c",
  25434. value: new n.Color( 0xff2200 )
  25435. },
  25436. opac:{
  25437. type: "f",
  25438. value: 0
  25439. },
  25440. texture1:{
  25441. type: "t",
  25442. value: null
  25443. },
  25444. texture2:{
  25445. type: "t",
  25446. value: null
  25447. }
  25448. },
  25449. vertexShader:"varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25450. fragmentShader:"varying vec3 vNormal;\n\nvarying vec2 vUv;\n\nuniform float opac;\n\nuniform vec3 color;\n\nuniform sampler2D texture1;\n\nuniform sampler2D texture2;\n\nvoid main() {\n\nvec4 tcolor1 = texture2D( texture1, vUv );\n\nvec4 tcolor2 = texture2D( texture2, vUv );\n\ngl_FragColor = mix(tcolor1,tcolor2 ,opac) + tcolor2*0.2; }\n"
  25451. },
  25452. modelOutside: {
  25453. uniforms: {
  25454. map: {
  25455. type: "t",
  25456. value: null
  25457. },
  25458. opacity: {
  25459. type: "f",
  25460. value: 1
  25461. }
  25462. },
  25463. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25464. fragmentShader: a + "uniform sampler2D map;\nuniform float opacity;\nvarying vec2 vUv;\n\nvec4 white = vec4(0.5, 0.5, 0.5, 1.0);\n\nvoid main() {\n\n vec4 colorFromTexture = texture2D( map, vUv );\n float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);\n colorFromTexture = mix(colorFromTexture, white, whiteness);\n gl_FragColor = vec4(colorFromTexture.rgb, opacity);\n\n}\n"
  25465. },
  25466. ribbon: {
  25467. uniforms: {
  25468. map: {
  25469. type: "t",
  25470. value: null
  25471. },
  25472. opacity: {
  25473. type: "f",
  25474. value: 1
  25475. },
  25476. color: {
  25477. type: "c",
  25478. value: new n.Color(r.path.color)
  25479. }
  25480. },
  25481. vertexShader: o + "varying vec2 vUv;\nvarying vec3 vN;\nvarying vec4 vP;\n\nvoid main() {\n\n vUv = uv;\n vN= normalMatrix * normal;\n vP = modelViewMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * vP;\n}\n",
  25482. fragmentShader: a + "uniform sampler2D map;\nuniform float opacity;\nvarying vec2 vUv;\nuniform vec3 color;\nvarying vec3 vN; // show-1182\nvarying vec4 vP; // show-1182\n\nvoid main() {\n\t// TODO add scroll-in and pulsing behaviors\n\tvec3 vNn = normalize(vN);\n\tvec3 vPn = normalize(vP.xyz);\n\tfloat f = pow(1.0-abs(dot(vNn,vPn)),0.2);\n vec4 colorFromTexture = texture2D( map, vUv );\n colorFromTexture.a *= f;\n gl_FragColor = vec4((color.rgb*colorFromTexture.rgb),\n \t\t\t\t\t\t(opacity*colorFromTexture.a));\n}\n"
  25483. },
  25484. waypoint: {
  25485. uniforms: {
  25486. map: {
  25487. type: "t",
  25488. value: null
  25489. },
  25490. opacity: {
  25491. type: "f",
  25492. value: 1
  25493. },
  25494. pulse: {
  25495. type: "f",
  25496. value: 1
  25497. },
  25498. nearFade: {
  25499. type: "v2",
  25500. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  25501. },
  25502. color: {
  25503. type: "c",
  25504. value: new n.Color(r.reticuleColor)
  25505. }
  25506. },
  25507. vertexShader: o + "varying vec2 vUv;\nvarying vec4 vPointView;\n\nvoid main() {\n\n vUv = uv;\n vPointView = modelViewMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * vPointView;\n\n}\n",
  25508. fragmentShader: a + "uniform sampler2D map;\nuniform float opacity;\nuniform float pulse; // another opacity, with a different clock\nuniform vec2 nearFade;\nvarying vec2 vUv;\nvarying vec4 vPointView;\nuniform vec3 color;\n\nvoid main() {\n\t// TODO add scroll-in and pulsing behaviors\n\tfloat depthFade = min(1.0, (abs(vPointView.z)-nearFade.x)/(nearFade.y-nearFade.x));\n vec4 colorFromTexture = texture2D( map, vUv );\t\t// we only use the alpha!\n gl_FragColor = vec4(color.rgb,\n \t\t\t\t\t\t(pulse*opacity*colorFromTexture.a * depthFade));\n}\n"
  25509. },
  25510. modelDebug: {
  25511. uniforms: {
  25512. map: {
  25513. type: "t",
  25514. value: null
  25515. },
  25516. modelAlpha: {
  25517. type: "f",
  25518. value: r.modelAlpha
  25519. },
  25520. depthmapRatio: {
  25521. type: "f",
  25522. value: 0
  25523. },
  25524. opacity: {
  25525. type: "f",
  25526. value: 1
  25527. },
  25528. progress: {
  25529. type: "f",
  25530. value: 0
  25531. },
  25532. considerOcclusion: {
  25533. type: "i",
  25534. value: r.fancierTransition
  25535. },
  25536. highlightPanoSelection: {
  25537. type: "i",
  25538. value: 0
  25539. },
  25540. useThirdPano: {
  25541. type: "i",
  25542. value: r.useThirdPano
  25543. },
  25544. pano0Map: {
  25545. type: "t",
  25546. value: null
  25547. },
  25548. pano0Depth: {
  25549. type: "t",
  25550. value: null
  25551. },
  25552. pano0Position: {
  25553. type: "v3",
  25554. value: new n.Vector3
  25555. },
  25556. pano0Matrix: {
  25557. type: "m4",
  25558. value: new n.Matrix4
  25559. },
  25560. pano0Weight: {
  25561. type: "f",
  25562. value: r.transition.pano0Weight
  25563. },
  25564. pano1Map: {
  25565. type: "t",
  25566. value: null
  25567. },
  25568. pano1Depth: {
  25569. type: "t",
  25570. value: null
  25571. },
  25572. pano1Position: {
  25573. type: "v3",
  25574. value: new n.Vector3
  25575. },
  25576. pano1Matrix: {
  25577. type: "m4",
  25578. value: new n.Matrix4
  25579. },
  25580. pano1Weight: {
  25581. type: "f",
  25582. value: r.transition.pano1Weight
  25583. },
  25584. pano2Map: {
  25585. type: "t",
  25586. value: null
  25587. },
  25588. pano2Depth: {
  25589. type: "t",
  25590. value: null
  25591. },
  25592. pano2Position: {
  25593. type: "v3",
  25594. value: new n.Vector3
  25595. },
  25596. pano2Matrix: {
  25597. type: "m4",
  25598. value: new n.Matrix4
  25599. },
  25600. pano2Weight: {
  25601. type: "f",
  25602. value: r.transition.pano2Weight
  25603. }
  25604. },
  25605. vertexShader: o + "uniform vec3 pano0Position;\nuniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\nuniform mat4 pano1Matrix;\n\nuniform vec3 pano2Position;\nuniform mat4 pano2Matrix;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\nvarying vec3 vWorldPosition2;\n\nvarying vec4 worldPosition;\n\nvoid main() {\n\n vUv = uv;\n worldPosition = modelMatrix * vec4(position, 1.0);\n\n vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;\n vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;\n vWorldPosition0.x *= -1.0;\n\n vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;\n vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;\n vWorldPosition1.x *= -1.0;\n\n vec3 positionLocalToPanoCenter2 = worldPosition.xyz - pano2Position;\n vWorldPosition2 = (vec4(positionLocalToPanoCenter2, 2.0) * pano2Matrix).xyz;\n vWorldPosition2.x *= -1.0;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25606. fragmentShader: a + "uniform sampler2D map;\nuniform float depthmapRatio;\nuniform float modelAlpha;\nuniform float opacity;\nuniform float progress;\nuniform int considerOcclusion;\nuniform int highlightPanoSelection;\nuniform int useThirdPano;\n\nuniform vec3 pano0Position;\nuniform samplerCube pano0Map;\nuniform samplerCube pano0Depth;\nuniform float pano0Weight;\n\nuniform vec3 pano1Position;\nuniform samplerCube pano1Map;\nuniform samplerCube pano1Depth;\nuniform float pano1Weight;\n\nuniform vec3 pano2Position;\nuniform samplerCube pano2Map;\nuniform samplerCube pano2Depth;\nuniform float pano2Weight;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\nvarying vec3 vWorldPosition2;\n\nvarying vec4 worldPosition;\n\nvoid main() {\n\n vec4 depthFromPano0 = textureCube( pano0Depth, vWorldPosition0.xyz );\n vec4 depthFromPano1 = textureCube( pano1Depth, vWorldPosition1.xyz );\n vec4 depthFromPano2 = textureCube( pano2Depth, vWorldPosition2.xyz );\n\n vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz );\n vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz );\n vec4 colorFromPano2 = textureCube( pano2Map, vWorldPosition2.xyz );\n\n float distanceToPano0 = distance(worldPosition.xyz, pano0Position);\n float distanceToPano1 = distance(worldPosition.xyz, pano1Position);\n float distanceToPano2 = distance(worldPosition.xyz, pano2Position);\n\n float cameraToPano0 = distance(cameraPosition.xyz, pano0Position);\n float cameraToPano1 = distance(cameraPosition.xyz, pano1Position);\n float cameraToPano2 = distance(cameraPosition.xyz, pano2Position);\n\n float contributionFromPano0 = cameraToPano0 == 0.0 ? 1000.0 : pano0Weight / cameraToPano0;\n float contributionFromPano1 = cameraToPano1 == 0.0 ? 1000.0 : pano1Weight / cameraToPano1;\n float contributionFromPano2 = cameraToPano2 == 0.0 ? 1000.0 : pano2Weight / cameraToPano2;\n\n contributionFromPano0 *= 1.0 / distanceToPano0;\n contributionFromPano1 *= 1.0 / distanceToPano1;\n contributionFromPano2 *= 1.0 / distanceToPano2;\n\n if(considerOcclusion == 1) {\n bool occludedFromPano0 = distanceToPano0 / 10.0 > 1.01 - depthFromPano0.x;\n bool occludedFromPano1 = distanceToPano1 / 10.0 > 1.01 - depthFromPano1.x;\n bool occludedFromPano2 = distanceToPano2 / 10.0 > 1.01 - depthFromPano2.x;\n\n if(occludedFromPano0){contributionFromPano0 *= 0.1;}\n if(occludedFromPano1){contributionFromPano1 *= 0.1;}\n if(occludedFromPano2){contributionFromPano2 *= 0.1;}\n //if(occludedFromPano0 && occludedFromPano1 && !occludedFromPano2) { contributionFromPano2 += 0.5; }\n }\n\n float contributionSum = contributionFromPano0 + contributionFromPano1 + contributionFromPano2;\n contributionFromPano0 /= contributionSum;\n contributionFromPano1 /= contributionSum;\n contributionFromPano2 /= contributionSum;\n\n vec4 colorFromPanos = colorFromPano0 * contributionFromPano0;\n colorFromPanos += colorFromPano1 * contributionFromPano1;\n colorFromPanos += colorFromPano2 * contributionFromPano2;\n\n vec4 depthFromPanos = depthFromPano0 * contributionFromPano0;\n depthFromPanos += depthFromPano1 * contributionFromPano1;\n depthFromPanos += depthFromPano2 * contributionFromPano2;\n\n vec4 colorFromTexture = texture2D( map, vUv );\n colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);\n\n if(highlightPanoSelection == 1) {\n colorFromPanos.r = contributionFromPano0;\n colorFromPanos.g = contributionFromPano1;\n colorFromPanos.b = contributionFromPano2;\n }\n\n gl_FragColor = vec4(mix(colorFromPanos, depthFromPanos, depthmapRatio).rgb, opacity);\n\n}\n"
  25607. },
  25608. customDepth: {
  25609. uniforms: {
  25610. panoPosition: {
  25611. type: "v3",
  25612. value: new n.Vector3
  25613. }
  25614. },
  25615. vertexShader: o + "varying vec4 worldPosition;\n\nvoid main() {\n\n worldPosition = modelMatrix * vec4(position, 1.0);\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25616. fragmentShader: a + "uniform vec3 panoPosition;\nvarying vec4 worldPosition;\n\nvoid main() {\n\n float depth = distance(worldPosition.xyz, panoPosition);\n float color = 1.0 - depth / 10.0;\n gl_FragColor = vec4(color, color, color, 1.0);\n\n}\n"
  25617. },
  25618. skysphere: {
  25619. uniforms: {
  25620. radius: {
  25621. type: "f",
  25622. value: 0
  25623. }
  25624. },
  25625. vertexShader: o + "varying vec4 worldPosition;\n\nvoid main() {\n\n worldPosition = modelMatrix * vec4(position, 1.0);\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25626. fragmentShader: a + "varying vec4 worldPosition;\nuniform float radius;\n\nvoid main() {\n\n vec4 topColor = vec4(0.094, 0.102, 0.11, 1.0);\n vec4 bottomColor = vec4(0.2, 0.216, 0.235, 1.0);\n float normalizedHeight = (worldPosition.y + radius) / (radius * 2.0);\n float ratio = smoothstep(0.0, 0.5, normalizedHeight);\n gl_FragColor = mix(bottomColor, topColor, ratio);\n\n}\n"
  25627. },
  25628. tagDisc: {
  25629. uniforms: {
  25630. opacity: {
  25631. type: "f",
  25632. value: 0
  25633. },
  25634. color: {
  25635. type: "c",
  25636. value: new n.Color
  25637. },
  25638. bg: {
  25639. type: "t",
  25640. value: null
  25641. },
  25642. mask: {
  25643. type: "t",
  25644. value: null
  25645. }
  25646. },
  25647. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25648. fragmentShader: a + "uniform float opacity;\nuniform vec3 color;\nuniform sampler2D bg;\nuniform sampler2D mask;\n\nvarying vec2 vUv;\n\nvoid main() {\n vec4 maskColor = texture2D(mask, vUv);\n vec4 bgColor = texture2D(bg, vUv);\n vec3 mappedColor = mix(bgColor.rgb, color, maskColor.a);\n gl_FragColor = vec4(mappedColor, bgColor.a * opacity);\n}\n"
  25649. }
  25650. }
  25651. }
  25652. , {
  25653. "./settings": 166,
  25654. three: 217
  25655. }],
  25656. 168: [function(e, t, i) {
  25657. (function(i) {
  25658. "use strict";
  25659. var n = e("three")
  25660. , r = (e("url"),
  25661. e("./util/ajax"))
  25662. , o = e("./settings")
  25663. , a = e("./util/logger")
  25664. , s = e("./util/math")
  25665. , l = e("./util/showcase")
  25666. , c = e("./objects/Panorama")
  25667. , h = new a(i)
  25668. , u = e("./model/Model")
  25669. , d = e("./shaders")
  25670. , p = e("./util/transitions")
  25671. , f = e("./objects/Chunk")
  25672. , g = e("./objects/Reticule")
  25673. , m = e("./objects/Skybox")
  25674. , v = e("./objects/Floor")
  25675. , A = e("./cameras/DollhouseCamera")
  25676. , y = e("./cameras/FloorplanCamera")
  25677. , C = e("./cameras/PanoramaCamera")
  25678. , I = e("./controls/DollhouseControls")
  25679. , E = e("./controls/FloorplanControls")
  25680. , b = e("./controls/PanoramaControls");
  25681. n.ImageUtils.crossOrigin = o.crossOrigin,
  25682. t.exports = {
  25683. shaders: d,
  25684. transitions: p,
  25685. Model: u,
  25686. Chunk: f,
  25687. Floor: v,
  25688. Skybox: m,
  25689. Reticule: g,
  25690. Panorama: c,
  25691. DollhouseCamera: A,
  25692. FloorplanCamera: y,
  25693. PanoramaCamera: C,
  25694. DollhouseControls: I,
  25695. FloorplanControls: E,
  25696. PanoramaControls: b,
  25697. getModel: function(e) {
  25698. if (!e.url)
  25699. throw 'getModel(): missing parameter "url"';
  25700. e.autoload = void 0 === e.autoload || e.autoload;
  25701. var t = l.parseSidUrl(e.url);
  25702. e.urlBase = t.urlBase,
  25703. e.urlModel = t.urlModel,
  25704. e.urlFiles = t.urlFiles;
  25705. var i = this._getPlatformError();
  25706. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  25707. this._loadModel().then(this._buildModel.bind(this)))
  25708. },
  25709. _getPlatformError: function() {
  25710. return "IE" === $.ua.browser.name && parseInt($.ua.browser.major) < 11 ? "webgl-unsupported" : "iOS" === $.ua.os.name && /^[0-7][$\.]/.test($.ua.os.version) ? "webgl-ios" : Modernizr.webgl ? null : "webgl-unsupported"
  25711. },
  25712. _loadModel: function() {
  25713. return r.get(this.options.urlModel, {
  25714. responseType: "json",
  25715. prefetchFrom: "model",
  25716. auth: l.getAuthorizationHeader()
  25717. }).then(null, function() {
  25718. return h.warn("Model loading failed at initial metadata load"),
  25719. "loading-failed"
  25720. })
  25721. },
  25722. _buildModel: function(e) {
  25723. e = l.normalizeModeldata(e, s);
  25724. var t = new u(this.options,e);
  25725. return this.options.autoload ? t.load(!0) : $.when(t)
  25726. }
  25727. }
  25728. }
  25729. ).call(this, "/js/showcase.js")
  25730. }
  25731. , {
  25732. "./cameras/DollhouseCamera": 5,
  25733. "./cameras/FloorplanCamera": 6,
  25734. "./cameras/PanoramaCamera": 7,
  25735. "./controls/DollhouseControls": 10,
  25736. "./controls/FloorplanControls": 11,
  25737. "./controls/PanoramaControls": 13,
  25738. "./model/Model": 139,
  25739. "./objects/Chunk": 144,
  25740. "./objects/Floor": 146,
  25741. "./objects/Panorama": 148,
  25742. "./objects/Reticule": 149,
  25743. "./objects/Skybox": 152,
  25744. "./settings": 166,
  25745. "./shaders": 167,
  25746. "./util/ajax": 181,
  25747. "./util/logger": 189,
  25748. "./util/math": 190,
  25749. "./util/showcase": 193,
  25750. "./util/transitions": 195,
  25751. three: 217,
  25752. url: 208
  25753. }],
  25754. 169: [function(e, t, i) {
  25755. "use strict";
  25756. function n() {
  25757. var e = {
  25758. renderTarget: null,
  25759. inUse: !1,
  25760. size: -1,
  25761. pano: null
  25762. };
  25763. return e
  25764. }
  25765. function r(e) {
  25766. M.push(e)
  25767. }
  25768. function o(e) {
  25769. var t = n();
  25770. return t.inUse = !0,
  25771. t.size = e,
  25772. r(t),
  25773. t
  25774. }
  25775. function a(e) {
  25776. for (var t = 0; t < M.length; t++) {
  25777. var i = M[t];
  25778. if (!i.inUse && i.size === e)
  25779. return i.inUse = !0,
  25780. i
  25781. }
  25782. return null
  25783. }
  25784. function s(e) {
  25785. for (var t = 0; t < M.length; t++) {
  25786. var i = M[t];
  25787. if (i.renderTarget === e)
  25788. return i.inUse = !1,
  25789. !0
  25790. }
  25791. return !1
  25792. }
  25793. function l() {
  25794. this.tileDirectory = {},
  25795. this.activeRenderTargetDescriptors = {},
  25796. this.activePanos = [],
  25797. this.panoLODDescriptors = {},
  25798. this.panoDescriptors = {},
  25799. this.tileTrees = {},
  25800. this.sceneRenderer = null,
  25801. this.tileDownloader = null,
  25802. this.forceQueue = [],
  25803. this.uploadQueues = {},
  25804. this.uploadInterval = null,
  25805. this.uploadIntervalCancelled = !1,
  25806. this.usingTileOverlay = !1,
  25807. this.overlayTilesLoaded = !1,
  25808. this.overlayTileBase = null,
  25809. this.overlayTilesBasic = {},
  25810. this.overlayTilesEnhanced = {},
  25811. this.zoomRenderTarget = null,
  25812. this.zoomPano = null,
  25813. this.zoomingActive = !1,
  25814. this.zoomPanoId = null,
  25815. this.zoomPanoRenderingDisabled = !1,
  25816. this.direction = new h.Vector3,
  25817. this.initTime = -1,
  25818. this.maxBaseUploadsPerFrame = x,
  25819. this.maxNonBaseUploadsPerFrame = T
  25820. }
  25821. function c() {
  25822. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  25823. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25824. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  25825. }
  25826. var h = e("three")
  25827. , u = e("../exception/BasicException")
  25828. , d = e("../settings")
  25829. , p = e("../enum/PanoSizeClass")
  25830. , f = (e("../objects/Panorama"),
  25831. e("../enum/PanoRendererEvents"))
  25832. , g = e("../enum/SceneRendererEvents")
  25833. , m = e("../enum/TileDownloaderEvents")
  25834. , v = e("../enum/Vectors")
  25835. , A = (e("../enum/GLCubeFaces"),
  25836. e("../objects/Panorama"),
  25837. e("./TileTree"))
  25838. , y = (e("./TileDownloader"),
  25839. e("./TilePrioritizer"))
  25840. , C = e("./TileUtils")
  25841. , p = e("../enum/PanoSizeClass")
  25842. , I = (e("../util/browser"),
  25843. e("../util/panorama"))
  25844. , E = e("events").EventEmitter
  25845. , b = !1
  25846. , w = d.tiling.uploadIntervalDelay
  25847. , _ = d.tiling.initialIntervalDelay
  25848. , T = d.tiling.maxNonBaseUploadsPerFrame
  25849. , x = d.tiling.maxBaseUploadsPerFrame
  25850. , S = {
  25851. Base: 0,
  25852. Remaining: 1
  25853. }
  25854. , M = [];
  25855. l.prototype = Object.create(E.prototype),
  25856. l.prototype.init = function(e, t, i) {
  25857. this.sceneRenderer = e,
  25858. this.tileDownloader = t,
  25859. this.qualityManager = i,
  25860. this.bindEvents(),
  25861. this.sceneRenderer.on(g.ContextCreated, this.loadOverlayTiles.bind(this)),
  25862. this.initTime = performance.now()
  25863. }
  25864. ,
  25865. l.prototype.getActivePanoTextures = function(e) {
  25866. e = e || [];
  25867. for (var t = 0; t < M.length; t++) {
  25868. var i = M[t];
  25869. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  25870. }
  25871. }
  25872. ,
  25873. l.prototype.hasQueuedTiles = function() {
  25874. var e = this.peekNextFromUploadQueue();
  25875. return null !== e && void 0 !== e
  25876. }
  25877. ,
  25878. l.prototype.getActiveRenderTargetDescriptor = function(e) {
  25879. return this.activeRenderTargetDescriptors[e]
  25880. }
  25881. ,
  25882. l.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  25883. this.activeRenderTargetDescriptors[e] = t
  25884. }
  25885. ,
  25886. l.prototype.loadOverlayTiles = function() {
  25887. if (0 !== d.tiling.overlayStyle) {
  25888. var e = 0
  25889. , t = function(t, n, r) {
  25890. t = n ? t[n] = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping),
  25891. this.sceneRenderer.uploadTexture2D(r, t, 0, 0, C.TILE_SIZE, C.TILE_SIZE),
  25892. e++,
  25893. e === i.length && (this.overlayTilesLoaded = !0)
  25894. }
  25895. .bind(this)
  25896. , i = [["images/outlineBase.png", t.bind(this, this.overlayTileBase, null)], ["images/outlineBasic512.png", t.bind(this, this.overlayTilesBasic, 256)], ["images/outlineBasic512.png", t.bind(this, this.overlayTilesBasic, 512)], ["images/outlineBasic1024.png", t.bind(this, this.overlayTilesBasic, 1024)], ["images/outlineBasic2048.png", t.bind(this, this.overlayTilesBasic, 2048)], ["images/outlineBasic4096.png", t.bind(this, this.overlayTilesBasic, 4096)], ["images/outlineEnhanced512.png", t.bind(this, this.overlayTilesEnhanced, 256)], ["images/outlineEnhanced512.png", t.bind(this, this.overlayTilesEnhanced, 512)], ["images/outlineEnhanced1024.png", t.bind(this, this.overlayTilesEnhanced, 1024)], ["images/outlineEnhanced2048.png", t.bind(this, this.overlayTilesEnhanced, 2048)], ["images/outlineEnhanced4096.png", t.bind(this, this.overlayTilesEnhanced, 4096)]];
  25897. i.forEach(function(e) {
  25898. this.tileDownloader.loadImage(e[0], 0, e[1])
  25899. }
  25900. .bind(this)),
  25901. this.usingTileOverlay = !0
  25902. } else
  25903. this.usingTileOverlay = !1
  25904. }
  25905. ,
  25906. l.prototype.bindEvents = function() {
  25907. this.tileDownloader.on(m.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  25908. }
  25909. ,
  25910. l.prototype.setupZoomRenderTarget = function() {
  25911. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  25912. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  25913. return;
  25914. var e = this.zoomRenderTarget;
  25915. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  25916. e) {
  25917. var t = e.width
  25918. , i = this.zoomRenderTarget.width;
  25919. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  25920. e.texture.dispose(),
  25921. e.texture.loaded = !1,
  25922. e.texture.version = 0,
  25923. this.sceneRenderer.deallocateCubeTexture(e.texture),
  25924. e.texture = null
  25925. }
  25926. this.zoomPanoRenderingDisabled = !1
  25927. } else
  25928. this.zoomPanoRenderingDisabled = !0
  25929. }
  25930. ,
  25931. l.prototype.enableUltraHighQualityMode = function(e) {
  25932. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  25933. var t = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  25934. this.tileDownloader.testDownload(t, C.TILE_SIZE, function(t) {
  25935. t && (this.qualityManager.enableUltraHighQualityMode(),
  25936. this.setupZoomRenderTarget(),
  25937. e())
  25938. }
  25939. .bind(this))
  25940. }
  25941. }
  25942. ,
  25943. l.prototype.activateTiledPano = function(e, t, i) {
  25944. i && this.clearAllQueuedUploads();
  25945. for (var n = 0; n < C.FACES_PER_PANO; n++)
  25946. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  25947. this.linkAllTilesAndNodes(e);
  25948. var r = this.getActiveRenderTargetDescriptor(e.id)
  25949. , l = t;
  25950. if (l > this.qualityManager.getMaxNavPanoSize() && (l = this.qualityManager.getMaxNavPanoSize()),
  25951. !r || l !== r.size) {
  25952. if (r && s(r.renderTarget),
  25953. r = a(l),
  25954. !r) {
  25955. var c = this.initTiledPano(l, !1);
  25956. r = o(c.width),
  25957. r.renderTarget = c
  25958. }
  25959. r.pano = e,
  25960. this.resetPanoDescriptor(e.id),
  25961. this.resetPanoLODDescriptors(e.id),
  25962. this.resetRenderStatus(e.id, !0, !0)
  25963. }
  25964. this.setActiveRenderTargetDescriptor(e.id, r);
  25965. var h = i ? 0 : 1;
  25966. return this.updateActivePanos(e, h),
  25967. r.renderTarget
  25968. }
  25969. ,
  25970. l.prototype.deactivateTiledPano = function(e) {
  25971. var t = this.getActiveRenderTargetDescriptor(e.id);
  25972. this.isRenderTargetDescriptorValid(t) && s(t.renderTarget),
  25973. this.setActiveRenderTargetDescriptor(e.id, null);
  25974. var i = this.getUploadQueueForPano(e.id);
  25975. this.clearUploadQueue(i),
  25976. this.updateActivePanos()
  25977. }
  25978. ,
  25979. l.prototype.updateActivePanos = function() {
  25980. var e = [];
  25981. return function(t, i) {
  25982. e.length = 0;
  25983. for (var n = 0; n < this.activePanos.length; n++) {
  25984. t && e.length === i && e.push(t);
  25985. var r = this.activePanos[n]
  25986. , o = this.getActiveRenderTargetDescriptor(r.id);
  25987. t && r.id === t.id || !this.isRenderTargetDescriptorValid(o) || e.push(r)
  25988. }
  25989. t && i >= e.length && e.push(t),
  25990. this.activePanos.length = 0,
  25991. this.activePanos.push.apply(this.activePanos, e)
  25992. }
  25993. }(),
  25994. l.prototype.getActivePanoCount = function() {
  25995. return this.activePanos.length
  25996. }
  25997. ,
  25998. l.prototype.resetRenderStatus = function(e, t, i, n) {
  25999. var r = null;
  26000. n && (r = A.getLevelCountForSize(C.TILE_SIZE, n) + 1);
  26001. for (var o = function(e, n, r, o) {
  26002. i && (n.tile.zoomUploaded = !1),
  26003. t && (n.tile.uploaded = !1)
  26004. }, a = 0; a < C.FACES_PER_PANO; a++) {
  26005. var s = this.getTileTree(e, a);
  26006. s.breadthFirst({
  26007. callback: o.bind(this, a),
  26008. minLevel: r
  26009. })
  26010. }
  26011. }
  26012. ,
  26013. l.prototype.copyBaseRenderStatusToZoomed = function(e) {
  26014. for (var t = A.getLevelCountForSize(C.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  26015. t.tile.zoomUploaded = t.tile.uploaded,
  26016. t.zoomCovered = t.covered
  26017. }, n = 0; n < C.FACES_PER_PANO; n++) {
  26018. var r = this.getTileTree(e, n);
  26019. r.breadthFirst({
  26020. callback: i.bind(this, n),
  26021. maxLevel: t
  26022. })
  26023. }
  26024. }
  26025. ,
  26026. l.prototype.renderPanoTiles = function() {
  26027. var e = [];
  26028. return function(t, i, n, r) {
  26029. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  26030. i = i || this.direction || v.FORWARD;
  26031. var o = this.getActiveRenderTargetDescriptor(t);
  26032. if (!this.isRenderTargetDescriptorValid(o))
  26033. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  26034. for (var a = 0; a < C.FACES_PER_PANO; a++) {
  26035. var s = this.getTileTree(t, a);
  26036. e.length = 0,
  26037. s.breadthFirst({
  26038. saveVisited: e
  26039. });
  26040. for (var l = 0; l < e.length; l++) {
  26041. var c = e[l];
  26042. this.queueTileUpload(c.tile, !1, r || 0 === l && n)
  26043. }
  26044. }
  26045. this.updateDirection(i)
  26046. }
  26047. }(),
  26048. l.prototype.isRenderTargetDescriptorValid = function(e) {
  26049. return e && e.renderTarget
  26050. }
  26051. ,
  26052. l.prototype.isPanoActive = function(e) {
  26053. var t = this.getActiveRenderTargetDescriptor(e);
  26054. return this.isRenderTargetDescriptorValid(t)
  26055. }
  26056. ,
  26057. l.prototype.isPanoZoomed = function(e) {
  26058. return this.zoomingActive && this.zoomPanoId === e
  26059. }
  26060. ,
  26061. l.prototype.initTileTree = function(e, t, i) {
  26062. var n = this.tileTrees[e];
  26063. n || (n = [],
  26064. this.tileTrees[e] = n);
  26065. var r = n[t];
  26066. if (!r) {
  26067. var o = A.getLevelCountForSize(C.TILE_SIZE, i);
  26068. r = new A(C.TILE_SIZE,o),
  26069. n[t] = r
  26070. }
  26071. }
  26072. ,
  26073. l.prototype.getTileTree = function(e, t) {
  26074. var i = this.tileTrees[e];
  26075. if (!i)
  26076. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  26077. var n = i[t];
  26078. if (!n)
  26079. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  26080. return n
  26081. }
  26082. ,
  26083. l.prototype.initTiledPano = function(e, t) {
  26084. var i = this.sceneRenderer.renderer
  26085. , n = (i.context,
  26086. new h.WebGLRenderTargetCube(e,e,{
  26087. stencilBuffer: !1
  26088. }))
  26089. , r = new h.CubeTexture([]);
  26090. n.texture = r,
  26091. r.image = [null, null, null, null, null, null],
  26092. r.flipY = !0,
  26093. t ? (r.generateMipmaps = !0,
  26094. r.magFilter = h.LinearFilter,
  26095. r.minFilter = h.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  26096. r.magFilter = h.LinearFilter,
  26097. r.minFilter = h.LinearFilter),
  26098. r.format = h.RGBAFormat,
  26099. i.setRenderTarget(n),
  26100. i.setRenderTarget(null);
  26101. var o = i.properties.get(r);
  26102. return o.__image__webglTextureCube = o.__webglTexture,
  26103. n
  26104. }
  26105. ,
  26106. l.prototype.getUploadQueueForPano = function(e) {
  26107. var t = this.uploadQueues[e];
  26108. return t || (t = [],
  26109. this.uploadQueues[e] = t),
  26110. t
  26111. }
  26112. ,
  26113. l.prototype.isTileUploaded = function(e) {
  26114. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  26115. }
  26116. ,
  26117. l.prototype.setUploaded = function(e, t) {
  26118. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  26119. }
  26120. ,
  26121. l.prototype.queueTileUpload = function(e, t, i) {
  26122. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  26123. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  26124. var r = this.getUploadQueueForPano(e.panoId);
  26125. i ? this.uploadTile(e, !1) : (this.shoulPushToFrontOfQueue(e) ? this.forceQueue.push(e) : t && this.direction ? y.insertSortedPanoTile(r, e, n.pano, this.direction) : r.push(e),
  26126. e.uploadQueued = !0,
  26127. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  26128. }
  26129. }
  26130. ,
  26131. l.prototype.shoulPushToFrontOfQueue = function(e) {
  26132. return 0 === A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  26133. }
  26134. ,
  26135. l.prototype.getTopUploadQueue = function() {
  26136. for (var e = null, t = null, i = S.Base; i <= S.Remaining; i++)
  26137. for (var n = 0; n < this.activePanos.length; n++)
  26138. if (e = this.activePanos[n],
  26139. t = this.getUploadQueueForPano(e.id),
  26140. t.length > 0)
  26141. switch (i) {
  26142. case S.Base:
  26143. if (0 === t[0].level)
  26144. return t;
  26145. break;
  26146. case S.Remaining:
  26147. return t
  26148. }
  26149. return null
  26150. }
  26151. ,
  26152. l.prototype.getNextFromUploadQueue = function() {
  26153. var e = function(e) {
  26154. var t = e.shift();
  26155. return t.uploadQueued = !1,
  26156. t
  26157. };
  26158. return function() {
  26159. if (this.forceQueue.length > 0)
  26160. return e(this.forceQueue);
  26161. var t = this.getTopUploadQueue();
  26162. return t && t.length > 0 ? e(t) : null
  26163. }
  26164. }(),
  26165. l.prototype.peekNextFromUploadQueue = function() {
  26166. if (this.forceQueue.length > 0)
  26167. return this.forceQueue[0];
  26168. var e = this.getTopUploadQueue();
  26169. return e && e.length > 0 ? e[0] : null
  26170. }
  26171. ,
  26172. l.prototype.clearAllQueuedUploads = function() {
  26173. this.clearAllUploadQueues(null, 0)
  26174. }
  26175. ,
  26176. l.prototype.clearAllQueuedUploadsForPano = function(e) {
  26177. this.clearAllUploadQueues(e, 0)
  26178. }
  26179. ,
  26180. l.prototype.clearAllUploadQueues = function(e, t) {
  26181. if (e)
  26182. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  26183. this.clearUploadQueue(this.forceQueue, t, e);
  26184. else {
  26185. for (var i = 0; i < this.activePanos.length; i++) {
  26186. var n = this.activePanos[i];
  26187. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  26188. }
  26189. this.clearUploadQueue(this.forceQueue, t)
  26190. }
  26191. }
  26192. ,
  26193. l.prototype.clearUploadQueue = function(e, t, i) {
  26194. void 0 !== t && null !== t || (t = 0);
  26195. for (var n = 0; n < e.length; ) {
  26196. var r = e[n];
  26197. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  26198. e.splice(n, 1)) : n++
  26199. }
  26200. }
  26201. ,
  26202. l.prototype.refreshUploadInterval = function() {
  26203. var e = null;
  26204. return function(t) {
  26205. this.uploadIntervalCancelled || (e || (e = c.bind(this)),
  26206. null !== t && void 0 !== t || (t = w),
  26207. b || (t = _),
  26208. this.uploadInterval = window.setTimeout(e, t),
  26209. this.uploadIntervalDelay = t)
  26210. }
  26211. }(),
  26212. l.prototype.update = function() {
  26213. var e = performance.now()
  26214. , t = 0;
  26215. return function() {
  26216. this.uploadIntervalCancelled = !0,
  26217. window.clearTimeout(this.uploadInterval),
  26218. this.uploadInterval = null;
  26219. var i = performance.now() - e;
  26220. !(i > w || 0 === t) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  26221. e = performance.now()),
  26222. t++
  26223. }
  26224. }(),
  26225. l.prototype.updateUploadQueue = function(e, t) {
  26226. e || (e = 1);
  26227. for (var i = 0, n = 0; ; ) {
  26228. if (n >= t || i >= e)
  26229. break;
  26230. var r = this.getNextFromUploadQueue();
  26231. if (!r)
  26232. break;
  26233. if (0 !== r.level ? i++ : n++,
  26234. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  26235. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  26236. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  26237. }
  26238. }
  26239. }
  26240. ,
  26241. l.prototype.updateDirection = function(e) {
  26242. if (e = e || this.direction) {
  26243. this.direction = e;
  26244. for (var t = 0; t < this.activePanos.length; t++) {
  26245. var i = this.activePanos[t]
  26246. , n = this.getUploadQueueForPano(i.id);
  26247. y.sortPanoTiles(n, i, this.direction)
  26248. }
  26249. }
  26250. }
  26251. ,
  26252. l.prototype.uploadTile = function() {
  26253. var e = {}
  26254. , t = (new h.Vector4,
  26255. d.tiling.overlayStyle);
  26256. return function(i, n) {
  26257. var r = i.panoId
  26258. , o = i.image
  26259. , a = i.tileSize
  26260. , s = i.panoSize
  26261. , l = i.tileIndex
  26262. , c = (i.faceTileIndex,
  26263. i.totalTiles)
  26264. , u = (i.face,
  26265. i.tileX)
  26266. , d = i.tileY
  26267. , p = !0
  26268. , g = !1
  26269. , m = (this.getPanoDescriptor(r),
  26270. this.getPanoLODDescriptor(r, s))
  26271. , v = this.getActiveRenderTargetDescriptor(r)
  26272. , A = v.renderTarget
  26273. , y = v.size;
  26274. if (this.isPanoZoomed(r) && (A = this.zoomRenderTarget,
  26275. y = this.qualityManager.getMaxZoomPanoSize()),
  26276. this.isRenderTargetDescriptorValid(v) || (p = !1,
  26277. g = !1),
  26278. n || (this.anyUploaded(i.node) && (p = !1,
  26279. g = !0),
  26280. this.isTileUploaded(i) && (p = !1,
  26281. g = !1)),
  26282. p) {
  26283. var C = u * a
  26284. , I = d * a
  26285. , E = a / s * y
  26286. , b = C / s * y
  26287. , w = I / s * y;
  26288. e[a] || (e[a] = this.sceneRenderer.initSizedTexture2D(a, h.ClampToEdgeWrapping));
  26289. var _ = e[a];
  26290. if (this.sceneRenderer.uploadTexture2D(o, _, 0, 0, a, a),
  26291. 1 === t || 2 === t) {
  26292. var T = 1 === t ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  26293. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace),
  26294. this.sceneRenderer.renderToCubeMap(T[s], A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace, h.NormalBlending, !0, .5)
  26295. } else
  26296. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace);
  26297. m.uploadCount++,
  26298. this.emit(f.TileRenderSuccess, r, s, l, c),
  26299. m.uploadCount === c && this.emit(f.PanoRenderComplete, r, s, c),
  26300. this.setUploaded(i, !0),
  26301. this.addCoverageForNode(i.node)
  26302. } else
  26303. this.setUploaded(i, !1);
  26304. return i.uploadAttempted || (m.uploadAttempts++,
  26305. this.emit(f.TileUploadAttempted, r, s, l, c)),
  26306. i.uploadAttempted = !0,
  26307. m.uploadAttempts === c && this.emit(f.UploadAttemptedForAllTiles, r, s, c),
  26308. g
  26309. }
  26310. }(),
  26311. l.prototype.linkTileAndNode = function(e, t) {
  26312. t.tile = e,
  26313. e.node = t
  26314. }
  26315. ,
  26316. l.prototype.linkAllTilesAndNodes = function(e) {
  26317. for (var t = function(t, i, n, r, o) {
  26318. var a = this.getTileDirectoryEntry(e.id, i, r, o);
  26319. this.linkTileAndNode(a, n)
  26320. }, i = 0; i < C.FACES_PER_PANO; i++) {
  26321. var n = this.getTileTree(e.id, i);
  26322. n.breadthFirst({
  26323. callback: t.bind(this, n, i)
  26324. })
  26325. }
  26326. }
  26327. ,
  26328. l.prototype.anyUploaded = function(e) {
  26329. if (!e)
  26330. return !1;
  26331. if (e.tile && this.isTileUploaded(e.tile))
  26332. return !0;
  26333. if (e.children)
  26334. for (var t = 0; t < e.children.length; t++) {
  26335. var i = e.children[t];
  26336. if (this.anyUploaded(i))
  26337. return !0
  26338. }
  26339. return !1
  26340. }
  26341. ,
  26342. l.prototype.setNodeCovered = function(e, t) {
  26343. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  26344. }
  26345. ,
  26346. l.prototype.isNodeCovered = function(e) {
  26347. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  26348. }
  26349. ,
  26350. l.prototype.addCoverageForNode = function(e) {
  26351. if (this.setNodeCovered(e, !0),
  26352. e.parent && e.covered) {
  26353. var t = e.parent;
  26354. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  26355. }
  26356. }
  26357. ,
  26358. l.prototype.calcFullCoverage = function(e) {
  26359. var t = !1;
  26360. if (e.children)
  26361. for (var i = 0; i < e.children.length; i++) {
  26362. var n = e.children[i];
  26363. t = t || this.calcFullCoverage(n)
  26364. }
  26365. e.covered = e.tile.uploaded || t
  26366. }
  26367. ,
  26368. l.prototype.nodeSubcovered = function(e) {
  26369. if (!e.children)
  26370. return !1;
  26371. for (var t = 0; t < e.children.length; t++)
  26372. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  26373. return !1;
  26374. return !0
  26375. }
  26376. ,
  26377. l.prototype.resetPanoDescriptor = function(e) {
  26378. this.getPanoDescriptor(e)
  26379. }
  26380. ,
  26381. l.prototype.getPanoDescriptor = function(e) {
  26382. var t = this.panoDescriptors[e];
  26383. return t || (t = {},
  26384. this.panoDescriptors[e] = t),
  26385. t
  26386. }
  26387. ,
  26388. l.prototype.resetPanoLODDescriptors = function(e) {
  26389. var t = this.getPanoLODDescriptors(e);
  26390. for (var i in t)
  26391. if (t.hasOwnProperty(i)) {
  26392. var n = t[i];
  26393. n.uploadCount = 0,
  26394. n.uploadAttempts = 0
  26395. }
  26396. }
  26397. ,
  26398. l.prototype.getPanoLODDescriptor = function(e, t) {
  26399. var i = this.getPanoLODDescriptors(e)
  26400. , n = i[t];
  26401. return n || (n = {
  26402. uploadCount: 0,
  26403. uploadAttempts: 0
  26404. },
  26405. i[t] = n),
  26406. n
  26407. }
  26408. ,
  26409. l.prototype.getPanoLODDescriptors = function(e) {
  26410. var t = this.panoLODDescriptors[e];
  26411. return t || (t = {},
  26412. this.panoLODDescriptors[e] = t),
  26413. t
  26414. }
  26415. ,
  26416. l.prototype.onTileDownloaded = function(e) {
  26417. var t = A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  26418. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  26419. if (i.downloaded = !0,
  26420. i.image = e.image,
  26421. i.panoSize = e.panoSize,
  26422. i.tileX = e.tileX,
  26423. i.tileY = e.tileY,
  26424. i.totalTiles = e.totalTiles,
  26425. i.tileIndex = e.tileIndex,
  26426. i.faceTileIndex = e.faceTileIndex,
  26427. i.face = e.face,
  26428. i.cubeFace = I.mapFaceToCubemapFace(e.face),
  26429. i.panoId = e.panoId,
  26430. i.tileSize = e.tileSize,
  26431. i.direction = (new h.Vector3).copy(e.direction),
  26432. i.node = null,
  26433. i.level = A.getLevelCountForSize(C.TILE_SIZE, i.panoSize),
  26434. this.isPanoActive(i.panoId)) {
  26435. var n = this.getTileTree(i.panoId, i.face)
  26436. , r = n.getSubNode(i.panoSize, i.tileX, i.tileY);
  26437. this.linkTileAndNode(i, r),
  26438. this.queueTileUpload(i, !0)
  26439. }
  26440. }
  26441. ,
  26442. l.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  26443. var r = this.tileDirectory[e];
  26444. r || (r = {},
  26445. this.tileDirectory[e] = r);
  26446. var o = 16384 * t + 1024 * i + n
  26447. , a = r[o];
  26448. return a || (a = {
  26449. downloaded: !1,
  26450. uploaded: !1,
  26451. zoomUploaded: !1
  26452. },
  26453. r[o] = a),
  26454. a._key = e + ":" + t + ":" + i + ":" + n,
  26455. a._tileKey = o,
  26456. a
  26457. }
  26458. ,
  26459. l.prototype.setZoomingActive = function(e, t, i) {
  26460. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  26461. this.zoomPanoId = t.id,
  26462. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  26463. }
  26464. ,
  26465. l.prototype.updateZoomedPanoFromBase = function(e) {
  26466. if (!this.zoomPanoRenderingDisabled) {
  26467. var t = this.getActiveRenderTargetDescriptor(e.id);
  26468. if (t && t.renderTarget) {
  26469. var i = this.qualityManager.getMaxZoomPanoSize()
  26470. , n = t.renderTarget
  26471. , r = t.size;
  26472. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  26473. this.copyBaseRenderStatusToZoomed(e.id)
  26474. }
  26475. }
  26476. }
  26477. ,
  26478. t.exports = l
  26479. }
  26480. , {
  26481. "../enum/GLCubeFaces": 25,
  26482. "../enum/PanoRendererEvents": 35,
  26483. "../enum/PanoSizeClass": 36,
  26484. "../enum/SceneRendererEvents": 43,
  26485. "../enum/TileDownloaderEvents": 45,
  26486. "../enum/Vectors": 50,
  26487. "../exception/BasicException": 55,
  26488. "../objects/Panorama": 148,
  26489. "../settings": 166,
  26490. "../util/browser": 182,
  26491. "../util/panorama": 191,
  26492. "./TileDownloader": 171,
  26493. "./TilePrioritizer": 172,
  26494. "./TileTree": 173,
  26495. "./TileUtils": 174,
  26496. events: 202,
  26497. three: 217
  26498. }],
  26499. 170: [function(e, t, i) {
  26500. "use strict";
  26501. function n(e, t, i) {
  26502. this.maxNavPanoSize = -1,
  26503. this.maxZoomPanoSize = -1,
  26504. this.devicePixelDensity = e,
  26505. this.deviceScreenSize = t,
  26506. this.clientBandwidth = i,
  26507. this.panoSizeClassMap = {},
  26508. this.useHighResolutionPanos = !0,
  26509. this.useUltraHighResolutionPanos = !1,
  26510. this.modelHasUltraHighPanos = !1
  26511. }
  26512. var r = e("../enum/PanoSizeClass")
  26513. , o = e("../settings")
  26514. , a = e("../util/browser")
  26515. , s = e("../constants")
  26516. , l = e("../util/showcase")
  26517. , c = e("../enum/ModelManagerEvents");
  26518. n.prototype.init = function(e) {
  26519. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  26520. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  26521. this.highSize = this.getPanoSize(r.HIGH),
  26522. this.standardSize = this.getPanoSize(r.STANDARD),
  26523. this.baseSize = this.getPanoSize(r.BASE),
  26524. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  26525. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  26526. this.updateMaximums(),
  26527. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  26528. }
  26529. ,
  26530. n.prototype.updateFromModel = function(e) {
  26531. this.updateHighResolutionSettings(e),
  26532. this.updateUltraHighResolutionSettings(e)
  26533. }
  26534. ,
  26535. n.prototype.updateHighResolutionSettings = function(e) {
  26536. //---------------------许钟文---------原始的会判断modeldata里version,以致useHighResolutionPanos为false,所以我直接变为true啦----------------------------------
  26537. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  26538. //this.useHighResolutionPanos = !0;
  26539. //----------------------e n d -----------------------------------------------------------------
  26540. this.updateMaximums()
  26541. }
  26542. ,
  26543. n.prototype.updateUltraHighResolutionSettings = function(e) {
  26544. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  26545. this.updateMaximums()
  26546. }
  26547. ,
  26548. n.prototype.enableUltraHighQualityMode = function() {
  26549. this.modelHasUltraHighPanos = !0,
  26550. this.updateUltraHighResolutionSettings(null)
  26551. }
  26552. ,
  26553. n.prototype.ultraHighQualityModeEnabled = function() {
  26554. return this.modelHasUltraHighPanos
  26555. }
  26556. ,
  26557. n.prototype.onModelChanged = function(e) {
  26558. this.updateFromModel(e.model),
  26559. this.updateMaximums()
  26560. }
  26561. ,
  26562. n.prototype.updateMaximums = function() {
  26563. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  26564. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  26565. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  26566. }
  26567. ,
  26568. n.prototype.buildPanoSizeClassMap = function() {
  26569. this.panoSizeClassMap[r.BASE] = 512,
  26570. this.panoSizeClassMap[r.STANDARD] = 1024,
  26571. this.panoSizeClassMap[r.HIGH] = 2048,
  26572. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  26573. }
  26574. ,
  26575. n.prototype.getPanoSize = function(e) {
  26576. return this.panoSizeClassMap[e]
  26577. }
  26578. ,
  26579. n.prototype.getMaxPossiblePanoSize = function() {
  26580. return this.getPanoSize(r.ULTRAHIGH)
  26581. }
  26582. ,
  26583. n.prototype.getMaxPanoSize = function() {
  26584. return this.maxZoomPanoSize
  26585. }
  26586. ,
  26587. n.prototype.getMaxNavPanoSize = function() {
  26588. return this.maxNavPanoSize
  26589. }
  26590. ,
  26591. n.prototype.getMaxZoomPanoSize = function() {
  26592. return this.maxZoomPanoSize
  26593. }
  26594. ,
  26595. n.prototype.detectMaxNavPanoSizeClass = function() {
  26596. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  26597. }
  26598. ,
  26599. n.prototype.detectMaxNavPanoSize = function() {
  26600. var e = this.detectMaxNavPanoSizeClass();
  26601. return this.getPanoSize(e)
  26602. }
  26603. ,
  26604. n.prototype.detectMaxZoomPanoSize = function() {
  26605. return this.useHighResolutionPanos ? a.isMobile() ? o.tiling.mobileHighQualityOverride ? this.getPanoSize(r.HIGH) : this.getPanoSize(r.STANDARD) : this.useUltraHighResolutionPanos ? this.getPanoSize(r.ULTRAHIGH) : this.getPanoSize(r.HIGH) : this.getPanoSize(r.STANDARD)
  26606. }
  26607. ,
  26608. t.exports = n
  26609. }
  26610. , {
  26611. "../constants": 8,
  26612. "../enum/ModelManagerEvents": 33,
  26613. "../enum/PanoSizeClass": 36,
  26614. "../settings": 166,
  26615. "../util/browser": 182,
  26616. "../util/showcase": 193
  26617. }],
  26618. 171: [function(e, t, i) {
  26619. (function(i) {
  26620. "use strict";
  26621. function n(e) {
  26622. this.panos = null,
  26623. this.retryMinimumTime = 1e4,
  26624. this.urls = null,
  26625. this.panoLoadCallbacks = {},
  26626. this.downloadDescriptors = {},
  26627. this.priorityQueue = [],
  26628. this.forceQueue = [],
  26629. this.activeDownloads = [],
  26630. this.qualityManager = null,
  26631. this.tilePrioritizer = null,
  26632. this.refreshInterval = null,
  26633. this.processPriorityQueue = !1,
  26634. this.concurrentDownloads = e.concurrentDownloads || 1,
  26635. this.downloadTestResults = {}
  26636. }
  26637. var r = e("three")
  26638. , o = (e("../enum/Viewmode"),
  26639. e("../settings"))
  26640. , a = (e("../objects/Panorama"),
  26641. e("../util/logger"))
  26642. , s = (e("../enum/Vectors"),
  26643. e("../enum/PanoSizeClass"),
  26644. e("../enum/TileDownloaderEvents"))
  26645. , l = e("./TilePrioritizer")
  26646. , c = e("./TileUtils")
  26647. , h = (e("../enum/GLCubeFaces"),
  26648. e("../enum/DownloadStatus"))
  26649. , u = e("../util/panorama")
  26650. , d = e("../util/ajax")
  26651. , p = e("../ab")
  26652. , f = e("events").EventEmitter
  26653. , g = (new a(i),
  26654. Object.freeze({
  26655. Testing: 1,
  26656. Success: 2,
  26657. Fail: 3
  26658. }));
  26659. n.prototype = Object.create(f.prototype),
  26660. n.IDLE_REFRESH_DELAY = 500,
  26661. n.ACTIVE_REFRESH_DELAY = 16,
  26662. n.DOWNLOAD_RETRIES = 4,
  26663. n.prototype.init = function(e) {
  26664. this.qualityManager = e
  26665. }
  26666. ,
  26667. n.prototype.setUrls = function(e) {
  26668. this.urls = e
  26669. }
  26670. ,
  26671. n.prototype.setPanoData = function(e, t, i) {
  26672. this.panos = e,
  26673. this.imagePanos = t,
  26674. this.panoGroupId = i
  26675. }
  26676. ,
  26677. n.prototype.start = function() {
  26678. this.refreshUpdateInterval(0)
  26679. }
  26680. ,
  26681. n.prototype.stop = function() {
  26682. window.cancel(this.refreshInterval)
  26683. }
  26684. ,
  26685. n.prototype.refreshUpdateInterval = function(e) {
  26686. e || (e = 0),
  26687. this.refreshInterval = window.setTimeout(function() {
  26688. var e = this.update();
  26689. e ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY)
  26690. }
  26691. .bind(this), e)
  26692. }
  26693. ,
  26694. n.prototype.update = function() {
  26695. var e = this.forceQueue.length > 0;
  26696. return this.processQueueForDownloading(this.forceQueue),
  26697. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  26698. this.priorityQueue.length > 0 && (e = !0),
  26699. this.processQueueForDownloading(this.priorityQueue)),
  26700. e
  26701. }
  26702. ,
  26703. n.prototype.forceQueueTilesForPano = function() {
  26704. var e = []
  26705. , t = [];
  26706. return function(i, n, r, o, a, s) {
  26707. e.length = 0;
  26708. for (var u = this.getTileDownloadDescriptors(i, n), d = 0; d < u.length; d++) {
  26709. var p = u[d];
  26710. p.status !== h.None && p.status !== h.Queued || e.push(p)
  26711. }
  26712. if (r && e.length > 0) {
  26713. l.sortPanoTiles(e, i, r),
  26714. t.length = 0,
  26715. c.matchingTilesInDirection(i, n, r, o, a, t);
  26716. for (var f = 0, g = function(e) {
  26717. return e.face === m.face && e.faceTileIndex === m.faceTileIndex
  26718. }; f < e.length; ) {
  26719. var m = e[f]
  26720. , v = t.findIndex(g);
  26721. v < 0 ? e.splice(f, 1) : f++
  26722. }
  26723. }
  26724. for (var A = 0; A < e.length; A++)
  26725. this.forceQueue.push(e[A]);
  26726. this.setStatusForAllDescriptors(this.forceQueue, h.ForceQueued),
  26727. this.clearFromQueue(this.priorityQueue, h.ForceQueued, !1),
  26728. s && this.processQueueForDownloading(this.forceQueue, !0)
  26729. }
  26730. }(),
  26731. n.prototype.clearForceQueue = function() {
  26732. this.clearQueue(this.forceQueue)
  26733. }
  26734. ,
  26735. n.prototype.queuePrioritizedTilesForPanos = function(e) {
  26736. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  26737. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  26738. this.clearFromQueue(this.priorityQueue, h.None, !0),
  26739. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, h.Queued))
  26740. }
  26741. ,
  26742. n.prototype.clearQueue = function(e) {
  26743. this.setStatusForAllDescriptors(e, h.None),
  26744. e.length = 0
  26745. }
  26746. ,
  26747. n.prototype.clearFromQueue = function(e, t, i) {
  26748. for (var n = 0; n < e.length; n++) {
  26749. var r = e[n];
  26750. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  26751. }
  26752. }
  26753. ,
  26754. n.prototype.setStatusForAllDescriptors = function(e, t) {
  26755. for (var i = 0; i < e.length; i++) {
  26756. var n = e[i];
  26757. n && (n.status = t)
  26758. }
  26759. }
  26760. ,
  26761. n.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  26762. for (var i = 0; i < e.length; i++) {
  26763. var n = e[i];
  26764. n && (n.status !== t ? n.status = t : e[i] = null)
  26765. }
  26766. }
  26767. ,
  26768. n.prototype.getTileDownloadDescriptors = function(e, t) {
  26769. var i = this.getAllTileDownloadDescriptorsForPano(e)
  26770. , n = i[t];
  26771. return n || (n = this.buildDownloadDescriptorArray(t),
  26772. i[t] = n,
  26773. this.initTileDownloadDescriptors(n, e, t)),
  26774. n
  26775. }
  26776. ,
  26777. n.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  26778. var t = this.downloadDescriptors[e.id];
  26779. return t || (t = {},
  26780. this.downloadDescriptors[e.id] = t),
  26781. t
  26782. }
  26783. ,
  26784. n.prototype.processQueueForDownloading = function(e, t) {
  26785. if (this.cleanupActiveDownloads(),
  26786. this.activeDownloads.length < this.concurrentDownloads || t)
  26787. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0, r = 0; n < i && e.length > 0; r++) {
  26788. var o = e.shift();
  26789. o && (this.startDownload(o),
  26790. n++)
  26791. }
  26792. }
  26793. ,
  26794. n.prototype.testDownload = function(e, t, i) {
  26795. var n = this.downloadTestResults[e];
  26796. if (n)
  26797. return void (n === g.Success ? i(!0) : n === g.Fail && i(!1));
  26798. this.downloadTestResults[e] = g.Testing;
  26799. var r = this.panos.list[0]
  26800. , o = this.getTileUrl(r.id, e, t, 0)
  26801. , a = function(t) {
  26802. this.downloadTestResults[e] = g.Success,
  26803. i(!0)
  26804. }
  26805. .bind(this)
  26806. , s = function() {
  26807. this.downloadTestResults[e] = g.Fail,
  26808. i(!1)
  26809. }
  26810. .bind(this);
  26811. this.loadImage(o, 0, a, s)
  26812. }
  26813. ,
  26814. n.prototype.startDownload = function(e) {
  26815. e.status = h.Downloading;
  26816. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  26817. this.activeDownloads.push(e),
  26818. this.loadImage(t, n.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  26819. }
  26820. ,
  26821. n.prototype.downloadFailed = function(e, t) {}
  26822. ,
  26823. n.prototype.downloadComplete = function(e, t) {
  26824. if (e.panoGroupId === this.panoGroupId) {
  26825. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  26826. e.status = h.Downloaded,
  26827. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  26828. var n = {
  26829. panoId: e.pano.id,
  26830. image: t,
  26831. tileSize: e.tileSize,
  26832. panoSize: e.panoSize,
  26833. tileIndex: e.tileIndex,
  26834. faceTileIndex: e.faceTileIndex,
  26835. totalTiles: e.totalTiles,
  26836. face: e.face,
  26837. tileX: e.tileX,
  26838. tileY: e.tileY,
  26839. direction: e.direction
  26840. };
  26841. e.image = t,
  26842. this.emit(s.TileDownloadSuccess, n),
  26843. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  26844. panoId: e.pano.id,
  26845. tileSize: e.tileSize,
  26846. panoSize: e.panoSize
  26847. },
  26848. this.emit(s.PanoDownloadComplete, n),
  26849. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  26850. }
  26851. }
  26852. ,
  26853. n.prototype.cleanupActiveDownloads = function() {
  26854. var e = [];
  26855. return function() {
  26856. e.length = 0;
  26857. for (var t = 0; t < this.activeDownloads.length; t++) {
  26858. var i = this.activeDownloads[t];
  26859. i.status !== h.Downloaded && i.status !== h.Failed && e.push(i)
  26860. }
  26861. this.activeDownloads.length = 0,
  26862. this.activeDownloads.push.apply(this.activeDownloads, e)
  26863. }
  26864. }(),
  26865. n.prototype.isPanoDownloaded = function(e, t) {
  26866. var i = this.getTileDownloadDescriptors(e, t);
  26867. if (i.length <= 0)
  26868. return !1;
  26869. for (var n = 0; n < i.length; n++) {
  26870. var r = i[n];
  26871. if (r.status !== h.Downloaded)
  26872. return !1
  26873. }
  26874. return !0
  26875. }
  26876. ,
  26877. n.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  26878. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  26879. this.panoLoadCallbacks[o] = {
  26880. onLoad: i,
  26881. onFail: n,
  26882. onProgress: r
  26883. }
  26884. }
  26885. ,
  26886. n.prototype.getPanoLoadCallbacks = function(e, t) {
  26887. var i = e.id + ":" + t;
  26888. return this.panoLoadCallbacks[i]
  26889. }
  26890. ,
  26891. n.prototype.buildDownloadDescriptorArray = function(e) {
  26892. for (var t = c.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  26893. var r = this.buildDownloadDescriptor();
  26894. i.push(r)
  26895. }
  26896. return i
  26897. }
  26898. ,
  26899. n.prototype.buildDownloadDescriptor = function() {
  26900. var e = {
  26901. panoGroupId: null,
  26902. pano: null,
  26903. panoSize: -1,
  26904. tileSize: -1,
  26905. tileIndex: -1,
  26906. totalTiles: -1,
  26907. faceTileIndex: -1,
  26908. status: h.None,
  26909. url: null,
  26910. image: null,
  26911. direction: new r.Vector3,
  26912. face: -1,
  26913. cubeFace: -1,
  26914. tileX: -1,
  26915. tileY: -1
  26916. };
  26917. return e
  26918. }
  26919. ,
  26920. n.prototype.initTileDownloadDescriptors = function(e, t, i) {
  26921. for (var n = 0; n < e.length; n++) {
  26922. var r = e[n];
  26923. this.initTileDownloadDescriptor(r, t, i, n)
  26924. }
  26925. }
  26926. ,
  26927. n.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  26928. var r = i >= c.TILE_SIZE ? c.TILE_SIZE : i;
  26929. e.face = c.getFaceForTile(i, n),
  26930. e.cubeFace = u.mapFaceToCubemapFace(e.face),
  26931. e.panoGroupId = this.panoGroupId,
  26932. e.pano = t,
  26933. e.panoSize = i,
  26934. e.tileSize = r,
  26935. e.tileIndex = n,
  26936. e.totalTiles = c.getTileCountForSize(i),
  26937. e.status = h.None,
  26938. e.image = null,
  26939. c.getTileLocation(e.panoSize, e.tileIndex, e),
  26940. c.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, c.LocationOnTile.Center, 0, e.direction)
  26941. }
  26942. ,
  26943. n.prototype.getTileUrl = function() {
  26944. var e = {
  26945. 256: "256",
  26946. 512: "512",
  26947. 1024: "1k",
  26948. 2048: "2k",
  26949. 4096: "4k"
  26950. }
  26951. , t = {
  26952. face: -1,
  26953. faceTileIndex: -1,
  26954. tileX: -1,
  26955. tileY: -1
  26956. };
  26957. return function(i, n, r, a) {
  26958. c.getTileLocation(n, a, t);
  26959. var s = Math.floor(n / r)
  26960. , l = s * s
  26961. , h = Math.floor(a / l)
  26962. , u = "";
  26963. 1 === o.tiling.customCompression && (u = "_" + o.tiling["q" + e[n]]);
  26964. var d = this.urls.get("tiles/" + i + "/" + e[n] + u + "_face" + h + "_" + t.tileX + "_" + t.tileY + ".jpg");
  26965. return d = p.changeIfTileGenerating(d)
  26966. }
  26967. }(),
  26968. n.prototype.loadImage = function(e, t, i, n) {
  26969. d.getImage(e, t).then(function(e) {
  26970. i(e)
  26971. }).fail(n)
  26972. }
  26973. ,
  26974. t.exports = n
  26975. }
  26976. ).call(this, "/js/tile/TileDownloader.js")
  26977. }
  26978. , {
  26979. "../ab": 3,
  26980. "../enum/DownloadStatus": 24,
  26981. "../enum/GLCubeFaces": 25,
  26982. "../enum/PanoSizeClass": 36,
  26983. "../enum/TileDownloaderEvents": 45,
  26984. "../enum/Vectors": 50,
  26985. "../enum/Viewmode": 51,
  26986. "../objects/Panorama": 148,
  26987. "../settings": 166,
  26988. "../util/ajax": 181,
  26989. "../util/logger": 189,
  26990. "../util/panorama": 191,
  26991. "./TilePrioritizer": 172,
  26992. "./TileUtils": 174,
  26993. events: 202,
  26994. three: 217
  26995. }],
  26996. 172: [function(e, t, i) {
  26997. (function(i) {
  26998. "use strict";
  26999. function n(e, t, i, o, a) {
  27000. this.qualityManager = e,
  27001. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  27002. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  27003. this.baseSize = t,
  27004. this.standardSize = i,
  27005. this.highSize = o,
  27006. this.ultraHighSize = a,
  27007. this.priorityCriteria = new n.PriorityCriteria(null,new r.Vector3(0,0,0),new r.Vector3(0,0,-1),new r.Vector3(0,0,-1))
  27008. }
  27009. var r = e("three")
  27010. , o = (e("../enum/Viewmode"),
  27011. e("../settings"),
  27012. e("../settings"),
  27013. e("../objects/Panorama"))
  27014. , a = e("../util/logger")
  27015. , s = (e("../enum/Vectors"),
  27016. e("../enum/PanoSizeClass"),
  27017. e("../enum/ModelManagerEvents"),
  27018. e("../enum/GLCubeFaces"),
  27019. e("../enum/DownloadStatus"))
  27020. , l = (e("../util/browser"),
  27021. e("./TileUtils"))
  27022. , c = e("../util/math")
  27023. , h = (e("events").EventEmitter,
  27024. new a(i),
  27025. Object.freeze({
  27026. None: 0,
  27027. DirectionalFOV: 1
  27028. }));
  27029. n.PriorityCriteria = function(e, t, i, n, o) {
  27030. this.pano = e,
  27031. this.cameraPosition = (new r.Vector3).copy(t),
  27032. this.cameraDir = (new r.Vector3).copy(i),
  27033. this.panoSpaceDir = (new r.Vector3).copy(n),
  27034. this.upcomingPanos = o,
  27035. this.copy = function(e) {
  27036. this.pano = e.pano,
  27037. this.cameraPosition.copy(e.cameraPosition),
  27038. this.cameraDir.copy(e.cameraDir),
  27039. this.panoSpaceDir.copy(e.panoSpaceDir),
  27040. this.upcomingPanos = o
  27041. }
  27042. ,
  27043. this.zoomingActive = !1
  27044. }
  27045. ,
  27046. n.DIRECTIONAL_FOV = 180,
  27047. n.DIRECTIONAL_FOV_NARROW = 120,
  27048. n.MAX_SCORED_PANOS_TOCONSIDER = 6,
  27049. n.MAX_SCORED_PANOS_TOADD = 2,
  27050. n.MAX_UPCOMING_PANOS_TOADD = 3,
  27051. n.DIRECTION_SCORE_STRICTNESS = .75,
  27052. n.appendQueue = function(e, t) {
  27053. if (e && t)
  27054. for (var i = 0; i < t.length; i++)
  27055. e.push(t[i])
  27056. }
  27057. ,
  27058. n.prototype.updateCriteria = function(e, t, i, n) {
  27059. this.priorityCriteria.pano = e,
  27060. this.priorityCriteria.cameraPosition.copy(t),
  27061. this.priorityCriteria.cameraDir.copy(i),
  27062. this.priorityCriteria.upcomingPanos = n,
  27063. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  27064. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  27065. }
  27066. ,
  27067. n.prototype.filterAndPrioritize = function() {
  27068. var e = []
  27069. , t = []
  27070. , i = [];
  27071. return function(r, o, a) {
  27072. this.populateNeighborPanos(this.priorityCriteria.pano, o, e),
  27073. this.populateScoredPanos(this.priorityCriteria.pano, o, t, this.priorityCriteria.cameraDir, n.MAX_SCORED_PANOS_TOCONSIDER);
  27074. var s = this.baseSize
  27075. , l = this.standardSize
  27076. , c = this.highSize
  27077. , h = this.ultraHighSize;
  27078. this.queueTilesForPano(r, a, this.priorityCriteria.pano, s),
  27079. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, s, n.MAX_UPCOMING_PANOS_TOADD),
  27080. i.length = 0,
  27081. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  27082. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  27083. n.appendQueue(r, i),
  27084. this.queueTilesForPanos(r, t, a, s, n.MAX_SCORED_PANOS_TOADD),
  27085. i.length = 0,
  27086. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  27087. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  27088. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  27089. n.appendQueue(r, i),
  27090. i.length = 0,
  27091. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  27092. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  27093. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  27094. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  27095. n.appendQueue(r, i),
  27096. this.queueTilesForPanos(r, e, a, s)
  27097. }
  27098. }(),
  27099. n.prototype.canDownloadSize = function(e) {
  27100. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  27101. }
  27102. ,
  27103. n.prototype.populateNeighborPanos = function(e, t, i) {
  27104. i = i || [],
  27105. i.length = 0;
  27106. var n = t.getNeighbours(e);
  27107. for (var r in n)
  27108. if (n.hasOwnProperty(r)) {
  27109. var o = t.get(r);
  27110. i.push(o)
  27111. }
  27112. return i
  27113. }
  27114. ,
  27115. n.prototype.populateScoredPanos = function(e, t, i, r, a) {
  27116. i = i || [],
  27117. i.length = 0;
  27118. var s = [o.filters.inPanoDirection(e.position, r, n.DIRECTION_SCORE_STRICTNESS), o.filters.not(e)]
  27119. , l = [o.scoreFunctions.distanceSquared(e), o.scoreFunctions.direction(e.position, r)]
  27120. , c = t.sortByScore(s, l);
  27121. if (c)
  27122. for (var h = 0; h < c.length && h < a; h++) {
  27123. var u = c[h].pano;
  27124. i.push(u)
  27125. }
  27126. return i
  27127. }
  27128. ,
  27129. n.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  27130. for (var o = 0, a = 0; a < t.length; a++) {
  27131. var s = t[a]
  27132. , l = this.queueTilesForPano(e, i, s, n);
  27133. if (o += l > 0 ? 1 : 0,
  27134. r && o >= r)
  27135. break
  27136. }
  27137. return o
  27138. }
  27139. ,
  27140. n.prototype.queueTilesForPano = function() {
  27141. var e = {
  27142. filter: h.None
  27143. };
  27144. return function(t, i, n, r) {
  27145. return this.filterAndQueueTileDownloadDescriptors(t, i, n, r, e)
  27146. }
  27147. }(),
  27148. n.prototype.queueTilesForPanosInDirection = function() {
  27149. var e = new r.Vector3;
  27150. return function(t, i, n, r, o, a, s, l) {
  27151. for (var h = 0, u = 0; u < n.length; u++) {
  27152. var d = n[u];
  27153. e.copy(d.position),
  27154. e.sub(o),
  27155. e.normalize();
  27156. var p = Math.max(Math.min(a.dot(e), 1), -1)
  27157. , f = c.getFOVDotThreshold(s);
  27158. if (p >= f) {
  27159. var g = this.queueTilesInDirectionForPano(t, i, d, r, o, a, s);
  27160. if (h += g > 0 ? 1 : 0,
  27161. l && h >= l)
  27162. break
  27163. }
  27164. }
  27165. return h
  27166. }
  27167. }(),
  27168. n.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  27169. for (var l = 0, c = 0; c < i.length; c++) {
  27170. var h = i[c]
  27171. , u = this.queueTilesInDirectionForPano(e, t, h, n, o, a);
  27172. if (l += u > 0 ? 1 : 0,
  27173. s && l >= s)
  27174. break
  27175. }
  27176. return l
  27177. }
  27178. ,
  27179. n.prototype.queueTilesInDirectionForPano = function() {
  27180. var e = {
  27181. filter: h.DirectionalFOV,
  27182. direction: new r.Vector3,
  27183. fov: 60
  27184. }
  27185. , t = new r.Vector3;
  27186. return function(i, n, r, o, a, s, c) {
  27187. return t.copy(s),
  27188. l.getRelativeDirection(r.quaternion, t),
  27189. e.direction.copy(t),
  27190. e.fov = c,
  27191. this.filterAndQueueTileDownloadDescriptors(i, n, r, o, e)
  27192. }
  27193. }(),
  27194. n.prototype.filterAndQueueTileDownloadDescriptors = function() {
  27195. var e = [];
  27196. return function(t, i, n, r, o) {
  27197. var a = i.getTileDownloadDescriptors(n, r);
  27198. e.length = 0,
  27199. this.filterTileDownloadDescriptors(n, a, e, o);
  27200. for (var s = 0, l = 0; l < e.length; l++) {
  27201. var c = e[l];
  27202. c && (t.push(c),
  27203. s++)
  27204. }
  27205. return s
  27206. }
  27207. }(),
  27208. n.prototype.filterTileDownloadDescriptors = function() {
  27209. new r.Vector3;
  27210. return function(e, t, i, n) {
  27211. var r, o;
  27212. switch (n.filter) {
  27213. case h.DirectionalFOV:
  27214. for (r = 0; r < t.length; r++)
  27215. o = t[r],
  27216. l.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  27217. break;
  27218. default:
  27219. for (r = 0; r < t.length; r++)
  27220. o = t[r],
  27221. i.push(o)
  27222. }
  27223. for (r = 0; r < i.length; r++)
  27224. o = i[r],
  27225. this.canIncludeDescriptor(o) || (i[r] = null)
  27226. }
  27227. }(),
  27228. n.prototype.canIncludeDescriptor = function(e) {
  27229. return e.status !== s.Downloading && e.status !== s.Downloaded
  27230. }
  27231. ,
  27232. n.prototype.canIncludePano = function(e, t) {
  27233. return !e.isLoaded(t)
  27234. }
  27235. ,
  27236. n.getFOVDotThreshold = function(e) {
  27237. return Math.cos(r.Math.degToRad(e / 2))
  27238. }
  27239. ;
  27240. var u = function() {
  27241. var e = function e(t, i) {
  27242. var n = e._panoSpaceDir
  27243. , r = e._fovThreshold
  27244. , o = e._fovThresholdNarrow
  27245. , a = Math.max(Math.min(n.dot(t.direction), 1), -1)
  27246. , s = Math.max(Math.min(n.dot(i.direction), 1), -1);
  27247. return t._dot = a,
  27248. i._dot = s,
  27249. a >= r && s < r ? -1 : a < r && s >= r ? 1 : a >= o && s < o ? -1 : a < o && s >= o ? 1 : t.panoSize > i.panoSize ? 1 : i.panoSize > t.panoSize ? -1 : -(a - s)
  27250. };
  27251. return e._panoSpaceDir = new r.Vector3,
  27252. e._fovThreshold = -1,
  27253. e._fovThresholdNarrow = -1,
  27254. e
  27255. }();
  27256. n.sortPanoTiles = function(e, t, i) {
  27257. u._panoSpaceDir.copy(i),
  27258. l.getRelativeDirection(t.quaternion, u._panoSpaceDir),
  27259. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  27260. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV),
  27261. e.sort(u)
  27262. }
  27263. ,
  27264. n.insertSortedPanoTile = function(e, t, i, r) {
  27265. u._panoSpaceDir.copy(r),
  27266. l.getRelativeDirection(i.quaternion, u._panoSpaceDir),
  27267. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  27268. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV);
  27269. for (var o = -1, a = 0; a < e.length; a++) {
  27270. var s = u(t, e[a]);
  27271. if (s <= 0) {
  27272. o = a;
  27273. break
  27274. }
  27275. }
  27276. if (o === -1)
  27277. e[e.length] = t;
  27278. else {
  27279. for (var h = e.length; h > o; h--)
  27280. e[h] = e[h - 1];
  27281. e[o] = t
  27282. }
  27283. }
  27284. ,
  27285. n.prototype.setZoomingActive = function(e) {
  27286. e !== this.zoomingActive && (this.zoomingActive = e)
  27287. }
  27288. ,
  27289. t.exports = n
  27290. }
  27291. ).call(this, "/js/tile/TilePrioritizer.js")
  27292. }
  27293. , {
  27294. "../enum/DownloadStatus": 24,
  27295. "../enum/GLCubeFaces": 25,
  27296. "../enum/ModelManagerEvents": 33,
  27297. "../enum/PanoSizeClass": 36,
  27298. "../enum/Vectors": 50,
  27299. "../enum/Viewmode": 51,
  27300. "../objects/Panorama": 148,
  27301. "../settings": 166,
  27302. "../util/browser": 182,
  27303. "../util/logger": 189,
  27304. "../util/math": 190,
  27305. "./TileUtils": 174,
  27306. events: 202,
  27307. three: 217
  27308. }],
  27309. 173: [function(e, t, i) {
  27310. "use strict";
  27311. function n(e, t) {
  27312. this.levels = t,
  27313. this.tileSize = e,
  27314. this.root = null,
  27315. this.allNodes = [],
  27316. a(this)
  27317. }
  27318. function r(e, t) {
  27319. this.tree = e,
  27320. this.parent = t,
  27321. this.children = [],
  27322. this.id = ++u
  27323. }
  27324. function o(e, t, i, r, a, s, l, h) {
  27325. if (e) {
  27326. l = l || n.TraversalType.PreOrder;
  27327. var u = r * c + i;
  27328. if (l === n.TraversalType.PreOrder && (a && a(e, t, u, i, r),
  27329. s && s.push(e)),
  27330. e.children && 0 !== e.children.length) {
  27331. for (var d = r * c, p = i * c, f = 0; f < c; f++)
  27332. for (var g = 0; g < c; g++)
  27333. o(e.children[g * c + f], t + 1, p + f, d + g, a, s, l, h);
  27334. l === n.TraversalType.PostOrder && (a && a(e, t, u, i, r),
  27335. s && s.push(e))
  27336. }
  27337. }
  27338. }
  27339. function a(e) {
  27340. e.root = s(e, null, 0)
  27341. }
  27342. function s(e, t, i) {
  27343. if (i > e.levels)
  27344. return null;
  27345. var n = new r(e,t);
  27346. e.allNodes.push(n);
  27347. for (var o = 0; o < h; o++)
  27348. n.children[o] = s(e, n, i + 1);
  27349. return n
  27350. }
  27351. function l(e, t, i, n, r) {
  27352. if (!e)
  27353. return null;
  27354. if (0 === i)
  27355. return e;
  27356. if (!e.children || 0 === e.children.length)
  27357. return null;
  27358. var o = Math.pow(c, i)
  27359. , a = o / c
  27360. , s = n % a
  27361. , h = r % a
  27362. , u = Math.floor(r / a)
  27363. , d = Math.floor(n / a)
  27364. , p = u * c + d
  27365. , f = e.children[p];
  27366. return l(f, t + 1, i - 1, s, h)
  27367. }
  27368. var c = (e("three"),
  27369. e("./TileUtils"),
  27370. e("../objects/Panorama"),
  27371. e("../util/panorama"),
  27372. e("events").EventEmitter,
  27373. 2)
  27374. , h = c * c;
  27375. n.TraversalType = Object.freeze({
  27376. PreOrder: 0,
  27377. PostOrder: 1
  27378. });
  27379. var u = 0;
  27380. n.getLevelCountForSize = function(e, t) {
  27381. var i = 0;
  27382. for (t < e && (t = e); ; ) {
  27383. if (t /= c,
  27384. t < e)
  27385. break;
  27386. i++
  27387. }
  27388. return i
  27389. }
  27390. ,
  27391. n.getSizeForLevel = function(e, t) {
  27392. return Math.pow(c, t) * e
  27393. }
  27394. ,
  27395. n.prototype.getSubNode = function(e, t, i) {
  27396. (!t || e < this.tileSize) && (t = 0),
  27397. (!i || e < this.tileSize) && (i = 0),
  27398. e < this.tileSize && (e = this.tileSize);
  27399. var r = n.getLevelCountForSize(this.tileSize, e)
  27400. , o = l(this.root, 0, r, t, i);
  27401. return o
  27402. }
  27403. ,
  27404. n.prototype.breadthFirst = function(e) {
  27405. e = e || {};
  27406. var t = !!e.nullLevelEnd
  27407. , i = e.maxLevel
  27408. , n = e.minLevel
  27409. , r = e.callback
  27410. , o = e.saveVisited
  27411. , a = []
  27412. , s = {}
  27413. , l = 0
  27414. , c = 0;
  27415. for (a.push(this.root),
  27416. a.push(s); a.length > 0 && !(i && l > i); ) {
  27417. var h = a.shift();
  27418. if (h === s)
  27419. (!n || l >= n) && (r && t && r(null),
  27420. o && t && o.push(null)),
  27421. a.length > 0 && a.push(s),
  27422. l++,
  27423. c = 0;
  27424. else {
  27425. if (h.children)
  27426. for (var u = 0; u < h.children.length; u++) {
  27427. var d = h.children[u];
  27428. d && a.push(h.children[u])
  27429. }
  27430. var p = this.getFaceIndexFromNode(h);
  27431. (!n || l >= n) && (r && r(h, l, p),
  27432. o && o.push(h)),
  27433. c++
  27434. }
  27435. }
  27436. }
  27437. ,
  27438. n.prototype.getFaceIndexFromNode = function(e) {
  27439. if (!e)
  27440. return -1;
  27441. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  27442. var o = i.parent;
  27443. if (!o)
  27444. break;
  27445. for (var a = -1, s = 0; s < o.children.length; s++)
  27446. o.children[s] === i && (a = s);
  27447. var l = a % c
  27448. , h = Math.floor(a / c);
  27449. n = l * t + n,
  27450. r = h * t + r,
  27451. t *= c,
  27452. i = o
  27453. }
  27454. return r * t + n
  27455. }
  27456. ,
  27457. n.prototype.depthFirst = function(e, t, i) {
  27458. o(this.root, 0, 0, 0, e, t, i, this.tileSize)
  27459. }
  27460. ,
  27461. t.exports = n
  27462. }
  27463. , {
  27464. "../objects/Panorama": 148,
  27465. "../util/panorama": 191,
  27466. "./TileUtils": 174,
  27467. events: 202,
  27468. three: 217
  27469. }],
  27470. 174: [function(e, t, i) {
  27471. "use strict";
  27472. var n = e("../enum/GLCubeFaces")
  27473. , r = e("../util/MathLight")
  27474. , o = {};
  27475. o.TILE_SIZE = 512,
  27476. o.FACES_PER_PANO = 6,
  27477. o.LocationOnTile = {
  27478. Center: 0,
  27479. UpperLeft: 1,
  27480. UpperRight: 2,
  27481. LowerRight: 3,
  27482. LowerLeft: 4
  27483. },
  27484. o.getTileVector = function() {
  27485. return function(e, t, i, a, s, l, c, h) {
  27486. l = l || o.LocationOnTile.Center;
  27487. var u = e / t
  27488. , d = a / u;
  27489. s = -s + (u - 1);
  27490. var p = s / u
  27491. , f = t / e
  27492. , g = 2 * f
  27493. , m = g / 2
  27494. , v = 2 * d - 1 + m
  27495. , A = 2 * p - 1 + m;
  27496. switch (l) {
  27497. case o.LocationOnTile.UpperLeft:
  27498. v -= m,
  27499. A += m,
  27500. v += c * g;
  27501. break;
  27502. case o.LocationOnTile.UpperRight:
  27503. v += m,
  27504. A += m,
  27505. A -= c * g;
  27506. break;
  27507. case o.LocationOnTile.LowerRight:
  27508. v += m,
  27509. A -= m,
  27510. v -= c * g;
  27511. break;
  27512. case o.LocationOnTile.LowerLeft:
  27513. v -= m,
  27514. A -= m,
  27515. A += c * g;
  27516. break;
  27517. case o.LocationOnTile.Center:
  27518. }
  27519. switch (i) {
  27520. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  27521. r.setVector(h, -1, A, -v);
  27522. break;
  27523. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  27524. r.setVector(h, 1, A, v);
  27525. break;
  27526. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  27527. r.setVector(h, -v, 1, -A);
  27528. break;
  27529. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  27530. r.setVector(h, -v, -1, A);
  27531. break;
  27532. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  27533. r.setVector(h, -v, A, 1);
  27534. break;
  27535. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  27536. r.setVector(h, v, A, -1)
  27537. }
  27538. r.normalize(h)
  27539. }
  27540. }(),
  27541. o.getFaceForTile = function(e, t) {
  27542. var i = o.TILE_SIZE;
  27543. e < o.TILE_SIZE && (i = e);
  27544. var n = Math.floor(e / i)
  27545. , r = n * n;
  27546. return Math.floor(t / r)
  27547. }
  27548. ,
  27549. o.getTileLocation = function(e, t, i) {
  27550. var n = o.TILE_SIZE;
  27551. e < o.TILE_SIZE && (n = e);
  27552. var r = o.getFaceForTile(e, t)
  27553. , a = Math.floor(e / n)
  27554. , s = a * a
  27555. , l = t - r * s;
  27556. i.tileX = l % a,
  27557. i.tileY = Math.floor(l / a),
  27558. i.face = r,
  27559. i.faceTileIndex = l
  27560. }
  27561. ,
  27562. o.getTileCountForSize = function(e) {
  27563. if (e <= o.TILE_SIZE)
  27564. return o.FACES_PER_PANO;
  27565. var t = Math.floor(e / o.TILE_SIZE)
  27566. , i = t * t
  27567. , n = i * o.FACES_PER_PANO;
  27568. return n
  27569. }
  27570. ,
  27571. o.getRelativeDirection = function() {
  27572. var e = new r.Matrix4
  27573. , t = new r.Quaternion;
  27574. return function(i, n) {
  27575. t.copy(i),
  27576. t.inverse(),
  27577. e.makeRotationFromQuaternion(t),
  27578. e.applyToVector3(n),
  27579. r.normalize(n)
  27580. }
  27581. }(),
  27582. o.matchingTilesInDirection = function() {
  27583. var e = new r.Vector3
  27584. , t = new r.Vector3(0,0,-1)
  27585. , i = new r.Quaternion
  27586. , n = function(e, t) {
  27587. e.push({
  27588. face: t.face,
  27589. faceTileIndex: t.faceTileIndex,
  27590. tileX: t.tileX,
  27591. tileY: t.tileY
  27592. })
  27593. }
  27594. , a = function() {
  27595. var e = {
  27596. face: -1,
  27597. faceTileIndex: -1,
  27598. tileX: -1,
  27599. tileY: -1
  27600. };
  27601. return function(t, i, r) {
  27602. for (var a = o.getTileCountForSize(t), s = 0, l = 0; l < a; l++)
  27603. o.getTileLocation(t, l, e),
  27604. i && !i(e) || (s++,
  27605. r && n(r, e));
  27606. return s
  27607. }
  27608. }();
  27609. return function(n, s, l, c, h, u) {
  27610. var d = s < o.TILE_SIZE ? s : o.TILE_SIZE;
  27611. o.getTileCountForSize(s);
  27612. if (!c && !h)
  27613. return a(s, null, u);
  27614. var p = !!h;
  27615. if (h = h || c,
  27616. h = Math.max(0, Math.min(h, 360)),
  27617. c = Math.max(0, Math.min(c, 360)),
  27618. r.copyVector(l, e),
  27619. o.getRelativeDirection(n.quaternion, e),
  27620. p) {
  27621. i.setFromUnitVectors(e, t);
  27622. var f = function(e) {
  27623. return o.isTileWithinFrustum(s, d, e.face, e.tileX, e.tileY, i, c, h)
  27624. };
  27625. return a(s, f, u)
  27626. }
  27627. var g = function(t) {
  27628. return o.isTileWithinFOV(s, d, t.face, t.tileX, t.tileY, e, c)
  27629. };
  27630. return a(s, g, u)
  27631. }
  27632. }(),
  27633. o.isTileWithinFrustum = function() {
  27634. var e = new r.Vector3
  27635. , t = 1e-5;
  27636. return function(i, n, a, s, l, c, h, u) {
  27637. for (var d = Math.tan(.5 * u * r.RADIANS_PER_DEGREE), p = -d, f = Math.tan(.5 * h * r.RADIANS_PER_DEGREE), g = -f, m = o.mapFaceToCubemapFace(a), v = 0, A = 0, y = 0, C = 0, I = 0, E = 0, b = o.LocationOnTile.Center; b <= o.LocationOnTile.LowerLeft; b++)
  27638. if (o.getTileVector(i, n, m, s, l, b, 0, e),
  27639. r.applyQuaternionToVector(c, e),
  27640. e.z >= -t)
  27641. I++;
  27642. else {
  27643. var w = -1 / e.z
  27644. , _ = e.x * w
  27645. , T = e.y * w;
  27646. T > d ? v++ : T < p && A++,
  27647. _ > f ? y++ : _ < g && C++,
  27648. E++
  27649. }
  27650. return A !== E && v !== E && y !== E && C !== E
  27651. }
  27652. }(),
  27653. o.isTileWithinFOV = function() {
  27654. var e = new r.Vector3
  27655. , t = new r.Vector3(0,1,0)
  27656. , i = new r.Vector3(1,0,0);
  27657. return function(n, a, s, l, c, h, u) {
  27658. var d = o.mapFaceToCubemapFace(s);
  27659. if (r.cross(h, t, i),
  27660. o.getTileVector(n, a, d, l, c, o.LocationOnTile.Center, 0, e),
  27661. o.isWithinFOV(e, h, u, null))
  27662. return !0;
  27663. for (var p = u / 360, f = Math.floor(1 / p), g = 0, m = 0; m < f; m++) {
  27664. for (var v = o.LocationOnTile.UpperLeft; v <= o.LocationOnTile.LowerLeft; v++)
  27665. if (o.getTileVector(n, a, d, l, c, v, g, e),
  27666. o.isWithinFOV(e, h, u, null))
  27667. return !0;
  27668. g += p
  27669. }
  27670. return !1
  27671. }
  27672. }(),
  27673. o.isWithinFOV = function() {
  27674. var e = new r.Vector3
  27675. , t = new r.Vector3;
  27676. return function(i, n, o, a) {
  27677. if (r.copyVector(i, t),
  27678. a) {
  27679. r.copyVector(a, e),
  27680. r.normalize(e);
  27681. var s = r.dot(e, i);
  27682. e.x *= s,
  27683. e.y *= s,
  27684. e.z *= s,
  27685. r.subVector(t, e)
  27686. }
  27687. var l = o / 2 * r.RADIANS_PER_DEGREE
  27688. , c = Math.cos(l)
  27689. , h = r.dot(t, n);
  27690. return h >= c
  27691. }
  27692. }(),
  27693. o.mapFaceToCubemapFace = function() {
  27694. var e = {
  27695. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  27696. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  27697. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  27698. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  27699. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  27700. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  27701. };
  27702. return function(t) {
  27703. return e[t]
  27704. }
  27705. }(),
  27706. t.exports = o
  27707. }
  27708. , {
  27709. "../enum/GLCubeFaces": 25,
  27710. "../util/MathLight": 176
  27711. }],
  27712. 175: [function(e, t, i) {
  27713. (function(i) {
  27714. "use strict";
  27715. function n() {
  27716. this.list = [],
  27717. this.index = {},
  27718. Object.defineProperty(this, "length", {
  27719. get: function() {
  27720. return this.list.length
  27721. }
  27722. })
  27723. }
  27724. var r = (e("./common"),
  27725. e("./logger"));
  27726. new r(i);
  27727. n.prototype.forEach = function(e) {
  27728. this.list.forEach(e)
  27729. }
  27730. ,
  27731. n.prototype.add = function(e) {
  27732. this.list.push(e),
  27733. this.index[this.getIndex(e)] = e
  27734. }
  27735. ,
  27736. n.prototype.getIndex = function(e) {
  27737. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  27738. }
  27739. ,
  27740. n.prototype.extend = function(e) {
  27741. for (var t = 0; t < e.length; t++)
  27742. this.add(e[t])
  27743. }
  27744. ,
  27745. n.prototype.get = function(e) {
  27746. return this.index[e]
  27747. }
  27748. ,
  27749. n.prototype.first = function() {
  27750. return this.list[0]
  27751. }
  27752. ,
  27753. n.prototype.last = function() {
  27754. return this.list[this.list.length - 1]
  27755. }
  27756. ,
  27757. n.prototype.reIndex = function() {
  27758. this.index = {};
  27759. var e = this;
  27760. this.forEach(function(t) {
  27761. e.index[e.getIndex(t)] = t
  27762. })
  27763. }
  27764. ,
  27765. n.prototype.filter = function(e) {
  27766. var t = this.list.filter(e);
  27767. return this.reIndex(),
  27768. t
  27769. }
  27770. ,
  27771. n.prototype.reduce = function(e, t) {
  27772. return this.list.reduce(e, t)
  27773. }
  27774. ,
  27775. n.prototype.sort = function(e) {
  27776. return this.list.sort(e)
  27777. }
  27778. ,
  27779. n.prototype.indexOf = function(e) {
  27780. for (var t = 0; t < this.list.length; ++t)
  27781. if (this.list[t] === e)
  27782. return t;
  27783. return -1
  27784. }
  27785. ,
  27786. t.exports = n
  27787. }
  27788. ).call(this, "/js/util/IndexedCollection.js")
  27789. }
  27790. , {
  27791. "./common": 185,
  27792. "./logger": 189
  27793. }],
  27794. 176: [function(e, t, i) {
  27795. "use strict";
  27796. var n = e("../constants")
  27797. , r = {};
  27798. r.RADIANS_PER_DEGREE = Math.PI / 180,
  27799. r.DEGREES_PER_RADIAN = 180 / Math.PI,
  27800. r.Vector3 = function(e, t, i) {
  27801. this.x = e || 0,
  27802. this.y = t || 0,
  27803. this.z = i || 0
  27804. }
  27805. ,
  27806. r.Matrix4 = function() {
  27807. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  27808. arguments.length > 0 && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  27809. }
  27810. ,
  27811. r.Matrix4.prototype = {
  27812. identity: function() {
  27813. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  27814. this
  27815. },
  27816. copy: function(e) {
  27817. return this.elements.set(e.elements),
  27818. this
  27819. },
  27820. applyToVector3: function(e) {
  27821. var t = e.x
  27822. , i = e.y
  27823. , n = e.z
  27824. , r = this.elements;
  27825. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  27826. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  27827. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  27828. this
  27829. },
  27830. getInverse: function(e, t) {
  27831. var i = this.elements
  27832. , n = e.elements
  27833. , r = n[0]
  27834. , o = n[1]
  27835. , a = n[2]
  27836. , s = n[3]
  27837. , l = n[4]
  27838. , c = n[5]
  27839. , h = n[6]
  27840. , u = n[7]
  27841. , d = n[8]
  27842. , p = n[9]
  27843. , f = n[10]
  27844. , g = n[11]
  27845. , m = n[12]
  27846. , v = n[13]
  27847. , A = n[14]
  27848. , y = n[15]
  27849. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  27850. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  27851. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  27852. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  27853. , w = r * C + o * I + a * E + s * b;
  27854. if (0 === w) {
  27855. var _ = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  27856. if (t)
  27857. throw new Error(_);
  27858. return console.warn(_),
  27859. this.identity()
  27860. }
  27861. var T = 1 / w;
  27862. return i[0] = C * T,
  27863. i[1] = (v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y) * T,
  27864. i[2] = (c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y) * T,
  27865. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  27866. i[4] = I * T,
  27867. i[5] = (d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y) * T,
  27868. i[6] = (m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y) * T,
  27869. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  27870. i[8] = E * T,
  27871. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y) * T,
  27872. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y) * T,
  27873. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  27874. i[12] = b * T,
  27875. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A) * T,
  27876. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A) * T,
  27877. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  27878. this
  27879. },
  27880. makeRotationFromQuaternion: function(e) {
  27881. var t = this.elements
  27882. , i = e.x
  27883. , n = e.y
  27884. , r = e.z
  27885. , o = e.w
  27886. , a = i + i
  27887. , s = n + n
  27888. , l = r + r
  27889. , c = i * a
  27890. , h = i * s
  27891. , u = i * l
  27892. , d = n * s
  27893. , p = n * l
  27894. , f = r * l
  27895. , g = o * a
  27896. , m = o * s
  27897. , v = o * l;
  27898. return t[0] = 1 - (d + f),
  27899. t[4] = h - v,
  27900. t[8] = u + m,
  27901. t[1] = h + v,
  27902. t[5] = 1 - (c + f),
  27903. t[9] = p - g,
  27904. t[2] = u - m,
  27905. t[6] = p + g,
  27906. t[10] = 1 - (c + d),
  27907. t[3] = 0,
  27908. t[7] = 0,
  27909. t[11] = 0,
  27910. t[12] = 0,
  27911. t[13] = 0,
  27912. t[14] = 0,
  27913. t[15] = 1,
  27914. this
  27915. }
  27916. },
  27917. r.Quaternion = function(e, t, i, n) {
  27918. this._x = e || 0,
  27919. this._y = t || 0,
  27920. this._z = i || 0,
  27921. this._w = void 0 !== n ? n : 1
  27922. }
  27923. ,
  27924. r.Quaternion.prototype = {
  27925. get x() {
  27926. return this._x
  27927. },
  27928. set x(e) {
  27929. this._x = e
  27930. },
  27931. get y() {
  27932. return this._y
  27933. },
  27934. set y(e) {
  27935. this._y = e
  27936. },
  27937. get z() {
  27938. return this._z
  27939. },
  27940. set z(e) {
  27941. this._z = e
  27942. },
  27943. get w() {
  27944. return this._w
  27945. },
  27946. set w(e) {
  27947. this._w = e
  27948. },
  27949. copy: function(e) {
  27950. this._x = e.x,
  27951. this._y = e.y,
  27952. this._z = e.z,
  27953. this._w = e.w
  27954. },
  27955. inverse: function() {
  27956. return this.conjugate().normalize()
  27957. },
  27958. conjugate: function() {
  27959. return this._x *= -1,
  27960. this._y *= -1,
  27961. this._z *= -1,
  27962. this
  27963. },
  27964. length: function() {
  27965. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  27966. },
  27967. normalize: function() {
  27968. var e = this.length();
  27969. return 0 === e ? (this._x = 0,
  27970. this._y = 0,
  27971. this._z = 0,
  27972. this._w = 1) : (e = 1 / e,
  27973. this._x = this._x * e,
  27974. this._y = this._y * e,
  27975. this._z = this._z * e,
  27976. this._w = this._w * e),
  27977. this
  27978. },
  27979. setFromAxisAngle: function(e, t) {
  27980. var i = t / 2
  27981. , n = Math.sin(i);
  27982. return this._x = e.x * n,
  27983. this._y = e.y * n,
  27984. this._z = e.z * n,
  27985. this._w = Math.cos(i),
  27986. this
  27987. },
  27988. setFromUnitVectors: function() {
  27989. var e, t, i = 1e-6;
  27990. return function(n, o) {
  27991. return void 0 === e && (e = new r.Vector3),
  27992. t = r.dot(n, o) + 1,
  27993. t < i ? (t = 0,
  27994. Math.abs(n.x) > Math.abs(n.z) ? r.setVector(e, -n.y, n.x, 0) : r.setVector(e, 0, -n.z, n.y)) : r.cross(n, o, e),
  27995. this._x = e.x,
  27996. this._y = e.y,
  27997. this._z = e.z,
  27998. this._w = t,
  27999. this.normalize()
  28000. }
  28001. }(),
  28002. multiply: function(e) {
  28003. return this.multiplyQuaternions(this, e)
  28004. },
  28005. premultiply: function(e) {
  28006. return this.multiplyQuaternions(e, this)
  28007. },
  28008. multiplyQuaternions: function(e, t) {
  28009. var i = e._x
  28010. , n = e._y
  28011. , r = e._z
  28012. , o = e._w
  28013. , a = t._x
  28014. , s = t._y
  28015. , l = t._z
  28016. , c = t._w;
  28017. return this._x = i * c + o * a + n * l - r * s,
  28018. this._y = n * c + o * s + r * a - i * l,
  28019. this._z = r * c + o * l + i * s - n * a,
  28020. this._w = o * c - i * a - n * s - r * l,
  28021. this
  28022. }
  28023. },
  28024. r.convertWorkshopVector = function(e) {
  28025. return new r.Vector3(-e.x,e.y,e.z)
  28026. }
  28027. ,
  28028. r.convertWorkshopQuaternion = function(e) {
  28029. return new r.Quaternion(-e.x,e.y,e.z,-e.w).multiply(new r.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0))
  28030. }
  28031. ;
  28032. r.convertWorkshopOrthoZoom = function(e) {//xzw
  28033. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / n.workshopApsect
  28034. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  28035. }
  28036. ,
  28037. r.convertWorkshopPanoramaQuaternion = function(e) {
  28038. return new r.Quaternion(e.x,-e.y,-e.z,e.w).normalize().multiply((new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), 270 * r.RADIANS_PER_DEGREE))
  28039. }
  28040. ,
  28041. r.normalize = function(e) {
  28042. var t = e.x * e.x + e.y * e.y + e.z * e.z
  28043. , i = Math.sqrt(t);
  28044. e.x /= i,
  28045. e.y /= i,
  28046. e.z /= i
  28047. }
  28048. ,
  28049. r.dot = function(e, t) {
  28050. return e.x * t.x + e.y * t.y + e.z * t.z
  28051. }
  28052. ,
  28053. r.cross = function(e, t, i) {
  28054. var n = e.x
  28055. , r = e.y
  28056. , o = e.z;
  28057. i.x = r * t.z - o * t.y,
  28058. i.y = o * t.x - n * t.z,
  28059. i.z = n * t.y - r * t.x
  28060. }
  28061. ,
  28062. r.setVector = function(e, t, i, n) {
  28063. e.x = t,
  28064. e.y = i,
  28065. e.z = n
  28066. }
  28067. ,
  28068. r.copyVector = function(e, t) {
  28069. t.x = e.x,
  28070. t.y = e.y,
  28071. t.z = e.z
  28072. }
  28073. ,
  28074. r.addVector = function(e, t) {
  28075. e.x += t.x,
  28076. e.y += t.y,
  28077. e.z += t.z
  28078. }
  28079. ,
  28080. r.subVector = function(e, t) {
  28081. e.x -= t.x,
  28082. e.y -= t.y,
  28083. e.z -= t.z
  28084. }
  28085. ,
  28086. r.applyQuaternionToVector = function(e, t) {
  28087. var i = t.x
  28088. , n = t.y
  28089. , r = t.z
  28090. , o = e.x
  28091. , a = e.y
  28092. , s = e.z
  28093. , l = e.w
  28094. , c = l * i + a * r - s * n
  28095. , h = l * n + s * i - o * r
  28096. , u = l * r + o * n - a * i
  28097. , d = -o * i - a * n - s * r;
  28098. t.x = c * l + d * -o + h * -s - u * -a,
  28099. t.y = h * l + d * -a + u * -o - c * -s,
  28100. t.z = u * l + d * -s + c * -a - h * -o
  28101. }
  28102. ,
  28103. r.angleBetweenVectors = function(e, t) {
  28104. return Math.acos(r.dot(e, t))
  28105. }
  28106. ,
  28107. t.exports = r
  28108. }
  28109. , {
  28110. "../constants": 8
  28111. }],
  28112. 177: [function(e, t, i) {
  28113. (function(i) {
  28114. "use strict";
  28115. function n(e) {
  28116. this.cache = null,
  28117. this.expires = 0
  28118. }
  28119. function r() {
  28120. this.baseUrl = null,
  28121. this.cache = null,
  28122. this.expires = 0
  28123. }
  28124. function o() {
  28125. this.baseUrl = null,
  28126. this.expires = 0
  28127. }
  28128. function a(e) {
  28129. this.initialLoadingPromise = null,
  28130. this.endpoint = e + "?type=3",
  28131. this.urlContainer = null,
  28132. this.authorizationHeader = h.getAuthorizationHeader(),
  28133. this.containerClasses = [o, r, n]
  28134. }
  28135. var s = e("./ajax")
  28136. , l = e("./logger")
  28137. , c = e("../constants")
  28138. , h = e("./showcase")
  28139. , u = (e("../ab"),
  28140. new l(i));
  28141. n.prototype = {
  28142. version: 1,
  28143. validate: function(e) {
  28144. return "catalog.json"in e && Object.keys(e).length > 0
  28145. },
  28146. update: function(e) {
  28147. return this.cache = e,
  28148. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  28149. $.when()
  28150. },
  28151. get: function(e) {
  28152. return this.cache[e]
  28153. }
  28154. },
  28155. r.prototype = {
  28156. version: 2,
  28157. validate: function(e) {
  28158. return "catalog.json"in e && "base.url"in e && Object.keys(e).length > 1
  28159. },
  28160. update: function(e) {
  28161. return this.baseUrl = e["base.url"],
  28162. this.cache = e,
  28163. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  28164. $.when()
  28165. },
  28166. get: function(e) {
  28167. var t = this.cache[e];
  28168. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  28169. }
  28170. },
  28171. o.prototype = {
  28172. version: 3,
  28173. validate: function(e) {
  28174. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  28175. },
  28176. update: function(e) {
  28177. return this.baseUrl = e.templates[0],
  28178. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  28179. $.when()
  28180. },
  28181. get: function(e) {
  28182. return this.baseUrl.replace("{{filename}}", e)
  28183. }
  28184. },
  28185. a.prototype = {
  28186. init: function() {
  28187. return this.initialLoadingPromise ? this.initialLoadingPromise : (setInterval(function() {
  28188. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  28189. Date.now() + c.signedUrlRefreshBuffer > e && (u.debug("Refreshing urls..."),
  28190. this.refresh().done(function() {
  28191. u.debug("Refreshed")
  28192. }).fail(function() {
  28193. u.error("Failed url refresh, urls might go stale soon")
  28194. }))
  28195. }
  28196. .bind(this), c.signedUrlCheckInterval),
  28197. this.initialLoadingPromise = this.refresh(),
  28198. this.initialLoadingPromise)
  28199. },
  28200. refresh: function(e) { //已经在someData.js里加载过了 不用再加载file了吧
  28201. e = e || {};
  28202. /*var t = void 0 === e.cache || e.cache;
  28203. return s.get( this.endpoint , { //file
  28204. responseType: "json",
  28205. prefetchFrom: t ? "files" : null,
  28206. cache: t,
  28207. auth: this.authorizationHeader
  28208. }).then(function(e) {
  28209. if (this.urlContainer && this.urlContainer.validate(e))
  28210. return this.urlContainer.update(e);
  28211. for (var i = 0; i < this.containerClasses.length; i++) {
  28212. var n = this.containerClasses[i]
  28213. , r = new n;
  28214. if (r.validate(e))
  28215. return u.info("Using urls version " + r.version),
  28216. this.urlContainer = r,
  28217. this.urlContainer.update(e)
  28218. }
  28219. return t ? this.refresh({
  28220. cache: !1
  28221. }) : $.Deferred().reject("missing-urls")
  28222. }
  28223. .bind(this), function(e) {
  28224. return "loading-failed"
  28225. }) */
  28226. return $.Deferred().resolve();
  28227. },
  28228. get: function(e) {
  28229. //return this.urlContainer.get(e)
  28230. return window.MP_PREFETCHED_MODELDATA.files.templates[0].replace("{{filename}}", e)
  28231. }
  28232. },
  28233. t.exports = a
  28234. }
  28235. ).call(this, "/js/util/ModelUrls.js")
  28236. }
  28237. , {
  28238. "../ab": 3,
  28239. "../constants": 8,
  28240. "./ajax": 181,
  28241. "./logger": 189,
  28242. "./showcase": 193
  28243. }],
  28244. 178: [function(e, t, i) {
  28245. (function(i) {
  28246. "use strict";
  28247. function n() {
  28248. u.call(this),
  28249. this.neighbourMap = {},
  28250. this.map = null
  28251. }
  28252. var r = e("three")
  28253. , o = e("./common")
  28254. , a = e("../settings")
  28255. , s = e("../objects/Panorama")
  28256. , a = e("../settings")
  28257. , l = e("./aStar")
  28258. , c = e("./logger")
  28259. , h = new c(i)
  28260. , u = e("./IndexedCollection")
  28261. , d = e("./transitions");
  28262. o.inherit(n, u),
  28263. n.prototype.getIndex = function(e) {
  28264. return e.id
  28265. }
  28266. ,
  28267. n.prototype.find = function(e, t) {
  28268. var i = o.filterAll(this.list, e);
  28269. return 0 === i.length ? null : (t && t.forEach(function(e) {
  28270. i = o.stableSort(i, e)
  28271. }),
  28272. i[0])
  28273. }
  28274. ,
  28275. n.prototype.sortByScore = function(e, t) {
  28276. var i = o.filterAll(this.list, e);
  28277. return 0 === i.length ? null : i = i.map(function(e) {
  28278. return {
  28279. pano: e,
  28280. score: t.reduce(function(t, i) {
  28281. return t + i(e)
  28282. }, 0)
  28283. }
  28284. }).sort(function(e, t) {
  28285. return t.score - e.score;
  28286. })
  28287. }
  28288. ,
  28289. n.prototype.lowestByScore = function(e, t, i) {
  28290. return this.findRankedByScore(0, e, t, i)
  28291. }
  28292. ,
  28293. n.prototype.findRankedByScore = function(e, t, i, n) {
  28294. n && (n.candidates = null,
  28295. n.pano = null),
  28296. e || (e = 0);
  28297. var r = this.sortByScore(t, i);
  28298. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  28299. n.pano = r[e].pano),
  28300. r[e].pano)
  28301. }
  28302. ,
  28303. n.prototype.showPanoScores = function(e) {
  28304. this.list.forEach(function(e) {
  28305. e.removeTextSprite()
  28306. });
  28307. var t = 6344768;
  28308. e.forEach(function(e) {
  28309. e.pano.addTextSprite(e.score.toFixed(2), t),
  28310. t = 16428055
  28311. })
  28312. }
  28313. ,
  28314. n.prototype.isNeighbour = function(e, t) {
  28315. return this.neighbourMap[e.id][t.id]
  28316. }
  28317. ,
  28318. n.prototype.getNeighbours = function(e) {
  28319. return this.neighbourMap[e.id]
  28320. }
  28321. ,
  28322. n.prototype.setNeighbour = function(e, t, i) {
  28323. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  28324. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  28325. this.neighbourMap[e.id][e.id] = !0,
  28326. this.neighbourMap[t.id][t.id] = !0,
  28327. this.neighbourMap[e.id][t.id] = i,
  28328. this.neighbourMap[t.id][e.id] = i,
  28329. this.neighbourMap[e.id]
  28330. }
  28331. ,
  28332. n.prototype.findClosest = function(e, t) {
  28333. var i = [s.filters.isPanoAligned()];
  28334. return t && i.push(s.filters.inDirection(e, t, .75)),
  28335. this.find(i, [s.sortFunctions.distanceToPoint(e)])
  28336. }
  28337. ,
  28338. n.prototype.dualNeighbors = function(e, t) {
  28339. var i, n = [];
  28340. for (i in this.neighbourMap[e.id])
  28341. this.neighbourMap[t.id][i] && n.push(i);
  28342. return n
  28343. }
  28344. ,
  28345. n.prototype.populate_path_graph = function() {
  28346. var e, t, i, n, o, a, s, l, c = Date.now(), u = {}, d = 0, p = new r.Vector3(0,0,0), f = 0, g = 0;
  28347. for (e = 0; e < this.list.length; e += 1) {
  28348. o = this.list[e],
  28349. s = {},
  28350. l = !1,
  28351. i = o.neighbourPanos || o.findNeighourPanos();
  28352. for (t in i)
  28353. if (i[t]) {
  28354. a = this.index[t],
  28355. p.copy(o.floorPosition),
  28356. p.sub(a.floorPosition);
  28357. var m = Math.sqrt(p.x * p.x + p.z * p.z)
  28358. , v = (Math.abs(p.y) / Math.max(m, .01),
  28359. Math.max(0, Math.abs(p.y) - .2));
  28360. v > 0 ? (f += 1,
  28361. v = Math.pow(4 * v, 2),
  28362. m = Math.pow(m, 2),
  28363. n = Math.sqrt(v * v + m * m)) : (g += 1,
  28364. n = p.length()),
  28365. s[a.id] = n,
  28366. l = !0
  28367. }
  28368. l ? u[o.id] = s : d += 1
  28369. }
  28370. this.map = u,
  28371. h.info("graph ready in " + (Date.now() - c) + "ms, " + d + " had no neighbors")
  28372. }
  28373. ,
  28374. n.prototype.aStarSearch = function(e, t) {
  28375. var i = Date.now()
  28376. , n = new l({
  28377. start: e,
  28378. isEnd: function(e) {
  28379. return e === t
  28380. },
  28381. neighbor: function(e) {
  28382. var t = e.neighbourPanos || e.findNeighourPanos()
  28383. , i = [];
  28384. for (var n in t)
  28385. i.push(this.index[n]);
  28386. return i
  28387. }
  28388. .bind(this),
  28389. distance: function(e, t) {
  28390. var i = this.map[e.id]
  28391. , n = i[t.id];
  28392. return n
  28393. }
  28394. .bind(this),
  28395. heuristic: function(e, t) {
  28396. return 1
  28397. }
  28398. .bind(this),
  28399. hash: function(e) {
  28400. return e.id
  28401. },
  28402. timeout: 5e3
  28403. });
  28404. if (h.debug("A* search in " + (Date.now() - i) + "ms"),
  28405. "success" !== n.status)
  28406. return h.debug("Did not find A* path from " + e + " to " + t),
  28407. null;
  28408. h.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  28409. var r = [];
  28410. return n.path.forEach(function(e) {
  28411. r.push(e.id)
  28412. }),
  28413. r
  28414. }
  28415. ,
  28416. n.prototype.includeNodesNearPath = function() {
  28417. var e = new r.Vector3
  28418. , t = new r.Vector3
  28419. , i = new r.Vector3
  28420. , n = new r.Vector3
  28421. , o = new r.Vector3
  28422. , a = new r.Vector3
  28423. , s = new r.Vector3
  28424. , l = new r.Vector3
  28425. , c = []
  28426. , h = new r.Vector3
  28427. , u = new r.Vector3;
  28428. return function(r, d) {
  28429. if (r)
  28430. for (var p = function(e, t, i) {
  28431. return o.copy(t).sub(e),
  28432. o.dot(i)
  28433. }, f = function(e, t) {
  28434. return p(h, e.position, i) - p(h, t.position, i)
  28435. }, g = 0; g < r.length - 1; ) {
  28436. var m = r[g]
  28437. , v = r[g + 1]
  28438. , A = this.index[m]
  28439. , y = this.index[v];
  28440. h.copy(A.position),
  28441. u.copy(y.position),
  28442. c.length = 0,
  28443. e.copy(u).sub(h),
  28444. i.copy(e).normalize();
  28445. for (var C = 0; C < this.list.length; C++) {
  28446. var I = this.list[C];
  28447. o.copy(I.position).sub(h);
  28448. var E = o.dot(i);
  28449. if (E > 0) {
  28450. s.copy(i),
  28451. s.multiplyScalar(E),
  28452. a.copy(o),
  28453. a.sub(s);
  28454. var b = a.length();
  28455. if (b < d) {
  28456. t.copy(e).negate(),
  28457. n.copy(t).normalize(),
  28458. l.copy(I.position).sub(u);
  28459. var w = l.dot(n);
  28460. w > 0 && c.push(I)
  28461. }
  28462. }
  28463. }
  28464. if (c.length > 0) {
  28465. c.sort(f);
  28466. for (var _ = r.length + c.length - 1; _ >= g + c.length; _--)
  28467. r[_] = r[_ - c.length];
  28468. for (var T = 0; T < c.length; T++)
  28469. r[T + g + 1] = c[T].id
  28470. }
  28471. g += c.length + 1
  28472. }
  28473. }
  28474. }(),
  28475. n.prototype.fadeMarkerOpacity = function(e, t) {
  28476. var i = void 0 === e ? a.panorama.markerOpacity : e
  28477. , n = this.list.findIndex(function(e) {
  28478. return e.marker
  28479. });
  28480. if (!(n < 0)) {
  28481. var r = this.list[n].marker.material.opacity;
  28482. if (r !== e) {
  28483. var o = i - r;
  28484. d.trigger({
  28485. func: function(e, t) {
  28486. var i = r + e * o;
  28487. this.forEach(function(e) {
  28488. e.marker && (e.marker.material.opacity = i)
  28489. })
  28490. }
  28491. .bind(this),
  28492. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  28493. name: "_fpm"
  28494. })
  28495. }
  28496. }
  28497. }
  28498. ,
  28499. t.exports = n
  28500. }
  28501. ).call(this, "/js/util/PanoramaCollection.js")
  28502. }
  28503. , {
  28504. "../objects/Panorama": 148,
  28505. "../settings": 166,
  28506. "./IndexedCollection": 175,
  28507. "./aStar": 180,
  28508. "./common": 185,
  28509. "./logger": 189,
  28510. "./transitions": 195,
  28511. three: 217
  28512. }],
  28513. 179: [function(e, t, i) {
  28514. "use strict";
  28515. function n() {
  28516. this.actionSequence = [],
  28517. this.actionSequenceInProgress = !1
  28518. }
  28519. function r(e, t, i, n) {
  28520. s.trackAlways("zoom_" + e, {
  28521. from: t,
  28522. to: i,
  28523. pano: n
  28524. })
  28525. }
  28526. function o(e, t) {
  28527. r("initial", 1, e, t)
  28528. }
  28529. function a(e, t, i) {
  28530. r("followup", e, t, i)
  28531. }
  28532. var s = e("../analytics");
  28533. n.prototype.reset = function(e) {
  28534. this.actionSequenceInProgress = !1,
  28535. this.actionSequence.length = 0
  28536. }
  28537. ,
  28538. n.prototype.addZoomAction = function() {
  28539. var e = null
  28540. , t = null
  28541. , i = !1
  28542. , n = function() {
  28543. if (e = null,
  28544. this.actionSequence.length > 0) {
  28545. var i = this.actionSequence[0].start
  28546. , n = this.actionSequence[this.actionSequence.length - 1].end;
  28547. 1 === i ? o(n, t) : a(i, n, t)
  28548. }
  28549. this.reset()
  28550. };
  28551. return function(r, o, a) {
  28552. if (r !== o) {
  28553. i || (n = n.bind(this),
  28554. i = !0),
  28555. e && (window.clearTimeout(e),
  28556. e = null),
  28557. a === t && this.actionSequenceInProgress || (this.reset(),
  28558. t = a),
  28559. this.actionSequenceInProgress = !0;
  28560. var s = {
  28561. start: r,
  28562. end: o
  28563. };
  28564. this.actionSequence.push(s),
  28565. e = window.setTimeout(n, 150)
  28566. }
  28567. }
  28568. }(),
  28569. t.exports = n
  28570. }
  28571. , {
  28572. "../analytics": 4
  28573. }],
  28574. 180: [function(e, t, i) {
  28575. "use strict";
  28576. function n(e) {
  28577. void 0 === e.timeout && (e.timeout = 1 / 0);
  28578. var t = e.hash || o
  28579. , i = {
  28580. data: e.start,
  28581. g: 0,
  28582. h: e.heuristic(e.start)
  28583. }
  28584. , n = i;
  28585. i.f = i.h;
  28586. var h = new s
  28587. , u = new l(a)
  28588. , d = c();
  28589. u.push(i),
  28590. d.set(t(i.data), i);
  28591. for (var p = new Date; u.size(); ) {
  28592. if (new Date - p > e.timeout)
  28593. return {
  28594. status: "timeout",
  28595. cost: n.g,
  28596. path: r(n)
  28597. };
  28598. var f = u.pop();
  28599. if (d.delete(t(f.data)),
  28600. e.isEnd(f.data))
  28601. return {
  28602. status: "success",
  28603. cost: f.g,
  28604. path: r(f)
  28605. };
  28606. h.add(t(f.data));
  28607. for (var g = e.neighbor(f.data), m = 0; m < g.length; m++) {
  28608. var v = g[m];
  28609. if (!h.contains(t(v))) {
  28610. var A = f.g + e.distance(f.data, v)
  28611. , y = d.get(t(v))
  28612. , C = !1;
  28613. if (void 0 === y)
  28614. y = {
  28615. data: v
  28616. },
  28617. d.set(t(v), y);
  28618. else {
  28619. if (y.g < A)
  28620. continue;
  28621. C = !0
  28622. }
  28623. y.parent = f,
  28624. y.g = A,
  28625. y.h = e.heuristic(v),
  28626. y.f = A + y.h,
  28627. y.h < n.h && (n = y),
  28628. C ? u.heapify() : u.push(y)
  28629. }
  28630. }
  28631. }
  28632. return {
  28633. status: "noPath",
  28634. cost: n.g,
  28635. path: r(n)
  28636. }
  28637. }
  28638. function r(e) {
  28639. if (void 0 !== e.parent) {
  28640. var t = r(e.parent);
  28641. return t.push(e.data),
  28642. t
  28643. }
  28644. return [e.data]
  28645. }
  28646. function o(e) {
  28647. return e.toString()
  28648. }
  28649. function a(e, t) {
  28650. return e.f - t.f
  28651. }
  28652. var s = e("Set")
  28653. , l = e("heap")
  28654. , c = e("dict");
  28655. t.exports = n
  28656. }
  28657. , {
  28658. Set: 196,
  28659. dict: 210,
  28660. heap: 211
  28661. }],
  28662. 181: [function(e, t, i) {
  28663. (function(i) {
  28664. "use strict";
  28665. function n(e, t, i) {
  28666. var n = new XMLHttpRequest;
  28667. if (i && "withCredentials"in n)
  28668. n.open(e, t, i);
  28669. else if ("undefined" != typeof XDomainRequest)
  28670. n = new XDomainRequest,
  28671. n.open(e, t);
  28672. else {
  28673. if (i)
  28674. throw "Browser does not support CORS!";
  28675. n.open(e, t)
  28676. }
  28677. return n
  28678. }
  28679. function r(e, t, i) {
  28680. function o() {
  28681. u.warn("Retrying ", t),
  28682. r(e, t, i).done(c.resolve.bind(c)).progress(c.notify.bind(c)).fail(c.reject.bind(c))
  28683. }
  28684. function a(e, t) {
  28685. var i = e.response;
  28686. if ("json" === t && "object" != typeof i)
  28687. try {
  28688. i = JSON.parse(e.responseText)
  28689. } catch (e) {
  28690. return void c.reject({
  28691. error: "Failed parsing JSON"
  28692. })
  28693. }
  28694. else if ("image/jpeg" === t) {
  28695. var n = new Uint8Array(e.response)
  28696. , r = new Blob([n],{
  28697. type: "image/jpeg"
  28698. })
  28699. , o = URL.createObjectURL(r);
  28700. i = new Image,
  28701. i.src = o,
  28702. i.crossOrigin = "Anonymous",
  28703. i.onload = function() {
  28704. URL.revokeObjectURL(o)
  28705. }
  28706. }
  28707. return i
  28708. }
  28709. var s = n(e, t, !1);
  28710. if (i = i || {},
  28711. i.retries = void 0 !== i.retries ? i.retries : 0,
  28712. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  28713. i.responseType)
  28714. if (["arraybuffer", "text", "json"].indexOf(i.responseType) > -1)
  28715. s.responseType = i.responseType;
  28716. else {
  28717. if ("image/jpeg" !== i.responseType)
  28718. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  28719. s.responseType = "arraybuffer"
  28720. }
  28721. if ("json" === i.responseType && s.setRequestHeader("Accept", "application/json"),
  28722. i.auth && s.setRequestHeader("Authorization", i.auth),
  28723. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  28724. s.setRequestHeader("Content-Type", "application/json")),
  28725. "object" == typeof i.headers)
  28726. for (var l in i.headers)
  28727. s.setRequestHeader(l, i.headers[l]);
  28728. var c = $.Deferred();
  28729. return s.onreadystatechange = function(e) {
  28730. if (4 === this.readyState)
  28731. if (this.status >= 500 && this.status <= 600 && i.retry && i.retries < 3)
  28732. i.retries++,
  28733. setTimeout(o, 1e3);
  28734. else if (200 === this.status) {
  28735. var t = a(this, i.responseType);
  28736. c.resolve(t)
  28737. } else
  28738. c.reject(this)
  28739. }
  28740. ,
  28741. s.onprogress = function(e) {
  28742. c.notify(e)
  28743. }
  28744. ,
  28745. s.send(i.data),
  28746. c.promise()
  28747. }
  28748. function o(e) {
  28749. return Object.keys(e).sort().map(function(t) {
  28750. return {
  28751. key: t,
  28752. value: e[t]
  28753. }
  28754. })
  28755. }
  28756. function a(e, t) {
  28757. var i = t.responseType || null
  28758. , n = t.auth || null
  28759. , r = t.prefetchFrom || null
  28760. , a = e + "__" + i + "__" + n + "__" + r;
  28761. return t.headers && o(t.headers).forEach(function(e) {
  28762. a += "__" + e.key + ":" + e.value
  28763. }),
  28764. a
  28765. }
  28766. function s(e, t) {
  28767. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[a(e, t)] : null
  28768. }
  28769. function l(e, t, i) {
  28770. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[a(e, t)] = i)
  28771. }
  28772. var c = e("./logger")
  28773. , h = e("../ab")
  28774. , u = new c(i);
  28775. window.URL = window.URL || window.webkitURL,
  28776. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  28777. window.MP_PREFETCHED_MODELDATA = window.MP_PREFETCHED_MODELDATA || {}
  28778. /* setTimeout(function() {//MP-- xzw delete
  28779. window.MP_REQUEST_CACHE = null,
  28780. window.MP_PREFETCHED_MODELDATA = {}
  28781. }, 6e4),
  28782. window.onpageshow = function(e) {
  28783. e.persisted && (window.MP_REQUEST_CACHE = null,
  28784. window.MP_PREFETCHED_MODELDATA = {})
  28785. } */
  28786. ,
  28787. t.exports = {
  28788. get: function(e, t) {
  28789. t = t || {};
  28790. var i = void 0 === t.cache || t.cache;
  28791. if (i) {
  28792. var n = s(e, t);
  28793. if (n)
  28794. return n
  28795. }
  28796. var o;
  28797. return o = t.prefetchFrom && window.MP_PREFETCHED_MODELDATA[t.prefetchFrom] ? $.when(window.MP_PREFETCHED_MODELDATA[t.prefetchFrom]) : r("GET", e, t),
  28798. i && l(e, t, o),
  28799. o
  28800. },
  28801. post: function(e, t) {
  28802. return r("POST", e, t)
  28803. },
  28804. patch: function(e, t) {
  28805. return r("PATCH", e, t)
  28806. },
  28807. getImage: function(e, t) {
  28808. function i() {
  28809. u.warn("Retrying ", e),
  28810. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  28811. }
  28812. var n = $.Deferred()
  28813. , r = new Image
  28814. , o = this;
  28815. return e = h.changeIfImageOptimzing(e),
  28816. null !== t && void 0 !== t || (t = 3),
  28817. r.onerror = function() {
  28818. t > 0 ? setTimeout(i, 1e3) : n.reject()
  28819. }
  28820. ,
  28821. r.onload = function() {
  28822. n.resolve(r)
  28823. }
  28824. ,
  28825. r.crossOrigin = "anonymous",
  28826. r.src = e,
  28827. n
  28828. }
  28829. }
  28830. }
  28831. ).call(this, "/js/util/ajax.js")
  28832. }
  28833. , {
  28834. "../ab": 3,
  28835. "./logger": 189
  28836. }],
  28837. 182: [function(e, t, i) {
  28838. "use strict";
  28839. function n(e, t) {
  28840. var i = window.navigator.userAgent
  28841. , n = i.match(e);
  28842. return n = n ? n[1].split(t) : [],
  28843. {
  28844. major: parseInt(n[0]) || 0,
  28845. minor: parseInt(n[1]) || 0,
  28846. patch: parseInt(n[2]) || 0
  28847. }
  28848. }
  28849. var r = e("../exception/DeviceMismatchException");
  28850. t.exports = {
  28851. isFullscreen: function() {
  28852. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  28853. },
  28854. supportsFullscreen: function() {
  28855. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  28856. },
  28857. isPointerLocked: function() {
  28858. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  28859. },
  28860. requestFullscreen: function(e, t) {
  28861. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  28862. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  28863. },
  28864. requestPointerLock: function() {
  28865. var e;
  28866. if (document.fullscreenElement)
  28867. e = document.fullscreenElement();
  28868. else if (document.mozFullscreenElement)
  28869. e = document.mozFullscreenElement();
  28870. else if (document.mozFullScreenElement)
  28871. e = document.mozFullScreenElement();
  28872. else {
  28873. if (!document.webkitFullscreenElement)
  28874. return;
  28875. e = document.webkitFullscreenElement()
  28876. }
  28877. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  28878. e.requestPointerLock(),
  28879. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  28880. },
  28881. exitPointerLock: function() {
  28882. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  28883. document.exitPointerLock()
  28884. },
  28885. exitFullscreen: function() {
  28886. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  28887. },
  28888. details: function() {
  28889. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  28890. return e ? {
  28891. name: e[1],
  28892. version: parseInt(e[2]),
  28893. platform: navigator.platform
  28894. } : {}
  28895. },
  28896. is: function(e) {
  28897. return this.details() && this.details().name === e
  28898. },
  28899. inIframe: function() {
  28900. return window.parent !== window
  28901. },
  28902. aspectRatio: function() {
  28903. var e = $("#player").width() / $("#player").height();
  28904. return isFinite(e) ? e : 0
  28905. },
  28906. userAgent: function() {
  28907. return window.navigator.userAgent
  28908. },
  28909. isMobile: function() {
  28910. var e = navigator.userAgent || navigator.vendor || window.opera;
  28911. return /(android|bb\d+|meego).+mobile|android|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0, 4))
  28912. },
  28913. isLandscape: function() {
  28914. return this.isMobile && this.aspectRatio() > 1
  28915. },
  28916. isSmallScreen: function() {
  28917. var e = screen.width / window.devicePixelRatio;
  28918. return e < 240
  28919. },
  28920. detectIE: function() {
  28921. var e = window.navigator.userAgent
  28922. , t = e.indexOf("MSIE ");
  28923. return t !== -1 || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  28924. },
  28925. detectSafari: function() {
  28926. var e = window.navigator.userAgent
  28927. , t = e.indexOf("Safari");
  28928. return t !== -1 && !this.detectChrome()
  28929. },
  28930. detectFirefox: function() {
  28931. var e = window.navigator.userAgent;
  28932. return e.indexOf("Firefox") !== -1
  28933. },
  28934. detectChrome: function() {
  28935. var e = window.navigator.userAgent;
  28936. return e.indexOf("Chrome") !== -1 && !this.detectOpera()
  28937. },
  28938. detectOpera: function() {
  28939. var e = window.navigator.userAgent;
  28940. return e.indexOf("OPR") !== -1
  28941. },
  28942. detectIOS: function() {
  28943. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  28944. },
  28945. detectIPad: function() {
  28946. var e = window.navigator.userAgent
  28947. , t = /iPad/;
  28948. return t.test(e)
  28949. },
  28950. detectIPod: function() {
  28951. var e = window.navigator.userAgent
  28952. , t = /iPod/;
  28953. return t.test(e)
  28954. },
  28955. detectIPhone: function() {
  28956. var e = window.navigator.userAgent
  28957. , t = /iPhone/;
  28958. return t.test(e)
  28959. },
  28960. detectAndroid: function() {
  28961. var e = window.navigator.userAgent;
  28962. return e.indexOf("Android") !== -1
  28963. },
  28964. detectAndroidMobile: function() {
  28965. var e = window.navigator.userAgent;
  28966. return this.detectAndroid() && e.indexOf("Mobile") !== -1
  28967. },
  28968. detectSamsungNative: function() {
  28969. var e = window.navigator.userAgent;
  28970. return e.indexOf("SM-G900H") !== -1 || e.indexOf("GT-I9500") !== -1 || e.indexOf("SM-N900") !== -1
  28971. },
  28972. detectSamsungS6: function() {
  28973. var e = window.navigator.userAgent;
  28974. return e.indexOf("SM-G92") !== -1
  28975. },
  28976. /************************************************************fyz改from徐世廷*************************************************************/
  28977. detectHUAWEI5X: function() {
  28978. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  28979. },
  28980. /*******************************************************************************************************************************/
  28981. detectWebVR: function() {
  28982. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  28983. },
  28984. getVRDisplay: function() {
  28985. var e = $.Deferred();
  28986. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(t) {
  28987. t.length >= 1 && e.resolve(t[0]),
  28988. e.reject(null)
  28989. }),
  28990. e) : e.reject(null)
  28991. },
  28992. iosVersion: function() {
  28993. if (!this.detectIOS())
  28994. throw new r("Did not detect an iDevice");
  28995. var e = /((?:\d+\_?){1,3}) like Mac OS/
  28996. , t = "_";
  28997. return n(e, t)
  28998. },
  28999. androidVersion: function() {
  29000. if (!this.detectAndroid())
  29001. throw new r("Did not detect an Android based device");
  29002. var e = /Android ((?:\d+\.?){1,3})/
  29003. , t = ".";
  29004. return n(e, t)
  29005. },
  29006. valueFromCookie: function(e, t) {
  29007. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  29008. if (!i)
  29009. return t;
  29010. var n = i[1];
  29011. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  29012. },
  29013. valueFromHash: function(e, t) {
  29014. var i = new RegExp("[#&?]" + e + "=([^#&?]*)")
  29015. , n = i.exec(window.location.href);
  29016. if (!n)
  29017. return t;
  29018. var r = n[1];
  29019. return "boolean" == typeof t ? "true" === r || "1" === r : "number" == typeof t ? parseFloat(r) : window.decodeURIComponent(r)
  29020. }
  29021. }
  29022. }
  29023. , {
  29024. "../exception/DeviceMismatchException": 56
  29025. }],
  29026. 183: [function(e, t, i) {
  29027. (function(i) {
  29028. "use strict";
  29029. function n(e, t) {
  29030. var i = r(t);
  29031. if (Object.keys(i).length > 0)
  29032. return i;
  29033. if (e.heroImage)
  29034. i = o(e, t);
  29035. else if (e.data.camera_start) {
  29036. var n = e.data.camera_start;
  29037. try {
  29038. Object.keys(n).length > 0 && !l.isEmptyQuaternion(n.camera.quaternion) && (i.mode = h.convertWorkshopModeInt(n.mode),
  29039. i.position = n.camera.position,
  29040. //i.quaternion = n.camera.quaternion,
  29041. i.quaternion = new th.Quaternion().fromArray(n.camera.quaternion),//xzw
  29042. i.zoom = l.convertWorkshopOrthoZoom(n.camera.zoom),
  29043. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  29044. d.debug("Using camera_start"),
  29045. d.debug("Modeldata pano: ", i.pano.quaternion),
  29046. d.debug("Camera start pano: ", n.pano.quaternion)),
  29047. i.mode !== h.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility))
  29048. } catch (e) {
  29049. d.warn(e.message)
  29050. }
  29051. }
  29052. if (e.outsideAllowed() || i.mode === h.PANORAMA || (i = {}),
  29053. i.mode === h.MESH && i.position && (i.mode = h.PANORAMA,
  29054. i.pano = t.findClosest(i.position),
  29055. i.quaternion = i.pano.quaternion),
  29056. 0 === Object.keys(i).length) {
  29057. var a = t.list[0];
  29058. a && (i.mode = h.PANORAMA,
  29059. i.pano = a,
  29060. i.position = a.position,
  29061. i.quaternion = a.quaternion,
  29062. d.info("Starting at 1st pano " + a.id))
  29063. }
  29064. return i.mode = i.mode || h.DOLLHOUSE,
  29065. i
  29066. }
  29067. function r(e) {
  29068. var t = c.valueFromHash("start", "")
  29069. , i = {};
  29070. if ("" !== t) {
  29071. d.debug("Start override found in parameters, trying to parse..."),
  29072. i = a(t) || {};
  29073. var n = c.valueFromHash("tag", null);
  29074. n && (i.tag = n),
  29075. i.panoId && (i.pano = e.get(i.panoId))
  29076. }
  29077. return i
  29078. }
  29079. function o(e, t) {
  29080. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  29081. return {};
  29082. var i = {}
  29083. , n = e.heroImage.metadata;
  29084. d.debug("Using start position from thumbnail image"),
  29085. i.position = n.camera_position,
  29086. i.quaternion = n.camera_quaternion;
  29087. try {
  29088. i.mode = h.convertWorkshopModeInt(n.camera_mode),
  29089. i.mode === h.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  29090. } catch (e) {
  29091. d.debug(e.message)
  29092. }
  29093. return i
  29094. }
  29095. function a(e) {
  29096. return s.deserialize(e)
  29097. }
  29098. var s = e("../controls/serializer")
  29099. , l = e("../util/math")
  29100. , c = e("./browser")
  29101. , h = e("../enum/Viewmode")
  29102. , u = e("../util/logger")
  29103. , th = e("three")//xzw
  29104. , d = new u(i);
  29105. t.exports = {
  29106. getStartCameraOptions: n
  29107. }
  29108. }
  29109. ).call(this, "/js/util/camera.js")
  29110. }
  29111. , {
  29112. "../controls/serializer": 14,
  29113. "../enum/Viewmode": 51,
  29114. "../util/logger": 189,
  29115. "../util/math": 190,
  29116. "./browser": 182,
  29117. "three": 217
  29118. }],
  29119. 184: [function(e, t, i) {
  29120. "use strict";
  29121. function n(e, t, i) {
  29122. return o(e.fov, t, i)
  29123. }
  29124. var r = e("./MathLight")
  29125. , o = function(e, t, i) {
  29126. var n = t
  29127. , o = i
  29128. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (n / o)) * r.DEGREES_PER_RADIAN;
  29129. return a
  29130. }
  29131. , a = function(e, t, i) {
  29132. var n = t
  29133. , o = i
  29134. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (o / n)) * r.DEGREES_PER_RADIAN;
  29135. return a
  29136. }
  29137. , s = function(e, t, i, n) {
  29138. var r = o(e, i, n);
  29139. return r > t ? a(t, i, n) : e
  29140. };
  29141. t.exports = {
  29142. clampVFOV: s,
  29143. getHFOVForCamera: n,
  29144. getHFOVFromVFOV: o,
  29145. getVFOVFromHFOV: a
  29146. }
  29147. }
  29148. , {
  29149. "./MathLight": 176
  29150. }],
  29151. 185: [function(e, t, i) {
  29152. "use strict";
  29153. var n = e("three");
  29154. t.exports = {
  29155. delayOneFrame: function(e) {
  29156. window.setTimeout(e, 1)
  29157. },
  29158. normalizeUrl: function(e) {
  29159. return e.replace("https://", "http://")
  29160. },
  29161. domainFromUrl: function(e) {
  29162. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  29163. return t ? t[3] : e
  29164. },
  29165. average: function(e, t) {
  29166. if (0 === e.length)
  29167. return null;
  29168. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  29169. var o = t ? e[r][t] : e[r];
  29170. i += o,
  29171. n++
  29172. }
  29173. return i / n
  29174. },
  29175. countUnique: function(e) {
  29176. for (var t = {}, i = 0; i < e.length; i++)
  29177. t[e[i]] = 1 + (t[e[i]] || 0);
  29178. return Object.keys(t).length
  29179. },
  29180. averageVectors: function(e, t) {
  29181. var i = new n.Vector3;
  29182. if (0 === e.length)
  29183. return i;
  29184. for (var r = 0, o = 0; o < e.length; o++) {
  29185. var a = t ? e[o][t] : e[o];
  29186. i.add(a),
  29187. r++
  29188. }
  29189. return i.divideScalar(r)
  29190. },
  29191. equalLists: function(e, t) {
  29192. if (e.length !== t.length)
  29193. return !1;
  29194. for (var i = 0; i < e.length; i++)
  29195. if (e[i] !== t[i])
  29196. return !1;
  29197. return !0
  29198. },
  29199. lowerMedian: function(e, t) {
  29200. if (0 === e.length)
  29201. return null;
  29202. t = t || 2,
  29203. e.sort(function(e, t) {
  29204. return e - t
  29205. });
  29206. var i = Math.floor(e.length / t);
  29207. return e[i]
  29208. },
  29209. stableSort: function(e, t) {
  29210. return e.map(function(e, t) {
  29211. return {
  29212. value: e,
  29213. index: t
  29214. }
  29215. }).sort(function(e, i) {
  29216. var n = t(e.value, i.value);
  29217. return 0 !== n ? n : e.index - i.index
  29218. }).map(function(e) {
  29219. return e.value
  29220. })
  29221. },
  29222. filterAll: function(e, t) {
  29223. return e.filter(function(e) {
  29224. return t.every(function(t) {
  29225. return t(e)
  29226. })
  29227. })
  29228. },
  29229. formatDate: function(e) {
  29230. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  29231. },
  29232. formatDatetime: function(e) {
  29233. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  29234. },
  29235. randomString: function(e) {
  29236. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  29237. t += i.charAt(Math.floor(Math.random() * i.length));
  29238. return t
  29239. },
  29240. uint8ToBase64: function(e, t) {
  29241. t && "number" == typeof t || (t = 8192);
  29242. for (var i = [], n = 0; n < e.length; n += t)
  29243. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  29244. return btoa(i.join(""))
  29245. },
  29246. uuid4: function e(t) {
  29247. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  29248. },
  29249. nth: function(e) {
  29250. return e %= 10,
  29251. 1 === e ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  29252. },
  29253. extendObject: function(e, t) {
  29254. return Object.keys(t).forEach(function(i) {
  29255. e[i] = t[i]
  29256. }),
  29257. e
  29258. },
  29259. deepExtend: function e(t) {
  29260. t = t || {};
  29261. for (var i = 1; i < arguments.length; i++) {
  29262. var n = arguments[i];
  29263. if (n)
  29264. for (var r in n)
  29265. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  29266. }
  29267. return t
  29268. },
  29269. inherit: function(e, t) {
  29270. e.prototype = Object.create(t.prototype),
  29271. e.prototype.constructor = e
  29272. },
  29273. extend: function(e, t) {
  29274. for (var i in t.prototype)
  29275. e.prototype[i] = t.prototype[i]
  29276. }
  29277. },
  29278. Math.sign = function(e) {
  29279. return e < 0 ? -1 : 1
  29280. }
  29281. }
  29282. , {
  29283. three: 217
  29284. }],
  29285. 186: [function(e, t, i) {
  29286. "use strict";
  29287. var n = {};
  29288. n.linearTween = function(e, t, i, n) {
  29289. return i * e / n + t
  29290. }
  29291. ,
  29292. n.easeInQuad = function(e, t, i, n) {
  29293. return e /= n,
  29294. i * e * e + t
  29295. }
  29296. ,
  29297. n.easeOutQuad = function(e, t, i, n) {
  29298. return e /= n,
  29299. -i * e * (e - 2) + t
  29300. }
  29301. ,
  29302. n.easeInOutQuad = function(e, t, i, n) {
  29303. return e /= n / 2,
  29304. e < 1 ? i / 2 * e * e + t : (e--,
  29305. -i / 2 * (e * (e - 2) - 1) + t)
  29306. }
  29307. ,
  29308. n.easeInCubic = function(e, t, i, n) {
  29309. return e /= n,
  29310. i * e * e * e + t
  29311. }
  29312. ,
  29313. n.easeOutCubic = function(e, t, i, n) {
  29314. return e /= n,
  29315. e--,
  29316. i * (e * e * e + 1) + t
  29317. }
  29318. ,
  29319. n.easeInOutCubic = function(e, t, i, n) {
  29320. return e /= n / 2,
  29321. e < 1 ? i / 2 * e * e * e + t : (e -= 2,
  29322. i / 2 * (e * e * e + 2) + t)
  29323. }
  29324. ,
  29325. n.easeInQuart = function(e, t, i, n) {
  29326. return e /= n,
  29327. i * e * e * e * e + t
  29328. }
  29329. ,
  29330. n.easeOutQuart = function(e, t, i, n) {
  29331. return e /= n,
  29332. e--,
  29333. -i * (e * e * e * e - 1) + t
  29334. }
  29335. ,
  29336. n.easeInOutQuart = function(e, t, i, n) {
  29337. return e /= n / 2,
  29338. e < 1 ? i / 2 * e * e * e * e + t : (e -= 2,
  29339. -i / 2 * (e * e * e * e - 2) + t)
  29340. }
  29341. ,
  29342. n.easeInQuint = function(e, t, i, n) {
  29343. return e /= n,
  29344. i * e * e * e * e * e + t
  29345. }
  29346. ,
  29347. n.easeOutQuint = function(e, t, i, n) {
  29348. return e /= n,
  29349. e--,
  29350. i * (e * e * e * e * e + 1) + t
  29351. }
  29352. ,
  29353. n.easeInOutQuint = function(e, t, i, n) {
  29354. return e /= n / 2,
  29355. e < 1 ? i / 2 * e * e * e * e * e + t : (e -= 2,
  29356. i / 2 * (e * e * e * e * e + 2) + t)
  29357. }
  29358. ,
  29359. n.easeInSine = function(e, t, i, n) {
  29360. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  29361. }
  29362. ,
  29363. n.easeOutSine = function(e, t, i, n) {
  29364. return i * Math.sin(e / n * (Math.PI / 2)) + t
  29365. }
  29366. ,
  29367. n.easeInOutSine = function(e, t, i, n) {
  29368. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  29369. }
  29370. ,
  29371. n.easeInExpo = function(e, t, i, n) {
  29372. return i * Math.pow(2, 10 * (e / n - 1)) + t
  29373. }
  29374. ,
  29375. n.easeOutExpo = function(e, t, i, n) {
  29376. return i * (-Math.pow(2, -10 * e / n) + 1) + t
  29377. }
  29378. ,
  29379. n.easeInOutExpo = function(e, t, i, n) {
  29380. return e /= n / 2,
  29381. e < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  29382. i / 2 * (-Math.pow(2, -10 * e) + 2) + t)
  29383. }
  29384. ,
  29385. n.easeInCirc = function(e, t, i, n) {
  29386. return e /= n,
  29387. -i * (Math.sqrt(1 - e * e) - 1) + t
  29388. }
  29389. ,
  29390. n.easeOutCirc = function(e, t, i, n) {
  29391. return e /= n,
  29392. e--,
  29393. i * Math.sqrt(1 - e * e) + t
  29394. }
  29395. ,
  29396. n.easeInOutCirc = function(e, t, i, n) {
  29397. return e /= n / 2,
  29398. e < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  29399. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  29400. }
  29401. ,
  29402. n.easeInElastic = function(e, t, i, n) {
  29403. var r = 1.70158
  29404. , o = 0
  29405. , a = i;
  29406. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  29407. a < Math.abs(i) ? (a = i,
  29408. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  29409. -(a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t)
  29410. }
  29411. ,
  29412. n.easeOutElastic = function(e, t, i, n) {
  29413. var r = 1.70158
  29414. , o = 0
  29415. , a = i;
  29416. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  29417. a < Math.abs(i) ? (a = i,
  29418. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  29419. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  29420. }
  29421. ,
  29422. n.easeInOutElastic = function(e, t, i, n) {
  29423. var r = 1.70158
  29424. , o = 0
  29425. , a = i;
  29426. return 0 === e ? t : 2 === (e /= n / 2) ? t + i : (o || (o = n * (.3 * 1.5)),
  29427. a < Math.abs(i) ? (a = i,
  29428. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  29429. e < 1 ? -.5 * (a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t : a * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) * .5 + i + t)
  29430. }
  29431. ,
  29432. n.easeInBack = function(e, t, i, n, r) {
  29433. return void 0 === r && (r = 1.70158),
  29434. i * (e /= n) * e * ((r + 1) * e - r) + t
  29435. }
  29436. ,
  29437. n.easeOutBack = function(e, t, i, n, r) {
  29438. return void 0 === r && (r = 1.70158),
  29439. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  29440. }
  29441. ,
  29442. n.easeInOutBack = function(e, t, i, n, r) {
  29443. return void 0 === r && (r = 1.70158),
  29444. (e /= n / 2) < 1 ? i / 2 * (e * e * (((r *= 1.525) + 1) * e - r)) + t : i / 2 * ((e -= 2) * e * (((r *= 1.525) + 1) * e + r) + 2) + t
  29445. }
  29446. ,
  29447. n.easeOutBounce = function(e, t, i, n) {
  29448. return (e /= n) < 1 / 2.75 ? i * (7.5625 * e * e) + t : e < 2 / 2.75 ? i * (7.5625 * (e -= 1.5 / 2.75) * e + .75) + t : e < 2.5 / 2.75 ? i * (7.5625 * (e -= 2.25 / 2.75) * e + .9375) + t : i * (7.5625 * (e -= 2.625 / 2.75) * e + .984375) + t
  29449. }
  29450. ,
  29451. n.easeInBounce = function(e, t, i, r) {
  29452. return i - n.easeOutBounce(r - e, 0, i, r) + t
  29453. }
  29454. ,
  29455. n.easeInOutBounce = function(e, t, i, r) {
  29456. return e < r / 2 ? .5 * n.easeInBounce(2 * e, 0, i, r) + t : .5 * n.easeOutBounce(x, 2 * e - r, 0, i, r) + .5 * i + t
  29457. }
  29458. ,
  29459. t.exports = n
  29460. }
  29461. , {}],
  29462. 187: [function(e, t, i) {
  29463. "use strict";
  29464. function n() {
  29465. this.events = [],
  29466. this.valid = !1
  29467. }
  29468. var r = e("../enum/Joystick");
  29469. n.prototype.push = function(e, t) {
  29470. this.events.push({
  29471. direction: e,
  29472. pano: t
  29473. }),
  29474. this.valid = !0
  29475. }
  29476. ,
  29477. n.prototype.pop = function(e) {
  29478. var t = this.events.pop();
  29479. return this.events.length < 1 && (this.valid = !1),
  29480. t
  29481. }
  29482. ,
  29483. n.prototype.peek = function() {
  29484. return this.events.length ? this.events[this.events.length - 1] : {
  29485. direction: null,
  29486. pano: null
  29487. }
  29488. }
  29489. ,
  29490. n.prototype.invalidate = function() {
  29491. this.events = [],
  29492. this.valid = !1
  29493. }
  29494. ,
  29495. n.prototype.reversePano = function(e) {
  29496. if (!this.valid)
  29497. return null;
  29498. var t = this.peek();
  29499. return r.opposite(e) === t.direction ? (this.pop(),
  29500. t.pano) : null
  29501. }
  29502. ,
  29503. t.exports = n
  29504. }
  29505. , {
  29506. "../enum/Joystick": 29
  29507. }],
  29508. 188: [function(e, t, i) {
  29509. "use strict";
  29510. t.exports = {
  29511. vector: function(e, t) {
  29512. var i = e.clone();
  29513. return t = t.clone(),
  29514. function(n) {
  29515. e.set(i.x * (1 - n) + t.x * n, i.y * (1 - n) + t.y * n, i.z * (1 - n) + t.z * n)
  29516. }
  29517. },
  29518. quaternion: function(e, t) {
  29519. var i = e.clone();
  29520. return function(n) {
  29521. e.copy(i).slerp(t, n)
  29522. }
  29523. },
  29524. property: function(e, t, i, n) {
  29525. var r = e[t];
  29526. return function(o) {
  29527. e[t] = r * (1 - o) + i * o,
  29528. n && n(e[t])
  29529. }
  29530. },
  29531. uniform: function(e, t, i) {
  29532. var n = e.material.uniforms[t].value;
  29533. return function(r) {
  29534. e.material.uniforms[t] && (e.material.uniforms[t].value = n * (1 - r) + i * r)
  29535. }
  29536. },
  29537. matrix4: function(e, t) {
  29538. var i = e.clone();
  29539. return function(n) {
  29540. for (var r = e.elements, o = i.elements, a = t.elements, s = 0; s < 16; s++)
  29541. r[s] = o[s] * (1 - n) + a[s] * n
  29542. }
  29543. },
  29544. allUniforms: function(e, t, i) {
  29545. var n = e.map(function(e) {
  29546. return this.uniform(e, t, i)
  29547. }
  29548. .bind(this));
  29549. return function(e) {
  29550. n.forEach(function(t) {
  29551. t(e)
  29552. })
  29553. }
  29554. }
  29555. }
  29556. }
  29557. , {}],
  29558. 189: [function(e, t, i) {
  29559. "use strict";
  29560. function n(e) {
  29561. var t, i, o, a, s = e.split("/"), l = "[" + s[s.length - 1].replace(".js", "") + "]", c = {};
  29562. if (n.consoleEnabled) {
  29563. var h = function(e) {
  29564. $("#debug-console").append("<p>" + e + "</p>"),
  29565. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  29566. };
  29567. t = function(e) {
  29568. h(Array.prototype.slice.call(arguments).join(" "))
  29569. }
  29570. ,
  29571. i = function(e) {
  29572. h(Array.prototype.slice.call(arguments).join(" "))
  29573. }
  29574. ,
  29575. o = function(e) {
  29576. h("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  29577. }
  29578. ,
  29579. a = function(e) {
  29580. h("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  29581. }
  29582. } else
  29583. console.log ? (t = console.log,
  29584. i = console.info ? console.info : console.log,
  29585. o = console.warn ? console.warn : console.log,
  29586. a = console.error ? console.error : console.log) : t = i = o = a = function() {}
  29587. ;
  29588. var u = function(e) {
  29589. return [l, n.timestamp()].concat(Array.prototype.slice.call(e))
  29590. }
  29591. , d = function(t, i) {
  29592. if (r) {
  29593. var o = Array.prototype.slice.call(t).join(" ");
  29594. r.captureMessage(o, {
  29595. level: i,
  29596. path: e,
  29597. timestamp: n.timestamp()
  29598. })
  29599. }
  29600. }
  29601. , p = function(t, i) {
  29602. if (r) {
  29603. var o = Array.prototype.slice.call(t).join(" ");
  29604. r.captureException(new Error(o), {
  29605. level: i,
  29606. path: e,
  29607. timestamp: n.timestamp()
  29608. })
  29609. }
  29610. };
  29611. return {
  29612. debug: function() {
  29613. n.level >= n.levels.debug && t.apply(console, u(arguments))
  29614. },
  29615. info: function() {
  29616. n.level >= n.levels.info && i.apply(console, u(arguments))
  29617. },
  29618. warn: function() {
  29619. d(arguments, "warn"),
  29620. n.level >= n.levels.warn && o.apply(console, u(arguments))
  29621. },
  29622. error: function() {
  29623. p(arguments, "error"),
  29624. n.level >= n.levels.error && a.apply(console, u(arguments))
  29625. },
  29626. v3str: function(e, t) {
  29627. var i = void 0 === t ? 2 : t;
  29628. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  29629. },
  29630. eulstr: function(e, t) {
  29631. var i = void 0 === t ? 2 : t;
  29632. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  29633. },
  29634. time: function(e) {
  29635. n.level >= n.levels.debug && (c[e] = Date.now())
  29636. },
  29637. timeEnd: function(e) {
  29638. if (n.level >= n.levels.debug) {
  29639. var t = c[e];
  29640. if (!t)
  29641. return;
  29642. var i = (Date.now() - t) / 1e3;
  29643. this.debug(e, i + "s")
  29644. }
  29645. }
  29646. }
  29647. }
  29648. var r = window.Raven;
  29649. n.timestamp = function() {
  29650. return (Date.now() - window.navigationStart) / 1e3 + "s"
  29651. }
  29652. ,
  29653. n.levels = {
  29654. debug: 3,
  29655. info: 2,
  29656. warn: 1,
  29657. error: 0
  29658. },
  29659. n.level = n.levels.info,
  29660. t.exports = n
  29661. }
  29662. , {}],
  29663. 190: [function(e, t, i) {
  29664. "use strict";
  29665. var n = e("three")
  29666. , r = e("../enum/GLCubeFaces")
  29667. , o = e("../constants");
  29668. t.exports = {
  29669. convertVisionVector: function(e) {
  29670. return new n.Vector3(e.x,e.z,-e.y)
  29671. },
  29672. convertVisionQuaternion: function(e) {
  29673. return new n.Quaternion(e.x,e.z,-e.y,e.w).multiply((new n.Quaternion).setFromAxisAngle(new n.Vector3(0,1,0), n.Math.degToRad(90)))
  29674. },
  29675. convertWorkshopVector: function(e) {
  29676. return new n.Vector3(-e.x,e.y,e.z)
  29677. },
  29678. convertWorkshopQuaternion: function(e) {
  29679. return new n.Quaternion(-e.x,e.y,e.z,-e.w).multiply(new n.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0))
  29680. },
  29681. convertWorkshopPanoramaQuaternion: function(e) {
  29682. return new n.Quaternion(e.x,-e.y,-e.z,e.w).normalize().multiply((new n.Quaternion).setFromAxisAngle(new n.Vector3(0,1,0), n.Math.degToRad(270)))
  29683. },
  29684. convertWorkshopOrthoZoom: function(e) {// xzw
  29685. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / o.workshopApsect
  29686. //return e;
  29687. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  29688. },
  29689. toPrecision: function(e, t) {//xzw change
  29690. var f = function(e, t){
  29691. var i = Math.pow(10, t);
  29692. return Math.round(e * i) / i
  29693. }
  29694. if(e instanceof Array){
  29695. for(var s=0; s<e.length; s++){
  29696. e[s] = f(e[s],t);
  29697. }
  29698. return e;
  29699. }
  29700. else return f(e,t)
  29701. },
  29702. isEmptyQuaternion: function(e) {
  29703. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  29704. },
  29705. projectPositionToCanvas: function(e, t, i) {
  29706. i = i || new n.Vector3,
  29707. i.copy(e);
  29708. var r = .5 * $("#player").width()
  29709. , o = .5 * $("#player").height();
  29710. return i.project(t),
  29711. i.x = i.x * r + r,
  29712. i.y = -(i.y * o) + o,
  29713. i
  29714. },
  29715. convertScreenPositionToNDC: function(e, t, i) {
  29716. return i = i || new n.Vector2,
  29717. i.x = e / $("#player").width() * 2 - 1,
  29718. i.y = 2 * -(t / $("#player").height()) + 1,
  29719. i
  29720. },
  29721. constrainedTurn: function(e) {
  29722. var t = e % (2 * Math.PI);
  29723. return t = t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  29724. },
  29725. getFOVDotThreshold: function(e) {
  29726. return Math.cos(n.Math.degToRad(e / 2))
  29727. },
  29728. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  29729. switch (e) {
  29730. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  29731. i.set(1, t.y, t.x);
  29732. break;
  29733. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  29734. i.set(-1, t.y, -t.x);
  29735. break;
  29736. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  29737. i.set(-t.x, 1, -t.y);
  29738. break;
  29739. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  29740. i.set(-t.x, -1, t.y);
  29741. break;
  29742. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  29743. i.set(-t.x, t.y, 1);
  29744. break;
  29745. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  29746. i.set(t.x, t.y, -1)
  29747. }
  29748. n && i.normalize()
  29749. }
  29750. }
  29751. }
  29752. , {
  29753. "../constants": 8,
  29754. "../enum/GLCubeFaces": 25,
  29755. three: 217
  29756. }],
  29757. 191: [function(e, t, i) {
  29758. "use strict";
  29759. function n(e, t, i) {
  29760. return a.map(function(n, o) {
  29761. return e.get("pan/" + i + "/" + t + "_skybox" + r(n) + ".jpg")
  29762. }
  29763. .bind(this))
  29764. }
  29765. function r(e) {
  29766. return s[e]
  29767. }
  29768. var o = e("../enum/GLCubeFaces")
  29769. , a = [0, 1, 2, 3, 4, 5]
  29770. , s = {
  29771. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  29772. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  29773. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  29774. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  29775. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  29776. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  29777. };
  29778. t.exports = {
  29779. mapFaceToCubemapFace: r,
  29780. getCubemapUrls: n
  29781. }
  29782. }
  29783. , {
  29784. "../enum/GLCubeFaces": 25
  29785. }],
  29786. 192: [function(e, t, i) {
  29787. "use strict";
  29788. t.exports = {
  29789. captureErrors: function(e, t, i) {
  29790. if ("Raven"in window) {
  29791. Raven.config(e, t).install(),
  29792. i && Raven.setTagsContext(i);
  29793. var n = console.warn
  29794. , r = console.error;
  29795. console.warn = function() {
  29796. var e = Array.prototype.slice.call(arguments);
  29797. Raven.captureMessage(e.join(" "), {
  29798. level: "warning"
  29799. }),
  29800. n.apply(console, e)
  29801. }
  29802. ,
  29803. console.error = function() {
  29804. var e = Array.prototype.slice.call(arguments);
  29805. Raven.captureException(new Error(e.join(" ")), {
  29806. level: "error"
  29807. }),
  29808. r.apply(console, e)
  29809. }
  29810. } else
  29811. console.error("Raven not found, not capturing errors.")
  29812. }
  29813. }
  29814. }
  29815. , {}],
  29816. 193: [function(e, t, i) {
  29817. (function(i) {
  29818. "use strict";
  29819. var n = e("./browser")
  29820. , r = e("../constants")
  29821. , o = e("url")
  29822. , a = e("./logger")
  29823. , ss = e('three')
  29824. , s = new a(i)
  29825. , l = {
  29826. getAuthorizationHeader: function() {
  29827. var e = n.valueFromHash("auth");
  29828. if (e)
  29829. return e.replace(",", " ");
  29830. var t = n.valueFromCookie("token");
  29831. return t ? "Token " + t : null
  29832. },
  29833. parseSidUrl: function(e) {
  29834. var t, i;
  29835. t=g_Prefix;
  29836. if (e = e || "",
  29837. e.match(/^https?/)) {
  29838. var n = o.parse(e);
  29839. t = g_Prefix,
  29840. i = e
  29841. } else{
  29842. //xzw 原先的不能用
  29843. //t = window.location.protocol + "//" + window.location.host, //MP
  29844. t = g_Prefix
  29845. //i = t + "/api/player/models/" + e; //MP
  29846. i = t + "data/" + e;
  29847. }
  29848. return {
  29849. urlBase: t,
  29850. urlModel: i,
  29851. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  29852. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  29853. }
  29854. },
  29855. getModelIDFromQueryString: function() {
  29856. return n.valueFromHash("model") || n.valueFromHash("m")
  29857. },
  29858. /* normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  29859. e = JSON.parse(JSON.stringify(e));
  29860. var i = null;
  29861. if (e.images.forEach(function(n) {
  29862. if(!n.metadata) return;
  29863. if ("string" == typeof n.metadata)
  29864. try {
  29865. n.metadata = JSON.parse(n.metadata)
  29866. } catch (e) {
  29867. s.warn("Unable to parse image metadata"),
  29868. n.metadata = null
  29869. }
  29870. else{
  29871. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  29872. }
  29873. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  29874. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  29875. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  29876. }else{
  29877. n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  29878. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position))
  29879. n.metadata.zoom = n.metadata.zoom || 1;
  29880. }
  29881. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  29882. }),
  29883. //icon初始视角的:
  29884. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  29885. var n = {};
  29886. n.pano = {
  29887. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  29888. position: t.convertWorkshopVector(i.scan_position),
  29889. uuid: i.scan_id
  29890. },
  29891. n.camera = {
  29892. quaternion: i.camera_quaternion,
  29893. position: i.camera_position
  29894. },
  29895. e.startPano = n
  29896. }
  29897. return e
  29898. },
  29899. */
  29900. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  29901. e = JSON.parse(JSON.stringify(e));
  29902. var i = null;
  29903. if (e.images.forEach(function(n) {
  29904. if(!n.metadata) return;
  29905. if ("string" == typeof n.metadata)
  29906. try {
  29907. n.metadata = JSON.parse(n.metadata)
  29908. } catch (e) {
  29909. s.warn("Unable to parse image metadata"),
  29910. n.metadata = null
  29911. }
  29912. else{
  29913. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  29914. }
  29915. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  29916. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  29917. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  29918. }else{
  29919. n.metadata.camera_position = new ss.Vector3().copy(n.metadata.camera_position)
  29920. n.metadata.camera_quaternion = new ss.Quaternion().copy(n.metadata.camera_quaternion)
  29921. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  29922. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position)) */
  29923. }
  29924. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  29925. }),
  29926. //icon初始视角的:
  29927. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  29928. var n = {};
  29929. n.pano = {
  29930. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  29931. position: t.convertWorkshopVector(i.scan_position),
  29932. uuid: i.scan_id
  29933. },
  29934. n.camera = {
  29935. quaternion: i.camera_quaternion,
  29936. position: i.camera_position
  29937. },
  29938. e.startPano = n
  29939. }
  29940. return e
  29941. },
  29942. visionVersionToInt: function() {
  29943. var e = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join(""));
  29944. return function(t) {
  29945. if (!t)
  29946. throw new Error("Vision version is required");
  29947. var i = e.exec(t);
  29948. if (null === i)
  29949. throw new Error("String is not a vision version: " + t);
  29950. return parseInt(i[1])
  29951. }
  29952. }(),
  29953. modelDataPromisesTiles: function(e) {
  29954. var vision_version = e.vision_version || window.MP_PREFETCHED_MODELDATA.vision_version
  29955. if (vision_version)
  29956. try {
  29957. return l.visionVersionToInt(vision_version) >= l.visionVersionToInt(r.visionTilingStartVersion)
  29958. } catch (t) {
  29959. s.warn("Invalid vision version: " + vision_version)
  29960. }
  29961. // var t = e.created ? new Date(e.created) : null;
  29962. // return t && t >= r.visionTilingStartDate
  29963. return false
  29964. }
  29965. };
  29966. t.exports = l
  29967. }
  29968. ).call(this, "/js/util/showcase.js")
  29969. }
  29970. , {
  29971. "../constants": 8,
  29972. "./browser": 182,
  29973. "./logger": 189,
  29974. three:217,
  29975. url: 208
  29976. }],
  29977. 194: [function(e, t, i) {
  29978. "use strict";
  29979. var n = e("../util/ajax")
  29980. , r = e("three")
  29981. , o = e("../settings")
  29982. , a = {};
  29983. t.exports = {
  29984. load: function(e, t, i) {
  29985. var s = a[e];
  29986. return s ? (t && setTimeout(function() {
  29987. t(s)
  29988. }, 1),
  29989. s) : (s = new r.Texture,
  29990. o.minimalMemoryMode && (s.minFilter = r.LinearFilter,
  29991. s.magFilter = r.LinearFilter,
  29992. s.generateMipmaps = !1),
  29993. s.sourceFile = e,
  29994. a[e] = s,
  29995. n.getImage(e).then(function(e) {
  29996. s.image = e,
  29997. s.needsUpdate = !0,
  29998. t && t(s)
  29999. }).fail(i),
  30000. s)
  30001. },
  30002. loadBase64: function(e, t) {
  30003. t = t || "png";
  30004. var i = new r.Texture;
  30005. return i.image = document.createElement("img"),
  30006. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  30007. o.minimalMemoryMode && (i.minFilter = r.LinearFilter,
  30008. i.magFilter = r.LinearFilter,
  30009. i.generateMipmaps = !1),
  30010. i.needsUpdate = !0,
  30011. i
  30012. },
  30013. isLoaded: function(e) {
  30014. return !!a[e]
  30015. }
  30016. }
  30017. }
  30018. , {
  30019. "../settings": 166,
  30020. "../util/ajax": 181,
  30021. three: 217
  30022. }],
  30023. 195: [function(e, t, i) {
  30024. "use strict";
  30025. var n = e("./easing");
  30026. t.exports = {
  30027. globalDone: null,
  30028. funcs: [],
  30029. counter: 0,
  30030. uniqueID: 0,
  30031. start: function(e, t, i, r, o, a, s) {
  30032. return r = r || 0,
  30033. this.funcs.push({
  30034. func: e,
  30035. current: -r * Math.abs(t),
  30036. duration: (1 - Math.max(r, 0)) * Math.abs(t),
  30037. done: i,
  30038. easing: o || n.linearTween,
  30039. cycling: t < 0,
  30040. running: !0,
  30041. debug: r < 0,
  30042. name: a || "T" + this.counter,
  30043. id: void 0 === s ? this.counter : s,
  30044. paused: !1
  30045. }),
  30046. e(0, 16),
  30047. this.counter += 1,
  30048. e
  30049. },
  30050. trigger: function(e) {
  30051. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  30052. , i = e.func || function() {}
  30053. , r = void 0 === e.duration ? 0 : e.duration;
  30054. void 0 !== e.cycling && e.cycling && (r = -Math.abs(r));
  30055. var o = e.done || null
  30056. , a = e.easing || n.linearTween
  30057. , s = e.name || "R" + this.counter
  30058. , l = void 0 === e.id ? this.counter : e.id;
  30059. return this.start(i, r, o, t, a, s, l)
  30060. },
  30061. setTimeout: function(e, t, i) {
  30062. var n = void 0 === i ? this.counter : i;
  30063. return this.trigger({
  30064. done: e,
  30065. duration: void 0 === t ? 0 : t,
  30066. name: "O" + this.counter,
  30067. id: n
  30068. })
  30069. },
  30070. pause: function() {
  30071. this.paused = !0
  30072. },
  30073. resume: function() {
  30074. this.paused = !1
  30075. },
  30076. update: function(e) {
  30077. this.funcs.forEach(function(t) {
  30078. if (!(t.paused || (t.current += 1e3 * e,
  30079. t.current < 0)))
  30080. if (t.current >= t.duration && !t.cycling) {
  30081. var i = t.easing(1, 0, 1, 1);
  30082. t.func(i, 1e3 * e),
  30083. t.done && t.done(),
  30084. t.running = !1
  30085. } else {
  30086. var n = t.easing(t.current % t.duration / t.duration, 0, 1, 1)
  30087. , r = t.func(n, 1e3 * e) || !1;
  30088. r && (t.done && t.done(),
  30089. t.running = !1)
  30090. }
  30091. });
  30092. var t = this.funcs.length;
  30093. this.funcs = this.funcs.filter(function(e) {
  30094. return e.running
  30095. });
  30096. var i = this.funcs.length;
  30097. if (t > 0 && 0 === i && this.globalDone) {
  30098. var n = this.globalDone;
  30099. this.globalDone = null,
  30100. n()
  30101. }
  30102. },
  30103. adjustSpeed: function(e, t) {
  30104. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  30105. var r = i[n];
  30106. r.duration /= t,
  30107. r.current /= t
  30108. }
  30109. },
  30110. getById: function(e) {
  30111. return this.funcs.filter(function(t) {
  30112. return e === t.id
  30113. })
  30114. },
  30115. get: function(e) {
  30116. for (var t = 0; t < this.funcs.length; t += 1)
  30117. if (this.funcs[t].func === e)
  30118. return this.funcs[t];
  30119. return null
  30120. },
  30121. isRunning: function(e) {
  30122. var t = this.get(e);
  30123. return null !== t && t.running
  30124. },
  30125. countActive: function() {
  30126. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  30127. e += this.funcs[t].running;
  30128. return e
  30129. },
  30130. listActive: function() {
  30131. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  30132. this.funcs[t].running && e.push(this.funcs[t].name);
  30133. return e
  30134. },
  30135. done: function(e) {
  30136. this.globalDone = e
  30137. },
  30138. cancelById: function(e) {
  30139. var t = void 0 === e ? 0 : e;
  30140. this.funcs = this.funcs.filter(function(e) {
  30141. return e.id !== t
  30142. })
  30143. },
  30144. cancel: function(e) {
  30145. this.funcs = this.funcs.filter(function(t) {
  30146. return t.func !== e
  30147. })
  30148. },
  30149. getUniqueId: function() {
  30150. return this.uniqueID -= 1,
  30151. this.uniqueID
  30152. }
  30153. }
  30154. }
  30155. , {
  30156. "./easing": 186
  30157. }],
  30158. 196: [function(e, t, i) {
  30159. function n(e) {
  30160. if (this.set = {},
  30161. this.infContains = function() {
  30162. return !0
  30163. }
  30164. ,
  30165. "object" == typeof e)
  30166. if (e instanceof Array)
  30167. for (var t = 0; t < e.length; t++)
  30168. this.set[e[t]] = !0;
  30169. else
  30170. this.set = e;
  30171. else if ("function" == typeof e)
  30172. this.infContains = e;
  30173. else if ("undefined" != typeof e)
  30174. throw new Error("set must be either an array or an object.")
  30175. }
  30176. t.exports = n,
  30177. n.prototype.contains = function(e) {
  30178. return !!this.set[e]
  30179. }
  30180. ,
  30181. n.prototype.has = n.prototype.contains,
  30182. n.prototype.add = function(e) {
  30183. if (1 == arguments.length)
  30184. this.set[e] = !0;
  30185. else
  30186. for (var t = 0; t < arguments.length; t++)
  30187. this.set[arguments[t]] = !0
  30188. }
  30189. ,
  30190. n.prototype.addAll = function(e) {
  30191. if ("object" != typeof e && !(e instanceof Array))
  30192. throw new Error("arr must be an array.");
  30193. for (var t = 0; t < e.length; t++)
  30194. this.add(e[t])
  30195. }
  30196. ,
  30197. n.prototype.remove = function(e) {
  30198. if (1 == arguments.length)
  30199. delete this.set[e];
  30200. else
  30201. for (var t = 0; t < arguments.length; t++)
  30202. delete this.set[arguments[t]]
  30203. }
  30204. ,
  30205. n.prototype.delete = n.prototype.remove,
  30206. n.prototype.clear = function() {
  30207. this.set = {}
  30208. }
  30209. ,
  30210. n.prototype.size = function() {
  30211. return Object.keys(this.set).length
  30212. }
  30213. ,
  30214. n.prototype.toString = function() {
  30215. return "{" + Object.keys(this.set).toString() + "}"
  30216. }
  30217. ,
  30218. n.prototype.toArray = function() {
  30219. return "undefined" == typeof this.set ? [] : Object.keys(this.set)
  30220. }
  30221. ,
  30222. n.prototype["*values"] = n.prototype.toArray
  30223. }
  30224. , {}],
  30225. 197: [function(e, t, i) {}
  30226. , {}],
  30227. 198: [function(e, t, i) {
  30228. (function(t) {
  30229. "use strict";
  30230. function n() {
  30231. try {
  30232. var e = new Uint8Array(1);
  30233. return e.__proto__ = {
  30234. __proto__: Uint8Array.prototype,
  30235. foo: function() {
  30236. return 42
  30237. }
  30238. },
  30239. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  30240. } catch (e) {
  30241. return !1
  30242. }
  30243. }
  30244. function r() {
  30245. return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  30246. }
  30247. function o(e, t) {
  30248. if (r() < t)
  30249. throw new RangeError("Invalid typed array length");
  30250. return a.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t),
  30251. e.__proto__ = a.prototype) : (null === e && (e = new a(t)),
  30252. e.length = t),
  30253. e
  30254. }
  30255. function a(e, t, i) {
  30256. if (!(a.TYPED_ARRAY_SUPPORT || this instanceof a))
  30257. return new a(e,t,i);
  30258. if ("number" == typeof e) {
  30259. if ("string" == typeof t)
  30260. throw new Error("If encoding is specified then the first argument must be a string");
  30261. return h(this, e)
  30262. }
  30263. return s(this, e, t, i)
  30264. }
  30265. function s(e, t, i, n) {
  30266. if ("number" == typeof t)
  30267. throw new TypeError('"value" argument must not be a number');
  30268. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? p(e, t, i, n) : "string" == typeof t ? u(e, t, i) : f(e, t)
  30269. }
  30270. function l(e) {
  30271. if ("number" != typeof e)
  30272. throw new TypeError('"size" argument must be a number');
  30273. if (e < 0)
  30274. throw new RangeError('"size" argument must not be negative')
  30275. }
  30276. function c(e, t, i, n) {
  30277. return l(t),
  30278. t <= 0 ? o(e, t) : void 0 !== i ? "string" == typeof n ? o(e, t).fill(i, n) : o(e, t).fill(i) : o(e, t)
  30279. }
  30280. function h(e, t) {
  30281. if (l(t),
  30282. e = o(e, t < 0 ? 0 : 0 | g(t)),
  30283. !a.TYPED_ARRAY_SUPPORT)
  30284. for (var i = 0; i < t; ++i)
  30285. e[i] = 0;
  30286. return e
  30287. }
  30288. function u(e, t, i) {
  30289. if ("string" == typeof i && "" !== i || (i = "utf8"),
  30290. !a.isEncoding(i))
  30291. throw new TypeError('"encoding" must be a valid string encoding');
  30292. var n = 0 | v(t, i);
  30293. e = o(e, n);
  30294. var r = e.write(t, i);
  30295. return r !== n && (e = e.slice(0, r)),
  30296. e
  30297. }
  30298. function d(e, t) {
  30299. var i = t.length < 0 ? 0 : 0 | g(t.length);
  30300. e = o(e, i);
  30301. for (var n = 0; n < i; n += 1)
  30302. e[n] = 255 & t[n];
  30303. return e
  30304. }
  30305. function p(e, t, i, n) {
  30306. if (t.byteLength,
  30307. i < 0 || t.byteLength < i)
  30308. throw new RangeError("'offset' is out of bounds");
  30309. if (t.byteLength < i + (n || 0))
  30310. throw new RangeError("'length' is out of bounds");
  30311. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  30312. a.TYPED_ARRAY_SUPPORT ? (e = t,
  30313. e.__proto__ = a.prototype) : e = d(e, t),
  30314. e
  30315. }
  30316. function f(e, t) {
  30317. if (a.isBuffer(t)) {
  30318. var i = 0 | g(t.length);
  30319. return e = o(e, i),
  30320. 0 === e.length ? e : (t.copy(e, 0, 0, i),
  30321. e)
  30322. }
  30323. if (t) {
  30324. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  30325. return "number" != typeof t.length || K(t.length) ? o(e, 0) : d(e, t);
  30326. if ("Buffer" === t.type && $(t.data))
  30327. return d(e, t.data)
  30328. }
  30329. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  30330. }
  30331. function g(e) {
  30332. if (e >= r())
  30333. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + r().toString(16) + " bytes");
  30334. return 0 | e
  30335. }
  30336. function m(e) {
  30337. return +e != e && (e = 0),
  30338. a.alloc(+e)
  30339. }
  30340. function v(e, t) {
  30341. if (a.isBuffer(e))
  30342. return e.length;
  30343. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  30344. return e.byteLength;
  30345. "string" != typeof e && (e = "" + e);
  30346. var i = e.length;
  30347. if (0 === i)
  30348. return 0;
  30349. for (var n = !1; ; )
  30350. switch (t) {
  30351. case "ascii":
  30352. case "latin1":
  30353. case "binary":
  30354. return i;
  30355. case "utf8":
  30356. case "utf-8":
  30357. case void 0:
  30358. return j(e).length;
  30359. case "ucs2":
  30360. case "ucs-2":
  30361. case "utf16le":
  30362. case "utf-16le":
  30363. return 2 * i;
  30364. case "hex":
  30365. return i >>> 1;
  30366. case "base64":
  30367. return Z(e).length;
  30368. default:
  30369. if (n)
  30370. return j(e).length;
  30371. t = ("" + t).toLowerCase(),
  30372. n = !0
  30373. }
  30374. }
  30375. function A(e, t, i) {
  30376. var n = !1;
  30377. if ((void 0 === t || t < 0) && (t = 0),
  30378. t > this.length)
  30379. return "";
  30380. if ((void 0 === i || i > this.length) && (i = this.length),
  30381. i <= 0)
  30382. return "";
  30383. if (i >>>= 0,
  30384. t >>>= 0,
  30385. i <= t)
  30386. return "";
  30387. for (e || (e = "utf8"); ; )
  30388. switch (e) {
  30389. case "hex":
  30390. return L(this, t, i);
  30391. case "utf8":
  30392. case "utf-8":
  30393. return M(this, t, i);
  30394. case "ascii":
  30395. return P(this, t, i);
  30396. case "latin1":
  30397. case "binary":
  30398. return O(this, t, i);
  30399. case "base64":
  30400. return S(this, t, i);
  30401. case "ucs2":
  30402. case "ucs-2":
  30403. case "utf16le":
  30404. case "utf-16le":
  30405. return D(this, t, i);
  30406. default:
  30407. if (n)
  30408. throw new TypeError("Unknown encoding: " + e);
  30409. e = (e + "").toLowerCase(),
  30410. n = !0
  30411. }
  30412. }
  30413. function y(e, t, i) {
  30414. var n = e[t];
  30415. e[t] = e[i],
  30416. e[i] = n
  30417. }
  30418. function C(e, t, i, n, r) {
  30419. if (0 === e.length)
  30420. return -1;
  30421. if ("string" == typeof i ? (n = i,
  30422. i = 0) : i > 2147483647 ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  30423. i = +i,
  30424. isNaN(i) && (i = r ? 0 : e.length - 1),
  30425. i < 0 && (i = e.length + i),
  30426. i >= e.length) {
  30427. if (r)
  30428. return -1;
  30429. i = e.length - 1
  30430. } else if (i < 0) {
  30431. if (!r)
  30432. return -1;
  30433. i = 0
  30434. }
  30435. if ("string" == typeof t && (t = a.from(t, n)),
  30436. a.isBuffer(t))
  30437. return 0 === t.length ? -1 : I(e, t, i, n, r);
  30438. if ("number" == typeof t)
  30439. return t &= 255,
  30440. a.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? r ? Uint8Array.prototype.indexOf.call(e, t, i) : Uint8Array.prototype.lastIndexOf.call(e, t, i) : I(e, [t], i, n, r);
  30441. throw new TypeError("val must be string, number or Buffer")
  30442. }
  30443. function I(e, t, i, n, r) {
  30444. function o(e, t) {
  30445. return 1 === a ? e[t] : e.readUInt16BE(t * a)
  30446. }
  30447. var a = 1
  30448. , s = e.length
  30449. , l = t.length;
  30450. if (void 0 !== n && (n = String(n).toLowerCase(),
  30451. "ucs2" === n || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  30452. if (e.length < 2 || t.length < 2)
  30453. return -1;
  30454. a = 2,
  30455. s /= 2,
  30456. l /= 2,
  30457. i /= 2
  30458. }
  30459. var c;
  30460. if (r) {
  30461. var h = -1;
  30462. for (c = i; c < s; c++)
  30463. if (o(e, c) === o(t, h === -1 ? 0 : c - h)) {
  30464. if (h === -1 && (h = c),
  30465. c - h + 1 === l)
  30466. return h * a
  30467. } else
  30468. h !== -1 && (c -= c - h),
  30469. h = -1
  30470. } else
  30471. for (i + l > s && (i = s - l),
  30472. c = i; c >= 0; c--) {
  30473. for (var u = !0, d = 0; d < l; d++)
  30474. if (o(e, c + d) !== o(t, d)) {
  30475. u = !1;
  30476. break
  30477. }
  30478. if (u)
  30479. return c
  30480. }
  30481. return -1
  30482. }
  30483. function E(e, t, i, n) {
  30484. i = Number(i) || 0;
  30485. var r = e.length - i;
  30486. n ? (n = Number(n),
  30487. n > r && (n = r)) : n = r;
  30488. var o = t.length;
  30489. if (o % 2 !== 0)
  30490. throw new TypeError("Invalid hex string");
  30491. n > o / 2 && (n = o / 2);
  30492. for (var a = 0; a < n; ++a) {
  30493. var s = parseInt(t.substr(2 * a, 2), 16);
  30494. if (isNaN(s))
  30495. return a;
  30496. e[i + a] = s
  30497. }
  30498. return a
  30499. }
  30500. function b(e, t, i, n) {
  30501. return q(j(t, e.length - i), e, i, n)
  30502. }
  30503. function w(e, t, i, n) {
  30504. return q(Y(t), e, i, n)
  30505. }
  30506. function _(e, t, i, n) {
  30507. return w(e, t, i, n)
  30508. }
  30509. function T(e, t, i, n) {
  30510. return q(Z(t), e, i, n)
  30511. }
  30512. function x(e, t, i, n) {
  30513. return q(X(t, e.length - i), e, i, n)
  30514. }
  30515. function S(e, t, i) {
  30516. return 0 === t && i === e.length ? Q.fromByteArray(e) : Q.fromByteArray(e.slice(t, i))
  30517. }
  30518. function M(e, t, i) {
  30519. i = Math.min(e.length, i);
  30520. for (var n = [], r = t; r < i; ) {
  30521. var o = e[r]
  30522. , a = null
  30523. , s = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
  30524. if (r + s <= i) {
  30525. var l, c, h, u;
  30526. switch (s) {
  30527. case 1:
  30528. o < 128 && (a = o);
  30529. break;
  30530. case 2:
  30531. l = e[r + 1],
  30532. 128 === (192 & l) && (u = (31 & o) << 6 | 63 & l,
  30533. u > 127 && (a = u));
  30534. break;
  30535. case 3:
  30536. l = e[r + 1],
  30537. c = e[r + 2],
  30538. 128 === (192 & l) && 128 === (192 & c) && (u = (15 & o) << 12 | (63 & l) << 6 | 63 & c,
  30539. u > 2047 && (u < 55296 || u > 57343) && (a = u));
  30540. break;
  30541. case 4:
  30542. l = e[r + 1],
  30543. c = e[r + 2],
  30544. h = e[r + 3],
  30545. 128 === (192 & l) && 128 === (192 & c) && 128 === (192 & h) && (u = (15 & o) << 18 | (63 & l) << 12 | (63 & c) << 6 | 63 & h,
  30546. u > 65535 && u < 1114112 && (a = u))
  30547. }
  30548. }
  30549. null === a ? (a = 65533,
  30550. s = 1) : a > 65535 && (a -= 65536,
  30551. n.push(a >>> 10 & 1023 | 55296),
  30552. a = 56320 | 1023 & a),
  30553. n.push(a),
  30554. r += s
  30555. }
  30556. return R(n)
  30557. }
  30558. function R(e) {
  30559. var t = e.length;
  30560. if (t <= ee)
  30561. return String.fromCharCode.apply(String, e);
  30562. for (var i = "", n = 0; n < t; )
  30563. i += String.fromCharCode.apply(String, e.slice(n, n += ee));
  30564. return i
  30565. }
  30566. function P(e, t, i) {
  30567. var n = "";
  30568. i = Math.min(e.length, i);
  30569. for (var r = t; r < i; ++r)
  30570. n += String.fromCharCode(127 & e[r]);
  30571. return n
  30572. }
  30573. function O(e, t, i) {
  30574. var n = "";
  30575. i = Math.min(e.length, i);
  30576. for (var r = t; r < i; ++r)
  30577. n += String.fromCharCode(e[r]);
  30578. return n
  30579. }
  30580. function L(e, t, i) {
  30581. var n = e.length;
  30582. (!t || t < 0) && (t = 0),
  30583. (!i || i < 0 || i > n) && (i = n);
  30584. for (var r = "", o = t; o < i; ++o)
  30585. r += W(e[o]);
  30586. return r
  30587. }
  30588. function D(e, t, i) {
  30589. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  30590. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  30591. return r
  30592. }
  30593. function N(e, t, i) {
  30594. if (e % 1 !== 0 || e < 0)
  30595. throw new RangeError("offset is not uint");
  30596. if (e + t > i)
  30597. throw new RangeError("Trying to access beyond buffer length")
  30598. }
  30599. function B(e, t, i, n, r, o) {
  30600. if (!a.isBuffer(e))
  30601. throw new TypeError('"buffer" argument must be a Buffer instance');
  30602. if (t > r || t < o)
  30603. throw new RangeError('"value" argument is out of bounds');
  30604. if (i + n > e.length)
  30605. throw new RangeError("Index out of range")
  30606. }
  30607. function F(e, t, i, n) {
  30608. t < 0 && (t = 65535 + t + 1);
  30609. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  30610. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  30611. }
  30612. function V(e, t, i, n) {
  30613. t < 0 && (t = 4294967295 + t + 1);
  30614. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  30615. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  30616. }
  30617. function U(e, t, i, n, r, o) {
  30618. if (i + n > e.length)
  30619. throw new RangeError("Index out of range");
  30620. if (i < 0)
  30621. throw new RangeError("Index out of range")
  30622. }
  30623. function k(e, t, i, n, r) {
  30624. return r || U(e, t, i, 4, 3.4028234663852886e38, -3.4028234663852886e38),
  30625. J.write(e, t, i, n, 23, 4),
  30626. i + 4
  30627. }
  30628. function H(e, t, i, n, r) {
  30629. return r || U(e, t, i, 8, 1.7976931348623157e308, -1.7976931348623157e308),
  30630. J.write(e, t, i, n, 52, 8),
  30631. i + 8
  30632. }
  30633. function G(e) {
  30634. if (e = z(e).replace(te, ""),
  30635. e.length < 2)
  30636. return "";
  30637. for (; e.length % 4 !== 0; )
  30638. e += "=";
  30639. return e
  30640. }
  30641. function z(e) {
  30642. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  30643. }
  30644. function W(e) {
  30645. return e < 16 ? "0" + e.toString(16) : e.toString(16)
  30646. }
  30647. function j(e, t) {
  30648. t = t || 1 / 0;
  30649. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  30650. if (i = e.charCodeAt(a),
  30651. i > 55295 && i < 57344) {
  30652. if (!r) {
  30653. if (i > 56319) {
  30654. (t -= 3) > -1 && o.push(239, 191, 189);
  30655. continue
  30656. }
  30657. if (a + 1 === n) {
  30658. (t -= 3) > -1 && o.push(239, 191, 189);
  30659. continue
  30660. }
  30661. r = i;
  30662. continue
  30663. }
  30664. if (i < 56320) {
  30665. (t -= 3) > -1 && o.push(239, 191, 189),
  30666. r = i;
  30667. continue
  30668. }
  30669. i = (r - 55296 << 10 | i - 56320) + 65536
  30670. } else
  30671. r && (t -= 3) > -1 && o.push(239, 191, 189);
  30672. if (r = null,
  30673. i < 128) {
  30674. if ((t -= 1) < 0)
  30675. break;
  30676. o.push(i)
  30677. } else if (i < 2048) {
  30678. if ((t -= 2) < 0)
  30679. break;
  30680. o.push(i >> 6 | 192, 63 & i | 128)
  30681. } else if (i < 65536) {
  30682. if ((t -= 3) < 0)
  30683. break;
  30684. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  30685. } else {
  30686. if (!(i < 1114112))
  30687. throw new Error("Invalid code point");
  30688. if ((t -= 4) < 0)
  30689. break;
  30690. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  30691. }
  30692. }
  30693. return o
  30694. }
  30695. function Y(e) {
  30696. for (var t = [], i = 0; i < e.length; ++i)
  30697. t.push(255 & e.charCodeAt(i));
  30698. return t
  30699. }
  30700. function X(e, t) {
  30701. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  30702. i = e.charCodeAt(a),
  30703. n = i >> 8,
  30704. r = i % 256,
  30705. o.push(r),
  30706. o.push(n);
  30707. return o
  30708. }
  30709. function Z(e) {
  30710. return Q.toByteArray(G(e))
  30711. }
  30712. function q(e, t, i, n) {
  30713. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  30714. t[r + i] = e[r];
  30715. return r
  30716. }
  30717. function K(e) {
  30718. return e !== e
  30719. }
  30720. var Q = e("base64-js")
  30721. , J = e("ieee754")
  30722. , $ = e("isarray");
  30723. i.Buffer = a,
  30724. i.SlowBuffer = m,
  30725. i.INSPECT_MAX_BYTES = 50,
  30726. a.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : n(),
  30727. i.kMaxLength = r(),
  30728. a.poolSize = 8192,
  30729. a._augment = function(e) {
  30730. return e.__proto__ = a.prototype,
  30731. e
  30732. }
  30733. ,
  30734. a.from = function(e, t, i) {
  30735. return s(null, e, t, i)
  30736. }
  30737. ,
  30738. a.TYPED_ARRAY_SUPPORT && (a.prototype.__proto__ = Uint8Array.prototype,
  30739. a.__proto__ = Uint8Array,
  30740. "undefined" != typeof Symbol && Symbol.species && a[Symbol.species] === a && Object.defineProperty(a, Symbol.species, {
  30741. value: null,
  30742. configurable: !0
  30743. })),
  30744. a.alloc = function(e, t, i) {
  30745. return c(null, e, t, i)
  30746. }
  30747. ,
  30748. a.allocUnsafe = function(e) {
  30749. return h(null, e)
  30750. }
  30751. ,
  30752. a.allocUnsafeSlow = function(e) {
  30753. return h(null, e)
  30754. }
  30755. ,
  30756. a.isBuffer = function(e) {
  30757. return !(null == e || !e._isBuffer)
  30758. }
  30759. ,
  30760. a.compare = function(e, t) {
  30761. if (!a.isBuffer(e) || !a.isBuffer(t))
  30762. throw new TypeError("Arguments must be Buffers");
  30763. if (e === t)
  30764. return 0;
  30765. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  30766. if (e[r] !== t[r]) {
  30767. i = e[r],
  30768. n = t[r];
  30769. break
  30770. }
  30771. return i < n ? -1 : n < i ? 1 : 0
  30772. }
  30773. ,
  30774. a.isEncoding = function(e) {
  30775. switch (String(e).toLowerCase()) {
  30776. case "hex":
  30777. case "utf8":
  30778. case "utf-8":
  30779. case "ascii":
  30780. case "latin1":
  30781. case "binary":
  30782. case "base64":
  30783. case "ucs2":
  30784. case "ucs-2":
  30785. case "utf16le":
  30786. case "utf-16le":
  30787. return !0;
  30788. default:
  30789. return !1
  30790. }
  30791. }
  30792. ,
  30793. a.concat = function(e, t) {
  30794. if (!$(e))
  30795. throw new TypeError('"list" argument must be an Array of Buffers');
  30796. if (0 === e.length)
  30797. return a.alloc(0);
  30798. var i;
  30799. if (void 0 === t)
  30800. for (t = 0,
  30801. i = 0; i < e.length; ++i)
  30802. t += e[i].length;
  30803. var n = a.allocUnsafe(t)
  30804. , r = 0;
  30805. for (i = 0; i < e.length; ++i) {
  30806. var o = e[i];
  30807. if (!a.isBuffer(o))
  30808. throw new TypeError('"list" argument must be an Array of Buffers');
  30809. o.copy(n, r),
  30810. r += o.length
  30811. }
  30812. return n
  30813. }
  30814. ,
  30815. a.byteLength = v,
  30816. a.prototype._isBuffer = !0,
  30817. a.prototype.swap16 = function() {
  30818. var e = this.length;
  30819. if (e % 2 !== 0)
  30820. throw new RangeError("Buffer size must be a multiple of 16-bits");
  30821. for (var t = 0; t < e; t += 2)
  30822. y(this, t, t + 1);
  30823. return this
  30824. }
  30825. ,
  30826. a.prototype.swap32 = function() {
  30827. var e = this.length;
  30828. if (e % 4 !== 0)
  30829. throw new RangeError("Buffer size must be a multiple of 32-bits");
  30830. for (var t = 0; t < e; t += 4)
  30831. y(this, t, t + 3),
  30832. y(this, t + 1, t + 2);
  30833. return this
  30834. }
  30835. ,
  30836. a.prototype.swap64 = function() {
  30837. var e = this.length;
  30838. if (e % 8 !== 0)
  30839. throw new RangeError("Buffer size must be a multiple of 64-bits");
  30840. for (var t = 0; t < e; t += 8)
  30841. y(this, t, t + 7),
  30842. y(this, t + 1, t + 6),
  30843. y(this, t + 2, t + 5),
  30844. y(this, t + 3, t + 4);
  30845. return this
  30846. }
  30847. ,
  30848. a.prototype.toString = function() {
  30849. var e = 0 | this.length;
  30850. return 0 === e ? "" : 0 === arguments.length ? M(this, 0, e) : A.apply(this, arguments)
  30851. }
  30852. ,
  30853. a.prototype.equals = function(e) {
  30854. if (!a.isBuffer(e))
  30855. throw new TypeError("Argument must be a Buffer");
  30856. return this === e || 0 === a.compare(this, e)
  30857. }
  30858. ,
  30859. a.prototype.inspect = function() {
  30860. var e = ""
  30861. , t = i.INSPECT_MAX_BYTES;
  30862. return this.length > 0 && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  30863. this.length > t && (e += " ... ")),
  30864. "<Buffer " + e + ">"
  30865. }
  30866. ,
  30867. a.prototype.compare = function(e, t, i, n, r) {
  30868. if (!a.isBuffer(e))
  30869. throw new TypeError("Argument must be a Buffer");
  30870. if (void 0 === t && (t = 0),
  30871. void 0 === i && (i = e ? e.length : 0),
  30872. void 0 === n && (n = 0),
  30873. void 0 === r && (r = this.length),
  30874. t < 0 || i > e.length || n < 0 || r > this.length)
  30875. throw new RangeError("out of range index");
  30876. if (n >= r && t >= i)
  30877. return 0;
  30878. if (n >= r)
  30879. return -1;
  30880. if (t >= i)
  30881. return 1;
  30882. if (t >>>= 0,
  30883. i >>>= 0,
  30884. n >>>= 0,
  30885. r >>>= 0,
  30886. this === e)
  30887. return 0;
  30888. for (var o = r - n, s = i - t, l = Math.min(o, s), c = this.slice(n, r), h = e.slice(t, i), u = 0; u < l; ++u)
  30889. if (c[u] !== h[u]) {
  30890. o = c[u],
  30891. s = h[u];
  30892. break
  30893. }
  30894. return o < s ? -1 : s < o ? 1 : 0
  30895. }
  30896. ,
  30897. a.prototype.includes = function(e, t, i) {
  30898. return this.indexOf(e, t, i) !== -1
  30899. }
  30900. ,
  30901. a.prototype.indexOf = function(e, t, i) {
  30902. return C(this, e, t, i, !0)
  30903. }
  30904. ,
  30905. a.prototype.lastIndexOf = function(e, t, i) {
  30906. return C(this, e, t, i, !1)
  30907. }
  30908. ,
  30909. a.prototype.write = function(e, t, i, n) {
  30910. if (void 0 === t)
  30911. n = "utf8",
  30912. i = this.length,
  30913. t = 0;
  30914. else if (void 0 === i && "string" == typeof t)
  30915. n = t,
  30916. i = this.length,
  30917. t = 0;
  30918. else {
  30919. if (!isFinite(t))
  30920. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  30921. t |= 0,
  30922. isFinite(i) ? (i |= 0,
  30923. void 0 === n && (n = "utf8")) : (n = i,
  30924. i = void 0)
  30925. }
  30926. var r = this.length - t;
  30927. if ((void 0 === i || i > r) && (i = r),
  30928. e.length > 0 && (i < 0 || t < 0) || t > this.length)
  30929. throw new RangeError("Attempt to write outside buffer bounds");
  30930. n || (n = "utf8");
  30931. for (var o = !1; ; )
  30932. switch (n) {
  30933. case "hex":
  30934. return E(this, e, t, i);
  30935. case "utf8":
  30936. case "utf-8":
  30937. return b(this, e, t, i);
  30938. case "ascii":
  30939. return w(this, e, t, i);
  30940. case "latin1":
  30941. case "binary":
  30942. return _(this, e, t, i);
  30943. case "base64":
  30944. return T(this, e, t, i);
  30945. case "ucs2":
  30946. case "ucs-2":
  30947. case "utf16le":
  30948. case "utf-16le":
  30949. return x(this, e, t, i);
  30950. default:
  30951. if (o)
  30952. throw new TypeError("Unknown encoding: " + n);
  30953. n = ("" + n).toLowerCase(),
  30954. o = !0
  30955. }
  30956. }
  30957. ,
  30958. a.prototype.toJSON = function() {
  30959. return {
  30960. type: "Buffer",
  30961. data: Array.prototype.slice.call(this._arr || this, 0)
  30962. }
  30963. }
  30964. ;
  30965. var ee = 4096;
  30966. a.prototype.slice = function(e, t) {
  30967. var i = this.length;
  30968. e = ~~e,
  30969. t = void 0 === t ? i : ~~t,
  30970. e < 0 ? (e += i,
  30971. e < 0 && (e = 0)) : e > i && (e = i),
  30972. t < 0 ? (t += i,
  30973. t < 0 && (t = 0)) : t > i && (t = i),
  30974. t < e && (t = e);
  30975. var n;
  30976. if (a.TYPED_ARRAY_SUPPORT)
  30977. n = this.subarray(e, t),
  30978. n.__proto__ = a.prototype;
  30979. else {
  30980. var r = t - e;
  30981. n = new a(r,void 0);
  30982. for (var o = 0; o < r; ++o)
  30983. n[o] = this[o + e]
  30984. }
  30985. return n
  30986. }
  30987. ,
  30988. a.prototype.readUIntLE = function(e, t, i) {
  30989. e |= 0,
  30990. t |= 0,
  30991. i || N(e, t, this.length);
  30992. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30993. n += this[e + o] * r;
  30994. return n
  30995. }
  30996. ,
  30997. a.prototype.readUIntBE = function(e, t, i) {
  30998. e |= 0,
  30999. t |= 0,
  31000. i || N(e, t, this.length);
  31001. for (var n = this[e + --t], r = 1; t > 0 && (r *= 256); )
  31002. n += this[e + --t] * r;
  31003. return n
  31004. }
  31005. ,
  31006. a.prototype.readUInt8 = function(e, t) {
  31007. return t || N(e, 1, this.length),
  31008. this[e]
  31009. }
  31010. ,
  31011. a.prototype.readUInt16LE = function(e, t) {
  31012. return t || N(e, 2, this.length),
  31013. this[e] | this[e + 1] << 8
  31014. }
  31015. ,
  31016. a.prototype.readUInt16BE = function(e, t) {
  31017. return t || N(e, 2, this.length),
  31018. this[e] << 8 | this[e + 1]
  31019. }
  31020. ,
  31021. a.prototype.readUInt32LE = function(e, t) {
  31022. return t || N(e, 4, this.length),
  31023. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  31024. }
  31025. ,
  31026. a.prototype.readUInt32BE = function(e, t) {
  31027. return t || N(e, 4, this.length),
  31028. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  31029. }
  31030. ,
  31031. a.prototype.readIntLE = function(e, t, i) {
  31032. e |= 0,
  31033. t |= 0,
  31034. i || N(e, t, this.length);
  31035. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  31036. n += this[e + o] * r;
  31037. return r *= 128,
  31038. n >= r && (n -= Math.pow(2, 8 * t)),
  31039. n
  31040. }
  31041. ,
  31042. a.prototype.readIntBE = function(e, t, i) {
  31043. e |= 0,
  31044. t |= 0,
  31045. i || N(e, t, this.length);
  31046. for (var n = t, r = 1, o = this[e + --n]; n > 0 && (r *= 256); )
  31047. o += this[e + --n] * r;
  31048. return r *= 128,
  31049. o >= r && (o -= Math.pow(2, 8 * t)),
  31050. o
  31051. }
  31052. ,
  31053. a.prototype.readInt8 = function(e, t) {
  31054. return t || N(e, 1, this.length),
  31055. 128 & this[e] ? (255 - this[e] + 1) * -1 : this[e]
  31056. }
  31057. ,
  31058. a.prototype.readInt16LE = function(e, t) {
  31059. t || N(e, 2, this.length);
  31060. var i = this[e] | this[e + 1] << 8;
  31061. return 32768 & i ? 4294901760 | i : i
  31062. }
  31063. ,
  31064. a.prototype.readInt16BE = function(e, t) {
  31065. t || N(e, 2, this.length);
  31066. var i = this[e + 1] | this[e] << 8;
  31067. return 32768 & i ? 4294901760 | i : i
  31068. }
  31069. ,
  31070. a.prototype.readInt32LE = function(e, t) {
  31071. return t || N(e, 4, this.length),
  31072. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  31073. }
  31074. ,
  31075. a.prototype.readInt32BE = function(e, t) {
  31076. return t || N(e, 4, this.length),
  31077. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  31078. }
  31079. ,
  31080. a.prototype.readFloatLE = function(e, t) {
  31081. return t || N(e, 4, this.length),
  31082. J.read(this, e, !0, 23, 4)
  31083. }
  31084. ,
  31085. a.prototype.readFloatBE = function(e, t) {
  31086. return t || N(e, 4, this.length),
  31087. J.read(this, e, !1, 23, 4)
  31088. }
  31089. ,
  31090. a.prototype.readDoubleLE = function(e, t) {
  31091. return t || N(e, 8, this.length),
  31092. J.read(this, e, !0, 52, 8)
  31093. }
  31094. ,
  31095. a.prototype.readDoubleBE = function(e, t) {
  31096. return t || N(e, 8, this.length),
  31097. J.read(this, e, !1, 52, 8)
  31098. }
  31099. ,
  31100. a.prototype.writeUIntLE = function(e, t, i, n) {
  31101. if (e = +e,
  31102. t |= 0,
  31103. i |= 0,
  31104. !n) {
  31105. var r = Math.pow(2, 8 * i) - 1;
  31106. B(this, e, t, i, r, 0)
  31107. }
  31108. var o = 1
  31109. , a = 0;
  31110. for (this[t] = 255 & e; ++a < i && (o *= 256); )
  31111. this[t + a] = e / o & 255;
  31112. return t + i
  31113. }
  31114. ,
  31115. a.prototype.writeUIntBE = function(e, t, i, n) {
  31116. if (e = +e,
  31117. t |= 0,
  31118. i |= 0,
  31119. !n) {
  31120. var r = Math.pow(2, 8 * i) - 1;
  31121. B(this, e, t, i, r, 0)
  31122. }
  31123. var o = i - 1
  31124. , a = 1;
  31125. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  31126. this[t + o] = e / a & 255;
  31127. return t + i
  31128. }
  31129. ,
  31130. a.prototype.writeUInt8 = function(e, t, i) {
  31131. return e = +e,
  31132. t |= 0,
  31133. i || B(this, e, t, 1, 255, 0),
  31134. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  31135. this[t] = 255 & e,
  31136. t + 1
  31137. }
  31138. ,
  31139. a.prototype.writeUInt16LE = function(e, t, i) {
  31140. return e = +e,
  31141. t |= 0,
  31142. i || B(this, e, t, 2, 65535, 0),
  31143. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  31144. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  31145. t + 2
  31146. }
  31147. ,
  31148. a.prototype.writeUInt16BE = function(e, t, i) {
  31149. return e = +e,
  31150. t |= 0,
  31151. i || B(this, e, t, 2, 65535, 0),
  31152. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  31153. this[t + 1] = 255 & e) : F(this, e, t, !1),
  31154. t + 2
  31155. }
  31156. ,
  31157. a.prototype.writeUInt32LE = function(e, t, i) {
  31158. return e = +e,
  31159. t |= 0,
  31160. i || B(this, e, t, 4, 4294967295, 0),
  31161. a.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  31162. this[t + 2] = e >>> 16,
  31163. this[t + 1] = e >>> 8,
  31164. this[t] = 255 & e) : V(this, e, t, !0),
  31165. t + 4
  31166. }
  31167. ,
  31168. a.prototype.writeUInt32BE = function(e, t, i) {
  31169. return e = +e,
  31170. t |= 0,
  31171. i || B(this, e, t, 4, 4294967295, 0),
  31172. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  31173. this[t + 1] = e >>> 16,
  31174. this[t + 2] = e >>> 8,
  31175. this[t + 3] = 255 & e) : V(this, e, t, !1),
  31176. t + 4
  31177. }
  31178. ,
  31179. a.prototype.writeIntLE = function(e, t, i, n) {
  31180. if (e = +e,
  31181. t |= 0,
  31182. !n) {
  31183. var r = Math.pow(2, 8 * i - 1);
  31184. B(this, e, t, i, r - 1, -r)
  31185. }
  31186. var o = 0
  31187. , a = 1
  31188. , s = 0;
  31189. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  31190. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  31191. this[t + o] = (e / a >> 0) - s & 255;
  31192. return t + i
  31193. }
  31194. ,
  31195. a.prototype.writeIntBE = function(e, t, i, n) {
  31196. if (e = +e,
  31197. t |= 0,
  31198. !n) {
  31199. var r = Math.pow(2, 8 * i - 1);
  31200. B(this, e, t, i, r - 1, -r)
  31201. }
  31202. var o = i - 1
  31203. , a = 1
  31204. , s = 0;
  31205. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  31206. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  31207. this[t + o] = (e / a >> 0) - s & 255;
  31208. return t + i
  31209. }
  31210. ,
  31211. a.prototype.writeInt8 = function(e, t, i) {
  31212. return e = +e,
  31213. t |= 0,
  31214. i || B(this, e, t, 1, 127, -128),
  31215. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  31216. e < 0 && (e = 255 + e + 1),
  31217. this[t] = 255 & e,
  31218. t + 1
  31219. }
  31220. ,
  31221. a.prototype.writeInt16LE = function(e, t, i) {
  31222. return e = +e,
  31223. t |= 0,
  31224. i || B(this, e, t, 2, 32767, -32768),
  31225. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  31226. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  31227. t + 2
  31228. }
  31229. ,
  31230. a.prototype.writeInt16BE = function(e, t, i) {
  31231. return e = +e,
  31232. t |= 0,
  31233. i || B(this, e, t, 2, 32767, -32768),
  31234. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  31235. this[t + 1] = 255 & e) : F(this, e, t, !1),
  31236. t + 2
  31237. }
  31238. ,
  31239. a.prototype.writeInt32LE = function(e, t, i) {
  31240. return e = +e,
  31241. t |= 0,
  31242. i || B(this, e, t, 4, 2147483647, -2147483648),
  31243. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  31244. this[t + 1] = e >>> 8,
  31245. this[t + 2] = e >>> 16,
  31246. this[t + 3] = e >>> 24) : V(this, e, t, !0),
  31247. t + 4
  31248. }
  31249. ,
  31250. a.prototype.writeInt32BE = function(e, t, i) {
  31251. return e = +e,
  31252. t |= 0,
  31253. i || B(this, e, t, 4, 2147483647, -2147483648),
  31254. e < 0 && (e = 4294967295 + e + 1),
  31255. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  31256. this[t + 1] = e >>> 16,
  31257. this[t + 2] = e >>> 8,
  31258. this[t + 3] = 255 & e) : V(this, e, t, !1),
  31259. t + 4
  31260. }
  31261. ,
  31262. a.prototype.writeFloatLE = function(e, t, i) {
  31263. return k(this, e, t, !0, i)
  31264. }
  31265. ,
  31266. a.prototype.writeFloatBE = function(e, t, i) {
  31267. return k(this, e, t, !1, i)
  31268. }
  31269. ,
  31270. a.prototype.writeDoubleLE = function(e, t, i) {
  31271. return H(this, e, t, !0, i)
  31272. }
  31273. ,
  31274. a.prototype.writeDoubleBE = function(e, t, i) {
  31275. return H(this, e, t, !1, i)
  31276. }
  31277. ,
  31278. a.prototype.copy = function(e, t, i, n) {
  31279. if (i || (i = 0),
  31280. n || 0 === n || (n = this.length),
  31281. t >= e.length && (t = e.length),
  31282. t || (t = 0),
  31283. n > 0 && n < i && (n = i),
  31284. n === i)
  31285. return 0;
  31286. if (0 === e.length || 0 === this.length)
  31287. return 0;
  31288. if (t < 0)
  31289. throw new RangeError("targetStart out of bounds");
  31290. if (i < 0 || i >= this.length)
  31291. throw new RangeError("sourceStart out of bounds");
  31292. if (n < 0)
  31293. throw new RangeError("sourceEnd out of bounds");
  31294. n > this.length && (n = this.length),
  31295. e.length - t < n - i && (n = e.length - t + i);
  31296. var r, o = n - i;
  31297. if (this === e && i < t && t < n)
  31298. for (r = o - 1; r >= 0; --r)
  31299. e[r + t] = this[r + i];
  31300. else if (o < 1e3 || !a.TYPED_ARRAY_SUPPORT)
  31301. for (r = 0; r < o; ++r)
  31302. e[r + t] = this[r + i];
  31303. else
  31304. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  31305. return o
  31306. }
  31307. ,
  31308. a.prototype.fill = function(e, t, i, n) {
  31309. if ("string" == typeof e) {
  31310. if ("string" == typeof t ? (n = t,
  31311. t = 0,
  31312. i = this.length) : "string" == typeof i && (n = i,
  31313. i = this.length),
  31314. 1 === e.length) {
  31315. var r = e.charCodeAt(0);
  31316. r < 256 && (e = r)
  31317. }
  31318. if (void 0 !== n && "string" != typeof n)
  31319. throw new TypeError("encoding must be a string");
  31320. if ("string" == typeof n && !a.isEncoding(n))
  31321. throw new TypeError("Unknown encoding: " + n)
  31322. } else
  31323. "number" == typeof e && (e &= 255);
  31324. if (t < 0 || this.length < t || this.length < i)
  31325. throw new RangeError("Out of range index");
  31326. if (i <= t)
  31327. return this;
  31328. t >>>= 0,
  31329. i = void 0 === i ? this.length : i >>> 0,
  31330. e || (e = 0);
  31331. var o;
  31332. if ("number" == typeof e)
  31333. for (o = t; o < i; ++o)
  31334. this[o] = e;
  31335. else {
  31336. var s = a.isBuffer(e) ? e : j(new a(e,n).toString())
  31337. , l = s.length;
  31338. for (o = 0; o < i - t; ++o)
  31339. this[o + t] = s[o % l]
  31340. }
  31341. return this
  31342. }
  31343. ;
  31344. var te = /[^+\/0-9A-Za-z-_]/g
  31345. }
  31346. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  31347. }
  31348. , {
  31349. "base64-js": 199,
  31350. ieee754: 200,
  31351. isarray: 201
  31352. }],
  31353. 199: [function(e, t, i) {
  31354. "use strict";
  31355. function n(e) {
  31356. var t = e.length;
  31357. if (t % 4 > 0)
  31358. throw new Error("Invalid string. Length must be a multiple of 4");
  31359. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  31360. }
  31361. function r(e) {
  31362. return 3 * e.length / 4 - n(e)
  31363. }
  31364. function o(e) {
  31365. var t, i, r, o, a, s, l = e.length;
  31366. a = n(e),
  31367. s = new u(3 * l / 4 - a),
  31368. r = a > 0 ? l - 4 : l;
  31369. var c = 0;
  31370. for (t = 0,
  31371. i = 0; t < r; t += 4,
  31372. i += 3)
  31373. o = h[e.charCodeAt(t)] << 18 | h[e.charCodeAt(t + 1)] << 12 | h[e.charCodeAt(t + 2)] << 6 | h[e.charCodeAt(t + 3)],
  31374. s[c++] = o >> 16 & 255,
  31375. s[c++] = o >> 8 & 255,
  31376. s[c++] = 255 & o;
  31377. return 2 === a ? (o = h[e.charCodeAt(t)] << 2 | h[e.charCodeAt(t + 1)] >> 4,
  31378. s[c++] = 255 & o) : 1 === a && (o = h[e.charCodeAt(t)] << 10 | h[e.charCodeAt(t + 1)] << 4 | h[e.charCodeAt(t + 2)] >> 2,
  31379. s[c++] = o >> 8 & 255,
  31380. s[c++] = 255 & o),
  31381. s
  31382. }
  31383. function a(e) {
  31384. return c[e >> 18 & 63] + c[e >> 12 & 63] + c[e >> 6 & 63] + c[63 & e]
  31385. }
  31386. function s(e, t, i) {
  31387. for (var n, r = [], o = t; o < i; o += 3)
  31388. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  31389. r.push(a(n));
  31390. return r.join("")
  31391. }
  31392. function l(e) {
  31393. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 16383, l = 0, h = i - n; l < h; l += a)
  31394. o.push(s(e, l, l + a > h ? h : l + a));
  31395. return 1 === n ? (t = e[i - 1],
  31396. r += c[t >> 2],
  31397. r += c[t << 4 & 63],
  31398. r += "==") : 2 === n && (t = (e[i - 2] << 8) + e[i - 1],
  31399. r += c[t >> 10],
  31400. r += c[t >> 4 & 63],
  31401. r += c[t << 2 & 63],
  31402. r += "="),
  31403. o.push(r),
  31404. o.join("")
  31405. }
  31406. i.byteLength = r,
  31407. i.toByteArray = o,
  31408. i.fromByteArray = l;
  31409. for (var c = [], h = [], u = "undefined" != typeof Uint8Array ? Uint8Array : Array, d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", p = 0, f = d.length; p < f; ++p)
  31410. c[p] = d[p],
  31411. h[d.charCodeAt(p)] = p;
  31412. h["-".charCodeAt(0)] = 62,
  31413. h["_".charCodeAt(0)] = 63
  31414. }
  31415. , {}],
  31416. 200: [function(e, t, i) {
  31417. i.read = function(e, t, i, n, r) {
  31418. var o, a, s = 8 * r - n - 1, l = (1 << s) - 1, c = l >> 1, h = -7, u = i ? r - 1 : 0, d = i ? -1 : 1, p = e[t + u];
  31419. for (u += d,
  31420. o = p & (1 << -h) - 1,
  31421. p >>= -h,
  31422. h += s; h > 0; o = 256 * o + e[t + u],
  31423. u += d,
  31424. h -= 8)
  31425. ;
  31426. for (a = o & (1 << -h) - 1,
  31427. o >>= -h,
  31428. h += n; h > 0; a = 256 * a + e[t + u],
  31429. u += d,
  31430. h -= 8)
  31431. ;
  31432. if (0 === o)
  31433. o = 1 - c;
  31434. else {
  31435. if (o === l)
  31436. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  31437. a += Math.pow(2, n),
  31438. o -= c
  31439. }
  31440. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  31441. }
  31442. ,
  31443. i.write = function(e, t, i, n, r, o) {
  31444. var a, s, l, c = 8 * o - r - 1, h = (1 << c) - 1, u = h >> 1, d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0, p = n ? 0 : o - 1, f = n ? 1 : -1, g = t < 0 || 0 === t && 1 / t < 0 ? 1 : 0;
  31445. for (t = Math.abs(t),
  31446. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  31447. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  31448. t * (l = Math.pow(2, -a)) < 1 && (a--,
  31449. l *= 2),
  31450. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  31451. t * l >= 2 && (a++,
  31452. l /= 2),
  31453. a + u >= h ? (s = 0,
  31454. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  31455. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  31456. a = 0)); r >= 8; e[i + p] = 255 & s,
  31457. p += f,
  31458. s /= 256,
  31459. r -= 8)
  31460. ;
  31461. for (a = a << r | s,
  31462. c += r; c > 0; e[i + p] = 255 & a,
  31463. p += f,
  31464. a /= 256,
  31465. c -= 8)
  31466. ;
  31467. e[i + p - f] |= 128 * g
  31468. }
  31469. }
  31470. , {}],
  31471. 201: [function(e, t, i) {
  31472. var n = {}.toString;
  31473. t.exports = Array.isArray || function(e) {
  31474. return "[object Array]" == n.call(e)
  31475. }
  31476. }
  31477. , {}],
  31478. 202: [function(e, t, i) {
  31479. function n() {
  31480. this._events = this._events || {},
  31481. this._maxListeners = this._maxListeners || void 0
  31482. }
  31483. function r(e) {
  31484. return "function" == typeof e
  31485. }
  31486. function o(e) {
  31487. return "number" == typeof e
  31488. }
  31489. function a(e) {
  31490. return "object" == typeof e && null !== e
  31491. }
  31492. function s(e) {
  31493. return void 0 === e
  31494. }
  31495. t.exports = n,
  31496. n.EventEmitter = n,
  31497. n.prototype._events = void 0,
  31498. n.prototype._maxListeners = void 0,
  31499. n.defaultMaxListeners = 10,
  31500. n.prototype.setMaxListeners = function(e) {
  31501. if (!o(e) || e < 0 || isNaN(e))
  31502. throw TypeError("n must be a positive number");
  31503. return this._maxListeners = e,
  31504. this
  31505. }
  31506. ,
  31507. n.prototype.emit = function(e) {
  31508. var t, i, n, o, l, c;
  31509. if (this._events || (this._events = {}),
  31510. "error" === e && (!this._events.error || a(this._events.error) && !this._events.error.length)) {
  31511. if (t = arguments[1],
  31512. t instanceof Error)
  31513. throw t;
  31514. var h = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  31515. throw h.context = t,
  31516. h
  31517. }
  31518. if (i = this._events[e],
  31519. s(i))
  31520. return !1;
  31521. if (r(i))
  31522. switch (arguments.length) {
  31523. case 1:
  31524. i.call(this);
  31525. break;
  31526. case 2:
  31527. i.call(this, arguments[1]);
  31528. break;
  31529. case 3:
  31530. i.call(this, arguments[1], arguments[2]);
  31531. break;
  31532. default:
  31533. o = Array.prototype.slice.call(arguments, 1),
  31534. i.apply(this, o)
  31535. }
  31536. else if (a(i))
  31537. for (o = Array.prototype.slice.call(arguments, 1),
  31538. c = i.slice(),
  31539. n = c.length,
  31540. l = 0; l < n; l++)
  31541. c[l].apply(this, o);
  31542. return !0
  31543. }
  31544. ,
  31545. n.prototype.addListener = function(e, t) {
  31546. var i;
  31547. if (!r(t))
  31548. throw TypeError("listener must be a function");
  31549. return this._events || (this._events = {}),
  31550. this._events.newListener && this.emit("newListener", e, r(t.listener) ? t.listener : t),
  31551. this._events[e] ? a(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  31552. a(this._events[e]) && !this._events[e].warned && (i = s(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners,
  31553. i && i > 0 && this._events[e].length > i && (this._events[e].warned = !0,
  31554. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  31555. "function" == typeof console.trace && console.trace())),
  31556. this
  31557. }
  31558. ,
  31559. n.prototype.on = n.prototype.addListener,
  31560. n.prototype.once = function(e, t) {
  31561. function i() {
  31562. this.removeListener(e, i),
  31563. n || (n = !0,
  31564. t.apply(this, arguments))
  31565. }
  31566. if (!r(t))
  31567. throw TypeError("listener must be a function");
  31568. var n = !1;
  31569. return i.listener = t,
  31570. this.on(e, i),
  31571. this
  31572. }
  31573. ,
  31574. n.prototype.removeListener = function(e, t) {
  31575. var i, n, o, s;
  31576. if (!r(t))
  31577. throw TypeError("listener must be a function");
  31578. if (!this._events || !this._events[e])
  31579. return this;
  31580. if (i = this._events[e],
  31581. o = i.length,
  31582. n = -1,
  31583. i === t || r(i.listener) && i.listener === t)
  31584. delete this._events[e],
  31585. this._events.removeListener && this.emit("removeListener", e, t);
  31586. else if (a(i)) {
  31587. for (s = o; s-- > 0; )
  31588. if (i[s] === t || i[s].listener && i[s].listener === t) {
  31589. n = s;
  31590. break
  31591. }
  31592. if (n < 0)
  31593. return this;
  31594. 1 === i.length ? (i.length = 0,
  31595. delete this._events[e]) : i.splice(n, 1),
  31596. this._events.removeListener && this.emit("removeListener", e, t)
  31597. }
  31598. return this
  31599. }
  31600. ,
  31601. n.prototype.removeAllListeners = function(e) {
  31602. var t, i;
  31603. if (!this._events)
  31604. return this;
  31605. if (!this._events.removeListener)
  31606. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  31607. this;
  31608. if (0 === arguments.length) {
  31609. for (t in this._events)
  31610. "removeListener" !== t && this.removeAllListeners(t);
  31611. return this.removeAllListeners("removeListener"),
  31612. this._events = {},
  31613. this
  31614. }
  31615. if (i = this._events[e],
  31616. r(i))
  31617. this.removeListener(e, i);
  31618. else if (i)
  31619. for (; i.length; )
  31620. this.removeListener(e, i[i.length - 1]);
  31621. return delete this._events[e],
  31622. this
  31623. }
  31624. ,
  31625. n.prototype.listeners = function(e) {
  31626. var t;
  31627. return t = this._events && this._events[e] ? r(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  31628. }
  31629. ,
  31630. n.prototype.listenerCount = function(e) {
  31631. if (this._events) {
  31632. var t = this._events[e];
  31633. if (r(t))
  31634. return 1;
  31635. if (t)
  31636. return t.length
  31637. }
  31638. return 0
  31639. }
  31640. ,
  31641. n.listenerCount = function(e, t) {
  31642. return e.listenerCount(t)
  31643. }
  31644. }
  31645. , {}],
  31646. 203: [function(e, t, i) {
  31647. function n() {
  31648. throw new Error("setTimeout has not been defined")
  31649. }
  31650. function r() {
  31651. throw new Error("clearTimeout has not been defined")
  31652. }
  31653. function o(e) {
  31654. if (u === setTimeout)
  31655. return setTimeout(e, 0);
  31656. if ((u === n || !u) && setTimeout)
  31657. return u = setTimeout,
  31658. setTimeout(e, 0);
  31659. try {
  31660. return u(e, 0)
  31661. } catch (t) {
  31662. try {
  31663. return u.call(null, e, 0)
  31664. } catch (t) {
  31665. return u.call(this, e, 0)
  31666. }
  31667. }
  31668. }
  31669. function a(e) {
  31670. if (d === clearTimeout)
  31671. return clearTimeout(e);
  31672. if ((d === r || !d) && clearTimeout)
  31673. return d = clearTimeout,
  31674. clearTimeout(e);
  31675. try {
  31676. return d(e)
  31677. } catch (t) {
  31678. try {
  31679. return d.call(null, e)
  31680. } catch (t) {
  31681. return d.call(this, e)
  31682. }
  31683. }
  31684. }
  31685. function s() {
  31686. m && f && (m = !1,
  31687. f.length ? g = f.concat(g) : v = -1,
  31688. g.length && l())
  31689. }
  31690. function l() {
  31691. if (!m) {
  31692. var e = o(s);
  31693. m = !0;
  31694. for (var t = g.length; t; ) {
  31695. for (f = g,
  31696. g = []; ++v < t; )
  31697. f && f[v].run();
  31698. v = -1,
  31699. t = g.length
  31700. }
  31701. f = null,
  31702. m = !1,
  31703. a(e)
  31704. }
  31705. }
  31706. function c(e, t) {
  31707. this.fun = e,
  31708. this.array = t
  31709. }
  31710. function h() {}
  31711. var u, d, p = t.exports = {};
  31712. !function() {
  31713. try {
  31714. u = "function" == typeof setTimeout ? setTimeout : n
  31715. } catch (e) {
  31716. u = n
  31717. }
  31718. try {
  31719. d = "function" == typeof clearTimeout ? clearTimeout : r
  31720. } catch (e) {
  31721. d = r
  31722. }
  31723. }();
  31724. var f, g = [], m = !1, v = -1;
  31725. p.nextTick = function(e) {
  31726. var t = new Array(arguments.length - 1);
  31727. if (arguments.length > 1)
  31728. for (var i = 1; i < arguments.length; i++)
  31729. t[i - 1] = arguments[i];
  31730. g.push(new c(e,t)),
  31731. 1 !== g.length || m || o(l)
  31732. }
  31733. ,
  31734. c.prototype.run = function() {
  31735. this.fun.apply(null, this.array)
  31736. }
  31737. ,
  31738. p.title = "browser",
  31739. p.browser = !0,
  31740. p.env = {},
  31741. p.argv = [],
  31742. p.version = "",
  31743. p.versions = {},
  31744. p.on = h,
  31745. p.addListener = h,
  31746. p.once = h,
  31747. p.off = h,
  31748. p.removeListener = h,
  31749. p.removeAllListeners = h,
  31750. p.emit = h,
  31751. p.binding = function(e) {
  31752. throw new Error("process.binding is not supported")
  31753. }
  31754. ,
  31755. p.cwd = function() {
  31756. return "/"
  31757. }
  31758. ,
  31759. p.chdir = function(e) {
  31760. throw new Error("process.chdir is not supported")
  31761. }
  31762. ,
  31763. p.umask = function() {
  31764. return 0
  31765. }
  31766. }
  31767. , {}],
  31768. 204: [function(e, t, i) {
  31769. (function(e) {
  31770. !function(n) {
  31771. function r(e) {
  31772. throw new RangeError(L[e])
  31773. }
  31774. function o(e, t) {
  31775. for (var i = e.length, n = []; i--; )
  31776. n[i] = t(e[i]);
  31777. return n
  31778. }
  31779. function a(e, t) {
  31780. var i = e.split("@")
  31781. , n = "";
  31782. i.length > 1 && (n = i[0] + "@",
  31783. e = i[1]),
  31784. e = e.replace(O, ".");
  31785. var r = e.split(".")
  31786. , a = o(r, t).join(".");
  31787. return n + a
  31788. }
  31789. function s(e) {
  31790. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  31791. t = e.charCodeAt(r++),
  31792. t >= 55296 && t <= 56319 && r < o ? (i = e.charCodeAt(r++),
  31793. 56320 == (64512 & i) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t),
  31794. r--)) : n.push(t);
  31795. return n
  31796. }
  31797. function l(e) {
  31798. return o(e, function(e) {
  31799. var t = "";
  31800. return e > 65535 && (e -= 65536,
  31801. t += B(e >>> 10 & 1023 | 55296),
  31802. e = 56320 | 1023 & e),
  31803. t += B(e)
  31804. }).join("")
  31805. }
  31806. function c(e) {
  31807. return e - 48 < 10 ? e - 22 : e - 65 < 26 ? e - 65 : e - 97 < 26 ? e - 97 : E
  31808. }
  31809. function h(e, t) {
  31810. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  31811. }
  31812. function u(e, t, i) {
  31813. var n = 0;
  31814. for (e = i ? N(e / T) : e >> 1,
  31815. e += N(e / t); e > D * w >> 1; n += E)
  31816. e = N(e / D);
  31817. return N(n + (D + 1) * e / (e + _))
  31818. }
  31819. function d(e) {
  31820. var t, i, n, o, a, s, h, d, p, f, g = [], m = e.length, v = 0, A = S, y = x;
  31821. for (i = e.lastIndexOf(M),
  31822. i < 0 && (i = 0),
  31823. n = 0; n < i; ++n)
  31824. e.charCodeAt(n) >= 128 && r("not-basic"),
  31825. g.push(e.charCodeAt(n));
  31826. for (o = i > 0 ? i + 1 : 0; o < m; ) {
  31827. for (a = v,
  31828. s = 1,
  31829. h = E; o >= m && r("invalid-input"),
  31830. d = c(e.charCodeAt(o++)),
  31831. (d >= E || d > N((I - v) / s)) && r("overflow"),
  31832. v += d * s,
  31833. p = h <= y ? b : h >= y + w ? w : h - y,
  31834. !(d < p); h += E)
  31835. f = E - p,
  31836. s > N(I / f) && r("overflow"),
  31837. s *= f;
  31838. t = g.length + 1,
  31839. y = u(v - a, t, 0 == a),
  31840. N(v / t) > I - A && r("overflow"),
  31841. A += N(v / t),
  31842. v %= t,
  31843. g.splice(v++, 0, A)
  31844. }
  31845. return l(g)
  31846. }
  31847. function p(e) {
  31848. var t, i, n, o, a, l, c, d, p, f, g, m, v, A, y, C = [];
  31849. for (e = s(e),
  31850. m = e.length,
  31851. t = S,
  31852. i = 0,
  31853. a = x,
  31854. l = 0; l < m; ++l)
  31855. g = e[l],
  31856. g < 128 && C.push(B(g));
  31857. for (n = o = C.length,
  31858. o && C.push(M); n < m; ) {
  31859. for (c = I,
  31860. l = 0; l < m; ++l)
  31861. g = e[l],
  31862. g >= t && g < c && (c = g);
  31863. for (v = n + 1,
  31864. c - t > N((I - i) / v) && r("overflow"),
  31865. i += (c - t) * v,
  31866. t = c,
  31867. l = 0; l < m; ++l)
  31868. if (g = e[l],
  31869. g < t && ++i > I && r("overflow"),
  31870. g == t) {
  31871. for (d = i,
  31872. p = E; f = p <= a ? b : p >= a + w ? w : p - a,
  31873. !(d < f); p += E)
  31874. y = d - f,
  31875. A = E - f,
  31876. C.push(B(h(f + y % A, 0))),
  31877. d = N(y / A);
  31878. C.push(B(h(d, 0))),
  31879. a = u(i, v, n == o),
  31880. i = 0,
  31881. ++n
  31882. }
  31883. ++i,
  31884. ++t
  31885. }
  31886. return C.join("")
  31887. }
  31888. function f(e) {
  31889. return a(e, function(e) {
  31890. return R.test(e) ? d(e.slice(4).toLowerCase()) : e
  31891. })
  31892. }
  31893. function g(e) {
  31894. return a(e, function(e) {
  31895. return P.test(e) ? "xn--" + p(e) : e
  31896. })
  31897. }
  31898. var m = "object" == typeof i && i && !i.nodeType && i
  31899. , v = "object" == typeof t && t && !t.nodeType && t
  31900. , A = "object" == typeof e && e;
  31901. A.global !== A && A.window !== A && A.self !== A || (n = A);
  31902. var y, C, I = 2147483647, E = 36, b = 1, w = 26, _ = 38, T = 700, x = 72, S = 128, M = "-", R = /^xn--/, P = /[^\x20-\x7E]/, O = /[\x2E\u3002\uFF0E\uFF61]/g, L = {
  31903. overflow: "Overflow: input needs wider integers to process",
  31904. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  31905. "invalid-input": "Invalid input"
  31906. }, D = E - b, N = Math.floor, B = String.fromCharCode;
  31907. if (y = {
  31908. version: "1.4.1",
  31909. ucs2: {
  31910. decode: s,
  31911. encode: l
  31912. },
  31913. decode: d,
  31914. encode: p,
  31915. toASCII: g,
  31916. toUnicode: f
  31917. },
  31918. "function" == typeof define && "object" == typeof define.amd && define.amd)
  31919. define("punycode", function() {
  31920. return y
  31921. });
  31922. else if (m && v)
  31923. if (t.exports == m)
  31924. v.exports = y;
  31925. else
  31926. for (C in y)
  31927. y.hasOwnProperty(C) && (m[C] = y[C]);
  31928. else
  31929. n.punycode = y
  31930. }(this)
  31931. }
  31932. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  31933. }
  31934. , {}],
  31935. 205: [function(e, t, i) {
  31936. "use strict";
  31937. function n(e, t) {
  31938. return Object.prototype.hasOwnProperty.call(e, t)
  31939. }
  31940. t.exports = function(e, t, i, o) {
  31941. t = t || "&",
  31942. i = i || "=";
  31943. var a = {};
  31944. if ("string" != typeof e || 0 === e.length)
  31945. return a;
  31946. var s = /\+/g;
  31947. e = e.split(t);
  31948. var l = 1e3;
  31949. o && "number" == typeof o.maxKeys && (l = o.maxKeys);
  31950. var c = e.length;
  31951. l > 0 && c > l && (c = l);
  31952. for (var h = 0; h < c; ++h) {
  31953. var u, d, p, f, g = e[h].replace(s, "%20"), m = g.indexOf(i);
  31954. m >= 0 ? (u = g.substr(0, m),
  31955. d = g.substr(m + 1)) : (u = g,
  31956. d = ""),
  31957. p = decodeURIComponent(u),
  31958. f = decodeURIComponent(d),
  31959. n(a, p) ? r(a[p]) ? a[p].push(f) : a[p] = [a[p], f] : a[p] = f
  31960. }
  31961. return a
  31962. }
  31963. ;
  31964. var r = Array.isArray || function(e) {
  31965. return "[object Array]" === Object.prototype.toString.call(e)
  31966. }
  31967. }
  31968. , {}],
  31969. 206: [function(e, t, i) {
  31970. "use strict";
  31971. function n(e, t) {
  31972. if (e.map)
  31973. return e.map(t);
  31974. for (var i = [], n = 0; n < e.length; n++)
  31975. i.push(t(e[n], n));
  31976. return i
  31977. }
  31978. var r = function(e) {
  31979. switch (typeof e) {
  31980. case "string":
  31981. return e;
  31982. case "boolean":
  31983. return e ? "true" : "false";
  31984. case "number":
  31985. return isFinite(e) ? e : "";
  31986. default:
  31987. return ""
  31988. }
  31989. };
  31990. t.exports = function(e, t, i, s) {
  31991. return t = t || "&",
  31992. i = i || "=",
  31993. null === e && (e = void 0),
  31994. "object" == typeof e ? n(a(e), function(a) {
  31995. var s = encodeURIComponent(r(a)) + i;
  31996. return o(e[a]) ? n(e[a], function(e) {
  31997. return s + encodeURIComponent(r(e))
  31998. }).join(t) : s + encodeURIComponent(r(e[a]))
  31999. }).join(t) : s ? encodeURIComponent(r(s)) + i + encodeURIComponent(r(e)) : ""
  32000. }
  32001. ;
  32002. var o = Array.isArray || function(e) {
  32003. return "[object Array]" === Object.prototype.toString.call(e)
  32004. }
  32005. , a = Object.keys || function(e) {
  32006. var t = [];
  32007. for (var i in e)
  32008. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  32009. return t
  32010. }
  32011. }
  32012. , {}],
  32013. 207: [function(e, t, i) {
  32014. "use strict";
  32015. i.decode = i.parse = e("./decode"),
  32016. i.encode = i.stringify = e("./encode")
  32017. }
  32018. , {
  32019. "./decode": 205,
  32020. "./encode": 206
  32021. }],
  32022. 208: [function(e, t, i) {
  32023. "use strict";
  32024. function n() {
  32025. this.protocol = null,
  32026. this.slashes = null,
  32027. this.auth = null,
  32028. this.host = null,
  32029. this.port = null,
  32030. this.hostname = null,
  32031. this.hash = null,
  32032. this.search = null,
  32033. this.query = null,
  32034. this.pathname = null,
  32035. this.path = null,
  32036. this.href = null
  32037. }
  32038. function r(e, t, i) {
  32039. if (e && c.isObject(e) && e instanceof n)
  32040. return e;
  32041. var r = new n;
  32042. return r.parse(e, t, i),
  32043. r
  32044. }
  32045. function o(e) {
  32046. return c.isString(e) && (e = r(e)),
  32047. e instanceof n ? e.format() : n.prototype.format.call(e)
  32048. }
  32049. function a(e, t) {
  32050. return r(e, !1, !0).resolve(t)
  32051. }
  32052. function s(e, t) {
  32053. return e ? r(e, !1, !0).resolveObject(t) : t
  32054. }
  32055. var l = e("punycode")
  32056. , c = e("./util");
  32057. i.parse = r,
  32058. i.resolve = a,
  32059. i.resolveObject = s,
  32060. i.format = o,
  32061. i.Url = n;
  32062. var h = /^([a-z0-9.+-]+:)/i
  32063. , u = /:[0-9]*$/
  32064. , d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  32065. , p = ["<", ">", '"', "`", " ", "\r", "\n", "\t"]
  32066. , f = ["{", "}", "|", "\\", "^", "`"].concat(p)
  32067. , g = ["'"].concat(f)
  32068. , m = ["%", "/", "?", ";", "#"].concat(g)
  32069. , v = ["/", "?", "#"]
  32070. , A = 255
  32071. , y = /^[+a-z0-9A-Z_-]{0,63}$/
  32072. , C = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  32073. , I = {
  32074. javascript: !0,
  32075. "javascript:": !0
  32076. }
  32077. , E = {
  32078. javascript: !0,
  32079. "javascript:": !0
  32080. }
  32081. , b = {
  32082. http: !0,
  32083. https: !0,
  32084. ftp: !0,
  32085. gopher: !0,
  32086. file: !0,
  32087. "http:": !0,
  32088. "https:": !0,
  32089. "ftp:": !0,
  32090. "gopher:": !0,
  32091. "file:": !0
  32092. }
  32093. , w = e("querystring");
  32094. n.prototype.parse = function(e, t, i) {
  32095. if (!c.isString(e))
  32096. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  32097. var n = e.indexOf("?")
  32098. , r = n !== -1 && n < e.indexOf("#") ? "?" : "#"
  32099. , o = e.split(r)
  32100. , a = /\\/g;
  32101. o[0] = o[0].replace(a, "/"),
  32102. e = o.join(r);
  32103. var s = e;
  32104. if (s = s.trim(),
  32105. !i && 1 === e.split("#").length) {
  32106. var u = d.exec(s);
  32107. if (u)
  32108. return this.path = s,
  32109. this.href = s,
  32110. this.pathname = u[1],
  32111. u[2] ? (this.search = u[2],
  32112. t ? this.query = w.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : t && (this.search = "",
  32113. this.query = {}),
  32114. this
  32115. }
  32116. var p = h.exec(s);
  32117. if (p) {
  32118. p = p[0];
  32119. var f = p.toLowerCase();
  32120. this.protocol = f,
  32121. s = s.substr(p.length)
  32122. }
  32123. if (i || p || s.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  32124. var _ = "//" === s.substr(0, 2);
  32125. !_ || p && E[p] || (s = s.substr(2),
  32126. this.slashes = !0)
  32127. }
  32128. if (!E[p] && (_ || p && !b[p])) {
  32129. for (var T = -1, x = 0; x < v.length; x++) {
  32130. var S = s.indexOf(v[x]);
  32131. S !== -1 && (T === -1 || S < T) && (T = S)
  32132. }
  32133. var M, R;
  32134. R = T === -1 ? s.lastIndexOf("@") : s.lastIndexOf("@", T),
  32135. R !== -1 && (M = s.slice(0, R),
  32136. s = s.slice(R + 1),
  32137. this.auth = decodeURIComponent(M)),
  32138. T = -1;
  32139. for (var x = 0; x < m.length; x++) {
  32140. var S = s.indexOf(m[x]);
  32141. S !== -1 && (T === -1 || S < T) && (T = S)
  32142. }
  32143. T === -1 && (T = s.length),
  32144. this.host = s.slice(0, T),
  32145. s = s.slice(T),
  32146. this.parseHost(),
  32147. this.hostname = this.hostname || "";
  32148. var P = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  32149. if (!P)
  32150. for (var O = this.hostname.split(/\./), x = 0, L = O.length; x < L; x++) {
  32151. var D = O[x];
  32152. if (D && !D.match(y)) {
  32153. for (var N = "", B = 0, F = D.length; B < F; B++)
  32154. N += D.charCodeAt(B) > 127 ? "x" : D[B];
  32155. if (!N.match(y)) {
  32156. var V = O.slice(0, x)
  32157. , U = O.slice(x + 1)
  32158. , k = D.match(C);
  32159. k && (V.push(k[1]),
  32160. U.unshift(k[2])),
  32161. U.length && (s = "/" + U.join(".") + s),
  32162. this.hostname = V.join(".");
  32163. break
  32164. }
  32165. }
  32166. }
  32167. this.hostname.length > A ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  32168. P || (this.hostname = l.toASCII(this.hostname));
  32169. var H = this.port ? ":" + this.port : ""
  32170. , G = this.hostname || "";
  32171. this.host = G + H,
  32172. this.href += this.host,
  32173. P && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  32174. "/" !== s[0] && (s = "/" + s))
  32175. }
  32176. if (!I[f])
  32177. for (var x = 0, L = g.length; x < L; x++) {
  32178. var z = g[x];
  32179. if (s.indexOf(z) !== -1) {
  32180. var W = encodeURIComponent(z);
  32181. W === z && (W = escape(z)),
  32182. s = s.split(z).join(W)
  32183. }
  32184. }
  32185. var j = s.indexOf("#");
  32186. j !== -1 && (this.hash = s.substr(j),
  32187. s = s.slice(0, j));
  32188. var Y = s.indexOf("?");
  32189. if (Y !== -1 ? (this.search = s.substr(Y),
  32190. this.query = s.substr(Y + 1),
  32191. t && (this.query = w.parse(this.query)),
  32192. s = s.slice(0, Y)) : t && (this.search = "",
  32193. this.query = {}),
  32194. s && (this.pathname = s),
  32195. b[f] && this.hostname && !this.pathname && (this.pathname = "/"),
  32196. this.pathname || this.search) {
  32197. var H = this.pathname || ""
  32198. , X = this.search || "";
  32199. this.path = H + X
  32200. }
  32201. return this.href = this.format(),
  32202. this
  32203. }
  32204. ,
  32205. n.prototype.format = function() {
  32206. var e = this.auth || "";
  32207. e && (e = encodeURIComponent(e),
  32208. e = e.replace(/%3A/i, ":"),
  32209. e += "@");
  32210. var t = this.protocol || ""
  32211. , i = this.pathname || ""
  32212. , n = this.hash || ""
  32213. , r = !1
  32214. , o = "";
  32215. this.host ? r = e + this.host : this.hostname && (r = e + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"),
  32216. this.port && (r += ":" + this.port)),
  32217. this.query && c.isObject(this.query) && Object.keys(this.query).length && (o = w.stringify(this.query));
  32218. var a = this.search || o && "?" + o || "";
  32219. return t && ":" !== t.substr(-1) && (t += ":"),
  32220. this.slashes || (!t || b[t]) && r !== !1 ? (r = "//" + (r || ""),
  32221. i && "/" !== i.charAt(0) && (i = "/" + i)) : r || (r = ""),
  32222. n && "#" !== n.charAt(0) && (n = "#" + n),
  32223. a && "?" !== a.charAt(0) && (a = "?" + a),
  32224. i = i.replace(/[?#]/g, function(e) {
  32225. return encodeURIComponent(e)
  32226. }),
  32227. a = a.replace("#", "%23"),
  32228. t + r + i + a + n
  32229. }
  32230. ,
  32231. n.prototype.resolve = function(e) {
  32232. return this.resolveObject(r(e, !1, !0)).format()
  32233. }
  32234. ,
  32235. n.prototype.resolveObject = function(e) {
  32236. if (c.isString(e)) {
  32237. var t = new n;
  32238. t.parse(e, !1, !0),
  32239. e = t
  32240. }
  32241. for (var i = new n, r = Object.keys(this), o = 0; o < r.length; o++) {
  32242. var a = r[o];
  32243. i[a] = this[a]
  32244. }
  32245. if (i.hash = e.hash,
  32246. "" === e.href)
  32247. return i.href = i.format(),
  32248. i;
  32249. if (e.slashes && !e.protocol) {
  32250. for (var s = Object.keys(e), l = 0; l < s.length; l++) {
  32251. var h = s[l];
  32252. "protocol" !== h && (i[h] = e[h])
  32253. }
  32254. return b[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  32255. i.href = i.format(),
  32256. i
  32257. }
  32258. if (e.protocol && e.protocol !== i.protocol) {
  32259. if (!b[e.protocol]) {
  32260. for (var u = Object.keys(e), d = 0; d < u.length; d++) {
  32261. var p = u[d];
  32262. i[p] = e[p]
  32263. }
  32264. return i.href = i.format(),
  32265. i
  32266. }
  32267. if (i.protocol = e.protocol,
  32268. e.host || E[e.protocol])
  32269. i.pathname = e.pathname;
  32270. else {
  32271. for (var f = (e.pathname || "").split("/"); f.length && !(e.host = f.shift()); )
  32272. ;
  32273. e.host || (e.host = ""),
  32274. e.hostname || (e.hostname = ""),
  32275. "" !== f[0] && f.unshift(""),
  32276. f.length < 2 && f.unshift(""),
  32277. i.pathname = f.join("/")
  32278. }
  32279. if (i.search = e.search,
  32280. i.query = e.query,
  32281. i.host = e.host || "",
  32282. i.auth = e.auth,
  32283. i.hostname = e.hostname || e.host,
  32284. i.port = e.port,
  32285. i.pathname || i.search) {
  32286. var g = i.pathname || ""
  32287. , m = i.search || "";
  32288. i.path = g + m
  32289. }
  32290. return i.slashes = i.slashes || e.slashes,
  32291. i.href = i.format(),
  32292. i
  32293. }
  32294. var v = i.pathname && "/" === i.pathname.charAt(0)
  32295. , A = e.host || e.pathname && "/" === e.pathname.charAt(0)
  32296. , y = A || v || i.host && e.pathname
  32297. , C = y
  32298. , I = i.pathname && i.pathname.split("/") || []
  32299. , f = e.pathname && e.pathname.split("/") || []
  32300. , w = i.protocol && !b[i.protocol];
  32301. if (w && (i.hostname = "",
  32302. i.port = null,
  32303. i.host && ("" === I[0] ? I[0] = i.host : I.unshift(i.host)),
  32304. i.host = "",
  32305. e.protocol && (e.hostname = null,
  32306. e.port = null,
  32307. e.host && ("" === f[0] ? f[0] = e.host : f.unshift(e.host)),
  32308. e.host = null),
  32309. y = y && ("" === f[0] || "" === I[0])),
  32310. A)
  32311. i.host = e.host || "" === e.host ? e.host : i.host,
  32312. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  32313. i.search = e.search,
  32314. i.query = e.query,
  32315. I = f;
  32316. else if (f.length)
  32317. I || (I = []),
  32318. I.pop(),
  32319. I = I.concat(f),
  32320. i.search = e.search,
  32321. i.query = e.query;
  32322. else if (!c.isNullOrUndefined(e.search)) {
  32323. if (w) {
  32324. i.hostname = i.host = I.shift();
  32325. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  32326. _ && (i.auth = _.shift(),
  32327. i.host = i.hostname = _.shift())
  32328. }
  32329. return i.search = e.search,
  32330. i.query = e.query,
  32331. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  32332. i.href = i.format(),
  32333. i
  32334. }
  32335. if (!I.length)
  32336. return i.pathname = null,
  32337. i.search ? i.path = "/" + i.search : i.path = null,
  32338. i.href = i.format(),
  32339. i;
  32340. for (var T = I.slice(-1)[0], x = (i.host || e.host || I.length > 1) && ("." === T || ".." === T) || "" === T, S = 0, M = I.length; M >= 0; M--)
  32341. T = I[M],
  32342. "." === T ? I.splice(M, 1) : ".." === T ? (I.splice(M, 1),
  32343. S++) : S && (I.splice(M, 1),
  32344. S--);
  32345. if (!y && !C)
  32346. for (; S--; S)
  32347. I.unshift("..");
  32348. !y || "" === I[0] || I[0] && "/" === I[0].charAt(0) || I.unshift(""),
  32349. x && "/" !== I.join("/").substr(-1) && I.push("");
  32350. var R = "" === I[0] || I[0] && "/" === I[0].charAt(0);
  32351. if (w) {
  32352. i.hostname = i.host = R ? "" : I.length ? I.shift() : "";
  32353. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  32354. _ && (i.auth = _.shift(),
  32355. i.host = i.hostname = _.shift())
  32356. }
  32357. return y = y || i.host && I.length,
  32358. y && !R && I.unshift(""),
  32359. I.length ? i.pathname = I.join("/") : (i.pathname = null,
  32360. i.path = null),
  32361. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  32362. i.auth = e.auth || i.auth,
  32363. i.slashes = i.slashes || e.slashes,
  32364. i.href = i.format(),
  32365. i
  32366. }
  32367. ,
  32368. n.prototype.parseHost = function() {
  32369. var e = this.host
  32370. , t = u.exec(e);
  32371. t && (t = t[0],
  32372. ":" !== t && (this.port = t.substr(1)),
  32373. e = e.substr(0, e.length - t.length)),
  32374. e && (this.hostname = e)
  32375. }
  32376. }
  32377. , {
  32378. "./util": 209,
  32379. punycode: 204,
  32380. querystring: 207
  32381. }],
  32382. 209: [function(e, t, i) {
  32383. "use strict";
  32384. t.exports = {
  32385. isString: function(e) {
  32386. return "string" == typeof e
  32387. },
  32388. isObject: function(e) {
  32389. return "object" == typeof e && null !== e
  32390. },
  32391. isNull: function(e) {
  32392. return null === e
  32393. },
  32394. isNullOrUndefined: function(e) {
  32395. return null == e
  32396. }
  32397. }
  32398. }
  32399. , {}],
  32400. 210: [function(e, t, i) {
  32401. "use strict";
  32402. function n(e) {
  32403. return l + e
  32404. }
  32405. function r(e) {
  32406. return e.substring(l.length)
  32407. }
  32408. function o(e, t) {
  32409. for (var i in t)
  32410. Object.defineProperty(e, i, {
  32411. value: t[i],
  32412. configurable: !0,
  32413. writable: !0
  32414. })
  32415. }
  32416. function a(e) {
  32417. if ("string" != typeof e)
  32418. throw new TypeError("key must be a string.")
  32419. }
  32420. var s = Object.prototype.hasOwnProperty
  32421. , l = "~";
  32422. t.exports = function(e) {
  32423. var t = Object.create(null)
  32424. , i = 0
  32425. , l = {};
  32426. return o(l, {
  32427. get: function(e, i) {
  32428. a(e);
  32429. var r = n(e);
  32430. return r in t ? t[r] : i
  32431. },
  32432. set: function(e, r) {
  32433. a(e);
  32434. var o = n(e);
  32435. return o in t || ++i,
  32436. t[o] = r
  32437. },
  32438. has: function(e) {
  32439. return a(e),
  32440. n(e)in t
  32441. },
  32442. delete: function(e) {
  32443. a(e);
  32444. var r = n(e);
  32445. return r in t && (--i,
  32446. delete t[r],
  32447. !0)
  32448. },
  32449. clear: function() {
  32450. t = Object.create(null),
  32451. i = 0
  32452. },
  32453. forEach: function(e, i) {
  32454. if ("function" != typeof e)
  32455. throw new TypeError("`callback` must be a function");
  32456. for (var n in t)
  32457. if (s.call(t, n)) {
  32458. var o = r(n)
  32459. , a = t[n];
  32460. e.call(i, a, o, l)
  32461. }
  32462. }
  32463. }),
  32464. Object.defineProperty(l, "size", {
  32465. get: function() {
  32466. return i
  32467. },
  32468. configurable: !0
  32469. }),
  32470. "object" == typeof e && null !== e && Object.keys(e).forEach(function(t) {
  32471. l.set(t, e[t])
  32472. }),
  32473. l
  32474. }
  32475. }
  32476. , {}],
  32477. 211: [function(e, t, i) {
  32478. t.exports = e("./lib/heap")
  32479. }
  32480. , {
  32481. "./lib/heap": 212
  32482. }],
  32483. 212: [function(e, t, i) {
  32484. (function() {
  32485. var e, n, r, o, a, s, l, c, h, u, d, p, f, g, m;
  32486. r = Math.floor,
  32487. u = Math.min,
  32488. n = function(e, t) {
  32489. return e < t ? -1 : e > t ? 1 : 0
  32490. }
  32491. ,
  32492. h = function(e, t, i, o, a) {
  32493. var s;
  32494. if (null == i && (i = 0),
  32495. null == a && (a = n),
  32496. i < 0)
  32497. throw new Error("lo must be non-negative");
  32498. for (null == o && (o = e.length); i < o; )
  32499. s = r((i + o) / 2),
  32500. a(t, e[s]) < 0 ? o = s : i = s + 1;
  32501. return [].splice.apply(e, [i, i - i].concat(t)),
  32502. t
  32503. }
  32504. ,
  32505. s = function(e, t, i) {
  32506. return null == i && (i = n),
  32507. e.push(t),
  32508. g(e, 0, e.length - 1, i)
  32509. }
  32510. ,
  32511. a = function(e, t) {
  32512. var i, r;
  32513. return null == t && (t = n),
  32514. i = e.pop(),
  32515. e.length ? (r = e[0],
  32516. e[0] = i,
  32517. m(e, 0, t)) : r = i,
  32518. r
  32519. }
  32520. ,
  32521. c = function(e, t, i) {
  32522. var r;
  32523. return null == i && (i = n),
  32524. r = e[0],
  32525. e[0] = t,
  32526. m(e, 0, i),
  32527. r
  32528. }
  32529. ,
  32530. l = function(e, t, i) {
  32531. var r;
  32532. return null == i && (i = n),
  32533. e.length && i(e[0], t) < 0 && (r = [e[0], t],
  32534. t = r[0],
  32535. e[0] = r[1],
  32536. m(e, 0, i)),
  32537. t
  32538. }
  32539. ,
  32540. o = function(e, t) {
  32541. var i, o, a, s, l, c;
  32542. for (null == t && (t = n),
  32543. s = function() {
  32544. c = [];
  32545. for (var t = 0, i = r(e.length / 2); 0 <= i ? t < i : t > i; 0 <= i ? t++ : t--)
  32546. c.push(t);
  32547. return c
  32548. }
  32549. .apply(this).reverse(),
  32550. l = [],
  32551. o = 0,
  32552. a = s.length; o < a; o++)
  32553. i = s[o],
  32554. l.push(m(e, i, t));
  32555. return l
  32556. }
  32557. ,
  32558. f = function(e, t, i) {
  32559. var r;
  32560. if (null == i && (i = n),
  32561. r = e.indexOf(t),
  32562. r !== -1)
  32563. return g(e, 0, r, i),
  32564. m(e, r, i)
  32565. }
  32566. ,
  32567. d = function(e, t, i) {
  32568. var r, a, s, c, h;
  32569. if (null == i && (i = n),
  32570. a = e.slice(0, t),
  32571. !a.length)
  32572. return a;
  32573. for (o(a, i),
  32574. h = e.slice(t),
  32575. s = 0,
  32576. c = h.length; s < c; s++)
  32577. r = h[s],
  32578. l(a, r, i);
  32579. return a.sort(i).reverse()
  32580. }
  32581. ,
  32582. p = function(e, t, i) {
  32583. var r, s, l, c, d, p, f, g, m, v;
  32584. if (null == i && (i = n),
  32585. 10 * t <= e.length) {
  32586. if (c = e.slice(0, t).sort(i),
  32587. !c.length)
  32588. return c;
  32589. for (l = c[c.length - 1],
  32590. g = e.slice(t),
  32591. d = 0,
  32592. f = g.length; d < f; d++)
  32593. r = g[d],
  32594. i(r, l) < 0 && (h(c, r, 0, null, i),
  32595. c.pop(),
  32596. l = c[c.length - 1]);
  32597. return c
  32598. }
  32599. for (o(e, i),
  32600. v = [],
  32601. s = p = 0,
  32602. m = u(t, e.length); 0 <= m ? p < m : p > m; s = 0 <= m ? ++p : --p)
  32603. v.push(a(e, i));
  32604. return v
  32605. }
  32606. ,
  32607. g = function(e, t, i, r) {
  32608. var o, a, s;
  32609. for (null == r && (r = n),
  32610. o = e[i]; i > t && (s = i - 1 >> 1,
  32611. a = e[s],
  32612. r(o, a) < 0); )
  32613. e[i] = a,
  32614. i = s;
  32615. return e[i] = o
  32616. }
  32617. ,
  32618. m = function(e, t, i) {
  32619. var r, o, a, s, l;
  32620. for (null == i && (i = n),
  32621. o = e.length,
  32622. l = t,
  32623. a = e[t],
  32624. r = 2 * t + 1; r < o; )
  32625. s = r + 1,
  32626. s < o && !(i(e[r], e[s]) < 0) && (r = s),
  32627. e[t] = e[r],
  32628. t = r,
  32629. r = 2 * t + 1;
  32630. return e[t] = a,
  32631. g(e, l, t, i)
  32632. }
  32633. ,
  32634. e = function() {
  32635. function e(e) {
  32636. this.cmp = null != e ? e : n,
  32637. this.nodes = []
  32638. }
  32639. return e.push = s,
  32640. e.pop = a,
  32641. e.replace = c,
  32642. e.pushpop = l,
  32643. e.heapify = o,
  32644. e.updateItem = f,
  32645. e.nlargest = d,
  32646. e.nsmallest = p,
  32647. e.prototype.push = function(e) {
  32648. return s(this.nodes, e, this.cmp)
  32649. }
  32650. ,
  32651. e.prototype.pop = function() {
  32652. return a(this.nodes, this.cmp)
  32653. }
  32654. ,
  32655. e.prototype.peek = function() {
  32656. return this.nodes[0]
  32657. }
  32658. ,
  32659. e.prototype.contains = function(e) {
  32660. return this.nodes.indexOf(e) !== -1
  32661. }
  32662. ,
  32663. e.prototype.replace = function(e) {
  32664. return c(this.nodes, e, this.cmp)
  32665. }
  32666. ,
  32667. e.prototype.pushpop = function(e) {
  32668. return l(this.nodes, e, this.cmp)
  32669. }
  32670. ,
  32671. e.prototype.heapify = function() {
  32672. return o(this.nodes, this.cmp)
  32673. }
  32674. ,
  32675. e.prototype.updateItem = function(e) {
  32676. return f(this.nodes, e, this.cmp)
  32677. }
  32678. ,
  32679. e.prototype.clear = function() {
  32680. return this.nodes = []
  32681. }
  32682. ,
  32683. e.prototype.empty = function() {
  32684. return 0 === this.nodes.length
  32685. }
  32686. ,
  32687. e.prototype.size = function() {
  32688. return this.nodes.length
  32689. }
  32690. ,
  32691. e.prototype.clone = function() {
  32692. var t;
  32693. return t = new e,
  32694. t.nodes = this.nodes.slice(0),
  32695. t
  32696. }
  32697. ,
  32698. e.prototype.toArray = function() {
  32699. return this.nodes.slice(0)
  32700. }
  32701. ,
  32702. e.prototype.insert = e.prototype.push,
  32703. e.prototype.top = e.prototype.peek,
  32704. e.prototype.front = e.prototype.peek,
  32705. e.prototype.has = e.prototype.contains,
  32706. e.prototype.copy = e.prototype.clone,
  32707. e
  32708. }(),
  32709. function(e, n) {
  32710. return "function" == typeof define && define.amd ? define([], n) : "object" == typeof i ? t.exports = n() : e.Heap = n()
  32711. }(this, function() {
  32712. return e
  32713. })
  32714. }
  32715. ).call(this)
  32716. }
  32717. , {}],
  32718. 213: [function(e, t, i) {
  32719. !function(e) {
  32720. function i() {}
  32721. function n(e, t) {
  32722. return function() {
  32723. e.apply(t, arguments)
  32724. }
  32725. }
  32726. function r(e) {
  32727. if ("object" != typeof this)
  32728. throw new TypeError("Promises must be constructed via new");
  32729. if ("function" != typeof e)
  32730. throw new TypeError("not a function");
  32731. this._state = 0,
  32732. this._handled = !1,
  32733. this._value = void 0,
  32734. this._deferreds = [],
  32735. h(e, this)
  32736. }
  32737. function o(e, t) {
  32738. for (; 3 === e._state; )
  32739. e = e._value;
  32740. return 0 === e._state ? void e._deferreds.push(t) : (e._handled = !0,
  32741. void r._immediateFn(function() {
  32742. var i = 1 === e._state ? t.onFulfilled : t.onRejected;
  32743. if (null === i)
  32744. return void (1 === e._state ? a : s)(t.promise, e._value);
  32745. var n;
  32746. try {
  32747. n = i(e._value)
  32748. } catch (e) {
  32749. return void s(t.promise, e)
  32750. }
  32751. a(t.promise, n)
  32752. }))
  32753. }
  32754. function a(e, t) {
  32755. try {
  32756. if (t === e)
  32757. throw new TypeError("A promise cannot be resolved with itself.");
  32758. if (t && ("object" == typeof t || "function" == typeof t)) {
  32759. var i = t.then;
  32760. if (t instanceof r)
  32761. return e._state = 3,
  32762. e._value = t,
  32763. void l(e);
  32764. if ("function" == typeof i)
  32765. return void h(n(i, t), e)
  32766. }
  32767. e._state = 1,
  32768. e._value = t,
  32769. l(e)
  32770. } catch (t) {
  32771. s(e, t)
  32772. }
  32773. }
  32774. function s(e, t) {
  32775. e._state = 2,
  32776. e._value = t,
  32777. l(e)
  32778. }
  32779. function l(e) {
  32780. 2 === e._state && 0 === e._deferreds.length && r._immediateFn(function() {
  32781. e._handled || r._unhandledRejectionFn(e._value)
  32782. });
  32783. for (var t = 0, i = e._deferreds.length; t < i; t++)
  32784. o(e, e._deferreds[t]);
  32785. e._deferreds = null
  32786. }
  32787. function c(e, t, i) {
  32788. this.onFulfilled = "function" == typeof e ? e : null,
  32789. this.onRejected = "function" == typeof t ? t : null,
  32790. this.promise = i
  32791. }
  32792. function h(e, t) {
  32793. var i = !1;
  32794. try {
  32795. e(function(e) {
  32796. i || (i = !0,
  32797. a(t, e))
  32798. }, function(e) {
  32799. i || (i = !0,
  32800. s(t, e))
  32801. })
  32802. } catch (e) {
  32803. if (i)
  32804. return;
  32805. i = !0,
  32806. s(t, e)
  32807. }
  32808. }
  32809. var u = setTimeout;
  32810. r.prototype.catch = function(e) {
  32811. return this.then(null, e)
  32812. }
  32813. ,
  32814. r.prototype.then = function(e, t) {
  32815. var n = new this.constructor(i);
  32816. return o(this, new c(e,t,n)),
  32817. n
  32818. }
  32819. ,
  32820. r.all = function(e) {
  32821. var t = Array.prototype.slice.call(e);
  32822. return new r(function(e, i) {
  32823. function n(o, a) {
  32824. try {
  32825. if (a && ("object" == typeof a || "function" == typeof a)) {
  32826. var s = a.then;
  32827. if ("function" == typeof s)
  32828. return void s.call(a, function(e) {
  32829. n(o, e)
  32830. }, i)
  32831. }
  32832. t[o] = a,
  32833. 0 === --r && e(t)
  32834. } catch (e) {
  32835. i(e)
  32836. }
  32837. }
  32838. if (0 === t.length)
  32839. return e([]);
  32840. for (var r = t.length, o = 0; o < t.length; o++)
  32841. n(o, t[o])
  32842. }
  32843. )
  32844. }
  32845. ,
  32846. r.resolve = function(e) {
  32847. return e && "object" == typeof e && e.constructor === r ? e : new r(function(t) {
  32848. t(e)
  32849. }
  32850. )
  32851. }
  32852. ,
  32853. r.reject = function(e) {
  32854. return new r(function(t, i) {
  32855. i(e)
  32856. }
  32857. )
  32858. }
  32859. ,
  32860. r.race = function(e) {
  32861. return new r(function(t, i) {
  32862. for (var n = 0, r = e.length; n < r; n++)
  32863. e[n].then(t, i)
  32864. }
  32865. )
  32866. }
  32867. ,
  32868. r._immediateFn = "function" == typeof setImmediate && function(e) {
  32869. setImmediate(e)
  32870. }
  32871. || function(e) {
  32872. u(e, 0)
  32873. }
  32874. ,
  32875. r._unhandledRejectionFn = function(e) {
  32876. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  32877. }
  32878. ,
  32879. r._setImmediateFn = function(e) {
  32880. r._immediateFn = e
  32881. }
  32882. ,
  32883. r._setUnhandledRejectionFn = function(e) {
  32884. r._unhandledRejectionFn = e
  32885. }
  32886. ,
  32887. "undefined" != typeof t && t.exports ? t.exports = r : e.Promise || (e.Promise = r)
  32888. }(this)
  32889. }
  32890. , {}],
  32891. 214: [function(e, t, i) {
  32892. (function(i) {
  32893. !function(i, n) {
  32894. "function" == typeof define && define.amd ? define(["bytebuffer"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = n(e("bytebuffer"), !0) : (i.dcodeIO = i.dcodeIO || {}).ProtoBuf = n(i.dcodeIO.ByteBuffer)
  32895. }(this, function(t, n) {
  32896. "use strict";
  32897. var r = {};
  32898. return r.ByteBuffer = t,
  32899. r.Long = t.Long || null,
  32900. r.VERSION = "5.0.1",
  32901. r.WIRE_TYPES = {},
  32902. r.WIRE_TYPES.VARINT = 0,
  32903. r.WIRE_TYPES.BITS64 = 1,
  32904. r.WIRE_TYPES.LDELIM = 2,
  32905. r.WIRE_TYPES.STARTGROUP = 3,
  32906. r.WIRE_TYPES.ENDGROUP = 4,
  32907. r.WIRE_TYPES.BITS32 = 5,
  32908. r.PACKABLE_WIRE_TYPES = [r.WIRE_TYPES.VARINT, r.WIRE_TYPES.BITS64, r.WIRE_TYPES.BITS32],
  32909. r.TYPES = {
  32910. int32: {
  32911. name: "int32",
  32912. wireType: r.WIRE_TYPES.VARINT,
  32913. defaultValue: 0
  32914. },
  32915. uint32: {
  32916. name: "uint32",
  32917. wireType: r.WIRE_TYPES.VARINT,
  32918. defaultValue: 0
  32919. },
  32920. sint32: {
  32921. name: "sint32",
  32922. wireType: r.WIRE_TYPES.VARINT,
  32923. defaultValue: 0
  32924. },
  32925. int64: {
  32926. name: "int64",
  32927. wireType: r.WIRE_TYPES.VARINT,
  32928. defaultValue: r.Long ? r.Long.ZERO : void 0
  32929. },
  32930. uint64: {
  32931. name: "uint64",
  32932. wireType: r.WIRE_TYPES.VARINT,
  32933. defaultValue: r.Long ? r.Long.UZERO : void 0
  32934. },
  32935. sint64: {
  32936. name: "sint64",
  32937. wireType: r.WIRE_TYPES.VARINT,
  32938. defaultValue: r.Long ? r.Long.ZERO : void 0
  32939. },
  32940. bool: {
  32941. name: "bool",
  32942. wireType: r.WIRE_TYPES.VARINT,
  32943. defaultValue: !1
  32944. },
  32945. double: {
  32946. name: "double",
  32947. wireType: r.WIRE_TYPES.BITS64,
  32948. defaultValue: 0
  32949. },
  32950. string: {
  32951. name: "string",
  32952. wireType: r.WIRE_TYPES.LDELIM,
  32953. defaultValue: ""
  32954. },
  32955. bytes: {
  32956. name: "bytes",
  32957. wireType: r.WIRE_TYPES.LDELIM,
  32958. defaultValue: null
  32959. },
  32960. fixed32: {
  32961. name: "fixed32",
  32962. wireType: r.WIRE_TYPES.BITS32,
  32963. defaultValue: 0
  32964. },
  32965. sfixed32: {
  32966. name: "sfixed32",
  32967. wireType: r.WIRE_TYPES.BITS32,
  32968. defaultValue: 0
  32969. },
  32970. fixed64: {
  32971. name: "fixed64",
  32972. wireType: r.WIRE_TYPES.BITS64,
  32973. defaultValue: r.Long ? r.Long.UZERO : void 0
  32974. },
  32975. sfixed64: {
  32976. name: "sfixed64",
  32977. wireType: r.WIRE_TYPES.BITS64,
  32978. defaultValue: r.Long ? r.Long.ZERO : void 0
  32979. },
  32980. float: {
  32981. name: "float",
  32982. wireType: r.WIRE_TYPES.BITS32,
  32983. defaultValue: 0
  32984. },
  32985. enum: {
  32986. name: "enum",
  32987. wireType: r.WIRE_TYPES.VARINT,
  32988. defaultValue: 0
  32989. },
  32990. message: {
  32991. name: "message",
  32992. wireType: r.WIRE_TYPES.LDELIM,
  32993. defaultValue: null
  32994. },
  32995. group: {
  32996. name: "group",
  32997. wireType: r.WIRE_TYPES.STARTGROUP,
  32998. defaultValue: null
  32999. }
  33000. },
  33001. r.MAP_KEY_TYPES = [r.TYPES.int32, r.TYPES.sint32, r.TYPES.sfixed32, r.TYPES.uint32, r.TYPES.fixed32, r.TYPES.int64, r.TYPES.sint64, r.TYPES.sfixed64, r.TYPES.uint64, r.TYPES.fixed64, r.TYPES.bool, r.TYPES.string, r.TYPES.bytes],
  33002. r.ID_MIN = 1,
  33003. r.ID_MAX = 536870911,
  33004. r.convertFieldsToCamelCase = !1,
  33005. r.populateAccessors = !0,
  33006. r.populateDefaults = !0,
  33007. r.Util = function() {
  33008. var t = {};
  33009. return t.IS_NODE = !("object" != typeof i || i + "" != "[object process]" || i.browser),
  33010. t.XHR = function() {
  33011. for (var e = [function() {
  33012. return new XMLHttpRequest
  33013. }
  33014. , function() {
  33015. return new ActiveXObject("Msxml2.XMLHTTP")
  33016. }
  33017. , function() {
  33018. return new ActiveXObject("Msxml3.XMLHTTP")
  33019. }
  33020. , function() {
  33021. return new ActiveXObject("Microsoft.XMLHTTP")
  33022. }
  33023. ], t = null, i = 0; i < e.length; i++) {
  33024. try {
  33025. t = e[i]()
  33026. } catch (e) {
  33027. continue
  33028. }
  33029. break
  33030. }
  33031. if (!t)
  33032. throw Error("XMLHttpRequest is not supported");
  33033. return t
  33034. }
  33035. ,
  33036. t.fetch = function(i, n) {
  33037. if (n && "function" != typeof n && (n = null),
  33038. t.IS_NODE) {
  33039. var r = e("fs");
  33040. if (n)
  33041. r.readFile(i, function(e, t) {
  33042. n(e ? null : "" + t)
  33043. });
  33044. else
  33045. try {
  33046. return r.readFileSync(i)
  33047. } catch (e) {
  33048. return null
  33049. }
  33050. } else {
  33051. var o = t.XHR();
  33052. if (o.open("GET", i, !!n),
  33053. o.setRequestHeader("Accept", "text/plain"),
  33054. "function" == typeof o.overrideMimeType && o.overrideMimeType("text/plain"),
  33055. !n)
  33056. return o.send(null),
  33057. 200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null;
  33058. if (o.onreadystatechange = function() {
  33059. 4 == o.readyState && n(200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null)
  33060. }
  33061. ,
  33062. 4 == o.readyState)
  33063. return;
  33064. o.send(null)
  33065. }
  33066. }
  33067. ,
  33068. t.toCamelCase = function(e) {
  33069. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  33070. return t.toUpperCase()
  33071. })
  33072. }
  33073. ,
  33074. t
  33075. }(),
  33076. r.Lang = {
  33077. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  33078. RULE: /^(?:required|optional|repeated|map)$/,
  33079. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  33080. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  33081. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  33082. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  33083. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  33084. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  33085. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  33086. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  33087. NUMBER_OCT: /^0[0-7]+$/,
  33088. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  33089. BOOL: /^(?:true|false)$/i,
  33090. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  33091. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  33092. WHITESPACE: /\s/,
  33093. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  33094. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  33095. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  33096. },
  33097. r.DotProto = function(e, t) {
  33098. function i(e, i) {
  33099. var n = -1
  33100. , r = 1;
  33101. if ("-" == e.charAt(0) && (r = -1,
  33102. e = e.substring(1)),
  33103. t.NUMBER_DEC.test(e))
  33104. n = parseInt(e);
  33105. else if (t.NUMBER_HEX.test(e))
  33106. n = parseInt(e.substring(2), 16);
  33107. else {
  33108. if (!t.NUMBER_OCT.test(e))
  33109. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  33110. n = parseInt(e.substring(1), 8)
  33111. }
  33112. if (n = r * n | 0,
  33113. !i && n < 0)
  33114. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  33115. return n
  33116. }
  33117. function n(e) {
  33118. var i = 1;
  33119. if ("-" == e.charAt(0) && (i = -1,
  33120. e = e.substring(1)),
  33121. t.NUMBER_DEC.test(e))
  33122. return i * parseInt(e, 10);
  33123. if (t.NUMBER_HEX.test(e))
  33124. return i * parseInt(e.substring(2), 16);
  33125. if (t.NUMBER_OCT.test(e))
  33126. return i * parseInt(e.substring(1), 8);
  33127. if ("inf" === e)
  33128. return i * (1 / 0);
  33129. if ("nan" === e)
  33130. return NaN;
  33131. if (t.NUMBER_FLT.test(e))
  33132. return i * parseFloat(e);
  33133. throw Error("illegal number value: " + (i < 0 ? "-" : "") + e)
  33134. }
  33135. function r(e, t, i) {
  33136. "undefined" == typeof e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  33137. e[t].push(i))
  33138. }
  33139. var o = {}
  33140. , a = function(e) {
  33141. this.source = e + "",
  33142. this.index = 0,
  33143. this.line = 1,
  33144. this.stack = [],
  33145. this._stringOpen = null
  33146. }
  33147. , s = a.prototype;
  33148. s._readString = function() {
  33149. var e = '"' === this._stringOpen ? t.STRING_DQ : t.STRING_SQ;
  33150. e.lastIndex = this.index - 1;
  33151. var i = e.exec(this.source);
  33152. if (!i)
  33153. throw Error("unterminated string");
  33154. return this.index = e.lastIndex,
  33155. this.stack.push(this._stringOpen),
  33156. this._stringOpen = null,
  33157. i[1]
  33158. }
  33159. ,
  33160. s.next = function() {
  33161. if (this.stack.length > 0)
  33162. return this.stack.shift();
  33163. if (this.index >= this.source.length)
  33164. return null;
  33165. if (null !== this._stringOpen)
  33166. return this._readString();
  33167. var e, i, n;
  33168. do {
  33169. for (e = !1; t.WHITESPACE.test(n = this.source.charAt(this.index)); )
  33170. if ("\n" === n && ++this.line,
  33171. ++this.index === this.source.length)
  33172. return null;
  33173. if ("/" === this.source.charAt(this.index))
  33174. if (++this.index,
  33175. "/" === this.source.charAt(this.index)) {
  33176. for (; "\n" !== this.source.charAt(++this.index); )
  33177. if (this.index == this.source.length)
  33178. return null;
  33179. ++this.index,
  33180. ++this.line,
  33181. e = !0
  33182. } else {
  33183. if ("*" !== (n = this.source.charAt(this.index)))
  33184. return "/";
  33185. do {
  33186. if ("\n" === n && ++this.line,
  33187. ++this.index === this.source.length)
  33188. return null;
  33189. i = n,
  33190. n = this.source.charAt(this.index)
  33191. } while ("*" !== i || "/" !== n);++this.index,
  33192. e = !0
  33193. }
  33194. } while (e);if (this.index === this.source.length)
  33195. return null;
  33196. var r = this.index;
  33197. t.DELIM.lastIndex = 0;
  33198. var o = t.DELIM.test(this.source.charAt(r++));
  33199. if (!o)
  33200. for (; r < this.source.length && !t.DELIM.test(this.source.charAt(r)); )
  33201. ++r;
  33202. var a = this.source.substring(this.index, this.index = r);
  33203. return '"' !== a && "'" !== a || (this._stringOpen = a),
  33204. a
  33205. }
  33206. ,
  33207. s.peek = function() {
  33208. if (0 === this.stack.length) {
  33209. var e = this.next();
  33210. if (null === e)
  33211. return null;
  33212. this.stack.push(e)
  33213. }
  33214. return this.stack[0]
  33215. }
  33216. ,
  33217. s.skip = function(e) {
  33218. var t = this.next();
  33219. if (t !== e)
  33220. throw Error("illegal '" + t + "', '" + e + "' expected")
  33221. }
  33222. ,
  33223. s.omit = function(e) {
  33224. return this.peek() === e && (this.next(),
  33225. !0)
  33226. }
  33227. ,
  33228. s.toString = function() {
  33229. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  33230. }
  33231. ,
  33232. o.Tokenizer = a;
  33233. var l = function(e) {
  33234. this.tn = new a(e),
  33235. this.proto3 = !1
  33236. }
  33237. , c = l.prototype;
  33238. return c.parse = function() {
  33239. var e, i, n = {
  33240. name: "[ROOT]",
  33241. package: null,
  33242. messages: [],
  33243. enums: [],
  33244. imports: [],
  33245. options: {},
  33246. services: []
  33247. }, r = !0;
  33248. try {
  33249. for (; e = this.tn.next(); )
  33250. switch (e) {
  33251. case "package":
  33252. if (!r || null !== n.package)
  33253. throw Error("unexpected 'package'");
  33254. if (e = this.tn.next(),
  33255. !t.TYPEREF.test(e))
  33256. throw Error("illegal package name: " + e);
  33257. this.tn.skip(";"),
  33258. n.package = e;
  33259. break;
  33260. case "import":
  33261. if (!r)
  33262. throw Error("unexpected 'import'");
  33263. e = this.tn.peek(),
  33264. ("public" === e || (i = "weak" === e)) && this.tn.next(),
  33265. e = this._readString(),
  33266. this.tn.skip(";"),
  33267. i || n.imports.push(e);
  33268. break;
  33269. case "syntax":
  33270. if (!r)
  33271. throw Error("unexpected 'syntax'");
  33272. this.tn.skip("="),
  33273. "proto3" === (n.syntax = this._readString()) && (this.proto3 = !0),
  33274. this.tn.skip(";");
  33275. break;
  33276. case "message":
  33277. this._parseMessage(n, null),
  33278. r = !1;
  33279. break;
  33280. case "enum":
  33281. this._parseEnum(n),
  33282. r = !1;
  33283. break;
  33284. case "option":
  33285. this._parseOption(n);
  33286. break;
  33287. case "service":
  33288. this._parseService(n);
  33289. break;
  33290. case "extend":
  33291. this._parseExtend(n);
  33292. break;
  33293. default:
  33294. throw Error("unexpected '" + e + "'")
  33295. }
  33296. } catch (e) {
  33297. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  33298. e
  33299. }
  33300. return delete n.name,
  33301. n
  33302. }
  33303. ,
  33304. l.parse = function(e) {
  33305. return new l(e).parse()
  33306. }
  33307. ,
  33308. c._readString = function() {
  33309. var e, t, i = "";
  33310. do {
  33311. if (t = this.tn.next(),
  33312. "'" !== t && '"' !== t)
  33313. throw Error("illegal string delimiter: " + t);
  33314. i += this.tn.next(),
  33315. this.tn.skip(t),
  33316. e = this.tn.peek()
  33317. } while ('"' === e || '"' === e);return i
  33318. }
  33319. ,
  33320. c._readValue = function(e) {
  33321. var i = this.tn.peek();
  33322. if ('"' === i || "'" === i)
  33323. return this._readString();
  33324. if (this.tn.next(),
  33325. t.NUMBER.test(i))
  33326. return n(i);
  33327. if (t.BOOL.test(i))
  33328. return "true" === i.toLowerCase();
  33329. if (e && t.TYPEREF.test(i))
  33330. return i;
  33331. throw Error("illegal value: " + i)
  33332. }
  33333. ,
  33334. c._parseOption = function(e, i) {
  33335. var n = this.tn.next()
  33336. , r = !1;
  33337. if ("(" === n && (r = !0,
  33338. n = this.tn.next()),
  33339. !t.TYPEREF.test(n))
  33340. throw Error("illegal option name: " + n);
  33341. var o = n;
  33342. r && (this.tn.skip(")"),
  33343. o = "(" + o + ")",
  33344. n = this.tn.peek(),
  33345. t.FQTYPEREF.test(n) && (o += n,
  33346. this.tn.next())),
  33347. this.tn.skip("="),
  33348. this._parseOptionValue(e, o),
  33349. i || this.tn.skip(";")
  33350. }
  33351. ,
  33352. c._parseOptionValue = function(e, i) {
  33353. var n = this.tn.peek();
  33354. if ("{" !== n)
  33355. r(e.options, i, this._readValue(!0));
  33356. else
  33357. for (this.tn.skip("{"); "}" !== (n = this.tn.next()); ) {
  33358. if (!t.NAME.test(n))
  33359. throw Error("illegal option name: " + i + "." + n);
  33360. this.tn.omit(":") ? r(e.options, i + "." + n, this._readValue(!0)) : this._parseOptionValue(e, i + "." + n)
  33361. }
  33362. }
  33363. ,
  33364. c._parseService = function(e) {
  33365. var i = this.tn.next();
  33366. if (!t.NAME.test(i))
  33367. throw Error("illegal service name at line " + this.tn.line + ": " + i);
  33368. var n = i
  33369. , r = {
  33370. name: n,
  33371. rpc: {},
  33372. options: {}
  33373. };
  33374. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  33375. if ("option" === i)
  33376. this._parseOption(r);
  33377. else {
  33378. if ("rpc" !== i)
  33379. throw Error("illegal service token: " + i);
  33380. this._parseServiceRPC(r)
  33381. }
  33382. this.tn.omit(";"),
  33383. e.services.push(r)
  33384. }
  33385. ,
  33386. c._parseServiceRPC = function(e) {
  33387. var i = "rpc"
  33388. , n = this.tn.next();
  33389. if (!t.NAME.test(n))
  33390. throw Error("illegal rpc service method name: " + n);
  33391. var r = n
  33392. , o = {
  33393. request: null,
  33394. response: null,
  33395. request_stream: !1,
  33396. response_stream: !1,
  33397. options: {}
  33398. };
  33399. if (this.tn.skip("("),
  33400. n = this.tn.next(),
  33401. "stream" === n.toLowerCase() && (o.request_stream = !0,
  33402. n = this.tn.next()),
  33403. !t.TYPEREF.test(n))
  33404. throw Error("illegal rpc service request type: " + n);
  33405. if (o.request = n,
  33406. this.tn.skip(")"),
  33407. n = this.tn.next(),
  33408. "returns" !== n.toLowerCase())
  33409. throw Error("illegal rpc service request type delimiter: " + n);
  33410. if (this.tn.skip("("),
  33411. n = this.tn.next(),
  33412. "stream" === n.toLowerCase() && (o.response_stream = !0,
  33413. n = this.tn.next()),
  33414. o.response = n,
  33415. this.tn.skip(")"),
  33416. n = this.tn.peek(),
  33417. "{" === n) {
  33418. for (this.tn.next(); "}" !== (n = this.tn.next()); ) {
  33419. if ("option" !== n)
  33420. throw Error("illegal rpc service token: " + n);
  33421. this._parseOption(o)
  33422. }
  33423. this.tn.omit(";")
  33424. } else
  33425. this.tn.skip(";");
  33426. "undefined" == typeof e[i] && (e[i] = {}),
  33427. e[i][r] = o
  33428. }
  33429. ,
  33430. c._parseMessage = function(e, n) {
  33431. var r = !!n
  33432. , o = this.tn.next()
  33433. , a = {
  33434. name: "",
  33435. fields: [],
  33436. enums: [],
  33437. messages: [],
  33438. options: {},
  33439. services: [],
  33440. oneofs: {}
  33441. };
  33442. if (!t.NAME.test(o))
  33443. throw Error("illegal " + (r ? "group" : "message") + " name: " + o);
  33444. for (a.name = o,
  33445. r && (this.tn.skip("="),
  33446. n.id = i(this.tn.next()),
  33447. a.isGroup = !0),
  33448. o = this.tn.peek(),
  33449. "[" === o && n && this._parseFieldOptions(n),
  33450. this.tn.skip("{"); "}" !== (o = this.tn.next()); )
  33451. if (t.RULE.test(o))
  33452. this._parseMessageField(a, o);
  33453. else if ("oneof" === o)
  33454. this._parseMessageOneOf(a);
  33455. else if ("enum" === o)
  33456. this._parseEnum(a);
  33457. else if ("message" === o)
  33458. this._parseMessage(a);
  33459. else if ("option" === o)
  33460. this._parseOption(a);
  33461. else if ("service" === o)
  33462. this._parseService(a);
  33463. else if ("extensions" === o)
  33464. a.extensions = this._parseExtensionRanges();
  33465. else if ("reserved" === o)
  33466. this._parseIgnored();
  33467. else if ("extend" === o)
  33468. this._parseExtend(a);
  33469. else {
  33470. if (!t.TYPEREF.test(o))
  33471. throw Error("illegal message token: " + o);
  33472. if (!this.proto3)
  33473. throw Error("illegal field rule: " + o);
  33474. this._parseMessageField(a, "optional", o)
  33475. }
  33476. return this.tn.omit(";"),
  33477. e.messages.push(a),
  33478. a
  33479. }
  33480. ,
  33481. c._parseIgnored = function() {
  33482. for (; ";" !== this.tn.peek(); )
  33483. this.tn.next();
  33484. this.tn.skip(";")
  33485. }
  33486. ,
  33487. c._parseMessageField = function(e, n, r) {
  33488. if (!t.RULE.test(n))
  33489. throw Error("illegal message field rule: " + n);
  33490. var o, a = {
  33491. rule: n,
  33492. type: "",
  33493. name: "",
  33494. options: {},
  33495. id: 0
  33496. };
  33497. if ("map" === n) {
  33498. if (r)
  33499. throw Error("illegal type: " + r);
  33500. if (this.tn.skip("<"),
  33501. o = this.tn.next(),
  33502. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  33503. throw Error("illegal message field type: " + o);
  33504. if (a.keytype = o,
  33505. this.tn.skip(","),
  33506. o = this.tn.next(),
  33507. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  33508. throw Error("illegal message field: " + o);
  33509. if (a.type = o,
  33510. this.tn.skip(">"),
  33511. o = this.tn.next(),
  33512. !t.NAME.test(o))
  33513. throw Error("illegal message field name: " + o);
  33514. a.name = o,
  33515. this.tn.skip("="),
  33516. a.id = i(this.tn.next()),
  33517. o = this.tn.peek(),
  33518. "[" === o && this._parseFieldOptions(a),
  33519. this.tn.skip(";")
  33520. } else if (r = "undefined" != typeof r ? r : this.tn.next(),
  33521. "group" === r) {
  33522. var s = this._parseMessage(e, a);
  33523. if (!/^[A-Z]/.test(s.name))
  33524. throw Error("illegal group name: " + s.name);
  33525. a.type = s.name,
  33526. a.name = s.name.toLowerCase(),
  33527. this.tn.omit(";")
  33528. } else {
  33529. if (!t.TYPE.test(r) && !t.TYPEREF.test(r))
  33530. throw Error("illegal message field type: " + r);
  33531. if (a.type = r,
  33532. o = this.tn.next(),
  33533. !t.NAME.test(o))
  33534. throw Error("illegal message field name: " + o);
  33535. a.name = o,
  33536. this.tn.skip("="),
  33537. a.id = i(this.tn.next()),
  33538. o = this.tn.peek(),
  33539. "[" === o && this._parseFieldOptions(a),
  33540. this.tn.skip(";")
  33541. }
  33542. return e.fields.push(a),
  33543. a
  33544. }
  33545. ,
  33546. c._parseMessageOneOf = function(e) {
  33547. var i = this.tn.next();
  33548. if (!t.NAME.test(i))
  33549. throw Error("illegal oneof name: " + i);
  33550. var n, r = i, o = [];
  33551. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  33552. n = this._parseMessageField(e, "optional", i),
  33553. n.oneof = r,
  33554. o.push(n.id);
  33555. this.tn.omit(";"),
  33556. e.oneofs[r] = o
  33557. }
  33558. ,
  33559. c._parseFieldOptions = function(e) {
  33560. this.tn.skip("[");
  33561. for (var t, i = !0; "]" !== (t = this.tn.peek()); )
  33562. i || this.tn.skip(","),
  33563. this._parseOption(e, !0),
  33564. i = !1;
  33565. this.tn.next()
  33566. }
  33567. ,
  33568. c._parseEnum = function(e) {
  33569. var n = {
  33570. name: "",
  33571. values: [],
  33572. options: {}
  33573. }
  33574. , r = this.tn.next();
  33575. if (!t.NAME.test(r))
  33576. throw Error("illegal name: " + r);
  33577. for (n.name = r,
  33578. this.tn.skip("{"); "}" !== (r = this.tn.next()); )
  33579. if ("option" === r)
  33580. this._parseOption(n);
  33581. else {
  33582. if (!t.NAME.test(r))
  33583. throw Error("illegal name: " + r);
  33584. this.tn.skip("=");
  33585. var o = {
  33586. name: r,
  33587. id: i(this.tn.next(), !0)
  33588. };
  33589. r = this.tn.peek(),
  33590. "[" === r && this._parseFieldOptions({
  33591. options: {}
  33592. }),
  33593. this.tn.skip(";"),
  33594. n.values.push(o)
  33595. }
  33596. this.tn.omit(";"),
  33597. e.enums.push(n)
  33598. }
  33599. ,
  33600. c._parseExtensionRanges = function() {
  33601. var t, i, r, o = [];
  33602. do {
  33603. for (i = []; ; ) {
  33604. switch (t = this.tn.next()) {
  33605. case "min":
  33606. r = e.ID_MIN;
  33607. break;
  33608. case "max":
  33609. r = e.ID_MAX;
  33610. break;
  33611. default:
  33612. r = n(t)
  33613. }
  33614. if (i.push(r),
  33615. 2 === i.length)
  33616. break;
  33617. if ("to" !== this.tn.peek()) {
  33618. i.push(r);
  33619. break
  33620. }
  33621. this.tn.next()
  33622. }
  33623. o.push(i)
  33624. } while (this.tn.omit(","));return this.tn.skip(";"),
  33625. o
  33626. }
  33627. ,
  33628. c._parseExtend = function(e) {
  33629. var i = this.tn.next();
  33630. if (!t.TYPEREF.test(i))
  33631. throw Error("illegal extend reference: " + i);
  33632. var n = {
  33633. ref: i,
  33634. fields: []
  33635. };
  33636. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  33637. if (t.RULE.test(i))
  33638. this._parseMessageField(n, i);
  33639. else {
  33640. if (!t.TYPEREF.test(i))
  33641. throw Error("illegal extend token: " + i);
  33642. if (!this.proto3)
  33643. throw Error("illegal field rule: " + i);
  33644. this._parseMessageField(n, "optional", i)
  33645. }
  33646. return this.tn.omit(";"),
  33647. e.messages.push(n),
  33648. n
  33649. }
  33650. ,
  33651. c.toString = function() {
  33652. return "Parser at line " + this.tn.line
  33653. }
  33654. ,
  33655. o.Parser = l,
  33656. o
  33657. }(r, r.Lang),
  33658. r.Reflect = function(e) {
  33659. function i(i) {
  33660. if ("string" == typeof i && (i = e.TYPES[i]),
  33661. "undefined" == typeof i.defaultValue)
  33662. throw Error("default value for type " + i.name + " is not supported");
  33663. return i == e.TYPES.bytes ? new t(0) : i.defaultValue
  33664. }
  33665. function n(t, i) {
  33666. if (t && "number" == typeof t.low && "number" == typeof t.high && "boolean" == typeof t.unsigned && t.low === t.low && t.high === t.high)
  33667. return new e.Long(t.low,t.high,"undefined" == typeof i ? t.unsigned : i);
  33668. if ("string" == typeof t)
  33669. return e.Long.fromString(t, i || !1, 10);
  33670. if ("number" == typeof t)
  33671. return e.Long.fromNumber(t, i || !1);
  33672. throw Error("not convertible to Long")
  33673. }
  33674. function r(t, i) {
  33675. var n = i.readVarint32()
  33676. , o = 7 & n
  33677. , a = n >>> 3;
  33678. switch (o) {
  33679. case e.WIRE_TYPES.VARINT:
  33680. do
  33681. n = i.readUint8();
  33682. while (128 === (128 & n));break;
  33683. case e.WIRE_TYPES.BITS64:
  33684. i.offset += 8;
  33685. break;
  33686. case e.WIRE_TYPES.LDELIM:
  33687. n = i.readVarint32(),
  33688. i.offset += n;
  33689. break;
  33690. case e.WIRE_TYPES.STARTGROUP:
  33691. r(a, i);
  33692. break;
  33693. case e.WIRE_TYPES.ENDGROUP:
  33694. if (a === t)
  33695. return !1;
  33696. throw Error("Illegal GROUPEND after unknown group: " + a + " (" + t + " expected)");
  33697. case e.WIRE_TYPES.BITS32:
  33698. i.offset += 4;
  33699. break;
  33700. default:
  33701. throw Error("Illegal wire type in unknown group " + t + ": " + o)
  33702. }
  33703. return !0
  33704. }
  33705. var o = {}
  33706. , a = function(e, t, i) {
  33707. this.builder = e,
  33708. this.parent = t,
  33709. this.name = i,
  33710. this.className
  33711. }
  33712. , s = a.prototype;
  33713. s.fqn = function() {
  33714. for (var e = this.name, t = this; ; ) {
  33715. if (t = t.parent,
  33716. null == t)
  33717. break;
  33718. e = t.name + "." + e
  33719. }
  33720. return e
  33721. }
  33722. ,
  33723. s.toString = function(e) {
  33724. return (e ? this.className + " " : "") + this.fqn()
  33725. }
  33726. ,
  33727. s.build = function() {
  33728. throw Error(this.toString(!0) + " cannot be built directly")
  33729. }
  33730. ,
  33731. o.T = a;
  33732. var l = function(e, t, i, n, r) {
  33733. a.call(this, e, t, i),
  33734. this.className = "Namespace",
  33735. this.children = [],
  33736. this.options = n || {},
  33737. this.syntax = r || "proto2"
  33738. }
  33739. , c = l.prototype = Object.create(a.prototype);
  33740. c.getChildren = function(e) {
  33741. if (e = e || null,
  33742. null == e)
  33743. return this.children.slice();
  33744. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  33745. this.children[i]instanceof e && t.push(this.children[i]);
  33746. return t
  33747. }
  33748. ,
  33749. c.addChild = function(e) {
  33750. var t;
  33751. if (t = this.getChild(e.name))
  33752. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  33753. t.name = t.originalName;
  33754. else {
  33755. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  33756. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  33757. e.name = e.originalName
  33758. }
  33759. this.children.push(e)
  33760. }
  33761. ,
  33762. c.getChild = function(e) {
  33763. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  33764. if (this.children[i][t] === e)
  33765. return this.children[i];
  33766. return null
  33767. }
  33768. ,
  33769. c.resolve = function(e, t) {
  33770. var i = "string" == typeof e ? e.split(".") : e
  33771. , n = this
  33772. , r = 0;
  33773. if ("" === i[r]) {
  33774. for (; null !== n.parent; )
  33775. n = n.parent;
  33776. r++
  33777. }
  33778. var a;
  33779. do {
  33780. do {
  33781. if (!(n instanceof o.Namespace)) {
  33782. n = null;
  33783. break
  33784. }
  33785. if (a = n.getChild(i[r]),
  33786. !a || !(a instanceof o.T) || t && !(a instanceof o.Namespace)) {
  33787. n = null;
  33788. break
  33789. }
  33790. n = a,
  33791. r++
  33792. } while (r < i.length);if (null != n)
  33793. break;
  33794. if (null !== this.parent)
  33795. return this.parent.resolve(e, t)
  33796. } while (null != n);return n
  33797. }
  33798. ,
  33799. c.qn = function(e) {
  33800. var t = []
  33801. , i = e;
  33802. do
  33803. t.unshift(i.name),
  33804. i = i.parent;
  33805. while (null !== i);for (var n = 1; n <= t.length; n++) {
  33806. var r = t.slice(t.length - n);
  33807. if (e === this.resolve(r, e instanceof o.Namespace))
  33808. return r.join(".")
  33809. }
  33810. return e.fqn()
  33811. }
  33812. ,
  33813. c.build = function() {
  33814. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  33815. e = i[n],
  33816. e instanceof l && (t[e.name] = e.build());
  33817. return Object.defineProperty && Object.defineProperty(t, "$options", {
  33818. value: this.buildOpt()
  33819. }),
  33820. t
  33821. }
  33822. ,
  33823. c.buildOpt = function() {
  33824. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  33825. var r = t[i]
  33826. , o = this.options[t[i]];
  33827. e[r] = o
  33828. }
  33829. return e
  33830. }
  33831. ,
  33832. c.getOption = function(e) {
  33833. return "undefined" == typeof e ? this.options : "undefined" != typeof this.options[e] ? this.options[e] : null
  33834. }
  33835. ,
  33836. o.Namespace = l;
  33837. var h = function(t, i, n, r) {
  33838. if (this.type = t,
  33839. this.resolvedType = i,
  33840. this.isMapKey = n,
  33841. this.syntax = r,
  33842. n && e.MAP_KEY_TYPES.indexOf(t) < 0)
  33843. throw Error("Invalid map key type: " + t.name)
  33844. }
  33845. , u = h.prototype;
  33846. h.defaultFieldValue = i,
  33847. u.verifyValue = function(i) {
  33848. function r(e, t) {
  33849. throw Error("Illegal value for " + o.toString(!0) + " of type " + o.type.name + ": " + e + " (" + t + ")")
  33850. }
  33851. var o = this;
  33852. switch (this.type) {
  33853. case e.TYPES.int32:
  33854. case e.TYPES.sint32:
  33855. case e.TYPES.sfixed32:
  33856. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  33857. i > 4294967295 ? 0 | i : i;
  33858. case e.TYPES.uint32:
  33859. case e.TYPES.fixed32:
  33860. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  33861. i < 0 ? i >>> 0 : i;
  33862. case e.TYPES.int64:
  33863. case e.TYPES.sint64:
  33864. case e.TYPES.sfixed64:
  33865. if (e.Long)
  33866. try {
  33867. return n(i, !1)
  33868. } catch (e) {
  33869. r(typeof i, e.message)
  33870. }
  33871. else
  33872. r(typeof i, "requires Long.js");
  33873. case e.TYPES.uint64:
  33874. case e.TYPES.fixed64:
  33875. if (e.Long)
  33876. try {
  33877. return n(i, !0)
  33878. } catch (e) {
  33879. r(typeof i, e.message)
  33880. }
  33881. else
  33882. r(typeof i, "requires Long.js");
  33883. case e.TYPES.bool:
  33884. return "boolean" != typeof i && r(typeof i, "not a boolean"),
  33885. i;
  33886. case e.TYPES.float:
  33887. case e.TYPES.double:
  33888. return "number" != typeof i && r(typeof i, "not a number"),
  33889. i;
  33890. case e.TYPES.string:
  33891. return "string" == typeof i || i && i instanceof String || r(typeof i, "not a string"),
  33892. "" + i;
  33893. case e.TYPES.bytes:
  33894. return t.isByteBuffer(i) ? i : t.wrap(i, "base64");
  33895. case e.TYPES.enum:
  33896. var a = this.resolvedType.getChildren(e.Reflect.Enum.Value);
  33897. for (l = 0; l < a.length; l++) {
  33898. if (a[l].name == i)
  33899. return a[l].id;
  33900. if (a[l].id == i)
  33901. return a[l].id
  33902. }
  33903. if ("proto3" === this.syntax)
  33904. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  33905. (i > 4294967295 || i < 0) && r(typeof i, "not in range for uint32"),
  33906. i;
  33907. r(i, "not a valid enum value");
  33908. case e.TYPES.group:
  33909. case e.TYPES.message:
  33910. if (i && "object" == typeof i || r(typeof i, "object expected"),
  33911. i instanceof this.resolvedType.clazz)
  33912. return i;
  33913. if (i instanceof e.Builder.Message) {
  33914. var s = {};
  33915. for (var l in i)
  33916. i.hasOwnProperty(l) && (s[l] = i[l]);
  33917. i = s
  33918. }
  33919. return new this.resolvedType.clazz(i)
  33920. }
  33921. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + i + " (undefined type " + this.type + ")")
  33922. }
  33923. ,
  33924. u.calculateLength = function(i, n) {
  33925. if (null === n)
  33926. return 0;
  33927. var r;
  33928. switch (this.type) {
  33929. case e.TYPES.int32:
  33930. return n < 0 ? t.calculateVarint64(n) : t.calculateVarint32(n);
  33931. case e.TYPES.uint32:
  33932. return t.calculateVarint32(n);
  33933. case e.TYPES.sint32:
  33934. return t.calculateVarint32(t.zigZagEncode32(n));
  33935. case e.TYPES.fixed32:
  33936. case e.TYPES.sfixed32:
  33937. case e.TYPES.float:
  33938. return 4;
  33939. case e.TYPES.int64:
  33940. case e.TYPES.uint64:
  33941. return t.calculateVarint64(n);
  33942. case e.TYPES.sint64:
  33943. return t.calculateVarint64(t.zigZagEncode64(n));
  33944. case e.TYPES.fixed64:
  33945. case e.TYPES.sfixed64:
  33946. return 8;
  33947. case e.TYPES.bool:
  33948. return 1;
  33949. case e.TYPES.enum:
  33950. return t.calculateVarint32(n);
  33951. case e.TYPES.double:
  33952. return 8;
  33953. case e.TYPES.string:
  33954. return r = t.calculateUTF8Bytes(n),
  33955. t.calculateVarint32(r) + r;
  33956. case e.TYPES.bytes:
  33957. if (n.remaining() < 0)
  33958. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  33959. return t.calculateVarint32(n.remaining()) + n.remaining();
  33960. case e.TYPES.message:
  33961. return r = this.resolvedType.calculate(n),
  33962. t.calculateVarint32(r) + r;
  33963. case e.TYPES.group:
  33964. return r = this.resolvedType.calculate(n),
  33965. r + t.calculateVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP)
  33966. }
  33967. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  33968. }
  33969. ,
  33970. u.encodeValue = function(i, n, r) {
  33971. if (null === n)
  33972. return r;
  33973. switch (this.type) {
  33974. case e.TYPES.int32:
  33975. n < 0 ? r.writeVarint64(n) : r.writeVarint32(n);
  33976. break;
  33977. case e.TYPES.uint32:
  33978. r.writeVarint32(n);
  33979. break;
  33980. case e.TYPES.sint32:
  33981. r.writeVarint32ZigZag(n);
  33982. break;
  33983. case e.TYPES.fixed32:
  33984. r.writeUint32(n);
  33985. break;
  33986. case e.TYPES.sfixed32:
  33987. r.writeInt32(n);
  33988. break;
  33989. case e.TYPES.int64:
  33990. case e.TYPES.uint64:
  33991. r.writeVarint64(n);
  33992. break;
  33993. case e.TYPES.sint64:
  33994. r.writeVarint64ZigZag(n);
  33995. break;
  33996. case e.TYPES.fixed64:
  33997. r.writeUint64(n);
  33998. break;
  33999. case e.TYPES.sfixed64:
  34000. r.writeInt64(n);
  34001. break;
  34002. case e.TYPES.bool:
  34003. "string" == typeof n ? r.writeVarint32("false" === n.toLowerCase() ? 0 : !!n) : r.writeVarint32(n ? 1 : 0);
  34004. break;
  34005. case e.TYPES.enum:
  34006. r.writeVarint32(n);
  34007. break;
  34008. case e.TYPES.float:
  34009. r.writeFloat32(n);
  34010. break;
  34011. case e.TYPES.double:
  34012. r.writeFloat64(n);
  34013. break;
  34014. case e.TYPES.string:
  34015. r.writeVString(n);
  34016. break;
  34017. case e.TYPES.bytes:
  34018. if (n.remaining() < 0)
  34019. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  34020. var o = n.offset;
  34021. r.writeVarint32(n.remaining()),
  34022. r.append(n),
  34023. n.offset = o;
  34024. break;
  34025. case e.TYPES.message:
  34026. var a = (new t).LE();
  34027. this.resolvedType.encode(n, a),
  34028. r.writeVarint32(a.offset),
  34029. r.append(a.flip());
  34030. break;
  34031. case e.TYPES.group:
  34032. this.resolvedType.encode(n, r),
  34033. r.writeVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP);
  34034. break;
  34035. default:
  34036. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  34037. }
  34038. return r
  34039. }
  34040. ,
  34041. u.decode = function(t, i, n) {
  34042. if (i != this.type.wireType)
  34043. throw Error("Unexpected wire type for element");
  34044. var r, o;
  34045. switch (this.type) {
  34046. case e.TYPES.int32:
  34047. return 0 | t.readVarint32();
  34048. case e.TYPES.uint32:
  34049. return t.readVarint32() >>> 0;
  34050. case e.TYPES.sint32:
  34051. return 0 | t.readVarint32ZigZag();
  34052. case e.TYPES.fixed32:
  34053. return t.readUint32() >>> 0;
  34054. case e.TYPES.sfixed32:
  34055. return 0 | t.readInt32();
  34056. case e.TYPES.int64:
  34057. return t.readVarint64();
  34058. case e.TYPES.uint64:
  34059. return t.readVarint64().toUnsigned();
  34060. case e.TYPES.sint64:
  34061. return t.readVarint64ZigZag();
  34062. case e.TYPES.fixed64:
  34063. return t.readUint64();
  34064. case e.TYPES.sfixed64:
  34065. return t.readInt64();
  34066. case e.TYPES.bool:
  34067. return !!t.readVarint32();
  34068. case e.TYPES.enum:
  34069. return t.readVarint32();
  34070. case e.TYPES.float:
  34071. return t.readFloat();
  34072. case e.TYPES.double:
  34073. return t.readDouble();
  34074. case e.TYPES.string:
  34075. return t.readVString();
  34076. case e.TYPES.bytes:
  34077. if (o = t.readVarint32(),
  34078. t.remaining() < o)
  34079. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + t.remaining());
  34080. return r = t.clone(),
  34081. r.limit = r.offset + o,
  34082. t.offset += o,
  34083. r;
  34084. case e.TYPES.message:
  34085. return o = t.readVarint32(),
  34086. this.resolvedType.decode(t, o);
  34087. case e.TYPES.group:
  34088. return this.resolvedType.decode(t, -1, n)
  34089. }
  34090. throw Error("[INTERNAL] Illegal decode type")
  34091. }
  34092. ,
  34093. u.valueFromString = function(i) {
  34094. if (!this.isMapKey)
  34095. throw Error("valueFromString() called on non-map-key element");
  34096. switch (this.type) {
  34097. case e.TYPES.int32:
  34098. case e.TYPES.sint32:
  34099. case e.TYPES.sfixed32:
  34100. case e.TYPES.uint32:
  34101. case e.TYPES.fixed32:
  34102. return this.verifyValue(parseInt(i));
  34103. case e.TYPES.int64:
  34104. case e.TYPES.sint64:
  34105. case e.TYPES.sfixed64:
  34106. case e.TYPES.uint64:
  34107. case e.TYPES.fixed64:
  34108. return this.verifyValue(i);
  34109. case e.TYPES.bool:
  34110. return "true" === i;
  34111. case e.TYPES.string:
  34112. return this.verifyValue(i);
  34113. case e.TYPES.bytes:
  34114. return t.fromBinary(i)
  34115. }
  34116. }
  34117. ,
  34118. u.valueToString = function(t) {
  34119. if (!this.isMapKey)
  34120. throw Error("valueToString() called on non-map-key element");
  34121. return this.type === e.TYPES.bytes ? t.toString("binary") : t.toString()
  34122. }
  34123. ,
  34124. o.Element = h;
  34125. var d = function(e, t, i, n, r, o) {
  34126. l.call(this, e, t, i, n, o),
  34127. this.className = "Message",
  34128. this.extensions = void 0,
  34129. this.clazz = null,
  34130. this.isGroup = !!r,
  34131. this._fields = null,
  34132. this._fieldsById = null,
  34133. this._fieldsByName = null
  34134. }
  34135. , p = d.prototype = Object.create(l.prototype);
  34136. p.build = function(i) {
  34137. if (this.clazz && !i)
  34138. return this.clazz;
  34139. var n = function(e, i) {
  34140. function n(i, r, o, a) {
  34141. if (null === i || "object" != typeof i) {
  34142. if (a && a instanceof e.Reflect.Enum) {
  34143. var s = e.Reflect.Enum.getName(a.object, i);
  34144. if (null !== s)
  34145. return s
  34146. }
  34147. return i
  34148. }
  34149. if (t.isByteBuffer(i))
  34150. return r ? i.toBase64() : i.toBuffer();
  34151. if (e.Long.isLong(i))
  34152. return o ? i.toString() : e.Long.fromValue(i);
  34153. var l;
  34154. if (Array.isArray(i))
  34155. return l = [],
  34156. i.forEach(function(e, t) {
  34157. l[t] = n(e, r, o, a)
  34158. }),
  34159. l;
  34160. if (l = {},
  34161. i instanceof e.Map) {
  34162. for (var c = i.entries(), h = c.next(); !h.done; h = c.next())
  34163. l[i.keyElem.valueToString(h.value[0])] = n(h.value[1], r, o, i.valueElem.resolvedType);
  34164. return l
  34165. }
  34166. var u = i.$type
  34167. , d = void 0;
  34168. for (var p in i)
  34169. i.hasOwnProperty(p) && (u && (d = u.getChild(p)) ? l[p] = n(i[p], r, o, d.resolvedType) : l[p] = n(i[p], r, o));
  34170. return l
  34171. }
  34172. var r = i.getChildren(e.Reflect.Message.Field)
  34173. , o = i.getChildren(e.Reflect.Message.OneOf)
  34174. , a = function(n, s) {
  34175. e.Builder.Message.call(this);
  34176. for (var l = 0, c = o.length; l < c; ++l)
  34177. this[o[l].name] = null;
  34178. for (l = 0,
  34179. c = r.length; l < c; ++l) {
  34180. var h = r[l];
  34181. this[h.name] = h.repeated ? [] : h.map ? new e.Map(h) : null,
  34182. !h.required && "proto3" !== i.syntax || null === h.defaultValue || (this[h.name] = h.defaultValue)
  34183. }
  34184. if (arguments.length > 0) {
  34185. var u;
  34186. if (1 !== arguments.length || null === n || "object" != typeof n || !("function" != typeof n.encode || n instanceof a) || Array.isArray(n) || n instanceof e.Map || t.isByteBuffer(n) || n instanceof ArrayBuffer || e.Long && n instanceof e.Long)
  34187. for (l = 0,
  34188. c = arguments.length; l < c; ++l)
  34189. "undefined" != typeof (u = arguments[l]) && this.$set(r[l].name, u);
  34190. else
  34191. this.$set(n)
  34192. }
  34193. }
  34194. , s = a.prototype = Object.create(e.Builder.Message.prototype);
  34195. s.add = function(t, n, r) {
  34196. var o = i._fieldsByName[t];
  34197. if (!r) {
  34198. if (!o)
  34199. throw Error(this + "#" + t + " is undefined");
  34200. if (!(o instanceof e.Reflect.Message.Field))
  34201. throw Error(this + "#" + t + " is not a field: " + o.toString(!0));
  34202. if (!o.repeated)
  34203. throw Error(this + "#" + t + " is not a repeated field");
  34204. n = o.verifyValue(n, !0)
  34205. }
  34206. return null === this[t] && (this[t] = []),
  34207. this[t].push(n),
  34208. this
  34209. }
  34210. ,
  34211. s.$add = s.add,
  34212. s.set = function(t, n, r) {
  34213. if (t && "object" == typeof t) {
  34214. r = n;
  34215. for (var o in t)
  34216. t.hasOwnProperty(o) && "undefined" != typeof (n = t[o]) && this.$set(o, n, r);
  34217. return this
  34218. }
  34219. var a = i._fieldsByName[t];
  34220. if (r)
  34221. this[t] = n;
  34222. else {
  34223. if (!a)
  34224. throw Error(this + "#" + t + " is not a field: undefined");
  34225. if (!(a instanceof e.Reflect.Message.Field))
  34226. throw Error(this + "#" + t + " is not a field: " + a.toString(!0));
  34227. this[a.name] = n = a.verifyValue(n)
  34228. }
  34229. if (a && a.oneof) {
  34230. var s = this[a.oneof.name];
  34231. null !== n ? (null !== s && s !== a.name && (this[s] = null),
  34232. this[a.oneof.name] = a.name) : s === t && (this[a.oneof.name] = null)
  34233. }
  34234. return this
  34235. }
  34236. ,
  34237. s.$set = s.set,
  34238. s.get = function(t, n) {
  34239. if (n)
  34240. return this[t];
  34241. var r = i._fieldsByName[t];
  34242. if (!(r && r instanceof e.Reflect.Message.Field))
  34243. throw Error(this + "#" + t + " is not a field: undefined");
  34244. if (!(r instanceof e.Reflect.Message.Field))
  34245. throw Error(this + "#" + t + " is not a field: " + r.toString(!0));
  34246. return this[r.name]
  34247. }
  34248. ,
  34249. s.$get = s.get;
  34250. for (var l = 0; l < r.length; l++) {
  34251. var c = r[l];
  34252. c instanceof e.Reflect.Message.ExtensionField || i.builder.options.populateAccessors && function(e) {
  34253. var t = e.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  34254. return e.toUpperCase().replace("_", "")
  34255. });
  34256. t = t.substring(0, 1).toUpperCase() + t.substring(1);
  34257. var n = e.originalName.replace(/([A-Z])/g, function(e) {
  34258. return "_" + e
  34259. })
  34260. , r = function(t, i) {
  34261. return this[e.name] = i ? t : e.verifyValue(t),
  34262. this
  34263. }
  34264. , o = function() {
  34265. return this[e.name]
  34266. };
  34267. null === i.getChild("set" + t) && (s["set" + t] = r),
  34268. null === i.getChild("set_" + n) && (s["set_" + n] = r),
  34269. null === i.getChild("get" + t) && (s["get" + t] = o),
  34270. null === i.getChild("get_" + n) && (s["get_" + n] = o)
  34271. }(c)
  34272. }
  34273. s.encode = function(e, n) {
  34274. "boolean" == typeof e && (n = e,
  34275. e = void 0);
  34276. var r = !1;
  34277. e || (e = new t,
  34278. r = !0);
  34279. var o = e.littleEndian;
  34280. try {
  34281. return i.encode(this, e.LE(), n),
  34282. (r ? e.flip() : e).LE(o)
  34283. } catch (t) {
  34284. throw e.LE(o),
  34285. t
  34286. }
  34287. }
  34288. ,
  34289. a.encode = function(e, t, i) {
  34290. return new a(e).encode(t, i)
  34291. }
  34292. ,
  34293. s.calculate = function() {
  34294. return i.calculate(this)
  34295. }
  34296. ,
  34297. s.encodeDelimited = function(e, n) {
  34298. var r = !1;
  34299. e || (e = new t,
  34300. r = !0);
  34301. var o = (new t).LE();
  34302. return i.encode(this, o, n).flip(),
  34303. e.writeVarint32(o.remaining()),
  34304. e.append(o),
  34305. r ? e.flip() : e
  34306. }
  34307. ,
  34308. s.encodeAB = function() {
  34309. try {
  34310. return this.encode().toArrayBuffer()
  34311. } catch (e) {
  34312. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  34313. e
  34314. }
  34315. }
  34316. ,
  34317. s.toArrayBuffer = s.encodeAB,
  34318. s.encodeNB = function() {
  34319. try {
  34320. return this.encode().toBuffer()
  34321. } catch (e) {
  34322. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  34323. e
  34324. }
  34325. }
  34326. ,
  34327. s.toBuffer = s.encodeNB,
  34328. s.encode64 = function() {
  34329. try {
  34330. return this.encode().toBase64()
  34331. } catch (e) {
  34332. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  34333. e
  34334. }
  34335. }
  34336. ,
  34337. s.toBase64 = s.encode64,
  34338. s.encodeHex = function() {
  34339. try {
  34340. return this.encode().toHex()
  34341. } catch (e) {
  34342. throw e.encoded && (e.encoded = e.encoded.toHex()),
  34343. e
  34344. }
  34345. }
  34346. ,
  34347. s.toHex = s.encodeHex,
  34348. s.toRaw = function(e, t) {
  34349. return n(this, !!e, !!t, this.$type)
  34350. }
  34351. ,
  34352. s.encodeJSON = function() {
  34353. return JSON.stringify(n(this, !0, !0, this.$type))
  34354. }
  34355. ,
  34356. a.decode = function(e, n, r) {
  34357. "string" == typeof n && (r = n,
  34358. n = -1),
  34359. "string" == typeof e && (e = t.wrap(e, r ? r : "base64")),
  34360. e = t.isByteBuffer(e) ? e : t.wrap(e);
  34361. var o = e.littleEndian;
  34362. try {
  34363. var a = i.decode(e.LE());
  34364. return e.LE(o),
  34365. a
  34366. } catch (t) {
  34367. throw e.LE(o),
  34368. t
  34369. }
  34370. }
  34371. ,
  34372. a.decodeDelimited = function(e, n) {
  34373. if ("string" == typeof e && (e = t.wrap(e, n ? n : "base64")),
  34374. e = t.isByteBuffer(e) ? e : t.wrap(e),
  34375. e.remaining() < 1)
  34376. return null;
  34377. var r = e.offset
  34378. , o = e.readVarint32();
  34379. if (e.remaining() < o)
  34380. return e.offset = r,
  34381. null;
  34382. try {
  34383. var a = i.decode(e.slice(e.offset, e.offset + o).LE());
  34384. return e.offset += o,
  34385. a
  34386. } catch (t) {
  34387. throw e.offset += o,
  34388. t
  34389. }
  34390. }
  34391. ,
  34392. a.decode64 = function(e) {
  34393. return a.decode(e, "base64")
  34394. }
  34395. ,
  34396. a.decodeHex = function(e) {
  34397. return a.decode(e, "hex")
  34398. }
  34399. ,
  34400. a.decodeJSON = function(e) {
  34401. return new a(JSON.parse(e))
  34402. }
  34403. ,
  34404. s.toString = function() {
  34405. return i.toString()
  34406. }
  34407. ;
  34408. return Object.defineProperty && (Object.defineProperty(a, "$options", {
  34409. value: i.buildOpt()
  34410. }),
  34411. Object.defineProperty(s, "$options", {
  34412. value: a.$options
  34413. }),
  34414. Object.defineProperty(a, "$type", {
  34415. value: i
  34416. }),
  34417. Object.defineProperty(s, "$type", {
  34418. value: i
  34419. })),
  34420. a
  34421. }(e, this);
  34422. this._fields = [],
  34423. this._fieldsById = {},
  34424. this._fieldsByName = {};
  34425. for (var r, o = 0, a = this.children.length; o < a; o++)
  34426. if (r = this.children[o],
  34427. r instanceof A || r instanceof d || r instanceof E) {
  34428. if (n.hasOwnProperty(r.name))
  34429. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + r.toString(!0) + " cannot override static property '" + r.name + "'");
  34430. n[r.name] = r.build()
  34431. } else if (r instanceof d.Field)
  34432. r.build(),
  34433. this._fields.push(r),
  34434. this._fieldsById[r.id] = r,
  34435. this._fieldsByName[r.name] = r;
  34436. else if (!(r instanceof d.OneOf || r instanceof I))
  34437. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[o].toString(!0));
  34438. return this.clazz = n
  34439. }
  34440. ,
  34441. p.encode = function(e, t, i) {
  34442. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  34443. n = this._fields[a],
  34444. r = e[n.name],
  34445. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  34446. if (null !== o) {
  34447. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  34448. throw l.encoded = t,
  34449. l
  34450. }
  34451. return t
  34452. }
  34453. ,
  34454. p.calculate = function(e) {
  34455. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  34456. if (t = this._fields[r],
  34457. i = e[t.name],
  34458. t.required && null === i)
  34459. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  34460. n += t.calculate(i, e)
  34461. }
  34462. return n
  34463. }
  34464. ,
  34465. p.decode = function(t, i, n) {
  34466. i = "number" == typeof i ? i : -1;
  34467. for (var o, a, s, l, c = t.offset, h = new this.clazz; t.offset < c + i || i === -1 && t.remaining() > 0; ) {
  34468. if (o = t.readVarint32(),
  34469. a = 7 & o,
  34470. s = o >>> 3,
  34471. a === e.WIRE_TYPES.ENDGROUP) {
  34472. if (s !== n)
  34473. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + s + " (" + (n ? n + " expected" : "not a group") + ")");
  34474. break
  34475. }
  34476. if (l = this._fieldsById[s]) {
  34477. if (l.repeated && !l.options.packed)
  34478. h[l.name].push(l.decode(a, t));
  34479. else if (l.map) {
  34480. var u = l.decode(a, t);
  34481. h[l.name].set(u[0], u[1])
  34482. } else if (h[l.name] = l.decode(a, t),
  34483. l.oneof) {
  34484. var d = h[l.oneof.name];
  34485. null !== d && d !== l.name && (h[d] = null),
  34486. h[l.oneof.name] = l.name
  34487. }
  34488. } else
  34489. switch (a) {
  34490. case e.WIRE_TYPES.VARINT:
  34491. t.readVarint32();
  34492. break;
  34493. case e.WIRE_TYPES.BITS32:
  34494. t.offset += 4;
  34495. break;
  34496. case e.WIRE_TYPES.BITS64:
  34497. t.offset += 8;
  34498. break;
  34499. case e.WIRE_TYPES.LDELIM:
  34500. var p = t.readVarint32();
  34501. t.offset += p;
  34502. break;
  34503. case e.WIRE_TYPES.STARTGROUP:
  34504. for (; r(s, t); )
  34505. ;
  34506. break;
  34507. default:
  34508. throw Error("Illegal wire type for unknown field " + s + " in " + this.toString(!0) + "#decode: " + a)
  34509. }
  34510. }
  34511. for (var f = 0, g = this._fields.length; f < g; ++f)
  34512. if (l = this._fields[f],
  34513. null === h[l.name])
  34514. if ("proto3" === this.syntax)
  34515. h[l.name] = l.defaultValue;
  34516. else {
  34517. if (l.required) {
  34518. var m = Error("Missing at least one required field for " + this.toString(!0) + ": " + l.name);
  34519. throw m.decoded = h,
  34520. m
  34521. }
  34522. e.populateDefaults && null !== l.defaultValue && (h[l.name] = l.defaultValue)
  34523. }
  34524. return h
  34525. }
  34526. ,
  34527. o.Message = d;
  34528. var f = function(t, i, n, r, o, s, l, c, h, u) {
  34529. a.call(this, t, i, s),
  34530. this.className = "Message.Field",
  34531. this.required = "required" === n,
  34532. this.repeated = "repeated" === n,
  34533. this.map = "map" === n,
  34534. this.keyType = r || null,
  34535. this.type = o,
  34536. this.resolvedType = null,
  34537. this.id = l,
  34538. this.options = c || {},
  34539. this.defaultValue = null,
  34540. this.oneof = h || null,
  34541. this.syntax = u || "proto2",
  34542. this.originalName = this.name,
  34543. this.element = null,
  34544. this.keyElement = null,
  34545. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = e.Util.toCamelCase(this.name))
  34546. }
  34547. , g = f.prototype = Object.create(a.prototype);
  34548. g.build = function() {
  34549. this.element = new h(this.type,this.resolvedType,!1,this.syntax),
  34550. this.map && (this.keyElement = new h(this.keyType,void 0,!0,this.syntax)),
  34551. "proto3" !== this.syntax || this.repeated || this.map ? "undefined" != typeof this.options.default && (this.defaultValue = this.verifyValue(this.options.default)) : this.defaultValue = h.defaultFieldValue(this.type)
  34552. }
  34553. ,
  34554. g.verifyValue = function(t, i) {
  34555. function n(e, t) {
  34556. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  34557. }
  34558. i = i || !1;
  34559. var r = this;
  34560. if (null === t)
  34561. return this.required && n(typeof t, "required"),
  34562. "proto3" === this.syntax && this.type !== e.TYPES.message && n(typeof t, "proto3 field without field presence cannot be null"),
  34563. null;
  34564. var o;
  34565. if (this.repeated && !i) {
  34566. Array.isArray(t) || (t = [t]);
  34567. var a = [];
  34568. for (o = 0; o < t.length; o++)
  34569. a.push(this.element.verifyValue(t[o]));
  34570. return a
  34571. }
  34572. return this.map && !i ? t instanceof e.Map ? t : (t instanceof Object || n(typeof t, "expected ProtoBuf.Map or raw object for map field"),
  34573. new e.Map(this,t)) : (!this.repeated && Array.isArray(t) && n(typeof t, "no array expected"),
  34574. this.element.verifyValue(t))
  34575. }
  34576. ,
  34577. g.hasWirePresence = function(t, i) {
  34578. if ("proto3" !== this.syntax)
  34579. return null !== t;
  34580. if (this.oneof && i[this.oneof.name] === this.name)
  34581. return !0;
  34582. switch (this.type) {
  34583. case e.TYPES.int32:
  34584. case e.TYPES.sint32:
  34585. case e.TYPES.sfixed32:
  34586. case e.TYPES.uint32:
  34587. case e.TYPES.fixed32:
  34588. return 0 !== t;
  34589. case e.TYPES.int64:
  34590. case e.TYPES.sint64:
  34591. case e.TYPES.sfixed64:
  34592. case e.TYPES.uint64:
  34593. case e.TYPES.fixed64:
  34594. return 0 !== t.low || 0 !== t.high;
  34595. case e.TYPES.bool:
  34596. return t;
  34597. case e.TYPES.float:
  34598. case e.TYPES.double:
  34599. return 0 !== t;
  34600. case e.TYPES.string:
  34601. return t.length > 0;
  34602. case e.TYPES.bytes:
  34603. return t.remaining() > 0;
  34604. case e.TYPES.enum:
  34605. return 0 !== t;
  34606. case e.TYPES.message:
  34607. return null !== t;
  34608. default:
  34609. return !0
  34610. }
  34611. }
  34612. ,
  34613. g.encode = function(i, n, r) {
  34614. if (null === this.type || "object" != typeof this.type)
  34615. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  34616. if (null === i || this.repeated && 0 == i.length)
  34617. return n;
  34618. try {
  34619. if (this.repeated) {
  34620. var o;
  34621. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  34622. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  34623. n.ensureCapacity(n.offset += 1);
  34624. var a = n.offset;
  34625. for (o = 0; o < i.length; o++)
  34626. this.element.encodeValue(this.id, i[o], n);
  34627. var s = n.offset - a
  34628. , l = t.calculateVarint32(s);
  34629. if (l > 1) {
  34630. var c = n.slice(a, n.offset);
  34631. a += l - 1,
  34632. n.offset = a,
  34633. n.append(c)
  34634. }
  34635. n.writeVarint32(s, a - l)
  34636. } else
  34637. for (o = 0; o < i.length; o++)
  34638. n.writeVarint32(this.id << 3 | this.type.wireType),
  34639. this.element.encodeValue(this.id, i[o], n)
  34640. } else
  34641. this.map ? i.forEach(function(i, r, o) {
  34642. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, r) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  34643. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  34644. n.writeVarint32(a),
  34645. n.writeVarint32(8 | this.keyType.wireType),
  34646. this.keyElement.encodeValue(1, r, n),
  34647. n.writeVarint32(16 | this.type.wireType),
  34648. this.element.encodeValue(2, i, n)
  34649. }, this) : this.hasWirePresence(i, r) && (n.writeVarint32(this.id << 3 | this.type.wireType),
  34650. this.element.encodeValue(this.id, i, n))
  34651. } catch (e) {
  34652. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  34653. }
  34654. return n
  34655. }
  34656. ,
  34657. g.calculate = function(i, n) {
  34658. if (i = this.verifyValue(i),
  34659. null === this.type || "object" != typeof this.type)
  34660. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  34661. if (null === i || this.repeated && 0 == i.length)
  34662. return 0;
  34663. var r = 0;
  34664. try {
  34665. if (this.repeated) {
  34666. var o, a;
  34667. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  34668. for (r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  34669. a = 0,
  34670. o = 0; o < i.length; o++)
  34671. a += this.element.calculateLength(this.id, i[o]);
  34672. r += t.calculateVarint32(a),
  34673. r += a
  34674. } else
  34675. for (o = 0; o < i.length; o++)
  34676. r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  34677. r += this.element.calculateLength(this.id, i[o])
  34678. } else
  34679. this.map ? i.forEach(function(i, n, o) {
  34680. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, n) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  34681. r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  34682. r += t.calculateVarint32(a),
  34683. r += a
  34684. }, this) : this.hasWirePresence(i, n) && (r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  34685. r += this.element.calculateLength(this.id, i))
  34686. } catch (e) {
  34687. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  34688. }
  34689. return r
  34690. }
  34691. ,
  34692. g.decode = function(t, i, n) {
  34693. var r, o, a = !this.map && t == this.type.wireType || !n && this.repeated && this.options.packed && t == e.WIRE_TYPES.LDELIM || this.map && t == e.WIRE_TYPES.LDELIM;
  34694. if (!a)
  34695. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + t + " (" + this.type.wireType + " expected)");
  34696. if (t == e.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 && !n) {
  34697. o = i.readVarint32(),
  34698. o = i.offset + o;
  34699. for (var s = []; i.offset < o; )
  34700. s.push(this.decode(this.type.wireType, i, !0));
  34701. return s
  34702. }
  34703. if (this.map) {
  34704. var l = h.defaultFieldValue(this.keyType);
  34705. if (r = h.defaultFieldValue(this.type),
  34706. o = i.readVarint32(),
  34707. i.remaining() < o)
  34708. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + i.remaining());
  34709. var c = i.clone();
  34710. for (c.limit = c.offset + o,
  34711. i.offset += o; c.remaining() > 0; ) {
  34712. var u = c.readVarint32();
  34713. t = 7 & u;
  34714. var d = u >>> 3;
  34715. if (1 === d)
  34716. l = this.keyElement.decode(c, t, d);
  34717. else {
  34718. if (2 !== d)
  34719. throw Error("Unexpected tag in map field key/value submessage");
  34720. r = this.element.decode(c, t, d)
  34721. }
  34722. }
  34723. return [l, r]
  34724. }
  34725. return this.element.decode(i, t, this.id)
  34726. }
  34727. ,
  34728. o.Message.Field = f;
  34729. var m = function(e, t, i, n, r, o, a) {
  34730. f.call(this, e, t, i, null, n, r, o, a),
  34731. this.extension
  34732. };
  34733. m.prototype = Object.create(f.prototype),
  34734. o.Message.ExtensionField = m;
  34735. var v = function(e, t, i) {
  34736. a.call(this, e, t, i),
  34737. this.fields = []
  34738. };
  34739. o.Message.OneOf = v;
  34740. var A = function(e, t, i, n, r) {
  34741. l.call(this, e, t, i, n, r),
  34742. this.className = "Enum",
  34743. this.object = null
  34744. };
  34745. A.getName = function(e, t) {
  34746. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  34747. if (e[i = n[r]] === t)
  34748. return i;
  34749. return null
  34750. }
  34751. ;
  34752. var y = A.prototype = Object.create(l.prototype);
  34753. y.build = function(t) {
  34754. if (this.object && !t)
  34755. return this.object;
  34756. for (var i = new e.Builder.Enum, n = this.getChildren(A.Value), r = 0, o = n.length; r < o; ++r)
  34757. i[n[r].name] = n[r].id;
  34758. return Object.defineProperty && Object.defineProperty(i, "$options", {
  34759. value: this.buildOpt(),
  34760. enumerable: !1
  34761. }),
  34762. this.object = i
  34763. }
  34764. ,
  34765. o.Enum = A;
  34766. var C = function(e, t, i, n) {
  34767. a.call(this, e, t, i),
  34768. this.className = "Enum.Value",
  34769. this.id = n
  34770. };
  34771. C.prototype = Object.create(a.prototype),
  34772. o.Enum.Value = C;
  34773. var I = function(e, t, i, n) {
  34774. a.call(this, e, t, i),
  34775. this.field = n
  34776. };
  34777. I.prototype = Object.create(a.prototype),
  34778. o.Extension = I;
  34779. var E = function(e, t, i, n) {
  34780. l.call(this, e, t, i, n),
  34781. this.className = "Service",
  34782. this.clazz = null
  34783. }
  34784. , b = E.prototype = Object.create(l.prototype);
  34785. b.build = function(i) {
  34786. return this.clazz && !i ? this.clazz : this.clazz = function(e, i) {
  34787. for (var n = function(t) {
  34788. e.Builder.Service.call(this),
  34789. this.rpcImpl = t || function(e, t, i) {
  34790. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  34791. }
  34792. }, r = n.prototype = Object.create(e.Builder.Service.prototype), o = i.getChildren(e.Reflect.Service.RPCMethod), a = 0; a < o.length; a++)
  34793. !function(e) {
  34794. r[e.name] = function(n, r) {
  34795. try {
  34796. try {
  34797. n = e.resolvedRequestType.clazz.decode(t.wrap(n))
  34798. } catch (e) {
  34799. if (!(e instanceof TypeError))
  34800. throw e
  34801. }
  34802. if (null === n || "object" != typeof n)
  34803. throw Error("Illegal arguments");
  34804. n instanceof e.resolvedRequestType.clazz || (n = new e.resolvedRequestType.clazz(n)),
  34805. this.rpcImpl(e.fqn(), n, function(t, n) {
  34806. if (t)
  34807. return void r(t);
  34808. null === n && (n = "");
  34809. try {
  34810. n = e.resolvedResponseType.clazz.decode(n)
  34811. } catch (e) {}
  34812. return n && n instanceof e.resolvedResponseType.clazz ? void r(null, n) : void r(Error("Illegal response type received in service method " + i.name + "#" + e.name))
  34813. })
  34814. } catch (e) {
  34815. setTimeout(r.bind(this, e), 0)
  34816. }
  34817. }
  34818. ,
  34819. n[e.name] = function(t, i, r) {
  34820. new n(t)[e.name](i, r)
  34821. }
  34822. ,
  34823. Object.defineProperty && (Object.defineProperty(n[e.name], "$options", {
  34824. value: e.buildOpt()
  34825. }),
  34826. Object.defineProperty(r[e.name], "$options", {
  34827. value: n[e.name].$options
  34828. }))
  34829. }(o[a]);
  34830. return Object.defineProperty && (Object.defineProperty(n, "$options", {
  34831. value: i.buildOpt()
  34832. }),
  34833. Object.defineProperty(r, "$options", {
  34834. value: n.$options
  34835. }),
  34836. Object.defineProperty(n, "$type", {
  34837. value: i
  34838. }),
  34839. Object.defineProperty(r, "$type", {
  34840. value: i
  34841. })),
  34842. n
  34843. }(e, this)
  34844. }
  34845. ,
  34846. o.Service = E;
  34847. var w = function(e, t, i, n) {
  34848. a.call(this, e, t, i),
  34849. this.className = "Service.Method",
  34850. this.options = n || {}
  34851. }
  34852. , _ = w.prototype = Object.create(a.prototype);
  34853. _.buildOpt = c.buildOpt,
  34854. o.Service.Method = w;
  34855. var T = function(e, t, i, n, r, o, a, s) {
  34856. w.call(this, e, t, i, s),
  34857. this.className = "Service.RPCMethod",
  34858. this.requestName = n,
  34859. this.responseName = r,
  34860. this.requestStream = o,
  34861. this.responseStream = a,
  34862. this.resolvedRequestType = null,
  34863. this.resolvedResponseType = null
  34864. };
  34865. return T.prototype = Object.create(w.prototype),
  34866. o.Service.RPCMethod = T,
  34867. o
  34868. }(r),
  34869. r.Builder = function(t, i, n) {
  34870. function r(e) {
  34871. e.messages && e.messages.forEach(function(t) {
  34872. t.syntax = e.syntax,
  34873. r(t)
  34874. }),
  34875. e.enums && e.enums.forEach(function(t) {
  34876. t.syntax = e.syntax
  34877. })
  34878. }
  34879. var o = function(e) {
  34880. this.ns = new n.Namespace(this,null,""),
  34881. this.ptr = this.ns,
  34882. this.resolved = !1,
  34883. this.result = null,
  34884. this.files = {},
  34885. this.importRoot = null,
  34886. this.options = e || {}
  34887. }
  34888. , a = o.prototype;
  34889. return o.isMessage = function(e) {
  34890. return "string" == typeof e.name && ("undefined" == typeof e.values && "undefined" == typeof e.rpc)
  34891. }
  34892. ,
  34893. o.isMessageField = function(e) {
  34894. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && "undefined" != typeof e.id
  34895. }
  34896. ,
  34897. o.isEnum = function(e) {
  34898. return "string" == typeof e.name && !("undefined" == typeof e.values || !Array.isArray(e.values) || 0 === e.values.length)
  34899. }
  34900. ,
  34901. o.isService = function(e) {
  34902. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  34903. }
  34904. ,
  34905. o.isExtend = function(e) {
  34906. return "string" == typeof e.ref
  34907. }
  34908. ,
  34909. a.reset = function() {
  34910. return this.ptr = this.ns,
  34911. this
  34912. }
  34913. ,
  34914. a.define = function(e) {
  34915. if ("string" != typeof e || !i.TYPEREF.test(e))
  34916. throw Error("illegal namespace: " + e);
  34917. return e.split(".").forEach(function(e) {
  34918. var t = this.ptr.getChild(e);
  34919. null === t && this.ptr.addChild(t = new n.Namespace(this,this.ptr,e)),
  34920. this.ptr = t
  34921. }, this),
  34922. this
  34923. }
  34924. ,
  34925. a.create = function(e) {
  34926. if (!e)
  34927. return this;
  34928. if (Array.isArray(e)) {
  34929. if (0 === e.length)
  34930. return this;
  34931. e = e.slice()
  34932. } else
  34933. e = [e];
  34934. for (var i = [e]; i.length > 0; ) {
  34935. if (e = i.pop(),
  34936. !Array.isArray(e))
  34937. throw Error("not a valid namespace: " + JSON.stringify(e));
  34938. for (; e.length > 0; ) {
  34939. var r = e.shift();
  34940. if (o.isMessage(r)) {
  34941. var a = new n.Message(this,this.ptr,r.name,r.options,r.isGroup,r.syntax)
  34942. , s = {};
  34943. r.oneofs && Object.keys(r.oneofs).forEach(function(e) {
  34944. a.addChild(s[e] = new n.Message.OneOf(this,a,e))
  34945. }, this),
  34946. r.fields && r.fields.forEach(function(e) {
  34947. if (null !== a.getChild(0 | e.id))
  34948. throw Error("duplicate or invalid field id in " + a.name + ": " + e.id);
  34949. if (e.options && "object" != typeof e.options)
  34950. throw Error("illegal field options in " + a.name + "#" + e.name);
  34951. var t = null;
  34952. if ("string" == typeof e.oneof && !(t = s[e.oneof]))
  34953. throw Error("illegal oneof in " + a.name + "#" + e.name + ": " + e.oneof);
  34954. e = new n.Message.Field(this,a,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,r.syntax),
  34955. t && t.fields.push(e),
  34956. a.addChild(e)
  34957. }, this);
  34958. var l = [];
  34959. if (r.enums && r.enums.forEach(function(e) {
  34960. l.push(e)
  34961. }),
  34962. r.messages && r.messages.forEach(function(e) {
  34963. l.push(e)
  34964. }),
  34965. r.services && r.services.forEach(function(e) {
  34966. l.push(e)
  34967. }),
  34968. r.extensions && ("number" == typeof r.extensions[0] ? a.extensions = [r.extensions] : a.extensions = r.extensions),
  34969. this.ptr.addChild(a),
  34970. l.length > 0) {
  34971. i.push(e),
  34972. e = l,
  34973. l = null,
  34974. this.ptr = a,
  34975. a = null;
  34976. continue
  34977. }
  34978. l = null
  34979. } else if (o.isEnum(r))
  34980. a = new n.Enum(this,this.ptr,r.name,r.options,r.syntax),
  34981. r.values.forEach(function(e) {
  34982. a.addChild(new n.Enum.Value(this,a,e.name,e.id))
  34983. }, this),
  34984. this.ptr.addChild(a);
  34985. else if (o.isService(r))
  34986. a = new n.Service(this,this.ptr,r.name,r.options),
  34987. Object.keys(r.rpc).forEach(function(e) {
  34988. var t = r.rpc[e];
  34989. a.addChild(new n.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  34990. }, this),
  34991. this.ptr.addChild(a);
  34992. else {
  34993. if (!o.isExtend(r))
  34994. throw Error("not a valid definition: " + JSON.stringify(r));
  34995. if (a = this.ptr.resolve(r.ref, !0))
  34996. r.fields.forEach(function(e) {
  34997. if (null !== a.getChild(0 | e.id))
  34998. throw Error("duplicate extended field id in " + a.name + ": " + e.id);
  34999. if (a.extensions) {
  35000. var i = !1;
  35001. if (a.extensions.forEach(function(t) {
  35002. e.id >= t[0] && e.id <= t[1] && (i = !0)
  35003. }),
  35004. !i)
  35005. throw Error("illegal extended field id in " + a.name + ": " + e.id + " (not within valid ranges)")
  35006. }
  35007. var r = e.name;
  35008. this.options.convertFieldsToCamelCase && (r = t.Util.toCamelCase(r));
  35009. var o = new n.Message.ExtensionField(this,a,e.rule,e.type,this.ptr.fqn() + "." + r,e.id,e.options)
  35010. , s = new n.Extension(this,this.ptr,e.name,o);
  35011. o.extension = s,
  35012. this.ptr.addChild(s),
  35013. a.addChild(o)
  35014. }, this);
  35015. else if (!/\.?google\.protobuf\./.test(r.ref))
  35016. throw Error("extended message " + r.ref + " is not defined")
  35017. }
  35018. r = null,
  35019. a = null
  35020. }
  35021. e = null,
  35022. this.ptr = this.ptr.parent
  35023. }
  35024. return this.resolved = !1,
  35025. this.result = null,
  35026. this
  35027. }
  35028. ,
  35029. a.import = function(i, n) {
  35030. var o = "/";
  35031. if ("string" == typeof n) {
  35032. if (t.Util.IS_NODE && (n = e("path").resolve(n)),
  35033. this.files[n] === !0)
  35034. return this.reset();
  35035. this.files[n] = !0
  35036. } else if ("object" == typeof n) {
  35037. var a = n.root;
  35038. t.Util.IS_NODE && (a = e("path").resolve(a)),
  35039. (a.indexOf("\\") >= 0 || n.file.indexOf("\\") >= 0) && (o = "\\");
  35040. var s = a + o + n.file;
  35041. if (this.files[s] === !0)
  35042. return this.reset();
  35043. this.files[s] = !0
  35044. }
  35045. if (i.imports && i.imports.length > 0) {
  35046. var l, c = !1;
  35047. "object" == typeof n ? (this.importRoot = n.root,
  35048. c = !0,
  35049. l = this.importRoot,
  35050. n = n.file,
  35051. (l.indexOf("\\") >= 0 || n.indexOf("\\") >= 0) && (o = "\\")) : "string" == typeof n ? this.importRoot ? l = this.importRoot : n.indexOf("/") >= 0 ? (l = n.replace(/\/[^\/]*$/, ""),
  35052. "" === l && (l = "/")) : n.indexOf("\\") >= 0 ? (l = n.replace(/\\[^\\]*$/, ""),
  35053. o = "\\") : l = "." : l = null;
  35054. for (var h = 0; h < i.imports.length; h++)
  35055. if ("string" == typeof i.imports[h]) {
  35056. if (!l)
  35057. throw Error("cannot determine import root");
  35058. var u = i.imports[h];
  35059. if ("google/protobuf/descriptor.proto" === u)
  35060. continue;
  35061. if (u = l + o + u,
  35062. this.files[u] === !0)
  35063. continue;
  35064. /\.proto$/i.test(u) && !t.DotProto && (u = u.replace(/\.proto$/, ".json"));
  35065. var d = t.Util.fetch(u);
  35066. if (null === d)
  35067. throw Error("failed to import '" + u + "' in '" + n + "': file not found");
  35068. /\.json$/i.test(u) ? this.import(JSON.parse(d + ""), u) : this.import(t.DotProto.Parser.parse(d), u)
  35069. } else
  35070. n ? /\.(\w+)$/.test(n) ? this.import(i.imports[h], n.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  35071. return t + "_import" + h + "." + i
  35072. })) : this.import(i.imports[h], n + "_import" + h) : this.import(i.imports[h]);
  35073. c && (this.importRoot = null)
  35074. }
  35075. i.package && this.define(i.package),
  35076. i.syntax && r(i);
  35077. var p = this.ptr;
  35078. return i.options && Object.keys(i.options).forEach(function(e) {
  35079. p.options[e] = i.options[e]
  35080. }),
  35081. i.messages && (this.create(i.messages),
  35082. this.ptr = p),
  35083. i.enums && (this.create(i.enums),
  35084. this.ptr = p),
  35085. i.services && (this.create(i.services),
  35086. this.ptr = p),
  35087. i.extends && this.create(i.extends),
  35088. this.reset()
  35089. }
  35090. ,
  35091. a.resolveAll = function() {
  35092. var e;
  35093. if (null == this.ptr || "object" == typeof this.ptr.type)
  35094. return this;
  35095. if (this.ptr instanceof n.Namespace)
  35096. this.ptr.children.forEach(function(e) {
  35097. this.ptr = e,
  35098. this.resolveAll()
  35099. }, this);
  35100. else if (this.ptr instanceof n.Message.Field) {
  35101. if (i.TYPE.test(this.ptr.type))
  35102. this.ptr.type = t.TYPES[this.ptr.type];
  35103. else {
  35104. if (!i.TYPEREF.test(this.ptr.type))
  35105. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  35106. if (e = (this.ptr instanceof n.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0),
  35107. !e)
  35108. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  35109. if (this.ptr.resolvedType = e,
  35110. e instanceof n.Enum) {
  35111. if (this.ptr.type = t.TYPES.enum,
  35112. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  35113. throw Error("proto3 message cannot reference proto2 enum")
  35114. } else {
  35115. if (!(e instanceof n.Message))
  35116. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  35117. this.ptr.type = e.isGroup ? t.TYPES.group : t.TYPES.message
  35118. }
  35119. }
  35120. if (this.ptr.map) {
  35121. if (!i.TYPE.test(this.ptr.keyType))
  35122. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  35123. this.ptr.keyType = t.TYPES[this.ptr.keyType]
  35124. }
  35125. } else if (this.ptr instanceof t.Reflect.Service.Method) {
  35126. if (!(this.ptr instanceof t.Reflect.Service.RPCMethod))
  35127. throw Error("illegal service type in " + this.ptr.toString(!0));
  35128. if (e = this.ptr.parent.resolve(this.ptr.requestName, !0),
  35129. !(e && e instanceof t.Reflect.Message))
  35130. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  35131. if (this.ptr.resolvedRequestType = e,
  35132. e = this.ptr.parent.resolve(this.ptr.responseName, !0),
  35133. !(e && e instanceof t.Reflect.Message))
  35134. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  35135. this.ptr.resolvedResponseType = e
  35136. } else if (!(this.ptr instanceof t.Reflect.Message.OneOf || this.ptr instanceof t.Reflect.Extension || this.ptr instanceof t.Reflect.Enum.Value))
  35137. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  35138. return this.reset()
  35139. }
  35140. ,
  35141. a.build = function(e) {
  35142. if (this.reset(),
  35143. this.resolved || (this.resolveAll(),
  35144. this.resolved = !0,
  35145. this.result = null),
  35146. null === this.result && (this.result = this.ns.build()),
  35147. !e)
  35148. return this.result;
  35149. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  35150. if (!i[t[n]]) {
  35151. i = null;
  35152. break
  35153. }
  35154. i = i[t[n]]
  35155. }
  35156. return i
  35157. }
  35158. ,
  35159. a.lookup = function(e, t) {
  35160. return e ? this.ns.resolve(e, t) : this.ns
  35161. }
  35162. ,
  35163. a.toString = function() {
  35164. return "Builder"
  35165. }
  35166. ,
  35167. o.Message = function() {}
  35168. ,
  35169. o.Enum = function() {}
  35170. ,
  35171. o.Service = function() {}
  35172. ,
  35173. o
  35174. }(r, r.Lang, r.Reflect),
  35175. r.Map = function(e, t) {
  35176. function i(e) {
  35177. var t = 0;
  35178. return {
  35179. next: function() {
  35180. return t < e.length ? {
  35181. done: !1,
  35182. value: e[t++]
  35183. } : {
  35184. done: !0
  35185. }
  35186. }
  35187. }
  35188. }
  35189. var n = function(e, i) {
  35190. if (!e.map)
  35191. throw Error("field is not a map");
  35192. if (this.field = e,
  35193. this.keyElem = new t.Element(e.keyType,null,!0,e.syntax),
  35194. this.valueElem = new t.Element(e.type,e.resolvedType,!1,e.syntax),
  35195. this.map = {},
  35196. Object.defineProperty(this, "size", {
  35197. get: function() {
  35198. return Object.keys(this.map).length
  35199. }
  35200. }),
  35201. i)
  35202. for (var n = Object.keys(i), r = 0; r < n.length; r++) {
  35203. var o = this.keyElem.valueFromString(n[r])
  35204. , a = this.valueElem.verifyValue(i[n[r]]);
  35205. this.map[this.keyElem.valueToString(o)] = {
  35206. key: o,
  35207. value: a
  35208. }
  35209. }
  35210. }
  35211. , r = n.prototype;
  35212. return r.clear = function() {
  35213. this.map = {}
  35214. }
  35215. ,
  35216. r.delete = function(e) {
  35217. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  35218. , i = t in this.map;
  35219. return delete this.map[t],
  35220. i
  35221. }
  35222. ,
  35223. r.entries = function() {
  35224. for (var e, t = [], n = Object.keys(this.map), r = 0; r < n.length; r++)
  35225. t.push([(e = this.map[n[r]]).key, e.value]);
  35226. return i(t)
  35227. }
  35228. ,
  35229. r.keys = function() {
  35230. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  35231. e.push(this.map[t[n]].key);
  35232. return i(e)
  35233. }
  35234. ,
  35235. r.values = function() {
  35236. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  35237. e.push(this.map[t[n]].value);
  35238. return i(e)
  35239. }
  35240. ,
  35241. r.forEach = function(e, t) {
  35242. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  35243. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  35244. }
  35245. ,
  35246. r.set = function(e, t) {
  35247. var i = this.keyElem.verifyValue(e)
  35248. , n = this.valueElem.verifyValue(t);
  35249. return this.map[this.keyElem.valueToString(i)] = {
  35250. key: i,
  35251. value: n
  35252. },
  35253. this
  35254. }
  35255. ,
  35256. r.get = function(e) {
  35257. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  35258. if (t in this.map)
  35259. return this.map[t].value
  35260. }
  35261. ,
  35262. r.has = function(e) {
  35263. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  35264. return t in this.map
  35265. }
  35266. ,
  35267. n
  35268. }(r, r.Reflect),
  35269. r.loadProto = function(e, t, i) {
  35270. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  35271. t = void 0),
  35272. r.loadJson(r.DotProto.Parser.parse(e), t, i)
  35273. }
  35274. ,
  35275. r.protoFromString = r.loadProto,
  35276. r.loadProtoFile = function(e, t, i) {
  35277. if (t && "object" == typeof t ? (i = t,
  35278. t = null) : t && "function" == typeof t || (t = null),
  35279. t)
  35280. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  35281. if (null === n)
  35282. return void t(Error("Failed to fetch file"));
  35283. try {
  35284. t(null, r.loadProto(n, i, e))
  35285. } catch (e) {
  35286. t(e)
  35287. }
  35288. });
  35289. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  35290. return null === n ? null : r.loadProto(n, i, e)
  35291. }
  35292. ,
  35293. r.protoFromFile = r.loadProtoFile,
  35294. r.newBuilder = function(e) {
  35295. return e = e || {},
  35296. "undefined" == typeof e.convertFieldsToCamelCase && (e.convertFieldsToCamelCase = r.convertFieldsToCamelCase),
  35297. "undefined" == typeof e.populateAccessors && (e.populateAccessors = r.populateAccessors),
  35298. new r.Builder(e)
  35299. }
  35300. ,
  35301. r.loadJson = function(e, t, i) {
  35302. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  35303. t = null),
  35304. t && "object" == typeof t || (t = r.newBuilder()),
  35305. "string" == typeof e && (e = JSON.parse(e)),
  35306. t.import(e, i),
  35307. t.resolveAll(),
  35308. t
  35309. }
  35310. ,
  35311. r.loadJsonFile = function(e, t, i) {
  35312. if (t && "object" == typeof t ? (i = t,
  35313. t = null) : t && "function" == typeof t || (t = null),
  35314. t)
  35315. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  35316. if (null === n)
  35317. return void t(Error("Failed to fetch file"));
  35318. try {
  35319. t(null, r.loadJson(JSON.parse(n), i, e))
  35320. } catch (e) {
  35321. t(e)
  35322. }
  35323. });
  35324. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  35325. return null === n ? null : r.loadJson(JSON.parse(n), i, e)
  35326. }
  35327. ,
  35328. r
  35329. })
  35330. }
  35331. ).call(this, e("_process"))
  35332. }
  35333. , {
  35334. _process: 203,
  35335. bytebuffer: 215,
  35336. fs: 197,
  35337. path: 197
  35338. }],
  35339. 215: [function(e, t, i) {
  35340. !function(i, n) {
  35341. "function" == typeof define && define.amd ? define(["long"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = function() {
  35342. var t;
  35343. try {
  35344. t = e("long")
  35345. } catch (e) {}
  35346. return n(t)
  35347. }() : (i.dcodeIO = i.dcodeIO || {}).ByteBuffer = n(i.dcodeIO.Long)
  35348. }(this, function(e) {
  35349. "use strict";
  35350. function t(e) {
  35351. var t = 0;
  35352. return function() {
  35353. return t < e.length ? e.charCodeAt(t++) : null
  35354. }
  35355. }
  35356. function i() {
  35357. var e = []
  35358. , t = [];
  35359. return function() {
  35360. return 0 === arguments.length ? t.join("") + l.apply(String, e) : (e.length + arguments.length > 1024 && (t.push(l.apply(String, e)),
  35361. e.length = 0),
  35362. void Array.prototype.push.apply(e, arguments))
  35363. }
  35364. }
  35365. function n(e, t, i, n, r) {
  35366. var o, a, s = 8 * r - n - 1, l = (1 << s) - 1, c = l >> 1, h = -7, u = i ? r - 1 : 0, d = i ? -1 : 1, p = e[t + u];
  35367. for (u += d,
  35368. o = p & (1 << -h) - 1,
  35369. p >>= -h,
  35370. h += s; h > 0; o = 256 * o + e[t + u],
  35371. u += d,
  35372. h -= 8)
  35373. ;
  35374. for (a = o & (1 << -h) - 1,
  35375. o >>= -h,
  35376. h += n; h > 0; a = 256 * a + e[t + u],
  35377. u += d,
  35378. h -= 8)
  35379. ;
  35380. if (0 === o)
  35381. o = 1 - c;
  35382. else {
  35383. if (o === l)
  35384. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  35385. a += Math.pow(2, n),
  35386. o -= c
  35387. }
  35388. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  35389. }
  35390. function r(e, t, i, n, r, o) {
  35391. var a, s, l, c = 8 * o - r - 1, h = (1 << c) - 1, u = h >> 1, d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0, p = n ? 0 : o - 1, f = n ? 1 : -1, g = t < 0 || 0 === t && 1 / t < 0 ? 1 : 0;
  35392. for (t = Math.abs(t),
  35393. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  35394. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  35395. t * (l = Math.pow(2, -a)) < 1 && (a--,
  35396. l *= 2),
  35397. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  35398. t * l >= 2 && (a++,
  35399. l /= 2),
  35400. a + u >= h ? (s = 0,
  35401. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  35402. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  35403. a = 0)); r >= 8; e[i + p] = 255 & s,
  35404. p += f,
  35405. s /= 256,
  35406. r -= 8)
  35407. ;
  35408. for (a = a << r | s,
  35409. c += r; c > 0; e[i + p] = 255 & a,
  35410. p += f,
  35411. a /= 256,
  35412. c -= 8)
  35413. ;
  35414. e[i + p - f] |= 128 * g
  35415. }
  35416. var o = function(e, t, i) {
  35417. if ("undefined" == typeof e && (e = o.DEFAULT_CAPACITY),
  35418. "undefined" == typeof t && (t = o.DEFAULT_ENDIAN),
  35419. "undefined" == typeof i && (i = o.DEFAULT_NOASSERT),
  35420. !i) {
  35421. if (e |= 0,
  35422. e < 0)
  35423. throw RangeError("Illegal capacity");
  35424. t = !!t,
  35425. i = !!i
  35426. }
  35427. this.buffer = 0 === e ? s : new ArrayBuffer(e),
  35428. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  35429. this.offset = 0,
  35430. this.markedOffset = -1,
  35431. this.limit = e,
  35432. this.littleEndian = t,
  35433. this.noAssert = i
  35434. };
  35435. o.VERSION = "5.0.1",
  35436. o.LITTLE_ENDIAN = !0,
  35437. o.BIG_ENDIAN = !1,
  35438. o.DEFAULT_CAPACITY = 16,
  35439. o.DEFAULT_ENDIAN = o.BIG_ENDIAN,
  35440. o.DEFAULT_NOASSERT = !1,
  35441. o.Long = e || null;
  35442. var a = o.prototype;
  35443. a.__isByteBuffer__,
  35444. Object.defineProperty(a, "__isByteBuffer__", {
  35445. value: !0,
  35446. enumerable: !1,
  35447. configurable: !1
  35448. });
  35449. var s = new ArrayBuffer(0)
  35450. , l = String.fromCharCode;
  35451. o.accessor = function() {
  35452. return Uint8Array
  35453. }
  35454. ,
  35455. o.allocate = function(e, t, i) {
  35456. return new o(e,t,i)
  35457. }
  35458. ,
  35459. o.concat = function(e, t, i, n) {
  35460. "boolean" != typeof t && "string" == typeof t || (n = i,
  35461. i = t,
  35462. t = void 0);
  35463. for (var r, a = 0, s = 0, l = e.length; s < l; ++s)
  35464. o.isByteBuffer(e[s]) || (e[s] = o.wrap(e[s], t)),
  35465. r = e[s].limit - e[s].offset,
  35466. r > 0 && (a += r);
  35467. if (0 === a)
  35468. return new o(0,i,n);
  35469. var c, h = new o(a,i,n);
  35470. for (s = 0; s < l; )
  35471. c = e[s++],
  35472. r = c.limit - c.offset,
  35473. r <= 0 || (h.view.set(c.view.subarray(c.offset, c.limit), h.offset),
  35474. h.offset += r);
  35475. return h.limit = h.offset,
  35476. h.offset = 0,
  35477. h
  35478. }
  35479. ,
  35480. o.isByteBuffer = function(e) {
  35481. return (e && e.__isByteBuffer__) === !0
  35482. }
  35483. ,
  35484. o.type = function() {
  35485. return ArrayBuffer
  35486. }
  35487. ,
  35488. o.wrap = function(e, t, i, n) {
  35489. if ("string" != typeof t && (n = i,
  35490. i = t,
  35491. t = void 0),
  35492. "string" == typeof e)
  35493. switch ("undefined" == typeof t && (t = "utf8"),
  35494. t) {
  35495. case "base64":
  35496. return o.fromBase64(e, i);
  35497. case "hex":
  35498. return o.fromHex(e, i);
  35499. case "binary":
  35500. return o.fromBinary(e, i);
  35501. case "utf8":
  35502. return o.fromUTF8(e, i);
  35503. case "debug":
  35504. return o.fromDebug(e, i);
  35505. default:
  35506. throw Error("Unsupported encoding: " + t)
  35507. }
  35508. if (null === e || "object" != typeof e)
  35509. throw TypeError("Illegal buffer");
  35510. var r;
  35511. if (o.isByteBuffer(e))
  35512. return r = a.clone.call(e),
  35513. r.markedOffset = -1,
  35514. r;
  35515. if (e instanceof Uint8Array)
  35516. r = new o(0,i,n),
  35517. e.length > 0 && (r.buffer = e.buffer,
  35518. r.offset = e.byteOffset,
  35519. r.limit = e.byteOffset + e.byteLength,
  35520. r.view = new Uint8Array(e.buffer));
  35521. else if (e instanceof ArrayBuffer)
  35522. r = new o(0,i,n),
  35523. e.byteLength > 0 && (r.buffer = e,
  35524. r.offset = 0,
  35525. r.limit = e.byteLength,
  35526. r.view = e.byteLength > 0 ? new Uint8Array(e) : null);
  35527. else {
  35528. if ("[object Array]" !== Object.prototype.toString.call(e))
  35529. throw TypeError("Illegal buffer");
  35530. r = new o(e.length,i,n),
  35531. r.limit = e.length;
  35532. for (var s = 0; s < e.length; ++s)
  35533. r.view[s] = e[s]
  35534. }
  35535. return r
  35536. }
  35537. ,
  35538. a.writeBitSet = function(e, t) {
  35539. var i = "undefined" == typeof t;
  35540. if (i && (t = this.offset),
  35541. !this.noAssert) {
  35542. if (!(e instanceof Array))
  35543. throw TypeError("Illegal BitSet: Not an array");
  35544. if ("number" != typeof t || t % 1 !== 0)
  35545. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35546. if (t >>>= 0,
  35547. t < 0 || t + 0 > this.buffer.byteLength)
  35548. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35549. }
  35550. var n, r = t, o = e.length, a = o >> 3, s = 0;
  35551. for (t += this.writeVarint32(o, t); a--; )
  35552. n = 1 & !!e[s++] | (1 & !!e[s++]) << 1 | (1 & !!e[s++]) << 2 | (1 & !!e[s++]) << 3 | (1 & !!e[s++]) << 4 | (1 & !!e[s++]) << 5 | (1 & !!e[s++]) << 6 | (1 & !!e[s++]) << 7,
  35553. this.writeByte(n, t++);
  35554. if (s < o) {
  35555. var l = 0;
  35556. for (n = 0; s < o; )
  35557. n |= (1 & !!e[s++]) << l++;
  35558. this.writeByte(n, t++)
  35559. }
  35560. return i ? (this.offset = t,
  35561. this) : t - r
  35562. }
  35563. ,
  35564. a.readBitSet = function(e) {
  35565. var t = "undefined" == typeof e;
  35566. t && (e = this.offset);
  35567. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  35568. for (e += n.length; o--; )
  35569. i = this.readByte(e++),
  35570. s[a++] = !!(1 & i),
  35571. s[a++] = !!(2 & i),
  35572. s[a++] = !!(4 & i),
  35573. s[a++] = !!(8 & i),
  35574. s[a++] = !!(16 & i),
  35575. s[a++] = !!(32 & i),
  35576. s[a++] = !!(64 & i),
  35577. s[a++] = !!(128 & i);
  35578. if (a < r) {
  35579. var l = 0;
  35580. for (i = this.readByte(e++); a < r; )
  35581. s[a++] = !!(i >> l++ & 1)
  35582. }
  35583. return t && (this.offset = e),
  35584. s
  35585. }
  35586. ,
  35587. a.readBytes = function(e, t) {
  35588. var i = "undefined" == typeof t;
  35589. if (i && (t = this.offset),
  35590. !this.noAssert) {
  35591. if ("number" != typeof t || t % 1 !== 0)
  35592. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35593. if (t >>>= 0,
  35594. t < 0 || t + e > this.buffer.byteLength)
  35595. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  35596. }
  35597. var n = this.slice(t, t + e);
  35598. return i && (this.offset += e),
  35599. n
  35600. }
  35601. ,
  35602. a.writeBytes = a.append,
  35603. a.writeInt8 = function(e, t) {
  35604. var i = "undefined" == typeof t;
  35605. if (i && (t = this.offset),
  35606. !this.noAssert) {
  35607. if ("number" != typeof e || e % 1 !== 0)
  35608. throw TypeError("Illegal value: " + e + " (not an integer)");
  35609. if (e |= 0,
  35610. "number" != typeof t || t % 1 !== 0)
  35611. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35612. if (t >>>= 0,
  35613. t < 0 || t + 0 > this.buffer.byteLength)
  35614. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35615. }
  35616. t += 1;
  35617. var n = this.buffer.byteLength;
  35618. return t > n && this.resize((n *= 2) > t ? n : t),
  35619. t -= 1,
  35620. this.view[t] = e,
  35621. i && (this.offset += 1),
  35622. this
  35623. }
  35624. ,
  35625. a.writeByte = a.writeInt8,
  35626. a.readInt8 = function(e) {
  35627. var t = "undefined" == typeof e;
  35628. if (t && (e = this.offset),
  35629. !this.noAssert) {
  35630. if ("number" != typeof e || e % 1 !== 0)
  35631. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35632. if (e >>>= 0,
  35633. e < 0 || e + 1 > this.buffer.byteLength)
  35634. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35635. }
  35636. var i = this.view[e];
  35637. return 128 === (128 & i) && (i = -(255 - i + 1)),
  35638. t && (this.offset += 1),
  35639. i
  35640. }
  35641. ,
  35642. a.readByte = a.readInt8,
  35643. a.writeUint8 = function(e, t) {
  35644. var i = "undefined" == typeof t;
  35645. if (i && (t = this.offset),
  35646. !this.noAssert) {
  35647. if ("number" != typeof e || e % 1 !== 0)
  35648. throw TypeError("Illegal value: " + e + " (not an integer)");
  35649. if (e >>>= 0,
  35650. "number" != typeof t || t % 1 !== 0)
  35651. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35652. if (t >>>= 0,
  35653. t < 0 || t + 0 > this.buffer.byteLength)
  35654. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35655. }
  35656. t += 1;
  35657. var n = this.buffer.byteLength;
  35658. return t > n && this.resize((n *= 2) > t ? n : t),
  35659. t -= 1,
  35660. this.view[t] = e,
  35661. i && (this.offset += 1),
  35662. this
  35663. }
  35664. ,
  35665. a.writeUInt8 = a.writeUint8,
  35666. a.readUint8 = function(e) {
  35667. var t = "undefined" == typeof e;
  35668. if (t && (e = this.offset),
  35669. !this.noAssert) {
  35670. if ("number" != typeof e || e % 1 !== 0)
  35671. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35672. if (e >>>= 0,
  35673. e < 0 || e + 1 > this.buffer.byteLength)
  35674. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35675. }
  35676. var i = this.view[e];
  35677. return t && (this.offset += 1),
  35678. i
  35679. }
  35680. ,
  35681. a.readUInt8 = a.readUint8,
  35682. a.writeInt16 = function(e, t) {
  35683. var i = "undefined" == typeof t;
  35684. if (i && (t = this.offset),
  35685. !this.noAssert) {
  35686. if ("number" != typeof e || e % 1 !== 0)
  35687. throw TypeError("Illegal value: " + e + " (not an integer)");
  35688. if (e |= 0,
  35689. "number" != typeof t || t % 1 !== 0)
  35690. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35691. if (t >>>= 0,
  35692. t < 0 || t + 0 > this.buffer.byteLength)
  35693. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35694. }
  35695. t += 2;
  35696. var n = this.buffer.byteLength;
  35697. return t > n && this.resize((n *= 2) > t ? n : t),
  35698. t -= 2,
  35699. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  35700. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  35701. this.view[t + 1] = 255 & e),
  35702. i && (this.offset += 2),
  35703. this
  35704. }
  35705. ,
  35706. a.writeShort = a.writeInt16,
  35707. a.readInt16 = function(e) {
  35708. var t = "undefined" == typeof e;
  35709. if (t && (e = this.offset),
  35710. !this.noAssert) {
  35711. if ("number" != typeof e || e % 1 !== 0)
  35712. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35713. if (e >>>= 0,
  35714. e < 0 || e + 2 > this.buffer.byteLength)
  35715. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  35716. }
  35717. var i = 0;
  35718. return this.littleEndian ? (i = this.view[e],
  35719. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  35720. i |= this.view[e + 1]),
  35721. 32768 === (32768 & i) && (i = -(65535 - i + 1)),
  35722. t && (this.offset += 2),
  35723. i
  35724. }
  35725. ,
  35726. a.readShort = a.readInt16,
  35727. a.writeUint16 = function(e, t) {
  35728. var i = "undefined" == typeof t;
  35729. if (i && (t = this.offset),
  35730. !this.noAssert) {
  35731. if ("number" != typeof e || e % 1 !== 0)
  35732. throw TypeError("Illegal value: " + e + " (not an integer)");
  35733. if (e >>>= 0,
  35734. "number" != typeof t || t % 1 !== 0)
  35735. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35736. if (t >>>= 0,
  35737. t < 0 || t + 0 > this.buffer.byteLength)
  35738. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35739. }
  35740. t += 2;
  35741. var n = this.buffer.byteLength;
  35742. return t > n && this.resize((n *= 2) > t ? n : t),
  35743. t -= 2,
  35744. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  35745. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  35746. this.view[t + 1] = 255 & e),
  35747. i && (this.offset += 2),
  35748. this
  35749. }
  35750. ,
  35751. a.writeUInt16 = a.writeUint16,
  35752. a.readUint16 = function(e) {
  35753. var t = "undefined" == typeof e;
  35754. if (t && (e = this.offset),
  35755. !this.noAssert) {
  35756. if ("number" != typeof e || e % 1 !== 0)
  35757. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35758. if (e >>>= 0,
  35759. e < 0 || e + 2 > this.buffer.byteLength)
  35760. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  35761. }
  35762. var i = 0;
  35763. return this.littleEndian ? (i = this.view[e],
  35764. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  35765. i |= this.view[e + 1]),
  35766. t && (this.offset += 2),
  35767. i
  35768. }
  35769. ,
  35770. a.readUInt16 = a.readUint16,
  35771. a.writeInt32 = function(e, t) {
  35772. var i = "undefined" == typeof t;
  35773. if (i && (t = this.offset),
  35774. !this.noAssert) {
  35775. if ("number" != typeof e || e % 1 !== 0)
  35776. throw TypeError("Illegal value: " + e + " (not an integer)");
  35777. if (e |= 0,
  35778. "number" != typeof t || t % 1 !== 0)
  35779. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35780. if (t >>>= 0,
  35781. t < 0 || t + 0 > this.buffer.byteLength)
  35782. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35783. }
  35784. t += 4;
  35785. var n = this.buffer.byteLength;
  35786. return t > n && this.resize((n *= 2) > t ? n : t),
  35787. t -= 4,
  35788. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  35789. this.view[t + 2] = e >>> 16 & 255,
  35790. this.view[t + 1] = e >>> 8 & 255,
  35791. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  35792. this.view[t + 1] = e >>> 16 & 255,
  35793. this.view[t + 2] = e >>> 8 & 255,
  35794. this.view[t + 3] = 255 & e),
  35795. i && (this.offset += 4),
  35796. this
  35797. }
  35798. ,
  35799. a.writeInt = a.writeInt32,
  35800. a.readInt32 = function(e) {
  35801. var t = "undefined" == typeof e;
  35802. if (t && (e = this.offset),
  35803. !this.noAssert) {
  35804. if ("number" != typeof e || e % 1 !== 0)
  35805. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35806. if (e >>>= 0,
  35807. e < 0 || e + 4 > this.buffer.byteLength)
  35808. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35809. }
  35810. var i = 0;
  35811. return this.littleEndian ? (i = this.view[e + 2] << 16,
  35812. i |= this.view[e + 1] << 8,
  35813. i |= this.view[e],
  35814. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  35815. i |= this.view[e + 2] << 8,
  35816. i |= this.view[e + 3],
  35817. i += this.view[e] << 24 >>> 0),
  35818. i |= 0,
  35819. t && (this.offset += 4),
  35820. i
  35821. }
  35822. ,
  35823. a.readInt = a.readInt32,
  35824. a.writeUint32 = function(e, t) {
  35825. var i = "undefined" == typeof t;
  35826. if (i && (t = this.offset),
  35827. !this.noAssert) {
  35828. if ("number" != typeof e || e % 1 !== 0)
  35829. throw TypeError("Illegal value: " + e + " (not an integer)");
  35830. if (e >>>= 0,
  35831. "number" != typeof t || t % 1 !== 0)
  35832. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35833. if (t >>>= 0,
  35834. t < 0 || t + 0 > this.buffer.byteLength)
  35835. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35836. }
  35837. t += 4;
  35838. var n = this.buffer.byteLength;
  35839. return t > n && this.resize((n *= 2) > t ? n : t),
  35840. t -= 4,
  35841. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  35842. this.view[t + 2] = e >>> 16 & 255,
  35843. this.view[t + 1] = e >>> 8 & 255,
  35844. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  35845. this.view[t + 1] = e >>> 16 & 255,
  35846. this.view[t + 2] = e >>> 8 & 255,
  35847. this.view[t + 3] = 255 & e),
  35848. i && (this.offset += 4),
  35849. this
  35850. }
  35851. ,
  35852. a.writeUInt32 = a.writeUint32,
  35853. a.readUint32 = function(e) {
  35854. var t = "undefined" == typeof e;
  35855. if (t && (e = this.offset),
  35856. !this.noAssert) {
  35857. if ("number" != typeof e || e % 1 !== 0)
  35858. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35859. if (e >>>= 0,
  35860. e < 0 || e + 4 > this.buffer.byteLength)
  35861. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35862. }
  35863. var i = 0;
  35864. return this.littleEndian ? (i = this.view[e + 2] << 16,
  35865. i |= this.view[e + 1] << 8,
  35866. i |= this.view[e],
  35867. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  35868. i |= this.view[e + 2] << 8,
  35869. i |= this.view[e + 3],
  35870. i += this.view[e] << 24 >>> 0),
  35871. t && (this.offset += 4),
  35872. i
  35873. }
  35874. ,
  35875. a.readUInt32 = a.readUint32,
  35876. e && (a.writeInt64 = function(t, i) {
  35877. var n = "undefined" == typeof i;
  35878. if (n && (i = this.offset),
  35879. !this.noAssert) {
  35880. if ("number" == typeof t)
  35881. t = e.fromNumber(t);
  35882. else if ("string" == typeof t)
  35883. t = e.fromString(t);
  35884. else if (!(t && t instanceof e))
  35885. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  35886. if ("number" != typeof i || i % 1 !== 0)
  35887. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35888. if (i >>>= 0,
  35889. i < 0 || i + 0 > this.buffer.byteLength)
  35890. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35891. }
  35892. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  35893. i += 8;
  35894. var r = this.buffer.byteLength;
  35895. i > r && this.resize((r *= 2) > i ? r : i),
  35896. i -= 8;
  35897. var o = t.low
  35898. , a = t.high;
  35899. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  35900. this.view[i + 2] = o >>> 16 & 255,
  35901. this.view[i + 1] = o >>> 8 & 255,
  35902. this.view[i] = 255 & o,
  35903. i += 4,
  35904. this.view[i + 3] = a >>> 24 & 255,
  35905. this.view[i + 2] = a >>> 16 & 255,
  35906. this.view[i + 1] = a >>> 8 & 255,
  35907. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  35908. this.view[i + 1] = a >>> 16 & 255,
  35909. this.view[i + 2] = a >>> 8 & 255,
  35910. this.view[i + 3] = 255 & a,
  35911. i += 4,
  35912. this.view[i] = o >>> 24 & 255,
  35913. this.view[i + 1] = o >>> 16 & 255,
  35914. this.view[i + 2] = o >>> 8 & 255,
  35915. this.view[i + 3] = 255 & o),
  35916. n && (this.offset += 8),
  35917. this
  35918. }
  35919. ,
  35920. a.writeLong = a.writeInt64,
  35921. a.readInt64 = function(t) {
  35922. var i = "undefined" == typeof t;
  35923. if (i && (t = this.offset),
  35924. !this.noAssert) {
  35925. if ("number" != typeof t || t % 1 !== 0)
  35926. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35927. if (t >>>= 0,
  35928. t < 0 || t + 8 > this.buffer.byteLength)
  35929. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  35930. }
  35931. var n = 0
  35932. , r = 0;
  35933. this.littleEndian ? (n = this.view[t + 2] << 16,
  35934. n |= this.view[t + 1] << 8,
  35935. n |= this.view[t],
  35936. n += this.view[t + 3] << 24 >>> 0,
  35937. t += 4,
  35938. r = this.view[t + 2] << 16,
  35939. r |= this.view[t + 1] << 8,
  35940. r |= this.view[t],
  35941. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  35942. r |= this.view[t + 2] << 8,
  35943. r |= this.view[t + 3],
  35944. r += this.view[t] << 24 >>> 0,
  35945. t += 4,
  35946. n = this.view[t + 1] << 16,
  35947. n |= this.view[t + 2] << 8,
  35948. n |= this.view[t + 3],
  35949. n += this.view[t] << 24 >>> 0);
  35950. var o = new e(n,r,!1);
  35951. return i && (this.offset += 8),
  35952. o
  35953. }
  35954. ,
  35955. a.readLong = a.readInt64,
  35956. a.writeUint64 = function(t, i) {
  35957. var n = "undefined" == typeof i;
  35958. if (n && (i = this.offset),
  35959. !this.noAssert) {
  35960. if ("number" == typeof t)
  35961. t = e.fromNumber(t);
  35962. else if ("string" == typeof t)
  35963. t = e.fromString(t);
  35964. else if (!(t && t instanceof e))
  35965. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  35966. if ("number" != typeof i || i % 1 !== 0)
  35967. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35968. if (i >>>= 0,
  35969. i < 0 || i + 0 > this.buffer.byteLength)
  35970. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35971. }
  35972. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  35973. i += 8;
  35974. var r = this.buffer.byteLength;
  35975. i > r && this.resize((r *= 2) > i ? r : i),
  35976. i -= 8;
  35977. var o = t.low
  35978. , a = t.high;
  35979. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  35980. this.view[i + 2] = o >>> 16 & 255,
  35981. this.view[i + 1] = o >>> 8 & 255,
  35982. this.view[i] = 255 & o,
  35983. i += 4,
  35984. this.view[i + 3] = a >>> 24 & 255,
  35985. this.view[i + 2] = a >>> 16 & 255,
  35986. this.view[i + 1] = a >>> 8 & 255,
  35987. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  35988. this.view[i + 1] = a >>> 16 & 255,
  35989. this.view[i + 2] = a >>> 8 & 255,
  35990. this.view[i + 3] = 255 & a,
  35991. i += 4,
  35992. this.view[i] = o >>> 24 & 255,
  35993. this.view[i + 1] = o >>> 16 & 255,
  35994. this.view[i + 2] = o >>> 8 & 255,
  35995. this.view[i + 3] = 255 & o),
  35996. n && (this.offset += 8),
  35997. this
  35998. }
  35999. ,
  36000. a.writeUInt64 = a.writeUint64,
  36001. a.readUint64 = function(t) {
  36002. var i = "undefined" == typeof t;
  36003. if (i && (t = this.offset),
  36004. !this.noAssert) {
  36005. if ("number" != typeof t || t % 1 !== 0)
  36006. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36007. if (t >>>= 0,
  36008. t < 0 || t + 8 > this.buffer.byteLength)
  36009. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  36010. }
  36011. var n = 0
  36012. , r = 0;
  36013. this.littleEndian ? (n = this.view[t + 2] << 16,
  36014. n |= this.view[t + 1] << 8,
  36015. n |= this.view[t],
  36016. n += this.view[t + 3] << 24 >>> 0,
  36017. t += 4,
  36018. r = this.view[t + 2] << 16,
  36019. r |= this.view[t + 1] << 8,
  36020. r |= this.view[t],
  36021. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  36022. r |= this.view[t + 2] << 8,
  36023. r |= this.view[t + 3],
  36024. r += this.view[t] << 24 >>> 0,
  36025. t += 4,
  36026. n = this.view[t + 1] << 16,
  36027. n |= this.view[t + 2] << 8,
  36028. n |= this.view[t + 3],
  36029. n += this.view[t] << 24 >>> 0);
  36030. var o = new e(n,r,!0);
  36031. return i && (this.offset += 8),
  36032. o
  36033. }
  36034. ,
  36035. a.readUInt64 = a.readUint64),
  36036. a.writeFloat32 = function(e, t) {
  36037. var i = "undefined" == typeof t;
  36038. if (i && (t = this.offset),
  36039. !this.noAssert) {
  36040. if ("number" != typeof e)
  36041. throw TypeError("Illegal value: " + e + " (not a number)");
  36042. if ("number" != typeof t || t % 1 !== 0)
  36043. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36044. if (t >>>= 0,
  36045. t < 0 || t + 0 > this.buffer.byteLength)
  36046. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36047. }
  36048. t += 4;
  36049. var n = this.buffer.byteLength;
  36050. return t > n && this.resize((n *= 2) > t ? n : t),
  36051. t -= 4,
  36052. r(this.view, e, t, this.littleEndian, 23, 4),
  36053. i && (this.offset += 4),
  36054. this
  36055. }
  36056. ,
  36057. a.writeFloat = a.writeFloat32,
  36058. a.readFloat32 = function(e) {
  36059. var t = "undefined" == typeof e;
  36060. if (t && (e = this.offset),
  36061. !this.noAssert) {
  36062. if ("number" != typeof e || e % 1 !== 0)
  36063. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36064. if (e >>>= 0,
  36065. e < 0 || e + 4 > this.buffer.byteLength)
  36066. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  36067. }
  36068. var i = n(this.view, e, this.littleEndian, 23, 4);
  36069. return t && (this.offset += 4),
  36070. i
  36071. }
  36072. ,
  36073. a.readFloat = a.readFloat32,
  36074. a.writeFloat64 = function(e, t) {
  36075. var i = "undefined" == typeof t;
  36076. if (i && (t = this.offset),
  36077. !this.noAssert) {
  36078. if ("number" != typeof e)
  36079. throw TypeError("Illegal value: " + e + " (not a number)");
  36080. if ("number" != typeof t || t % 1 !== 0)
  36081. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36082. if (t >>>= 0,
  36083. t < 0 || t + 0 > this.buffer.byteLength)
  36084. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36085. }
  36086. t += 8;
  36087. var n = this.buffer.byteLength;
  36088. return t > n && this.resize((n *= 2) > t ? n : t),
  36089. t -= 8,
  36090. r(this.view, e, t, this.littleEndian, 52, 8),
  36091. i && (this.offset += 8),
  36092. this
  36093. }
  36094. ,
  36095. a.writeDouble = a.writeFloat64,
  36096. a.readFloat64 = function(e) {
  36097. var t = "undefined" == typeof e;
  36098. if (t && (e = this.offset),
  36099. !this.noAssert) {
  36100. if ("number" != typeof e || e % 1 !== 0)
  36101. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36102. if (e >>>= 0,
  36103. e < 0 || e + 8 > this.buffer.byteLength)
  36104. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  36105. }
  36106. var i = n(this.view, e, this.littleEndian, 52, 8);
  36107. return t && (this.offset += 8),
  36108. i
  36109. }
  36110. ,
  36111. a.readDouble = a.readFloat64,
  36112. o.MAX_VARINT32_BYTES = 5,
  36113. o.calculateVarint32 = function(e) {
  36114. return e >>>= 0,
  36115. e < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  36116. }
  36117. ,
  36118. o.zigZagEncode32 = function(e) {
  36119. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  36120. }
  36121. ,
  36122. o.zigZagDecode32 = function(e) {
  36123. return e >>> 1 ^ -(1 & e) | 0
  36124. }
  36125. ,
  36126. a.writeVarint32 = function(e, t) {
  36127. var i = "undefined" == typeof t;
  36128. if (i && (t = this.offset),
  36129. !this.noAssert) {
  36130. if ("number" != typeof e || e % 1 !== 0)
  36131. throw TypeError("Illegal value: " + e + " (not an integer)");
  36132. if (e |= 0,
  36133. "number" != typeof t || t % 1 !== 0)
  36134. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36135. if (t >>>= 0,
  36136. t < 0 || t + 0 > this.buffer.byteLength)
  36137. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36138. }
  36139. var n, r = o.calculateVarint32(e);
  36140. t += r;
  36141. var a = this.buffer.byteLength;
  36142. for (t > a && this.resize((a *= 2) > t ? a : t),
  36143. t -= r,
  36144. e >>>= 0; e >= 128; )
  36145. n = 127 & e | 128,
  36146. this.view[t++] = n,
  36147. e >>>= 7;
  36148. return this.view[t++] = e,
  36149. i ? (this.offset = t,
  36150. this) : r
  36151. }
  36152. ,
  36153. a.writeVarint32ZigZag = function(e, t) {
  36154. return this.writeVarint32(o.zigZagEncode32(e), t)
  36155. }
  36156. ,
  36157. a.readVarint32 = function(e) {
  36158. var t = "undefined" == typeof e;
  36159. if (t && (e = this.offset),
  36160. !this.noAssert) {
  36161. if ("number" != typeof e || e % 1 !== 0)
  36162. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36163. if (e >>>= 0,
  36164. e < 0 || e + 1 > this.buffer.byteLength)
  36165. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  36166. }
  36167. var i, n = 0, r = 0;
  36168. do {
  36169. if (!this.noAssert && e > this.limit) {
  36170. var o = Error("Truncated");
  36171. throw o.truncated = !0,
  36172. o
  36173. }
  36174. i = this.view[e++],
  36175. n < 5 && (r |= (127 & i) << 7 * n),
  36176. ++n
  36177. } while (0 !== (128 & i));return r |= 0,
  36178. t ? (this.offset = e,
  36179. r) : {
  36180. value: r,
  36181. length: n
  36182. }
  36183. }
  36184. ,
  36185. a.readVarint32ZigZag = function(e) {
  36186. var t = this.readVarint32(e);
  36187. return "object" == typeof t ? t.value = o.zigZagDecode32(t.value) : t = o.zigZagDecode32(t),
  36188. t
  36189. }
  36190. ,
  36191. e && (o.MAX_VARINT64_BYTES = 10,
  36192. o.calculateVarint64 = function(t) {
  36193. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t));
  36194. var i = t.toInt() >>> 0
  36195. , n = t.shiftRightUnsigned(28).toInt() >>> 0
  36196. , r = t.shiftRightUnsigned(56).toInt() >>> 0;
  36197. return 0 == r ? 0 == n ? i < 16384 ? i < 128 ? 1 : 2 : i < 1 << 21 ? 3 : 4 : n < 16384 ? n < 128 ? 5 : 6 : n < 1 << 21 ? 7 : 8 : r < 128 ? 9 : 10
  36198. }
  36199. ,
  36200. o.zigZagEncode64 = function(t) {
  36201. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  36202. t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()
  36203. }
  36204. ,
  36205. o.zigZagDecode64 = function(t) {
  36206. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  36207. t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()
  36208. }
  36209. ,
  36210. a.writeVarint64 = function(t, i) {
  36211. var n = "undefined" == typeof i;
  36212. if (n && (i = this.offset),
  36213. !this.noAssert) {
  36214. if ("number" == typeof t)
  36215. t = e.fromNumber(t);
  36216. else if ("string" == typeof t)
  36217. t = e.fromString(t);
  36218. else if (!(t && t instanceof e))
  36219. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  36220. if ("number" != typeof i || i % 1 !== 0)
  36221. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36222. if (i >>>= 0,
  36223. i < 0 || i + 0 > this.buffer.byteLength)
  36224. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36225. }
  36226. "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned());
  36227. var r = o.calculateVarint64(t)
  36228. , a = t.toInt() >>> 0
  36229. , s = t.shiftRightUnsigned(28).toInt() >>> 0
  36230. , l = t.shiftRightUnsigned(56).toInt() >>> 0;
  36231. i += r;
  36232. var c = this.buffer.byteLength;
  36233. switch (i > c && this.resize((c *= 2) > i ? c : i),
  36234. i -= r,
  36235. r) {
  36236. case 10:
  36237. this.view[i + 9] = l >>> 7 & 1;
  36238. case 9:
  36239. this.view[i + 8] = 9 !== r ? 128 | l : 127 & l;
  36240. case 8:
  36241. this.view[i + 7] = 8 !== r ? s >>> 21 | 128 : s >>> 21 & 127;
  36242. case 7:
  36243. this.view[i + 6] = 7 !== r ? s >>> 14 | 128 : s >>> 14 & 127;
  36244. case 6:
  36245. this.view[i + 5] = 6 !== r ? s >>> 7 | 128 : s >>> 7 & 127;
  36246. case 5:
  36247. this.view[i + 4] = 5 !== r ? 128 | s : 127 & s;
  36248. case 4:
  36249. this.view[i + 3] = 4 !== r ? a >>> 21 | 128 : a >>> 21 & 127;
  36250. case 3:
  36251. this.view[i + 2] = 3 !== r ? a >>> 14 | 128 : a >>> 14 & 127;
  36252. case 2:
  36253. this.view[i + 1] = 2 !== r ? a >>> 7 | 128 : a >>> 7 & 127;
  36254. case 1:
  36255. this.view[i] = 1 !== r ? 128 | a : 127 & a
  36256. }
  36257. return n ? (this.offset += r,
  36258. this) : r
  36259. }
  36260. ,
  36261. a.writeVarint64ZigZag = function(e, t) {
  36262. return this.writeVarint64(o.zigZagEncode64(e), t)
  36263. }
  36264. ,
  36265. a.readVarint64 = function(t) {
  36266. var i = "undefined" == typeof t;
  36267. if (i && (t = this.offset),
  36268. !this.noAssert) {
  36269. if ("number" != typeof t || t % 1 !== 0)
  36270. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36271. if (t >>>= 0,
  36272. t < 0 || t + 1 > this.buffer.byteLength)
  36273. throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
  36274. }
  36275. var n = t
  36276. , r = 0
  36277. , o = 0
  36278. , a = 0
  36279. , s = 0;
  36280. if (s = this.view[t++],
  36281. r = 127 & s,
  36282. 128 & s && (s = this.view[t++],
  36283. r |= (127 & s) << 7,
  36284. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  36285. r |= (127 & s) << 14,
  36286. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  36287. r |= (127 & s) << 21,
  36288. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  36289. o = 127 & s,
  36290. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  36291. o |= (127 & s) << 7,
  36292. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  36293. o |= (127 & s) << 14,
  36294. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  36295. o |= (127 & s) << 21,
  36296. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  36297. a = 127 & s,
  36298. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  36299. a |= (127 & s) << 7,
  36300. 128 & s || this.noAssert && "undefined" == typeof s))))))))))
  36301. throw Error("Buffer overrun");
  36302. var l = e.fromBits(r | o << 28, o >>> 4 | a << 24, !1);
  36303. return i ? (this.offset = t,
  36304. l) : {
  36305. value: l,
  36306. length: t - n
  36307. }
  36308. }
  36309. ,
  36310. a.readVarint64ZigZag = function(t) {
  36311. var i = this.readVarint64(t);
  36312. return i && i.value instanceof e ? i.value = o.zigZagDecode64(i.value) : i = o.zigZagDecode64(i),
  36313. i
  36314. }
  36315. ),
  36316. a.writeCString = function(e, i) {
  36317. var n = "undefined" == typeof i;
  36318. n && (i = this.offset);
  36319. var r, o = e.length;
  36320. if (!this.noAssert) {
  36321. if ("string" != typeof e)
  36322. throw TypeError("Illegal str: Not a string");
  36323. for (r = 0; r < o; ++r)
  36324. if (0 === e.charCodeAt(r))
  36325. throw RangeError("Illegal str: Contains NULL-characters");
  36326. if ("number" != typeof i || i % 1 !== 0)
  36327. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36328. if (i >>>= 0,
  36329. i < 0 || i + 0 > this.buffer.byteLength)
  36330. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36331. }
  36332. o = h.calculateUTF16asUTF8(t(e))[1],
  36333. i += o + 1;
  36334. var a = this.buffer.byteLength;
  36335. return i > a && this.resize((a *= 2) > i ? a : i),
  36336. i -= o + 1,
  36337. h.encodeUTF16toUTF8(t(e), function(e) {
  36338. this.view[i++] = e
  36339. }
  36340. .bind(this)),
  36341. this.view[i++] = 0,
  36342. n ? (this.offset = i,
  36343. this) : o
  36344. }
  36345. ,
  36346. a.readCString = function(e) {
  36347. var t = "undefined" == typeof e;
  36348. if (t && (e = this.offset),
  36349. !this.noAssert) {
  36350. if ("number" != typeof e || e % 1 !== 0)
  36351. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36352. if (e >>>= 0,
  36353. e < 0 || e + 1 > this.buffer.byteLength)
  36354. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  36355. }
  36356. var n, r = e, o = -1;
  36357. return h.decodeUTF8toUTF16(function() {
  36358. if (0 === o)
  36359. return null;
  36360. if (e >= this.limit)
  36361. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  36362. return o = this.view[e++],
  36363. 0 === o ? null : o
  36364. }
  36365. .bind(this), n = i(), !0),
  36366. t ? (this.offset = e,
  36367. n()) : {
  36368. string: n(),
  36369. length: e - r
  36370. }
  36371. }
  36372. ,
  36373. a.writeIString = function(e, i) {
  36374. var n = "undefined" == typeof i;
  36375. if (n && (i = this.offset),
  36376. !this.noAssert) {
  36377. if ("string" != typeof e)
  36378. throw TypeError("Illegal str: Not a string");
  36379. if ("number" != typeof i || i % 1 !== 0)
  36380. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36381. if (i >>>= 0,
  36382. i < 0 || i + 0 > this.buffer.byteLength)
  36383. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36384. }
  36385. var r, o = i;
  36386. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  36387. i += 4 + r;
  36388. var a = this.buffer.byteLength;
  36389. if (i > a && this.resize((a *= 2) > i ? a : i),
  36390. i -= 4 + r,
  36391. this.littleEndian ? (this.view[i + 3] = r >>> 24 & 255,
  36392. this.view[i + 2] = r >>> 16 & 255,
  36393. this.view[i + 1] = r >>> 8 & 255,
  36394. this.view[i] = 255 & r) : (this.view[i] = r >>> 24 & 255,
  36395. this.view[i + 1] = r >>> 16 & 255,
  36396. this.view[i + 2] = r >>> 8 & 255,
  36397. this.view[i + 3] = 255 & r),
  36398. i += 4,
  36399. h.encodeUTF16toUTF8(t(e), function(e) {
  36400. this.view[i++] = e
  36401. }
  36402. .bind(this)),
  36403. i !== o + 4 + r)
  36404. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + 4 + r));
  36405. return n ? (this.offset = i,
  36406. this) : i - o
  36407. }
  36408. ,
  36409. a.readIString = function(e) {
  36410. var t = "undefined" == typeof e;
  36411. if (t && (e = this.offset),
  36412. !this.noAssert) {
  36413. if ("number" != typeof e || e % 1 !== 0)
  36414. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36415. if (e >>>= 0,
  36416. e < 0 || e + 4 > this.buffer.byteLength)
  36417. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  36418. }
  36419. var i = e
  36420. , n = this.readUint32(e)
  36421. , r = this.readUTF8String(n, o.METRICS_BYTES, e += 4);
  36422. return e += r.length,
  36423. t ? (this.offset = e,
  36424. r.string) : {
  36425. string: r.string,
  36426. length: e - i
  36427. }
  36428. }
  36429. ,
  36430. o.METRICS_CHARS = "c",
  36431. o.METRICS_BYTES = "b",
  36432. a.writeUTF8String = function(e, i) {
  36433. var n = "undefined" == typeof i;
  36434. if (n && (i = this.offset),
  36435. !this.noAssert) {
  36436. if ("number" != typeof i || i % 1 !== 0)
  36437. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36438. if (i >>>= 0,
  36439. i < 0 || i + 0 > this.buffer.byteLength)
  36440. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36441. }
  36442. var r, o = i;
  36443. r = h.calculateUTF16asUTF8(t(e))[1],
  36444. i += r;
  36445. var a = this.buffer.byteLength;
  36446. return i > a && this.resize((a *= 2) > i ? a : i),
  36447. i -= r,
  36448. h.encodeUTF16toUTF8(t(e), function(e) {
  36449. this.view[i++] = e
  36450. }
  36451. .bind(this)),
  36452. n ? (this.offset = i,
  36453. this) : i - o
  36454. }
  36455. ,
  36456. a.writeString = a.writeUTF8String,
  36457. o.calculateUTF8Chars = function(e) {
  36458. return h.calculateUTF16asUTF8(t(e))[0]
  36459. }
  36460. ,
  36461. o.calculateUTF8Bytes = function(e) {
  36462. return h.calculateUTF16asUTF8(t(e))[1]
  36463. }
  36464. ,
  36465. o.calculateString = o.calculateUTF8Bytes,
  36466. a.readUTF8String = function(e, t, n) {
  36467. "number" == typeof t && (n = t,
  36468. t = void 0);
  36469. var r = "undefined" == typeof n;
  36470. if (r && (n = this.offset),
  36471. "undefined" == typeof t && (t = o.METRICS_CHARS),
  36472. !this.noAssert) {
  36473. if ("number" != typeof e || e % 1 !== 0)
  36474. throw TypeError("Illegal length: " + e + " (not an integer)");
  36475. if (e |= 0,
  36476. "number" != typeof n || n % 1 !== 0)
  36477. throw TypeError("Illegal offset: " + n + " (not an integer)");
  36478. if (n >>>= 0,
  36479. n < 0 || n + 0 > this.buffer.byteLength)
  36480. throw RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
  36481. }
  36482. var a, s = 0, l = n;
  36483. if (t === o.METRICS_CHARS) {
  36484. if (a = i(),
  36485. h.decodeUTF8(function() {
  36486. return s < e && n < this.limit ? this.view[n++] : null
  36487. }
  36488. .bind(this), function(e) {
  36489. ++s,
  36490. h.UTF8toUTF16(e, a)
  36491. }),
  36492. s !== e)
  36493. throw RangeError("Illegal range: Truncated data, " + s + " == " + e);
  36494. return r ? (this.offset = n,
  36495. a()) : {
  36496. string: a(),
  36497. length: n - l
  36498. }
  36499. }
  36500. if (t === o.METRICS_BYTES) {
  36501. if (!this.noAssert) {
  36502. if ("number" != typeof n || n % 1 !== 0)
  36503. throw TypeError("Illegal offset: " + n + " (not an integer)");
  36504. if (n >>>= 0,
  36505. n < 0 || n + e > this.buffer.byteLength)
  36506. throw RangeError("Illegal offset: 0 <= " + n + " (+" + e + ") <= " + this.buffer.byteLength)
  36507. }
  36508. var c = n + e;
  36509. if (h.decodeUTF8toUTF16(function() {
  36510. return n < c ? this.view[n++] : null
  36511. }
  36512. .bind(this), a = i(), this.noAssert),
  36513. n !== c)
  36514. throw RangeError("Illegal range: Truncated data, " + n + " == " + c);
  36515. return r ? (this.offset = n,
  36516. a()) : {
  36517. string: a(),
  36518. length: n - l
  36519. }
  36520. }
  36521. throw TypeError("Unsupported metrics: " + t)
  36522. }
  36523. ,
  36524. a.readString = a.readUTF8String,
  36525. a.writeVString = function(e, i) {
  36526. var n = "undefined" == typeof i;
  36527. if (n && (i = this.offset),
  36528. !this.noAssert) {
  36529. if ("string" != typeof e)
  36530. throw TypeError("Illegal str: Not a string");
  36531. if ("number" != typeof i || i % 1 !== 0)
  36532. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36533. if (i >>>= 0,
  36534. i < 0 || i + 0 > this.buffer.byteLength)
  36535. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36536. }
  36537. var r, a, s = i;
  36538. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  36539. a = o.calculateVarint32(r),
  36540. i += a + r;
  36541. var l = this.buffer.byteLength;
  36542. if (i > l && this.resize((l *= 2) > i ? l : i),
  36543. i -= a + r,
  36544. i += this.writeVarint32(r, i),
  36545. h.encodeUTF16toUTF8(t(e), function(e) {
  36546. this.view[i++] = e
  36547. }
  36548. .bind(this)),
  36549. i !== s + r + a)
  36550. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + r + a));
  36551. return n ? (this.offset = i,
  36552. this) : i - s
  36553. }
  36554. ,
  36555. a.readVString = function(e) {
  36556. var t = "undefined" == typeof e;
  36557. if (t && (e = this.offset),
  36558. !this.noAssert) {
  36559. if ("number" != typeof e || e % 1 !== 0)
  36560. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36561. if (e >>>= 0,
  36562. e < 0 || e + 1 > this.buffer.byteLength)
  36563. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  36564. }
  36565. var i = e
  36566. , n = this.readVarint32(e)
  36567. , r = this.readUTF8String(n.value, o.METRICS_BYTES, e += n.length);
  36568. return e += r.length,
  36569. t ? (this.offset = e,
  36570. r.string) : {
  36571. string: r.string,
  36572. length: e - i
  36573. }
  36574. }
  36575. ,
  36576. a.append = function(e, t, i) {
  36577. "number" != typeof t && "string" == typeof t || (i = t,
  36578. t = void 0);
  36579. var n = "undefined" == typeof i;
  36580. if (n && (i = this.offset),
  36581. !this.noAssert) {
  36582. if ("number" != typeof i || i % 1 !== 0)
  36583. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36584. if (i >>>= 0,
  36585. i < 0 || i + 0 > this.buffer.byteLength)
  36586. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36587. }
  36588. e instanceof o || (e = o.wrap(e, t));
  36589. var r = e.limit - e.offset;
  36590. if (r <= 0)
  36591. return this;
  36592. i += r;
  36593. var a = this.buffer.byteLength;
  36594. return i > a && this.resize((a *= 2) > i ? a : i),
  36595. i -= r,
  36596. this.view.set(e.view.subarray(e.offset, e.limit), i),
  36597. e.offset += r,
  36598. n && (this.offset += r),
  36599. this
  36600. }
  36601. ,
  36602. a.appendTo = function(e, t) {
  36603. return e.append(this, t),
  36604. this
  36605. }
  36606. ,
  36607. a.assert = function(e) {
  36608. return this.noAssert = !e,
  36609. this
  36610. }
  36611. ,
  36612. a.capacity = function() {
  36613. return this.buffer.byteLength
  36614. }
  36615. ,
  36616. a.clear = function() {
  36617. return this.offset = 0,
  36618. this.limit = this.buffer.byteLength,
  36619. this.markedOffset = -1,
  36620. this
  36621. }
  36622. ,
  36623. a.clone = function(e) {
  36624. var t = new o(0,this.littleEndian,this.noAssert);
  36625. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  36626. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  36627. t.view = this.view),
  36628. t.offset = this.offset,
  36629. t.markedOffset = this.markedOffset,
  36630. t.limit = this.limit,
  36631. t
  36632. }
  36633. ,
  36634. a.compact = function(e, t) {
  36635. if ("undefined" == typeof e && (e = this.offset),
  36636. "undefined" == typeof t && (t = this.limit),
  36637. !this.noAssert) {
  36638. if ("number" != typeof e || e % 1 !== 0)
  36639. throw TypeError("Illegal begin: Not an integer");
  36640. if (e >>>= 0,
  36641. "number" != typeof t || t % 1 !== 0)
  36642. throw TypeError("Illegal end: Not an integer");
  36643. if (t >>>= 0,
  36644. e < 0 || e > t || t > this.buffer.byteLength)
  36645. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36646. }
  36647. if (0 === e && t === this.buffer.byteLength)
  36648. return this;
  36649. var i = t - e;
  36650. if (0 === i)
  36651. return this.buffer = s,
  36652. this.view = null,
  36653. this.markedOffset >= 0 && (this.markedOffset -= e),
  36654. this.offset = 0,
  36655. this.limit = 0,
  36656. this;
  36657. var n = new ArrayBuffer(i)
  36658. , r = new Uint8Array(n);
  36659. return r.set(this.view.subarray(e, t)),
  36660. this.buffer = n,
  36661. this.view = r,
  36662. this.markedOffset >= 0 && (this.markedOffset -= e),
  36663. this.offset = 0,
  36664. this.limit = i,
  36665. this
  36666. }
  36667. ,
  36668. a.copy = function(e, t) {
  36669. if ("undefined" == typeof e && (e = this.offset),
  36670. "undefined" == typeof t && (t = this.limit),
  36671. !this.noAssert) {
  36672. if ("number" != typeof e || e % 1 !== 0)
  36673. throw TypeError("Illegal begin: Not an integer");
  36674. if (e >>>= 0,
  36675. "number" != typeof t || t % 1 !== 0)
  36676. throw TypeError("Illegal end: Not an integer");
  36677. if (t >>>= 0,
  36678. e < 0 || e > t || t > this.buffer.byteLength)
  36679. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36680. }
  36681. if (e === t)
  36682. return new o(0,this.littleEndian,this.noAssert);
  36683. var i = t - e
  36684. , n = new o(i,this.littleEndian,this.noAssert);
  36685. return n.offset = 0,
  36686. n.limit = i,
  36687. n.markedOffset >= 0 && (n.markedOffset -= e),
  36688. this.copyTo(n, 0, e, t),
  36689. n
  36690. }
  36691. ,
  36692. a.copyTo = function(e, t, i, n) {
  36693. var r, a;
  36694. if (!this.noAssert && !o.isByteBuffer(e))
  36695. throw TypeError("Illegal target: Not a ByteBuffer");
  36696. if (t = (a = "undefined" == typeof t) ? e.offset : 0 | t,
  36697. i = (r = "undefined" == typeof i) ? this.offset : 0 | i,
  36698. n = "undefined" == typeof n ? this.limit : 0 | n,
  36699. t < 0 || t > e.buffer.byteLength)
  36700. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  36701. if (i < 0 || n > this.buffer.byteLength)
  36702. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  36703. var s = n - i;
  36704. return 0 === s ? e : (e.ensureCapacity(t + s),
  36705. e.view.set(this.view.subarray(i, n), t),
  36706. r && (this.offset += s),
  36707. a && (e.offset += s),
  36708. this)
  36709. }
  36710. ,
  36711. a.ensureCapacity = function(e) {
  36712. var t = this.buffer.byteLength;
  36713. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  36714. }
  36715. ,
  36716. a.fill = function(e, t, i) {
  36717. var n = "undefined" == typeof t;
  36718. if (n && (t = this.offset),
  36719. "string" == typeof e && e.length > 0 && (e = e.charCodeAt(0)),
  36720. "undefined" == typeof t && (t = this.offset),
  36721. "undefined" == typeof i && (i = this.limit),
  36722. !this.noAssert) {
  36723. if ("number" != typeof e || e % 1 !== 0)
  36724. throw TypeError("Illegal value: " + e + " (not an integer)");
  36725. if (e |= 0,
  36726. "number" != typeof t || t % 1 !== 0)
  36727. throw TypeError("Illegal begin: Not an integer");
  36728. if (t >>>= 0,
  36729. "number" != typeof i || i % 1 !== 0)
  36730. throw TypeError("Illegal end: Not an integer");
  36731. if (i >>>= 0,
  36732. t < 0 || t > i || i > this.buffer.byteLength)
  36733. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36734. }
  36735. if (t >= i)
  36736. return this;
  36737. for (; t < i; )
  36738. this.view[t++] = e;
  36739. return n && (this.offset = t),
  36740. this
  36741. }
  36742. ,
  36743. a.flip = function() {
  36744. return this.limit = this.offset,
  36745. this.offset = 0,
  36746. this
  36747. }
  36748. ,
  36749. a.mark = function(e) {
  36750. if (e = "undefined" == typeof e ? this.offset : e,
  36751. !this.noAssert) {
  36752. if ("number" != typeof e || e % 1 !== 0)
  36753. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36754. if (e >>>= 0,
  36755. e < 0 || e + 0 > this.buffer.byteLength)
  36756. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  36757. }
  36758. return this.markedOffset = e,
  36759. this
  36760. }
  36761. ,
  36762. a.order = function(e) {
  36763. if (!this.noAssert && "boolean" != typeof e)
  36764. throw TypeError("Illegal littleEndian: Not a boolean");
  36765. return this.littleEndian = !!e,
  36766. this
  36767. }
  36768. ,
  36769. a.LE = function(e) {
  36770. return this.littleEndian = "undefined" == typeof e || !!e,
  36771. this
  36772. }
  36773. ,
  36774. a.BE = function(e) {
  36775. return this.littleEndian = "undefined" != typeof e && !e,
  36776. this
  36777. }
  36778. ,
  36779. a.prepend = function(e, t, i) {
  36780. "number" != typeof t && "string" == typeof t || (i = t,
  36781. t = void 0);
  36782. var n = "undefined" == typeof i;
  36783. if (n && (i = this.offset),
  36784. !this.noAssert) {
  36785. if ("number" != typeof i || i % 1 !== 0)
  36786. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36787. if (i >>>= 0,
  36788. i < 0 || i + 0 > this.buffer.byteLength)
  36789. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36790. }
  36791. e instanceof o || (e = o.wrap(e, t));
  36792. var r = e.limit - e.offset;
  36793. if (r <= 0)
  36794. return this;
  36795. var a = r - i;
  36796. if (a > 0) {
  36797. var s = new ArrayBuffer(this.buffer.byteLength + a)
  36798. , l = new Uint8Array(s);
  36799. l.set(this.view.subarray(i, this.buffer.byteLength), r),
  36800. this.buffer = s,
  36801. this.view = l,
  36802. this.offset += a,
  36803. this.markedOffset >= 0 && (this.markedOffset += a),
  36804. this.limit += a,
  36805. i += a
  36806. } else {
  36807. new Uint8Array(this.buffer)
  36808. }
  36809. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  36810. e.offset = e.limit,
  36811. n && (this.offset -= r),
  36812. this
  36813. }
  36814. ,
  36815. a.prependTo = function(e, t) {
  36816. return e.prepend(this, t),
  36817. this
  36818. }
  36819. ,
  36820. a.printDebug = function(e) {
  36821. "function" != typeof e && (e = console.log.bind(console)),
  36822. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  36823. }
  36824. ,
  36825. a.remaining = function() {
  36826. return this.limit - this.offset
  36827. }
  36828. ,
  36829. a.reset = function() {
  36830. return this.markedOffset >= 0 ? (this.offset = this.markedOffset,
  36831. this.markedOffset = -1) : this.offset = 0,
  36832. this
  36833. }
  36834. ,
  36835. a.resize = function(e) {
  36836. if (!this.noAssert) {
  36837. if ("number" != typeof e || e % 1 !== 0)
  36838. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  36839. if (e |= 0,
  36840. e < 0)
  36841. throw RangeError("Illegal capacity: 0 <= " + e)
  36842. }
  36843. if (this.buffer.byteLength < e) {
  36844. var t = new ArrayBuffer(e)
  36845. , i = new Uint8Array(t);
  36846. i.set(this.view),
  36847. this.buffer = t,
  36848. this.view = i
  36849. }
  36850. return this
  36851. }
  36852. ,
  36853. a.reverse = function(e, t) {
  36854. if ("undefined" == typeof e && (e = this.offset),
  36855. "undefined" == typeof t && (t = this.limit),
  36856. !this.noAssert) {
  36857. if ("number" != typeof e || e % 1 !== 0)
  36858. throw TypeError("Illegal begin: Not an integer");
  36859. if (e >>>= 0,
  36860. "number" != typeof t || t % 1 !== 0)
  36861. throw TypeError("Illegal end: Not an integer");
  36862. if (t >>>= 0,
  36863. e < 0 || e > t || t > this.buffer.byteLength)
  36864. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36865. }
  36866. return e === t ? this : (Array.prototype.reverse.call(this.view.subarray(e, t)),
  36867. this)
  36868. }
  36869. ,
  36870. a.skip = function(e) {
  36871. if (!this.noAssert) {
  36872. if ("number" != typeof e || e % 1 !== 0)
  36873. throw TypeError("Illegal length: " + e + " (not an integer)");
  36874. e |= 0
  36875. }
  36876. var t = this.offset + e;
  36877. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  36878. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  36879. return this.offset = t,
  36880. this
  36881. }
  36882. ,
  36883. a.slice = function(e, t) {
  36884. if ("undefined" == typeof e && (e = this.offset),
  36885. "undefined" == typeof t && (t = this.limit),
  36886. !this.noAssert) {
  36887. if ("number" != typeof e || e % 1 !== 0)
  36888. throw TypeError("Illegal begin: Not an integer");
  36889. if (e >>>= 0,
  36890. "number" != typeof t || t % 1 !== 0)
  36891. throw TypeError("Illegal end: Not an integer");
  36892. if (t >>>= 0,
  36893. e < 0 || e > t || t > this.buffer.byteLength)
  36894. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36895. }
  36896. var i = this.clone();
  36897. return i.offset = e,
  36898. i.limit = t,
  36899. i
  36900. }
  36901. ,
  36902. a.toBuffer = function(e) {
  36903. var t = this.offset
  36904. , i = this.limit;
  36905. if (!this.noAssert) {
  36906. if ("number" != typeof t || t % 1 !== 0)
  36907. throw TypeError("Illegal offset: Not an integer");
  36908. if (t >>>= 0,
  36909. "number" != typeof i || i % 1 !== 0)
  36910. throw TypeError("Illegal limit: Not an integer");
  36911. if (i >>>= 0,
  36912. t < 0 || t > i || i > this.buffer.byteLength)
  36913. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36914. }
  36915. if (!e && 0 === t && i === this.buffer.byteLength)
  36916. return this.buffer;
  36917. if (t === i)
  36918. return s;
  36919. var n = new ArrayBuffer(i - t);
  36920. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  36921. n
  36922. }
  36923. ,
  36924. a.toArrayBuffer = a.toBuffer,
  36925. a.toString = function(e, t, i) {
  36926. if ("undefined" == typeof e)
  36927. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  36928. switch ("number" == typeof e && (e = "utf8",
  36929. t = e,
  36930. i = t),
  36931. e) {
  36932. case "utf8":
  36933. return this.toUTF8(t, i);
  36934. case "base64":
  36935. return this.toBase64(t, i);
  36936. case "hex":
  36937. return this.toHex(t, i);
  36938. case "binary":
  36939. return this.toBinary(t, i);
  36940. case "debug":
  36941. return this.toDebug();
  36942. case "columns":
  36943. return this.toColumns();
  36944. default:
  36945. throw Error("Unsupported encoding: " + e)
  36946. }
  36947. }
  36948. ;
  36949. var c = function() {
  36950. for (var e = {}, t = [65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47], i = [], n = 0, r = t.length; n < r; ++n)
  36951. i[t[n]] = n;
  36952. return e.encode = function(e, i) {
  36953. for (var n, r; null !== (n = e()); )
  36954. i(t[n >> 2 & 63]),
  36955. r = (3 & n) << 4,
  36956. null !== (n = e()) ? (r |= n >> 4 & 15,
  36957. i(t[63 & (r | n >> 4 & 15)]),
  36958. r = (15 & n) << 2,
  36959. null !== (n = e()) ? (i(t[63 & (r | n >> 6 & 3)]),
  36960. i(t[63 & n])) : (i(t[63 & r]),
  36961. i(61))) : (i(t[63 & r]),
  36962. i(61),
  36963. i(61))
  36964. }
  36965. ,
  36966. e.decode = function(e, t) {
  36967. function n(e) {
  36968. throw Error("Illegal character code: " + e)
  36969. }
  36970. for (var r, o, a; null !== (r = e()); )
  36971. if (o = i[r],
  36972. "undefined" == typeof o && n(r),
  36973. null !== (r = e()) && (a = i[r],
  36974. "undefined" == typeof a && n(r),
  36975. t(o << 2 >>> 0 | (48 & a) >> 4),
  36976. null !== (r = e()))) {
  36977. if (o = i[r],
  36978. "undefined" == typeof o) {
  36979. if (61 === r)
  36980. break;
  36981. n(r)
  36982. }
  36983. if (t((15 & a) << 4 >>> 0 | (60 & o) >> 2),
  36984. null !== (r = e())) {
  36985. if (a = i[r],
  36986. "undefined" == typeof a) {
  36987. if (61 === r)
  36988. break;
  36989. n(r)
  36990. }
  36991. t((3 & o) << 6 >>> 0 | a)
  36992. }
  36993. }
  36994. }
  36995. ,
  36996. e.test = function(e) {
  36997. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  36998. }
  36999. ,
  37000. e
  37001. }();
  37002. a.toBase64 = function(e, t) {
  37003. if ("undefined" == typeof e && (e = this.offset),
  37004. "undefined" == typeof t && (t = this.limit),
  37005. e |= 0,
  37006. t |= 0,
  37007. e < 0 || t > this.capacity || e > t)
  37008. throw RangeError("begin, end");
  37009. var n;
  37010. return c.encode(function() {
  37011. return e < t ? this.view[e++] : null
  37012. }
  37013. .bind(this), n = i()),
  37014. n()
  37015. }
  37016. ,
  37017. o.fromBase64 = function(e, i) {
  37018. if ("string" != typeof e)
  37019. throw TypeError("str");
  37020. var n = new o(e.length / 4 * 3,i)
  37021. , r = 0;
  37022. return c.decode(t(e), function(e) {
  37023. n.view[r++] = e
  37024. }),
  37025. n.limit = r,
  37026. n
  37027. }
  37028. ,
  37029. o.btoa = function(e) {
  37030. return o.fromBinary(e).toBase64()
  37031. }
  37032. ,
  37033. o.atob = function(e) {
  37034. return o.fromBase64(e).toBinary()
  37035. }
  37036. ,
  37037. a.toBinary = function(e, t) {
  37038. if ("undefined" == typeof e && (e = this.offset),
  37039. "undefined" == typeof t && (t = this.limit),
  37040. e |= 0,
  37041. t |= 0,
  37042. e < 0 || t > this.capacity() || e > t)
  37043. throw RangeError("begin, end");
  37044. if (e === t)
  37045. return "";
  37046. for (var i = [], n = []; e < t; )
  37047. i.push(this.view[e++]),
  37048. i.length >= 1024 && (n.push(String.fromCharCode.apply(String, i)),
  37049. i = []);
  37050. return n.join("") + String.fromCharCode.apply(String, i)
  37051. }
  37052. ,
  37053. o.fromBinary = function(e, t) {
  37054. if ("string" != typeof e)
  37055. throw TypeError("str");
  37056. for (var i, n = 0, r = e.length, a = new o(r,t); n < r; ) {
  37057. if (i = e.charCodeAt(n),
  37058. i > 255)
  37059. throw RangeError("illegal char code: " + i);
  37060. a.view[n++] = i
  37061. }
  37062. return a.limit = r,
  37063. a
  37064. }
  37065. ,
  37066. a.toDebug = function(e) {
  37067. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  37068. if (i !== -1 && (t = this.view[i],
  37069. r += t < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  37070. e && (o += t > 32 && t < 127 ? String.fromCharCode(t) : ".")),
  37071. ++i,
  37072. e && i > 0 && i % 16 === 0 && i !== n) {
  37073. for (; r.length < 51; )
  37074. r += " ";
  37075. a += r + o + "\n",
  37076. r = o = ""
  37077. }
  37078. r += i === this.offset && i === this.limit ? i === this.markedOffset ? "!" : "|" : i === this.offset ? i === this.markedOffset ? "[" : "<" : i === this.limit ? i === this.markedOffset ? "]" : ">" : i === this.markedOffset ? "'" : e || 0 !== i && i !== n ? " " : ""
  37079. }
  37080. if (e && " " !== r) {
  37081. for (; r.length < 51; )
  37082. r += " ";
  37083. a += r + o + "\n"
  37084. }
  37085. return e ? a : r
  37086. }
  37087. ,
  37088. o.fromDebug = function(e, t, i) {
  37089. for (var n, r, a = e.length, s = new o((a + 1) / 3 | 0,t,i), l = 0, c = 0, h = !1, u = !1, d = !1, p = !1, f = !1; l < a; ) {
  37090. switch (n = e.charAt(l++)) {
  37091. case "!":
  37092. if (!i) {
  37093. if (u || d || p) {
  37094. f = !0;
  37095. break
  37096. }
  37097. u = d = p = !0
  37098. }
  37099. s.offset = s.markedOffset = s.limit = c,
  37100. h = !1;
  37101. break;
  37102. case "|":
  37103. if (!i) {
  37104. if (u || p) {
  37105. f = !0;
  37106. break
  37107. }
  37108. u = p = !0
  37109. }
  37110. s.offset = s.limit = c,
  37111. h = !1;
  37112. break;
  37113. case "[":
  37114. if (!i) {
  37115. if (u || d) {
  37116. f = !0;
  37117. break
  37118. }
  37119. u = d = !0
  37120. }
  37121. s.offset = s.markedOffset = c,
  37122. h = !1;
  37123. break;
  37124. case "<":
  37125. if (!i) {
  37126. if (u) {
  37127. f = !0;
  37128. break
  37129. }
  37130. u = !0
  37131. }
  37132. s.offset = c,
  37133. h = !1;
  37134. break;
  37135. case "]":
  37136. if (!i) {
  37137. if (p || d) {
  37138. f = !0;
  37139. break
  37140. }
  37141. p = d = !0
  37142. }
  37143. s.limit = s.markedOffset = c,
  37144. h = !1;
  37145. break;
  37146. case ">":
  37147. if (!i) {
  37148. if (p) {
  37149. f = !0;
  37150. break
  37151. }
  37152. p = !0
  37153. }
  37154. s.limit = c,
  37155. h = !1;
  37156. break;
  37157. case "'":
  37158. if (!i) {
  37159. if (d) {
  37160. f = !0;
  37161. break
  37162. }
  37163. d = !0
  37164. }
  37165. s.markedOffset = c,
  37166. h = !1;
  37167. break;
  37168. case " ":
  37169. h = !1;
  37170. break;
  37171. default:
  37172. if (!i && h) {
  37173. f = !0;
  37174. break
  37175. }
  37176. if (r = parseInt(n + e.charAt(l++), 16),
  37177. !i && (isNaN(r) || r < 0 || r > 255))
  37178. throw TypeError("Illegal str: Not a debug encoded string");
  37179. s.view[c++] = r,
  37180. h = !0
  37181. }
  37182. if (f)
  37183. throw TypeError("Illegal str: Invalid symbol at " + l)
  37184. }
  37185. if (!i) {
  37186. if (!u || !p)
  37187. throw TypeError("Illegal str: Missing offset or limit");
  37188. if (c < s.buffer.byteLength)
  37189. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + c + " < " + a)
  37190. }
  37191. return s
  37192. }
  37193. ,
  37194. a.toHex = function(e, t) {
  37195. if (e = "undefined" == typeof e ? this.offset : e,
  37196. t = "undefined" == typeof t ? this.limit : t,
  37197. !this.noAssert) {
  37198. if ("number" != typeof e || e % 1 !== 0)
  37199. throw TypeError("Illegal begin: Not an integer");
  37200. if (e >>>= 0,
  37201. "number" != typeof t || t % 1 !== 0)
  37202. throw TypeError("Illegal end: Not an integer");
  37203. if (t >>>= 0,
  37204. e < 0 || e > t || t > this.buffer.byteLength)
  37205. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  37206. }
  37207. for (var i, n = new Array(t - e); e < t; )
  37208. i = this.view[e++],
  37209. i < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  37210. return n.join("")
  37211. }
  37212. ,
  37213. o.fromHex = function(e, t, i) {
  37214. if (!i) {
  37215. if ("string" != typeof e)
  37216. throw TypeError("Illegal str: Not a string");
  37217. if (e.length % 2 !== 0)
  37218. throw TypeError("Illegal str: Length not a multiple of 2")
  37219. }
  37220. for (var n, r = e.length, a = new o(r / 2 | 0,t), s = 0, l = 0; s < r; s += 2) {
  37221. if (n = parseInt(e.substring(s, s + 2), 16),
  37222. !i && (!isFinite(n) || n < 0 || n > 255))
  37223. throw TypeError("Illegal str: Contains non-hex characters");
  37224. a.view[l++] = n
  37225. }
  37226. return a.limit = l,
  37227. a
  37228. }
  37229. ;
  37230. var h = function() {
  37231. var e = {};
  37232. return e.MAX_CODEPOINT = 1114111,
  37233. e.encodeUTF8 = function(e, t) {
  37234. var i = null;
  37235. for ("number" == typeof e && (i = e,
  37236. e = function() {
  37237. return null
  37238. }
  37239. ); null !== i || null !== (i = e()); )
  37240. i < 128 ? t(127 & i) : i < 2048 ? (t(i >> 6 & 31 | 192),
  37241. t(63 & i | 128)) : i < 65536 ? (t(i >> 12 & 15 | 224),
  37242. t(i >> 6 & 63 | 128),
  37243. t(63 & i | 128)) : (t(i >> 18 & 7 | 240),
  37244. t(i >> 12 & 63 | 128),
  37245. t(i >> 6 & 63 | 128),
  37246. t(63 & i | 128)),
  37247. i = null
  37248. }
  37249. ,
  37250. e.decodeUTF8 = function(e, t) {
  37251. for (var i, n, r, o, a = function(e) {
  37252. e = e.slice(0, e.indexOf(null));
  37253. var t = Error(e.toString());
  37254. throw t.name = "TruncatedError",
  37255. t.bytes = e,
  37256. t
  37257. }; null !== (i = e()); )
  37258. if (0 === (128 & i))
  37259. t(i);
  37260. else if (192 === (224 & i))
  37261. null === (n = e()) && a([i, n]),
  37262. t((31 & i) << 6 | 63 & n);
  37263. else if (224 === (240 & i))
  37264. (null === (n = e()) || null === (r = e())) && a([i, n, r]),
  37265. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  37266. else {
  37267. if (240 !== (248 & i))
  37268. throw RangeError("Illegal starting byte: " + i);
  37269. (null === (n = e()) || null === (r = e()) || null === (o = e())) && a([i, n, r, o]),
  37270. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  37271. }
  37272. }
  37273. ,
  37274. e.UTF16toUTF8 = function(e, t) {
  37275. for (var i, n = null; ; ) {
  37276. if (null === (i = null !== n ? n : e()))
  37277. break;
  37278. i >= 55296 && i <= 57343 && null !== (n = e()) && n >= 56320 && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  37279. n = null) : t(i)
  37280. }
  37281. null !== n && t(n)
  37282. }
  37283. ,
  37284. e.UTF8toUTF16 = function(e, t) {
  37285. var i = null;
  37286. for ("number" == typeof e && (i = e,
  37287. e = function() {
  37288. return null
  37289. }
  37290. ); null !== i || null !== (i = e()); )
  37291. i <= 65535 ? t(i) : (i -= 65536,
  37292. t((i >> 10) + 55296),
  37293. t(i % 1024 + 56320)),
  37294. i = null
  37295. }
  37296. ,
  37297. e.encodeUTF16toUTF8 = function(t, i) {
  37298. e.UTF16toUTF8(t, function(t) {
  37299. e.encodeUTF8(t, i)
  37300. })
  37301. }
  37302. ,
  37303. e.decodeUTF8toUTF16 = function(t, i) {
  37304. e.decodeUTF8(t, function(t) {
  37305. e.UTF8toUTF16(t, i)
  37306. })
  37307. }
  37308. ,
  37309. e.calculateCodePoint = function(e) {
  37310. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  37311. }
  37312. ,
  37313. e.calculateUTF8 = function(e) {
  37314. for (var t, i = 0; null !== (t = e()); )
  37315. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  37316. return i
  37317. }
  37318. ,
  37319. e.calculateUTF16asUTF8 = function(t) {
  37320. var i = 0
  37321. , n = 0;
  37322. return e.UTF16toUTF8(t, function(e) {
  37323. ++i,
  37324. n += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  37325. }),
  37326. [i, n]
  37327. }
  37328. ,
  37329. e
  37330. }();
  37331. return a.toUTF8 = function(e, t) {
  37332. if ("undefined" == typeof e && (e = this.offset),
  37333. "undefined" == typeof t && (t = this.limit),
  37334. !this.noAssert) {
  37335. if ("number" != typeof e || e % 1 !== 0)
  37336. throw TypeError("Illegal begin: Not an integer");
  37337. if (e >>>= 0,
  37338. "number" != typeof t || t % 1 !== 0)
  37339. throw TypeError("Illegal end: Not an integer");
  37340. if (t >>>= 0,
  37341. e < 0 || e > t || t > this.buffer.byteLength)
  37342. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  37343. }
  37344. var n;
  37345. try {
  37346. h.decodeUTF8toUTF16(function() {
  37347. return e < t ? this.view[e++] : null
  37348. }
  37349. .bind(this), n = i())
  37350. } catch (i) {
  37351. if (e !== t)
  37352. throw RangeError("Illegal range: Truncated data, " + e + " != " + t)
  37353. }
  37354. return n()
  37355. }
  37356. ,
  37357. o.fromUTF8 = function(e, i, n) {
  37358. if (!n && "string" != typeof e)
  37359. throw TypeError("Illegal str: Not a string");
  37360. var r = new o(h.calculateUTF16asUTF8(t(e), !0)[1],i,n)
  37361. , a = 0;
  37362. return h.encodeUTF16toUTF8(t(e), function(e) {
  37363. r.view[a++] = e
  37364. }),
  37365. r.limit = a,
  37366. r
  37367. }
  37368. ,
  37369. o
  37370. })
  37371. }
  37372. , {
  37373. long: 216
  37374. }],
  37375. 216: [function(e, t, i) {
  37376. !function(i, n) {
  37377. "function" == typeof define && define.amd ? define([], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = n() : (i.dcodeIO = i.dcodeIO || {}).Long = n()
  37378. }(this, function() {
  37379. "use strict";
  37380. function e(e, t, i) {
  37381. this.low = 0 | e,
  37382. this.high = 0 | t,
  37383. this.unsigned = !!i
  37384. }
  37385. function t(e) {
  37386. return (e && e.__isLong__) === !0
  37387. }
  37388. function i(e, t) {
  37389. var i, n, o;
  37390. return t ? (e >>>= 0,
  37391. (o = 0 <= e && e < 256) && (n = l[e]) ? n : (i = r(e, (0 | e) < 0 ? -1 : 0, !0),
  37392. o && (l[e] = i),
  37393. i)) : (e |= 0,
  37394. (o = -128 <= e && e < 128) && (n = s[e]) ? n : (i = r(e, e < 0 ? -1 : 0, !1),
  37395. o && (s[e] = i),
  37396. i))
  37397. }
  37398. function n(e, t) {
  37399. if (isNaN(e) || !isFinite(e))
  37400. return t ? m : g;
  37401. if (t) {
  37402. if (e < 0)
  37403. return m;
  37404. if (e >= d)
  37405. return I
  37406. } else {
  37407. if (e <= -p)
  37408. return E;
  37409. if (e + 1 >= p)
  37410. return C
  37411. }
  37412. return e < 0 ? n(-e, t).neg() : r(e % u | 0, e / u | 0, t)
  37413. }
  37414. function r(t, i, n) {
  37415. return new e(t,i,n)
  37416. }
  37417. function o(e, t, i) {
  37418. if (0 === e.length)
  37419. throw Error("empty string");
  37420. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  37421. return g;
  37422. if ("number" == typeof t ? (i = t,
  37423. t = !1) : t = !!t,
  37424. i = i || 10,
  37425. i < 2 || 36 < i)
  37426. throw RangeError("radix");
  37427. var r;
  37428. if ((r = e.indexOf("-")) > 0)
  37429. throw Error("interior hyphen");
  37430. if (0 === r)
  37431. return o(e.substring(1), t, i).neg();
  37432. for (var a = n(c(i, 8)), s = g, l = 0; l < e.length; l += 8) {
  37433. var h = Math.min(8, e.length - l)
  37434. , u = parseInt(e.substring(l, l + h), i);
  37435. if (h < 8) {
  37436. var d = n(c(i, h));
  37437. s = s.mul(d).add(n(u))
  37438. } else
  37439. s = s.mul(a),
  37440. s = s.add(n(u))
  37441. }
  37442. return s.unsigned = t,
  37443. s
  37444. }
  37445. function a(t) {
  37446. return t instanceof e ? t : "number" == typeof t ? n(t) : "string" == typeof t ? o(t) : r(t.low, t.high, t.unsigned)
  37447. }
  37448. e.prototype.__isLong__,
  37449. Object.defineProperty(e.prototype, "__isLong__", {
  37450. value: !0,
  37451. enumerable: !1,
  37452. configurable: !1
  37453. }),
  37454. e.isLong = t;
  37455. var s = {}
  37456. , l = {};
  37457. e.fromInt = i,
  37458. e.fromNumber = n,
  37459. e.fromBits = r;
  37460. var c = Math.pow;
  37461. e.fromString = o,
  37462. e.fromValue = a;
  37463. var h = 1 << 24
  37464. , u = 4294967296
  37465. , d = 0x10000000000000000
  37466. , p = d / 2
  37467. , f = i(h)
  37468. , g = i(0);
  37469. e.ZERO = g;
  37470. var m = i(0, !0);
  37471. e.UZERO = m;
  37472. var v = i(1);
  37473. e.ONE = v;
  37474. var A = i(1, !0);
  37475. e.UONE = A;
  37476. var y = i(-1);
  37477. e.NEG_ONE = y;
  37478. var C = r(-1, 2147483647, !1);
  37479. e.MAX_VALUE = C;
  37480. var I = r(-1, -1, !0);
  37481. e.MAX_UNSIGNED_VALUE = I;
  37482. var E = r(0, -2147483648, !1);
  37483. e.MIN_VALUE = E;
  37484. var b = e.prototype;
  37485. return b.toInt = function() {
  37486. return this.unsigned ? this.low >>> 0 : this.low
  37487. }
  37488. ,
  37489. b.toNumber = function() {
  37490. return this.unsigned ? (this.high >>> 0) * u + (this.low >>> 0) : this.high * u + (this.low >>> 0)
  37491. }
  37492. ,
  37493. b.toString = function(e) {
  37494. if (e = e || 10,
  37495. e < 2 || 36 < e)
  37496. throw RangeError("radix");
  37497. if (this.isZero())
  37498. return "0";
  37499. if (this.isNegative()) {
  37500. if (this.eq(E)) {
  37501. var t = n(e)
  37502. , i = this.div(t)
  37503. , r = i.mul(t).sub(this);
  37504. return i.toString(e) + r.toInt().toString(e)
  37505. }
  37506. return "-" + this.neg().toString(e)
  37507. }
  37508. for (var o = n(c(e, 6), this.unsigned), a = this, s = ""; ; ) {
  37509. var l = a.div(o)
  37510. , h = a.sub(l.mul(o)).toInt() >>> 0
  37511. , u = h.toString(e);
  37512. if (a = l,
  37513. a.isZero())
  37514. return u + s;
  37515. for (; u.length < 6; )
  37516. u = "0" + u;
  37517. s = "" + u + s
  37518. }
  37519. }
  37520. ,
  37521. b.getHighBits = function() {
  37522. return this.high
  37523. }
  37524. ,
  37525. b.getHighBitsUnsigned = function() {
  37526. return this.high >>> 0
  37527. }
  37528. ,
  37529. b.getLowBits = function() {
  37530. return this.low
  37531. }
  37532. ,
  37533. b.getLowBitsUnsigned = function() {
  37534. return this.low >>> 0
  37535. }
  37536. ,
  37537. b.getNumBitsAbs = function() {
  37538. if (this.isNegative())
  37539. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  37540. for (var e = 0 != this.high ? this.high : this.low, t = 31; t > 0 && 0 == (e & 1 << t); t--)
  37541. ;
  37542. return 0 != this.high ? t + 33 : t + 1
  37543. }
  37544. ,
  37545. b.isZero = function() {
  37546. return 0 === this.high && 0 === this.low
  37547. }
  37548. ,
  37549. b.isNegative = function() {
  37550. return !this.unsigned && this.high < 0
  37551. }
  37552. ,
  37553. b.isPositive = function() {
  37554. return this.unsigned || this.high >= 0
  37555. }
  37556. ,
  37557. b.isOdd = function() {
  37558. return 1 === (1 & this.low)
  37559. }
  37560. ,
  37561. b.isEven = function() {
  37562. return 0 === (1 & this.low)
  37563. }
  37564. ,
  37565. b.equals = function(e) {
  37566. return t(e) || (e = a(e)),
  37567. (this.unsigned === e.unsigned || this.high >>> 31 !== 1 || e.high >>> 31 !== 1) && (this.high === e.high && this.low === e.low)
  37568. }
  37569. ,
  37570. b.eq = b.equals,
  37571. b.notEquals = function(e) {
  37572. return !this.eq(e)
  37573. }
  37574. ,
  37575. b.neq = b.notEquals,
  37576. b.lessThan = function(e) {
  37577. return this.comp(e) < 0
  37578. }
  37579. ,
  37580. b.lt = b.lessThan,
  37581. b.lessThanOrEqual = function(e) {
  37582. return this.comp(e) <= 0
  37583. }
  37584. ,
  37585. b.lte = b.lessThanOrEqual,
  37586. b.greaterThan = function(e) {
  37587. return this.comp(e) > 0
  37588. }
  37589. ,
  37590. b.gt = b.greaterThan,
  37591. b.greaterThanOrEqual = function(e) {
  37592. return this.comp(e) >= 0
  37593. }
  37594. ,
  37595. b.gte = b.greaterThanOrEqual,
  37596. b.compare = function(e) {
  37597. if (t(e) || (e = a(e)),
  37598. this.eq(e))
  37599. return 0;
  37600. var i = this.isNegative()
  37601. , n = e.isNegative();
  37602. return i && !n ? -1 : !i && n ? 1 : this.unsigned ? e.high >>> 0 > this.high >>> 0 || e.high === this.high && e.low >>> 0 > this.low >>> 0 ? -1 : 1 : this.sub(e).isNegative() ? -1 : 1
  37603. }
  37604. ,
  37605. b.comp = b.compare,
  37606. b.negate = function() {
  37607. return !this.unsigned && this.eq(E) ? E : this.not().add(v)
  37608. }
  37609. ,
  37610. b.neg = b.negate,
  37611. b.add = function(e) {
  37612. t(e) || (e = a(e));
  37613. var i = this.high >>> 16
  37614. , n = 65535 & this.high
  37615. , o = this.low >>> 16
  37616. , s = 65535 & this.low
  37617. , l = e.high >>> 16
  37618. , c = 65535 & e.high
  37619. , h = e.low >>> 16
  37620. , u = 65535 & e.low
  37621. , d = 0
  37622. , p = 0
  37623. , f = 0
  37624. , g = 0;
  37625. return g += s + u,
  37626. f += g >>> 16,
  37627. g &= 65535,
  37628. f += o + h,
  37629. p += f >>> 16,
  37630. f &= 65535,
  37631. p += n + c,
  37632. d += p >>> 16,
  37633. p &= 65535,
  37634. d += i + l,
  37635. d &= 65535,
  37636. r(f << 16 | g, d << 16 | p, this.unsigned)
  37637. }
  37638. ,
  37639. b.subtract = function(e) {
  37640. return t(e) || (e = a(e)),
  37641. this.add(e.neg())
  37642. }
  37643. ,
  37644. b.sub = b.subtract,
  37645. b.multiply = function(e) {
  37646. if (this.isZero())
  37647. return g;
  37648. if (t(e) || (e = a(e)),
  37649. e.isZero())
  37650. return g;
  37651. if (this.eq(E))
  37652. return e.isOdd() ? E : g;
  37653. if (e.eq(E))
  37654. return this.isOdd() ? E : g;
  37655. if (this.isNegative())
  37656. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  37657. if (e.isNegative())
  37658. return this.mul(e.neg()).neg();
  37659. if (this.lt(f) && e.lt(f))
  37660. return n(this.toNumber() * e.toNumber(), this.unsigned);
  37661. var i = this.high >>> 16
  37662. , o = 65535 & this.high
  37663. , s = this.low >>> 16
  37664. , l = 65535 & this.low
  37665. , c = e.high >>> 16
  37666. , h = 65535 & e.high
  37667. , u = e.low >>> 16
  37668. , d = 65535 & e.low
  37669. , p = 0
  37670. , m = 0
  37671. , v = 0
  37672. , A = 0;
  37673. return A += l * d,
  37674. v += A >>> 16,
  37675. A &= 65535,
  37676. v += s * d,
  37677. m += v >>> 16,
  37678. v &= 65535,
  37679. v += l * u,
  37680. m += v >>> 16,
  37681. v &= 65535,
  37682. m += o * d,
  37683. p += m >>> 16,
  37684. m &= 65535,
  37685. m += s * u,
  37686. p += m >>> 16,
  37687. m &= 65535,
  37688. m += l * h,
  37689. p += m >>> 16,
  37690. m &= 65535,
  37691. p += i * d + o * u + s * h + l * c,
  37692. p &= 65535,
  37693. r(v << 16 | A, p << 16 | m, this.unsigned)
  37694. }
  37695. ,
  37696. b.mul = b.multiply,
  37697. b.divide = function(e) {
  37698. if (t(e) || (e = a(e)),
  37699. e.isZero())
  37700. throw Error("division by zero");
  37701. if (this.isZero())
  37702. return this.unsigned ? m : g;
  37703. var i, r, o;
  37704. if (this.unsigned) {
  37705. if (e.unsigned || (e = e.toUnsigned()),
  37706. e.gt(this))
  37707. return m;
  37708. if (e.gt(this.shru(1)))
  37709. return A;
  37710. o = m
  37711. } else {
  37712. if (this.eq(E)) {
  37713. if (e.eq(v) || e.eq(y))
  37714. return E;
  37715. if (e.eq(E))
  37716. return v;
  37717. var s = this.shr(1);
  37718. return i = s.div(e).shl(1),
  37719. i.eq(g) ? e.isNegative() ? v : y : (r = this.sub(e.mul(i)),
  37720. o = i.add(r.div(e)))
  37721. }
  37722. if (e.eq(E))
  37723. return this.unsigned ? m : g;
  37724. if (this.isNegative())
  37725. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  37726. if (e.isNegative())
  37727. return this.div(e.neg()).neg();
  37728. o = g
  37729. }
  37730. for (r = this; r.gte(e); ) {
  37731. i = Math.max(1, Math.floor(r.toNumber() / e.toNumber()));
  37732. for (var l = Math.ceil(Math.log(i) / Math.LN2), h = l <= 48 ? 1 : c(2, l - 48), u = n(i), d = u.mul(e); d.isNegative() || d.gt(r); )
  37733. i -= h,
  37734. u = n(i, this.unsigned),
  37735. d = u.mul(e);
  37736. u.isZero() && (u = v),
  37737. o = o.add(u),
  37738. r = r.sub(d)
  37739. }
  37740. return o
  37741. }
  37742. ,
  37743. b.div = b.divide,
  37744. b.modulo = function(e) {
  37745. return t(e) || (e = a(e)),
  37746. this.sub(this.div(e).mul(e))
  37747. }
  37748. ,
  37749. b.mod = b.modulo,
  37750. b.not = function() {
  37751. return r(~this.low, ~this.high, this.unsigned)
  37752. }
  37753. ,
  37754. b.and = function(e) {
  37755. return t(e) || (e = a(e)),
  37756. r(this.low & e.low, this.high & e.high, this.unsigned)
  37757. }
  37758. ,
  37759. b.or = function(e) {
  37760. return t(e) || (e = a(e)),
  37761. r(this.low | e.low, this.high | e.high, this.unsigned)
  37762. }
  37763. ,
  37764. b.xor = function(e) {
  37765. return t(e) || (e = a(e)),
  37766. r(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  37767. }
  37768. ,
  37769. b.shiftLeft = function(e) {
  37770. return t(e) && (e = e.toInt()),
  37771. 0 === (e &= 63) ? this : e < 32 ? r(this.low << e, this.high << e | this.low >>> 32 - e, this.unsigned) : r(0, this.low << e - 32, this.unsigned)
  37772. }
  37773. ,
  37774. b.shl = b.shiftLeft,
  37775. b.shiftRight = function(e) {
  37776. return t(e) && (e = e.toInt()),
  37777. 0 === (e &= 63) ? this : e < 32 ? r(this.low >>> e | this.high << 32 - e, this.high >> e, this.unsigned) : r(this.high >> e - 32, this.high >= 0 ? 0 : -1, this.unsigned)
  37778. }
  37779. ,
  37780. b.shr = b.shiftRight,
  37781. b.shiftRightUnsigned = function(e) {
  37782. if (t(e) && (e = e.toInt()),
  37783. e &= 63,
  37784. 0 === e)
  37785. return this;
  37786. var i = this.high;
  37787. if (e < 32) {
  37788. var n = this.low;
  37789. return r(n >>> e | i << 32 - e, i >>> e, this.unsigned)
  37790. }
  37791. return 32 === e ? r(i, 0, this.unsigned) : r(i >>> e - 32, 0, this.unsigned)
  37792. }
  37793. ,
  37794. b.shru = b.shiftRightUnsigned,
  37795. b.toSigned = function() {
  37796. return this.unsigned ? r(this.low, this.high, !1) : this
  37797. }
  37798. ,
  37799. b.toUnsigned = function() {
  37800. return this.unsigned ? this : r(this.low, this.high, !0)
  37801. }
  37802. ,
  37803. b.toBytes = function(e) {
  37804. return e ? this.toBytesLE() : this.toBytesBE()
  37805. }
  37806. ,
  37807. b.toBytesLE = function() {
  37808. var e = this.high
  37809. , t = this.low;
  37810. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  37811. }
  37812. ,
  37813. b.toBytesBE = function() {
  37814. var e = this.high
  37815. , t = this.low;
  37816. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  37817. }
  37818. ,
  37819. e
  37820. })
  37821. }
  37822. , {}],
  37823. 217: [function(e, t, i) {
  37824. var n = {
  37825. REVISION: "75"
  37826. };
  37827. "function" == typeof define && define.amd ? define("three", n) : "undefined" != typeof i && "undefined" != typeof t && (t.exports = n),
  37828. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  37829. void 0 === Math.sign && (Math.sign = function(e) {
  37830. return e < 0 ? -1 : e > 0 ? 1 : +e
  37831. }
  37832. ),
  37833. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  37834. get: function() {
  37835. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  37836. }
  37837. }),
  37838. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  37839. writable: !0,
  37840. configurable: !0,
  37841. value: function(e) {
  37842. "use strict";
  37843. if (void 0 === e || null === e)
  37844. throw new TypeError("Cannot convert first argument to object");
  37845. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  37846. var r = arguments[i];
  37847. if (void 0 !== r && null !== r) {
  37848. r = Object(r);
  37849. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  37850. var l = o[a]
  37851. , c = Object.getOwnPropertyDescriptor(r, l);
  37852. void 0 !== c && c.enumerable && (t[l] = r[l])
  37853. }
  37854. }
  37855. }
  37856. return t
  37857. }
  37858. }),
  37859. n.MOUSE = {
  37860. LEFT: 0,
  37861. MIDDLE: 1,
  37862. RIGHT: 2
  37863. },
  37864. n.CullFaceNone = 0,
  37865. n.CullFaceBack = 1,
  37866. n.CullFaceFront = 2,
  37867. n.CullFaceFrontBack = 3,
  37868. n.FrontFaceDirectionCW = 0,
  37869. n.FrontFaceDirectionCCW = 1,
  37870. n.BasicShadowMap = 0,
  37871. n.PCFShadowMap = 1,
  37872. n.PCFSoftShadowMap = 2,
  37873. n.FrontSide = 0,
  37874. n.BackSide = 1,
  37875. n.DoubleSide = 2,
  37876. n.FlatShading = 1,
  37877. n.SmoothShading = 2,
  37878. n.NoColors = 0,
  37879. n.FaceColors = 1,
  37880. n.VertexColors = 2,
  37881. n.NoBlending = 0,
  37882. n.NormalBlending = 1,
  37883. n.AdditiveBlending = 2,
  37884. n.SubtractiveBlending = 3,
  37885. n.MultiplyBlending = 4,
  37886. n.CustomBlending = 5,
  37887. n.AddEquation = 100,
  37888. n.SubtractEquation = 101,
  37889. n.ReverseSubtractEquation = 102,
  37890. n.MinEquation = 103,
  37891. n.MaxEquation = 104,
  37892. n.ZeroFactor = 200,
  37893. n.OneFactor = 201,
  37894. n.SrcColorFactor = 202,
  37895. n.OneMinusSrcColorFactor = 203,
  37896. n.SrcAlphaFactor = 204,
  37897. n.OneMinusSrcAlphaFactor = 205,
  37898. n.DstAlphaFactor = 206,
  37899. n.OneMinusDstAlphaFactor = 207,
  37900. n.DstColorFactor = 208,
  37901. n.OneMinusDstColorFactor = 209,
  37902. n.SrcAlphaSaturateFactor = 210,
  37903. n.NeverDepth = 0,
  37904. n.AlwaysDepth = 1,
  37905. n.LessDepth = 2,
  37906. n.LessEqualDepth = 3,
  37907. n.EqualDepth = 4,
  37908. n.GreaterEqualDepth = 5,
  37909. n.GreaterDepth = 6,
  37910. n.NotEqualDepth = 7,
  37911. n.MultiplyOperation = 0,
  37912. n.MixOperation = 1,
  37913. n.AddOperation = 2,
  37914. n.NoToneMapping = 0,
  37915. n.LinearToneMapping = 1,
  37916. n.ReinhardToneMapping = 2,
  37917. n.Uncharted2ToneMapping = 3,
  37918. n.CineonToneMapping = 4,
  37919. n.UVMapping = 300,
  37920. n.CubeReflectionMapping = 301,
  37921. n.CubeRefractionMapping = 302,
  37922. n.EquirectangularReflectionMapping = 303,
  37923. n.EquirectangularRefractionMapping = 304,
  37924. n.SphericalReflectionMapping = 305,
  37925. n.CubeUVReflectionMapping = 306,
  37926. n.CubeUVRefractionMapping = 307,
  37927. n.RepeatWrapping = 1e3,
  37928. n.ClampToEdgeWrapping = 1001,
  37929. n.MirroredRepeatWrapping = 1002,
  37930. n.NearestFilter = 1003,
  37931. n.NearestMipMapNearestFilter = 1004,
  37932. n.NearestMipMapLinearFilter = 1005,
  37933. n.LinearFilter = 1006,
  37934. n.LinearMipMapNearestFilter = 1007,
  37935. n.LinearMipMapLinearFilter = 1008,
  37936. n.UnsignedByteType = 1009,
  37937. n.ByteType = 1010,
  37938. n.ShortType = 1011,
  37939. n.UnsignedShortType = 1012,
  37940. n.IntType = 1013,
  37941. n.UnsignedIntType = 1014,
  37942. n.FloatType = 1015,
  37943. n.HalfFloatType = 1025,
  37944. n.UnsignedShort4444Type = 1016,
  37945. n.UnsignedShort5551Type = 1017,
  37946. n.UnsignedShort565Type = 1018,
  37947. n.AlphaFormat = 1019,
  37948. n.RGBFormat = 1020,
  37949. n.RGBAFormat = 1021,
  37950. n.LuminanceFormat = 1022,
  37951. n.LuminanceAlphaFormat = 1023,
  37952. n.RGBEFormat = n.RGBAFormat,
  37953. n.RGB_S3TC_DXT1_Format = 2001,
  37954. n.RGBA_S3TC_DXT1_Format = 2002,
  37955. n.RGBA_S3TC_DXT3_Format = 2003,
  37956. n.RGBA_S3TC_DXT5_Format = 2004,
  37957. n.RGB_PVRTC_4BPPV1_Format = 2100,
  37958. n.RGB_PVRTC_2BPPV1_Format = 2101,
  37959. n.RGBA_PVRTC_4BPPV1_Format = 2102,
  37960. n.RGBA_PVRTC_2BPPV1_Format = 2103,
  37961. n.RGB_ETC1_Format = 2151,
  37962. n.LoopOnce = 2200,
  37963. n.LoopRepeat = 2201,
  37964. n.LoopPingPong = 2202,
  37965. n.InterpolateDiscrete = 2300,
  37966. n.InterpolateLinear = 2301,
  37967. n.InterpolateSmooth = 2302,
  37968. n.ZeroCurvatureEnding = 2400,
  37969. n.ZeroSlopeEnding = 2401,
  37970. n.WrapAroundEnding = 2402,
  37971. n.TrianglesDrawMode = 0,
  37972. n.TriangleStripDrawMode = 1,
  37973. n.TriangleFanDrawMode = 2,
  37974. n.LinearEncoding = 3e3,
  37975. n.sRGBEncoding = 3001,
  37976. n.GammaEncoding = 3007,
  37977. n.RGBEEncoding = 3002,
  37978. n.LogLuvEncoding = 3003,
  37979. n.RGBM7Encoding = 3004,
  37980. n.RGBM16Encoding = 3005,
  37981. n.RGBDEncoding = 3006,
  37982. n.Color = function(e) {
  37983. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  37984. }
  37985. ,
  37986. n.Color.prototype = {
  37987. constructor: n.Color,
  37988. r: 1,
  37989. g: 1,
  37990. b: 1,
  37991. set: function(e) {
  37992. return e instanceof n.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  37993. this
  37994. },
  37995. setScalar: function(e) {
  37996. this.r = e,
  37997. this.g = e,
  37998. this.b = e
  37999. },
  38000. setHex: function(e) {
  38001. return e = Math.floor(e),
  38002. this.r = (e >> 16 & 255) / 255,
  38003. this.g = (e >> 8 & 255) / 255,
  38004. this.b = (255 & e) / 255,
  38005. this
  38006. },
  38007. setRGB: function(e, t, i) {
  38008. return this.r = e,
  38009. this.g = t,
  38010. this.b = i,
  38011. this
  38012. },
  38013. setHSL: function() {
  38014. function e(e, t, i) {
  38015. return i < 0 && (i += 1),
  38016. i > 1 && (i -= 1),
  38017. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  38018. }
  38019. return function(t, i, r) {
  38020. if (t = n.Math.euclideanModulo(t, 1),
  38021. i = n.Math.clamp(i, 0, 1),
  38022. r = n.Math.clamp(r, 0, 1),
  38023. 0 === i)
  38024. this.r = this.g = this.b = r;
  38025. else {
  38026. var o = r <= .5 ? r * (1 + i) : r + i - r * i
  38027. , a = 2 * r - o;
  38028. this.r = e(a, o, t + 1 / 3),
  38029. this.g = e(a, o, t),
  38030. this.b = e(a, o, t - 1 / 3)
  38031. }
  38032. return this
  38033. }
  38034. }(),
  38035. setStyle: function(e) {
  38036. function t(t) {
  38037. void 0 !== t && parseFloat(t) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored.")
  38038. }
  38039. var i;
  38040. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)) {
  38041. var r, o = i[1], a = i[2];
  38042. switch (o) {
  38043. case "rgb":
  38044. case "rgba":
  38045. if (r = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  38046. return this.r = Math.min(255, parseInt(r[1], 10)) / 255,
  38047. this.g = Math.min(255, parseInt(r[2], 10)) / 255,
  38048. this.b = Math.min(255, parseInt(r[3], 10)) / 255,
  38049. t(r[5]),
  38050. this;
  38051. if (r = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  38052. return this.r = Math.min(100, parseInt(r[1], 10)) / 100,
  38053. this.g = Math.min(100, parseInt(r[2], 10)) / 100,
  38054. this.b = Math.min(100, parseInt(r[3], 10)) / 100,
  38055. t(r[5]),
  38056. this;
  38057. break;
  38058. case "hsl":
  38059. case "hsla":
  38060. if (r = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)) {
  38061. var s = parseFloat(r[1]) / 360
  38062. , l = parseInt(r[2], 10) / 100
  38063. , c = parseInt(r[3], 10) / 100;
  38064. return t(r[5]),
  38065. this.setHSL(s, l, c)
  38066. }
  38067. }
  38068. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(e)) {
  38069. var h = i[1]
  38070. , u = h.length;
  38071. if (3 === u)
  38072. return this.r = parseInt(h.charAt(0) + h.charAt(0), 16) / 255,
  38073. this.g = parseInt(h.charAt(1) + h.charAt(1), 16) / 255,
  38074. this.b = parseInt(h.charAt(2) + h.charAt(2), 16) / 255,
  38075. this;
  38076. if (6 === u)
  38077. return this.r = parseInt(h.charAt(0) + h.charAt(1), 16) / 255,
  38078. this.g = parseInt(h.charAt(2) + h.charAt(3), 16) / 255,
  38079. this.b = parseInt(h.charAt(4) + h.charAt(5), 16) / 255,
  38080. this
  38081. }
  38082. if (e && e.length > 0) {
  38083. var h = n.ColorKeywords[e];
  38084. void 0 !== h ? this.setHex(h) : console.warn("THREE.Color: Unknown color " + e)
  38085. }
  38086. return this
  38087. },
  38088. clone: function() {
  38089. return new this.constructor(this.r,this.g,this.b)
  38090. },
  38091. copy: function(e) {
  38092. return this.r = e.r,
  38093. this.g = e.g,
  38094. this.b = e.b,
  38095. this
  38096. },
  38097. copyGammaToLinear: function(e, t) {
  38098. return void 0 === t && (t = 2),
  38099. this.r = Math.pow(e.r, t),
  38100. this.g = Math.pow(e.g, t),
  38101. this.b = Math.pow(e.b, t),
  38102. this
  38103. },
  38104. copyLinearToGamma: function(e, t) {
  38105. void 0 === t && (t = 2);
  38106. var i = t > 0 ? 1 / t : 1;
  38107. return this.r = Math.pow(e.r, i),
  38108. this.g = Math.pow(e.g, i),
  38109. this.b = Math.pow(e.b, i),
  38110. this
  38111. },
  38112. convertGammaToLinear: function() {
  38113. var e = this.r
  38114. , t = this.g
  38115. , i = this.b;
  38116. return this.r = e * e,
  38117. this.g = t * t,
  38118. this.b = i * i,
  38119. this
  38120. },
  38121. convertLinearToGamma: function() {
  38122. return this.r = Math.sqrt(this.r),
  38123. this.g = Math.sqrt(this.g),
  38124. this.b = Math.sqrt(this.b),
  38125. this
  38126. },
  38127. getHex: function() {
  38128. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  38129. },
  38130. getHexString: function() {
  38131. return ("000000" + this.getHex().toString(16)).slice(-6)
  38132. },
  38133. getHSL: function(e) {
  38134. var t, i, n = e || {
  38135. h: 0,
  38136. s: 0,
  38137. l: 0
  38138. }, r = this.r, o = this.g, a = this.b, s = Math.max(r, o, a), l = Math.min(r, o, a), c = (l + s) / 2;
  38139. if (l === s)
  38140. t = 0,
  38141. i = 0;
  38142. else {
  38143. var h = s - l;
  38144. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  38145. s) {
  38146. case r:
  38147. t = (o - a) / h + (o < a ? 6 : 0);
  38148. break;
  38149. case o:
  38150. t = (a - r) / h + 2;
  38151. break;
  38152. case a:
  38153. t = (r - o) / h + 4
  38154. }
  38155. t /= 6
  38156. }
  38157. return n.h = t,
  38158. n.s = i,
  38159. n.l = c,
  38160. n
  38161. },
  38162. getStyle: function() {
  38163. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  38164. },
  38165. offsetHSL: function(e, t, i) {
  38166. var n = this.getHSL();
  38167. return n.h += e,
  38168. n.s += t,
  38169. n.l += i,
  38170. this.setHSL(n.h, n.s, n.l),
  38171. this
  38172. },
  38173. add: function(e) {
  38174. return this.r += e.r,
  38175. this.g += e.g,
  38176. this.b += e.b,
  38177. this
  38178. },
  38179. addColors: function(e, t) {
  38180. return this.r = e.r + t.r,
  38181. this.g = e.g + t.g,
  38182. this.b = e.b + t.b,
  38183. this
  38184. },
  38185. addScalar: function(e) {
  38186. return this.r += e,
  38187. this.g += e,
  38188. this.b += e,
  38189. this
  38190. },
  38191. multiply: function(e) {
  38192. return this.r *= e.r,
  38193. this.g *= e.g,
  38194. this.b *= e.b,
  38195. this
  38196. },
  38197. multiplyScalar: function(e) {
  38198. return this.r *= e,
  38199. this.g *= e,
  38200. this.b *= e,
  38201. this
  38202. },
  38203. lerp: function(e, t) {
  38204. return this.r += (e.r - this.r) * t,
  38205. this.g += (e.g - this.g) * t,
  38206. this.b += (e.b - this.b) * t,
  38207. this
  38208. },
  38209. equals: function(e) {
  38210. return e.r === this.r && e.g === this.g && e.b === this.b
  38211. },
  38212. fromArray: function(e, t) {
  38213. return void 0 === t && (t = 0),
  38214. this.r = e[t],
  38215. this.g = e[t + 1],
  38216. this.b = e[t + 2],
  38217. this
  38218. },
  38219. toArray: function(e, t) {
  38220. return void 0 === e && (e = []),
  38221. void 0 === t && (t = 0),
  38222. e[t] = this.r,
  38223. e[t + 1] = this.g,
  38224. e[t + 2] = this.b,
  38225. e
  38226. }
  38227. },
  38228. n.ColorKeywords = {
  38229. aliceblue: 15792383,
  38230. antiquewhite: 16444375,
  38231. aqua: 65535,
  38232. aquamarine: 8388564,
  38233. azure: 15794175,
  38234. beige: 16119260,
  38235. bisque: 16770244,
  38236. black: 0,
  38237. blanchedalmond: 16772045,
  38238. blue: 255,
  38239. blueviolet: 9055202,
  38240. brown: 10824234,
  38241. burlywood: 14596231,
  38242. cadetblue: 6266528,
  38243. chartreuse: 8388352,
  38244. chocolate: 13789470,
  38245. coral: 16744272,
  38246. cornflowerblue: 6591981,
  38247. cornsilk: 16775388,
  38248. crimson: 14423100,
  38249. cyan: 65535,
  38250. darkblue: 139,
  38251. darkcyan: 35723,
  38252. darkgoldenrod: 12092939,
  38253. darkgray: 11119017,
  38254. darkgreen: 25600,
  38255. darkgrey: 11119017,
  38256. darkkhaki: 12433259,
  38257. darkmagenta: 9109643,
  38258. darkolivegreen: 5597999,
  38259. darkorange: 16747520,
  38260. darkorchid: 10040012,
  38261. darkred: 9109504,
  38262. darksalmon: 15308410,
  38263. darkseagreen: 9419919,
  38264. darkslateblue: 4734347,
  38265. darkslategray: 3100495,
  38266. darkslategrey: 3100495,
  38267. darkturquoise: 52945,
  38268. darkviolet: 9699539,
  38269. deeppink: 16716947,
  38270. deepskyblue: 49151,
  38271. dimgray: 6908265,
  38272. dimgrey: 6908265,
  38273. dodgerblue: 2003199,
  38274. firebrick: 11674146,
  38275. floralwhite: 16775920,
  38276. forestgreen: 2263842,
  38277. fuchsia: 16711935,
  38278. gainsboro: 14474460,
  38279. ghostwhite: 16316671,
  38280. gold: 16766720,
  38281. goldenrod: 14329120,
  38282. gray: 8421504,
  38283. green: 32768,
  38284. greenyellow: 11403055,
  38285. grey: 8421504,
  38286. honeydew: 15794160,
  38287. hotpink: 16738740,
  38288. indianred: 13458524,
  38289. indigo: 4915330,
  38290. ivory: 16777200,
  38291. khaki: 15787660,
  38292. lavender: 15132410,
  38293. lavenderblush: 16773365,
  38294. lawngreen: 8190976,
  38295. lemonchiffon: 16775885,
  38296. lightblue: 11393254,
  38297. lightcoral: 15761536,
  38298. lightcyan: 14745599,
  38299. lightgoldenrodyellow: 16448210,
  38300. lightgray: 13882323,
  38301. lightgreen: 9498256,
  38302. lightgrey: 13882323,
  38303. lightpink: 16758465,
  38304. lightsalmon: 16752762,
  38305. lightseagreen: 2142890,
  38306. lightskyblue: 8900346,
  38307. lightslategray: 7833753,
  38308. lightslategrey: 7833753,
  38309. lightsteelblue: 11584734,
  38310. lightyellow: 16777184,
  38311. lime: 65280,
  38312. limegreen: 3329330,
  38313. linen: 16445670,
  38314. magenta: 16711935,
  38315. maroon: 8388608,
  38316. mediumaquamarine: 6737322,
  38317. mediumblue: 205,
  38318. mediumorchid: 12211667,
  38319. mediumpurple: 9662683,
  38320. mediumseagreen: 3978097,
  38321. mediumslateblue: 8087790,
  38322. mediumspringgreen: 64154,
  38323. mediumturquoise: 4772300,
  38324. mediumvioletred: 13047173,
  38325. midnightblue: 1644912,
  38326. mintcream: 16121850,
  38327. mistyrose: 16770273,
  38328. moccasin: 16770229,
  38329. navajowhite: 16768685,
  38330. navy: 128,
  38331. oldlace: 16643558,
  38332. olive: 8421376,
  38333. olivedrab: 7048739,
  38334. orange: 16753920,
  38335. orangered: 16729344,
  38336. orchid: 14315734,
  38337. palegoldenrod: 15657130,
  38338. palegreen: 10025880,
  38339. paleturquoise: 11529966,
  38340. palevioletred: 14381203,
  38341. papayawhip: 16773077,
  38342. peachpuff: 16767673,
  38343. peru: 13468991,
  38344. pink: 16761035,
  38345. plum: 14524637,
  38346. powderblue: 11591910,
  38347. purple: 8388736,
  38348. red: 16711680,
  38349. rosybrown: 12357519,
  38350. royalblue: 4286945,
  38351. saddlebrown: 9127187,
  38352. salmon: 16416882,
  38353. sandybrown: 16032864,
  38354. seagreen: 3050327,
  38355. seashell: 16774638,
  38356. sienna: 10506797,
  38357. silver: 12632256,
  38358. skyblue: 8900331,
  38359. slateblue: 6970061,
  38360. slategray: 7372944,
  38361. slategrey: 7372944,
  38362. snow: 16775930,
  38363. springgreen: 65407,
  38364. steelblue: 4620980,
  38365. tan: 13808780,
  38366. teal: 32896,
  38367. thistle: 14204888,
  38368. tomato: 16737095,
  38369. turquoise: 4251856,
  38370. violet: 15631086,
  38371. wheat: 16113331,
  38372. white: 16777215,
  38373. whitesmoke: 16119285,
  38374. yellow: 16776960,
  38375. yellowgreen: 10145074
  38376. },
  38377. n.Quaternion = function(e, t, i, n) {
  38378. this._x = e || 0,
  38379. this._y = t || 0,
  38380. this._z = i || 0,
  38381. this._w = void 0 !== n ? n : 1
  38382. }
  38383. ,
  38384. n.Quaternion.prototype = {
  38385. constructor: n.Quaternion,
  38386. get x() {
  38387. return this._x
  38388. },
  38389. set x(e) {
  38390. this._x = e,
  38391. this.onChangeCallback()
  38392. },
  38393. get y() {
  38394. return this._y
  38395. },
  38396. set y(e) {
  38397. this._y = e,
  38398. this.onChangeCallback()
  38399. },
  38400. get z() {
  38401. return this._z
  38402. },
  38403. set z(e) {
  38404. this._z = e,
  38405. this.onChangeCallback()
  38406. },
  38407. get w() {
  38408. return this._w
  38409. },
  38410. set w(e) {
  38411. this._w = e,
  38412. this.onChangeCallback()
  38413. },
  38414. set: function(e, t, i, n) {
  38415. return this._x = e,
  38416. this._y = t,
  38417. this._z = i,
  38418. this._w = n,
  38419. this.onChangeCallback(),
  38420. this
  38421. },
  38422. clone: function() {
  38423. return new this.constructor(this._x,this._y,this._z,this._w)
  38424. },
  38425. copy: function(e) {
  38426. return this._x = e.x,
  38427. this._y = e.y,
  38428. this._z = e.z,
  38429. this._w = e.w,
  38430. this.onChangeCallback(),
  38431. this
  38432. },
  38433. setFromEuler: function(e, t) {
  38434. if (e instanceof n.Euler == !1)
  38435. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  38436. var i = Math.cos(e._x / 2)
  38437. , r = Math.cos(e._y / 2)
  38438. , o = Math.cos(e._z / 2)
  38439. , a = Math.sin(e._x / 2)
  38440. , s = Math.sin(e._y / 2)
  38441. , l = Math.sin(e._z / 2)
  38442. , c = e.order;
  38443. return "XYZ" === c ? (this._x = a * r * o + i * s * l,
  38444. this._y = i * s * o - a * r * l,
  38445. this._z = i * r * l + a * s * o,
  38446. this._w = i * r * o - a * s * l) : "YXZ" === c ? (this._x = a * r * o + i * s * l,
  38447. this._y = i * s * o - a * r * l,
  38448. this._z = i * r * l - a * s * o,
  38449. this._w = i * r * o + a * s * l) : "ZXY" === c ? (this._x = a * r * o - i * s * l,
  38450. this._y = i * s * o + a * r * l,
  38451. this._z = i * r * l + a * s * o,
  38452. this._w = i * r * o - a * s * l) : "ZYX" === c ? (this._x = a * r * o - i * s * l,
  38453. this._y = i * s * o + a * r * l,
  38454. this._z = i * r * l - a * s * o,
  38455. this._w = i * r * o + a * s * l) : "YZX" === c ? (this._x = a * r * o + i * s * l,
  38456. this._y = i * s * o + a * r * l,
  38457. this._z = i * r * l - a * s * o,
  38458. this._w = i * r * o - a * s * l) : "XZY" === c && (this._x = a * r * o - i * s * l,
  38459. this._y = i * s * o - a * r * l,
  38460. this._z = i * r * l + a * s * o,
  38461. this._w = i * r * o + a * s * l),
  38462. t !== !1 && this.onChangeCallback(),
  38463. this
  38464. },
  38465. setFromAxisAngle: function(e, t) {
  38466. var i = t / 2
  38467. , n = Math.sin(i);
  38468. return this._x = e.x * n,
  38469. this._y = e.y * n,
  38470. this._z = e.z * n,
  38471. this._w = Math.cos(i),
  38472. this.onChangeCallback(),
  38473. this
  38474. },
  38475. setFromRotationMatrix: function(e) {
  38476. var t, i = e.elements, n = i[0], r = i[4], o = i[8], a = i[1], s = i[5], l = i[9], c = i[2], h = i[6], u = i[10], d = n + s + u;
  38477. return d > 0 ? (t = .5 / Math.sqrt(d + 1),
  38478. this._w = .25 / t,
  38479. this._x = (h - l) * t,
  38480. this._y = (o - c) * t,
  38481. this._z = (a - r) * t) : n > s && n > u ? (t = 2 * Math.sqrt(1 + n - s - u),
  38482. this._w = (h - l) / t,
  38483. this._x = .25 * t,
  38484. this._y = (r + a) / t,
  38485. this._z = (o + c) / t) : s > u ? (t = 2 * Math.sqrt(1 + s - n - u),
  38486. this._w = (o - c) / t,
  38487. this._x = (r + a) / t,
  38488. this._y = .25 * t,
  38489. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  38490. this._w = (a - r) / t,
  38491. this._x = (o + c) / t,
  38492. this._y = (l + h) / t,
  38493. this._z = .25 * t),
  38494. this.onChangeCallback(),
  38495. this
  38496. },
  38497. setFromUnitVectors: function() {
  38498. var e, t, i = 1e-6;
  38499. return function(r, o) {
  38500. return void 0 === e && (e = new n.Vector3),
  38501. t = r.dot(o) + 1,
  38502. t < i ? (t = 0,
  38503. Math.abs(r.x) > Math.abs(r.z) ? e.set(-r.y, r.x, 0) : e.set(0, -r.z, r.y)) : e.crossVectors(r, o),
  38504. this._x = e.x,
  38505. this._y = e.y,
  38506. this._z = e.z,
  38507. this._w = t,
  38508. this.normalize(),
  38509. this
  38510. }
  38511. }(),
  38512. inverse: function() {
  38513. return this.conjugate().normalize(),
  38514. this
  38515. },
  38516. conjugate: function() {
  38517. return this._x *= -1,
  38518. this._y *= -1,
  38519. this._z *= -1,
  38520. this.onChangeCallback(),
  38521. this
  38522. },
  38523. dot: function(e) {
  38524. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  38525. },
  38526. lengthSq: function() {
  38527. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  38528. },
  38529. length: function() {
  38530. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  38531. },
  38532. normalize: function() {
  38533. var e = this.length();
  38534. return 0 === e ? (this._x = 0,
  38535. this._y = 0,
  38536. this._z = 0,
  38537. this._w = 1) : (e = 1 / e,
  38538. this._x = this._x * e,
  38539. this._y = this._y * e,
  38540. this._z = this._z * e,
  38541. this._w = this._w * e),
  38542. this.onChangeCallback(),
  38543. this
  38544. },
  38545. multiply: function(e, t) {
  38546. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  38547. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  38548. },
  38549. multiplyQuaternions: function(e, t) {
  38550. var i = e._x
  38551. , n = e._y
  38552. , r = e._z
  38553. , o = e._w
  38554. , a = t._x
  38555. , s = t._y
  38556. , l = t._z
  38557. , c = t._w;
  38558. return this._x = i * c + o * a + n * l - r * s,
  38559. this._y = n * c + o * s + r * a - i * l,
  38560. this._z = r * c + o * l + i * s - n * a,
  38561. this._w = o * c - i * a - n * s - r * l,
  38562. this.onChangeCallback(),
  38563. this
  38564. },
  38565. slerp: function(e, t) {
  38566. if (0 === t)
  38567. return this;
  38568. if (1 === t)
  38569. return this.copy(e);
  38570. var i = this._x
  38571. , n = this._y
  38572. , r = this._z
  38573. , o = this._w
  38574. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  38575. if (a < 0 ? (this._w = -e._w,
  38576. this._x = -e._x,
  38577. this._y = -e._y,
  38578. this._z = -e._z,
  38579. a = -a) : this.copy(e),
  38580. a >= 1)
  38581. return this._w = o,
  38582. this._x = i,
  38583. this._y = n,
  38584. this._z = r,
  38585. this;
  38586. var s = Math.sqrt(1 - a * a);
  38587. if (Math.abs(s) < .001)
  38588. return this._w = .5 * (o + this._w),
  38589. this._x = .5 * (i + this._x),
  38590. this._y = .5 * (n + this._y),
  38591. this._z = .5 * (r + this._z),
  38592. this;
  38593. var l = Math.atan2(s, a)
  38594. , c = Math.sin((1 - t) * l) / s
  38595. , h = Math.sin(t * l) / s;
  38596. return this._w = o * c + this._w * h,
  38597. this._x = i * c + this._x * h,
  38598. this._y = n * c + this._y * h,
  38599. this._z = r * c + this._z * h,
  38600. this.onChangeCallback(),
  38601. this
  38602. },
  38603. equals: function(e) {
  38604. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  38605. },
  38606. fromArray: function(e, t) {
  38607. return void 0 === t && (t = 0),
  38608. this._x = e[t],
  38609. this._y = e[t + 1],
  38610. this._z = e[t + 2],
  38611. this._w = e[t + 3],
  38612. this.onChangeCallback(),
  38613. this
  38614. },
  38615. toArray: function(e, t) {
  38616. return void 0 === e && (e = []),
  38617. void 0 === t && (t = 0),
  38618. e[t] = this._x,
  38619. e[t + 1] = this._y,
  38620. e[t + 2] = this._z,
  38621. e[t + 3] = this._w,
  38622. e
  38623. },
  38624. onChange: function(e) {
  38625. return this.onChangeCallback = e,
  38626. this
  38627. },
  38628. onChangeCallback: function() {}
  38629. },
  38630. Object.assign(n.Quaternion, {
  38631. slerp: function(e, t, i, n) {
  38632. return i.copy(e).slerp(t, n)
  38633. },
  38634. slerpFlat: function(e, t, i, n, r, o, a) {
  38635. var s = i[n + 0]
  38636. , l = i[n + 1]
  38637. , c = i[n + 2]
  38638. , h = i[n + 3]
  38639. , u = r[o + 0]
  38640. , d = r[o + 1]
  38641. , p = r[o + 2]
  38642. , f = r[o + 3];
  38643. if (h !== f || s !== u || l !== d || c !== p) {
  38644. var g = 1 - a
  38645. , m = s * u + l * d + c * p + h * f
  38646. , v = m >= 0 ? 1 : -1
  38647. , A = 1 - m * m;
  38648. if (A > Number.EPSILON) {
  38649. var y = Math.sqrt(A)
  38650. , C = Math.atan2(y, m * v);
  38651. g = Math.sin(g * C) / y,
  38652. a = Math.sin(a * C) / y
  38653. }
  38654. var I = a * v;
  38655. if (s = s * g + u * I,
  38656. l = l * g + d * I,
  38657. c = c * g + p * I,
  38658. h = h * g + f * I,
  38659. g === 1 - a) {
  38660. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  38661. s *= E,
  38662. l *= E,
  38663. c *= E,
  38664. h *= E
  38665. }
  38666. }
  38667. e[t] = s,
  38668. e[t + 1] = l,
  38669. e[t + 2] = c,
  38670. e[t + 3] = h
  38671. }
  38672. }),
  38673. n.Vector2 = function(e, t) {
  38674. this.x = e || 0,
  38675. this.y = t || 0
  38676. }
  38677. ,
  38678. n.Vector2.prototype = {
  38679. constructor: n.Vector2,
  38680. get width() {
  38681. return this.x
  38682. },
  38683. set width(e) {
  38684. this.x = e
  38685. },
  38686. get height() {
  38687. return this.y
  38688. },
  38689. set height(e) {
  38690. this.y = e
  38691. },
  38692. set: function(e, t) {
  38693. return this.x = e,
  38694. this.y = t,
  38695. this
  38696. },
  38697. setScalar: function(e) {
  38698. return this.x = e,
  38699. this.y = e,
  38700. this
  38701. },
  38702. setX: function(e) {
  38703. return this.x = e,
  38704. this
  38705. },
  38706. setY: function(e) {
  38707. return this.y = e,
  38708. this
  38709. },
  38710. setComponent: function(e, t) {
  38711. switch (e) {
  38712. case 0:
  38713. this.x = t;
  38714. break;
  38715. case 1:
  38716. this.y = t;
  38717. break;
  38718. default:
  38719. throw new Error("index is out of range: " + e)
  38720. }
  38721. },
  38722. getComponent: function(e) {
  38723. switch (e) {
  38724. case 0:
  38725. return this.x;
  38726. case 1:
  38727. return this.y;
  38728. default:
  38729. throw new Error("index is out of range: " + e)
  38730. }
  38731. },
  38732. clone: function() {
  38733. return new this.constructor(this.x,this.y)
  38734. },
  38735. copy: function(e) {
  38736. return this.x = e.x,
  38737. this.y = e.y,
  38738. this
  38739. },
  38740. add: function(e, t) {
  38741. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38742. this.addVectors(e, t)) : (this.x += e.x,
  38743. this.y += e.y,
  38744. this)
  38745. },
  38746. addScalar: function(e) {
  38747. return this.x += e,
  38748. this.y += e,
  38749. this
  38750. },
  38751. addVectors: function(e, t) {
  38752. return this.x = e.x + t.x,
  38753. this.y = e.y + t.y,
  38754. this
  38755. },
  38756. addScaledVector: function(e, t) {
  38757. return this.x += e.x * t,
  38758. this.y += e.y * t,
  38759. this
  38760. },
  38761. sub: function(e, t) {
  38762. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38763. this.subVectors(e, t)) : (this.x -= e.x,
  38764. this.y -= e.y,
  38765. this)
  38766. },
  38767. subScalar: function(e) {
  38768. return this.x -= e,
  38769. this.y -= e,
  38770. this
  38771. },
  38772. subVectors: function(e, t) {
  38773. return this.x = e.x - t.x,
  38774. this.y = e.y - t.y,
  38775. this
  38776. },
  38777. multiply: function(e) {
  38778. return this.x *= e.x,
  38779. this.y *= e.y,
  38780. this
  38781. },
  38782. multiplyScalar: function(e) {
  38783. return isFinite(e) ? (this.x *= e,
  38784. this.y *= e) : (this.x = 0,
  38785. this.y = 0),
  38786. this
  38787. },
  38788. divide: function(e) {
  38789. return this.x /= e.x,
  38790. this.y /= e.y,
  38791. this
  38792. },
  38793. divideScalar: function(e) {
  38794. return this.multiplyScalar(1 / e)
  38795. },
  38796. min: function(e) {
  38797. return this.x = Math.min(this.x, e.x),
  38798. this.y = Math.min(this.y, e.y),
  38799. this
  38800. },
  38801. max: function(e) {
  38802. return this.x = Math.max(this.x, e.x),
  38803. this.y = Math.max(this.y, e.y),
  38804. this
  38805. },
  38806. clamp: function(e, t) {
  38807. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38808. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38809. this
  38810. },
  38811. clampScalar: function() {
  38812. var e, t;
  38813. return function(i, r) {
  38814. return void 0 === e && (e = new n.Vector2,
  38815. t = new n.Vector2),
  38816. e.set(i, i),
  38817. t.set(r, r),
  38818. this.clamp(e, t)
  38819. }
  38820. }(),
  38821. clampLength: function(e, t) {
  38822. var i = this.length();
  38823. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38824. this
  38825. },
  38826. floor: function() {
  38827. return this.x = Math.floor(this.x),
  38828. this.y = Math.floor(this.y),
  38829. this
  38830. },
  38831. ceil: function() {
  38832. return this.x = Math.ceil(this.x),
  38833. this.y = Math.ceil(this.y),
  38834. this
  38835. },
  38836. round: function() {
  38837. return this.x = Math.round(this.x),
  38838. this.y = Math.round(this.y),
  38839. this
  38840. },
  38841. roundToZero: function() {
  38842. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38843. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38844. this
  38845. },
  38846. negate: function() {
  38847. return this.x = -this.x,
  38848. this.y = -this.y,
  38849. this
  38850. },
  38851. dot: function(e) {
  38852. return this.x * e.x + this.y * e.y
  38853. },
  38854. lengthSq: function() {
  38855. return this.x * this.x + this.y * this.y
  38856. },
  38857. length: function() {
  38858. return Math.sqrt(this.x * this.x + this.y * this.y)
  38859. },
  38860. lengthManhattan: function() {
  38861. return Math.abs(this.x) + Math.abs(this.y)
  38862. },
  38863. normalize: function() {
  38864. return this.divideScalar(this.length())
  38865. },
  38866. angle: function() {
  38867. var e = Math.atan2(this.y, this.x);
  38868. return e < 0 && (e += 2 * Math.PI),
  38869. e
  38870. },
  38871. distanceTo: function(e) {
  38872. return Math.sqrt(this.distanceToSquared(e))
  38873. },
  38874. distanceToSquared: function(e) {
  38875. var t = this.x - e.x
  38876. , i = this.y - e.y;
  38877. return t * t + i * i
  38878. },
  38879. setLength: function(e) {
  38880. return this.multiplyScalar(e / this.length())
  38881. },
  38882. lerp: function(e, t) {
  38883. return this.x += (e.x - this.x) * t,
  38884. this.y += (e.y - this.y) * t,
  38885. this
  38886. },
  38887. lerpVectors: function(e, t, i) {
  38888. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38889. this
  38890. },
  38891. equals: function(e) {
  38892. return e.x === this.x && e.y === this.y
  38893. },
  38894. fromArray: function(e, t) {
  38895. return void 0 === t && (t = 0),
  38896. this.x = e[t],
  38897. this.y = e[t + 1],
  38898. this
  38899. },
  38900. toArray: function(e, t) {
  38901. return void 0 === e && (e = []),
  38902. void 0 === t && (t = 0),
  38903. e[t] = this.x,
  38904. e[t + 1] = this.y,
  38905. e
  38906. },
  38907. fromAttribute: function(e, t, i) {
  38908. return void 0 === i && (i = 0),
  38909. t = t * e.itemSize + i,
  38910. this.x = e.array[t],
  38911. this.y = e.array[t + 1],
  38912. this
  38913. },
  38914. rotateAround: function(e, t) {
  38915. var i = Math.cos(t)
  38916. , n = Math.sin(t)
  38917. , r = this.x - e.x
  38918. , o = this.y - e.y;
  38919. return this.x = r * i - o * n + e.x,
  38920. this.y = r * n + o * i + e.y,
  38921. this
  38922. }
  38923. },
  38924. n.Vector3 = function(e, t, i) {
  38925. this.x = e || 0,
  38926. this.y = t || 0,
  38927. this.z = i || 0
  38928. }
  38929. ,
  38930. n.Vector3.prototype = {
  38931. constructor: n.Vector3,
  38932. set: function(e, t, i) {
  38933. return this.x = e,
  38934. this.y = t,
  38935. this.z = i,
  38936. this
  38937. },
  38938. setScalar: function(e) {
  38939. return this.x = e,
  38940. this.y = e,
  38941. this.z = e,
  38942. this
  38943. },
  38944. setX: function(e) {
  38945. return this.x = e,
  38946. this
  38947. },
  38948. setY: function(e) {
  38949. return this.y = e,
  38950. this
  38951. },
  38952. setZ: function(e) {
  38953. return this.z = e,
  38954. this
  38955. },
  38956. setComponent: function(e, t) {
  38957. switch (e) {
  38958. case 0:
  38959. this.x = t;
  38960. break;
  38961. case 1:
  38962. this.y = t;
  38963. break;
  38964. case 2:
  38965. this.z = t;
  38966. break;
  38967. default:
  38968. throw new Error("index is out of range: " + e)
  38969. }
  38970. },
  38971. getComponent: function(e) {
  38972. switch (e) {
  38973. case 0:
  38974. return this.x;
  38975. case 1:
  38976. return this.y;
  38977. case 2:
  38978. return this.z;
  38979. default:
  38980. throw new Error("index is out of range: " + e)
  38981. }
  38982. },
  38983. clone: function() {
  38984. return new this.constructor(this.x,this.y,this.z)
  38985. },
  38986. copy: function(e) {
  38987. return this.x = e.x,
  38988. this.y = e.y,
  38989. this.z = e.z,
  38990. this
  38991. },
  38992. add: function(e, t) {
  38993. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38994. this.addVectors(e, t)) : (this.x += e.x,
  38995. this.y += e.y,
  38996. this.z += e.z,
  38997. this)
  38998. },
  38999. addScalar: function(e) {
  39000. return this.x += e,
  39001. this.y += e,
  39002. this.z += e,
  39003. this
  39004. },
  39005. addVectors: function(e, t) {
  39006. return this.x = e.x + t.x,
  39007. this.y = e.y + t.y,
  39008. this.z = e.z + t.z,
  39009. this
  39010. },
  39011. addScaledVector: function(e, t) {
  39012. return this.x += e.x * t,
  39013. this.y += e.y * t,
  39014. this.z += e.z * t,
  39015. this
  39016. },
  39017. sub: function(e, t) {
  39018. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  39019. this.subVectors(e, t)) : (this.x -= e.x,
  39020. this.y -= e.y,
  39021. this.z -= e.z,
  39022. this)
  39023. },
  39024. subScalar: function(e) {
  39025. return this.x -= e,
  39026. this.y -= e,
  39027. this.z -= e,
  39028. this
  39029. },
  39030. subVectors: function(e, t) {
  39031. return this.x = e.x - t.x,
  39032. this.y = e.y - t.y,
  39033. this.z = e.z - t.z,
  39034. this
  39035. },
  39036. multiply: function(e, t) {
  39037. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  39038. this.multiplyVectors(e, t)) : (this.x *= e.x,
  39039. this.y *= e.y,
  39040. this.z *= e.z,
  39041. this)
  39042. },
  39043. multiplyScalar: function(e) {
  39044. return isFinite(e) ? (this.x *= e,
  39045. this.y *= e,
  39046. this.z *= e) : (this.x = 0,
  39047. this.y = 0,
  39048. this.z = 0),
  39049. this
  39050. },
  39051. multiplyVectors: function(e, t) {
  39052. return this.x = e.x * t.x,
  39053. this.y = e.y * t.y,
  39054. this.z = e.z * t.z,
  39055. this
  39056. },
  39057. applyEuler: function() {
  39058. var e;
  39059. return function(t) {
  39060. return t instanceof n.Euler == !1 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  39061. void 0 === e && (e = new n.Quaternion),
  39062. this.applyQuaternion(e.setFromEuler(t)),
  39063. this
  39064. }
  39065. }(),
  39066. applyAxisAngle: function() {
  39067. var e;
  39068. return function(t, i) {
  39069. return void 0 === e && (e = new n.Quaternion),
  39070. this.applyQuaternion(e.setFromAxisAngle(t, i)),
  39071. this
  39072. }
  39073. }(),
  39074. applyMatrix3: function(e) {
  39075. var t = this.x
  39076. , i = this.y
  39077. , n = this.z
  39078. , r = e.elements;
  39079. return this.x = r[0] * t + r[3] * i + r[6] * n,
  39080. this.y = r[1] * t + r[4] * i + r[7] * n,
  39081. this.z = r[2] * t + r[5] * i + r[8] * n,
  39082. this
  39083. },
  39084. applyMatrix4: function(e) {
  39085. var t = this.x
  39086. , i = this.y
  39087. , n = this.z
  39088. , r = e.elements;
  39089. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  39090. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  39091. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  39092. this
  39093. },
  39094. applyProjection: function(e) {
  39095. var t = this.x
  39096. , i = this.y
  39097. , n = this.z
  39098. , r = e.elements
  39099. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  39100. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  39101. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  39102. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  39103. this
  39104. },
  39105. applyQuaternion: function(e) {
  39106. var t = this.x
  39107. , i = this.y
  39108. , n = this.z
  39109. , r = e.x
  39110. , o = e.y
  39111. , a = e.z
  39112. , s = e.w
  39113. , l = s * t + o * n - a * i
  39114. , c = s * i + a * t - r * n
  39115. , h = s * n + r * i - o * t
  39116. , u = -r * t - o * i - a * n;
  39117. return this.x = l * s + u * -r + c * -a - h * -o,
  39118. this.y = c * s + u * -o + h * -r - l * -a,
  39119. this.z = h * s + u * -a + l * -o - c * -r,
  39120. this
  39121. },
  39122. project: function() {
  39123. var e;
  39124. return function(t) {
  39125. return void 0 === e && (e = new n.Matrix4),
  39126. e.multiplyMatrices(t.projectionMatrix, e.getInverse(t.matrixWorld)),
  39127. this.applyProjection(e)
  39128. }
  39129. }(),
  39130. unproject: function() {
  39131. var e;
  39132. return function(t) {
  39133. return void 0 === e && (e = new n.Matrix4),
  39134. e.multiplyMatrices(t.matrixWorld, e.getInverse(t.projectionMatrix)),
  39135. this.applyProjection(e)
  39136. }
  39137. }(),
  39138. transformDirection: function(e) {
  39139. var t = this.x
  39140. , i = this.y
  39141. , n = this.z
  39142. , r = e.elements;
  39143. return this.x = r[0] * t + r[4] * i + r[8] * n,
  39144. this.y = r[1] * t + r[5] * i + r[9] * n,
  39145. this.z = r[2] * t + r[6] * i + r[10] * n,
  39146. this.normalize(),
  39147. this
  39148. },
  39149. divide: function(e) {
  39150. return this.x /= e.x,
  39151. this.y /= e.y,
  39152. this.z /= e.z,
  39153. this
  39154. },
  39155. divideScalar: function(e) {
  39156. return this.multiplyScalar(1 / e)
  39157. },
  39158. min: function(e) {
  39159. return this.x = Math.min(this.x, e.x),
  39160. this.y = Math.min(this.y, e.y),
  39161. this.z = Math.min(this.z, e.z),
  39162. this
  39163. },
  39164. max: function(e) {
  39165. return this.x = Math.max(this.x, e.x),
  39166. this.y = Math.max(this.y, e.y),
  39167. this.z = Math.max(this.z, e.z),
  39168. this
  39169. },
  39170. clamp: function(e, t) {
  39171. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  39172. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  39173. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  39174. this
  39175. },
  39176. clampScalar: function() {
  39177. var e, t;
  39178. return function(i, r) {
  39179. return void 0 === e && (e = new n.Vector3,
  39180. t = new n.Vector3),
  39181. e.set(i, i, i),
  39182. t.set(r, r, r),
  39183. this.clamp(e, t)
  39184. }
  39185. }(),
  39186. clampLength: function(e, t) {
  39187. var i = this.length();
  39188. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  39189. this
  39190. },
  39191. floor: function() {
  39192. return this.x = Math.floor(this.x),
  39193. this.y = Math.floor(this.y),
  39194. this.z = Math.floor(this.z),
  39195. this
  39196. },
  39197. ceil: function() {
  39198. return this.x = Math.ceil(this.x),
  39199. this.y = Math.ceil(this.y),
  39200. this.z = Math.ceil(this.z),
  39201. this
  39202. },
  39203. round: function() {
  39204. return this.x = Math.round(this.x),
  39205. this.y = Math.round(this.y),
  39206. this.z = Math.round(this.z),
  39207. this
  39208. },
  39209. roundToZero: function() {
  39210. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  39211. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  39212. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  39213. this
  39214. },
  39215. negate: function() {
  39216. return this.x = -this.x,
  39217. this.y = -this.y,
  39218. this.z = -this.z,
  39219. this
  39220. },
  39221. dot: function(e) {
  39222. return this.x * e.x + this.y * e.y + this.z * e.z
  39223. },
  39224. lengthSq: function() {
  39225. return this.x * this.x + this.y * this.y + this.z * this.z
  39226. },
  39227. length: function() {
  39228. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  39229. },
  39230. lengthManhattan: function() {
  39231. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  39232. },
  39233. normalize: function() {
  39234. return this.divideScalar(this.length())
  39235. },
  39236. setLength: function(e) {
  39237. return this.multiplyScalar(e / this.length())
  39238. },
  39239. lerp: function(e, t) {
  39240. return this.x += (e.x - this.x) * t,
  39241. this.y += (e.y - this.y) * t,
  39242. this.z += (e.z - this.z) * t,
  39243. this
  39244. },
  39245. lerpVectors: function(e, t, i) {
  39246. return this.subVectors(t, e).multiplyScalar(i).add(e),
  39247. this
  39248. },
  39249. cross: function(e, t) {
  39250. if (void 0 !== t)
  39251. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  39252. this.crossVectors(e, t);
  39253. var i = this.x
  39254. , n = this.y
  39255. , r = this.z;
  39256. return this.x = n * e.z - r * e.y,
  39257. this.y = r * e.x - i * e.z,
  39258. this.z = i * e.y - n * e.x,
  39259. this
  39260. },
  39261. crossVectors: function(e, t) {
  39262. var i = e.x
  39263. , n = e.y
  39264. , r = e.z
  39265. , o = t.x
  39266. , a = t.y
  39267. , s = t.z;
  39268. return this.x = n * s - r * a,
  39269. this.y = r * o - i * s,
  39270. this.z = i * a - n * o,
  39271. this
  39272. },
  39273. projectOnVector: function() {
  39274. var e, t;
  39275. return function(i) {
  39276. return void 0 === e && (e = new n.Vector3),
  39277. e.copy(i).normalize(),
  39278. t = this.dot(e),
  39279. this.copy(e).multiplyScalar(t)
  39280. }
  39281. }(),
  39282. projectOnPlane: function() {
  39283. var e;
  39284. return function(t) {
  39285. return void 0 === e && (e = new n.Vector3),
  39286. e.copy(this).projectOnVector(t),
  39287. this.sub(e)
  39288. }
  39289. }(),
  39290. reflect: function() {
  39291. var e;
  39292. return function(t) {
  39293. return void 0 === e && (e = new n.Vector3),
  39294. this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
  39295. }
  39296. }(),
  39297. angleTo: function(e) {
  39298. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  39299. return Math.acos(n.Math.clamp(t, -1, 1))
  39300. },
  39301. distanceTo: function(e) {
  39302. return Math.sqrt(this.distanceToSquared(e))
  39303. },
  39304. distanceToSquared: function(e) {
  39305. var t = this.x - e.x
  39306. , i = this.y - e.y
  39307. , n = this.z - e.z;
  39308. return t * t + i * i + n * n
  39309. },
  39310. setFromSpherical: function(e) {
  39311. var t = Math.sin(e.phi) * e.radius;
  39312. return this.x = t * Math.sin(e.theta),
  39313. this.y = Math.cos(e.phi) * e.radius,
  39314. this.z = t * Math.cos(e.theta),
  39315. this
  39316. },
  39317. setFromMatrixPosition: function(e) {
  39318. return this.setFromMatrixColumn(e, 3)
  39319. },
  39320. setFromMatrixScale: function(e) {
  39321. var t = this.setFromMatrixColumn(e, 0).length()
  39322. , i = this.setFromMatrixColumn(e, 1).length()
  39323. , n = this.setFromMatrixColumn(e, 2).length();
  39324. return this.x = t,
  39325. this.y = i,
  39326. this.z = n,
  39327. this
  39328. },
  39329. setFromMatrixColumn: function(e, t) {
  39330. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  39331. e = arguments[1],
  39332. t = arguments[0]),
  39333. this.fromArray(e.elements, 4 * t)
  39334. },
  39335. equals: function(e) {
  39336. return e.x === this.x && e.y === this.y && e.z === this.z
  39337. },
  39338. fromArray: function(e, t) {
  39339. return void 0 === t && (t = 0),
  39340. this.x = e[t],
  39341. this.y = e[t + 1],
  39342. this.z = e[t + 2],
  39343. this
  39344. },
  39345. toArray: function(e, t) {
  39346. return void 0 === e && (e = []),
  39347. void 0 === t && (t = 0),
  39348. e[t] = this.x,
  39349. e[t + 1] = this.y,
  39350. e[t + 2] = this.z,
  39351. e
  39352. },
  39353. fromAttribute: function(e, t, i) {
  39354. return void 0 === i && (i = 0),
  39355. t = t * e.itemSize + i,
  39356. this.x = e.array[t],
  39357. this.y = e.array[t + 1],
  39358. this.z = e.array[t + 2],
  39359. this
  39360. }
  39361. },
  39362. n.Vector4 = function(e, t, i, n) {
  39363. this.x = e || 0,
  39364. this.y = t || 0,
  39365. this.z = i || 0,
  39366. this.w = void 0 !== n ? n : 1
  39367. }
  39368. ,
  39369. n.Vector4.prototype = {
  39370. constructor: n.Vector4,
  39371. set: function(e, t, i, n) {
  39372. return this.x = e,
  39373. this.y = t,
  39374. this.z = i,
  39375. this.w = n,
  39376. this
  39377. },
  39378. setScalar: function(e) {
  39379. return this.x = e,
  39380. this.y = e,
  39381. this.z = e,
  39382. this.w = e,
  39383. this
  39384. },
  39385. setX: function(e) {
  39386. return this.x = e,
  39387. this
  39388. },
  39389. setY: function(e) {
  39390. return this.y = e,
  39391. this
  39392. },
  39393. setZ: function(e) {
  39394. return this.z = e,
  39395. this
  39396. },
  39397. setW: function(e) {
  39398. return this.w = e,
  39399. this
  39400. },
  39401. setComponent: function(e, t) {
  39402. switch (e) {
  39403. case 0:
  39404. this.x = t;
  39405. break;
  39406. case 1:
  39407. this.y = t;
  39408. break;
  39409. case 2:
  39410. this.z = t;
  39411. break;
  39412. case 3:
  39413. this.w = t;
  39414. break;
  39415. default:
  39416. throw new Error("index is out of range: " + e)
  39417. }
  39418. },
  39419. getComponent: function(e) {
  39420. switch (e) {
  39421. case 0:
  39422. return this.x;
  39423. case 1:
  39424. return this.y;
  39425. case 2:
  39426. return this.z;
  39427. case 3:
  39428. return this.w;
  39429. default:
  39430. throw new Error("index is out of range: " + e)
  39431. }
  39432. },
  39433. clone: function() {
  39434. return new this.constructor(this.x,this.y,this.z,this.w)
  39435. },
  39436. copy: function(e) {
  39437. return this.x = e.x,
  39438. this.y = e.y,
  39439. this.z = e.z,
  39440. this.w = void 0 !== e.w ? e.w : 1,
  39441. this
  39442. },
  39443. add: function(e, t) {
  39444. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  39445. this.addVectors(e, t)) : (this.x += e.x,
  39446. this.y += e.y,
  39447. this.z += e.z,
  39448. this.w += e.w,
  39449. this)
  39450. },
  39451. addScalar: function(e) {
  39452. return this.x += e,
  39453. this.y += e,
  39454. this.z += e,
  39455. this.w += e,
  39456. this
  39457. },
  39458. addVectors: function(e, t) {
  39459. return this.x = e.x + t.x,
  39460. this.y = e.y + t.y,
  39461. this.z = e.z + t.z,
  39462. this.w = e.w + t.w,
  39463. this
  39464. },
  39465. addScaledVector: function(e, t) {
  39466. return this.x += e.x * t,
  39467. this.y += e.y * t,
  39468. this.z += e.z * t,
  39469. this.w += e.w * t,
  39470. this
  39471. },
  39472. sub: function(e, t) {
  39473. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  39474. this.subVectors(e, t)) : (this.x -= e.x,
  39475. this.y -= e.y,
  39476. this.z -= e.z,
  39477. this.w -= e.w,
  39478. this)
  39479. },
  39480. subScalar: function(e) {
  39481. return this.x -= e,
  39482. this.y -= e,
  39483. this.z -= e,
  39484. this.w -= e,
  39485. this
  39486. },
  39487. subVectors: function(e, t) {
  39488. return this.x = e.x - t.x,
  39489. this.y = e.y - t.y,
  39490. this.z = e.z - t.z,
  39491. this.w = e.w - t.w,
  39492. this
  39493. },
  39494. multiplyScalar: function(e) {
  39495. return isFinite(e) ? (this.x *= e,
  39496. this.y *= e,
  39497. this.z *= e,
  39498. this.w *= e) : (this.x = 0,
  39499. this.y = 0,
  39500. this.z = 0,
  39501. this.w = 0),
  39502. this
  39503. },
  39504. applyMatrix4: function(e) {
  39505. var t = this.x
  39506. , i = this.y
  39507. , n = this.z
  39508. , r = this.w
  39509. , o = e.elements;
  39510. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  39511. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  39512. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  39513. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  39514. this
  39515. },
  39516. divideScalar: function(e) {
  39517. return this.multiplyScalar(1 / e)
  39518. },
  39519. setAxisAngleFromQuaternion: function(e) {
  39520. this.w = 2 * Math.acos(e.w);
  39521. var t = Math.sqrt(1 - e.w * e.w);
  39522. return t < 1e-4 ? (this.x = 1,
  39523. this.y = 0,
  39524. this.z = 0) : (this.x = e.x / t,
  39525. this.y = e.y / t,
  39526. this.z = e.z / t),
  39527. this
  39528. },
  39529. setAxisAngleFromRotationMatrix: function(e) {
  39530. var t, i, n, r, o = .01, a = .1, s = e.elements, l = s[0], c = s[4], h = s[8], u = s[1], d = s[5], p = s[9], f = s[2], g = s[6], m = s[10];
  39531. if (Math.abs(c - u) < o && Math.abs(h - f) < o && Math.abs(p - g) < o) {
  39532. if (Math.abs(c + u) < a && Math.abs(h + f) < a && Math.abs(p + g) < a && Math.abs(l + d + m - 3) < a)
  39533. return this.set(1, 0, 0, 0),
  39534. this;
  39535. t = Math.PI;
  39536. var v = (l + 1) / 2
  39537. , A = (d + 1) / 2
  39538. , y = (m + 1) / 2
  39539. , C = (c + u) / 4
  39540. , I = (h + f) / 4
  39541. , E = (p + g) / 4;
  39542. return v > A && v > y ? v < o ? (i = 0,
  39543. n = .707106781,
  39544. r = .707106781) : (i = Math.sqrt(v),
  39545. n = C / i,
  39546. r = I / i) : A > y ? A < o ? (i = .707106781,
  39547. n = 0,
  39548. r = .707106781) : (n = Math.sqrt(A),
  39549. i = C / n,
  39550. r = E / n) : y < o ? (i = .707106781,
  39551. n = .707106781,
  39552. r = 0) : (r = Math.sqrt(y),
  39553. i = I / r,
  39554. n = E / r),
  39555. this.set(i, n, r, t),
  39556. this
  39557. }
  39558. var b = Math.sqrt((g - p) * (g - p) + (h - f) * (h - f) + (u - c) * (u - c));
  39559. return Math.abs(b) < .001 && (b = 1),
  39560. this.x = (g - p) / b,
  39561. this.y = (h - f) / b,
  39562. this.z = (u - c) / b,
  39563. this.w = Math.acos((l + d + m - 1) / 2),
  39564. this
  39565. },
  39566. min: function(e) {
  39567. return this.x = Math.min(this.x, e.x),
  39568. this.y = Math.min(this.y, e.y),
  39569. this.z = Math.min(this.z, e.z),
  39570. this.w = Math.min(this.w, e.w),
  39571. this
  39572. },
  39573. max: function(e) {
  39574. return this.x = Math.max(this.x, e.x),
  39575. this.y = Math.max(this.y, e.y),
  39576. this.z = Math.max(this.z, e.z),
  39577. this.w = Math.max(this.w, e.w),
  39578. this
  39579. },
  39580. clamp: function(e, t) {
  39581. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  39582. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  39583. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  39584. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  39585. this
  39586. },
  39587. clampScalar: function() {
  39588. var e, t;
  39589. return function(i, r) {
  39590. return void 0 === e && (e = new n.Vector4,
  39591. t = new n.Vector4),
  39592. e.set(i, i, i, i),
  39593. t.set(r, r, r, r),
  39594. this.clamp(e, t)
  39595. }
  39596. }(),
  39597. floor: function() {
  39598. return this.x = Math.floor(this.x),
  39599. this.y = Math.floor(this.y),
  39600. this.z = Math.floor(this.z),
  39601. this.w = Math.floor(this.w),
  39602. this
  39603. },
  39604. ceil: function() {
  39605. return this.x = Math.ceil(this.x),
  39606. this.y = Math.ceil(this.y),
  39607. this.z = Math.ceil(this.z),
  39608. this.w = Math.ceil(this.w),
  39609. this
  39610. },
  39611. round: function() {
  39612. return this.x = Math.round(this.x),
  39613. this.y = Math.round(this.y),
  39614. this.z = Math.round(this.z),
  39615. this.w = Math.round(this.w),
  39616. this
  39617. },
  39618. roundToZero: function() {
  39619. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  39620. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  39621. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  39622. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  39623. this
  39624. },
  39625. negate: function() {
  39626. return this.x = -this.x,
  39627. this.y = -this.y,
  39628. this.z = -this.z,
  39629. this.w = -this.w,
  39630. this
  39631. },
  39632. dot: function(e) {
  39633. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  39634. },
  39635. lengthSq: function() {
  39636. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  39637. },
  39638. length: function() {
  39639. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  39640. },
  39641. lengthManhattan: function() {
  39642. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  39643. },
  39644. normalize: function() {
  39645. return this.divideScalar(this.length())
  39646. },
  39647. setLength: function(e) {
  39648. return this.multiplyScalar(e / this.length())
  39649. },
  39650. lerp: function(e, t) {
  39651. return this.x += (e.x - this.x) * t,
  39652. this.y += (e.y - this.y) * t,
  39653. this.z += (e.z - this.z) * t,
  39654. this.w += (e.w - this.w) * t,
  39655. this
  39656. },
  39657. lerpVectors: function(e, t, i) {
  39658. return this.subVectors(t, e).multiplyScalar(i).add(e),
  39659. this
  39660. },
  39661. equals: function(e) {
  39662. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  39663. },
  39664. fromArray: function(e, t) {
  39665. return void 0 === t && (t = 0),
  39666. this.x = e[t],
  39667. this.y = e[t + 1],
  39668. this.z = e[t + 2],
  39669. this.w = e[t + 3],
  39670. this
  39671. },
  39672. toArray: function(e, t) {
  39673. return void 0 === e && (e = []),
  39674. void 0 === t && (t = 0),
  39675. e[t] = this.x,
  39676. e[t + 1] = this.y,
  39677. e[t + 2] = this.z,
  39678. e[t + 3] = this.w,
  39679. e
  39680. },
  39681. fromAttribute: function(e, t, i) {
  39682. return void 0 === i && (i = 0),
  39683. t = t * e.itemSize + i,
  39684. this.x = e.array[t],
  39685. this.y = e.array[t + 1],
  39686. this.z = e.array[t + 2],
  39687. this.w = e.array[t + 3],
  39688. this
  39689. }
  39690. },
  39691. n.Euler = function(e, t, i, r) {
  39692. this._x = e || 0,
  39693. this._y = t || 0,
  39694. this._z = i || 0,
  39695. this._order = r || n.Euler.DefaultOrder
  39696. }
  39697. ,
  39698. n.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  39699. n.Euler.DefaultOrder = "XYZ",
  39700. n.Euler.prototype = {
  39701. constructor: n.Euler,
  39702. get x() {
  39703. return this._x
  39704. },
  39705. set x(e) {
  39706. this._x = e,
  39707. this.onChangeCallback()
  39708. },
  39709. get y() {
  39710. return this._y
  39711. },
  39712. set y(e) {
  39713. this._y = e,
  39714. this.onChangeCallback()
  39715. },
  39716. get z() {
  39717. return this._z
  39718. },
  39719. set z(e) {
  39720. this._z = e,
  39721. this.onChangeCallback()
  39722. },
  39723. get order() {
  39724. return this._order
  39725. },
  39726. set order(e) {
  39727. this._order = e,
  39728. this.onChangeCallback()
  39729. },
  39730. set: function(e, t, i, n) {
  39731. return this._x = e,
  39732. this._y = t,
  39733. this._z = i,
  39734. this._order = n || this._order,
  39735. this.onChangeCallback(),
  39736. this
  39737. },
  39738. clone: function() {
  39739. return new this.constructor(this._x,this._y,this._z,this._order)
  39740. },
  39741. copy: function(e) {
  39742. return this._x = e._x,
  39743. this._y = e._y,
  39744. this._z = e._z,
  39745. this._order = e._order,
  39746. this.onChangeCallback(),
  39747. this
  39748. },
  39749. setFromRotationMatrix: function(e, t, i) {
  39750. var r = n.Math.clamp
  39751. , o = e.elements
  39752. , a = o[0]
  39753. , s = o[4]
  39754. , l = o[8]
  39755. , c = o[1]
  39756. , h = o[5]
  39757. , u = o[9]
  39758. , d = o[2]
  39759. , p = o[6]
  39760. , f = o[10];
  39761. return t = t || this._order,
  39762. "XYZ" === t ? (this._y = Math.asin(r(l, -1, 1)),
  39763. Math.abs(l) < .99999 ? (this._x = Math.atan2(-u, f),
  39764. this._z = Math.atan2(-s, a)) : (this._x = Math.atan2(p, h),
  39765. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-r(u, -1, 1)),
  39766. Math.abs(u) < .99999 ? (this._y = Math.atan2(l, f),
  39767. this._z = Math.atan2(c, h)) : (this._y = Math.atan2(-d, a),
  39768. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(r(p, -1, 1)),
  39769. Math.abs(p) < .99999 ? (this._y = Math.atan2(-d, f),
  39770. this._z = Math.atan2(-s, h)) : (this._y = 0,
  39771. this._z = Math.atan2(c, a))) : "ZYX" === t ? (this._y = Math.asin(-r(d, -1, 1)),
  39772. Math.abs(d) < .99999 ? (this._x = Math.atan2(p, f),
  39773. this._z = Math.atan2(c, a)) : (this._x = 0,
  39774. this._z = Math.atan2(-s, h))) : "YZX" === t ? (this._z = Math.asin(r(c, -1, 1)),
  39775. Math.abs(c) < .99999 ? (this._x = Math.atan2(-u, h),
  39776. this._y = Math.atan2(-d, a)) : (this._x = 0,
  39777. this._y = Math.atan2(l, f))) : "XZY" === t ? (this._z = Math.asin(-r(s, -1, 1)),
  39778. Math.abs(s) < .99999 ? (this._x = Math.atan2(p, h),
  39779. this._y = Math.atan2(l, a)) : (this._x = Math.atan2(-u, f),
  39780. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  39781. this._order = t,
  39782. i !== !1 && this.onChangeCallback(),
  39783. this
  39784. },
  39785. setFromQuaternion: function() {
  39786. var e;
  39787. return function(t, i, r) {
  39788. return void 0 === e && (e = new n.Matrix4),
  39789. e.makeRotationFromQuaternion(t),
  39790. this.setFromRotationMatrix(e, i, r),
  39791. this
  39792. }
  39793. }(),
  39794. setFromVector3: function(e, t) {
  39795. return this.set(e.x, e.y, e.z, t || this._order)
  39796. },
  39797. reorder: function() {
  39798. var e = new n.Quaternion;
  39799. return function(t) {
  39800. e.setFromEuler(this),
  39801. this.setFromQuaternion(e, t)
  39802. }
  39803. }(),
  39804. equals: function(e) {
  39805. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  39806. },
  39807. fromArray: function(e) {
  39808. return this._x = e[0],
  39809. this._y = e[1],
  39810. this._z = e[2],
  39811. void 0 !== e[3] && (this._order = e[3]),
  39812. this.onChangeCallback(),
  39813. this
  39814. },
  39815. toArray: function(e, t) {
  39816. return void 0 === e && (e = []),
  39817. void 0 === t && (t = 0),
  39818. e[t] = this._x,
  39819. e[t + 1] = this._y,
  39820. e[t + 2] = this._z,
  39821. e[t + 3] = this._order,
  39822. e
  39823. },
  39824. toVector3: function(e) {
  39825. return e ? e.set(this._x, this._y, this._z) : new n.Vector3(this._x,this._y,this._z)
  39826. },
  39827. onChange: function(e) {
  39828. return this.onChangeCallback = e,
  39829. this
  39830. },
  39831. onChangeCallback: function() {}
  39832. },
  39833. n.Line3 = function(e, t) {
  39834. this.start = void 0 !== e ? e : new n.Vector3,
  39835. this.end = void 0 !== t ? t : new n.Vector3
  39836. }
  39837. ,
  39838. n.Line3.prototype = {
  39839. constructor: n.Line3,
  39840. set: function(e, t) {
  39841. return this.start.copy(e),
  39842. this.end.copy(t),
  39843. this
  39844. },
  39845. clone: function() {
  39846. return (new this.constructor).copy(this)
  39847. },
  39848. copy: function(e) {
  39849. return this.start.copy(e.start),
  39850. this.end.copy(e.end),
  39851. this
  39852. },
  39853. center: function(e) {
  39854. var t = e || new n.Vector3;
  39855. return t.addVectors(this.start, this.end).multiplyScalar(.5)
  39856. },
  39857. delta: function(e) {
  39858. var t = e || new n.Vector3;
  39859. return t.subVectors(this.end, this.start)
  39860. },
  39861. distanceSq: function() {
  39862. return this.start.distanceToSquared(this.end)
  39863. },
  39864. distance: function() {
  39865. return this.start.distanceTo(this.end)
  39866. },
  39867. at: function(e, t) {
  39868. var i = t || new n.Vector3;
  39869. return this.delta(i).multiplyScalar(e).add(this.start)
  39870. },
  39871. closestPointToPointParameter: function() {
  39872. var e = new n.Vector3
  39873. , t = new n.Vector3;
  39874. return function(i, r) {
  39875. e.subVectors(i, this.start),
  39876. t.subVectors(this.end, this.start);
  39877. var o = t.dot(t)
  39878. , a = t.dot(e)
  39879. , s = a / o;
  39880. return r && (s = n.Math.clamp(s, 0, 1)),
  39881. s
  39882. }
  39883. }(),
  39884. closestPointToPoint: function(e, t, i) {
  39885. var r = this.closestPointToPointParameter(e, t)
  39886. , o = i || new n.Vector3;
  39887. return this.delta(o).multiplyScalar(r).add(this.start)
  39888. },
  39889. applyMatrix4: function(e) {
  39890. return this.start.applyMatrix4(e),
  39891. this.end.applyMatrix4(e),
  39892. this
  39893. },
  39894. equals: function(e) {
  39895. return e.start.equals(this.start) && e.end.equals(this.end)
  39896. }
  39897. },
  39898. n.Box2 = function(e, t) {
  39899. this.min = void 0 !== e ? e : new n.Vector2(+(1 / 0),+(1 / 0)),
  39900. this.max = void 0 !== t ? t : new n.Vector2(-(1 / 0),-(1 / 0))
  39901. }
  39902. ,
  39903. n.Box2.prototype = {
  39904. constructor: n.Box2,
  39905. set: function(e, t) {
  39906. return this.min.copy(e),
  39907. this.max.copy(t),
  39908. this
  39909. },
  39910. setFromPoints: function(e) {
  39911. this.makeEmpty();
  39912. for (var t = 0, i = e.length; t < i; t++)
  39913. this.expandByPoint(e[t]);
  39914. return this
  39915. },
  39916. setFromCenterAndSize: function() {
  39917. var e = new n.Vector2;
  39918. return function(t, i) {
  39919. var n = e.copy(i).multiplyScalar(.5);
  39920. return this.min.copy(t).sub(n),
  39921. this.max.copy(t).add(n),
  39922. this
  39923. }
  39924. }(),
  39925. clone: function() {
  39926. return (new this.constructor).copy(this)
  39927. },
  39928. copy: function(e) {
  39929. return this.min.copy(e.min),
  39930. this.max.copy(e.max),
  39931. this
  39932. },
  39933. makeEmpty: function() {
  39934. return this.min.x = this.min.y = +(1 / 0),
  39935. this.max.x = this.max.y = -(1 / 0),
  39936. this
  39937. },
  39938. isEmpty: function() {
  39939. return this.max.x < this.min.x || this.max.y < this.min.y
  39940. },
  39941. center: function(e) {
  39942. var t = e || new n.Vector2;
  39943. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  39944. },
  39945. size: function(e) {
  39946. var t = e || new n.Vector2;
  39947. return t.subVectors(this.max, this.min)
  39948. },
  39949. expandByPoint: function(e) {
  39950. return this.min.min(e),
  39951. this.max.max(e),
  39952. this
  39953. },
  39954. expandByVector: function(e) {
  39955. return this.min.sub(e),
  39956. this.max.add(e),
  39957. this
  39958. },
  39959. expandByScalar: function(e) {
  39960. return this.min.addScalar(-e),
  39961. this.max.addScalar(e),
  39962. this
  39963. },
  39964. containsPoint: function(e) {
  39965. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  39966. },
  39967. containsBox: function(e) {
  39968. return this.min.x <= e.min.x && e.max.x <= this.max.x && this.min.y <= e.min.y && e.max.y <= this.max.y
  39969. },
  39970. getParameter: function(e, t) {
  39971. var i = t || new n.Vector2;
  39972. return i.set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y))
  39973. },
  39974. intersectsBox: function(e) {
  39975. return !(e.max.x < this.min.x || e.min.x > this.max.x || e.max.y < this.min.y || e.min.y > this.max.y)
  39976. },
  39977. clampPoint: function(e, t) {
  39978. var i = t || new n.Vector2;
  39979. return i.copy(e).clamp(this.min, this.max)
  39980. },
  39981. distanceToPoint: function() {
  39982. var e = new n.Vector2;
  39983. return function(t) {
  39984. var i = e.copy(t).clamp(this.min, this.max);
  39985. return i.sub(t).length()
  39986. }
  39987. }(),
  39988. intersect: function(e) {
  39989. return this.min.max(e.min),
  39990. this.max.min(e.max),
  39991. this
  39992. },
  39993. union: function(e) {
  39994. return this.min.min(e.min),
  39995. this.max.max(e.max),
  39996. this
  39997. },
  39998. translate: function(e) {
  39999. return this.min.add(e),
  40000. this.max.add(e),
  40001. this
  40002. },
  40003. equals: function(e) {
  40004. return e.min.equals(this.min) && e.max.equals(this.max)
  40005. }
  40006. },
  40007. n.Box3 = function(e, t) {
  40008. this.min = void 0 !== e ? e : new n.Vector3(+(1 / 0),+(1 / 0),+(1 / 0)),
  40009. this.max = void 0 !== t ? t : new n.Vector3(-(1 / 0),-(1 / 0),-(1 / 0))
  40010. }
  40011. ,
  40012. n.Box3.prototype = {
  40013. constructor: n.Box3,
  40014. set: function(e, t) {
  40015. return this.min.copy(e),
  40016. this.max.copy(t),
  40017. this
  40018. },
  40019. setFromArray: function(e) {
  40020. this.makeEmpty();
  40021. for (var t = +(1 / 0), i = +(1 / 0), n = +(1 / 0), r = -(1 / 0), o = -(1 / 0), a = -(1 / 0), s = 0, l = e.length; s < l; s += 3) {
  40022. var c = e[s]
  40023. , h = e[s + 1]
  40024. , u = e[s + 2];
  40025. c < t && (t = c),
  40026. h < i && (i = h),
  40027. u < n && (n = u),
  40028. c > r && (r = c),
  40029. h > o && (o = h),
  40030. u > a && (a = u)
  40031. }
  40032. this.min.set(t, i, n),
  40033. this.max.set(r, o, a)
  40034. },
  40035. setFromPoints: function(e) {
  40036. this.makeEmpty();
  40037. for (var t = 0, i = e.length; t < i; t++)
  40038. this.expandByPoint(e[t]);
  40039. return this
  40040. },
  40041. setFromCenterAndSize: function() {
  40042. var e = new n.Vector3;
  40043. return function(t, i) {
  40044. var n = e.copy(i).multiplyScalar(.5);
  40045. return this.min.copy(t).sub(n),
  40046. this.max.copy(t).add(n),
  40047. this
  40048. }
  40049. }(),
  40050. setFromObject: function() {
  40051. var e;
  40052. return function(t) {
  40053. void 0 === e && (e = new n.Box3);
  40054. var i = this;
  40055. return this.makeEmpty(),
  40056. t.updateMatrixWorld(!0),
  40057. t.traverse(function(t) {
  40058. var n = t.geometry;
  40059. void 0 !== n && (null === n.boundingBox && n.computeBoundingBox(),
  40060. n.boundingBox.isEmpty() === !1 && (e.copy(n.boundingBox),
  40061. e.applyMatrix4(t.matrixWorld),
  40062. i.union(e)))
  40063. }),
  40064. this
  40065. }
  40066. }(),
  40067. clone: function() {
  40068. return (new this.constructor).copy(this)
  40069. },
  40070. copy: function(e) {
  40071. return this.min.copy(e.min),
  40072. this.max.copy(e.max),
  40073. this
  40074. },
  40075. makeEmpty: function() {
  40076. return this.min.x = this.min.y = this.min.z = +(1 / 0),
  40077. this.max.x = this.max.y = this.max.z = -(1 / 0),
  40078. this
  40079. },
  40080. isEmpty: function() {
  40081. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  40082. },
  40083. center: function(e) {
  40084. var t = e || new n.Vector3;
  40085. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  40086. },
  40087. size: function(e) {
  40088. var t = e || new n.Vector3;
  40089. return t.subVectors(this.max, this.min)
  40090. },
  40091. expandByPoint: function(e) {
  40092. return this.min.min(e),
  40093. this.max.max(e),
  40094. this
  40095. },
  40096. expandByVector: function(e) {
  40097. return this.min.sub(e),
  40098. this.max.add(e),
  40099. this
  40100. },
  40101. expandByScalar: function(e) {
  40102. return this.min.addScalar(-e),
  40103. this.max.addScalar(e),
  40104. this
  40105. },
  40106. containsPoint: function(e) {
  40107. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y || e.z < this.min.z || e.z > this.max.z)
  40108. },
  40109. containsBox: function(e) {
  40110. return this.min.x <= e.min.x && e.max.x <= this.max.x && this.min.y <= e.min.y && e.max.y <= this.max.y && this.min.z <= e.min.z && e.max.z <= this.max.z
  40111. },
  40112. getParameter: function(e, t) {
  40113. var i = t || new n.Vector3;
  40114. return i.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))
  40115. },
  40116. intersectsBox: function(e) {
  40117. return !(e.max.x < this.min.x || e.min.x > this.max.x || e.max.y < this.min.y || e.min.y > this.max.y || e.max.z < this.min.z || e.min.z > this.max.z)
  40118. },
  40119. intersectsSphere: function() {
  40120. var e;
  40121. return function(t) {
  40122. return void 0 === e && (e = new n.Vector3),
  40123. this.clampPoint(t.center, e),
  40124. e.distanceToSquared(t.center) <= t.radius * t.radius
  40125. }
  40126. }(),
  40127. intersectsPlane: function(e) {
  40128. var t, i;
  40129. return e.normal.x > 0 ? (t = e.normal.x * this.min.x,
  40130. i = e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  40131. i = e.normal.x * this.min.x),
  40132. e.normal.y > 0 ? (t += e.normal.y * this.min.y,
  40133. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  40134. i += e.normal.y * this.min.y),
  40135. e.normal.z > 0 ? (t += e.normal.z * this.min.z,
  40136. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  40137. i += e.normal.z * this.min.z),
  40138. t <= e.constant && i >= e.constant
  40139. },
  40140. clampPoint: function(e, t) {
  40141. var i = t || new n.Vector3;
  40142. return i.copy(e).clamp(this.min, this.max)
  40143. },
  40144. distanceToPoint: function() {
  40145. var e = new n.Vector3;
  40146. return function(t) {
  40147. var i = e.copy(t).clamp(this.min, this.max);
  40148. return i.sub(t).length()
  40149. }
  40150. }(),
  40151. getBoundingSphere: function() {
  40152. var e = new n.Vector3;
  40153. return function(t) {
  40154. var i = t || new n.Sphere;
  40155. return i.center = this.center(),
  40156. i.radius = .5 * this.size(e).length(),
  40157. i
  40158. }
  40159. }(),
  40160. intersect: function(e) {
  40161. return this.min.max(e.min),
  40162. this.max.min(e.max),
  40163. this
  40164. },
  40165. union: function(e) {
  40166. return this.min.min(e.min),
  40167. this.max.max(e.max),
  40168. this
  40169. },
  40170. applyMatrix4: function() {
  40171. var e = [new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3];
  40172. return function(t) {
  40173. return e[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t),
  40174. e[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t),
  40175. e[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t),
  40176. e[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t),
  40177. e[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t),
  40178. e[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t),
  40179. e[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t),
  40180. e[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t),
  40181. this.makeEmpty(),
  40182. this.setFromPoints(e),
  40183. this
  40184. }
  40185. }(),
  40186. translate: function(e) {
  40187. return this.min.add(e),
  40188. this.max.add(e),
  40189. this
  40190. },
  40191. equals: function(e) {
  40192. return e.min.equals(this.min) && e.max.equals(this.max)
  40193. }
  40194. },
  40195. n.Matrix3 = function() {
  40196. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  40197. arguments.length > 0 && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  40198. }
  40199. ,
  40200. n.Matrix3.prototype = {
  40201. constructor: n.Matrix3,
  40202. set: function(e, t, i, n, r, o, a, s, l) {
  40203. var c = this.elements;
  40204. return c[0] = e,
  40205. c[1] = n,
  40206. c[2] = a,
  40207. c[3] = t,
  40208. c[4] = r,
  40209. c[5] = s,
  40210. c[6] = i,
  40211. c[7] = o,
  40212. c[8] = l,
  40213. this
  40214. },
  40215. identity: function() {
  40216. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  40217. this
  40218. },
  40219. clone: function() {
  40220. return (new this.constructor).fromArray(this.elements)
  40221. },
  40222. copy: function(e) {
  40223. var t = e.elements;
  40224. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  40225. this
  40226. },
  40227. setFromMatrix4: function(e) {
  40228. var t = e.elements;
  40229. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  40230. this
  40231. },
  40232. applyToVector3Array: function() {
  40233. var e;
  40234. return function(t, i, r) {
  40235. void 0 === e && (e = new n.Vector3),
  40236. void 0 === i && (i = 0),
  40237. void 0 === r && (r = t.length);
  40238. for (var o = 0, a = i; o < r; o += 3,
  40239. a += 3)
  40240. e.fromArray(t, a),
  40241. e.applyMatrix3(this),
  40242. e.toArray(t, a);
  40243. return t
  40244. }
  40245. }(),
  40246. applyToBuffer: function() {
  40247. var e;
  40248. return function(t, i, r) {
  40249. void 0 === e && (e = new n.Vector3),
  40250. void 0 === i && (i = 0),
  40251. void 0 === r && (r = t.length / t.itemSize);
  40252. for (var o = 0, a = i; o < r; o++,
  40253. a++)
  40254. e.x = t.getX(a),
  40255. e.y = t.getY(a),
  40256. e.z = t.getZ(a),
  40257. e.applyMatrix3(this),
  40258. t.setXYZ(e.x, e.y, e.z);
  40259. return t
  40260. }
  40261. }(),
  40262. multiplyScalar: function(e) {
  40263. var t = this.elements;
  40264. return t[0] *= e,
  40265. t[3] *= e,
  40266. t[6] *= e,
  40267. t[1] *= e,
  40268. t[4] *= e,
  40269. t[7] *= e,
  40270. t[2] *= e,
  40271. t[5] *= e,
  40272. t[8] *= e,
  40273. this
  40274. },
  40275. determinant: function() {
  40276. var e = this.elements
  40277. , t = e[0]
  40278. , i = e[1]
  40279. , n = e[2]
  40280. , r = e[3]
  40281. , o = e[4]
  40282. , a = e[5]
  40283. , s = e[6]
  40284. , l = e[7]
  40285. , c = e[8];
  40286. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  40287. },
  40288. getInverse: function(e, t) {
  40289. e instanceof n.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  40290. var i = e.elements
  40291. , r = this.elements
  40292. , o = i[0]
  40293. , a = i[1]
  40294. , s = i[2]
  40295. , l = i[3]
  40296. , c = i[4]
  40297. , h = i[5]
  40298. , u = i[6]
  40299. , d = i[7]
  40300. , p = i[8]
  40301. , f = p * c - h * d
  40302. , g = h * u - p * l
  40303. , m = d * l - c * u
  40304. , v = o * f + a * g + s * m;
  40305. if (0 === v) {
  40306. var A = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  40307. if (t)
  40308. throw new Error(A);
  40309. return console.warn(A),
  40310. this.identity()
  40311. }
  40312. return r[0] = f,
  40313. r[1] = s * d - p * a,
  40314. r[2] = h * a - s * c,
  40315. r[3] = g,
  40316. r[4] = p * o - s * u,
  40317. r[5] = s * l - h * o,
  40318. r[6] = m,
  40319. r[7] = a * u - d * o,
  40320. r[8] = c * o - a * l,
  40321. this.multiplyScalar(1 / v)
  40322. },
  40323. transpose: function() {
  40324. var e, t = this.elements;
  40325. return e = t[1],
  40326. t[1] = t[3],
  40327. t[3] = e,
  40328. e = t[2],
  40329. t[2] = t[6],
  40330. t[6] = e,
  40331. e = t[5],
  40332. t[5] = t[7],
  40333. t[7] = e,
  40334. this
  40335. },
  40336. flattenToArrayOffset: function(e, t) {
  40337. var i = this.elements;
  40338. return e[t] = i[0],
  40339. e[t + 1] = i[1],
  40340. e[t + 2] = i[2],
  40341. e[t + 3] = i[3],
  40342. e[t + 4] = i[4],
  40343. e[t + 5] = i[5],
  40344. e[t + 6] = i[6],
  40345. e[t + 7] = i[7],
  40346. e[t + 8] = i[8],
  40347. e
  40348. },
  40349. getNormalMatrix: function(e) {
  40350. return this.setFromMatrix4(e).getInverse(this).transpose()
  40351. },
  40352. transposeIntoArray: function(e) {
  40353. var t = this.elements;
  40354. return e[0] = t[0],
  40355. e[1] = t[3],
  40356. e[2] = t[6],
  40357. e[3] = t[1],
  40358. e[4] = t[4],
  40359. e[5] = t[7],
  40360. e[6] = t[2],
  40361. e[7] = t[5],
  40362. e[8] = t[8],
  40363. this
  40364. },
  40365. fromArray: function(e) {
  40366. return this.elements.set(e),
  40367. this
  40368. },
  40369. toArray: function() {
  40370. var e = this.elements;
  40371. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  40372. }
  40373. },
  40374. n.Matrix4 = function() {
  40375. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  40376. arguments.length > 0 && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  40377. }
  40378. ,
  40379. n.Matrix4.prototype = {
  40380. constructor: n.Matrix4,
  40381. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  40382. var m = this.elements;
  40383. return m[0] = e,
  40384. m[4] = t,
  40385. m[8] = i,
  40386. m[12] = n,
  40387. m[1] = r,
  40388. m[5] = o,
  40389. m[9] = a,
  40390. m[13] = s,
  40391. m[2] = l,
  40392. m[6] = c,
  40393. m[10] = h,
  40394. m[14] = u,
  40395. m[3] = d,
  40396. m[7] = p,
  40397. m[11] = f,
  40398. m[15] = g,
  40399. this
  40400. },
  40401. identity: function() {
  40402. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  40403. this
  40404. },
  40405. clone: function() {
  40406. return (new n.Matrix4).fromArray(this.elements)
  40407. },
  40408. copy: function(e) {
  40409. return this.elements.set(e.elements),
  40410. this
  40411. },
  40412. copyPosition: function(e) {
  40413. var t = this.elements
  40414. , i = e.elements;
  40415. return t[12] = i[12],
  40416. t[13] = i[13],
  40417. t[14] = i[14],
  40418. this
  40419. },
  40420. extractBasis: function(e, t, i) {
  40421. return e.setFromMatrixColumn(this, 0),
  40422. t.setFromMatrixColumn(this, 1),
  40423. i.setFromMatrixColumn(this, 2),
  40424. this
  40425. },
  40426. makeBasis: function(e, t, i) {
  40427. return this.set(e.x, t.x, i.x, 0, e.y, t.y, i.y, 0, e.z, t.z, i.z, 0, 0, 0, 0, 1),
  40428. this
  40429. },
  40430. extractRotation: function() {
  40431. var e;
  40432. return function(t) {
  40433. void 0 === e && (e = new n.Vector3);
  40434. var i = this.elements
  40435. , r = t.elements
  40436. , o = 1 / e.setFromMatrixColumn(t, 0).length()
  40437. , a = 1 / e.setFromMatrixColumn(t, 1).length()
  40438. , s = 1 / e.setFromMatrixColumn(t, 2).length();
  40439. return i[0] = r[0] * o,
  40440. i[1] = r[1] * o,
  40441. i[2] = r[2] * o,
  40442. i[4] = r[4] * a,
  40443. i[5] = r[5] * a,
  40444. i[6] = r[6] * a,
  40445. i[8] = r[8] * s,
  40446. i[9] = r[9] * s,
  40447. i[10] = r[10] * s,
  40448. this
  40449. }
  40450. }(),
  40451. makeRotationFromEuler: function(e) {
  40452. e instanceof n.Euler == !1 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  40453. var t = this.elements
  40454. , i = e.x
  40455. , r = e.y
  40456. , o = e.z
  40457. , a = Math.cos(i)
  40458. , s = Math.sin(i)
  40459. , l = Math.cos(r)
  40460. , c = Math.sin(r)
  40461. , h = Math.cos(o)
  40462. , u = Math.sin(o);
  40463. if ("XYZ" === e.order) {
  40464. var d = a * h
  40465. , p = a * u
  40466. , f = s * h
  40467. , g = s * u;
  40468. t[0] = l * h,
  40469. t[4] = -l * u,
  40470. t[8] = c,
  40471. t[1] = p + f * c,
  40472. t[5] = d - g * c,
  40473. t[9] = -s * l,
  40474. t[2] = g - d * c,
  40475. t[6] = f + p * c,
  40476. t[10] = a * l
  40477. } else if ("YXZ" === e.order) {
  40478. var m = l * h
  40479. , v = l * u
  40480. , A = c * h
  40481. , y = c * u;
  40482. t[0] = m + y * s,
  40483. t[4] = A * s - v,
  40484. t[8] = a * c,
  40485. t[1] = a * u,
  40486. t[5] = a * h,
  40487. t[9] = -s,
  40488. t[2] = v * s - A,
  40489. t[6] = y + m * s,
  40490. t[10] = a * l
  40491. } else if ("ZXY" === e.order) {
  40492. var m = l * h
  40493. , v = l * u
  40494. , A = c * h
  40495. , y = c * u;
  40496. t[0] = m - y * s,
  40497. t[4] = -a * u,
  40498. t[8] = A + v * s,
  40499. t[1] = v + A * s,
  40500. t[5] = a * h,
  40501. t[9] = y - m * s,
  40502. t[2] = -a * c,
  40503. t[6] = s,
  40504. t[10] = a * l
  40505. } else if ("ZYX" === e.order) {
  40506. var d = a * h
  40507. , p = a * u
  40508. , f = s * h
  40509. , g = s * u;
  40510. t[0] = l * h,
  40511. t[4] = f * c - p,
  40512. t[8] = d * c + g,
  40513. t[1] = l * u,
  40514. t[5] = g * c + d,
  40515. t[9] = p * c - f,
  40516. t[2] = -c,
  40517. t[6] = s * l,
  40518. t[10] = a * l
  40519. } else if ("YZX" === e.order) {
  40520. var C = a * l
  40521. , I = a * c
  40522. , E = s * l
  40523. , b = s * c;
  40524. t[0] = l * h,
  40525. t[4] = b - C * u,
  40526. t[8] = E * u + I,
  40527. t[1] = u,
  40528. t[5] = a * h,
  40529. t[9] = -s * h,
  40530. t[2] = -c * h,
  40531. t[6] = I * u + E,
  40532. t[10] = C - b * u
  40533. } else if ("XZY" === e.order) {
  40534. var C = a * l
  40535. , I = a * c
  40536. , E = s * l
  40537. , b = s * c;
  40538. t[0] = l * h,
  40539. t[4] = -u,
  40540. t[8] = c * h,
  40541. t[1] = C * u + b,
  40542. t[5] = a * h,
  40543. t[9] = I * u - E,
  40544. t[2] = E * u - I,
  40545. t[6] = s * h,
  40546. t[10] = b * u + C
  40547. }
  40548. return t[3] = 0,
  40549. t[7] = 0,
  40550. t[11] = 0,
  40551. t[12] = 0,
  40552. t[13] = 0,
  40553. t[14] = 0,
  40554. t[15] = 1,
  40555. this
  40556. },
  40557. makeRotationFromQuaternion: function(e) {
  40558. var t = this.elements
  40559. , i = e.x
  40560. , n = e.y
  40561. , r = e.z
  40562. , o = e.w
  40563. , a = i + i
  40564. , s = n + n
  40565. , l = r + r
  40566. , c = i * a
  40567. , h = i * s
  40568. , u = i * l
  40569. , d = n * s
  40570. , p = n * l
  40571. , f = r * l
  40572. , g = o * a
  40573. , m = o * s
  40574. , v = o * l;
  40575. return t[0] = 1 - (d + f),
  40576. t[4] = h - v,
  40577. t[8] = u + m,
  40578. t[1] = h + v,
  40579. t[5] = 1 - (c + f),
  40580. t[9] = p - g,
  40581. t[2] = u - m,
  40582. t[6] = p + g,
  40583. t[10] = 1 - (c + d),
  40584. t[3] = 0,
  40585. t[7] = 0,
  40586. t[11] = 0,
  40587. t[12] = 0,
  40588. t[13] = 0,
  40589. t[14] = 0,
  40590. t[15] = 1,
  40591. this
  40592. },
  40593. lookAt: function() {
  40594. var e, t, i;
  40595. return function(r, o, a) {
  40596. void 0 === e && (e = new n.Vector3),
  40597. void 0 === t && (t = new n.Vector3),
  40598. void 0 === i && (i = new n.Vector3);
  40599. var s = this.elements;
  40600. return i.subVectors(r, o).normalize(),
  40601. 0 === i.lengthSq() && (i.z = 1),
  40602. e.crossVectors(a, i).normalize(),
  40603. 0 === e.lengthSq() && (i.x += 1e-4,
  40604. e.crossVectors(a, i).normalize()),
  40605. t.crossVectors(i, e),
  40606. s[0] = e.x,
  40607. s[4] = t.x,
  40608. s[8] = i.x,
  40609. s[1] = e.y,
  40610. s[5] = t.y,
  40611. s[9] = i.y,
  40612. s[2] = e.z,
  40613. s[6] = t.z,
  40614. s[10] = i.z,
  40615. this
  40616. }
  40617. }(),
  40618. multiply: function(e, t) {
  40619. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  40620. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  40621. },
  40622. multiplyMatrices: function(e, t) {
  40623. var i = e.elements
  40624. , n = t.elements
  40625. , r = this.elements
  40626. , o = i[0]
  40627. , a = i[4]
  40628. , s = i[8]
  40629. , l = i[12]
  40630. , c = i[1]
  40631. , h = i[5]
  40632. , u = i[9]
  40633. , d = i[13]
  40634. , p = i[2]
  40635. , f = i[6]
  40636. , g = i[10]
  40637. , m = i[14]
  40638. , v = i[3]
  40639. , A = i[7]
  40640. , y = i[11]
  40641. , C = i[15]
  40642. , I = n[0]
  40643. , E = n[4]
  40644. , b = n[8]
  40645. , w = n[12]
  40646. , _ = n[1]
  40647. , T = n[5]
  40648. , x = n[9]
  40649. , S = n[13]
  40650. , M = n[2]
  40651. , R = n[6]
  40652. , P = n[10]
  40653. , O = n[14]
  40654. , L = n[3]
  40655. , D = n[7]
  40656. , N = n[11]
  40657. , B = n[15];
  40658. return r[0] = o * I + a * _ + s * M + l * L,
  40659. r[4] = o * E + a * T + s * R + l * D,
  40660. r[8] = o * b + a * x + s * P + l * N,
  40661. r[12] = o * w + a * S + s * O + l * B,
  40662. r[1] = c * I + h * _ + u * M + d * L,
  40663. r[5] = c * E + h * T + u * R + d * D,
  40664. r[9] = c * b + h * x + u * P + d * N,
  40665. r[13] = c * w + h * S + u * O + d * B,
  40666. r[2] = p * I + f * _ + g * M + m * L,
  40667. r[6] = p * E + f * T + g * R + m * D,
  40668. r[10] = p * b + f * x + g * P + m * N,
  40669. r[14] = p * w + f * S + g * O + m * B,
  40670. r[3] = v * I + A * _ + y * M + C * L,
  40671. r[7] = v * E + A * T + y * R + C * D,
  40672. r[11] = v * b + A * x + y * P + C * N,
  40673. r[15] = v * w + A * S + y * O + C * B,
  40674. this
  40675. },
  40676. multiplyToArray: function(e, t, i) {
  40677. var n = this.elements;
  40678. return this.multiplyMatrices(e, t),
  40679. i[0] = n[0],
  40680. i[1] = n[1],
  40681. i[2] = n[2],
  40682. i[3] = n[3],
  40683. i[4] = n[4],
  40684. i[5] = n[5],
  40685. i[6] = n[6],
  40686. i[7] = n[7],
  40687. i[8] = n[8],
  40688. i[9] = n[9],
  40689. i[10] = n[10],
  40690. i[11] = n[11],
  40691. i[12] = n[12],
  40692. i[13] = n[13],
  40693. i[14] = n[14],
  40694. i[15] = n[15],
  40695. this
  40696. },
  40697. multiplyScalar: function(e) {
  40698. var t = this.elements;
  40699. return t[0] *= e,
  40700. t[4] *= e,
  40701. t[8] *= e,
  40702. t[12] *= e,
  40703. t[1] *= e,
  40704. t[5] *= e,
  40705. t[9] *= e,
  40706. t[13] *= e,
  40707. t[2] *= e,
  40708. t[6] *= e,
  40709. t[10] *= e,
  40710. t[14] *= e,
  40711. t[3] *= e,
  40712. t[7] *= e,
  40713. t[11] *= e,
  40714. t[15] *= e,
  40715. this
  40716. },
  40717. applyToVector3Array: function() {
  40718. var e;
  40719. return function(t, i, r) {
  40720. void 0 === e && (e = new n.Vector3),
  40721. void 0 === i && (i = 0),
  40722. void 0 === r && (r = t.length);
  40723. for (var o = 0, a = i; o < r; o += 3,
  40724. a += 3)
  40725. e.fromArray(t, a),
  40726. e.applyMatrix4(this),
  40727. e.toArray(t, a);
  40728. return t
  40729. }
  40730. }(),
  40731. applyToBuffer: function() {
  40732. var e;
  40733. return function(t, i, r) {
  40734. void 0 === e && (e = new n.Vector3),
  40735. void 0 === i && (i = 0),
  40736. void 0 === r && (r = t.length / t.itemSize);
  40737. for (var o = 0, a = i; o < r; o++,
  40738. a++)
  40739. e.x = t.getX(a),
  40740. e.y = t.getY(a),
  40741. e.z = t.getZ(a),
  40742. e.applyMatrix4(this),
  40743. t.setXYZ(e.x, e.y, e.z);
  40744. return t
  40745. }
  40746. }(),
  40747. determinant: function() {
  40748. var e = this.elements
  40749. , t = e[0]
  40750. , i = e[4]
  40751. , n = e[8]
  40752. , r = e[12]
  40753. , o = e[1]
  40754. , a = e[5]
  40755. , s = e[9]
  40756. , l = e[13]
  40757. , c = e[2]
  40758. , h = e[6]
  40759. , u = e[10]
  40760. , d = e[14]
  40761. , p = e[3]
  40762. , f = e[7]
  40763. , g = e[11]
  40764. , m = e[15];
  40765. return p * (+r * s * h - n * l * h - r * a * u + i * l * u + n * a * d - i * s * d) + f * (+t * s * d - t * l * u + r * o * u - n * o * d + n * l * c - r * s * c) + g * (+t * l * h - t * a * d - r * o * h + i * o * d + r * a * c - i * l * c) + m * (-n * a * c - t * s * h + t * a * u + n * o * h - i * o * u + i * s * c)
  40766. },
  40767. transpose: function() {
  40768. var e, t = this.elements;
  40769. return e = t[1],
  40770. t[1] = t[4],
  40771. t[4] = e,
  40772. e = t[2],
  40773. t[2] = t[8],
  40774. t[8] = e,
  40775. e = t[6],
  40776. t[6] = t[9],
  40777. t[9] = e,
  40778. e = t[3],
  40779. t[3] = t[12],
  40780. t[12] = e,
  40781. e = t[7],
  40782. t[7] = t[13],
  40783. t[13] = e,
  40784. e = t[11],
  40785. t[11] = t[14],
  40786. t[14] = e,
  40787. this
  40788. },
  40789. flattenToArrayOffset: function(e, t) {
  40790. var i = this.elements;
  40791. return e[t] = i[0],
  40792. e[t + 1] = i[1],
  40793. e[t + 2] = i[2],
  40794. e[t + 3] = i[3],
  40795. e[t + 4] = i[4],
  40796. e[t + 5] = i[5],
  40797. e[t + 6] = i[6],
  40798. e[t + 7] = i[7],
  40799. e[t + 8] = i[8],
  40800. e[t + 9] = i[9],
  40801. e[t + 10] = i[10],
  40802. e[t + 11] = i[11],
  40803. e[t + 12] = i[12],
  40804. e[t + 13] = i[13],
  40805. e[t + 14] = i[14],
  40806. e[t + 15] = i[15],
  40807. e
  40808. },
  40809. getPosition: function() {
  40810. var e;
  40811. return function() {
  40812. return void 0 === e && (e = new n.Vector3),
  40813. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  40814. e.setFromMatrixColumn(this, 3)
  40815. }
  40816. }(),
  40817. setPosition: function(e) {
  40818. var t = this.elements;
  40819. return t[12] = e.x,
  40820. t[13] = e.y,
  40821. t[14] = e.z,
  40822. this
  40823. },
  40824. getInverse: function(e, t) {
  40825. var i = this.elements
  40826. , n = e.elements
  40827. , r = n[0]
  40828. , o = n[1]
  40829. , a = n[2]
  40830. , s = n[3]
  40831. , l = n[4]
  40832. , c = n[5]
  40833. , h = n[6]
  40834. , u = n[7]
  40835. , d = n[8]
  40836. , p = n[9]
  40837. , f = n[10]
  40838. , g = n[11]
  40839. , m = n[12]
  40840. , v = n[13]
  40841. , A = n[14]
  40842. , y = n[15]
  40843. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  40844. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  40845. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  40846. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  40847. , w = r * C + o * I + a * E + s * b;
  40848. if (0 === w) {
  40849. var _ = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  40850. if (t)
  40851. throw new Error(_);
  40852. return console.warn(_),
  40853. this.identity()
  40854. }
  40855. return i[0] = C,
  40856. i[1] = v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y,
  40857. i[2] = c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y,
  40858. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  40859. i[4] = I,
  40860. i[5] = d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y,
  40861. i[6] = m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y,
  40862. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  40863. i[8] = E,
  40864. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y,
  40865. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y,
  40866. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  40867. i[12] = b,
  40868. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A,
  40869. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A,
  40870. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  40871. this.multiplyScalar(1 / w)
  40872. },
  40873. scale: function(e) {
  40874. var t = this.elements
  40875. , i = e.x
  40876. , n = e.y
  40877. , r = e.z;
  40878. return t[0] *= i,
  40879. t[4] *= n,
  40880. t[8] *= r,
  40881. t[1] *= i,
  40882. t[5] *= n,
  40883. t[9] *= r,
  40884. t[2] *= i,
  40885. t[6] *= n,
  40886. t[10] *= r,
  40887. t[3] *= i,
  40888. t[7] *= n,
  40889. t[11] *= r,
  40890. this
  40891. },
  40892. getMaxScaleOnAxis: function() {
  40893. var e = this.elements
  40894. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  40895. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  40896. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  40897. return Math.sqrt(Math.max(t, i, n))
  40898. },
  40899. makeTranslation: function(e, t, i) {
  40900. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  40901. this
  40902. },
  40903. makeRotationX: function(e) {
  40904. var t = Math.cos(e)
  40905. , i = Math.sin(e);
  40906. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  40907. this
  40908. },
  40909. makeRotationY: function(e) {
  40910. var t = Math.cos(e)
  40911. , i = Math.sin(e);
  40912. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  40913. this
  40914. },
  40915. makeRotationZ: function(e) {
  40916. var t = Math.cos(e)
  40917. , i = Math.sin(e);
  40918. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  40919. this
  40920. },
  40921. makeRotationAxis: function(e, t) {
  40922. var i = Math.cos(t)
  40923. , n = Math.sin(t)
  40924. , r = 1 - i
  40925. , o = e.x
  40926. , a = e.y
  40927. , s = e.z
  40928. , l = r * o
  40929. , c = r * a;
  40930. return this.set(l * o + i, l * a - n * s, l * s + n * a, 0, l * a + n * s, c * a + i, c * s - n * o, 0, l * s - n * a, c * s + n * o, r * s * s + i, 0, 0, 0, 0, 1),
  40931. this
  40932. },
  40933. makeScale: function(e, t, i) {
  40934. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  40935. this
  40936. },
  40937. compose: function(e, t, i) {
  40938. return this.makeRotationFromQuaternion(t),
  40939. this.scale(i),
  40940. this.setPosition(e),
  40941. this
  40942. },
  40943. decompose: function() {
  40944. var e, t;
  40945. return function(i, r, o) {
  40946. void 0 === e && (e = new n.Vector3),
  40947. void 0 === t && (t = new n.Matrix4);
  40948. var a = this.elements
  40949. , s = e.set(a[0], a[1], a[2]).length()
  40950. , l = e.set(a[4], a[5], a[6]).length()
  40951. , c = e.set(a[8], a[9], a[10]).length()
  40952. , h = this.determinant();
  40953. h < 0 && (s = -s),
  40954. i.x = a[12],
  40955. i.y = a[13],
  40956. i.z = a[14],
  40957. t.elements.set(this.elements);
  40958. var u = 1 / s
  40959. , d = 1 / l
  40960. , p = 1 / c;
  40961. return t.elements[0] *= u,
  40962. t.elements[1] *= u,
  40963. t.elements[2] *= u,
  40964. t.elements[4] *= d,
  40965. t.elements[5] *= d,
  40966. t.elements[6] *= d,
  40967. t.elements[8] *= p,
  40968. t.elements[9] *= p,
  40969. t.elements[10] *= p,
  40970. r.setFromRotationMatrix(t),
  40971. o.x = s,
  40972. o.y = l,
  40973. o.z = c,
  40974. this
  40975. }
  40976. }(),
  40977. makeFrustum: function(e, t, i, n, r, o) {
  40978. var a = this.elements
  40979. , s = 2 * r / (t - e)
  40980. , l = 2 * r / (n - i)
  40981. , c = (t + e) / (t - e)
  40982. , h = (n + i) / (n - i)
  40983. , u = -(o + r) / (o - r)
  40984. , d = -2 * o * r / (o - r);
  40985. return a[0] = s,
  40986. a[4] = 0,
  40987. a[8] = c,
  40988. a[12] = 0,
  40989. a[1] = 0,
  40990. a[5] = l,
  40991. a[9] = h,
  40992. a[13] = 0,
  40993. a[2] = 0,
  40994. a[6] = 0,
  40995. a[10] = u,
  40996. a[14] = d,
  40997. a[3] = 0,
  40998. a[7] = 0,
  40999. a[11] = -1,
  41000. a[15] = 0,
  41001. this
  41002. },
  41003. makePerspective: function(e, t, i, r) {
  41004. var o = i * Math.tan(n.Math.degToRad(.5 * e))
  41005. , a = -o
  41006. , s = a * t
  41007. , l = o * t;
  41008. return this.makeFrustum(s, l, a, o, i, r)
  41009. },
  41010. makeOrthographic: function(e, t, i, n, r, o) {
  41011. var a = this.elements
  41012. , s = 1 / (t - e)
  41013. , l = 1 / (i - n)
  41014. , c = 1 / (o - r)
  41015. , h = (t + e) * s
  41016. , u = (i + n) * l
  41017. , d = (o + r) * c;
  41018. return a[0] = 2 * s,
  41019. a[4] = 0,
  41020. a[8] = 0,
  41021. a[12] = -h,
  41022. a[1] = 0,
  41023. a[5] = 2 * l,
  41024. a[9] = 0,
  41025. a[13] = -u,
  41026. a[2] = 0,
  41027. a[6] = 0,
  41028. a[10] = -2 * c,
  41029. a[14] = -d,
  41030. a[3] = 0,
  41031. a[7] = 0,
  41032. a[11] = 0,
  41033. a[15] = 1,
  41034. this
  41035. },
  41036. equals: function(e) {
  41037. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  41038. if (t[n] !== i[n])
  41039. return !1;
  41040. return !0
  41041. },
  41042. fromArray: function(e) {
  41043. return this.elements.set(e),
  41044. this
  41045. },
  41046. toArray: function() {
  41047. var e = this.elements;
  41048. 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]]
  41049. }
  41050. },
  41051. n.Ray = function(e, t) {
  41052. this.origin = void 0 !== e ? e : new n.Vector3,
  41053. this.direction = void 0 !== t ? t : new n.Vector3
  41054. }
  41055. ,
  41056. n.Ray.prototype = {
  41057. constructor: n.Ray,
  41058. set: function(e, t) {
  41059. return this.origin.copy(e),
  41060. this.direction.copy(t),
  41061. this
  41062. },
  41063. clone: function() {
  41064. return (new this.constructor).copy(this)
  41065. },
  41066. copy: function(e) {
  41067. return this.origin.copy(e.origin),
  41068. this.direction.copy(e.direction),
  41069. this
  41070. },
  41071. at: function(e, t) {
  41072. var i = t || new n.Vector3;
  41073. return i.copy(this.direction).multiplyScalar(e).add(this.origin)
  41074. },
  41075. lookAt: function(e) {
  41076. this.direction.copy(e).sub(this.origin).normalize()
  41077. },
  41078. recast: function() {
  41079. var e = new n.Vector3;
  41080. return function(t) {
  41081. return this.origin.copy(this.at(t, e)),
  41082. this
  41083. }
  41084. }(),
  41085. closestPointToPoint: function(e, t) {
  41086. var i = t || new n.Vector3;
  41087. i.subVectors(e, this.origin);
  41088. var r = i.dot(this.direction);
  41089. return r < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(r).add(this.origin)
  41090. },
  41091. distanceToPoint: function(e) {
  41092. return Math.sqrt(this.distanceSqToPoint(e))
  41093. },
  41094. distanceSqToPoint: function() {
  41095. var e = new n.Vector3;
  41096. return function(t) {
  41097. var i = e.subVectors(t, this.origin).dot(this.direction);
  41098. return i < 0 ? this.origin.distanceToSquared(t) : (e.copy(this.direction).multiplyScalar(i).add(this.origin),
  41099. e.distanceToSquared(t))
  41100. }
  41101. }(),
  41102. distanceSqToSegment: function() {
  41103. var e = new n.Vector3
  41104. , t = new n.Vector3
  41105. , i = new n.Vector3;
  41106. return function(n, r, o, a) {
  41107. e.copy(n).add(r).multiplyScalar(.5),
  41108. t.copy(r).sub(n).normalize(),
  41109. i.copy(this.origin).sub(e);
  41110. var s, l, c, h, u = .5 * n.distanceTo(r), d = -this.direction.dot(t), p = i.dot(this.direction), f = -i.dot(t), g = i.lengthSq(), m = Math.abs(1 - d * d);
  41111. if (m > 0)
  41112. if (s = d * f - p,
  41113. l = d * p - f,
  41114. h = u * m,
  41115. s >= 0)
  41116. if (l >= -h)
  41117. if (l <= h) {
  41118. var v = 1 / m;
  41119. s *= v,
  41120. l *= v,
  41121. c = s * (s + d * l + 2 * p) + l * (d * s + l + 2 * f) + g
  41122. } else
  41123. l = u,
  41124. s = Math.max(0, -(d * l + p)),
  41125. c = -s * s + l * (l + 2 * f) + g;
  41126. else
  41127. l = -u,
  41128. s = Math.max(0, -(d * l + p)),
  41129. c = -s * s + l * (l + 2 * f) + g;
  41130. else
  41131. l <= -h ? (s = Math.max(0, -(-d * u + p)),
  41132. l = s > 0 ? -u : Math.min(Math.max(-u, -f), u),
  41133. c = -s * s + l * (l + 2 * f) + g) : l <= h ? (s = 0,
  41134. l = Math.min(Math.max(-u, -f), u),
  41135. c = l * (l + 2 * f) + g) : (s = Math.max(0, -(d * u + p)),
  41136. l = s > 0 ? u : Math.min(Math.max(-u, -f), u),
  41137. c = -s * s + l * (l + 2 * f) + g);
  41138. else
  41139. l = d > 0 ? -u : u,
  41140. s = Math.max(0, -(d * l + p)),
  41141. c = -s * s + l * (l + 2 * f) + g;
  41142. return o && o.copy(this.direction).multiplyScalar(s).add(this.origin),
  41143. a && a.copy(t).multiplyScalar(l).add(e),
  41144. c
  41145. }
  41146. }(),
  41147. intersectSphere: function() {
  41148. var e = new n.Vector3;
  41149. return function(t, i) {
  41150. e.subVectors(t.center, this.origin);
  41151. var n = e.dot(this.direction)
  41152. , r = e.dot(e) - n * n
  41153. , o = t.radius * t.radius;
  41154. if (r > o)
  41155. return null;
  41156. var a = Math.sqrt(o - r)
  41157. , s = n - a
  41158. , l = n + a;
  41159. return s < 0 && l < 0 ? null : s < 0 ? this.at(l, i) : this.at(s, i)
  41160. }
  41161. }(),
  41162. intersectsSphere: function(e) {
  41163. return this.distanceToPoint(e.center) <= e.radius
  41164. },
  41165. distanceToPlane: function(e) {
  41166. var t = e.normal.dot(this.direction);
  41167. if (0 === t)
  41168. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  41169. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  41170. return i >= 0 ? i : null
  41171. },
  41172. intersectPlane: function(e, t) {
  41173. var i = this.distanceToPlane(e);
  41174. return null === i ? null : this.at(i, t)
  41175. },
  41176. intersectsPlane: function(e) {
  41177. var t = e.distanceToPoint(this.origin);
  41178. if (0 === t)
  41179. return !0;
  41180. var i = e.normal.dot(this.direction);
  41181. return i * t < 0
  41182. },
  41183. intersectBox: function(e, t) {
  41184. var i, n, r, o, a, s, l = 1 / this.direction.x, c = 1 / this.direction.y, h = 1 / this.direction.z, u = this.origin;
  41185. return l >= 0 ? (i = (e.min.x - u.x) * l,
  41186. n = (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  41187. n = (e.min.x - u.x) * l),
  41188. c >= 0 ? (r = (e.min.y - u.y) * c,
  41189. o = (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  41190. o = (e.min.y - u.y) * c),
  41191. i > o || r > n ? null : ((r > i || i !== i) && (i = r),
  41192. (o < n || n !== n) && (n = o),
  41193. h >= 0 ? (a = (e.min.z - u.z) * h,
  41194. s = (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  41195. s = (e.min.z - u.z) * h),
  41196. i > s || a > n ? null : ((a > i || i !== i) && (i = a),
  41197. (s < n || n !== n) && (n = s),
  41198. n < 0 ? null : this.at(i >= 0 ? i : n, t)))
  41199. },
  41200. intersectsBox: function() {
  41201. var e = new n.Vector3;
  41202. return function(t) {
  41203. return null !== this.intersectBox(t, e)
  41204. }
  41205. }(),
  41206. intersectTriangle: function() {
  41207. var e = new n.Vector3
  41208. , t = new n.Vector3
  41209. , i = new n.Vector3
  41210. , r = new n.Vector3;
  41211. return function(n, o, a, s, l) {
  41212. t.subVectors(o, n),
  41213. i.subVectors(a, n),
  41214. r.crossVectors(t, i);
  41215. var c, h = this.direction.dot(r);
  41216. if (h > 0) {
  41217. if (s)
  41218. return null;
  41219. c = 1
  41220. } else {
  41221. if (!(h < 0))
  41222. return null;
  41223. c = -1,
  41224. h = -h
  41225. }
  41226. e.subVectors(this.origin, n);
  41227. var u = c * this.direction.dot(i.crossVectors(e, i));
  41228. if (u < 0)
  41229. return null;
  41230. var d = c * this.direction.dot(t.cross(e));
  41231. if (d < 0)
  41232. return null;
  41233. if (u + d > h)
  41234. return null;
  41235. var p = -c * e.dot(r);
  41236. return p < 0 ? null : this.at(p / h, l)
  41237. }
  41238. }(),
  41239. applyMatrix4: function(e) {
  41240. return this.direction.add(this.origin).applyMatrix4(e),
  41241. this.origin.applyMatrix4(e),
  41242. this.direction.sub(this.origin),
  41243. this.direction.normalize(),
  41244. this
  41245. },
  41246. equals: function(e) {
  41247. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  41248. }
  41249. },
  41250. n.Sphere = function(e, t) {
  41251. this.center = void 0 !== e ? e : new n.Vector3,
  41252. this.radius = void 0 !== t ? t : 0
  41253. }
  41254. ,
  41255. n.Sphere.prototype = {
  41256. constructor: n.Sphere,
  41257. set: function(e, t) {
  41258. return this.center.copy(e),
  41259. this.radius = t,
  41260. this
  41261. },
  41262. setFromPoints: function() {
  41263. var e = new n.Box3;
  41264. return function(t, i) {
  41265. var n = this.center;
  41266. void 0 !== i ? n.copy(i) : e.setFromPoints(t).center(n);
  41267. for (var r = 0, o = 0, a = t.length; o < a; o++)
  41268. r = Math.max(r, n.distanceToSquared(t[o]));
  41269. return this.radius = Math.sqrt(r),
  41270. this
  41271. }
  41272. }(),
  41273. clone: function() {
  41274. return (new this.constructor).copy(this)
  41275. },
  41276. copy: function(e) {
  41277. return this.center.copy(e.center),
  41278. this.radius = e.radius,
  41279. this
  41280. },
  41281. empty: function() {
  41282. return this.radius <= 0
  41283. },
  41284. containsPoint: function(e) {
  41285. return e.distanceToSquared(this.center) <= this.radius * this.radius
  41286. },
  41287. distanceToPoint: function(e) {
  41288. return e.distanceTo(this.center) - this.radius
  41289. },
  41290. intersectsSphere: function(e) {
  41291. var t = this.radius + e.radius;
  41292. return e.center.distanceToSquared(this.center) <= t * t
  41293. },
  41294. intersectsBox: function(e) {
  41295. return e.intersectsSphere(this)
  41296. },
  41297. intersectsPlane: function(e) {
  41298. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  41299. },
  41300. clampPoint: function(e, t) {
  41301. var i = this.center.distanceToSquared(e)
  41302. , r = t || new n.Vector3;
  41303. return r.copy(e),
  41304. i > this.radius * this.radius && (r.sub(this.center).normalize(),
  41305. r.multiplyScalar(this.radius).add(this.center)),
  41306. r
  41307. },
  41308. getBoundingBox: function(e) {
  41309. var t = e || new n.Box3;
  41310. return t.set(this.center, this.center),
  41311. t.expandByScalar(this.radius),
  41312. t
  41313. },
  41314. applyMatrix4: function(e) {
  41315. return this.center.applyMatrix4(e),
  41316. this.radius = this.radius * e.getMaxScaleOnAxis(),
  41317. this
  41318. },
  41319. translate: function(e) {
  41320. return this.center.add(e),
  41321. this
  41322. },
  41323. equals: function(e) {
  41324. return e.center.equals(this.center) && e.radius === this.radius
  41325. }
  41326. },
  41327. n.Frustum = function(e, t, i, r, o, a) {
  41328. this.planes = [void 0 !== e ? e : new n.Plane, void 0 !== t ? t : new n.Plane, void 0 !== i ? i : new n.Plane, void 0 !== r ? r : new n.Plane, void 0 !== o ? o : new n.Plane, void 0 !== a ? a : new n.Plane]
  41329. }
  41330. ,
  41331. n.Frustum.prototype = {
  41332. constructor: n.Frustum,
  41333. set: function(e, t, i, n, r, o) {
  41334. var a = this.planes;
  41335. return a[0].copy(e),
  41336. a[1].copy(t),
  41337. a[2].copy(i),
  41338. a[3].copy(n),
  41339. a[4].copy(r),
  41340. a[5].copy(o),
  41341. this
  41342. },
  41343. clone: function() {
  41344. return (new this.constructor).copy(this)
  41345. },
  41346. copy: function(e) {
  41347. for (var t = this.planes, i = 0; i < 6; i++)
  41348. t[i].copy(e.planes[i]);
  41349. return this
  41350. },
  41351. setFromMatrix: function(e) {
  41352. var t = this.planes
  41353. , i = e.elements
  41354. , n = i[0]
  41355. , r = i[1]
  41356. , o = i[2]
  41357. , a = i[3]
  41358. , s = i[4]
  41359. , l = i[5]
  41360. , c = i[6]
  41361. , h = i[7]
  41362. , u = i[8]
  41363. , d = i[9]
  41364. , p = i[10]
  41365. , f = i[11]
  41366. , g = i[12]
  41367. , m = i[13]
  41368. , v = i[14]
  41369. , A = i[15];
  41370. return t[0].setComponents(a - n, h - s, f - u, A - g).normalize(),
  41371. t[1].setComponents(a + n, h + s, f + u, A + g).normalize(),
  41372. t[2].setComponents(a + r, h + l, f + d, A + m).normalize(),
  41373. t[3].setComponents(a - r, h - l, f - d, A - m).normalize(),
  41374. t[4].setComponents(a - o, h - c, f - p, A - v).normalize(),
  41375. t[5].setComponents(a + o, h + c, f + p, A + v).normalize(),
  41376. this
  41377. },
  41378. intersectsObject: function() {
  41379. var e = new n.Sphere;
  41380. return function(t) {
  41381. var i = t.geometry;
  41382. return null === i.boundingSphere && i.computeBoundingSphere(),
  41383. e.copy(i.boundingSphere),
  41384. e.applyMatrix4(t.matrixWorld),
  41385. this.intersectsSphere(e)
  41386. }
  41387. }(),
  41388. intersectsSphere: function(e) {
  41389. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  41390. var o = t[r].distanceToPoint(i);
  41391. if (o < n)
  41392. return !1
  41393. }
  41394. return !0
  41395. },
  41396. intersectsBox: function() {
  41397. var e = new n.Vector3
  41398. , t = new n.Vector3;
  41399. return function(i) {
  41400. for (var n = this.planes, r = 0; r < 6; r++) {
  41401. var o = n[r];
  41402. e.x = o.normal.x > 0 ? i.min.x : i.max.x,
  41403. t.x = o.normal.x > 0 ? i.max.x : i.min.x,
  41404. e.y = o.normal.y > 0 ? i.min.y : i.max.y,
  41405. t.y = o.normal.y > 0 ? i.max.y : i.min.y,
  41406. e.z = o.normal.z > 0 ? i.min.z : i.max.z,
  41407. t.z = o.normal.z > 0 ? i.max.z : i.min.z;
  41408. var a = o.distanceToPoint(e)
  41409. , s = o.distanceToPoint(t);
  41410. if (a < 0 && s < 0)
  41411. return !1
  41412. }
  41413. return !0
  41414. }
  41415. }(),
  41416. containsPoint: function(e) {
  41417. for (var t = this.planes, i = 0; i < 6; i++)
  41418. if (t[i].distanceToPoint(e) < 0)
  41419. return !1;
  41420. return !0
  41421. }
  41422. },
  41423. n.Plane = function(e, t) {
  41424. this.normal = void 0 !== e ? e : new n.Vector3(1,0,0),
  41425. this.constant = void 0 !== t ? t : 0
  41426. }
  41427. ,
  41428. n.Plane.prototype = {
  41429. constructor: n.Plane,
  41430. set: function(e, t) {
  41431. return this.normal.copy(e),
  41432. this.constant = t,
  41433. this
  41434. },
  41435. setComponents: function(e, t, i, n) {
  41436. return this.normal.set(e, t, i),
  41437. this.constant = n,
  41438. this
  41439. },
  41440. setFromNormalAndCoplanarPoint: function(e, t) {
  41441. return this.normal.copy(e),
  41442. this.constant = -t.dot(this.normal),
  41443. this
  41444. },
  41445. setFromCoplanarPoints: function() {
  41446. var e = new n.Vector3
  41447. , t = new n.Vector3;
  41448. return function(i, n, r) {
  41449. var o = e.subVectors(r, n).cross(t.subVectors(i, n)).normalize();
  41450. return this.setFromNormalAndCoplanarPoint(o, i),
  41451. this
  41452. }
  41453. }(),
  41454. clone: function() {
  41455. return (new this.constructor).copy(this)
  41456. },
  41457. copy: function(e) {
  41458. return this.normal.copy(e.normal),
  41459. this.constant = e.constant,
  41460. this
  41461. },
  41462. normalize: function() {
  41463. var e = 1 / this.normal.length();
  41464. return this.normal.multiplyScalar(e),
  41465. this.constant *= e,
  41466. this
  41467. },
  41468. negate: function() {
  41469. return this.constant *= -1,
  41470. this.normal.negate(),
  41471. this
  41472. },
  41473. distanceToPoint: function(e) {
  41474. return this.normal.dot(e) + this.constant
  41475. },
  41476. distanceToSphere: function(e) {
  41477. return this.distanceToPoint(e.center) - e.radius
  41478. },
  41479. projectPoint: function(e, t) {
  41480. return this.orthoPoint(e, t).sub(e).negate()
  41481. },
  41482. orthoPoint: function(e, t) {
  41483. var i = this.distanceToPoint(e)
  41484. , r = t || new n.Vector3;
  41485. return r.copy(this.normal).multiplyScalar(i)
  41486. },
  41487. intersectLine: function() {
  41488. var e = new n.Vector3;
  41489. return function(t, i) {
  41490. var r = i || new n.Vector3
  41491. , o = t.delta(e)
  41492. , a = this.normal.dot(o);
  41493. if (0 !== a) {
  41494. var s = -(t.start.dot(this.normal) + this.constant) / a;
  41495. if (!(s < 0 || s > 1))
  41496. return r.copy(o).multiplyScalar(s).add(t.start)
  41497. } else if (0 === this.distanceToPoint(t.start))
  41498. return r.copy(t.start)
  41499. }
  41500. }(),
  41501. intersectsLine: function(e) {
  41502. var t = this.distanceToPoint(e.start)
  41503. , i = this.distanceToPoint(e.end);
  41504. return t < 0 && i > 0 || i < 0 && t > 0
  41505. },
  41506. intersectsBox: function(e) {
  41507. return e.intersectsPlane(this)
  41508. },
  41509. intersectsSphere: function(e) {
  41510. return e.intersectsPlane(this)
  41511. },
  41512. coplanarPoint: function(e) {
  41513. var t = e || new n.Vector3;
  41514. return t.copy(this.normal).multiplyScalar(-this.constant)
  41515. },
  41516. applyMatrix4: function() {
  41517. var e = new n.Vector3
  41518. , t = new n.Vector3
  41519. , i = new n.Matrix3;
  41520. return function(n, r) {
  41521. var o = r || i.getNormalMatrix(n)
  41522. , a = e.copy(this.normal).applyMatrix3(o)
  41523. , s = this.coplanarPoint(t);
  41524. return s.applyMatrix4(n),
  41525. this.setFromNormalAndCoplanarPoint(a, s),
  41526. this
  41527. }
  41528. }(),
  41529. translate: function(e) {
  41530. return this.constant = this.constant - e.dot(this.normal),
  41531. this
  41532. },
  41533. equals: function(e) {
  41534. return e.normal.equals(this.normal) && e.constant === this.constant
  41535. }
  41536. },
  41537. n.Spherical = function(e, t, i) {
  41538. return this.radius = void 0 !== e ? e : 1,
  41539. this.phi = void 0 !== t ? t : 0,
  41540. this.theta = void 0 !== i ? i : 0,
  41541. this
  41542. }
  41543. ,
  41544. n.Spherical.prototype = {
  41545. constructor: n.Spherical,
  41546. set: function(e, t, i) {
  41547. this.radius = e,
  41548. this.phi = t,
  41549. this.theta = i
  41550. },
  41551. clone: function() {
  41552. return (new this.constructor).copy(this)
  41553. },
  41554. copy: function(e) {
  41555. return this.radius.copy(e.radius),
  41556. this.phi.copy(e.phi),
  41557. this.theta.copy(e.theta),
  41558. this
  41559. },
  41560. makeSafe: function() {
  41561. var e = 1e-6;
  41562. this.phi = Math.max(e, Math.min(Math.PI - e, this.phi))
  41563. },
  41564. setFromVector3: function(e) {
  41565. return this.radius = e.length(),
  41566. 0 === this.radius ? (this.theta = 0,
  41567. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  41568. this.phi = Math.acos(n.Math.clamp(e.y / this.radius, -1, 1))),
  41569. this
  41570. }
  41571. },
  41572. n.Math = {
  41573. generateUUID: function() {
  41574. var e, t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), i = new Array(36), n = 0;
  41575. return function() {
  41576. for (var r = 0; r < 36; r++)
  41577. 8 === r || 13 === r || 18 === r || 23 === r ? i[r] = "-" : 14 === r ? i[r] = "4" : (n <= 2 && (n = 33554432 + 16777216 * Math.random() | 0),
  41578. e = 15 & n,
  41579. n >>= 4,
  41580. i[r] = t[19 === r ? 3 & e | 8 : e]);
  41581. return i.join("")
  41582. }
  41583. }(),
  41584. clamp: function(e, t, i) {
  41585. return Math.max(t, Math.min(i, e))
  41586. },
  41587. euclideanModulo: function(e, t) {
  41588. return (e % t + t) % t
  41589. },
  41590. mapLinear: function(e, t, i, n, r) {
  41591. return n + (e - t) * (r - n) / (i - t)
  41592. },
  41593. smoothstep: function(e, t, i) {
  41594. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  41595. e * e * (3 - 2 * e))
  41596. },
  41597. smootherstep: function(e, t, i) {
  41598. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  41599. e * e * e * (e * (6 * e - 15) + 10))
  41600. },
  41601. random16: function() {
  41602. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  41603. Math.random()
  41604. },
  41605. randInt: function(e, t) {
  41606. return e + Math.floor(Math.random() * (t - e + 1))
  41607. },
  41608. randFloat: function(e, t) {
  41609. return e + Math.random() * (t - e)
  41610. },
  41611. randFloatSpread: function(e) {
  41612. return e * (.5 - Math.random())
  41613. },
  41614. degToRad: function() {
  41615. var e = Math.PI / 180;
  41616. return function(t) {
  41617. return t * e
  41618. }
  41619. }(),
  41620. radToDeg: function() {
  41621. var e = 180 / Math.PI;
  41622. return function(t) {
  41623. return t * e
  41624. }
  41625. }(),
  41626. isPowerOfTwo: function(e) {
  41627. return 0 === (e & e - 1) && 0 !== e
  41628. },
  41629. nearestPowerOfTwo: function(e) {
  41630. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  41631. },
  41632. nextPowerOfTwo: function(e) {
  41633. return e--,
  41634. e |= e >> 1,
  41635. e |= e >> 2,
  41636. e |= e >> 4,
  41637. e |= e >> 8,
  41638. e |= e >> 16,
  41639. e++,
  41640. e
  41641. }
  41642. },
  41643. n.Spline = function(e) {
  41644. function t(e, t, i, n, r, o, a) {
  41645. var s = .5 * (i - e)
  41646. , l = .5 * (n - t);
  41647. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  41648. }
  41649. this.points = e;
  41650. var i, r, o, a, s, l, c, h, u, d = [], p = {
  41651. x: 0,
  41652. y: 0,
  41653. z: 0
  41654. };
  41655. this.initFromArray = function(e) {
  41656. this.points = [];
  41657. for (var t = 0; t < e.length; t++)
  41658. this.points[t] = {
  41659. x: e[t][0],
  41660. y: e[t][1],
  41661. z: e[t][2]
  41662. }
  41663. }
  41664. ,
  41665. this.getPoint = function(e) {
  41666. return i = (this.points.length - 1) * e,
  41667. r = Math.floor(i),
  41668. o = i - r,
  41669. d[0] = 0 === r ? r : r - 1,
  41670. d[1] = r,
  41671. d[2] = r > this.points.length - 2 ? this.points.length - 1 : r + 1,
  41672. d[3] = r > this.points.length - 3 ? this.points.length - 1 : r + 2,
  41673. l = this.points[d[0]],
  41674. c = this.points[d[1]],
  41675. h = this.points[d[2]],
  41676. u = this.points[d[3]],
  41677. a = o * o,
  41678. s = o * a,
  41679. p.x = t(l.x, c.x, h.x, u.x, o, a, s),
  41680. p.y = t(l.y, c.y, h.y, u.y, o, a, s),
  41681. p.z = t(l.z, c.z, h.z, u.z, o, a, s),
  41682. p
  41683. }
  41684. ,
  41685. this.getControlPointsArray = function() {
  41686. var e, t, i = this.points.length, n = [];
  41687. for (e = 0; e < i; e++)
  41688. t = this.points[e],
  41689. n[e] = [t.x, t.y, t.z];
  41690. return n
  41691. }
  41692. ,
  41693. this.getLength = function(e) {
  41694. var t, i, r, o, a = 0, s = 0, l = 0, c = new n.Vector3, h = new n.Vector3, u = [], d = 0;
  41695. for (u[0] = 0,
  41696. e || (e = 100),
  41697. r = this.points.length * e,
  41698. c.copy(this.points[0]),
  41699. t = 1; t < r; t++)
  41700. i = t / r,
  41701. o = this.getPoint(i),
  41702. h.copy(o),
  41703. d += h.distanceTo(c),
  41704. c.copy(o),
  41705. a = (this.points.length - 1) * i,
  41706. s = Math.floor(a),
  41707. s !== l && (u[s] = d,
  41708. l = s);
  41709. return u[u.length] = d,
  41710. {
  41711. chunks: u,
  41712. total: d
  41713. }
  41714. }
  41715. ,
  41716. this.reparametrizeByArcLength = function(e) {
  41717. var t, i, r, o, a, s, l, c, h = [], u = new n.Vector3, d = this.getLength();
  41718. for (h.push(u.copy(this.points[0]).clone()),
  41719. t = 1; t < this.points.length; t++) {
  41720. for (s = d.chunks[t] - d.chunks[t - 1],
  41721. l = Math.ceil(e * s / d.total),
  41722. o = (t - 1) / (this.points.length - 1),
  41723. a = t / (this.points.length - 1),
  41724. i = 1; i < l - 1; i++)
  41725. r = o + i * (1 / l) * (a - o),
  41726. c = this.getPoint(r),
  41727. h.push(u.copy(c).clone());
  41728. h.push(u.copy(this.points[t]).clone())
  41729. }
  41730. this.points = h
  41731. }
  41732. }
  41733. ,
  41734. n.Triangle = function(e, t, i) {
  41735. this.a = void 0 !== e ? e : new n.Vector3,
  41736. this.b = void 0 !== t ? t : new n.Vector3,
  41737. this.c = void 0 !== i ? i : new n.Vector3
  41738. }
  41739. ,
  41740. n.Triangle.normal = function() {
  41741. var e = new n.Vector3;
  41742. return function(t, i, r, o) {
  41743. var a = o || new n.Vector3;
  41744. a.subVectors(r, i),
  41745. e.subVectors(t, i),
  41746. a.cross(e);
  41747. var s = a.lengthSq();
  41748. return s > 0 ? a.multiplyScalar(1 / Math.sqrt(s)) : a.set(0, 0, 0)
  41749. }
  41750. }(),
  41751. n.Triangle.barycoordFromPoint = function() {
  41752. var e = new n.Vector3
  41753. , t = new n.Vector3
  41754. , i = new n.Vector3;
  41755. return function(r, o, a, s, l) {
  41756. e.subVectors(s, o),
  41757. t.subVectors(a, o),
  41758. i.subVectors(r, o);
  41759. var c = e.dot(e)
  41760. , h = e.dot(t)
  41761. , u = e.dot(i)
  41762. , d = t.dot(t)
  41763. , p = t.dot(i)
  41764. , f = c * d - h * h
  41765. , g = l || new n.Vector3;
  41766. if (0 === f)
  41767. return g.set(-2, -1, -1);
  41768. var m = 1 / f
  41769. , v = (d * u - h * p) * m
  41770. , A = (c * p - h * u) * m;
  41771. return g.set(1 - v - A, A, v)
  41772. }
  41773. }(),
  41774. n.Triangle.containsPoint = function() {
  41775. var e = new n.Vector3;
  41776. return function(t, i, r, o) {
  41777. var a = n.Triangle.barycoordFromPoint(t, i, r, o, e);
  41778. return a.x >= 0 && a.y >= 0 && a.x + a.y <= 1
  41779. }
  41780. }(),
  41781. n.Triangle.prototype = {
  41782. constructor: n.Triangle,
  41783. set: function(e, t, i) {
  41784. return this.a.copy(e),
  41785. this.b.copy(t),
  41786. this.c.copy(i),
  41787. this
  41788. },
  41789. setFromPointsAndIndices: function(e, t, i, n) {
  41790. return this.a.copy(e[t]),
  41791. this.b.copy(e[i]),
  41792. this.c.copy(e[n]),
  41793. this
  41794. },
  41795. clone: function() {
  41796. return (new this.constructor).copy(this)
  41797. },
  41798. copy: function(e) {
  41799. return this.a.copy(e.a),
  41800. this.b.copy(e.b),
  41801. this.c.copy(e.c),
  41802. this
  41803. },
  41804. area: function() {
  41805. var e = new n.Vector3
  41806. , t = new n.Vector3;
  41807. return function() {
  41808. return e.subVectors(this.c, this.b),
  41809. t.subVectors(this.a, this.b),
  41810. .5 * e.cross(t).length()
  41811. }
  41812. }(),
  41813. midpoint: function(e) {
  41814. var t = e || new n.Vector3;
  41815. return t.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  41816. },
  41817. normal: function(e) {
  41818. return n.Triangle.normal(this.a, this.b, this.c, e)
  41819. },
  41820. plane: function(e) {
  41821. var t = e || new n.Plane;
  41822. return t.setFromCoplanarPoints(this.a, this.b, this.c)
  41823. },
  41824. barycoordFromPoint: function(e, t) {
  41825. return n.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  41826. },
  41827. containsPoint: function(e) {
  41828. return n.Triangle.containsPoint(e, this.a, this.b, this.c)
  41829. },
  41830. equals: function(e) {
  41831. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  41832. }
  41833. },
  41834. n.Interpolant = function(e, t, i, n) {
  41835. this.parameterPositions = e,
  41836. this._cachedIndex = 0,
  41837. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  41838. this.sampleValues = t,
  41839. this.valueSize = i
  41840. }
  41841. ,
  41842. n.Interpolant.prototype = {
  41843. constructor: n.Interpolant,
  41844. evaluate: function(e) {
  41845. var t = this.parameterPositions
  41846. , i = this._cachedIndex
  41847. , n = t[i]
  41848. , r = t[i - 1];
  41849. e: {
  41850. t: {
  41851. var o;
  41852. i: {
  41853. n: if (!(e < n)) {
  41854. for (var a = i + 2; ; ) {
  41855. if (void 0 === n) {
  41856. if (e < r)
  41857. break n;
  41858. return i = t.length,
  41859. this._cachedIndex = i,
  41860. this.afterEnd_(i - 1, e, r)
  41861. }
  41862. if (i === a)
  41863. break;
  41864. if (r = n,
  41865. n = t[++i],
  41866. e < n)
  41867. break t
  41868. }
  41869. o = t.length;
  41870. break i
  41871. }
  41872. {
  41873. if (e >= r)
  41874. break e;
  41875. var s = t[1];
  41876. e < s && (i = 2,
  41877. r = s);
  41878. for (var a = i - 2; ; ) {
  41879. if (void 0 === r)
  41880. return this._cachedIndex = 0,
  41881. this.beforeStart_(0, e, n);
  41882. if (i === a)
  41883. break;
  41884. if (n = r,
  41885. r = t[--i - 1],
  41886. e >= r)
  41887. break t
  41888. }
  41889. o = i,
  41890. i = 0
  41891. }
  41892. }
  41893. for (; i < o; ) {
  41894. var l = i + o >>> 1;
  41895. e < t[l] ? o = l : i = l + 1
  41896. }
  41897. if (n = t[i],
  41898. r = t[i - 1],
  41899. void 0 === r)
  41900. return this._cachedIndex = 0,
  41901. this.beforeStart_(0, e, n);
  41902. if (void 0 === n)
  41903. return i = t.length,
  41904. this._cachedIndex = i,
  41905. this.afterEnd_(i - 1, r, e)
  41906. }
  41907. this._cachedIndex = i,
  41908. this.intervalChanged_(i, r, n)
  41909. }
  41910. return this.interpolate_(i, r, e, n)
  41911. },
  41912. settings: null,
  41913. DefaultSettings_: {},
  41914. getSettings_: function() {
  41915. return this.settings || this.DefaultSettings_
  41916. },
  41917. copySampleValue_: function(e) {
  41918. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  41919. t[o] = i[r + o];
  41920. return t
  41921. },
  41922. interpolate_: function(e, t, i, n) {
  41923. throw new Error("call to abstract method")
  41924. },
  41925. intervalChanged_: function(e, t, i) {}
  41926. },
  41927. Object.assign(n.Interpolant.prototype, {
  41928. beforeStart_: n.Interpolant.prototype.copySampleValue_,
  41929. afterEnd_: n.Interpolant.prototype.copySampleValue_
  41930. }),
  41931. n.CubicInterpolant = function(e, t, i, r) {
  41932. n.Interpolant.call(this, e, t, i, r),
  41933. this._weightPrev = -0,
  41934. this._offsetPrev = -0,
  41935. this._weightNext = -0,
  41936. this._offsetNext = -0
  41937. }
  41938. ,
  41939. n.CubicInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  41940. constructor: n.CubicInterpolant,
  41941. DefaultSettings_: {
  41942. endingStart: n.ZeroCurvatureEnding,
  41943. endingEnd: n.ZeroCurvatureEnding
  41944. },
  41945. intervalChanged_: function(e, t, i) {
  41946. var r = this.parameterPositions
  41947. , o = e - 2
  41948. , a = e + 1
  41949. , s = r[o]
  41950. , l = r[a];
  41951. if (void 0 === s)
  41952. switch (this.getSettings_().endingStart) {
  41953. case n.ZeroSlopeEnding:
  41954. o = e,
  41955. s = 2 * t - i;
  41956. break;
  41957. case n.WrapAroundEnding:
  41958. o = r.length - 2,
  41959. s = t + r[o] - r[o + 1];
  41960. break;
  41961. default:
  41962. o = e,
  41963. s = i
  41964. }
  41965. if (void 0 === l)
  41966. switch (this.getSettings_().endingEnd) {
  41967. case n.ZeroSlopeEnding:
  41968. a = e,
  41969. l = 2 * i - t;
  41970. break;
  41971. case n.WrapAroundEnding:
  41972. a = 1,
  41973. l = i + r[1] - r[0];
  41974. break;
  41975. default:
  41976. a = e - 1,
  41977. l = t
  41978. }
  41979. var c = .5 * (i - t)
  41980. , h = this.valueSize;
  41981. this._weightPrev = c / (t - s),
  41982. this._weightNext = c / (l - i),
  41983. this._offsetPrev = o * h,
  41984. this._offsetNext = a * h
  41985. },
  41986. interpolate_: function(e, t, i, n) {
  41987. for (var r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = e * a, l = s - a, c = this._offsetPrev, h = this._offsetNext, u = this._weightPrev, d = this._weightNext, p = (i - t) / (n - t), f = p * p, g = f * p, m = -u * g + 2 * u * f - u * p, v = (1 + u) * g + (-1.5 - 2 * u) * f + (-.5 + u) * p + 1, A = (-1 - d) * g + (1.5 + d) * f + .5 * p, y = d * g - d * f, C = 0; C !== a; ++C)
  41988. r[C] = m * o[c + C] + v * o[l + C] + A * o[s + C] + y * o[h + C];
  41989. return r
  41990. }
  41991. }),
  41992. n.DiscreteInterpolant = function(e, t, i, r) {
  41993. n.Interpolant.call(this, e, t, i, r)
  41994. }
  41995. ,
  41996. n.DiscreteInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  41997. constructor: n.DiscreteInterpolant,
  41998. interpolate_: function(e, t, i, n) {
  41999. return this.copySampleValue_(e - 1)
  42000. }
  42001. }),
  42002. n.LinearInterpolant = function(e, t, i, r) {
  42003. n.Interpolant.call(this, e, t, i, r)
  42004. }
  42005. ,
  42006. n.LinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  42007. constructor: n.LinearInterpolant,
  42008. interpolate_: function(e, t, i, n) {
  42009. for (var r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = e * a, l = s - a, c = (i - t) / (n - t), h = 1 - c, u = 0; u !== a; ++u)
  42010. r[u] = o[l + u] * h + o[s + u] * c;
  42011. return r
  42012. }
  42013. }),
  42014. n.QuaternionLinearInterpolant = function(e, t, i, r) {
  42015. n.Interpolant.call(this, e, t, i, r)
  42016. }
  42017. ,
  42018. n.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  42019. constructor: n.QuaternionLinearInterpolant,
  42020. interpolate_: function(e, t, i, r) {
  42021. for (var o = this.resultBuffer, a = this.sampleValues, s = this.valueSize, l = e * s, c = (i - t) / (r - t), h = l + s; l !== h; l += 4)
  42022. n.Quaternion.slerpFlat(o, 0, a, l - s, a, l, c);
  42023. return o
  42024. }
  42025. }),
  42026. n.Clock = function(e) {
  42027. this.autoStart = void 0 === e || e,
  42028. this.startTime = 0,
  42029. this.oldTime = 0,
  42030. this.elapsedTime = 0,
  42031. this.running = !1
  42032. }
  42033. ,
  42034. n.Clock.prototype = {
  42035. constructor: n.Clock,
  42036. start: function() {
  42037. this.startTime = performance.now(),
  42038. this.oldTime = this.startTime,
  42039. this.running = !0
  42040. },
  42041. stop: function() {
  42042. this.getElapsedTime(),
  42043. this.running = !1
  42044. },
  42045. getElapsedTime: function() {
  42046. return this.getDelta(),
  42047. this.elapsedTime
  42048. },
  42049. getDelta: function() {
  42050. var e = 0;
  42051. if (this.autoStart && !this.running && this.start(),
  42052. this.running) {
  42053. var t = performance.now();
  42054. e = .001 * (t - this.oldTime),
  42055. this.oldTime = t,
  42056. this.elapsedTime += e
  42057. }
  42058. return e
  42059. }
  42060. },
  42061. n.EventDispatcher = function() {}
  42062. ,
  42063. n.EventDispatcher.prototype = {
  42064. constructor: n.EventDispatcher,
  42065. apply: function(e) {
  42066. e.addEventListener = n.EventDispatcher.prototype.addEventListener,
  42067. e.hasEventListener = n.EventDispatcher.prototype.hasEventListener,
  42068. e.removeEventListener = n.EventDispatcher.prototype.removeEventListener,
  42069. e.dispatchEvent = n.EventDispatcher.prototype.dispatchEvent
  42070. },
  42071. addEventListener: function(e, t) {
  42072. void 0 === this._listeners && (this._listeners = {});
  42073. var i = this._listeners;
  42074. void 0 === i[e] && (i[e] = []),
  42075. i[e].indexOf(t) === -1 && i[e].push(t)
  42076. },
  42077. hasEventListener: function(e, t) {
  42078. if (void 0 === this._listeners)
  42079. return !1;
  42080. var i = this._listeners;
  42081. return void 0 !== i[e] && i[e].indexOf(t) !== -1
  42082. },
  42083. removeEventListener: function(e, t) {
  42084. if (void 0 !== this._listeners) {
  42085. var i = this._listeners
  42086. , n = i[e];
  42087. if (void 0 !== n) {
  42088. var r = n.indexOf(t);
  42089. r !== -1 && n.splice(r, 1)
  42090. }
  42091. }
  42092. },
  42093. dispatchEvent: function(e) {
  42094. if (void 0 !== this._listeners) {
  42095. var t = this._listeners
  42096. , i = t[e.type];
  42097. if (void 0 !== i) {
  42098. e.target = this;
  42099. for (var n = [], r = i.length, o = 0; o < r; o++)
  42100. n[o] = i[o];
  42101. for (var o = 0; o < r; o++)
  42102. n[o].call(this, e)
  42103. }
  42104. }
  42105. }
  42106. },
  42107. n.Layers = function() {
  42108. this.mask = 1
  42109. }
  42110. ,
  42111. n.Layers.prototype = {
  42112. constructor: n.Layers,
  42113. set: function(e) {
  42114. this.mask = 1 << e
  42115. },
  42116. enable: function(e) {
  42117. this.mask |= 1 << e
  42118. },
  42119. toggle: function(e) {
  42120. this.mask ^= 1 << e
  42121. },
  42122. disable: function(e) {
  42123. this.mask &= ~(1 << e)
  42124. },
  42125. test: function(e) {
  42126. return 0 !== (this.mask & e.mask)
  42127. }
  42128. },
  42129. function(e) {
  42130. function t(e, t) {
  42131. return e.distance - t.distance
  42132. }
  42133. function i(e, t, n, r) {
  42134. if (e.visible !== !1 && (e.raycast(t, n),
  42135. r === !0))
  42136. for (var o = e.children, a = 0, s = o.length; a < s; a++)
  42137. i(o[a], t, n, !0)
  42138. }
  42139. e.Raycaster = function(t, i, n, r) {
  42140. this.ray = new e.Ray(t,i),
  42141. this.near = n || 0,
  42142. this.far = r || 1 / 0,
  42143. this.params = {
  42144. Mesh: {},
  42145. Line: {},
  42146. LOD: {},
  42147. Points: {
  42148. threshold: 1
  42149. },
  42150. Sprite: {}
  42151. },
  42152. Object.defineProperties(this.params, {
  42153. PointCloud: {
  42154. get: function() {
  42155. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  42156. this.Points
  42157. }
  42158. }
  42159. })
  42160. }
  42161. ,
  42162. e.Raycaster.prototype = {
  42163. constructor: e.Raycaster,
  42164. linePrecision: 1,
  42165. set: function(e, t) {
  42166. this.ray.set(e, t)
  42167. },
  42168. setFromCamera: function(t, i) {
  42169. i instanceof e.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(i.matrixWorld),
  42170. this.ray.direction.set(t.x, t.y, .5).unproject(i).sub(this.ray.origin).normalize()) : i instanceof e.OrthographicCamera ? (this.ray.origin.set(t.x, t.y, -1).unproject(i),
  42171. this.ray.direction.set(0, 0, -1).transformDirection(i.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  42172. },
  42173. intersectObject: function(e, n) {
  42174. var r = [];
  42175. return i(e, this, r, n),
  42176. r.sort(t),
  42177. r
  42178. },
  42179. intersectObjects: function(e, n) {
  42180. var r = [];
  42181. if (Array.isArray(e) === !1)
  42182. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  42183. r;
  42184. for (var o = 0, a = e.length; o < a; o++)
  42185. i(e[o], this, r, n);
  42186. return r.sort(t),
  42187. r
  42188. }
  42189. }
  42190. }(n),
  42191. n.Object3D = function() {
  42192. function e() {
  42193. o.setFromEuler(r, !1)
  42194. }
  42195. function t() {
  42196. r.setFromQuaternion(o, void 0, !1)
  42197. }
  42198. Object.defineProperty(this, "id", {
  42199. value: n.Object3DIdCount++
  42200. }),
  42201. this.uuid = n.Math.generateUUID(),
  42202. this.name = "",
  42203. this.type = "Object3D",
  42204. this.parent = null,
  42205. this.children = [],
  42206. this.up = n.Object3D.DefaultUp.clone();
  42207. var i = new n.Vector3
  42208. , r = new n.Euler
  42209. , o = new n.Quaternion
  42210. , a = new n.Vector3(1,1,1);
  42211. r.onChange(e),
  42212. o.onChange(t),
  42213. Object.defineProperties(this, {
  42214. position: {
  42215. enumerable: !0,
  42216. value: i
  42217. },
  42218. rotation: {
  42219. enumerable: !0,
  42220. value: r
  42221. },
  42222. quaternion: {
  42223. enumerable: !0,
  42224. value: o
  42225. },
  42226. scale: {
  42227. enumerable: !0,
  42228. value: a
  42229. },
  42230. modelViewMatrix: {
  42231. value: new n.Matrix4
  42232. },
  42233. normalMatrix: {
  42234. value: new n.Matrix3
  42235. }
  42236. }),
  42237. this.rotationAutoUpdate = !0,
  42238. this.matrix = new n.Matrix4,
  42239. this.matrixWorld = new n.Matrix4,
  42240. this.matrixAutoUpdate = n.Object3D.DefaultMatrixAutoUpdate,
  42241. this.matrixWorldNeedsUpdate = !1,
  42242. this.layers = new n.Layers,
  42243. this.visible = !0,
  42244. this.castShadow = !1,
  42245. this.receiveShadow = !1,
  42246. this.frustumCulled = !0,
  42247. this.renderOrder = 0,
  42248. this.userData = {}
  42249. }
  42250. ,
  42251. n.Object3D.DefaultUp = new n.Vector3(0,1,0),
  42252. n.Object3D.DefaultMatrixAutoUpdate = !0,
  42253. n.Object3D.prototype = {
  42254. constructor: n.Object3D,
  42255. applyMatrix: function(e) {
  42256. this.matrix.multiplyMatrices(e, this.matrix),
  42257. this.matrix.decompose(this.position, this.quaternion, this.scale)
  42258. },
  42259. setRotationFromAxisAngle: function(e, t) {
  42260. this.quaternion.setFromAxisAngle(e, t)
  42261. },
  42262. setRotationFromEuler: function(e) {
  42263. this.quaternion.setFromEuler(e, !0)
  42264. },
  42265. setRotationFromMatrix: function(e) {
  42266. this.quaternion.setFromRotationMatrix(e)
  42267. },
  42268. setRotationFromQuaternion: function(e) {
  42269. this.quaternion.copy(e)
  42270. },
  42271. rotateOnAxis: function() {
  42272. var e = new n.Quaternion;
  42273. return function(t, i) {
  42274. return e.setFromAxisAngle(t, i),
  42275. this.quaternion.multiply(e),
  42276. this
  42277. }
  42278. }(),
  42279. rotateX: function() {
  42280. var e = new n.Vector3(1,0,0);
  42281. return function(t) {
  42282. return this.rotateOnAxis(e, t)
  42283. }
  42284. }(),
  42285. rotateY: function() {
  42286. var e = new n.Vector3(0,1,0);
  42287. return function(t) {
  42288. return this.rotateOnAxis(e, t)
  42289. }
  42290. }(),
  42291. rotateZ: function() {
  42292. var e = new n.Vector3(0,0,1);
  42293. return function(t) {
  42294. return this.rotateOnAxis(e, t)
  42295. }
  42296. }(),
  42297. translateOnAxis: function() {
  42298. var e = new n.Vector3;
  42299. return function(t, i) {
  42300. return e.copy(t).applyQuaternion(this.quaternion),
  42301. this.position.add(e.multiplyScalar(i)),
  42302. this
  42303. }
  42304. }(),
  42305. translateX: function() {
  42306. var e = new n.Vector3(1,0,0);
  42307. return function(t) {
  42308. return this.translateOnAxis(e, t)
  42309. }
  42310. }(),
  42311. translateY: function() {
  42312. var e = new n.Vector3(0,1,0);
  42313. return function(t) {
  42314. return this.translateOnAxis(e, t)
  42315. }
  42316. }(),
  42317. translateZ: function() {
  42318. var e = new n.Vector3(0,0,1);
  42319. return function(t) {
  42320. return this.translateOnAxis(e, t)
  42321. }
  42322. }(),
  42323. localToWorld: function(e) {
  42324. return e.applyMatrix4(this.matrixWorld)
  42325. },
  42326. worldToLocal: function() {
  42327. var e = new n.Matrix4;
  42328. return function(t) {
  42329. return t.applyMatrix4(e.getInverse(this.matrixWorld))
  42330. }
  42331. }(),
  42332. lookAt: function() {
  42333. var e = new n.Matrix4;
  42334. return function(t) {
  42335. e.lookAt(t, this.position, this.up),
  42336. this.quaternion.setFromRotationMatrix(e)
  42337. }
  42338. }(),
  42339. add: function(e) {
  42340. if (arguments.length > 1) {
  42341. for (var t = 0; t < arguments.length; t++)
  42342. this.add(arguments[t]);
  42343. return this
  42344. }
  42345. return e === this ? (console.error("THREE.Object3D.add: object can't be added as a child of itself.", e),
  42346. this) : (e instanceof n.Object3D ? (null !== e.parent && e.parent.remove(e),
  42347. e.parent = this,
  42348. e.dispatchEvent({
  42349. type: "added"
  42350. }),
  42351. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  42352. this)
  42353. },
  42354. remove: function(e) {
  42355. if (arguments.length > 1)
  42356. for (var t = 0; t < arguments.length; t++)
  42357. this.remove(arguments[t]);
  42358. var i = this.children.indexOf(e);
  42359. i !== -1 && (e.parent = null,
  42360. e.dispatchEvent({
  42361. type: "removed"
  42362. }),
  42363. this.children.splice(i, 1))
  42364. },
  42365. getObjectById: function(e) {
  42366. return this.getObjectByProperty("id", e)
  42367. },
  42368. getObjectByName: function(e) {
  42369. return this.getObjectByProperty("name", e)
  42370. },
  42371. getObjectByProperty: function(e, t) {
  42372. if (this[e] === t)
  42373. return this;
  42374. for (var i = 0, n = this.children.length; i < n; i++) {
  42375. var r = this.children[i]
  42376. , o = r.getObjectByProperty(e, t);
  42377. if (void 0 !== o)
  42378. return o
  42379. }
  42380. },
  42381. getWorldPosition: function(e) {
  42382. var t = e || new n.Vector3;
  42383. return this.updateMatrixWorld(!0),
  42384. t.setFromMatrixPosition(this.matrixWorld)
  42385. },
  42386. getWorldQuaternion: function() {
  42387. var e = new n.Vector3
  42388. , t = new n.Vector3;
  42389. return function(i) {
  42390. var r = i || new n.Quaternion;
  42391. return this.updateMatrixWorld(!0),
  42392. this.matrixWorld.decompose(e, r, t),
  42393. r
  42394. }
  42395. }(),
  42396. getWorldRotation: function() {
  42397. var e = new n.Quaternion;
  42398. return function(t) {
  42399. var i = t || new n.Euler;
  42400. return this.getWorldQuaternion(e),
  42401. i.setFromQuaternion(e, this.rotation.order, !1)
  42402. }
  42403. }(),
  42404. getWorldScale: function() {
  42405. var e = new n.Vector3
  42406. , t = new n.Quaternion;
  42407. return function(i) {
  42408. var r = i || new n.Vector3;
  42409. return this.updateMatrixWorld(!0),
  42410. this.matrixWorld.decompose(e, t, r),
  42411. r
  42412. }
  42413. }(),
  42414. getWorldDirection: function() {
  42415. var e = new n.Quaternion;
  42416. return function(t) {
  42417. var i = t || new n.Vector3;
  42418. return this.getWorldQuaternion(e),
  42419. i.set(0, 0, 1).applyQuaternion(e)
  42420. }
  42421. }(),
  42422. raycast: function() {},
  42423. traverse: function(e) {
  42424. e(this);
  42425. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  42426. t[i].traverse(e)
  42427. },
  42428. traverseVisible: function(e) {
  42429. if (this.visible !== !1) {
  42430. e(this);
  42431. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  42432. t[i].traverseVisible(e)
  42433. }
  42434. },
  42435. traverseAncestors: function(e) {
  42436. var t = this.parent;
  42437. null !== t && (e(t),
  42438. t.traverseAncestors(e))
  42439. },
  42440. updateMatrix: function() {
  42441. this.matrix.compose(this.position, this.quaternion, this.scale),
  42442. this.matrixWorldNeedsUpdate = !0
  42443. },
  42444. updateMatrixWorld: function(e) {
  42445. this.matrixAutoUpdate === !0 && this.updateMatrix(),
  42446. this.matrixWorldNeedsUpdate !== !0 && e !== !0 || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  42447. this.matrixWorldNeedsUpdate = !1,
  42448. e = !0);
  42449. for (var t = 0, i = this.children.length; t < i; t++)
  42450. this.children[t].updateMatrixWorld(e)
  42451. },
  42452. toJSON: function(e) {
  42453. function t(e) {
  42454. var t = [];
  42455. for (var i in e) {
  42456. var n = e[i];
  42457. delete n.metadata,
  42458. t.push(n)
  42459. }
  42460. return t
  42461. }
  42462. var i = void 0 === e
  42463. , n = {};
  42464. i && (e = {
  42465. geometries: {},
  42466. materials: {},
  42467. textures: {},
  42468. images: {}
  42469. },
  42470. n.metadata = {
  42471. version: 4.4,
  42472. type: "Object",
  42473. generator: "Object3D.toJSON"
  42474. });
  42475. var r = {};
  42476. if (r.uuid = this.uuid,
  42477. r.type = this.type,
  42478. "" !== this.name && (r.name = this.name),
  42479. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  42480. this.castShadow === !0 && (r.castShadow = !0),
  42481. this.receiveShadow === !0 && (r.receiveShadow = !0),
  42482. this.visible === !1 && (r.visible = !1),
  42483. r.matrix = this.matrix.toArray(),
  42484. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  42485. r.geometry = this.geometry.uuid),
  42486. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  42487. r.material = this.material.uuid),
  42488. this.children.length > 0) {
  42489. r.children = [];
  42490. for (var o = 0; o < this.children.length; o++)
  42491. r.children.push(this.children[o].toJSON(e).object)
  42492. }
  42493. if (i) {
  42494. var a = t(e.geometries)
  42495. , s = t(e.materials)
  42496. , l = t(e.textures)
  42497. , c = t(e.images);
  42498. a.length > 0 && (n.geometries = a),
  42499. s.length > 0 && (n.materials = s),
  42500. l.length > 0 && (n.textures = l),
  42501. c.length > 0 && (n.images = c)
  42502. }
  42503. return n.object = r,
  42504. n
  42505. },
  42506. clone: function(e) {
  42507. return (new this.constructor).copy(this, e)
  42508. },
  42509. copy: function(e, t) {
  42510. if (void 0 === t && (t = !0),
  42511. this.name = e.name,
  42512. this.up.copy(e.up),
  42513. this.position.copy(e.position),
  42514. this.quaternion.copy(e.quaternion),
  42515. this.scale.copy(e.scale),
  42516. this.rotationAutoUpdate = e.rotationAutoUpdate,
  42517. this.matrix.copy(e.matrix),
  42518. this.matrixWorld.copy(e.matrixWorld),
  42519. this.matrixAutoUpdate = e.matrixAutoUpdate,
  42520. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  42521. this.visible = e.visible,
  42522. this.castShadow = e.castShadow,
  42523. this.receiveShadow = e.receiveShadow,
  42524. this.frustumCulled = e.frustumCulled,
  42525. this.renderOrder = e.renderOrder,
  42526. this.userData = JSON.parse(JSON.stringify(e.userData)),
  42527. t === !0)
  42528. for (var i = 0; i < e.children.length; i++) {
  42529. var n = e.children[i];
  42530. this.add(n.clone())
  42531. }
  42532. return this
  42533. }
  42534. },
  42535. n.EventDispatcher.prototype.apply(n.Object3D.prototype),
  42536. n.Object3DIdCount = 0,
  42537. n.Face3 = function(e, t, i, r, o, a) {
  42538. this.a = e,
  42539. this.b = t,
  42540. this.c = i,
  42541. this.normal = r instanceof n.Vector3 ? r : new n.Vector3,
  42542. this.vertexNormals = Array.isArray(r) ? r : [],
  42543. this.color = o instanceof n.Color ? o : new n.Color,
  42544. this.vertexColors = Array.isArray(o) ? o : [],
  42545. this.materialIndex = void 0 !== a ? a : 0
  42546. }
  42547. ,
  42548. n.Face3.prototype = {
  42549. constructor: n.Face3,
  42550. clone: function() {
  42551. return (new this.constructor).copy(this)
  42552. },
  42553. copy: function(e) {
  42554. this.a = e.a,
  42555. this.b = e.b,
  42556. this.c = e.c,
  42557. this.normal.copy(e.normal),
  42558. this.color.copy(e.color),
  42559. this.materialIndex = e.materialIndex;
  42560. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  42561. this.vertexNormals[t] = e.vertexNormals[t].clone();
  42562. for (var t = 0, i = e.vertexColors.length; t < i; t++)
  42563. this.vertexColors[t] = e.vertexColors[t].clone();
  42564. return this
  42565. }
  42566. },
  42567. n.BufferAttribute = function(e, t) {
  42568. this.uuid = n.Math.generateUUID(),
  42569. this.array = e,
  42570. this.itemSize = t,
  42571. this.dynamic = !1,
  42572. this.updateRange = {
  42573. offset: 0,
  42574. count: -1
  42575. },
  42576. this.version = 0
  42577. }
  42578. ,
  42579. n.BufferAttribute.prototype = {
  42580. constructor: n.BufferAttribute,
  42581. get count() {
  42582. return this.array.length / this.itemSize
  42583. },
  42584. set needsUpdate(e) {
  42585. e === !0 && this.version++
  42586. },
  42587. setDynamic: function(e) {
  42588. return this.dynamic = e,
  42589. this
  42590. },
  42591. copy: function(e) {
  42592. return this.array = new e.array.constructor(e.array),
  42593. this.itemSize = e.itemSize,
  42594. this.dynamic = e.dynamic,
  42595. this
  42596. },
  42597. copyAt: function(e, t, i) {
  42598. e *= this.itemSize,
  42599. i *= t.itemSize;
  42600. for (var n = 0, r = this.itemSize; n < r; n++)
  42601. this.array[e + n] = t.array[i + n];
  42602. return this
  42603. },
  42604. copyArray: function(e) {
  42605. return this.array.set(e),
  42606. this
  42607. },
  42608. copyColorsArray: function(e) {
  42609. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  42610. var a = e[r];
  42611. void 0 === a && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", r),
  42612. a = new n.Color),
  42613. t[i++] = a.r,
  42614. t[i++] = a.g,
  42615. t[i++] = a.b
  42616. }
  42617. return this
  42618. },
  42619. copyIndicesArray: function(e) {
  42620. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  42621. var o = e[n];
  42622. t[i++] = o.a,
  42623. t[i++] = o.b,
  42624. t[i++] = o.c
  42625. }
  42626. return this
  42627. },
  42628. copyVector2sArray: function(e) {
  42629. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  42630. var a = e[r];
  42631. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", r),
  42632. a = new n.Vector2),
  42633. t[i++] = a.x,
  42634. t[i++] = a.y
  42635. }
  42636. return this
  42637. },
  42638. copyVector3sArray: function(e) {
  42639. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  42640. var a = e[r];
  42641. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", r),
  42642. a = new n.Vector3),
  42643. t[i++] = a.x,
  42644. t[i++] = a.y,
  42645. t[i++] = a.z
  42646. }
  42647. return this
  42648. },
  42649. copyVector4sArray: function(e) {
  42650. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  42651. var a = e[r];
  42652. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", r),
  42653. a = new n.Vector4),
  42654. t[i++] = a.x,
  42655. t[i++] = a.y,
  42656. t[i++] = a.z,
  42657. t[i++] = a.w
  42658. }
  42659. return this
  42660. },
  42661. set: function(e, t) {
  42662. return void 0 === t && (t = 0),
  42663. this.array.set(e, t),
  42664. this
  42665. },
  42666. getX: function(e) {
  42667. return this.array[e * this.itemSize]
  42668. },
  42669. setX: function(e, t) {
  42670. return this.array[e * this.itemSize] = t,
  42671. this
  42672. },
  42673. getY: function(e) {
  42674. return this.array[e * this.itemSize + 1]
  42675. },
  42676. setY: function(e, t) {
  42677. return this.array[e * this.itemSize + 1] = t,
  42678. this
  42679. },
  42680. getZ: function(e) {
  42681. return this.array[e * this.itemSize + 2]
  42682. },
  42683. setZ: function(e, t) {
  42684. return this.array[e * this.itemSize + 2] = t,
  42685. this
  42686. },
  42687. getW: function(e) {
  42688. return this.array[e * this.itemSize + 3]
  42689. },
  42690. setW: function(e, t) {
  42691. return this.array[e * this.itemSize + 3] = t,
  42692. this
  42693. },
  42694. setXY: function(e, t, i) {
  42695. return e *= this.itemSize,
  42696. this.array[e + 0] = t,
  42697. this.array[e + 1] = i,
  42698. this
  42699. },
  42700. setXYZ: function(e, t, i, n) {
  42701. return e *= this.itemSize,
  42702. this.array[e + 0] = t,
  42703. this.array[e + 1] = i,
  42704. this.array[e + 2] = n,
  42705. this
  42706. },
  42707. setXYZW: function(e, t, i, n, r) {
  42708. return e *= this.itemSize,
  42709. this.array[e + 0] = t,
  42710. this.array[e + 1] = i,
  42711. this.array[e + 2] = n,
  42712. this.array[e + 3] = r,
  42713. this
  42714. },
  42715. clone: function() {
  42716. return (new this.constructor).copy(this)
  42717. }
  42718. },
  42719. n.Int8Attribute = function(e, t) {
  42720. return new n.BufferAttribute(new Int8Array(e),t)
  42721. }
  42722. ,
  42723. n.Uint8Attribute = function(e, t) {
  42724. return new n.BufferAttribute(new Uint8Array(e),t)
  42725. }
  42726. ,
  42727. n.Uint8ClampedAttribute = function(e, t) {
  42728. return new n.BufferAttribute(new Uint8ClampedArray(e),t)
  42729. }
  42730. ,
  42731. n.Int16Attribute = function(e, t) {
  42732. return new n.BufferAttribute(new Int16Array(e),t)
  42733. }
  42734. ,
  42735. n.Uint16Attribute = function(e, t) {
  42736. return new n.BufferAttribute(new Uint16Array(e),t)
  42737. }
  42738. ;
  42739. n.Int32Attribute = function(e, t) {
  42740. return new n.BufferAttribute(new Int32Array(e),t)
  42741. }
  42742. ;
  42743. n.Uint32Attribute = function(e, t) {
  42744. return new n.BufferAttribute(new Uint32Array(e),t)
  42745. }
  42746. ,
  42747. n.Float32Attribute = function(e, t) {
  42748. return new n.BufferAttribute(new Float32Array(e),t)
  42749. }
  42750. ,
  42751. n.Float64Attribute = function(e, t) {
  42752. return new n.BufferAttribute(new Float64Array(e),t)
  42753. }
  42754. ,
  42755. n.DynamicBufferAttribute = function(e, t) {
  42756. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  42757. new n.BufferAttribute(e,t).setDynamic(!0)
  42758. }
  42759. ,
  42760. n.InstancedBufferAttribute = function(e, t, i) {
  42761. n.BufferAttribute.call(this, e, t),
  42762. this.meshPerAttribute = i || 1
  42763. }
  42764. ,
  42765. n.InstancedBufferAttribute.prototype = Object.create(n.BufferAttribute.prototype),
  42766. n.InstancedBufferAttribute.prototype.constructor = n.InstancedBufferAttribute,
  42767. n.InstancedBufferAttribute.prototype.copy = function(e) {
  42768. return n.BufferAttribute.prototype.copy.call(this, e),
  42769. this.meshPerAttribute = e.meshPerAttribute,
  42770. this
  42771. }
  42772. ,
  42773. n.InterleavedBuffer = function(e, t) {
  42774. this.uuid = n.Math.generateUUID(),
  42775. this.array = e,
  42776. this.stride = t,
  42777. this.dynamic = !1,
  42778. this.updateRange = {
  42779. offset: 0,
  42780. count: -1
  42781. },
  42782. this.version = 0
  42783. }
  42784. ,
  42785. n.InterleavedBuffer.prototype = {
  42786. constructor: n.InterleavedBuffer,
  42787. get length() {
  42788. return this.array.length
  42789. },
  42790. get count() {
  42791. return this.array.length / this.stride
  42792. },
  42793. set needsUpdate(e) {
  42794. e === !0 && this.version++
  42795. },
  42796. setDynamic: function(e) {
  42797. return this.dynamic = e,
  42798. this
  42799. },
  42800. copy: function(e) {
  42801. return this.array = new e.array.constructor(e.array),
  42802. this.stride = e.stride,
  42803. this.dynamic = e.dynamic,
  42804. this
  42805. },
  42806. copyAt: function(e, t, i) {
  42807. e *= this.stride,
  42808. i *= t.stride;
  42809. for (var n = 0, r = this.stride; n < r; n++)
  42810. this.array[e + n] = t.array[i + n];
  42811. return this
  42812. },
  42813. set: function(e, t) {
  42814. return void 0 === t && (t = 0),
  42815. this.array.set(e, t),
  42816. this
  42817. },
  42818. clone: function() {
  42819. return (new this.constructor).copy(this)
  42820. }
  42821. },
  42822. n.InstancedInterleavedBuffer = function(e, t, i) {
  42823. n.InterleavedBuffer.call(this, e, t),
  42824. this.meshPerAttribute = i || 1
  42825. }
  42826. ,
  42827. n.InstancedInterleavedBuffer.prototype = Object.create(n.InterleavedBuffer.prototype),
  42828. n.InstancedInterleavedBuffer.prototype.constructor = n.InstancedInterleavedBuffer,
  42829. n.InstancedInterleavedBuffer.prototype.copy = function(e) {
  42830. return n.InterleavedBuffer.prototype.copy.call(this, e),
  42831. this.meshPerAttribute = e.meshPerAttribute,
  42832. this
  42833. }
  42834. ,
  42835. n.InterleavedBufferAttribute = function(e, t, i) {
  42836. this.uuid = n.Math.generateUUID(),
  42837. this.data = e,
  42838. this.itemSize = t,
  42839. this.offset = i
  42840. }
  42841. ,
  42842. n.InterleavedBufferAttribute.prototype = {
  42843. constructor: n.InterleavedBufferAttribute,
  42844. get length() {
  42845. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  42846. this.array.length
  42847. },
  42848. get count() {
  42849. return this.data.count
  42850. },
  42851. setX: function(e, t) {
  42852. return this.data.array[e * this.data.stride + this.offset] = t,
  42853. this
  42854. },
  42855. setY: function(e, t) {
  42856. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  42857. this
  42858. },
  42859. setZ: function(e, t) {
  42860. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  42861. this
  42862. },
  42863. setW: function(e, t) {
  42864. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  42865. this
  42866. },
  42867. getX: function(e) {
  42868. return this.data.array[e * this.data.stride + this.offset]
  42869. },
  42870. getY: function(e) {
  42871. return this.data.array[e * this.data.stride + this.offset + 1]
  42872. },
  42873. getZ: function(e) {
  42874. return this.data.array[e * this.data.stride + this.offset + 2]
  42875. },
  42876. getW: function(e) {
  42877. return this.data.array[e * this.data.stride + this.offset + 3]
  42878. },
  42879. setXY: function(e, t, i) {
  42880. return e = e * this.data.stride + this.offset,
  42881. this.data.array[e + 0] = t,
  42882. this.data.array[e + 1] = i,
  42883. this
  42884. },
  42885. setXYZ: function(e, t, i, n) {
  42886. return e = e * this.data.stride + this.offset,
  42887. this.data.array[e + 0] = t,
  42888. this.data.array[e + 1] = i,
  42889. this.data.array[e + 2] = n,
  42890. this
  42891. },
  42892. setXYZW: function(e, t, i, n, r) {
  42893. return e = e * this.data.stride + this.offset,
  42894. this.data.array[e + 0] = t,
  42895. this.data.array[e + 1] = i,
  42896. this.data.array[e + 2] = n,
  42897. this.data.array[e + 3] = r,
  42898. this
  42899. }
  42900. },
  42901. n.Geometry = function() {
  42902. Object.defineProperty(this, "id", {
  42903. value: n.GeometryIdCount++
  42904. }),
  42905. this.uuid = n.Math.generateUUID(),
  42906. this.name = "",
  42907. this.type = "Geometry",
  42908. this.vertices = [],
  42909. this.colors = [],
  42910. this.faces = [],
  42911. this.faceVertexUvs = [[]],
  42912. this.morphTargets = [],
  42913. this.morphNormals = [],
  42914. this.skinWeights = [],
  42915. this.skinIndices = [],
  42916. this.lineDistances = [],
  42917. this.boundingBox = null,
  42918. this.boundingSphere = null,
  42919. this.verticesNeedUpdate = !1,
  42920. this.elementsNeedUpdate = !1,
  42921. this.uvsNeedUpdate = !1,
  42922. this.normalsNeedUpdate = !1,
  42923. this.colorsNeedUpdate = !1,
  42924. this.lineDistancesNeedUpdate = !1,
  42925. this.groupsNeedUpdate = !1
  42926. }
  42927. ,
  42928. n.Geometry.prototype = {
  42929. constructor: n.Geometry,
  42930. applyMatrix: function(e) {
  42931. for (var t = (new n.Matrix3).getNormalMatrix(e), i = 0, r = this.vertices.length; i < r; i++) {
  42932. var o = this.vertices[i];
  42933. o.applyMatrix4(e)
  42934. }
  42935. for (var i = 0, r = this.faces.length; i < r; i++) {
  42936. var a = this.faces[i];
  42937. a.normal.applyMatrix3(t).normalize();
  42938. for (var s = 0, l = a.vertexNormals.length; s < l; s++)
  42939. a.vertexNormals[s].applyMatrix3(t).normalize()
  42940. }
  42941. return null !== this.boundingBox && this.computeBoundingBox(),
  42942. null !== this.boundingSphere && this.computeBoundingSphere(),
  42943. this.verticesNeedUpdate = !0,
  42944. this.normalsNeedUpdate = !0,
  42945. this
  42946. },
  42947. rotateX: function() {
  42948. var e;
  42949. return function(t) {
  42950. return void 0 === e && (e = new n.Matrix4),
  42951. e.makeRotationX(t),
  42952. this.applyMatrix(e),
  42953. this
  42954. }
  42955. }(),
  42956. rotateY: function() {
  42957. var e;
  42958. return function(t) {
  42959. return void 0 === e && (e = new n.Matrix4),
  42960. e.makeRotationY(t),
  42961. this.applyMatrix(e),
  42962. this
  42963. }
  42964. }(),
  42965. rotateZ: function() {
  42966. var e;
  42967. return function(t) {
  42968. return void 0 === e && (e = new n.Matrix4),
  42969. e.makeRotationZ(t),
  42970. this.applyMatrix(e),
  42971. this
  42972. }
  42973. }(),
  42974. translate: function() {
  42975. var e;
  42976. return function(t, i, r) {
  42977. return void 0 === e && (e = new n.Matrix4),
  42978. e.makeTranslation(t, i, r),
  42979. this.applyMatrix(e),
  42980. this
  42981. }
  42982. }(),
  42983. scale: function() {
  42984. var e;
  42985. return function(t, i, r) {
  42986. return void 0 === e && (e = new n.Matrix4),
  42987. e.makeScale(t, i, r),
  42988. this.applyMatrix(e),
  42989. this
  42990. }
  42991. }(),
  42992. lookAt: function() {
  42993. var e;
  42994. return function(t) {
  42995. void 0 === e && (e = new n.Object3D),
  42996. e.lookAt(t),
  42997. e.updateMatrix(),
  42998. this.applyMatrix(e.matrix)
  42999. }
  43000. }(),
  43001. fromBufferGeometry: function(e) {
  43002. function t(e, t, r, o) {
  43003. var a = void 0 !== s ? [u[e].clone(), u[t].clone(), u[r].clone()] : []
  43004. , f = void 0 !== l ? [i.colors[e].clone(), i.colors[t].clone(), i.colors[r].clone()] : []
  43005. , g = new n.Face3(e,t,r,a,f,o);
  43006. i.faces.push(g),
  43007. void 0 !== c && i.faceVertexUvs[0].push([d[e].clone(), d[t].clone(), d[r].clone()]),
  43008. void 0 !== h && i.faceVertexUvs[1].push([p[e].clone(), p[t].clone(), p[r].clone()])
  43009. }
  43010. var i = this
  43011. , r = null !== e.index ? e.index.array : void 0
  43012. , o = e.attributes
  43013. , a = o.position.array
  43014. , s = void 0 !== o.normal ? o.normal.array : void 0
  43015. , l = void 0 !== o.color ? o.color.array : void 0
  43016. , c = void 0 !== o.uv ? o.uv.array : void 0
  43017. , h = void 0 !== o.uv2 ? o.uv2.array : void 0;
  43018. void 0 !== h && (this.faceVertexUvs[1] = []);
  43019. for (var u = [], d = [], p = [], f = 0, g = 0; f < a.length; f += 3,
  43020. g += 2)
  43021. i.vertices.push(new n.Vector3(a[f],a[f + 1],a[f + 2])),
  43022. void 0 !== s && u.push(new n.Vector3(s[f],s[f + 1],s[f + 2])),
  43023. void 0 !== l && i.colors.push(new n.Color(l[f],l[f + 1],l[f + 2])),
  43024. void 0 !== c && d.push(new n.Vector2(c[g],c[g + 1])),
  43025. void 0 !== h && p.push(new n.Vector2(h[g],h[g + 1]));
  43026. if (void 0 !== r) {
  43027. var m = e.groups;
  43028. if (m.length > 0)
  43029. for (var f = 0; f < m.length; f++)
  43030. for (var v = m[f], A = v.start, y = v.count, g = A, C = A + y; g < C; g += 3)
  43031. t(r[g], r[g + 1], r[g + 2], v.materialIndex);
  43032. else
  43033. for (var f = 0; f < r.length; f += 3)
  43034. t(r[f], r[f + 1], r[f + 2])
  43035. } else
  43036. for (var f = 0; f < a.length / 3; f += 3)
  43037. t(f, f + 1, f + 2);
  43038. return this.computeFaceNormals(),
  43039. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  43040. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  43041. this
  43042. },
  43043. center: function() {
  43044. this.computeBoundingBox();
  43045. var e = this.boundingBox.center().negate();
  43046. return this.translate(e.x, e.y, e.z),
  43047. e
  43048. },
  43049. normalize: function() {
  43050. this.computeBoundingSphere();
  43051. var e = this.boundingSphere.center
  43052. , t = this.boundingSphere.radius
  43053. , i = 0 === t ? 1 : 1 / t
  43054. , r = new n.Matrix4;
  43055. return r.set(i, 0, 0, -i * e.x, 0, i, 0, -i * e.y, 0, 0, i, -i * e.z, 0, 0, 0, 1),
  43056. this.applyMatrix(r),
  43057. this
  43058. },
  43059. computeFaceNormals: function() {
  43060. for (var e = new n.Vector3, t = new n.Vector3, i = 0, r = this.faces.length; i < r; i++) {
  43061. var o = this.faces[i]
  43062. , a = this.vertices[o.a]
  43063. , s = this.vertices[o.b]
  43064. , l = this.vertices[o.c];
  43065. e.subVectors(l, s),
  43066. t.subVectors(a, s),
  43067. e.cross(t),
  43068. e.normalize(),
  43069. o.normal.copy(e)
  43070. }
  43071. },
  43072. computeVertexNormals: function(e) {
  43073. void 0 === e && (e = !0);
  43074. var t, i, r, o, a, s;
  43075. for (s = new Array(this.vertices.length),
  43076. t = 0,
  43077. i = this.vertices.length; t < i; t++)
  43078. s[t] = new n.Vector3;
  43079. if (e) {
  43080. var l, c, h, u = new n.Vector3, d = new n.Vector3;
  43081. for (r = 0,
  43082. o = this.faces.length; r < o; r++)
  43083. a = this.faces[r],
  43084. l = this.vertices[a.a],
  43085. c = this.vertices[a.b],
  43086. h = this.vertices[a.c],
  43087. u.subVectors(h, c),
  43088. d.subVectors(l, c),
  43089. u.cross(d),
  43090. s[a.a].add(u),
  43091. s[a.b].add(u),
  43092. s[a.c].add(u)
  43093. } else
  43094. for (r = 0,
  43095. o = this.faces.length; r < o; r++)
  43096. a = this.faces[r],
  43097. s[a.a].add(a.normal),
  43098. s[a.b].add(a.normal),
  43099. s[a.c].add(a.normal);
  43100. for (t = 0,
  43101. i = this.vertices.length; t < i; t++)
  43102. s[t].normalize();
  43103. for (r = 0,
  43104. o = this.faces.length; r < o; r++) {
  43105. a = this.faces[r];
  43106. var p = a.vertexNormals;
  43107. 3 === p.length ? (p[0].copy(s[a.a]),
  43108. p[1].copy(s[a.b]),
  43109. p[2].copy(s[a.c])) : (p[0] = s[a.a].clone(),
  43110. p[1] = s[a.b].clone(),
  43111. p[2] = s[a.c].clone())
  43112. }
  43113. this.faces.length > 0 && (this.normalsNeedUpdate = !0)
  43114. },
  43115. computeMorphNormals: function() {
  43116. var e, t, i, r, o;
  43117. for (i = 0,
  43118. r = this.faces.length; i < r; i++)
  43119. for (o = this.faces[i],
  43120. o.__originalFaceNormal ? o.__originalFaceNormal.copy(o.normal) : o.__originalFaceNormal = o.normal.clone(),
  43121. o.__originalVertexNormals || (o.__originalVertexNormals = []),
  43122. e = 0,
  43123. t = o.vertexNormals.length; e < t; e++)
  43124. o.__originalVertexNormals[e] ? o.__originalVertexNormals[e].copy(o.vertexNormals[e]) : o.__originalVertexNormals[e] = o.vertexNormals[e].clone();
  43125. var a = new n.Geometry;
  43126. for (a.faces = this.faces,
  43127. e = 0,
  43128. t = this.morphTargets.length; e < t; e++) {
  43129. if (!this.morphNormals[e]) {
  43130. this.morphNormals[e] = {},
  43131. this.morphNormals[e].faceNormals = [],
  43132. this.morphNormals[e].vertexNormals = [];
  43133. var s, l, c = this.morphNormals[e].faceNormals, h = this.morphNormals[e].vertexNormals;
  43134. for (i = 0,
  43135. r = this.faces.length; i < r; i++)
  43136. s = new n.Vector3,
  43137. l = {
  43138. a: new n.Vector3,
  43139. b: new n.Vector3,
  43140. c: new n.Vector3
  43141. },
  43142. c.push(s),
  43143. h.push(l)
  43144. }
  43145. var u = this.morphNormals[e];
  43146. a.vertices = this.morphTargets[e].vertices,
  43147. a.computeFaceNormals(),
  43148. a.computeVertexNormals();
  43149. var s, l;
  43150. for (i = 0,
  43151. r = this.faces.length; i < r; i++)
  43152. o = this.faces[i],
  43153. s = u.faceNormals[i],
  43154. l = u.vertexNormals[i],
  43155. s.copy(o.normal),
  43156. l.a.copy(o.vertexNormals[0]),
  43157. l.b.copy(o.vertexNormals[1]),
  43158. l.c.copy(o.vertexNormals[2])
  43159. }
  43160. for (i = 0,
  43161. r = this.faces.length; i < r; i++)
  43162. o = this.faces[i],
  43163. o.normal = o.__originalFaceNormal,
  43164. o.vertexNormals = o.__originalVertexNormals
  43165. },
  43166. computeTangents: function() {
  43167. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  43168. },
  43169. computeLineDistances: function() {
  43170. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  43171. i > 0 && (e += t[i].distanceTo(t[i - 1])),
  43172. this.lineDistances[i] = e
  43173. },
  43174. computeBoundingBox: function() {
  43175. null === this.boundingBox && (this.boundingBox = new n.Box3),
  43176. this.boundingBox.setFromPoints(this.vertices)
  43177. },
  43178. computeBoundingSphere: function() {
  43179. null === this.boundingSphere && (this.boundingSphere = new n.Sphere),
  43180. this.boundingSphere.setFromPoints(this.vertices)
  43181. },
  43182. merge: function(e, t, i) {
  43183. if (e instanceof n.Geometry == !1)
  43184. return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e);
  43185. var r, o = this.vertices.length, a = this.vertices, s = e.vertices, l = this.faces, c = e.faces, h = this.faceVertexUvs[0], u = e.faceVertexUvs[0];
  43186. void 0 === i && (i = 0),
  43187. void 0 !== t && (r = (new n.Matrix3).getNormalMatrix(t));
  43188. for (var d = 0, p = s.length; d < p; d++) {
  43189. var f = s[d]
  43190. , g = f.clone();
  43191. void 0 !== t && g.applyMatrix4(t),
  43192. a.push(g)
  43193. }
  43194. for (d = 0,
  43195. p = c.length; d < p; d++) {
  43196. var m, v, A, y = c[d], C = y.vertexNormals, I = y.vertexColors;
  43197. m = new n.Face3(y.a + o,y.b + o,y.c + o),
  43198. m.normal.copy(y.normal),
  43199. void 0 !== r && m.normal.applyMatrix3(r).normalize();
  43200. for (var E = 0, b = C.length; E < b; E++)
  43201. v = C[E].clone(),
  43202. void 0 !== r && v.applyMatrix3(r).normalize(),
  43203. m.vertexNormals.push(v);
  43204. m.color.copy(y.color);
  43205. for (var E = 0, b = I.length; E < b; E++)
  43206. A = I[E],
  43207. m.vertexColors.push(A.clone());
  43208. m.materialIndex = y.materialIndex + i,
  43209. l.push(m)
  43210. }
  43211. for (d = 0,
  43212. p = u.length; d < p; d++) {
  43213. var w = u[d]
  43214. , _ = [];
  43215. if (void 0 !== w) {
  43216. for (var E = 0, b = w.length; E < b; E++)
  43217. _.push(w[E].clone());
  43218. h.push(_)
  43219. }
  43220. }
  43221. },
  43222. mergeMesh: function(e) {
  43223. return e instanceof n.Mesh == !1 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  43224. void this.merge(e.geometry, e.matrix))
  43225. },
  43226. mergeVertices: function() {
  43227. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = 4, d = Math.pow(10, u);
  43228. for (i = 0,
  43229. n = this.vertices.length; i < n; i++)
  43230. e = this.vertices[i],
  43231. t = Math.round(e.x * d) + "_" + Math.round(e.y * d) + "_" + Math.round(e.z * d),
  43232. void 0 === l[t] ? (l[t] = i,
  43233. c.push(this.vertices[i]),
  43234. h[i] = c.length - 1) : h[i] = h[l[t]];
  43235. var p = [];
  43236. for (i = 0,
  43237. n = this.faces.length; i < n; i++) {
  43238. r = this.faces[i],
  43239. r.a = h[r.a],
  43240. r.b = h[r.b],
  43241. r.c = h[r.c],
  43242. o = [r.a, r.b, r.c];
  43243. for (var f = -1, g = 0; g < 3; g++)
  43244. if (o[g] === o[(g + 1) % 3]) {
  43245. f = g,
  43246. p.push(i);
  43247. break
  43248. }
  43249. }
  43250. for (i = p.length - 1; i >= 0; i--) {
  43251. var m = p[i];
  43252. for (this.faces.splice(m, 1),
  43253. a = 0,
  43254. s = this.faceVertexUvs.length; a < s; a++)
  43255. this.faceVertexUvs[a].splice(m, 1)
  43256. }
  43257. var v = this.vertices.length - c.length;
  43258. return this.vertices = c,
  43259. v
  43260. },
  43261. sortFacesByMaterialIndex: function() {
  43262. function e(e, t) {
  43263. return e.materialIndex - t.materialIndex
  43264. }
  43265. for (var t = this.faces, i = t.length, n = 0; n < i; n++)
  43266. t[n]._id = n;
  43267. t.sort(e);
  43268. var r, o, a = this.faceVertexUvs[0], s = this.faceVertexUvs[1];
  43269. a && a.length === i && (r = []),
  43270. s && s.length === i && (o = []);
  43271. for (var n = 0; n < i; n++) {
  43272. var l = t[n]._id;
  43273. r && r.push(a[l]),
  43274. o && o.push(s[l])
  43275. }
  43276. r && (this.faceVertexUvs[0] = r),
  43277. o && (this.faceVertexUvs[1] = o)
  43278. },
  43279. toJSON: function() {
  43280. function e(e, t, i) {
  43281. return i ? e | 1 << t : e & ~(1 << t)
  43282. }
  43283. function t(e) {
  43284. var t = e.x.toString() + e.y.toString() + e.z.toString();
  43285. return void 0 !== d[t] ? d[t] : (d[t] = u.length / 3,
  43286. u.push(e.x, e.y, e.z),
  43287. d[t])
  43288. }
  43289. function i(e) {
  43290. var t = e.r.toString() + e.g.toString() + e.b.toString();
  43291. return void 0 !== f[t] ? f[t] : (f[t] = p.length,
  43292. p.push(e.getHex()),
  43293. f[t])
  43294. }
  43295. function n(e) {
  43296. var t = e.x.toString() + e.y.toString();
  43297. return void 0 !== m[t] ? m[t] : (m[t] = g.length / 2,
  43298. g.push(e.x, e.y),
  43299. m[t])
  43300. }
  43301. var r = {
  43302. metadata: {
  43303. version: 4.4,
  43304. type: "Geometry",
  43305. generator: "Geometry.toJSON"
  43306. }
  43307. };
  43308. if (r.uuid = this.uuid,
  43309. r.type = this.type,
  43310. "" !== this.name && (r.name = this.name),
  43311. void 0 !== this.parameters) {
  43312. var o = this.parameters;
  43313. for (var a in o)
  43314. void 0 !== o[a] && (r[a] = o[a]);
  43315. return r
  43316. }
  43317. for (var s = [], l = 0; l < this.vertices.length; l++) {
  43318. var c = this.vertices[l];
  43319. s.push(c.x, c.y, c.z)
  43320. }
  43321. for (var h = [], u = [], d = {}, p = [], f = {}, g = [], m = {}, l = 0; l < this.faces.length; l++) {
  43322. var v = this.faces[l]
  43323. , A = !0
  43324. , y = !1
  43325. , C = void 0 !== this.faceVertexUvs[0][l]
  43326. , I = v.normal.length() > 0
  43327. , E = v.vertexNormals.length > 0
  43328. , b = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  43329. , w = v.vertexColors.length > 0
  43330. , _ = 0;
  43331. if (_ = e(_, 0, 0),
  43332. _ = e(_, 1, A),
  43333. _ = e(_, 2, y),
  43334. _ = e(_, 3, C),
  43335. _ = e(_, 4, I),
  43336. _ = e(_, 5, E),
  43337. _ = e(_, 6, b),
  43338. _ = e(_, 7, w),
  43339. h.push(_),
  43340. h.push(v.a, v.b, v.c),
  43341. h.push(v.materialIndex),
  43342. C) {
  43343. var T = this.faceVertexUvs[0][l];
  43344. h.push(n(T[0]), n(T[1]), n(T[2]))
  43345. }
  43346. if (I && h.push(t(v.normal)),
  43347. E) {
  43348. var x = v.vertexNormals;
  43349. h.push(t(x[0]), t(x[1]), t(x[2]))
  43350. }
  43351. if (b && h.push(i(v.color)),
  43352. w) {
  43353. var S = v.vertexColors;
  43354. h.push(i(S[0]), i(S[1]), i(S[2]))
  43355. }
  43356. }
  43357. return r.data = {},
  43358. r.data.vertices = s,
  43359. r.data.normals = u,
  43360. p.length > 0 && (r.data.colors = p),
  43361. g.length > 0 && (r.data.uvs = [g]),
  43362. r.data.faces = h,
  43363. r
  43364. },
  43365. clone: function() {
  43366. return (new n.Geometry).copy(this)
  43367. },
  43368. copy: function(e) {
  43369. this.vertices = [],
  43370. this.faces = [],
  43371. this.faceVertexUvs = [[]];
  43372. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  43373. this.vertices.push(t[i].clone());
  43374. for (var r = e.faces, i = 0, n = r.length; i < n; i++)
  43375. this.faces.push(r[i].clone());
  43376. for (var i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  43377. var o = e.faceVertexUvs[i];
  43378. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  43379. for (var a = 0, s = o.length; a < s; a++) {
  43380. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  43381. var d = l[h];
  43382. c.push(d.clone())
  43383. }
  43384. this.faceVertexUvs[i].push(c)
  43385. }
  43386. }
  43387. return this
  43388. },
  43389. dispose: function() {
  43390. this.dispatchEvent({
  43391. type: "dispose"
  43392. })
  43393. }
  43394. },
  43395. n.EventDispatcher.prototype.apply(n.Geometry.prototype),
  43396. n.GeometryIdCount = 0,
  43397. n.DirectGeometry = function() {
  43398. Object.defineProperty(this, "id", {
  43399. value: n.GeometryIdCount++
  43400. }),
  43401. this.uuid = n.Math.generateUUID(),
  43402. this.name = "",
  43403. this.type = "DirectGeometry",
  43404. this.indices = [],
  43405. this.vertices = [],
  43406. this.normals = [],
  43407. this.colors = [],
  43408. this.uvs = [],
  43409. this.uvs2 = [],
  43410. this.groups = [],
  43411. this.morphTargets = {},
  43412. this.skinWeights = [],
  43413. this.skinIndices = [],
  43414. this.boundingBox = null,
  43415. this.boundingSphere = null,
  43416. this.verticesNeedUpdate = !1,
  43417. this.normalsNeedUpdate = !1,
  43418. this.colorsNeedUpdate = !1,
  43419. this.uvsNeedUpdate = !1,
  43420. this.groupsNeedUpdate = !1
  43421. }
  43422. ,
  43423. n.DirectGeometry.prototype = {
  43424. constructor: n.DirectGeometry,
  43425. computeBoundingBox: n.Geometry.prototype.computeBoundingBox,
  43426. computeBoundingSphere: n.Geometry.prototype.computeBoundingSphere,
  43427. computeFaceNormals: function() {
  43428. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  43429. },
  43430. computeVertexNormals: function() {
  43431. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  43432. },
  43433. computeGroups: function(e) {
  43434. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  43435. var a = r[o];
  43436. a.materialIndex !== i && (i = a.materialIndex,
  43437. void 0 !== t && (t.count = 3 * o - t.start,
  43438. n.push(t)),
  43439. t = {
  43440. start: 3 * o,
  43441. materialIndex: i
  43442. })
  43443. }
  43444. void 0 !== t && (t.count = 3 * o - t.start,
  43445. n.push(t)),
  43446. this.groups = n
  43447. },
  43448. fromGeometry: function(e) {
  43449. var t, i = e.faces, r = e.vertices, o = e.faceVertexUvs, a = o[0] && o[0].length > 0, s = o[1] && o[1].length > 0, l = e.morphTargets, c = l.length;
  43450. if (c > 0) {
  43451. t = [];
  43452. for (var h = 0; h < c; h++)
  43453. t[h] = [];
  43454. this.morphTargets.position = t
  43455. }
  43456. var u, d = e.morphNormals, p = d.length;
  43457. if (p > 0) {
  43458. u = [];
  43459. for (var h = 0; h < p; h++)
  43460. u[h] = [];
  43461. this.morphTargets.normal = u
  43462. }
  43463. for (var f = e.skinIndices, g = e.skinWeights, m = f.length === r.length, v = g.length === r.length, h = 0; h < i.length; h++) {
  43464. var A = i[h];
  43465. this.vertices.push(r[A.a], r[A.b], r[A.c]);
  43466. var y = A.vertexNormals;
  43467. if (3 === y.length)
  43468. this.normals.push(y[0], y[1], y[2]);
  43469. else {
  43470. var C = A.normal;
  43471. this.normals.push(C, C, C)
  43472. }
  43473. var I = A.vertexColors;
  43474. if (3 === I.length)
  43475. this.colors.push(I[0], I[1], I[2]);
  43476. else {
  43477. var E = A.color;
  43478. this.colors.push(E, E, E)
  43479. }
  43480. if (a === !0) {
  43481. var b = o[0][h];
  43482. void 0 !== b ? this.uvs.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", h),
  43483. this.uvs.push(new n.Vector2, new n.Vector2, new n.Vector2))
  43484. }
  43485. if (s === !0) {
  43486. var b = o[1][h];
  43487. void 0 !== b ? this.uvs2.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", h),
  43488. this.uvs2.push(new n.Vector2, new n.Vector2, new n.Vector2))
  43489. }
  43490. for (var w = 0; w < c; w++) {
  43491. var _ = l[w].vertices;
  43492. t[w].push(_[A.a], _[A.b], _[A.c])
  43493. }
  43494. for (var w = 0; w < p; w++) {
  43495. var T = d[w].vertexNormals[h];
  43496. u[w].push(T.a, T.b, T.c)
  43497. }
  43498. m && this.skinIndices.push(f[A.a], f[A.b], f[A.c]),
  43499. v && this.skinWeights.push(g[A.a], g[A.b], g[A.c])
  43500. }
  43501. return this.computeGroups(e),
  43502. this.verticesNeedUpdate = e.verticesNeedUpdate,
  43503. this.normalsNeedUpdate = e.normalsNeedUpdate,
  43504. this.colorsNeedUpdate = e.colorsNeedUpdate,
  43505. this.uvsNeedUpdate = e.uvsNeedUpdate,
  43506. this.groupsNeedUpdate = e.groupsNeedUpdate,
  43507. this
  43508. },
  43509. dispose: function() {
  43510. this.dispatchEvent({
  43511. type: "dispose"
  43512. })
  43513. }
  43514. },
  43515. n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),
  43516. n.BufferGeometry = function() {
  43517. Object.defineProperty(this, "id", {
  43518. value: n.GeometryIdCount++
  43519. }),
  43520. this.uuid = n.Math.generateUUID(),
  43521. this.name = "",
  43522. this.type = "BufferGeometry",
  43523. this.index = null,
  43524. this.attributes = {},
  43525. this.morphAttributes = {},
  43526. this.groups = [],
  43527. this.boundingBox = null,
  43528. this.boundingSphere = null,
  43529. this.drawRange = {
  43530. start: 0,
  43531. count: 1 / 0
  43532. }
  43533. }
  43534. ,
  43535. n.BufferGeometry.prototype = {
  43536. constructor: n.BufferGeometry,
  43537. getIndex: function() {
  43538. return this.index
  43539. },
  43540. setIndex: function(e) {
  43541. this.index = e
  43542. },
  43543. addAttribute: function(e, t) {
  43544. return t instanceof n.BufferAttribute == !1 && t instanceof n.InterleavedBufferAttribute == !1 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  43545. void this.addAttribute(e, new n.BufferAttribute(arguments[1],arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  43546. void this.setIndex(t)) : (this.attributes[e] = t,
  43547. this)
  43548. },
  43549. getAttribute: function(e) {
  43550. return this.attributes[e]
  43551. },
  43552. removeAttribute: function(e) {
  43553. return delete this.attributes[e],
  43554. this
  43555. },
  43556. addGroup: function(e, t, i) {
  43557. this.groups.push({
  43558. start: e,
  43559. count: t,
  43560. materialIndex: void 0 !== i ? i : 0
  43561. })
  43562. },
  43563. clearGroups: function() {
  43564. this.groups = []
  43565. },
  43566. setDrawRange: function(e, t) {
  43567. this.drawRange.start = e,
  43568. this.drawRange.count = t
  43569. },
  43570. applyMatrix: function(e) {
  43571. var t = this.attributes.position;
  43572. void 0 !== t && (e.applyToVector3Array(t.array),
  43573. t.needsUpdate = !0);
  43574. var i = this.attributes.normal;
  43575. if (void 0 !== i) {
  43576. var r = (new n.Matrix3).getNormalMatrix(e);
  43577. r.applyToVector3Array(i.array),
  43578. i.needsUpdate = !0
  43579. }
  43580. return null !== this.boundingBox && this.computeBoundingBox(),
  43581. null !== this.boundingSphere && this.computeBoundingSphere(),
  43582. this
  43583. },
  43584. rotateX: function() {
  43585. var e;
  43586. return function(t) {
  43587. return void 0 === e && (e = new n.Matrix4),
  43588. e.makeRotationX(t),
  43589. this.applyMatrix(e),
  43590. this
  43591. }
  43592. }(),
  43593. rotateY: function() {
  43594. var e;
  43595. return function(t) {
  43596. return void 0 === e && (e = new n.Matrix4),
  43597. e.makeRotationY(t),
  43598. this.applyMatrix(e),
  43599. this
  43600. }
  43601. }(),
  43602. rotateZ: function() {
  43603. var e;
  43604. return function(t) {
  43605. return void 0 === e && (e = new n.Matrix4),
  43606. e.makeRotationZ(t),
  43607. this.applyMatrix(e),
  43608. this
  43609. }
  43610. }(),
  43611. translate: function() {
  43612. var e;
  43613. return function(t, i, r) {
  43614. return void 0 === e && (e = new n.Matrix4),
  43615. e.makeTranslation(t, i, r),
  43616. this.applyMatrix(e),
  43617. this
  43618. }
  43619. }(),
  43620. scale: function() {
  43621. var e;
  43622. return function(t, i, r) {
  43623. return void 0 === e && (e = new n.Matrix4),
  43624. e.makeScale(t, i, r),
  43625. this.applyMatrix(e),
  43626. this
  43627. }
  43628. }(),
  43629. lookAt: function() {
  43630. var e;
  43631. return function(t) {
  43632. void 0 === e && (e = new n.Object3D),
  43633. e.lookAt(t),
  43634. e.updateMatrix(),
  43635. this.applyMatrix(e.matrix)
  43636. }
  43637. }(),
  43638. center: function() {
  43639. this.computeBoundingBox();
  43640. var e = this.boundingBox.center().negate();
  43641. return this.translate(e.x, e.y, e.z),
  43642. e
  43643. },
  43644. setFromObject: function(e) {
  43645. var t = e.geometry;
  43646. if (e instanceof n.Points || e instanceof n.Line) {
  43647. var i = new n.Float32Attribute(3 * t.vertices.length,3)
  43648. , r = new n.Float32Attribute(3 * t.colors.length,3);
  43649. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  43650. this.addAttribute("color", r.copyColorsArray(t.colors)),
  43651. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  43652. var o = new n.Float32Attribute(t.lineDistances.length,1);
  43653. this.addAttribute("lineDistance", o.copyArray(t.lineDistances))
  43654. }
  43655. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  43656. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  43657. } else
  43658. e instanceof n.Mesh && t instanceof n.Geometry && this.fromGeometry(t);
  43659. return this
  43660. },
  43661. updateFromObject: function(e) {
  43662. var t = e.geometry;
  43663. if (e instanceof n.Mesh) {
  43664. var i = t.__directGeometry;
  43665. if (void 0 === i)
  43666. return this.fromGeometry(t);
  43667. i.verticesNeedUpdate = t.verticesNeedUpdate,
  43668. i.normalsNeedUpdate = t.normalsNeedUpdate,
  43669. i.colorsNeedUpdate = t.colorsNeedUpdate,
  43670. i.uvsNeedUpdate = t.uvsNeedUpdate,
  43671. i.groupsNeedUpdate = t.groupsNeedUpdate,
  43672. t.verticesNeedUpdate = !1,
  43673. t.normalsNeedUpdate = !1,
  43674. t.colorsNeedUpdate = !1,
  43675. t.uvsNeedUpdate = !1,
  43676. t.groupsNeedUpdate = !1,
  43677. t = i
  43678. }
  43679. if (t.verticesNeedUpdate === !0) {
  43680. var r = this.attributes.position;
  43681. void 0 !== r && (r.copyVector3sArray(t.vertices),
  43682. r.needsUpdate = !0),
  43683. t.verticesNeedUpdate = !1
  43684. }
  43685. if (t.normalsNeedUpdate === !0) {
  43686. var r = this.attributes.normal;
  43687. void 0 !== r && (r.copyVector3sArray(t.normals),
  43688. r.needsUpdate = !0),
  43689. t.normalsNeedUpdate = !1
  43690. }
  43691. if (t.colorsNeedUpdate === !0) {
  43692. var r = this.attributes.color;
  43693. void 0 !== r && (r.copyColorsArray(t.colors),
  43694. r.needsUpdate = !0),
  43695. t.colorsNeedUpdate = !1
  43696. }
  43697. if (t.uvsNeedUpdate) {
  43698. var r = this.attributes.uv;
  43699. void 0 !== r && (r.copyVector2sArray(t.uvs),
  43700. r.needsUpdate = !0),
  43701. t.uvsNeedUpdate = !1
  43702. }
  43703. if (t.lineDistancesNeedUpdate) {
  43704. var r = this.attributes.lineDistance;
  43705. void 0 !== r && (r.copyArray(t.lineDistances),
  43706. r.needsUpdate = !0),
  43707. t.lineDistancesNeedUpdate = !1
  43708. }
  43709. return t.groupsNeedUpdate && (t.computeGroups(e.geometry),
  43710. this.groups = t.groups,
  43711. t.groupsNeedUpdate = !1),
  43712. this
  43713. },
  43714. fromGeometry: function(e) {
  43715. return e.__directGeometry = (new n.DirectGeometry).fromGeometry(e),
  43716. this.fromDirectGeometry(e.__directGeometry)
  43717. },
  43718. fromDirectGeometry: function(e) {
  43719. var t = new Float32Array(3 * e.vertices.length);
  43720. if (this.addAttribute("position", new n.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  43721. e.normals.length > 0) {
  43722. var i = new Float32Array(3 * e.normals.length);
  43723. this.addAttribute("normal", new n.BufferAttribute(i,3).copyVector3sArray(e.normals))
  43724. }
  43725. if (e.colors.length > 0) {
  43726. var r = new Float32Array(3 * e.colors.length);
  43727. this.addAttribute("color", new n.BufferAttribute(r,3).copyColorsArray(e.colors))
  43728. }
  43729. if (e.uvs.length > 0) {
  43730. var o = new Float32Array(2 * e.uvs.length);
  43731. this.addAttribute("uv", new n.BufferAttribute(o,2).copyVector2sArray(e.uvs))
  43732. }
  43733. if (e.uvs2.length > 0) {
  43734. var a = new Float32Array(2 * e.uvs2.length);
  43735. this.addAttribute("uv2", new n.BufferAttribute(a,2).copyVector2sArray(e.uvs2))
  43736. }
  43737. if (e.indices.length > 0) {
  43738. var s = e.vertices.length > 65535 ? Uint32Array : Uint16Array
  43739. , l = new s(3 * e.indices.length);
  43740. this.setIndex(new n.BufferAttribute(l,1).copyIndicesArray(e.indices))
  43741. }
  43742. this.groups = e.groups;
  43743. for (var c in e.morphTargets) {
  43744. for (var h = [], u = e.morphTargets[c], d = 0, p = u.length; d < p; d++) {
  43745. var f = u[d]
  43746. , g = new n.Float32Attribute(3 * f.length,3);
  43747. h.push(g.copyVector3sArray(f))
  43748. }
  43749. this.morphAttributes[c] = h
  43750. }
  43751. if (e.skinIndices.length > 0) {
  43752. var m = new n.Float32Attribute(4 * e.skinIndices.length,4);
  43753. this.addAttribute("skinIndex", m.copyVector4sArray(e.skinIndices))
  43754. }
  43755. if (e.skinWeights.length > 0) {
  43756. var v = new n.Float32Attribute(4 * e.skinWeights.length,4);
  43757. this.addAttribute("skinWeight", v.copyVector4sArray(e.skinWeights))
  43758. }
  43759. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  43760. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  43761. this
  43762. },
  43763. computeBoundingBox: function() {
  43764. new n.Vector3;
  43765. return function() {
  43766. null === this.boundingBox && (this.boundingBox = new n.Box3);
  43767. var e = this.attributes.position.array;
  43768. e && this.boundingBox.setFromArray(e),
  43769. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  43770. this.boundingBox.max.set(0, 0, 0)),
  43771. (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)
  43772. }
  43773. }(),
  43774. computeBoundingSphere: function() {
  43775. var e = new n.Box3
  43776. , t = new n.Vector3;
  43777. return function() {
  43778. null === this.boundingSphere && (this.boundingSphere = new n.Sphere);
  43779. var i = this.attributes.position.array;
  43780. if (i) {
  43781. var r = this.boundingSphere.center;
  43782. e.setFromArray(i),
  43783. e.center(r);
  43784. for (var o = 0, a = 0, s = i.length; a < s; a += 3)
  43785. t.fromArray(i, a),
  43786. o = Math.max(o, r.distanceToSquared(t));
  43787. this.boundingSphere.radius = Math.sqrt(o),
  43788. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  43789. }
  43790. }
  43791. }(),
  43792. computeFaceNormals: function() {},
  43793. computeVertexNormals: function() {
  43794. var e = this.index
  43795. , t = this.attributes
  43796. , i = this.groups;
  43797. if (t.position) {
  43798. var r = t.position.array;
  43799. if (void 0 === t.normal)
  43800. this.addAttribute("normal", new n.BufferAttribute(new Float32Array(r.length),3));
  43801. else
  43802. for (var o = t.normal.array, a = 0, s = o.length; a < s; a++)
  43803. o[a] = 0;
  43804. var l, c, h, u = t.normal.array, d = new n.Vector3, p = new n.Vector3, f = new n.Vector3, g = new n.Vector3, m = new n.Vector3;
  43805. if (e) {
  43806. var v = e.array;
  43807. 0 === i.length && this.addGroup(0, v.length);
  43808. for (var A = 0, y = i.length; A < y; ++A)
  43809. for (var C = i[A], I = C.start, E = C.count, a = I, s = I + E; a < s; a += 3)
  43810. l = 3 * v[a + 0],
  43811. c = 3 * v[a + 1],
  43812. h = 3 * v[a + 2],
  43813. d.fromArray(r, l),
  43814. p.fromArray(r, c),
  43815. f.fromArray(r, h),
  43816. g.subVectors(f, p),
  43817. m.subVectors(d, p),
  43818. g.cross(m),
  43819. u[l] += g.x,
  43820. u[l + 1] += g.y,
  43821. u[l + 2] += g.z,
  43822. u[c] += g.x,
  43823. u[c + 1] += g.y,
  43824. u[c + 2] += g.z,
  43825. u[h] += g.x,
  43826. u[h + 1] += g.y,
  43827. u[h + 2] += g.z
  43828. } else
  43829. for (var a = 0, s = r.length; a < s; a += 9)
  43830. d.fromArray(r, a),
  43831. p.fromArray(r, a + 3),
  43832. f.fromArray(r, a + 6),
  43833. g.subVectors(f, p),
  43834. m.subVectors(d, p),
  43835. g.cross(m),
  43836. u[a] = g.x,
  43837. u[a + 1] = g.y,
  43838. u[a + 2] = g.z,
  43839. u[a + 3] = g.x,
  43840. u[a + 4] = g.y,
  43841. u[a + 5] = g.z,
  43842. u[a + 6] = g.x,
  43843. u[a + 7] = g.y,
  43844. u[a + 8] = g.z;
  43845. this.normalizeNormals(),
  43846. t.normal.needsUpdate = !0
  43847. }
  43848. },
  43849. merge: function(e, t) {
  43850. if (e instanceof n.BufferGeometry == !1)
  43851. return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e);
  43852. void 0 === t && (t = 0);
  43853. var i = this.attributes;
  43854. for (var r in i)
  43855. if (void 0 !== e.attributes[r])
  43856. for (var o = i[r], a = o.array, s = e.attributes[r], l = s.array, c = s.itemSize, h = 0, u = c * t; h < l.length; h++,
  43857. u++)
  43858. a[u] = l[h];
  43859. return this
  43860. },
  43861. normalizeNormals: function() {
  43862. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  43863. e = r[o],
  43864. t = r[o + 1],
  43865. i = r[o + 2],
  43866. n = 1 / Math.sqrt(e * e + t * t + i * i),
  43867. r[o] *= n,
  43868. r[o + 1] *= n,
  43869. r[o + 2] *= n
  43870. },
  43871. toNonIndexed: function() {
  43872. if (null === this.index)
  43873. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  43874. this;
  43875. var e = new n.BufferGeometry
  43876. , t = this.index.array
  43877. , i = this.attributes;
  43878. for (var r in i) {
  43879. for (var o = i[r], a = o.array, s = o.itemSize, l = new a.constructor(t.length * s), c = 0, h = 0, u = 0, d = t.length; u < d; u++) {
  43880. c = t[u] * s;
  43881. for (var p = 0; p < s; p++)
  43882. l[h++] = a[c++]
  43883. }
  43884. e.addAttribute(r, new n.BufferAttribute(l,s))
  43885. }
  43886. return e
  43887. },
  43888. toJSON: function() {
  43889. var e = {
  43890. metadata: {
  43891. version: 4.4,
  43892. type: "BufferGeometry",
  43893. generator: "BufferGeometry.toJSON"
  43894. }
  43895. };
  43896. if (e.uuid = this.uuid,
  43897. e.type = this.type,
  43898. "" !== this.name && (e.name = this.name),
  43899. void 0 !== this.parameters) {
  43900. var t = this.parameters;
  43901. for (var i in t)
  43902. void 0 !== t[i] && (e[i] = t[i]);
  43903. return e
  43904. }
  43905. e.data = {
  43906. attributes: {}
  43907. };
  43908. var n = this.index;
  43909. if (null !== n) {
  43910. var r = Array.prototype.slice.call(n.array);
  43911. e.data.index = {
  43912. type: n.array.constructor.name,
  43913. array: r
  43914. }
  43915. }
  43916. var o = this.attributes;
  43917. for (var i in o) {
  43918. var a = o[i]
  43919. , r = Array.prototype.slice.call(a.array);
  43920. e.data.attributes[i] = {
  43921. itemSize: a.itemSize,
  43922. type: a.array.constructor.name,
  43923. array: r
  43924. }
  43925. }
  43926. var s = this.groups;
  43927. s.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(s)));
  43928. var l = this.boundingSphere;
  43929. return null !== l && (e.data.boundingSphere = {
  43930. center: l.center.toArray(),
  43931. radius: l.radius
  43932. }),
  43933. e
  43934. },
  43935. clone: function() {
  43936. return (new n.BufferGeometry).copy(this)
  43937. },
  43938. copy: function(e) {
  43939. var t = e.index;
  43940. null !== t && this.setIndex(t.clone());
  43941. var i = e.attributes;
  43942. for (var n in i) {
  43943. var r = i[n];
  43944. this.addAttribute(n, r.clone())
  43945. }
  43946. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  43947. var l = o[a];
  43948. this.addGroup(l.start, l.count)
  43949. }
  43950. return this
  43951. },
  43952. dispose: function() {
  43953. this.dispatchEvent({
  43954. type: "dispose"
  43955. })
  43956. }
  43957. },
  43958. n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),
  43959. n.BufferGeometry.MaxIndex = 65535,
  43960. n.InstancedBufferGeometry = function() {
  43961. n.BufferGeometry.call(this),
  43962. this.type = "InstancedBufferGeometry",
  43963. this.maxInstancedCount = void 0
  43964. }
  43965. ,
  43966. n.InstancedBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  43967. n.InstancedBufferGeometry.prototype.constructor = n.InstancedBufferGeometry,
  43968. n.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  43969. this.groups.push({
  43970. start: e,
  43971. count: t,
  43972. instances: i
  43973. })
  43974. }
  43975. ,
  43976. n.InstancedBufferGeometry.prototype.copy = function(e) {
  43977. var t = e.index;
  43978. null !== t && this.setIndex(t.clone());
  43979. var i = e.attributes;
  43980. for (var n in i) {
  43981. var r = i[n];
  43982. this.addAttribute(n, r.clone())
  43983. }
  43984. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  43985. var l = o[a];
  43986. this.addGroup(l.start, l.count, l.instances)
  43987. }
  43988. return this
  43989. }
  43990. ,
  43991. n.EventDispatcher.prototype.apply(n.InstancedBufferGeometry.prototype),
  43992. n.Uniform = function(e, t) {
  43993. this.type = e,
  43994. this.value = t,
  43995. this.dynamic = !1
  43996. }
  43997. ,
  43998. n.Uniform.prototype = {
  43999. constructor: n.Uniform,
  44000. onUpdate: function(e) {
  44001. return this.dynamic = !0,
  44002. this.onUpdateCallback = e,
  44003. this
  44004. }
  44005. },
  44006. n.AnimationClip = function(e, t, i) {
  44007. this.name = e || n.Math.generateUUID(),
  44008. this.tracks = i,
  44009. this.duration = void 0 !== t ? t : -1,
  44010. this.duration < 0 && this.resetDuration(),
  44011. this.trim(),
  44012. this.optimize()
  44013. }
  44014. ,
  44015. n.AnimationClip.prototype = {
  44016. constructor: n.AnimationClip,
  44017. resetDuration: function() {
  44018. for (var e = this.tracks, t = 0, i = 0, n = e.length; i !== n; ++i) {
  44019. var r = this.tracks[i];
  44020. t = Math.max(t, r.times[r.times.length - 1])
  44021. }
  44022. this.duration = t
  44023. },
  44024. trim: function() {
  44025. for (var e = 0; e < this.tracks.length; e++)
  44026. this.tracks[e].trim(0, this.duration);
  44027. return this
  44028. },
  44029. optimize: function() {
  44030. for (var e = 0; e < this.tracks.length; e++)
  44031. this.tracks[e].optimize();
  44032. return this
  44033. }
  44034. },
  44035. Object.assign(n.AnimationClip, {
  44036. parse: function(e) {
  44037. for (var t = [], i = e.tracks, r = 1 / (e.fps || 1), o = 0, a = i.length; o !== a; ++o)
  44038. t.push(n.KeyframeTrack.parse(i[o]).scale(r));
  44039. return new n.AnimationClip(e.name,e.duration,t)
  44040. },
  44041. toJSON: function(e) {
  44042. for (var t = [], i = e.tracks, r = {
  44043. name: e.name,
  44044. duration: e.duration,
  44045. tracks: t
  44046. }, o = 0, a = i.length; o !== a; ++o)
  44047. t.push(n.KeyframeTrack.toJSON(i[o]));
  44048. return r
  44049. },
  44050. CreateFromMorphTargetSequence: function(e, t, i) {
  44051. for (var r = t.length, o = [], a = 0; a < r; a++) {
  44052. var s = []
  44053. , l = [];
  44054. s.push((a + r - 1) % r, a, (a + 1) % r),
  44055. l.push(0, 1, 0);
  44056. var c = n.AnimationUtils.getKeyframeOrder(s);
  44057. s = n.AnimationUtils.sortedArray(s, 1, c),
  44058. l = n.AnimationUtils.sortedArray(l, 1, c),
  44059. 0 === s[0] && (s.push(r),
  44060. l.push(l[0])),
  44061. o.push(new n.NumberKeyframeTrack(".morphTargetInfluences[" + t[a].name + "]",s,l).scale(1 / i))
  44062. }
  44063. return new n.AnimationClip(e,-1,o)
  44064. },
  44065. findByName: function(e, t) {
  44066. for (var i = 0; i < e.length; i++)
  44067. if (e[i].name === t)
  44068. return e[i];
  44069. return null
  44070. },
  44071. CreateClipsFromMorphTargetSequences: function(e, t) {
  44072. for (var i = {}, r = /^([\w-]*?)([\d]+)$/, o = 0, a = e.length; o < a; o++) {
  44073. var s = e[o]
  44074. , l = s.name.match(r);
  44075. if (l && l.length > 1) {
  44076. var c = l[1]
  44077. , h = i[c];
  44078. h || (i[c] = h = []),
  44079. h.push(s)
  44080. }
  44081. }
  44082. var u = [];
  44083. for (var c in i)
  44084. u.push(n.AnimationClip.CreateFromMorphTargetSequence(c, i[c], t));
  44085. return u
  44086. },
  44087. parseAnimation: function(e, t, i) {
  44088. if (!e)
  44089. return console.error(" no animation in JSONLoader data"),
  44090. null;
  44091. for (var r = function(e, t, i, r, o) {
  44092. if (0 !== i.length) {
  44093. var a = []
  44094. , s = [];
  44095. n.AnimationUtils.flattenJSON(i, a, s, r),
  44096. 0 !== a.length && o.push(new e(t,a,s))
  44097. }
  44098. }, o = [], a = e.name || "default", s = e.length || -1, l = e.fps || 30, c = e.hierarchy || [], h = 0; h < c.length; h++) {
  44099. var u = c[h].keys;
  44100. if (u && 0 != u.length)
  44101. if (u[0].morphTargets) {
  44102. for (var d = {}, p = 0; p < u.length; p++)
  44103. if (u[p].morphTargets)
  44104. for (var f = 0; f < u[p].morphTargets.length; f++)
  44105. d[u[p].morphTargets[f]] = -1;
  44106. for (var g in d) {
  44107. for (var m = [], v = [], f = 0; f !== u[p].morphTargets.length; ++f) {
  44108. var A = u[p];
  44109. m.push(A.time),
  44110. v.push(A.morphTarget === g ? 1 : 0)
  44111. }
  44112. o.push(new n.NumberKeyframeTrack(".morphTargetInfluence[" + g + "]",m,v))
  44113. }
  44114. s = d.length * (l || 1)
  44115. } else {
  44116. var y = ".bones[" + t[h].name + "]";
  44117. r(n.VectorKeyframeTrack, y + ".position", u, "pos", o),
  44118. r(n.QuaternionKeyframeTrack, y + ".quaternion", u, "rot", o),
  44119. r(n.VectorKeyframeTrack, y + ".scale", u, "scl", o)
  44120. }
  44121. }
  44122. if (0 === o.length)
  44123. return null;
  44124. var C = new n.AnimationClip(a,s,o);
  44125. return C
  44126. }
  44127. }),
  44128. n.AnimationMixer = function(e) {
  44129. this._root = e,
  44130. this._initMemoryManager(),
  44131. this._accuIndex = 0,
  44132. this.time = 0,
  44133. this.timeScale = 1
  44134. }
  44135. ,
  44136. n.AnimationMixer.prototype = {
  44137. constructor: n.AnimationMixer,
  44138. clipAction: function(e, t) {
  44139. var i, r = t || this._root, o = r.uuid, a = "string" == typeof e ? e : e.name, s = e !== a ? e : null, l = this._actionsByClip[a];
  44140. if (void 0 !== l) {
  44141. var c = l.actionByRoot[o];
  44142. if (void 0 !== c)
  44143. return c;
  44144. if (i = l.knownActions[0],
  44145. s = i._clip,
  44146. e !== a && e !== s)
  44147. throw new Error("Different clips with the same name detected!")
  44148. }
  44149. if (null === s)
  44150. return null;
  44151. var h = new n.AnimationMixer._Action(this,s,t);
  44152. return this._bindAction(h, i),
  44153. this._addInactiveAction(h, a, o),
  44154. h
  44155. },
  44156. existingAction: function(e, t) {
  44157. var i = t || this._root
  44158. , n = i.uuid
  44159. , r = "string" == typeof e ? e : e.name
  44160. , o = this._actionsByClip[r];
  44161. return void 0 !== o ? o.actionByRoot[n] || null : null
  44162. },
  44163. stopAllAction: function() {
  44164. var e = this._actions
  44165. , t = this._nActiveActions
  44166. , i = this._bindings
  44167. , n = this._nActiveBindings;
  44168. this._nActiveActions = 0,
  44169. this._nActiveBindings = 0;
  44170. for (var r = 0; r !== t; ++r)
  44171. e[r].reset();
  44172. for (var r = 0; r !== n; ++r)
  44173. i[r].useCount = 0;
  44174. return this
  44175. },
  44176. update: function(e) {
  44177. e *= this.timeScale;
  44178. for (var t = this._actions, i = this._nActiveActions, n = this.time += e, r = Math.sign(e), o = this._accuIndex ^= 1, a = 0; a !== i; ++a) {
  44179. var s = t[a];
  44180. s.enabled && s._update(n, e, r, o)
  44181. }
  44182. for (var l = this._bindings, c = this._nActiveBindings, a = 0; a !== c; ++a)
  44183. l[a].apply(o);
  44184. return this
  44185. },
  44186. getRoot: function() {
  44187. return this._root
  44188. },
  44189. uncacheClip: function(e) {
  44190. var t = this._actions
  44191. , i = e.name
  44192. , n = this._actionsByClip
  44193. , r = n[i];
  44194. if (void 0 !== r) {
  44195. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  44196. var l = o[a];
  44197. this._deactivateAction(l);
  44198. var c = l._cacheIndex
  44199. , h = t[t.length - 1];
  44200. l._cacheIndex = null,
  44201. l._byClipCacheIndex = null,
  44202. h._cacheIndex = c,
  44203. t[c] = h,
  44204. t.pop(),
  44205. this._removeInactiveBindingsForAction(l)
  44206. }
  44207. delete n[i]
  44208. }
  44209. },
  44210. uncacheRoot: function(e) {
  44211. var t = e.uuid
  44212. , i = this._actionsByClip;
  44213. for (var n in i) {
  44214. var r = i[n].actionByRoot
  44215. , o = r[t];
  44216. void 0 !== o && (this._deactivateAction(o),
  44217. this._removeInactiveAction(o))
  44218. }
  44219. var a = this._bindingsByRootAndName
  44220. , s = a[t];
  44221. if (void 0 !== s)
  44222. for (var l in s) {
  44223. var c = s[l];
  44224. c.restoreOriginalState(),
  44225. this._removeInactiveBinding(c)
  44226. }
  44227. },
  44228. uncacheAction: function(e, t) {
  44229. var i = this.existingAction(e, t);
  44230. null !== i && (this._deactivateAction(i),
  44231. this._removeInactiveAction(i))
  44232. }
  44233. },
  44234. n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),
  44235. n.AnimationMixer._Action = function(e, t, i) {
  44236. this._mixer = e,
  44237. this._clip = t,
  44238. this._localRoot = i || null;
  44239. for (var r = t.tracks, o = r.length, a = new Array(o), s = {
  44240. endingStart: n.ZeroCurvatureEnding,
  44241. endingEnd: n.ZeroCurvatureEnding
  44242. }, l = 0; l !== o; ++l) {
  44243. var c = r[l].createInterpolant(null);
  44244. a[l] = c,
  44245. c.settings = s
  44246. }
  44247. this._interpolantSettings = s,
  44248. this._interpolants = a,
  44249. this._propertyBindings = new Array(o),
  44250. this._cacheIndex = null,
  44251. this._byClipCacheIndex = null,
  44252. this._timeScaleInterpolant = null,
  44253. this._weightInterpolant = null,
  44254. this.loop = n.LoopRepeat,
  44255. this._loopCount = -1,
  44256. this._startTime = null,
  44257. this.time = 0,
  44258. this.timeScale = 1,
  44259. this._effectiveTimeScale = 1,
  44260. this.weight = 1,
  44261. this._effectiveWeight = 1,
  44262. this.repetitions = 1 / 0,
  44263. this.paused = !1,
  44264. this.enabled = !0,
  44265. this.clampWhenFinished = !1,
  44266. this.zeroSlopeAtStart = !0,
  44267. this.zeroSlopeAtEnd = !0
  44268. }
  44269. ,
  44270. n.AnimationMixer._Action.prototype = {
  44271. constructor: n.AnimationMixer._Action,
  44272. play: function() {
  44273. return this._mixer._activateAction(this),
  44274. this
  44275. },
  44276. stop: function() {
  44277. return this._mixer._deactivateAction(this),
  44278. this.reset()
  44279. },
  44280. reset: function() {
  44281. return this.paused = !1,
  44282. this.enabled = !0,
  44283. this.time = 0,
  44284. this._loopCount = -1,
  44285. this._startTime = null,
  44286. this.stopFading().stopWarping()
  44287. },
  44288. isRunning: function() {
  44289. this._startTime;
  44290. return this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  44291. },
  44292. isScheduled: function() {
  44293. return this._mixer._isActiveAction(this)
  44294. },
  44295. startAt: function(e) {
  44296. return this._startTime = e,
  44297. this
  44298. },
  44299. setLoop: function(e, t) {
  44300. return this.loop = e,
  44301. this.repetitions = t,
  44302. this
  44303. },
  44304. setEffectiveWeight: function(e) {
  44305. return this.weight = e,
  44306. this._effectiveWeight = this.enabled ? e : 0,
  44307. this.stopFading()
  44308. },
  44309. getEffectiveWeight: function() {
  44310. return this._effectiveWeight
  44311. },
  44312. fadeIn: function(e) {
  44313. return this._scheduleFading(e, 0, 1)
  44314. },
  44315. fadeOut: function(e) {
  44316. return this._scheduleFading(e, 1, 0)
  44317. },
  44318. crossFadeFrom: function(e, t, i) {
  44319. this._mixer;
  44320. if (e.fadeOut(t),
  44321. this.fadeIn(t),
  44322. i) {
  44323. var n = this._clip.duration
  44324. , r = e._clip.duration
  44325. , o = r / n
  44326. , a = n / r;
  44327. e.warp(1, o, t),
  44328. this.warp(a, 1, t)
  44329. }
  44330. return this
  44331. },
  44332. crossFadeTo: function(e, t, i) {
  44333. return e.crossFadeFrom(this, t, i)
  44334. },
  44335. stopFading: function() {
  44336. var e = this._weightInterpolant;
  44337. return null !== e && (this._weightInterpolant = null,
  44338. this._mixer._takeBackControlInterpolant(e)),
  44339. this
  44340. },
  44341. setEffectiveTimeScale: function(e) {
  44342. return this.timeScale = e,
  44343. this._effectiveTimeScale = this.paused ? 0 : e,
  44344. this.stopWarping()
  44345. },
  44346. getEffectiveTimeScale: function() {
  44347. return this._effectiveTimeScale
  44348. },
  44349. setDuration: function(e) {
  44350. return this.timeScale = this._clip.duration / e,
  44351. this.stopWarping()
  44352. },
  44353. syncWith: function(e) {
  44354. return this.time = e.time,
  44355. this.timeScale = e.timeScale,
  44356. this.stopWarping()
  44357. },
  44358. halt: function(e) {
  44359. return this.warp(this._currentTimeScale, 0, e)
  44360. },
  44361. warp: function(e, t, i) {
  44362. var n = this._mixer
  44363. , r = n.time
  44364. , o = this._timeScaleInterpolant
  44365. , a = this.timeScale;
  44366. null === o && (o = n._lendControlInterpolant(),
  44367. this._timeScaleInterpolant = o);
  44368. var s = o.parameterPositions
  44369. , l = o.sampleValues;
  44370. return s[0] = r,
  44371. s[1] = r + i,
  44372. l[0] = e / a,
  44373. l[1] = t / a,
  44374. this
  44375. },
  44376. stopWarping: function() {
  44377. var e = this._timeScaleInterpolant;
  44378. return null !== e && (this._timeScaleInterpolant = null,
  44379. this._mixer._takeBackControlInterpolant(e)),
  44380. this
  44381. },
  44382. getMixer: function() {
  44383. return this._mixer
  44384. },
  44385. getClip: function() {
  44386. return this._clip
  44387. },
  44388. getRoot: function() {
  44389. return this._localRoot || this._mixer._root
  44390. },
  44391. _update: function(e, t, i, n) {
  44392. var r = this._startTime;
  44393. if (null !== r) {
  44394. var o = (e - r) * i;
  44395. if (o < 0 || 0 === i)
  44396. return;
  44397. this._startTime = null,
  44398. t = i * o
  44399. }
  44400. t *= this._updateTimeScale(e);
  44401. var a = this._updateTime(t)
  44402. , s = this._updateWeight(e);
  44403. if (s > 0)
  44404. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  44405. l[h].evaluate(a),
  44406. c[h].accumulate(n, s)
  44407. },
  44408. _updateWeight: function(e) {
  44409. var t = 0;
  44410. if (this.enabled) {
  44411. t = this.weight;
  44412. var i = this._weightInterpolant;
  44413. if (null !== i) {
  44414. var n = i.evaluate(e)[0];
  44415. t *= n,
  44416. e > i.parameterPositions[1] && (this.stopFading(),
  44417. 0 === n && (this.enabled = !1))
  44418. }
  44419. }
  44420. return this._effectiveWeight = t,
  44421. t
  44422. },
  44423. _updateTimeScale: function(e) {
  44424. var t = 0;
  44425. if (!this.paused) {
  44426. t = this.timeScale;
  44427. var i = this._timeScaleInterpolant;
  44428. if (null !== i) {
  44429. var n = i.evaluate(e)[0];
  44430. t *= n,
  44431. e > i.parameterPositions[1] && (this.stopWarping(),
  44432. 0 === t ? this.pause = !0 : this.timeScale = t)
  44433. }
  44434. }
  44435. return this._effectiveTimeScale = t,
  44436. t
  44437. },
  44438. _updateTime: function(e) {
  44439. var t = this.time + e;
  44440. if (0 === e)
  44441. return t;
  44442. var i = this._clip.duration
  44443. , r = this.loop
  44444. , o = this._loopCount
  44445. , a = !1;
  44446. switch (r) {
  44447. case n.LoopOnce:
  44448. if (o === -1 && (this.loopCount = 0,
  44449. this._setEndings(!0, !0, !1)),
  44450. t >= i)
  44451. t = i;
  44452. else {
  44453. if (!(t < 0))
  44454. break;
  44455. t = 0
  44456. }
  44457. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  44458. this._mixer.dispatchEvent({
  44459. type: "finished",
  44460. action: this,
  44461. direction: e < 0 ? -1 : 1
  44462. });
  44463. break;
  44464. case n.LoopPingPong:
  44465. a = !0;
  44466. case n.LoopRepeat:
  44467. if (o === -1 && (e > 0 ? (o = 0,
  44468. this._setEndings(!0, 0 === this.repetitions, a)) : this._setEndings(0 === this.repetitions, !0, a)),
  44469. t >= i || t < 0) {
  44470. var s = Math.floor(t / i);
  44471. t -= i * s,
  44472. o += Math.abs(s);
  44473. var l = this.repetitions - o;
  44474. if (l < 0) {
  44475. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  44476. t = e > 0 ? i : 0,
  44477. this._mixer.dispatchEvent({
  44478. type: "finished",
  44479. action: this,
  44480. direction: e > 0 ? 1 : -1
  44481. });
  44482. break
  44483. }
  44484. if (0 === l) {
  44485. var c = e < 0;
  44486. this._setEndings(c, !c, a)
  44487. } else
  44488. this._setEndings(!1, !1, a);
  44489. this._loopCount = o,
  44490. this._mixer.dispatchEvent({
  44491. type: "loop",
  44492. action: this,
  44493. loopDelta: s
  44494. })
  44495. }
  44496. if (r === n.LoopPingPong && 1 === (1 & o))
  44497. return this.time = t,
  44498. i - t
  44499. }
  44500. return this.time = t,
  44501. t
  44502. },
  44503. _setEndings: function(e, t, i) {
  44504. var r = this._interpolantSettings;
  44505. i ? (r.endingStart = n.ZeroSlopeEnding,
  44506. r.endingEnd = n.ZeroSlopeEnding) : (e ? r.endingStart = this.zeroSlopeAtStart ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingStart = n.WrapAroundEnding,
  44507. t ? r.endingEnd = this.zeroSlopeAtEnd ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingEnd = n.WrapAroundEnding)
  44508. },
  44509. _scheduleFading: function(e, t, i) {
  44510. var n = this._mixer
  44511. , r = n.time
  44512. , o = this._weightInterpolant;
  44513. null === o && (o = n._lendControlInterpolant(),
  44514. this._weightInterpolant = o);
  44515. var a = o.parameterPositions
  44516. , s = o.sampleValues;
  44517. return a[0] = r,
  44518. s[0] = t,
  44519. a[1] = r + e,
  44520. s[1] = i,
  44521. this
  44522. }
  44523. },
  44524. Object.assign(n.AnimationMixer.prototype, {
  44525. _bindAction: function(e, t) {
  44526. var i = e._localRoot || this._root
  44527. , r = e._clip.tracks
  44528. , o = r.length
  44529. , a = e._propertyBindings
  44530. , s = e._interpolants
  44531. , l = i.uuid
  44532. , c = this._bindingsByRootAndName
  44533. , h = c[l];
  44534. void 0 === h && (h = {},
  44535. c[l] = h);
  44536. for (var u = 0; u !== o; ++u) {
  44537. var d = r[u]
  44538. , p = d.name
  44539. , f = h[p];
  44540. if (void 0 !== f)
  44541. a[u] = f;
  44542. else {
  44543. if (f = a[u],
  44544. void 0 !== f) {
  44545. null === f._cacheIndex && (++f.referenceCount,
  44546. this._addInactiveBinding(f, l, p));
  44547. continue
  44548. }
  44549. var g = t && t._propertyBindings[u].binding.parsedPath;
  44550. f = new n.PropertyMixer(n.PropertyBinding.create(i, p, g),d.ValueTypeName,d.getValueSize()),
  44551. ++f.referenceCount,
  44552. this._addInactiveBinding(f, l, p),
  44553. a[u] = f
  44554. }
  44555. s[u].resultBuffer = f.buffer
  44556. }
  44557. },
  44558. _activateAction: function(e) {
  44559. if (!this._isActiveAction(e)) {
  44560. if (null === e._cacheIndex) {
  44561. var t = (e._localRoot || this._root).uuid
  44562. , i = e._clip.name
  44563. , n = this._actionsByClip[i];
  44564. this._bindAction(e, n && n.knownActions[0]),
  44565. this._addInactiveAction(e, i, t)
  44566. }
  44567. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  44568. var s = r[o];
  44569. 0 === s.useCount++ && (this._lendBinding(s),
  44570. s.saveOriginalState())
  44571. }
  44572. this._lendAction(e)
  44573. }
  44574. },
  44575. _deactivateAction: function(e) {
  44576. if (this._isActiveAction(e)) {
  44577. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  44578. var r = t[i];
  44579. 0 === --r.useCount && (r.restoreOriginalState(),
  44580. this._takeBackBinding(r))
  44581. }
  44582. this._takeBackAction(e)
  44583. }
  44584. },
  44585. _initMemoryManager: function() {
  44586. this._actions = [],
  44587. this._nActiveActions = 0,
  44588. this._actionsByClip = {},
  44589. this._bindings = [],
  44590. this._nActiveBindings = 0,
  44591. this._bindingsByRootAndName = {},
  44592. this._controlInterpolants = [],
  44593. this._nActiveControlInterpolants = 0;
  44594. var e = this;
  44595. this.stats = {
  44596. actions: {
  44597. get total() {
  44598. return e._actions.length
  44599. },
  44600. get inUse() {
  44601. return e._nActiveActions
  44602. }
  44603. },
  44604. bindings: {
  44605. get total() {
  44606. return e._bindings.length
  44607. },
  44608. get inUse() {
  44609. return e._nActiveBindings
  44610. }
  44611. },
  44612. controlInterpolants: {
  44613. get total() {
  44614. return e._controlInterpolants.length
  44615. },
  44616. get inUse() {
  44617. return e._nActiveControlInterpolants
  44618. }
  44619. }
  44620. }
  44621. },
  44622. _isActiveAction: function(e) {
  44623. var t = e._cacheIndex;
  44624. return null !== t && t < this._nActiveActions
  44625. },
  44626. _addInactiveAction: function(e, t, i) {
  44627. var n = this._actions
  44628. , r = this._actionsByClip
  44629. , o = r[t];
  44630. if (void 0 === o)
  44631. o = {
  44632. knownActions: [e],
  44633. actionByRoot: {}
  44634. },
  44635. e._byClipCacheIndex = 0,
  44636. r[t] = o;
  44637. else {
  44638. var a = o.knownActions;
  44639. e._byClipCacheIndex = a.length,
  44640. a.push(e)
  44641. }
  44642. e._cacheIndex = n.length,
  44643. n.push(e),
  44644. o.actionByRoot[i] = e
  44645. },
  44646. _removeInactiveAction: function(e) {
  44647. var t = this._actions
  44648. , i = t[t.length - 1]
  44649. , n = e._cacheIndex;
  44650. i._cacheIndex = n,
  44651. t[n] = i,
  44652. t.pop(),
  44653. e._cacheIndex = null;
  44654. var r = e._clip.name
  44655. , o = this._actionsByClip
  44656. , a = o[r]
  44657. , s = a.knownActions
  44658. , l = s[s.length - 1]
  44659. , c = e._byClipCacheIndex;
  44660. l._byClipCacheIndex = c,
  44661. s[c] = l,
  44662. s.pop(),
  44663. e._byClipCacheIndex = null;
  44664. var h = a.actionByRoot
  44665. , u = (t._localRoot || this._root).uuid;
  44666. delete h[u],
  44667. 0 === s.length && delete o[r],
  44668. this._removeInactiveBindingsForAction(e)
  44669. },
  44670. _removeInactiveBindingsForAction: function(e) {
  44671. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  44672. var r = t[i];
  44673. 0 === --r.referenceCount && this._removeInactiveBinding(r)
  44674. }
  44675. },
  44676. _lendAction: function(e) {
  44677. var t = this._actions
  44678. , i = e._cacheIndex
  44679. , n = this._nActiveActions++
  44680. , r = t[n];
  44681. e._cacheIndex = n,
  44682. t[n] = e,
  44683. r._cacheIndex = i,
  44684. t[i] = r
  44685. },
  44686. _takeBackAction: function(e) {
  44687. var t = this._actions
  44688. , i = e._cacheIndex
  44689. , n = --this._nActiveActions
  44690. , r = t[n];
  44691. e._cacheIndex = n,
  44692. t[n] = e,
  44693. r._cacheIndex = i,
  44694. t[i] = r
  44695. },
  44696. _addInactiveBinding: function(e, t, i) {
  44697. var n = this._bindingsByRootAndName
  44698. , r = n[t]
  44699. , o = this._bindings;
  44700. void 0 === r && (r = {},
  44701. n[t] = r),
  44702. r[i] = e,
  44703. e._cacheIndex = o.length,
  44704. o.push(e)
  44705. },
  44706. _removeInactiveBinding: function(e) {
  44707. var t = this._bindings
  44708. , i = e.binding
  44709. , n = i.rootNode.uuid
  44710. , r = i.path
  44711. , o = this._bindingsByRootAndName
  44712. , a = o[n]
  44713. , s = t[t.length - 1]
  44714. , l = e._cacheIndex;
  44715. s._cacheIndex = l,
  44716. t[l] = s,
  44717. t.pop(),
  44718. delete a[r];
  44719. e: {
  44720. for (var c in a)
  44721. break e;
  44722. delete o[n]
  44723. }
  44724. },
  44725. _lendBinding: function(e) {
  44726. var t = this._bindings
  44727. , i = e._cacheIndex
  44728. , n = this._nActiveBindings++
  44729. , r = t[n];
  44730. e._cacheIndex = n,
  44731. t[n] = e,
  44732. r._cacheIndex = i,
  44733. t[i] = r
  44734. },
  44735. _takeBackBinding: function(e) {
  44736. var t = this._bindings
  44737. , i = e._cacheIndex
  44738. , n = --this._nActiveBindings
  44739. , r = t[n];
  44740. e._cacheIndex = n,
  44741. t[n] = e,
  44742. r._cacheIndex = i,
  44743. t[i] = r
  44744. },
  44745. _lendControlInterpolant: function() {
  44746. var e = this._controlInterpolants
  44747. , t = this._nActiveControlInterpolants++
  44748. , i = e[t];
  44749. return void 0 === i && (i = new n.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),
  44750. i.__cacheIndex = t,
  44751. e[t] = i),
  44752. i
  44753. },
  44754. _takeBackControlInterpolant: function(e) {
  44755. var t = this._controlInterpolants
  44756. , i = e.__cacheIndex
  44757. , n = --this._nActiveControlInterpolants
  44758. , r = t[n];
  44759. e.__cacheIndex = n,
  44760. t[n] = e,
  44761. r.__cacheIndex = i,
  44762. t[i] = r
  44763. },
  44764. _controlInterpolantsResultBuffer: new Float32Array(1)
  44765. }),
  44766. n.AnimationObjectGroup = function(e) {
  44767. this.uuid = n.Math.generateUUID(),
  44768. this._objects = Array.prototype.slice.call(arguments),
  44769. this.nCachedObjects_ = 0;
  44770. var t = {};
  44771. this._indicesByUUID = t;
  44772. for (var i = 0, r = arguments.length; i !== r; ++i)
  44773. t[arguments[i].uuid] = i;
  44774. this._paths = [],
  44775. this._parsedPaths = [],
  44776. this._bindings = [],
  44777. this._bindingsIndicesByPath = {};
  44778. var o = this;
  44779. this.stats = {
  44780. objects: {
  44781. get total() {
  44782. return o._objects.length
  44783. },
  44784. get inUse() {
  44785. return this.total - o.nCachedObjects_
  44786. }
  44787. },
  44788. get bindingsPerObject() {
  44789. return o._bindings.length
  44790. }
  44791. }
  44792. }
  44793. ,
  44794. n.AnimationObjectGroup.prototype = {
  44795. constructor: n.AnimationObjectGroup,
  44796. add: function(e) {
  44797. for (var t = this._objects, i = t.length, r = this.nCachedObjects_, o = this._indicesByUUID, a = this._paths, s = this._parsedPaths, l = this._bindings, c = l.length, h = 0, u = arguments.length; h !== u; ++h) {
  44798. var d = arguments[h]
  44799. , p = d.uuid
  44800. , f = o[p];
  44801. if (void 0 === f) {
  44802. f = i++,
  44803. o[p] = f,
  44804. t.push(d);
  44805. for (var g = 0, m = c; g !== m; ++g)
  44806. l[g].push(new n.PropertyBinding(d,a[g],s[g]))
  44807. } else if (f < r) {
  44808. var v = t[f]
  44809. , A = --r
  44810. , y = t[A];
  44811. o[y.uuid] = f,
  44812. t[f] = y,
  44813. o[p] = A,
  44814. t[A] = d;
  44815. for (var g = 0, m = c; g !== m; ++g) {
  44816. var C = l[g]
  44817. , I = C[A]
  44818. , E = C[f];
  44819. C[f] = I,
  44820. void 0 === E && (E = new n.PropertyBinding(d,a[g],s[g])),
  44821. C[A] = E
  44822. }
  44823. } else
  44824. t[f] !== v && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  44825. }
  44826. this.nCachedObjects_ = r
  44827. },
  44828. remove: function(e) {
  44829. for (var t = this._objects, i = (t.length,
  44830. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  44831. var l = arguments[a]
  44832. , c = l.uuid
  44833. , h = n[c];
  44834. if (void 0 !== h && h >= i) {
  44835. var u = i++
  44836. , d = t[u];
  44837. n[d.uuid] = h,
  44838. t[h] = d,
  44839. n[c] = u,
  44840. t[u] = l;
  44841. for (var p = 0, f = o; p !== f; ++p) {
  44842. var g = r[p]
  44843. , m = g[u]
  44844. , v = g[h];
  44845. g[h] = m,
  44846. g[u] = v
  44847. }
  44848. }
  44849. }
  44850. this.nCachedObjects_ = i
  44851. },
  44852. uncache: function(e) {
  44853. for (var t = this._objects, i = t.length, n = this.nCachedObjects_, r = this._indicesByUUID, o = this._bindings, a = o.length, s = 0, l = arguments.length; s !== l; ++s) {
  44854. var c = arguments[s]
  44855. , h = c.uuid
  44856. , u = r[h];
  44857. if (void 0 !== u)
  44858. if (delete r[h],
  44859. u < n) {
  44860. var d = --n
  44861. , p = t[d]
  44862. , f = --i
  44863. , g = t[f];
  44864. r[p.uuid] = u,
  44865. t[u] = p,
  44866. r[g.uuid] = d,
  44867. t[d] = g,
  44868. t.pop();
  44869. for (var m = 0, v = a; m !== v; ++m) {
  44870. var A = o[m]
  44871. , y = A[d]
  44872. , C = A[f];
  44873. A[u] = y,
  44874. A[d] = C,
  44875. A.pop()
  44876. }
  44877. } else {
  44878. var f = --i
  44879. , g = t[f];
  44880. r[g.uuid] = u,
  44881. t[u] = g,
  44882. t.pop();
  44883. for (var m = 0, v = a; m !== v; ++m) {
  44884. var A = o[m];
  44885. A[u] = A[f],
  44886. A.pop()
  44887. }
  44888. }
  44889. }
  44890. this.nCachedObjects_ = n
  44891. },
  44892. subscribe_: function(e, t) {
  44893. var i = this._bindingsIndicesByPath
  44894. , r = i[e]
  44895. , o = this._bindings;
  44896. if (void 0 !== r)
  44897. return o[r];
  44898. var a = this._paths
  44899. , s = this._parsedPaths
  44900. , l = this._objects
  44901. , c = l.length
  44902. , h = this.nCachedObjects_
  44903. , u = new Array(c);
  44904. r = o.length,
  44905. i[e] = r,
  44906. a.push(e),
  44907. s.push(t),
  44908. o.push(u);
  44909. for (var d = h, p = l.length; d !== p; ++d) {
  44910. var f = l[d];
  44911. u[d] = new n.PropertyBinding(f,e,t)
  44912. }
  44913. return u
  44914. },
  44915. unsubscribe_: function(e) {
  44916. var t = this._bindingsIndicesByPath
  44917. , i = t[e];
  44918. if (void 0 !== i) {
  44919. var n = this._paths
  44920. , r = this._parsedPaths
  44921. , o = this._bindings
  44922. , a = o.length - 1
  44923. , s = o[a]
  44924. , l = e[a];
  44925. t[l] = i,
  44926. o[i] = s,
  44927. o.pop(),
  44928. r[i] = r[a],
  44929. r.pop(),
  44930. n[i] = n[a],
  44931. n.pop()
  44932. }
  44933. }
  44934. },
  44935. n.AnimationUtils = {
  44936. arraySlice: function(e, t, i) {
  44937. return n.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  44938. },
  44939. convertArray: function(e, t, i) {
  44940. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  44941. },
  44942. isTypedArray: function(e) {
  44943. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  44944. },
  44945. getKeyframeOrder: function(e) {
  44946. function t(t, i) {
  44947. return e[t] - e[i]
  44948. }
  44949. for (var i = e.length, n = new Array(i), r = 0; r !== i; ++r)
  44950. n[r] = r;
  44951. return n.sort(t),
  44952. n
  44953. },
  44954. sortedArray: function(e, t, i) {
  44955. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  44956. for (var s = i[o] * t, l = 0; l !== t; ++l)
  44957. r[a++] = e[s + l];
  44958. return r
  44959. },
  44960. flattenJSON: function(e, t, i, n) {
  44961. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  44962. o = e[r++];
  44963. if (void 0 !== o) {
  44964. var a = o[n];
  44965. if (void 0 !== a)
  44966. if (Array.isArray(a)) {
  44967. do
  44968. a = o[n],
  44969. void 0 !== a && (t.push(o.time),
  44970. i.push.apply(i, a)),
  44971. o = e[r++];
  44972. while (void 0 !== o)
  44973. } else if (void 0 !== a.toArray) {
  44974. do
  44975. a = o[n],
  44976. void 0 !== a && (t.push(o.time),
  44977. a.toArray(i, i.length)),
  44978. o = e[r++];
  44979. while (void 0 !== o)
  44980. } else
  44981. do
  44982. a = o[n],
  44983. void 0 !== a && (t.push(o.time),
  44984. i.push(a)),
  44985. o = e[r++];
  44986. while (void 0 !== o)
  44987. }
  44988. }
  44989. },
  44990. n.KeyframeTrack = function(e, t, i, r) {
  44991. if (void 0 === e)
  44992. throw new Error("track name is undefined");
  44993. if (void 0 === t || 0 === t.length)
  44994. throw new Error("no keyframes in track named " + e);
  44995. this.name = e,
  44996. this.times = n.AnimationUtils.convertArray(t, this.TimeBufferType),
  44997. this.values = n.AnimationUtils.convertArray(i, this.ValueBufferType),
  44998. this.setInterpolation(r || this.DefaultInterpolation),
  44999. this.validate(),
  45000. this.optimize()
  45001. }
  45002. ,
  45003. n.KeyframeTrack.prototype = {
  45004. constructor: n.KeyframeTrack,
  45005. TimeBufferType: Float32Array,
  45006. ValueBufferType: Float32Array,
  45007. DefaultInterpolation: n.InterpolateLinear,
  45008. InterpolantFactoryMethodDiscrete: function(e) {
  45009. return new n.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  45010. },
  45011. InterpolantFactoryMethodLinear: function(e) {
  45012. return new n.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  45013. },
  45014. InterpolantFactoryMethodSmooth: function(e) {
  45015. return new n.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  45016. },
  45017. setInterpolation: function(e) {
  45018. var t = void 0;
  45019. switch (e) {
  45020. case n.InterpolateDiscrete:
  45021. t = this.InterpolantFactoryMethodDiscrete;
  45022. break;
  45023. case n.InterpolateLinear:
  45024. t = this.InterpolantFactoryMethodLinear;
  45025. break;
  45026. case n.InterpolateSmooth:
  45027. t = this.InterpolantFactoryMethodSmooth
  45028. }
  45029. if (void 0 === t) {
  45030. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  45031. if (void 0 === this.createInterpolant) {
  45032. if (e === this.DefaultInterpolation)
  45033. throw new Error(i);
  45034. this.setInterpolation(this.DefaultInterpolation)
  45035. }
  45036. return void console.warn(i)
  45037. }
  45038. this.createInterpolant = t
  45039. },
  45040. getInterpolation: function() {
  45041. switch (this.createInterpolant) {
  45042. case this.InterpolantFactoryMethodDiscrete:
  45043. return n.InterpolateDiscrete;
  45044. case this.InterpolantFactoryMethodLinear:
  45045. return n.InterpolateLinear;
  45046. case this.InterpolantFactoryMethodSmooth:
  45047. return n.InterpolateSmooth
  45048. }
  45049. },
  45050. getValueSize: function() {
  45051. return this.values.length / this.times.length
  45052. },
  45053. shift: function(e) {
  45054. if (0 !== e)
  45055. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  45056. t[i] += e;
  45057. return this
  45058. },
  45059. scale: function(e) {
  45060. if (1 !== e)
  45061. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  45062. t[i] *= e;
  45063. return this
  45064. },
  45065. trim: function(e, t) {
  45066. for (var i = this.times, r = i.length, o = 0, a = r - 1; o !== r && i[o] < e; )
  45067. ++o;
  45068. for (; a !== -1 && i[a] > t; )
  45069. --a;
  45070. if (++a,
  45071. 0 !== o || a !== r) {
  45072. o >= a && (a = Math.max(a, 1),
  45073. o = a - 1);
  45074. var s = this.getValueSize();
  45075. this.times = n.AnimationUtils.arraySlice(i, o, a),
  45076. this.values = n.AnimationUtils.arraySlice(this.values, o * s, a * s)
  45077. }
  45078. return this
  45079. },
  45080. validate: function() {
  45081. var e = !0
  45082. , t = this.getValueSize();
  45083. t - Math.floor(t) !== 0 && (console.error("invalid value size in track", this),
  45084. e = !1);
  45085. var i = this.times
  45086. , r = this.values
  45087. , o = i.length;
  45088. 0 === o && (console.error("track is empty", this),
  45089. e = !1);
  45090. for (var a = null, s = 0; s !== o; s++) {
  45091. var l = i[s];
  45092. if ("number" == typeof l && isNaN(l)) {
  45093. console.error("time is not a valid number", this, s, l),
  45094. e = !1;
  45095. break
  45096. }
  45097. if (null !== a && a > l) {
  45098. console.error("out of order keys", this, s, l, a),
  45099. e = !1;
  45100. break
  45101. }
  45102. a = l
  45103. }
  45104. if (void 0 !== r && n.AnimationUtils.isTypedArray(r))
  45105. for (var s = 0, c = r.length; s !== c; ++s) {
  45106. var h = r[s];
  45107. if (isNaN(h)) {
  45108. console.error("value is not a valid number", this, s, h),
  45109. e = !1;
  45110. break
  45111. }
  45112. }
  45113. return e
  45114. },
  45115. optimize: function() {
  45116. for (var e = this.times, t = this.values, i = this.getValueSize(), r = 1, o = 1, a = e.length - 1; o <= a; ++o) {
  45117. var s = !1
  45118. , l = e[o]
  45119. , c = e[o + 1];
  45120. if (l !== c && (1 !== o || l !== l[0]))
  45121. for (var h = o * i, u = h - i, d = h + i, p = 0; p !== i; ++p) {
  45122. var f = t[h + p];
  45123. if (f !== t[u + p] || f !== t[d + p]) {
  45124. s = !0;
  45125. break
  45126. }
  45127. }
  45128. if (s) {
  45129. if (o !== r) {
  45130. e[r] = e[o];
  45131. for (var g = o * i, m = r * i, p = 0; p !== i; ++p)
  45132. t[m + p] = t[g + p]
  45133. }
  45134. ++r
  45135. }
  45136. }
  45137. return r !== e.length && (this.times = n.AnimationUtils.arraySlice(e, 0, r),
  45138. this.values = n.AnimationUtils.arraySlice(t, 0, r * i)),
  45139. this
  45140. }
  45141. },
  45142. Object.assign(n.KeyframeTrack, {
  45143. parse: function(e) {
  45144. if (void 0 === e.type)
  45145. throw new Error("track type undefined, can not parse");
  45146. var t = n.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  45147. if (void 0 === e.times) {
  45148. console.warn("legacy JSON format detected, converting");
  45149. var i = []
  45150. , r = [];
  45151. n.AnimationUtils.flattenJSON(e.keys, i, r, "value"),
  45152. e.times = i,
  45153. e.values = r
  45154. }
  45155. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  45156. },
  45157. toJSON: function(e) {
  45158. var t, i = e.constructor;
  45159. if (void 0 !== i.toJSON)
  45160. t = i.toJSON(e);
  45161. else {
  45162. t = {
  45163. name: e.name,
  45164. times: n.AnimationUtils.convertArray(e.times, Array),
  45165. values: n.AnimationUtils.convertArray(e.values, Array)
  45166. };
  45167. var r = e.getInterpolation();
  45168. r !== e.DefaultInterpolation && (t.interpolation = r)
  45169. }
  45170. return t.type = e.ValueTypeName,
  45171. t
  45172. },
  45173. _getTrackTypeForValueTypeName: function(e) {
  45174. switch (e.toLowerCase()) {
  45175. case "scalar":
  45176. case "double":
  45177. case "float":
  45178. case "number":
  45179. case "integer":
  45180. return n.NumberKeyframeTrack;
  45181. case "vector":
  45182. case "vector2":
  45183. case "vector3":
  45184. case "vector4":
  45185. return n.VectorKeyframeTrack;
  45186. case "color":
  45187. return n.ColorKeyframeTrack;
  45188. case "quaternion":
  45189. return n.QuaternionKeyframeTrack;
  45190. case "bool":
  45191. case "boolean":
  45192. return n.BooleanKeyframeTrack;
  45193. case "string":
  45194. return n.StringKeyframeTrack
  45195. }
  45196. throw new Error("Unsupported typeName: " + e)
  45197. }
  45198. }),
  45199. n.PropertyBinding = function(e, t, i) {
  45200. this.path = t,
  45201. this.parsedPath = i || n.PropertyBinding.parseTrackName(t),
  45202. this.node = n.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  45203. this.rootNode = e
  45204. }
  45205. ,
  45206. n.PropertyBinding.prototype = {
  45207. constructor: n.PropertyBinding,
  45208. getValue: function(e, t) {
  45209. this.bind(),
  45210. this.getValue(e, t)
  45211. },
  45212. setValue: function(e, t) {
  45213. this.bind(),
  45214. this.setValue(e, t)
  45215. },
  45216. bind: function() {
  45217. var e = this.node
  45218. , t = this.parsedPath
  45219. , i = t.objectName
  45220. , r = t.propertyName
  45221. , o = t.propertyIndex;
  45222. if (e || (e = n.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  45223. this.node = e),
  45224. this.getValue = this._getValue_unavailable,
  45225. this.setValue = this._setValue_unavailable,
  45226. !e)
  45227. return void console.error(" trying to update node for track: " + this.path + " but it wasn't found.");
  45228. if (i) {
  45229. var a = t.objectIndex;
  45230. switch (i) {
  45231. case "materials":
  45232. if (!e.material)
  45233. return void console.error(" can not bind to material as node does not have a material", this);
  45234. if (!e.material.materials)
  45235. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  45236. e = e.material.materials;
  45237. break;
  45238. case "bones":
  45239. if (!e.skeleton)
  45240. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  45241. e = e.skeleton.bones;
  45242. for (var s = 0; s < e.length; s++)
  45243. if (e[s].name === a) {
  45244. a = s;
  45245. break
  45246. }
  45247. break;
  45248. default:
  45249. if (void 0 === e[i])
  45250. return void console.error(" can not bind to objectName of node, undefined", this);
  45251. e = e[i]
  45252. }
  45253. if (void 0 !== a) {
  45254. if (void 0 === e[a])
  45255. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  45256. e = e[a]
  45257. }
  45258. }
  45259. var l = e[r];
  45260. if (!l) {
  45261. var c = t.nodeName;
  45262. return void console.error(" trying to update property for track: " + c + "." + r + " but it wasn't found.", e)
  45263. }
  45264. var h = this.Versioning.None;
  45265. void 0 !== e.needsUpdate ? (h = this.Versioning.NeedsUpdate,
  45266. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (h = this.Versioning.MatrixWorldNeedsUpdate,
  45267. this.targetObject = e);
  45268. var u = this.BindingType.Direct;
  45269. if (void 0 !== o) {
  45270. if ("morphTargetInfluences" === r) {
  45271. if (!e.geometry)
  45272. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  45273. if (!e.geometry.morphTargets)
  45274. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  45275. for (var s = 0; s < this.node.geometry.morphTargets.length; s++)
  45276. if (e.geometry.morphTargets[s].name === o) {
  45277. o = s;
  45278. break
  45279. }
  45280. }
  45281. u = this.BindingType.ArrayElement,
  45282. this.resolvedProperty = l,
  45283. this.propertyIndex = o
  45284. } else
  45285. void 0 !== l.fromArray && void 0 !== l.toArray ? (u = this.BindingType.HasFromToArray,
  45286. this.resolvedProperty = l) : void 0 !== l.length ? (u = this.BindingType.EntireArray,
  45287. this.resolvedProperty = l) : this.propertyName = r;
  45288. this.getValue = this.GetterByBindingType[u],
  45289. this.setValue = this.SetterByBindingTypeAndVersioning[u][h]
  45290. },
  45291. unbind: function() {
  45292. this.node = null,
  45293. this.getValue = this._getValue_unbound,
  45294. this.setValue = this._setValue_unbound
  45295. }
  45296. },
  45297. Object.assign(n.PropertyBinding.prototype, {
  45298. _getValue_unavailable: function() {},
  45299. _setValue_unavailable: function() {},
  45300. _getValue_unbound: n.PropertyBinding.prototype.getValue,
  45301. _setValue_unbound: n.PropertyBinding.prototype.setValue,
  45302. BindingType: {
  45303. Direct: 0,
  45304. EntireArray: 1,
  45305. ArrayElement: 2,
  45306. HasFromToArray: 3
  45307. },
  45308. Versioning: {
  45309. None: 0,
  45310. NeedsUpdate: 1,
  45311. MatrixWorldNeedsUpdate: 2
  45312. },
  45313. GetterByBindingType: [function(e, t) {
  45314. e[t] = this.node[this.propertyName]
  45315. }
  45316. , function(e, t) {
  45317. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  45318. e[t++] = i[n]
  45319. }
  45320. , function(e, t) {
  45321. e[t] = this.resolvedProperty[this.propertyIndex]
  45322. }
  45323. , function(e, t) {
  45324. this.resolvedProperty.toArray(e, t)
  45325. }
  45326. ],
  45327. SetterByBindingTypeAndVersioning: [[function(e, t) {
  45328. this.node[this.propertyName] = e[t]
  45329. }
  45330. , function(e, t) {
  45331. this.node[this.propertyName] = e[t],
  45332. this.targetObject.needsUpdate = !0
  45333. }
  45334. , function(e, t) {
  45335. this.node[this.propertyName] = e[t],
  45336. this.targetObject.matrixWorldNeedsUpdate = !0
  45337. }
  45338. ], [function(e, t) {
  45339. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  45340. i[n] = e[t++]
  45341. }
  45342. , function(e, t) {
  45343. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  45344. i[n] = e[t++];
  45345. this.targetObject.needsUpdate = !0
  45346. }
  45347. , function(e, t) {
  45348. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  45349. i[n] = e[t++];
  45350. this.targetObject.matrixWorldNeedsUpdate = !0
  45351. }
  45352. ], [function(e, t) {
  45353. this.resolvedProperty[this.propertyIndex] = e[t]
  45354. }
  45355. , function(e, t) {
  45356. this.resolvedProperty[this.propertyIndex] = e[t],
  45357. this.targetObject.needsUpdate = !0
  45358. }
  45359. , function(e, t) {
  45360. this.resolvedProperty[this.propertyIndex] = e[t],
  45361. this.targetObject.matrixWorldNeedsUpdate = !0
  45362. }
  45363. ], [function(e, t) {
  45364. this.resolvedProperty.fromArray(e, t)
  45365. }
  45366. , function(e, t) {
  45367. this.resolvedProperty.fromArray(e, t),
  45368. this.targetObject.needsUpdate = !0
  45369. }
  45370. , function(e, t) {
  45371. this.resolvedProperty.fromArray(e, t),
  45372. this.targetObject.matrixWorldNeedsUpdate = !0
  45373. }
  45374. ]]
  45375. }),
  45376. n.PropertyBinding.Composite = function(e, t, i) {
  45377. var r = i || n.PropertyBinding.parseTrackName(t);
  45378. this._targetGroup = e,
  45379. this._bindings = e.subscribe_(t, r)
  45380. }
  45381. ,
  45382. n.PropertyBinding.Composite.prototype = {
  45383. constructor: n.PropertyBinding.Composite,
  45384. getValue: function(e, t) {
  45385. this.bind();
  45386. var i = this._targetGroup.nCachedObjects_
  45387. , n = this._bindings[i];
  45388. void 0 !== n && n.getValue(e, t)
  45389. },
  45390. setValue: function(e, t) {
  45391. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  45392. i[n].setValue(e, t)
  45393. },
  45394. bind: function() {
  45395. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  45396. e[t].bind()
  45397. },
  45398. unbind: function() {
  45399. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  45400. e[t].unbind()
  45401. }
  45402. },
  45403. n.PropertyBinding.create = function(e, t, i) {
  45404. return e instanceof n.AnimationObjectGroup ? new n.PropertyBinding.Composite(e,t,i) : new n.PropertyBinding(e,t,i)
  45405. }
  45406. ,
  45407. n.PropertyBinding.parseTrackName = function(e) {
  45408. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  45409. , i = t.exec(e);
  45410. if (!i)
  45411. throw new Error("cannot parse trackName at all: " + e);
  45412. i.index === t.lastIndex && t.lastIndex++;
  45413. var n = {
  45414. nodeName: i[3],
  45415. objectName: i[5],
  45416. objectIndex: i[7],
  45417. propertyName: i[9],
  45418. propertyIndex: i[11]
  45419. };
  45420. if (null === n.propertyName || 0 === n.propertyName.length)
  45421. throw new Error("can not parse propertyName from trackName: " + e);
  45422. return n
  45423. }
  45424. ,
  45425. n.PropertyBinding.findNode = function(e, t) {
  45426. if (!t || "" === t || "root" === t || "." === t || t === -1 || t === e.name || t === e.uuid)
  45427. return e;
  45428. if (e.skeleton) {
  45429. var i = function(e) {
  45430. for (var i = 0; i < e.bones.length; i++) {
  45431. var n = e.bones[i];
  45432. if (n.name === t)
  45433. return n
  45434. }
  45435. return null
  45436. }
  45437. , n = i(e.skeleton);
  45438. if (n)
  45439. return n
  45440. }
  45441. if (e.children) {
  45442. var r = function(e) {
  45443. for (var i = 0; i < e.length; i++) {
  45444. var n = e[i];
  45445. if (n.name === t || n.uuid === t)
  45446. return n;
  45447. var o = r(n.children);
  45448. if (o)
  45449. return o
  45450. }
  45451. return null
  45452. }
  45453. , o = r(e.children);
  45454. if (o)
  45455. return o
  45456. }
  45457. return null
  45458. }
  45459. ,
  45460. n.PropertyMixer = function(e, t, i) {
  45461. this.binding = e,
  45462. this.valueSize = i;
  45463. var n, r = Float64Array;
  45464. switch (t) {
  45465. case "quaternion":
  45466. n = this._slerp;
  45467. break;
  45468. case "string":
  45469. case "bool":
  45470. r = Array,
  45471. n = this._select;
  45472. break;
  45473. default:
  45474. n = this._lerp
  45475. }
  45476. this.buffer = new r(4 * i),
  45477. this._mixBufferRegion = n,
  45478. this.cumulativeWeight = 0,
  45479. this.useCount = 0,
  45480. this.referenceCount = 0
  45481. }
  45482. ,
  45483. n.PropertyMixer.prototype = {
  45484. constructor: n.PropertyMixer,
  45485. accumulate: function(e, t) {
  45486. var i = this.buffer
  45487. , n = this.valueSize
  45488. , r = e * n + n
  45489. , o = this.cumulativeWeight;
  45490. if (0 === o) {
  45491. for (var a = 0; a !== n; ++a)
  45492. i[r + a] = i[a];
  45493. o = t
  45494. } else {
  45495. o += t;
  45496. var s = t / o;
  45497. this._mixBufferRegion(i, r, 0, s, n)
  45498. }
  45499. this.cumulativeWeight = o
  45500. },
  45501. apply: function(e) {
  45502. var t = this.valueSize
  45503. , i = this.buffer
  45504. , n = e * t + t
  45505. , r = this.cumulativeWeight
  45506. , o = this.binding;
  45507. if (this.cumulativeWeight = 0,
  45508. r < 1) {
  45509. var a = 3 * t;
  45510. this._mixBufferRegion(i, n, a, 1 - r, t)
  45511. }
  45512. for (var s = t, l = t + t; s !== l; ++s)
  45513. if (i[s] !== i[s + t]) {
  45514. o.setValue(i, n);
  45515. break
  45516. }
  45517. },
  45518. saveOriginalState: function() {
  45519. var e = this.binding
  45520. , t = this.buffer
  45521. , i = this.valueSize
  45522. , n = 3 * i;
  45523. e.getValue(t, n);
  45524. for (var r = i, o = n; r !== o; ++r)
  45525. t[r] = t[n + r % i];
  45526. this.cumulativeWeight = 0
  45527. },
  45528. restoreOriginalState: function() {
  45529. var e = 3 * this.valueSize;
  45530. this.binding.setValue(this.buffer, e)
  45531. },
  45532. _select: function(e, t, i, n, r) {
  45533. if (n >= .5)
  45534. for (var o = 0; o !== r; ++o)
  45535. e[t + o] = e[i + o]
  45536. },
  45537. _slerp: function(e, t, i, r, o) {
  45538. n.Quaternion.slerpFlat(e, t, e, t, e, i, r)
  45539. },
  45540. _lerp: function(e, t, i, n, r) {
  45541. for (var o = 1 - n, a = 0; a !== r; ++a) {
  45542. var s = t + a;
  45543. e[s] = e[s] * o + e[i + a] * n
  45544. }
  45545. }
  45546. },
  45547. n.BooleanKeyframeTrack = function(e, t, i) {
  45548. n.KeyframeTrack.call(this, e, t, i)
  45549. }
  45550. ,
  45551. n.BooleanKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  45552. constructor: n.BooleanKeyframeTrack,
  45553. ValueTypeName: "bool",
  45554. ValueBufferType: Array,
  45555. DefaultInterpolation: n.IntepolateDiscrete,
  45556. InterpolantFactoryMethodLinear: void 0,
  45557. InterpolantFactoryMethodSmooth: void 0
  45558. }),
  45559. n.NumberKeyframeTrack = function(e, t, i, r) {
  45560. n.KeyframeTrack.call(this, e, t, i, r)
  45561. }
  45562. ,
  45563. n.NumberKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  45564. constructor: n.NumberKeyframeTrack,
  45565. ValueTypeName: "number"
  45566. }),
  45567. n.QuaternionKeyframeTrack = function(e, t, i, r) {
  45568. n.KeyframeTrack.call(this, e, t, i, r)
  45569. }
  45570. ,
  45571. n.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  45572. constructor: n.QuaternionKeyframeTrack,
  45573. ValueTypeName: "quaternion",
  45574. DefaultInterpolation: n.InterpolateLinear,
  45575. InterpolantFactoryMethodLinear: function(e) {
  45576. return new n.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  45577. },
  45578. InterpolantFactoryMethodSmooth: void 0
  45579. }),
  45580. n.StringKeyframeTrack = function(e, t, i, r) {
  45581. n.KeyframeTrack.call(this, e, t, i, r)
  45582. }
  45583. ,
  45584. n.StringKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  45585. constructor: n.StringKeyframeTrack,
  45586. ValueTypeName: "string",
  45587. ValueBufferType: Array,
  45588. DefaultInterpolation: n.IntepolateDiscrete,
  45589. InterpolantFactoryMethodLinear: void 0,
  45590. InterpolantFactoryMethodSmooth: void 0
  45591. }),
  45592. n.VectorKeyframeTrack = function(e, t, i, r) {
  45593. n.KeyframeTrack.call(this, e, t, i, r)
  45594. }
  45595. ,
  45596. n.VectorKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  45597. constructor: n.VectorKeyframeTrack,
  45598. ValueTypeName: "vector"
  45599. }),
  45600. n.Audio = function(e) {
  45601. n.Object3D.call(this),
  45602. this.type = "Audio",
  45603. this.context = e.context,
  45604. this.source = this.context.createBufferSource(),
  45605. this.source.onended = this.onEnded.bind(this),
  45606. this.gain = this.context.createGain(),
  45607. this.gain.connect(e.getInput()),
  45608. this.autoplay = !1,
  45609. this.startTime = 0,
  45610. this.playbackRate = 1,
  45611. this.isPlaying = !1,
  45612. this.hasPlaybackControl = !0,
  45613. this.sourceType = "empty",
  45614. this.filter = null
  45615. }
  45616. ,
  45617. n.Audio.prototype = Object.create(n.Object3D.prototype),
  45618. n.Audio.prototype.constructor = n.Audio,
  45619. n.Audio.prototype.getOutput = function() {
  45620. return this.gain
  45621. }
  45622. ,
  45623. n.Audio.prototype.load = function(e) {
  45624. var t = new n.AudioBuffer(this.context);
  45625. return t.load(e),
  45626. this.setBuffer(t),
  45627. this
  45628. }
  45629. ,
  45630. n.Audio.prototype.setNodeSource = function(e) {
  45631. return this.hasPlaybackControl = !1,
  45632. this.sourceType = "audioNode",
  45633. this.source = e,
  45634. this.connect(),
  45635. this
  45636. }
  45637. ,
  45638. n.Audio.prototype.setBuffer = function(e) {
  45639. var t = this;
  45640. return e.onReady(function(e) {
  45641. t.source.buffer = e,
  45642. t.sourceType = "buffer",
  45643. t.autoplay && t.play()
  45644. }),
  45645. this
  45646. }
  45647. ,
  45648. n.Audio.prototype.play = function() {
  45649. if (this.isPlaying === !0)
  45650. return void console.warn("THREE.Audio: Audio is already playing.");
  45651. if (this.hasPlaybackControl === !1)
  45652. return void console.warn("THREE.Audio: this Audio has no playback control.");
  45653. var e = this.context.createBufferSource();
  45654. e.buffer = this.source.buffer,
  45655. e.loop = this.source.loop,
  45656. e.onended = this.source.onended,
  45657. e.start(0, this.startTime),
  45658. e.playbackRate.value = this.playbackRate,
  45659. this.isPlaying = !0,
  45660. this.source = e,
  45661. this.connect()
  45662. }
  45663. ,
  45664. n.Audio.prototype.pause = function() {
  45665. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  45666. void (this.startTime = this.context.currentTime))
  45667. }
  45668. ,
  45669. n.Audio.prototype.stop = function() {
  45670. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  45671. void (this.startTime = 0))
  45672. }
  45673. ,
  45674. n.Audio.prototype.connect = function() {
  45675. null !== this.filter ? (this.source.connect(this.filter),
  45676. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  45677. }
  45678. ,
  45679. n.Audio.prototype.disconnect = function() {
  45680. null !== this.filter ? (this.source.disconnect(this.filter),
  45681. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  45682. }
  45683. ,
  45684. n.Audio.prototype.getFilter = function() {
  45685. return this.filter
  45686. }
  45687. ,
  45688. n.Audio.prototype.setFilter = function(e) {
  45689. void 0 === e && (e = null),
  45690. this.isPlaying === !0 ? (this.disconnect(),
  45691. this.filter = e,
  45692. this.connect()) : this.filter = e
  45693. }
  45694. ,
  45695. n.Audio.prototype.setPlaybackRate = function(e) {
  45696. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  45697. void (this.isPlaying === !0 && (this.source.playbackRate.value = this.playbackRate)))
  45698. }
  45699. ,
  45700. n.Audio.prototype.getPlaybackRate = function() {
  45701. return this.playbackRate
  45702. }
  45703. ,
  45704. n.Audio.prototype.onEnded = function() {
  45705. this.isPlaying = !1
  45706. }
  45707. ,
  45708. n.Audio.prototype.setLoop = function(e) {
  45709. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  45710. }
  45711. ,
  45712. n.Audio.prototype.getLoop = function() {
  45713. return this.hasPlaybackControl === !1 ? (console.warn("THREE.Audio: this Audio has no playback control."),
  45714. !1) : this.source.loop
  45715. }
  45716. ,
  45717. n.Audio.prototype.setVolume = function(e) {
  45718. this.gain.gain.value = e
  45719. }
  45720. ,
  45721. n.Audio.prototype.getVolume = function() {
  45722. return this.gain.gain.value
  45723. }
  45724. ,
  45725. n.AudioAnalyser = function(e, t) {
  45726. this.analyser = e.context.createAnalyser(),
  45727. this.analyser.fftSize = void 0 !== t ? t : 2048,
  45728. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  45729. e.getOutput().connect(this.analyser)
  45730. }
  45731. ,
  45732. n.AudioAnalyser.prototype = {
  45733. constructor: n.AudioAnalyser,
  45734. getData: function() {
  45735. return this.analyser.getByteFrequencyData(this.data),
  45736. this.data
  45737. }
  45738. },
  45739. n.AudioBuffer = function(e) {
  45740. this.context = e,
  45741. this.ready = !1,
  45742. this.readyCallbacks = []
  45743. }
  45744. ,
  45745. n.AudioBuffer.prototype.load = function(e) {
  45746. var t = this
  45747. , i = new XMLHttpRequest;
  45748. return i.open("GET", e, !0),
  45749. i.responseType = "arraybuffer",
  45750. i.onload = function(e) {
  45751. t.context.decodeAudioData(this.response, function(e) {
  45752. t.buffer = e,
  45753. t.ready = !0;
  45754. for (var i = 0; i < t.readyCallbacks.length; i++)
  45755. t.readyCallbacks[i](t.buffer);
  45756. t.readyCallbacks = []
  45757. })
  45758. }
  45759. ,
  45760. i.send(),
  45761. this
  45762. }
  45763. ,
  45764. n.AudioBuffer.prototype.onReady = function(e) {
  45765. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  45766. }
  45767. ,
  45768. n.PositionalAudio = function(e) {
  45769. n.Audio.call(this, e),
  45770. this.panner = this.context.createPanner(),
  45771. this.panner.connect(this.gain)
  45772. }
  45773. ,
  45774. n.PositionalAudio.prototype = Object.create(n.Audio.prototype),
  45775. n.PositionalAudio.prototype.constructor = n.PositionalAudio,
  45776. n.PositionalAudio.prototype.getOutput = function() {
  45777. return this.panner
  45778. }
  45779. ,
  45780. n.PositionalAudio.prototype.setRefDistance = function(e) {
  45781. this.panner.refDistance = e
  45782. }
  45783. ,
  45784. n.PositionalAudio.prototype.getRefDistance = function() {
  45785. return this.panner.refDistance
  45786. }
  45787. ,
  45788. n.PositionalAudio.prototype.setRolloffFactor = function(e) {
  45789. this.panner.rolloffFactor = e
  45790. }
  45791. ,
  45792. n.PositionalAudio.prototype.getRolloffFactor = function() {
  45793. return this.panner.rolloffFactor
  45794. }
  45795. ,
  45796. n.PositionalAudio.prototype.setDistanceModel = function(e) {
  45797. this.panner.distanceModel = e
  45798. }
  45799. ,
  45800. n.PositionalAudio.prototype.getDistanceModel = function() {
  45801. return this.panner.distanceModel
  45802. }
  45803. ,
  45804. n.PositionalAudio.prototype.setMaxDistance = function(e) {
  45805. this.panner.maxDistance = e
  45806. }
  45807. ,
  45808. n.PositionalAudio.prototype.getMaxDistance = function() {
  45809. return this.panner.maxDistance
  45810. }
  45811. ,
  45812. n.PositionalAudio.prototype.updateMatrixWorld = function() {
  45813. var e = new n.Vector3;
  45814. return function(t) {
  45815. n.Object3D.prototype.updateMatrixWorld.call(this, t),
  45816. e.setFromMatrixPosition(this.matrixWorld),
  45817. this.panner.setPosition(e.x, e.y, e.z)
  45818. }
  45819. }(),
  45820. n.AudioListener = function() {
  45821. n.Object3D.call(this),
  45822. this.type = "AudioListener",
  45823. this.context = new (window.AudioContext || window.webkitAudioContext),
  45824. this.gain = this.context.createGain(),
  45825. this.gain.connect(this.context.destination),
  45826. this.filter = null
  45827. }
  45828. ,
  45829. n.AudioListener.prototype = Object.create(n.Object3D.prototype),
  45830. n.AudioListener.prototype.constructor = n.AudioListener,
  45831. n.AudioListener.prototype.getInput = function() {
  45832. return this.gain
  45833. }
  45834. ,
  45835. n.AudioListener.prototype.removeFilter = function() {
  45836. null !== this.filter && (this.gain.disconnect(this.filter),
  45837. this.filter.disconnect(this.context.destination),
  45838. this.gain.connect(this.context.destination),
  45839. this.filter = null)
  45840. }
  45841. ,
  45842. n.AudioListener.prototype.setFilter = function(e) {
  45843. null !== this.filter ? (this.gain.disconnect(this.filter),
  45844. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  45845. this.filter = e,
  45846. this.gain.connect(this.filter),
  45847. this.filter.connect(this.context.destination)
  45848. }
  45849. ,
  45850. n.AudioListener.prototype.getFilter = function() {
  45851. return this.filter
  45852. }
  45853. ,
  45854. n.AudioListener.prototype.setMasterVolume = function(e) {
  45855. this.gain.gain.value = e
  45856. }
  45857. ,
  45858. n.AudioListener.prototype.getMasterVolume = function() {
  45859. return this.gain.gain.value
  45860. }
  45861. ,
  45862. n.AudioListener.prototype.updateMatrixWorld = function() {
  45863. var e = new n.Vector3
  45864. , t = new n.Quaternion
  45865. , i = new n.Vector3
  45866. , r = new n.Vector3;
  45867. return function(o) {
  45868. n.Object3D.prototype.updateMatrixWorld.call(this, o);
  45869. var a = this.context.listener
  45870. , s = this.up;
  45871. this.matrixWorld.decompose(e, t, i),
  45872. r.set(0, 0, -1).applyQuaternion(t),
  45873. a.setPosition(e.x, e.y, e.z),
  45874. a.setOrientation(r.x, r.y, r.z, s.x, s.y, s.z)
  45875. }
  45876. }(),
  45877. n.Camera = function() {
  45878. n.Object3D.call(this),
  45879. this.type = "Camera",
  45880. this.matrixWorldInverse = new n.Matrix4,
  45881. this.projectionMatrix = new n.Matrix4
  45882. }
  45883. ,
  45884. n.Camera.prototype = Object.create(n.Object3D.prototype),
  45885. n.Camera.prototype.constructor = n.Camera,
  45886. n.Camera.prototype.getWorldDirection = function() {
  45887. var e = new n.Quaternion;
  45888. return function(t) {
  45889. var i = t || new n.Vector3;
  45890. return this.getWorldQuaternion(e),
  45891. i.set(0, 0, -1).applyQuaternion(e)
  45892. }
  45893. }(),
  45894. n.Camera.prototype.lookAt = function() {
  45895. var e = new n.Matrix4;
  45896. return function(t) {
  45897. e.lookAt(this.position, t, this.up),
  45898. this.quaternion.setFromRotationMatrix(e)
  45899. }
  45900. }(),
  45901. n.Camera.prototype.clone = function() {
  45902. return (new this.constructor).copy(this)
  45903. }
  45904. ,
  45905. n.Camera.prototype.copy = function(e) {
  45906. return n.Object3D.prototype.copy.call(this, e),
  45907. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  45908. this.projectionMatrix.copy(e.projectionMatrix),
  45909. this
  45910. }
  45911. ,
  45912. n.CubeCamera = function(e, t, i) {
  45913. n.Object3D.call(this),
  45914. this.type = "CubeCamera";
  45915. var r = 90
  45916. , o = 1
  45917. , a = new n.PerspectiveCamera(r,o,e,t);
  45918. a.up.set(0, -1, 0),
  45919. a.lookAt(new n.Vector3(1,0,0)),
  45920. this.add(a);
  45921. var s = new n.PerspectiveCamera(r,o,e,t);
  45922. s.up.set(0, -1, 0),
  45923. s.lookAt(new n.Vector3(-1,0,0)),
  45924. this.add(s);
  45925. var l = new n.PerspectiveCamera(r,o,e,t);
  45926. l.up.set(0, 0, 1),
  45927. l.lookAt(new n.Vector3(0,1,0)),
  45928. this.add(l);
  45929. var c = new n.PerspectiveCamera(r,o,e,t);
  45930. c.up.set(0, 0, -1),
  45931. c.lookAt(new n.Vector3(0,-1,0)),
  45932. this.add(c);
  45933. var h = new n.PerspectiveCamera(r,o,e,t);
  45934. h.up.set(0, -1, 0),
  45935. h.lookAt(new n.Vector3(0,0,1)),
  45936. this.add(h);
  45937. var u = new n.PerspectiveCamera(r,o,e,t);
  45938. u.up.set(0, -1, 0),
  45939. u.lookAt(new n.Vector3(0,0,-1)),
  45940. this.add(u);
  45941. var d = {
  45942. format: n.RGBFormat,
  45943. magFilter: n.LinearFilter,
  45944. minFilter: n.LinearFilter
  45945. };
  45946. this.renderTarget = new n.WebGLRenderTargetCube(i,i,d),
  45947. this.updateCubeMap = function(e, t) {
  45948. null === this.parent && this.updateMatrixWorld();
  45949. var i = this.renderTarget
  45950. , n = i.texture.generateMipmaps;
  45951. i.texture.generateMipmaps = !1,
  45952. i.activeCubeFace = 0,
  45953. e.render(t, a, i),
  45954. i.activeCubeFace = 1,
  45955. e.render(t, s, i),
  45956. i.activeCubeFace = 2,
  45957. e.render(t, l, i),
  45958. i.activeCubeFace = 3,
  45959. e.render(t, c, i),
  45960. i.activeCubeFace = 4,
  45961. e.render(t, h, i),
  45962. i.texture.generateMipmaps = n,
  45963. i.activeCubeFace = 5,
  45964. e.render(t, u, i),
  45965. e.setRenderTarget(null)
  45966. }
  45967. }
  45968. ,
  45969. n.CubeCamera.prototype = Object.create(n.Object3D.prototype),
  45970. n.CubeCamera.prototype.constructor = n.CubeCamera,
  45971. n.OrthographicCamera = function(e, t, i, r, o, a) {
  45972. n.Camera.call(this),
  45973. this.type = "OrthographicCamera",
  45974. this.zoom = 1,
  45975. this.left = e,
  45976. this.right = t,
  45977. this.top = i,
  45978. this.bottom = r,
  45979. this.near = void 0 !== o ? o : .1,
  45980. this.far = void 0 !== a ? a : 2e3,
  45981. this.updateProjectionMatrix()
  45982. }
  45983. ,
  45984. n.OrthographicCamera.prototype = Object.create(n.Camera.prototype),
  45985. n.OrthographicCamera.prototype.constructor = n.OrthographicCamera,
  45986. n.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  45987. var e = (this.right - this.left) / (2 * this.zoom)
  45988. , t = (this.top - this.bottom) / (2 * this.zoom)
  45989. , i = (this.right + this.left) / 2
  45990. , n = (this.top + this.bottom) / 2;
  45991. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  45992. }
  45993. ,
  45994. n.OrthographicCamera.prototype.copy = function(e) {
  45995. return n.Camera.prototype.copy.call(this, e),
  45996. this.left = e.left,
  45997. this.right = e.right,
  45998. this.top = e.top,
  45999. this.bottom = e.bottom,
  46000. this.near = e.near,
  46001. this.far = e.far,
  46002. this.zoom = e.zoom,
  46003. this
  46004. }
  46005. ,
  46006. n.OrthographicCamera.prototype.toJSON = function(e) {
  46007. var t = n.Object3D.prototype.toJSON.call(this, e);
  46008. return t.object.zoom = this.zoom,
  46009. t.object.left = this.left,
  46010. t.object.right = this.right,
  46011. t.object.top = this.top,
  46012. t.object.bottom = this.bottom,
  46013. t.object.near = this.near,
  46014. t.object.far = this.far,
  46015. t
  46016. }
  46017. ,
  46018. n.PerspectiveCamera = function(e, t, i, r) {
  46019. n.Camera.call(this),
  46020. this.type = "PerspectiveCamera",
  46021. this.focalLength = 10,
  46022. this.zoom = 1,
  46023. this.fov = void 0 !== e ? e : 50,
  46024. this.aspect = void 0 !== t ? t : 1,
  46025. this.near = void 0 !== i ? i : .1,
  46026. this.far = void 0 !== r ? r : 2e3,
  46027. this.updateProjectionMatrix()
  46028. }
  46029. ,
  46030. n.PerspectiveCamera.prototype = Object.create(n.Camera.prototype),
  46031. n.PerspectiveCamera.prototype.constructor = n.PerspectiveCamera,
  46032. n.PerspectiveCamera.prototype.setLens = function(e, t) {
  46033. void 0 === t && (t = 24),
  46034. this.fov = 2 * n.Math.radToDeg(Math.atan(t / (2 * e))),
  46035. this.updateProjectionMatrix()
  46036. }
  46037. ,
  46038. n.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  46039. this.fullWidth = e,
  46040. this.fullHeight = t,
  46041. this.x = i,
  46042. this.y = n,
  46043. this.width = r,
  46044. this.height = o,
  46045. this.updateProjectionMatrix()
  46046. }
  46047. ,
  46048. n.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  46049. var e = n.Math.radToDeg(2 * Math.atan(Math.tan(.5 * n.Math.degToRad(this.fov)) / this.zoom));
  46050. if (this.fullWidth) {
  46051. var t = this.fullWidth / this.fullHeight
  46052. , i = Math.tan(n.Math.degToRad(.5 * e)) * this.near
  46053. , r = -i
  46054. , o = t * r
  46055. , a = t * i
  46056. , s = Math.abs(a - o)
  46057. , l = Math.abs(i - r);
  46058. this.projectionMatrix.makeFrustum(o + this.x * s / this.fullWidth, o + (this.x + this.width) * s / this.fullWidth, i - (this.y + this.height) * l / this.fullHeight, i - this.y * l / this.fullHeight, this.near, this.far)
  46059. } else
  46060. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  46061. }
  46062. ,
  46063. n.PerspectiveCamera.prototype.copy = function(e) {
  46064. return n.Camera.prototype.copy.call(this, e),
  46065. this.focalLength = e.focalLength,
  46066. this.zoom = e.zoom,
  46067. this.fov = e.fov,
  46068. this.aspect = e.aspect,
  46069. this.near = e.near,
  46070. this.far = e.far,
  46071. this
  46072. }
  46073. ,
  46074. n.PerspectiveCamera.prototype.toJSON = function(e) {
  46075. var t = n.Object3D.prototype.toJSON.call(this, e);
  46076. return t.object.focalLength = this.focalLength,
  46077. t.object.zoom = this.zoom,
  46078. t.object.fov = this.fov,
  46079. t.object.aspect = this.aspect,
  46080. t.object.near = this.near,
  46081. t.object.far = this.far,
  46082. t
  46083. }
  46084. ,
  46085. n.StereoCamera = function() {
  46086. this.type = "StereoCamera",
  46087. this.aspect = 1,
  46088. this.cameraL = new n.PerspectiveCamera,
  46089. this.cameraL.layers.enable(1),
  46090. this.cameraL.matrixAutoUpdate = !1,
  46091. this.cameraR = new n.PerspectiveCamera,
  46092. this.cameraR.layers.enable(2),
  46093. this.cameraR.matrixAutoUpdate = !1
  46094. }
  46095. ,
  46096. n.StereoCamera.prototype = {
  46097. constructor: n.StereoCamera,
  46098. update: function() {
  46099. var e, t, i, r, o, a = new n.Matrix4, s = new n.Matrix4;
  46100. return function(l) {
  46101. var c = e !== l.focalLength || t !== l.fov || i !== l.aspect * this.aspect || r !== l.near || o !== l.far;
  46102. if (c) {
  46103. e = l.focalLength,
  46104. t = l.fov,
  46105. i = l.aspect * this.aspect,
  46106. r = l.near,
  46107. o = l.far;
  46108. var h, u, d = l.projectionMatrix.clone(), p = .032, f = p * r / e, g = r * Math.tan(n.Math.degToRad(.5 * t));
  46109. s.elements[12] = -p,
  46110. a.elements[12] = p,
  46111. h = -g * i + f,
  46112. u = g * i + f,
  46113. d.elements[0] = 2 * r / (u - h),
  46114. d.elements[8] = (u + h) / (u - h),
  46115. this.cameraL.projectionMatrix.copy(d),
  46116. h = -g * i - f,
  46117. u = g * i - f,
  46118. d.elements[0] = 2 * r / (u - h),
  46119. d.elements[8] = (u + h) / (u - h),
  46120. this.cameraR.projectionMatrix.copy(d)
  46121. }
  46122. this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(s),
  46123. this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(a)
  46124. }
  46125. }()
  46126. },
  46127. n.Light = function(e, t) {
  46128. n.Object3D.call(this),
  46129. this.type = "Light",
  46130. this.color = new n.Color(e),
  46131. this.intensity = void 0 !== t ? t : 1,
  46132. this.receiveShadow = void 0
  46133. }
  46134. ,
  46135. n.Light.prototype = Object.create(n.Object3D.prototype),
  46136. n.Light.prototype.constructor = n.Light,
  46137. n.Light.prototype.copy = function(e) {
  46138. return n.Object3D.prototype.copy.call(this, e),
  46139. this.color.copy(e.color),
  46140. this.intensity = e.intensity,
  46141. this
  46142. }
  46143. ,
  46144. n.Light.prototype.toJSON = function(e) {
  46145. var t = n.Object3D.prototype.toJSON.call(this, e);
  46146. return t.object.color = this.color.getHex(),
  46147. t.object.intensity = this.intensity,
  46148. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  46149. void 0 !== this.distance && (t.object.distance = this.distance),
  46150. void 0 !== this.angle && (t.object.angle = this.angle),
  46151. void 0 !== this.decay && (t.object.decay = this.decay),
  46152. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  46153. t
  46154. }
  46155. ,
  46156. n.LightShadow = function(e) {
  46157. this.camera = e,
  46158. this.bias = 0,
  46159. this.radius = 1,
  46160. this.mapSize = new n.Vector2(512,512),
  46161. this.map = null,
  46162. this.matrix = new n.Matrix4
  46163. }
  46164. ,
  46165. n.LightShadow.prototype = {
  46166. constructor: n.LightShadow,
  46167. copy: function(e) {
  46168. return this.camera = e.camera.clone(),
  46169. this.bias = e.bias,
  46170. this.radius = e.radius,
  46171. this.mapSize.copy(e.mapSize),
  46172. this
  46173. },
  46174. clone: function() {
  46175. return (new this.constructor).copy(this)
  46176. }
  46177. },
  46178. n.AmbientLight = function(e, t) {
  46179. n.Light.call(this, e, t),
  46180. this.type = "AmbientLight",
  46181. this.castShadow = void 0
  46182. }
  46183. ,
  46184. n.AmbientLight.prototype = Object.create(n.Light.prototype),
  46185. n.AmbientLight.prototype.constructor = n.AmbientLight,
  46186. n.DirectionalLight = function(e, t) {
  46187. n.Light.call(this, e, t),
  46188. this.type = "DirectionalLight",
  46189. this.position.set(0, 1, 0),
  46190. this.updateMatrix(),
  46191. this.target = new n.Object3D,
  46192. this.shadow = new n.LightShadow(new n.OrthographicCamera(-5,5,5,-5,.5,500))
  46193. }
  46194. ,
  46195. n.DirectionalLight.prototype = Object.create(n.Light.prototype),
  46196. n.DirectionalLight.prototype.constructor = n.DirectionalLight,
  46197. n.DirectionalLight.prototype.copy = function(e) {
  46198. return n.Light.prototype.copy.call(this, e),
  46199. this.target = e.target.clone(),
  46200. this.shadow = e.shadow.clone(),
  46201. this
  46202. }
  46203. ,
  46204. n.HemisphereLight = function(e, t, i) {
  46205. n.Light.call(this, e, i),
  46206. this.type = "HemisphereLight",
  46207. this.castShadow = void 0,
  46208. this.position.set(0, 1, 0),
  46209. this.updateMatrix(),
  46210. this.groundColor = new n.Color(t)
  46211. }
  46212. ,
  46213. n.HemisphereLight.prototype = Object.create(n.Light.prototype),
  46214. n.HemisphereLight.prototype.constructor = n.HemisphereLight,
  46215. n.HemisphereLight.prototype.copy = function(e) {
  46216. return n.Light.prototype.copy.call(this, e),
  46217. this.groundColor.copy(e.groundColor),
  46218. this
  46219. }
  46220. ,
  46221. n.PointLight = function(e, t, i, r) {
  46222. n.Light.call(this, e, t),
  46223. this.type = "PointLight",
  46224. this.distance = void 0 !== i ? i : 0,
  46225. this.decay = void 0 !== r ? r : 1,
  46226. this.shadow = new n.LightShadow(new n.PerspectiveCamera(90,1,.5,500))
  46227. }
  46228. ,
  46229. n.PointLight.prototype = Object.create(n.Light.prototype),
  46230. n.PointLight.prototype.constructor = n.PointLight,
  46231. Object.defineProperty(n.PointLight.prototype, "power", {
  46232. get: function() {
  46233. return 4 * this.intensity * Math.PI
  46234. },
  46235. set: function(e) {
  46236. this.intensity = e / (4 * Math.PI)
  46237. }
  46238. }),
  46239. n.PointLight.prototype.copy = function(e) {
  46240. return n.Light.prototype.copy.call(this, e),
  46241. this.distance = e.distance,
  46242. this.decay = e.decay,
  46243. this.shadow = e.shadow.clone(),
  46244. this
  46245. }
  46246. ,
  46247. n.SpotLight = function(e, t, i, r, o, a) {
  46248. n.Light.call(this, e, t),
  46249. this.type = "SpotLight",
  46250. this.position.set(0, 1, 0),
  46251. this.updateMatrix(),
  46252. this.target = new n.Object3D,
  46253. this.distance = void 0 !== i ? i : 0,
  46254. this.angle = void 0 !== r ? r : Math.PI / 3,
  46255. this.penumbra = void 0 !== o ? o : 0,
  46256. this.decay = void 0 !== a ? a : 1,
  46257. this.shadow = new n.LightShadow(new n.PerspectiveCamera(50,1,.5,500))
  46258. }
  46259. ,
  46260. n.SpotLight.prototype = Object.create(n.Light.prototype),
  46261. n.SpotLight.prototype.constructor = n.SpotLight,
  46262. Object.defineProperty(n.SpotLight.prototype, "power", {
  46263. get: function() {
  46264. return this.intensity * Math.PI
  46265. },
  46266. set: function(e) {
  46267. this.intensity = e / Math.PI
  46268. }
  46269. }),
  46270. n.SpotLight.prototype.copy = function(e) {
  46271. return n.Light.prototype.copy.call(this, e),
  46272. this.distance = e.distance,
  46273. this.angle = e.angle,
  46274. this.penumbra = e.penumbra,
  46275. this.decay = e.decay,
  46276. this.target = e.target.clone(),
  46277. this.shadow = e.shadow.clone(),
  46278. this
  46279. }
  46280. ,
  46281. n.Cache = {
  46282. enabled: !1,
  46283. files: {},
  46284. add: function(e, t) {
  46285. this.enabled !== !1 && (this.files[e] = t)
  46286. },
  46287. get: function(e) {
  46288. if (this.enabled !== !1)
  46289. return this.files[e]
  46290. },
  46291. remove: function(e) {
  46292. delete this.files[e]
  46293. },
  46294. clear: function() {
  46295. this.files = {}
  46296. }
  46297. },
  46298. n.Loader = function() {
  46299. this.onLoadStart = function() {}
  46300. ,
  46301. this.onLoadProgress = function() {}
  46302. ,
  46303. this.onLoadComplete = function() {}
  46304. }
  46305. ,
  46306. n.Loader.prototype = {
  46307. constructor: n.Loader,
  46308. crossOrigin: void 0,
  46309. extractUrlBase: function(e) {
  46310. var t = e.split("/");
  46311. return 1 === t.length ? "./" : (t.pop(),
  46312. t.join("/") + "/")
  46313. },
  46314. initMaterials: function(e, t, i) {
  46315. for (var n = [], r = 0; r < e.length; ++r)
  46316. n[r] = this.createMaterial(e[r], t, i);
  46317. return n
  46318. },
  46319. createMaterial: function() {
  46320. var e, t, i;
  46321. return function(r, o, a) {
  46322. function s(e, i, r, s, c) {
  46323. var h, u = o + e, d = n.Loader.Handlers.get(u);
  46324. null !== d ? h = d.load(u) : (t.setCrossOrigin(a),
  46325. h = t.load(u)),
  46326. void 0 !== i && (h.repeat.fromArray(i),
  46327. 1 !== i[0] && (h.wrapS = n.RepeatWrapping),
  46328. 1 !== i[1] && (h.wrapT = n.RepeatWrapping)),
  46329. void 0 !== r && h.offset.fromArray(r),
  46330. void 0 !== s && ("repeat" === s[0] && (h.wrapS = n.RepeatWrapping),
  46331. "mirror" === s[0] && (h.wrapS = n.MirroredRepeatWrapping),
  46332. "repeat" === s[1] && (h.wrapT = n.RepeatWrapping),
  46333. "mirror" === s[1] && (h.wrapT = n.MirroredRepeatWrapping)),
  46334. void 0 !== c && (h.anisotropy = c);
  46335. var p = n.Math.generateUUID();
  46336. return l[p] = h,
  46337. p
  46338. }
  46339. void 0 === e && (e = new n.Color),
  46340. void 0 === t && (t = new n.TextureLoader),
  46341. void 0 === i && (i = new n.MaterialLoader);
  46342. var l = {}
  46343. , c = {
  46344. uuid: n.Math.generateUUID(),
  46345. type: "MeshLambertMaterial"
  46346. };
  46347. for (var h in r) {
  46348. var u = r[h];
  46349. switch (h) {
  46350. case "DbgColor":
  46351. case "DbgIndex":
  46352. case "opticalDensity":
  46353. case "illumination":
  46354. break;
  46355. case "DbgName":
  46356. c.name = u;
  46357. break;
  46358. case "blending":
  46359. c.blending = n[u];
  46360. break;
  46361. case "colorAmbient":
  46362. case "mapAmbient":
  46363. console.warn("THREE.Loader.createMaterial:", h, "is no longer supported.");
  46364. break;
  46365. case "colorDiffuse":
  46366. c.color = e.fromArray(u).getHex();
  46367. break;
  46368. case "colorSpecular":
  46369. c.specular = e.fromArray(u).getHex();
  46370. break;
  46371. case "colorEmissive":
  46372. c.emissive = e.fromArray(u).getHex();
  46373. break;
  46374. case "specularCoef":
  46375. c.shininess = u;
  46376. break;
  46377. case "shading":
  46378. "basic" === u.toLowerCase() && (c.type = "MeshBasicMaterial"),
  46379. "phong" === u.toLowerCase() && (c.type = "MeshPhongMaterial");
  46380. break;
  46381. case "mapDiffuse":
  46382. c.map = s(u, r.mapDiffuseRepeat, r.mapDiffuseOffset, r.mapDiffuseWrap, r.mapDiffuseAnisotropy);
  46383. break;
  46384. case "mapDiffuseRepeat":
  46385. case "mapDiffuseOffset":
  46386. case "mapDiffuseWrap":
  46387. case "mapDiffuseAnisotropy":
  46388. break;
  46389. case "mapLight":
  46390. c.lightMap = s(u, r.mapLightRepeat, r.mapLightOffset, r.mapLightWrap, r.mapLightAnisotropy);
  46391. break;
  46392. case "mapLightRepeat":
  46393. case "mapLightOffset":
  46394. case "mapLightWrap":
  46395. case "mapLightAnisotropy":
  46396. break;
  46397. case "mapAO":
  46398. c.aoMap = s(u, r.mapAORepeat, r.mapAOOffset, r.mapAOWrap, r.mapAOAnisotropy);
  46399. break;
  46400. case "mapAORepeat":
  46401. case "mapAOOffset":
  46402. case "mapAOWrap":
  46403. case "mapAOAnisotropy":
  46404. break;
  46405. case "mapBump":
  46406. c.bumpMap = s(u, r.mapBumpRepeat, r.mapBumpOffset, r.mapBumpWrap, r.mapBumpAnisotropy);
  46407. break;
  46408. case "mapBumpScale":
  46409. c.bumpScale = u;
  46410. break;
  46411. case "mapBumpRepeat":
  46412. case "mapBumpOffset":
  46413. case "mapBumpWrap":
  46414. case "mapBumpAnisotropy":
  46415. break;
  46416. case "mapNormal":
  46417. c.normalMap = s(u, r.mapNormalRepeat, r.mapNormalOffset, r.mapNormalWrap, r.mapNormalAnisotropy);
  46418. break;
  46419. case "mapNormalFactor":
  46420. c.normalScale = [u, u];
  46421. break;
  46422. case "mapNormalRepeat":
  46423. case "mapNormalOffset":
  46424. case "mapNormalWrap":
  46425. case "mapNormalAnisotropy":
  46426. break;
  46427. case "mapSpecular":
  46428. c.specularMap = s(u, r.mapSpecularRepeat, r.mapSpecularOffset, r.mapSpecularWrap, r.mapSpecularAnisotropy);
  46429. break;
  46430. case "mapSpecularRepeat":
  46431. case "mapSpecularOffset":
  46432. case "mapSpecularWrap":
  46433. case "mapSpecularAnisotropy":
  46434. break;
  46435. case "mapAlpha":
  46436. c.alphaMap = s(u, r.mapAlphaRepeat, r.mapAlphaOffset, r.mapAlphaWrap, r.mapAlphaAnisotropy);
  46437. break;
  46438. case "mapAlphaRepeat":
  46439. case "mapAlphaOffset":
  46440. case "mapAlphaWrap":
  46441. case "mapAlphaAnisotropy":
  46442. break;
  46443. case "flipSided":
  46444. c.side = n.BackSide;
  46445. break;
  46446. case "doubleSided":
  46447. c.side = n.DoubleSide;
  46448. break;
  46449. case "transparency":
  46450. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  46451. c.opacity = u;
  46452. break;
  46453. case "depthTest":
  46454. case "depthWrite":
  46455. case "colorWrite":
  46456. case "opacity":
  46457. case "reflectivity":
  46458. case "transparent":
  46459. case "visible":
  46460. case "wireframe":
  46461. c[h] = u;
  46462. break;
  46463. case "vertexColors":
  46464. u === !0 && (c.vertexColors = n.VertexColors),
  46465. "face" === u && (c.vertexColors = n.FaceColors);
  46466. break;
  46467. default:
  46468. console.error("THREE.Loader.createMaterial: Unsupported", h, u)
  46469. }
  46470. }
  46471. return "MeshBasicMaterial" === c.type && delete c.emissive,
  46472. "MeshPhongMaterial" !== c.type && delete c.specular,
  46473. c.opacity < 1 && (c.transparent = !0),
  46474. i.setTextures(l),
  46475. i.parse(c)
  46476. }
  46477. }()
  46478. },
  46479. n.Loader.Handlers = {
  46480. handlers: [],
  46481. add: function(e, t) {
  46482. this.handlers.push(e, t)
  46483. },
  46484. get: function(e) {
  46485. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  46486. var r = t[i]
  46487. , o = t[i + 1];
  46488. if (r.test(e))
  46489. return o
  46490. }
  46491. return null
  46492. }
  46493. },
  46494. n.XHRLoader = function(e) {
  46495. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  46496. }
  46497. ,
  46498. n.XHRLoader.prototype = {
  46499. constructor: n.XHRLoader,
  46500. load: function(e, t, i, r) {
  46501. void 0 !== this.path && (e = this.path + e);
  46502. var o = this
  46503. , a = n.Cache.get(e);
  46504. if (void 0 !== a)
  46505. return t && setTimeout(function() {
  46506. t(a)
  46507. }, 0),
  46508. a;
  46509. var s = new XMLHttpRequest;
  46510. return s.overrideMimeType("text/plain"),
  46511. s.open("GET", e, !0),
  46512. s.addEventListener("load", function(i) {
  46513. var a = i.target.response;
  46514. n.Cache.add(e, a),
  46515. 200 === this.status ? (t && t(a),
  46516. o.manager.itemEnd(e)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  46517. t && t(a),
  46518. o.manager.itemEnd(e)) : (r && r(i),
  46519. o.manager.itemError(e))
  46520. }, !1),
  46521. void 0 !== i && s.addEventListener("progress", function(e) {
  46522. i(e)
  46523. }, !1),
  46524. s.addEventListener("error", function(t) {
  46525. r && r(t),
  46526. o.manager.itemError(e)
  46527. }, !1),
  46528. void 0 !== this.responseType && (s.responseType = this.responseType),
  46529. void 0 !== this.withCredentials && (s.withCredentials = this.withCredentials),
  46530. s.send(null),
  46531. o.manager.itemStart(e),
  46532. s
  46533. },
  46534. setPath: function(e) {
  46535. this.path = e
  46536. },
  46537. setResponseType: function(e) {
  46538. this.responseType = e
  46539. },
  46540. setWithCredentials: function(e) {
  46541. this.withCredentials = e
  46542. }
  46543. },
  46544. n.FontLoader = function(e) {
  46545. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  46546. }
  46547. ,
  46548. n.FontLoader.prototype = {
  46549. constructor: n.FontLoader,
  46550. load: function(e, t, i, r) {
  46551. var o = new n.XHRLoader(this.manager);
  46552. o.load(e, function(e) {
  46553. t(new n.Font(JSON.parse(e.substring(65, e.length - 2))))
  46554. }, i, r)
  46555. }
  46556. },
  46557. n.ImageLoader = function(e) {
  46558. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  46559. }
  46560. ,
  46561. n.ImageLoader.prototype = {
  46562. constructor: n.ImageLoader,
  46563. load: function(e, t, i, r) {
  46564. void 0 !== this.path && (e = this.path + e);
  46565. var o = this
  46566. , a = n.Cache.get(e);
  46567. if (void 0 !== a)
  46568. return o.manager.itemStart(e),
  46569. t ? setTimeout(function() {
  46570. t(a),
  46571. o.manager.itemEnd(e)
  46572. }, 0) : o.manager.itemEnd(e),
  46573. a;
  46574. var s = document.createElement("img");
  46575. return s.addEventListener("load", function(i) {
  46576. n.Cache.add(e, this),
  46577. t && t(this),
  46578. o.manager.itemEnd(e)
  46579. }, !1),
  46580. void 0 !== i && s.addEventListener("progress", function(e) {
  46581. i(e)
  46582. }, !1),
  46583. s.addEventListener("error", function(t) {
  46584. r && r(t),
  46585. o.manager.itemError(e)
  46586. }, !1),
  46587. void 0 !== this.crossOrigin && (s.crossOrigin = this.crossOrigin),
  46588. o.manager.itemStart(e),
  46589. s.src = e,
  46590. s
  46591. },
  46592. setCrossOrigin: function(e) {
  46593. this.crossOrigin = e
  46594. },
  46595. setPath: function(e) {
  46596. this.path = e
  46597. }
  46598. },
  46599. n.JSONLoader = function(e) {
  46600. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  46601. e = void 0),
  46602. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  46603. this.withCredentials = !1
  46604. }
  46605. ,
  46606. n.JSONLoader.prototype = {
  46607. constructor: n.JSONLoader,
  46608. get statusDomElement() {
  46609. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  46610. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  46611. this._statusDomElement
  46612. },
  46613. load: function(e, t, i, r) {
  46614. var o = this
  46615. , a = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : n.Loader.prototype.extractUrlBase(e)
  46616. , s = new n.XHRLoader(this.manager);
  46617. s.setWithCredentials(this.withCredentials),
  46618. s.load(e, function(i) {
  46619. var n = JSON.parse(i)
  46620. , r = n.metadata;
  46621. if (void 0 !== r) {
  46622. var s = r.type;
  46623. if (void 0 !== s) {
  46624. if ("object" === s.toLowerCase())
  46625. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.ObjectLoader instead.");
  46626. if ("scene" === s.toLowerCase())
  46627. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.SceneLoader instead.")
  46628. }
  46629. }
  46630. var l = o.parse(n, a);
  46631. t(l.geometry, l.materials)
  46632. }, i, r)
  46633. },
  46634. setTexturePath: function(e) {
  46635. this.texturePath = e
  46636. },
  46637. parse: function(e, t) {
  46638. function i(t) {
  46639. function i(e, t) {
  46640. return e & 1 << t
  46641. }
  46642. var r, o, a, l, c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w, _, T, x, S, M, R, P, O = e.faces, L = e.vertices, D = e.normals, N = e.colors, B = 0;
  46643. if (void 0 !== e.uvs) {
  46644. for (r = 0; r < e.uvs.length; r++)
  46645. e.uvs[r].length && B++;
  46646. for (r = 0; r < B; r++)
  46647. s.faceVertexUvs[r] = []
  46648. }
  46649. for (l = 0,
  46650. c = L.length; l < c; )
  46651. E = new n.Vector3,
  46652. E.x = L[l++] * t,
  46653. E.y = L[l++] * t,
  46654. E.z = L[l++] * t,
  46655. s.vertices.push(E);
  46656. for (l = 0,
  46657. c = O.length; l < c; )
  46658. if (f = O[l++],
  46659. g = i(f, 0),
  46660. m = i(f, 1),
  46661. v = i(f, 3),
  46662. A = i(f, 4),
  46663. y = i(f, 5),
  46664. C = i(f, 6),
  46665. I = i(f, 7),
  46666. g) {
  46667. if (w = new n.Face3,
  46668. w.a = O[l],
  46669. w.b = O[l + 1],
  46670. w.c = O[l + 3],
  46671. _ = new n.Face3,
  46672. _.a = O[l + 1],
  46673. _.b = O[l + 2],
  46674. _.c = O[l + 3],
  46675. l += 4,
  46676. m && (p = O[l++],
  46677. w.materialIndex = p,
  46678. _.materialIndex = p),
  46679. a = s.faces.length,
  46680. v)
  46681. for (r = 0; r < B; r++)
  46682. for (S = e.uvs[r],
  46683. s.faceVertexUvs[r][a] = [],
  46684. s.faceVertexUvs[r][a + 1] = [],
  46685. o = 0; o < 4; o++)
  46686. d = O[l++],
  46687. R = S[2 * d],
  46688. P = S[2 * d + 1],
  46689. M = new n.Vector2(R,P),
  46690. 2 !== o && s.faceVertexUvs[r][a].push(M),
  46691. 0 !== o && s.faceVertexUvs[r][a + 1].push(M);
  46692. if (A && (u = 3 * O[l++],
  46693. w.normal.set(D[u++], D[u++], D[u]),
  46694. _.normal.copy(w.normal)),
  46695. y)
  46696. for (r = 0; r < 4; r++)
  46697. u = 3 * O[l++],
  46698. x = new n.Vector3(D[u++],D[u++],D[u]),
  46699. 2 !== r && w.vertexNormals.push(x),
  46700. 0 !== r && _.vertexNormals.push(x);
  46701. if (C && (h = O[l++],
  46702. T = N[h],
  46703. w.color.setHex(T),
  46704. _.color.setHex(T)),
  46705. I)
  46706. for (r = 0; r < 4; r++)
  46707. h = O[l++],
  46708. T = N[h],
  46709. 2 !== r && w.vertexColors.push(new n.Color(T)),
  46710. 0 !== r && _.vertexColors.push(new n.Color(T));
  46711. s.faces.push(w),
  46712. s.faces.push(_)
  46713. } else {
  46714. if (b = new n.Face3,
  46715. b.a = O[l++],
  46716. b.b = O[l++],
  46717. b.c = O[l++],
  46718. m && (p = O[l++],
  46719. b.materialIndex = p),
  46720. a = s.faces.length,
  46721. v)
  46722. for (r = 0; r < B; r++)
  46723. for (S = e.uvs[r],
  46724. s.faceVertexUvs[r][a] = [],
  46725. o = 0; o < 3; o++)
  46726. d = O[l++],
  46727. R = S[2 * d],
  46728. P = S[2 * d + 1],
  46729. M = new n.Vector2(R,P),
  46730. s.faceVertexUvs[r][a].push(M);
  46731. if (A && (u = 3 * O[l++],
  46732. b.normal.set(D[u++], D[u++], D[u])),
  46733. y)
  46734. for (r = 0; r < 3; r++)
  46735. u = 3 * O[l++],
  46736. x = new n.Vector3(D[u++],D[u++],D[u]),
  46737. b.vertexNormals.push(x);
  46738. if (C && (h = O[l++],
  46739. b.color.setHex(N[h])),
  46740. I)
  46741. for (r = 0; r < 3; r++)
  46742. h = O[l++],
  46743. b.vertexColors.push(new n.Color(N[h]));
  46744. s.faces.push(b)
  46745. }
  46746. }
  46747. function r() {
  46748. var t = void 0 !== e.influencesPerVertex ? e.influencesPerVertex : 2;
  46749. if (e.skinWeights)
  46750. for (var i = 0, r = e.skinWeights.length; i < r; i += t) {
  46751. var o = e.skinWeights[i]
  46752. , a = t > 1 ? e.skinWeights[i + 1] : 0
  46753. , l = t > 2 ? e.skinWeights[i + 2] : 0
  46754. , c = t > 3 ? e.skinWeights[i + 3] : 0;
  46755. s.skinWeights.push(new n.Vector4(o,a,l,c))
  46756. }
  46757. if (e.skinIndices)
  46758. for (var i = 0, r = e.skinIndices.length; i < r; i += t) {
  46759. var h = e.skinIndices[i]
  46760. , u = t > 1 ? e.skinIndices[i + 1] : 0
  46761. , d = t > 2 ? e.skinIndices[i + 2] : 0
  46762. , p = t > 3 ? e.skinIndices[i + 3] : 0;
  46763. s.skinIndices.push(new n.Vector4(h,u,d,p))
  46764. }
  46765. s.bones = e.bones,
  46766. s.bones && s.bones.length > 0 && (s.skinWeights.length !== s.skinIndices.length || s.skinIndices.length !== s.vertices.length) && console.warn("When skinning, number of vertices (" + s.vertices.length + "), skinIndices (" + s.skinIndices.length + "), and skinWeights (" + s.skinWeights.length + ") should match.")
  46767. }
  46768. function o(t) {
  46769. if (void 0 !== e.morphTargets)
  46770. for (var i = 0, r = e.morphTargets.length; i < r; i++) {
  46771. s.morphTargets[i] = {},
  46772. s.morphTargets[i].name = e.morphTargets[i].name,
  46773. s.morphTargets[i].vertices = [];
  46774. for (var o = s.morphTargets[i].vertices, a = e.morphTargets[i].vertices, l = 0, c = a.length; l < c; l += 3) {
  46775. var h = new n.Vector3;
  46776. h.x = a[l] * t,
  46777. h.y = a[l + 1] * t,
  46778. h.z = a[l + 2] * t,
  46779. o.push(h)
  46780. }
  46781. }
  46782. if (void 0 !== e.morphColors && e.morphColors.length > 0) {
  46783. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  46784. for (var u = s.faces, d = e.morphColors[0].colors, i = 0, r = u.length; i < r; i++)
  46785. u[i].color.fromArray(d, 3 * i)
  46786. }
  46787. }
  46788. function a() {
  46789. var t = []
  46790. , i = [];
  46791. void 0 !== e.animation && i.push(e.animation),
  46792. void 0 !== e.animations && (e.animations.length ? i = i.concat(e.animations) : i.push(e.animations));
  46793. for (var r = 0; r < i.length; r++) {
  46794. var o = n.AnimationClip.parseAnimation(i[r], s.bones);
  46795. o && t.push(o)
  46796. }
  46797. if (s.morphTargets) {
  46798. var a = n.AnimationClip.CreateClipsFromMorphTargetSequences(s.morphTargets, 10);
  46799. t = t.concat(a)
  46800. }
  46801. t.length > 0 && (s.animations = t)
  46802. }
  46803. var s = new n.Geometry
  46804. , l = void 0 !== e.scale ? 1 / e.scale : 1;
  46805. if (i(l),
  46806. r(),
  46807. o(l),
  46808. a(),
  46809. s.computeFaceNormals(),
  46810. s.computeBoundingSphere(),
  46811. void 0 === e.materials || 0 === e.materials.length)
  46812. return {
  46813. geometry: s
  46814. };
  46815. var c = n.Loader.prototype.initMaterials(e.materials, t, this.crossOrigin);
  46816. return {
  46817. geometry: s,
  46818. materials: c
  46819. }
  46820. }
  46821. },
  46822. n.LoadingManager = function(e, t, i) {
  46823. var n = this
  46824. , r = !1
  46825. , o = 0
  46826. , a = 0;
  46827. this.onStart = void 0,
  46828. this.onLoad = e,
  46829. this.onProgress = t,
  46830. this.onError = i,
  46831. this.itemStart = function(e) {
  46832. a++,
  46833. r === !1 && void 0 !== n.onStart && n.onStart(e, o, a),
  46834. r = !0
  46835. }
  46836. ,
  46837. this.itemEnd = function(e) {
  46838. o++,
  46839. void 0 !== n.onProgress && n.onProgress(e, o, a),
  46840. o === a && (r = !1,
  46841. void 0 !== n.onLoad && n.onLoad())
  46842. }
  46843. ,
  46844. this.itemError = function(e) {
  46845. void 0 !== n.onError && n.onError(e)
  46846. }
  46847. }
  46848. ,
  46849. n.DefaultLoadingManager = new n.LoadingManager,
  46850. n.BufferGeometryLoader = function(e) {
  46851. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  46852. }
  46853. ,
  46854. n.BufferGeometryLoader.prototype = {
  46855. constructor: n.BufferGeometryLoader,
  46856. load: function(e, t, i, r) {
  46857. var o = this
  46858. , a = new n.XHRLoader(o.manager);
  46859. a.load(e, function(e) {
  46860. t(o.parse(JSON.parse(e)))
  46861. }, i, r)
  46862. },
  46863. parse: function(e) {
  46864. var t = new n.BufferGeometry
  46865. , i = e.data.index
  46866. , r = {
  46867. Int8Array: Int8Array,
  46868. Uint8Array: Uint8Array,
  46869. Uint8ClampedArray: Uint8ClampedArray,
  46870. Int16Array: Int16Array,
  46871. Uint16Array: Uint16Array,
  46872. Int32Array: Int32Array,
  46873. Uint32Array: Uint32Array,
  46874. Float32Array: Float32Array,
  46875. Float64Array: Float64Array
  46876. };
  46877. if (void 0 !== i) {
  46878. var o = new r[i.type](i.array);
  46879. t.setIndex(new n.BufferAttribute(o,1))
  46880. }
  46881. var a = e.data.attributes;
  46882. for (var s in a) {
  46883. var l = a[s]
  46884. , o = new r[l.type](l.array);
  46885. t.addAttribute(s, new n.BufferAttribute(o,l.itemSize))
  46886. }
  46887. var c = e.data.groups || e.data.drawcalls || e.data.offsets;
  46888. if (void 0 !== c)
  46889. for (var h = 0, u = c.length; h !== u; ++h) {
  46890. var d = c[h];
  46891. t.addGroup(d.start, d.count, d.materialIndex)
  46892. }
  46893. var p = e.data.boundingSphere;
  46894. if (void 0 !== p) {
  46895. var f = new n.Vector3;
  46896. void 0 !== p.center && f.fromArray(p.center),
  46897. t.boundingSphere = new n.Sphere(f,p.radius)
  46898. }
  46899. return t
  46900. }
  46901. },
  46902. n.MaterialLoader = function(e) {
  46903. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  46904. this.textures = {}
  46905. }
  46906. ,
  46907. n.MaterialLoader.prototype = {
  46908. constructor: n.MaterialLoader,
  46909. load: function(e, t, i, r) {
  46910. var o = this
  46911. , a = new n.XHRLoader(o.manager);
  46912. a.load(e, function(e) {
  46913. t(o.parse(JSON.parse(e)))
  46914. }, i, r)
  46915. },
  46916. setTextures: function(e) {
  46917. this.textures = e
  46918. },
  46919. getTexture: function(e) {
  46920. var t = this.textures;
  46921. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  46922. t[e]
  46923. },
  46924. parse: function(e) {
  46925. var t = new n[e.type];
  46926. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  46927. void 0 !== e.name && (t.name = e.name),
  46928. void 0 !== e.color && t.color.setHex(e.color),
  46929. void 0 !== e.roughness && (t.roughness = e.roughness),
  46930. void 0 !== e.metalness && (t.metalness = e.metalness),
  46931. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  46932. void 0 !== e.specular && t.specular.setHex(e.specular),
  46933. void 0 !== e.shininess && (t.shininess = e.shininess),
  46934. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  46935. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  46936. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  46937. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  46938. void 0 !== e.shading && (t.shading = e.shading),
  46939. void 0 !== e.blending && (t.blending = e.blending),
  46940. void 0 !== e.side && (t.side = e.side),
  46941. void 0 !== e.opacity && (t.opacity = e.opacity),
  46942. void 0 !== e.transparent && (t.transparent = e.transparent),
  46943. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  46944. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  46945. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  46946. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  46947. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  46948. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  46949. void 0 !== e.size && (t.size = e.size),
  46950. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  46951. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  46952. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  46953. t.transparent = !0),
  46954. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  46955. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  46956. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  46957. void 0 !== e.normalScale) {
  46958. var i = e.normalScale;
  46959. Array.isArray(i) === !1 && (i = [i, i]),
  46960. t.normalScale = (new n.Vector2).fromArray(i)
  46961. }
  46962. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  46963. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  46964. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  46965. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  46966. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  46967. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  46968. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  46969. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  46970. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  46971. t.combine = n.MultiplyOperation),
  46972. e.reflectivity && (t.reflectivity = e.reflectivity),
  46973. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  46974. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  46975. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  46976. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  46977. void 0 !== e.materials)
  46978. for (var r = 0, o = e.materials.length; r < o; r++)
  46979. t.materials.push(this.parse(e.materials[r]));
  46980. return t
  46981. }
  46982. },
  46983. n.ObjectLoader = function(e) {
  46984. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  46985. this.texturePath = ""
  46986. }
  46987. ,
  46988. n.ObjectLoader.prototype = {
  46989. constructor: n.ObjectLoader,
  46990. load: function(e, t, i, r) {
  46991. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  46992. var o = this
  46993. , a = new n.XHRLoader(o.manager);
  46994. a.load(e, function(e) {
  46995. o.parse(JSON.parse(e), t)
  46996. }, i, r)
  46997. },
  46998. setTexturePath: function(e) {
  46999. this.texturePath = e
  47000. },
  47001. setCrossOrigin: function(e) {
  47002. this.crossOrigin = e
  47003. },
  47004. parse: function(e, t) {
  47005. var i = this.parseGeometries(e.geometries)
  47006. , n = this.parseImages(e.images, function() {
  47007. void 0 !== t && t(a)
  47008. })
  47009. , r = this.parseTextures(e.textures, n)
  47010. , o = this.parseMaterials(e.materials, r)
  47011. , a = this.parseObject(e.object, i, o);
  47012. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  47013. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  47014. a
  47015. },
  47016. parseGeometries: function(e) {
  47017. var t = {};
  47018. if (void 0 !== e)
  47019. for (var i = new n.JSONLoader, r = new n.BufferGeometryLoader, o = 0, a = e.length; o < a; o++) {
  47020. var s, l = e[o];
  47021. switch (l.type) {
  47022. case "PlaneGeometry":
  47023. case "PlaneBufferGeometry":
  47024. s = new n[l.type](l.width,l.height,l.widthSegments,l.heightSegments);
  47025. break;
  47026. case "BoxGeometry":
  47027. case "BoxBufferGeometry":
  47028. case "CubeGeometry":
  47029. s = new n[l.type](l.width,l.height,l.depth,l.widthSegments,l.heightSegments,l.depthSegments);
  47030. break;
  47031. case "CircleGeometry":
  47032. case "CircleBufferGeometry":
  47033. s = new n[l.type](l.radius,l.segments,l.thetaStart,l.thetaLength);
  47034. break;
  47035. case "CylinderGeometry":
  47036. case "CylinderBufferGeometry":
  47037. s = new n[l.type](l.radiusTop,l.radiusBottom,l.height,l.radialSegments,l.heightSegments,l.openEnded,l.thetaStart,l.thetaLength);
  47038. break;
  47039. case "SphereGeometry":
  47040. case "SphereBufferGeometry":
  47041. s = new n[l.type](l.radius,l.widthSegments,l.heightSegments,l.phiStart,l.phiLength,l.thetaStart,l.thetaLength);
  47042. break;
  47043. case "DodecahedronGeometry":
  47044. s = new n.DodecahedronGeometry(l.radius,l.detail);
  47045. break;
  47046. case "IcosahedronGeometry":
  47047. s = new n.IcosahedronGeometry(l.radius,l.detail);
  47048. break;
  47049. case "OctahedronGeometry":
  47050. s = new n.OctahedronGeometry(l.radius,l.detail);
  47051. break;
  47052. case "TetrahedronGeometry":
  47053. s = new n.TetrahedronGeometry(l.radius,l.detail);
  47054. break;
  47055. case "RingGeometry":
  47056. case "RingBufferGeometry":
  47057. s = new n[l.type](l.innerRadius,l.outerRadius,l.thetaSegments,l.phiSegments,l.thetaStart,l.thetaLength);
  47058. break;
  47059. case "TorusGeometry":
  47060. case "TorusBufferGeometry":
  47061. s = new n[l.type](l.radius,l.tube,l.radialSegments,l.tubularSegments,l.arc);
  47062. break;
  47063. case "TorusKnotGeometry":
  47064. case "TorusKnotBufferGeometry":
  47065. s = new n[l.type](l.radius,l.tube,l.tubularSegments,l.radialSegments,l.p,l.q);
  47066. break;
  47067. case "LatheGeometry":
  47068. s = new n.LatheGeometry(l.points,l.segments,l.phiStart,l.phiLength);
  47069. break;
  47070. case "BufferGeometry":
  47071. s = r.parse(l);
  47072. break;
  47073. case "Geometry":
  47074. s = i.parse(l.data, this.texturePath).geometry;
  47075. break;
  47076. default:
  47077. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + l.type + '"');
  47078. continue
  47079. }
  47080. s.uuid = l.uuid,
  47081. void 0 !== l.name && (s.name = l.name),
  47082. t[l.uuid] = s
  47083. }
  47084. return t
  47085. },
  47086. parseMaterials: function(e, t) {
  47087. var i = {};
  47088. if (void 0 !== e) {
  47089. var r = new n.MaterialLoader;
  47090. r.setTextures(t);
  47091. for (var o = 0, a = e.length; o < a; o++) {
  47092. var s = r.parse(e[o]);
  47093. i[s.uuid] = s
  47094. }
  47095. }
  47096. return i
  47097. },
  47098. parseAnimations: function(e) {
  47099. for (var t = [], i = 0; i < e.length; i++) {
  47100. var r = n.AnimationClip.parse(e[i]);
  47101. t.push(r)
  47102. }
  47103. return t
  47104. },
  47105. parseImages: function(e, t) {
  47106. function i(e) {
  47107. return r.manager.itemStart(e),
  47108. s.load(e, function() {
  47109. r.manager.itemEnd(e)
  47110. })
  47111. }
  47112. var r = this
  47113. , o = {};
  47114. if (void 0 !== e && e.length > 0) {
  47115. var a = new n.LoadingManager(t)
  47116. , s = new n.ImageLoader(a);
  47117. s.setCrossOrigin(this.crossOrigin);
  47118. for (var l = 0, c = e.length; l < c; l++) {
  47119. var h = e[l]
  47120. , u = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url) ? h.url : r.texturePath + h.url;
  47121. o[h.uuid] = i(u)
  47122. }
  47123. }
  47124. return o
  47125. },
  47126. parseTextures: function(e, t) {
  47127. function i(e) {
  47128. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  47129. n[e])
  47130. }
  47131. var r = {};
  47132. if (void 0 !== e)
  47133. for (var o = 0, a = e.length; o < a; o++) {
  47134. var s = e[o];
  47135. void 0 === s.image && console.warn('THREE.ObjectLoader: No "image" specified for', s.uuid),
  47136. void 0 === t[s.image] && console.warn("THREE.ObjectLoader: Undefined image", s.image);
  47137. var l = new n.Texture(t[s.image]);
  47138. l.needsUpdate = !0,
  47139. l.uuid = s.uuid,
  47140. void 0 !== s.name && (l.name = s.name),
  47141. void 0 !== s.mapping && (l.mapping = i(s.mapping)),
  47142. void 0 !== s.offset && (l.offset = new n.Vector2(s.offset[0],s.offset[1])),
  47143. void 0 !== s.repeat && (l.repeat = new n.Vector2(s.repeat[0],s.repeat[1])),
  47144. void 0 !== s.minFilter && (l.minFilter = i(s.minFilter)),
  47145. void 0 !== s.magFilter && (l.magFilter = i(s.magFilter)),
  47146. void 0 !== s.anisotropy && (l.anisotropy = s.anisotropy),
  47147. Array.isArray(s.wrap) && (l.wrapS = i(s.wrap[0]),
  47148. l.wrapT = i(s.wrap[1])),
  47149. r[s.uuid] = l
  47150. }
  47151. return r
  47152. },
  47153. parseObject: function() {
  47154. var e = new n.Matrix4;
  47155. return function(t, i, r) {
  47156. function o(e) {
  47157. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  47158. i[e]
  47159. }
  47160. function a(e) {
  47161. if (void 0 !== e)
  47162. return void 0 === r[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  47163. r[e]
  47164. }
  47165. var s;
  47166. switch (t.type) {
  47167. case "Scene":
  47168. s = new n.Scene;
  47169. break;
  47170. case "PerspectiveCamera":
  47171. s = new n.PerspectiveCamera(t.fov,t.aspect,t.near,t.far);
  47172. break;
  47173. case "OrthographicCamera":
  47174. s = new n.OrthographicCamera(t.left,t.right,t.top,t.bottom,t.near,t.far);
  47175. break;
  47176. case "AmbientLight":
  47177. s = new n.AmbientLight(t.color,t.intensity);
  47178. break;
  47179. case "DirectionalLight":
  47180. s = new n.DirectionalLight(t.color,t.intensity);
  47181. break;
  47182. case "PointLight":
  47183. s = new n.PointLight(t.color,t.intensity,t.distance,t.decay);
  47184. break;
  47185. case "SpotLight":
  47186. s = new n.SpotLight(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);
  47187. break;
  47188. case "HemisphereLight":
  47189. s = new n.HemisphereLight(t.color,t.groundColor,t.intensity);
  47190. break;
  47191. case "Mesh":
  47192. var l = o(t.geometry)
  47193. , c = a(t.material);
  47194. s = l.bones && l.bones.length > 0 ? new n.SkinnedMesh(l,c) : new n.Mesh(l,c);
  47195. break;
  47196. case "LOD":
  47197. s = new n.LOD;
  47198. break;
  47199. case "Line":
  47200. s = new n.Line(o(t.geometry),a(t.material),t.mode);
  47201. break;
  47202. case "PointCloud":
  47203. case "Points":
  47204. s = new n.Points(o(t.geometry),a(t.material));
  47205. break;
  47206. case "Sprite":
  47207. s = new n.Sprite(a(t.material));
  47208. break;
  47209. case "Group":
  47210. s = new n.Group;
  47211. break;
  47212. default:
  47213. s = new n.Object3D
  47214. }
  47215. if (s.uuid = t.uuid,
  47216. void 0 !== t.name && (s.name = t.name),
  47217. void 0 !== t.matrix ? (e.fromArray(t.matrix),
  47218. e.decompose(s.position, s.quaternion, s.scale)) : (void 0 !== t.position && s.position.fromArray(t.position),
  47219. void 0 !== t.rotation && s.rotation.fromArray(t.rotation),
  47220. void 0 !== t.scale && s.scale.fromArray(t.scale)),
  47221. void 0 !== t.castShadow && (s.castShadow = t.castShadow),
  47222. void 0 !== t.receiveShadow && (s.receiveShadow = t.receiveShadow),
  47223. void 0 !== t.visible && (s.visible = t.visible),
  47224. void 0 !== t.userData && (s.userData = t.userData),
  47225. void 0 !== t.children)
  47226. for (var h in t.children)
  47227. s.add(this.parseObject(t.children[h], i, r));
  47228. if ("LOD" === t.type)
  47229. for (var u = t.levels, d = 0; d < u.length; d++) {
  47230. var p = u[d]
  47231. , h = s.getObjectByProperty("uuid", p.object);
  47232. void 0 !== h && s.addLevel(h, p.distance)
  47233. }
  47234. return s
  47235. }
  47236. }()
  47237. },
  47238. n.TextureLoader = function(e) {
  47239. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  47240. }
  47241. ,
  47242. n.TextureLoader.prototype = {
  47243. constructor: n.TextureLoader,
  47244. load: function(e, t, i, r) {
  47245. var o = new n.Texture
  47246. , a = new n.ImageLoader(this.manager);
  47247. return a.setCrossOrigin(this.crossOrigin),
  47248. a.setPath(this.path),
  47249. a.load(e, function(e) {
  47250. o.image = e,
  47251. o.needsUpdate = !0,
  47252. void 0 !== t && t(o)
  47253. }, i, r),
  47254. o
  47255. },
  47256. setCrossOrigin: function(e) {
  47257. this.crossOrigin = e
  47258. },
  47259. setPath: function(e) {
  47260. this.path = e
  47261. }
  47262. },
  47263. n.CubeTextureLoader = function(e) {
  47264. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  47265. }
  47266. ,
  47267. n.CubeTextureLoader.prototype = {
  47268. constructor: n.CubeTextureLoader,
  47269. load: function(e, t, i, r) {
  47270. function o(i) {
  47271. s.load(e[i], function(e) {
  47272. a.images[i] = e,
  47273. l++,
  47274. 6 === l && (a.needsUpdate = !0,
  47275. t && t(a))
  47276. }, void 0, r)
  47277. }
  47278. var a = new n.CubeTexture
  47279. , s = new n.ImageLoader(this.manager);
  47280. s.setCrossOrigin(this.crossOrigin),
  47281. s.setPath(this.path);
  47282. for (var l = 0, c = 0; c < e.length; ++c)
  47283. o(c);
  47284. return a
  47285. },
  47286. setCrossOrigin: function(e) {
  47287. this.crossOrigin = e
  47288. },
  47289. setPath: function(e) {
  47290. this.path = e
  47291. }
  47292. },
  47293. n.DataTextureLoader = n.BinaryTextureLoader = function(e) {
  47294. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  47295. this._parser = null
  47296. }
  47297. ,
  47298. n.BinaryTextureLoader.prototype = {
  47299. constructor: n.BinaryTextureLoader,
  47300. load: function(e, t, i, r) {
  47301. var o = this
  47302. , a = new n.DataTexture
  47303. , s = new n.XHRLoader(this.manager);
  47304. return s.setResponseType("arraybuffer"),
  47305. s.load(e, function(e) {
  47306. var i = o._parser(e);
  47307. i && (void 0 !== i.image ? a.image = i.image : void 0 !== i.data && (a.image.width = i.width,
  47308. a.image.height = i.height,
  47309. a.image.data = i.data),
  47310. a.wrapS = void 0 !== i.wrapS ? i.wrapS : n.ClampToEdgeWrapping,
  47311. a.wrapT = void 0 !== i.wrapT ? i.wrapT : n.ClampToEdgeWrapping,
  47312. a.magFilter = void 0 !== i.magFilter ? i.magFilter : n.LinearFilter,
  47313. a.minFilter = void 0 !== i.minFilter ? i.minFilter : n.LinearMipMapLinearFilter,
  47314. a.anisotropy = void 0 !== i.anisotropy ? i.anisotropy : 1,
  47315. void 0 !== i.format && (a.format = i.format),
  47316. void 0 !== i.type && (a.type = i.type),
  47317. void 0 !== i.mipmaps && (a.mipmaps = i.mipmaps),
  47318. 1 === i.mipmapCount && (a.minFilter = n.LinearFilter),
  47319. a.needsUpdate = !0,
  47320. t && t(a, i))
  47321. }, i, r),
  47322. a
  47323. }
  47324. },
  47325. n.CompressedTextureLoader = function(e) {
  47326. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  47327. this._parser = null
  47328. }
  47329. ;
  47330. n.CompressedTextureLoader.prototype = {
  47331. constructor: n.CompressedTextureLoader,
  47332. load: function(e, t, i, r) {
  47333. function o(o) {
  47334. c.load(e[o], function(e) {
  47335. var i = a._parser(e, !0);
  47336. s[o] = {
  47337. width: i.width,
  47338. height: i.height,
  47339. format: i.format,
  47340. mipmaps: i.mipmaps
  47341. },
  47342. h += 1,
  47343. 6 === h && (1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  47344. l.format = i.format,
  47345. l.needsUpdate = !0,
  47346. t && t(l))
  47347. }, i, r)
  47348. }
  47349. var a = this
  47350. , s = []
  47351. , l = new n.CompressedTexture;
  47352. l.image = s;
  47353. var c = new n.XHRLoader(this.manager);
  47354. if (c.setPath(this.path),
  47355. c.setResponseType("arraybuffer"),
  47356. Array.isArray(e))
  47357. for (var h = 0, u = 0, d = e.length; u < d; ++u)
  47358. o(u);
  47359. else
  47360. c.load(e, function(e) {
  47361. var i = a._parser(e, !0);
  47362. if (i.isCubemap)
  47363. for (var r = i.mipmaps.length / i.mipmapCount, o = 0; o < r; o++) {
  47364. s[o] = {
  47365. mipmaps: []
  47366. };
  47367. for (var c = 0; c < i.mipmapCount; c++)
  47368. s[o].mipmaps.push(i.mipmaps[o * i.mipmapCount + c]),
  47369. s[o].format = i.format,
  47370. s[o].width = i.width,
  47371. s[o].height = i.height
  47372. }
  47373. else
  47374. l.image.width = i.width,
  47375. l.image.height = i.height,
  47376. l.mipmaps = i.mipmaps;
  47377. 1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  47378. l.format = i.format,
  47379. l.needsUpdate = !0,
  47380. t && t(l)
  47381. }, i, r);
  47382. return l
  47383. },
  47384. setPath: function(e) {
  47385. this.path = e
  47386. }
  47387. };
  47388. n.Material = function() {
  47389. Object.defineProperty(this, "id", {
  47390. value: n.MaterialIdCount++
  47391. }),
  47392. this.uuid = n.Math.generateUUID(),
  47393. this.name = "",
  47394. this.type = "Material",
  47395. this.side = n.FrontSide,
  47396. this.opacity = 1,
  47397. this.transparent = !1,
  47398. this.blending = n.NormalBlending,
  47399. this.blendSrc = n.SrcAlphaFactor,
  47400. this.blendDst = n.OneMinusSrcAlphaFactor,
  47401. this.blendEquation = n.AddEquation,
  47402. this.blendSrcAlpha = null,
  47403. this.blendDstAlpha = null,
  47404. this.blendEquationAlpha = null,
  47405. this.depthFunc = n.LessEqualDepth,
  47406. this.depthTest = !0,
  47407. this.depthWrite = !0,
  47408. this.colorWrite = !0,
  47409. this.precision = null,
  47410. this.polygonOffset = !1,
  47411. this.polygonOffsetFactor = 0,
  47412. this.polygonOffsetUnits = 0,
  47413. this.alphaTest = 0,
  47414. this.premultipliedAlpha = !1,
  47415. this.overdraw = 0,
  47416. this.visible = !0,
  47417. this._needsUpdate = !0
  47418. }
  47419. ,
  47420. n.Material.prototype = {
  47421. constructor: n.Material,
  47422. get needsUpdate() {
  47423. return this._needsUpdate
  47424. },
  47425. set needsUpdate(e) {
  47426. e === !0 && this.update(),
  47427. this._needsUpdate = e
  47428. },
  47429. setValues: function(e) {
  47430. if (void 0 !== e)
  47431. for (var t in e) {
  47432. var i = e[t];
  47433. if (void 0 !== i) {
  47434. var r = this[t];
  47435. void 0 !== r ? r instanceof n.Color ? r.set(i) : r instanceof n.Vector3 && i instanceof n.Vector3 ? r.copy(i) : "overdraw" === t ? this[t] = Number(i) : this[t] = i : console.warn("THREE." + this.type + ": '" + t + "' is not a property of this material.")
  47436. } else
  47437. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  47438. }
  47439. },
  47440. toJSON: function(e) {
  47441. function t(e) {
  47442. var t = [];
  47443. for (var i in e) {
  47444. var n = e[i];
  47445. delete n.metadata,
  47446. t.push(n)
  47447. }
  47448. return t
  47449. }
  47450. var i = void 0 === e;
  47451. i && (e = {
  47452. textures: {},
  47453. images: {}
  47454. });
  47455. var r = {
  47456. metadata: {
  47457. version: 4.4,
  47458. type: "Material",
  47459. generator: "Material.toJSON"
  47460. }
  47461. };
  47462. if (r.uuid = this.uuid,
  47463. r.type = this.type,
  47464. "" !== this.name && (r.name = this.name),
  47465. this.color instanceof n.Color && (r.color = this.color.getHex()),
  47466. .5 !== this.roughness && (r.roughness = this.roughness),
  47467. .5 !== this.metalness && (r.metalness = this.metalness),
  47468. this.emissive instanceof n.Color && (r.emissive = this.emissive.getHex()),
  47469. this.specular instanceof n.Color && (r.specular = this.specular.getHex()),
  47470. void 0 !== this.shininess && (r.shininess = this.shininess),
  47471. this.map instanceof n.Texture && (r.map = this.map.toJSON(e).uuid),
  47472. this.alphaMap instanceof n.Texture && (r.alphaMap = this.alphaMap.toJSON(e).uuid),
  47473. this.lightMap instanceof n.Texture && (r.lightMap = this.lightMap.toJSON(e).uuid),
  47474. this.bumpMap instanceof n.Texture && (r.bumpMap = this.bumpMap.toJSON(e).uuid,
  47475. r.bumpScale = this.bumpScale),
  47476. this.normalMap instanceof n.Texture && (r.normalMap = this.normalMap.toJSON(e).uuid,
  47477. r.normalScale = this.normalScale.toArray()),
  47478. this.displacementMap instanceof n.Texture && (r.displacementMap = this.displacementMap.toJSON(e).uuid,
  47479. r.displacementScale = this.displacementScale,
  47480. r.displacementBias = this.displacementBias),
  47481. this.roughnessMap instanceof n.Texture && (r.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  47482. this.metalnessMap instanceof n.Texture && (r.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  47483. this.emissiveMap instanceof n.Texture && (r.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  47484. this.specularMap instanceof n.Texture && (r.specularMap = this.specularMap.toJSON(e).uuid),
  47485. this.envMap instanceof n.Texture && (r.envMap = this.envMap.toJSON(e).uuid,
  47486. r.reflectivity = this.reflectivity),
  47487. void 0 !== this.size && (r.size = this.size),
  47488. void 0 !== this.sizeAttenuation && (r.sizeAttenuation = this.sizeAttenuation),
  47489. void 0 !== this.vertexColors && this.vertexColors !== n.NoColors && (r.vertexColors = this.vertexColors),
  47490. void 0 !== this.shading && this.shading !== n.SmoothShading && (r.shading = this.shading),
  47491. void 0 !== this.blending && this.blending !== n.NormalBlending && (r.blending = this.blending),
  47492. void 0 !== this.side && this.side !== n.FrontSide && (r.side = this.side),
  47493. this.opacity < 1 && (r.opacity = this.opacity),
  47494. this.transparent === !0 && (r.transparent = this.transparent),
  47495. this.alphaTest > 0 && (r.alphaTest = this.alphaTest),
  47496. this.premultipliedAlpha === !0 && (r.premultipliedAlpha = this.premultipliedAlpha),
  47497. this.wireframe === !0 && (r.wireframe = this.wireframe),
  47498. this.wireframeLinewidth > 1 && (r.wireframeLinewidth = this.wireframeLinewidth),
  47499. i) {
  47500. var o = t(e.textures)
  47501. , a = t(e.images);
  47502. o.length > 0 && (r.textures = o),
  47503. a.length > 0 && (r.images = a)
  47504. }
  47505. return r
  47506. },
  47507. clone: function() {
  47508. return (new this.constructor).copy(this)
  47509. },
  47510. copy: function(e) {
  47511. return this.name = e.name,
  47512. this.side = e.side,
  47513. this.opacity = e.opacity,
  47514. this.transparent = e.transparent,
  47515. this.blending = e.blending,
  47516. this.blendSrc = e.blendSrc,
  47517. this.blendDst = e.blendDst,
  47518. this.blendEquation = e.blendEquation,
  47519. this.blendSrcAlpha = e.blendSrcAlpha,
  47520. this.blendDstAlpha = e.blendDstAlpha,
  47521. this.blendEquationAlpha = e.blendEquationAlpha,
  47522. this.depthFunc = e.depthFunc,
  47523. this.depthTest = e.depthTest,
  47524. this.depthWrite = e.depthWrite,
  47525. this.colorWrite = e.colorWrite,
  47526. this.precision = e.precision,
  47527. this.polygonOffset = e.polygonOffset,
  47528. this.polygonOffsetFactor = e.polygonOffsetFactor,
  47529. this.polygonOffsetUnits = e.polygonOffsetUnits,
  47530. this.alphaTest = e.alphaTest,
  47531. this.premultipliedAlpha = e.premultipliedAlpha,
  47532. this.overdraw = e.overdraw,
  47533. this.visible = e.visible,
  47534. this
  47535. },
  47536. update: function() {
  47537. this.dispatchEvent({
  47538. type: "update"
  47539. })
  47540. },
  47541. dispose: function() {
  47542. this.dispatchEvent({
  47543. type: "dispose"
  47544. })
  47545. }
  47546. },
  47547. n.EventDispatcher.prototype.apply(n.Material.prototype),
  47548. n.MaterialIdCount = 0,
  47549. n.LineBasicMaterial = function(e) {
  47550. n.Material.call(this),
  47551. this.type = "LineBasicMaterial",
  47552. this.color = new n.Color(16777215),
  47553. this.linewidth = 1,
  47554. this.linecap = "round",
  47555. this.linejoin = "round",
  47556. this.blending = n.NormalBlending,
  47557. this.vertexColors = n.NoColors,
  47558. this.fog = !0,
  47559. this.setValues(e)
  47560. }
  47561. ,
  47562. n.LineBasicMaterial.prototype = Object.create(n.Material.prototype),
  47563. n.LineBasicMaterial.prototype.constructor = n.LineBasicMaterial,
  47564. n.LineBasicMaterial.prototype.copy = function(e) {
  47565. return n.Material.prototype.copy.call(this, e),
  47566. this.color.copy(e.color),
  47567. this.linewidth = e.linewidth,
  47568. this.linecap = e.linecap,
  47569. this.linejoin = e.linejoin,
  47570. this.vertexColors = e.vertexColors,
  47571. this.fog = e.fog,
  47572. this
  47573. }
  47574. ,
  47575. n.LineDashedMaterial = function(e) {
  47576. n.Material.call(this),
  47577. this.type = "LineDashedMaterial",
  47578. this.color = new n.Color(16777215),
  47579. this.linewidth = 1,
  47580. this.scale = 1,
  47581. this.dashSize = 3,
  47582. this.gapSize = 1,
  47583. this.blending = n.NormalBlending,
  47584. this.vertexColors = n.NoColors,
  47585. this.fog = !0,
  47586. this.setValues(e)
  47587. }
  47588. ,
  47589. n.LineDashedMaterial.prototype = Object.create(n.Material.prototype),
  47590. n.LineDashedMaterial.prototype.constructor = n.LineDashedMaterial,
  47591. n.LineDashedMaterial.prototype.copy = function(e) {
  47592. return n.Material.prototype.copy.call(this, e),
  47593. this.color.copy(e.color),
  47594. this.linewidth = e.linewidth,
  47595. this.scale = e.scale,
  47596. this.dashSize = e.dashSize,
  47597. this.gapSize = e.gapSize,
  47598. this.vertexColors = e.vertexColors,
  47599. this.fog = e.fog,
  47600. this
  47601. }
  47602. ,
  47603. n.MeshBasicMaterial = function(e) {
  47604. n.Material.call(this),
  47605. this.type = "MeshBasicMaterial",
  47606. this.color = new n.Color(16777215),
  47607. this.map = null,
  47608. this.aoMap = null,
  47609. this.aoMapIntensity = 1,
  47610. this.specularMap = null,
  47611. this.alphaMap = null,
  47612. this.envMap = null,
  47613. this.combine = n.MultiplyOperation,
  47614. this.reflectivity = 1,
  47615. this.refractionRatio = .98,
  47616. this.fog = !0,
  47617. this.shading = n.SmoothShading,
  47618. this.blending = n.NormalBlending,
  47619. this.wireframe = !1,
  47620. this.wireframeLinewidth = 1,
  47621. this.wireframeLinecap = "round",
  47622. this.wireframeLinejoin = "round",
  47623. this.vertexColors = n.NoColors,
  47624. this.skinning = !1,
  47625. this.morphTargets = !1,
  47626. this.setValues(e)
  47627. }
  47628. ,
  47629. n.MeshBasicMaterial.prototype = Object.create(n.Material.prototype),
  47630. n.MeshBasicMaterial.prototype.constructor = n.MeshBasicMaterial,
  47631. n.MeshBasicMaterial.prototype.copy = function(e) {
  47632. return n.Material.prototype.copy.call(this, e),
  47633. this.color.copy(e.color),
  47634. this.map = e.map,
  47635. this.aoMap = e.aoMap,
  47636. this.aoMapIntensity = e.aoMapIntensity,
  47637. this.specularMap = e.specularMap,
  47638. this.alphaMap = e.alphaMap,
  47639. this.envMap = e.envMap,
  47640. this.combine = e.combine,
  47641. this.reflectivity = e.reflectivity,
  47642. this.refractionRatio = e.refractionRatio,
  47643. this.fog = e.fog,
  47644. this.shading = e.shading,
  47645. this.wireframe = e.wireframe,
  47646. this.wireframeLinewidth = e.wireframeLinewidth,
  47647. this.wireframeLinecap = e.wireframeLinecap,
  47648. this.wireframeLinejoin = e.wireframeLinejoin,
  47649. this.vertexColors = e.vertexColors,
  47650. this.skinning = e.skinning,
  47651. this.morphTargets = e.morphTargets,
  47652. this
  47653. }
  47654. ,
  47655. n.MeshLambertMaterial = function(e) {
  47656. n.Material.call(this),
  47657. this.type = "MeshLambertMaterial",
  47658. this.color = new n.Color(16777215),
  47659. this.map = null,
  47660. this.lightMap = null,
  47661. this.lightMapIntensity = 1,
  47662. this.aoMap = null,
  47663. this.aoMapIntensity = 1,
  47664. this.emissive = new n.Color(0),
  47665. this.emissiveIntensity = 1,
  47666. this.emissiveMap = null,
  47667. this.specularMap = null,
  47668. this.alphaMap = null,
  47669. this.envMap = null,
  47670. this.combine = n.MultiplyOperation,
  47671. this.reflectivity = 1,
  47672. this.refractionRatio = .98,
  47673. this.fog = !0,
  47674. this.blending = n.NormalBlending,
  47675. this.wireframe = !1,
  47676. this.wireframeLinewidth = 1,
  47677. this.wireframeLinecap = "round",
  47678. this.wireframeLinejoin = "round",
  47679. this.vertexColors = n.NoColors,
  47680. this.skinning = !1,
  47681. this.morphTargets = !1,
  47682. this.morphNormals = !1,
  47683. this.setValues(e)
  47684. }
  47685. ,
  47686. n.MeshLambertMaterial.prototype = Object.create(n.Material.prototype),
  47687. n.MeshLambertMaterial.prototype.constructor = n.MeshLambertMaterial,
  47688. n.MeshLambertMaterial.prototype.copy = function(e) {
  47689. return n.Material.prototype.copy.call(this, e),
  47690. this.color.copy(e.color),
  47691. this.map = e.map,
  47692. this.lightMap = e.lightMap,
  47693. this.lightMapIntensity = e.lightMapIntensity,
  47694. this.aoMap = e.aoMap,
  47695. this.aoMapIntensity = e.aoMapIntensity,
  47696. this.emissive.copy(e.emissive),
  47697. this.emissiveMap = e.emissiveMap,
  47698. this.emissiveIntensity = e.emissiveIntensity,
  47699. this.specularMap = e.specularMap,
  47700. this.alphaMap = e.alphaMap,
  47701. this.envMap = e.envMap,
  47702. this.combine = e.combine,
  47703. this.reflectivity = e.reflectivity,
  47704. this.refractionRatio = e.refractionRatio,
  47705. this.fog = e.fog,
  47706. this.wireframe = e.wireframe,
  47707. this.wireframeLinewidth = e.wireframeLinewidth,
  47708. this.wireframeLinecap = e.wireframeLinecap,
  47709. this.wireframeLinejoin = e.wireframeLinejoin,
  47710. this.vertexColors = e.vertexColors,
  47711. this.skinning = e.skinning,
  47712. this.morphTargets = e.morphTargets,
  47713. this.morphNormals = e.morphNormals,
  47714. this
  47715. }
  47716. ,
  47717. n.MeshPhongMaterial = function(e) {
  47718. n.Material.call(this),
  47719. this.type = "MeshPhongMaterial",
  47720. this.color = new n.Color(16777215),
  47721. this.specular = new n.Color(1118481),
  47722. this.shininess = 30,
  47723. this.map = null,
  47724. this.lightMap = null,
  47725. this.lightMapIntensity = 1,
  47726. this.aoMap = null,
  47727. this.aoMapIntensity = 1,
  47728. this.emissive = new n.Color(0),
  47729. this.emissiveIntensity = 1,
  47730. this.emissiveMap = null,
  47731. this.bumpMap = null,
  47732. this.bumpScale = 1,
  47733. this.normalMap = null,
  47734. this.normalScale = new n.Vector2(1,1),
  47735. this.displacementMap = null,
  47736. this.displacementScale = 1,
  47737. this.displacementBias = 0,
  47738. this.specularMap = null,
  47739. this.alphaMap = null,
  47740. this.envMap = null,
  47741. this.combine = n.MultiplyOperation,
  47742. this.reflectivity = 1,
  47743. this.refractionRatio = .98,
  47744. this.fog = !0,
  47745. this.shading = n.SmoothShading,
  47746. this.blending = n.NormalBlending,
  47747. this.wireframe = !1,
  47748. this.wireframeLinewidth = 1,
  47749. this.wireframeLinecap = "round",
  47750. this.wireframeLinejoin = "round",
  47751. this.vertexColors = n.NoColors,
  47752. this.skinning = !1,
  47753. this.morphTargets = !1,
  47754. this.morphNormals = !1,
  47755. this.setValues(e)
  47756. }
  47757. ,
  47758. n.MeshPhongMaterial.prototype = Object.create(n.Material.prototype),
  47759. n.MeshPhongMaterial.prototype.constructor = n.MeshPhongMaterial,
  47760. n.MeshPhongMaterial.prototype.copy = function(e) {
  47761. return n.Material.prototype.copy.call(this, e),
  47762. this.color.copy(e.color),
  47763. this.specular.copy(e.specular),
  47764. this.shininess = e.shininess,
  47765. this.map = e.map,
  47766. this.lightMap = e.lightMap,
  47767. this.lightMapIntensity = e.lightMapIntensity,
  47768. this.aoMap = e.aoMap,
  47769. this.aoMapIntensity = e.aoMapIntensity,
  47770. this.emissive.copy(e.emissive),
  47771. this.emissiveMap = e.emissiveMap,
  47772. this.emissiveIntensity = e.emissiveIntensity,
  47773. this.bumpMap = e.bumpMap,
  47774. this.bumpScale = e.bumpScale,
  47775. this.normalMap = e.normalMap,
  47776. this.normalScale.copy(e.normalScale),
  47777. this.displacementMap = e.displacementMap,
  47778. this.displacementScale = e.displacementScale,
  47779. this.displacementBias = e.displacementBias,
  47780. this.specularMap = e.specularMap,
  47781. this.alphaMap = e.alphaMap,
  47782. this.envMap = e.envMap,
  47783. this.combine = e.combine,
  47784. this.reflectivity = e.reflectivity,
  47785. this.refractionRatio = e.refractionRatio,
  47786. this.fog = e.fog,
  47787. this.shading = e.shading,
  47788. this.wireframe = e.wireframe,
  47789. this.wireframeLinewidth = e.wireframeLinewidth,
  47790. this.wireframeLinecap = e.wireframeLinecap,
  47791. this.wireframeLinejoin = e.wireframeLinejoin,
  47792. this.vertexColors = e.vertexColors,
  47793. this.skinning = e.skinning,
  47794. this.morphTargets = e.morphTargets,
  47795. this.morphNormals = e.morphNormals,
  47796. this
  47797. }
  47798. ,
  47799. n.MeshStandardMaterial = function(e) {
  47800. n.Material.call(this),
  47801. this.type = "MeshStandardMaterial",
  47802. this.color = new n.Color(16777215),
  47803. this.roughness = .5,
  47804. this.metalness = .5,
  47805. this.map = null,
  47806. this.lightMap = null,
  47807. this.lightMapIntensity = 1,
  47808. this.aoMap = null,
  47809. this.aoMapIntensity = 1,
  47810. this.emissive = new n.Color(0),
  47811. this.emissiveIntensity = 1,
  47812. this.emissiveMap = null,
  47813. this.bumpMap = null,
  47814. this.bumpScale = 1,
  47815. this.normalMap = null,
  47816. this.normalScale = new n.Vector2(1,1),
  47817. this.displacementMap = null,
  47818. this.displacementScale = 1,
  47819. this.displacementBias = 0,
  47820. this.roughnessMap = null,
  47821. this.metalnessMap = null,
  47822. this.alphaMap = null,
  47823. this.envMap = null,
  47824. this.envMapIntensity = 1,
  47825. this.refractionRatio = .98,
  47826. this.fog = !0,
  47827. this.shading = n.SmoothShading,
  47828. this.blending = n.NormalBlending,
  47829. this.wireframe = !1,
  47830. this.wireframeLinewidth = 1,
  47831. this.wireframeLinecap = "round",
  47832. this.wireframeLinejoin = "round",
  47833. this.vertexColors = n.NoColors,
  47834. this.skinning = !1,
  47835. this.morphTargets = !1,
  47836. this.morphNormals = !1,
  47837. this.setValues(e)
  47838. }
  47839. ,
  47840. n.MeshStandardMaterial.prototype = Object.create(n.Material.prototype),
  47841. n.MeshStandardMaterial.prototype.constructor = n.MeshStandardMaterial,
  47842. n.MeshStandardMaterial.prototype.copy = function(e) {
  47843. return n.Material.prototype.copy.call(this, e),
  47844. this.color.copy(e.color),
  47845. this.roughness = e.roughness,
  47846. this.metalness = e.metalness,
  47847. this.map = e.map,
  47848. this.lightMap = e.lightMap,
  47849. this.lightMapIntensity = e.lightMapIntensity,
  47850. this.aoMap = e.aoMap,
  47851. this.aoMapIntensity = e.aoMapIntensity,
  47852. this.emissive.copy(e.emissive),
  47853. this.emissiveMap = e.emissiveMap,
  47854. this.emissiveIntensity = e.emissiveIntensity,
  47855. this.bumpMap = e.bumpMap,
  47856. this.bumpScale = e.bumpScale,
  47857. this.normalMap = e.normalMap,
  47858. this.normalScale.copy(e.normalScale),
  47859. this.displacementMap = e.displacementMap,
  47860. this.displacementScale = e.displacementScale,
  47861. this.displacementBias = e.displacementBias,
  47862. this.roughnessMap = e.roughnessMap,
  47863. this.metalnessMap = e.metalnessMap,
  47864. this.alphaMap = e.alphaMap,
  47865. this.envMap = e.envMap,
  47866. this.envMapIntensity = e.envMapIntensity,
  47867. this.refractionRatio = e.refractionRatio,
  47868. this.fog = e.fog,
  47869. this.shading = e.shading,
  47870. this.wireframe = e.wireframe,
  47871. this.wireframeLinewidth = e.wireframeLinewidth,
  47872. this.wireframeLinecap = e.wireframeLinecap,
  47873. this.wireframeLinejoin = e.wireframeLinejoin,
  47874. this.vertexColors = e.vertexColors,
  47875. this.skinning = e.skinning,
  47876. this.morphTargets = e.morphTargets,
  47877. this.morphNormals = e.morphNormals,
  47878. this
  47879. }
  47880. ,
  47881. n.MeshDepthMaterial = function(e) {
  47882. n.Material.call(this),
  47883. this.type = "MeshDepthMaterial",
  47884. this.morphTargets = !1,
  47885. this.wireframe = !1,
  47886. this.wireframeLinewidth = 1,
  47887. this.setValues(e)
  47888. }
  47889. ,
  47890. n.MeshDepthMaterial.prototype = Object.create(n.Material.prototype),
  47891. n.MeshDepthMaterial.prototype.constructor = n.MeshDepthMaterial,
  47892. n.MeshDepthMaterial.prototype.copy = function(e) {
  47893. return n.Material.prototype.copy.call(this, e),
  47894. this.wireframe = e.wireframe,
  47895. this.wireframeLinewidth = e.wireframeLinewidth,
  47896. this
  47897. }
  47898. ,
  47899. n.MeshNormalMaterial = function(e) {
  47900. n.Material.call(this, e),
  47901. this.type = "MeshNormalMaterial",
  47902. this.wireframe = !1,
  47903. this.wireframeLinewidth = 1,
  47904. this.morphTargets = !1,
  47905. this.setValues(e)
  47906. }
  47907. ,
  47908. n.MeshNormalMaterial.prototype = Object.create(n.Material.prototype),
  47909. n.MeshNormalMaterial.prototype.constructor = n.MeshNormalMaterial,
  47910. n.MeshNormalMaterial.prototype.copy = function(e) {
  47911. return n.Material.prototype.copy.call(this, e),
  47912. this.wireframe = e.wireframe,
  47913. this.wireframeLinewidth = e.wireframeLinewidth,
  47914. this
  47915. }
  47916. ,
  47917. n.MultiMaterial = function(e) {
  47918. this.uuid = n.Math.generateUUID(),
  47919. this.type = "MultiMaterial",
  47920. this.materials = e instanceof Array ? e : [],
  47921. this.visible = !0
  47922. }
  47923. ,
  47924. n.MultiMaterial.prototype = {
  47925. constructor: n.MultiMaterial,
  47926. toJSON: function(e) {
  47927. for (var t = {
  47928. metadata: {
  47929. version: 4.2,
  47930. type: "material",
  47931. generator: "MaterialExporter"
  47932. },
  47933. uuid: this.uuid,
  47934. type: this.type,
  47935. materials: []
  47936. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  47937. var o = i[n].toJSON(e);
  47938. delete o.metadata,
  47939. t.materials.push(o)
  47940. }
  47941. return t.visible = this.visible,
  47942. t
  47943. },
  47944. clone: function() {
  47945. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  47946. e.materials.push(this.materials[t].clone());
  47947. return e.visible = this.visible,
  47948. e
  47949. }
  47950. },
  47951. n.PointsMaterial = function(e) {
  47952. n.Material.call(this),
  47953. this.type = "PointsMaterial",
  47954. this.color = new n.Color(16777215),
  47955. this.map = null,
  47956. this.size = 1,
  47957. this.sizeAttenuation = !0,
  47958. this.blending = n.NormalBlending,
  47959. this.vertexColors = n.NoColors,
  47960. this.fog = !0,
  47961. this.setValues(e)
  47962. }
  47963. ,
  47964. n.PointsMaterial.prototype = Object.create(n.Material.prototype),
  47965. n.PointsMaterial.prototype.constructor = n.PointsMaterial,
  47966. n.PointsMaterial.prototype.copy = function(e) {
  47967. return n.Material.prototype.copy.call(this, e),
  47968. this.color.copy(e.color),
  47969. this.map = e.map,
  47970. this.size = e.size,
  47971. this.sizeAttenuation = e.sizeAttenuation,
  47972. this.vertexColors = e.vertexColors,
  47973. this.fog = e.fog,
  47974. this
  47975. }
  47976. ,
  47977. n.ShaderMaterial = function(e) {
  47978. n.Material.call(this),
  47979. this.type = "ShaderMaterial",
  47980. this.defines = {},
  47981. this.uniforms = {},
  47982. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  47983. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  47984. this.shading = n.SmoothShading,
  47985. this.linewidth = 1,
  47986. this.wireframe = !1,
  47987. this.wireframeLinewidth = 1,
  47988. this.fog = !1,
  47989. this.lights = !1,
  47990. this.vertexColors = n.NoColors,
  47991. this.skinning = !1,
  47992. this.morphTargets = !1,
  47993. this.morphNormals = !1,
  47994. this.extensions = {
  47995. derivatives: !1,
  47996. fragDepth: !1,
  47997. drawBuffers: !1,
  47998. shaderTextureLOD: !1
  47999. },
  48000. this.defaultAttributeValues = {
  48001. color: [1, 1, 1],
  48002. uv: [0, 0],
  48003. uv2: [0, 0]
  48004. },
  48005. this.index0AttributeName = void 0,
  48006. void 0 !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  48007. this.setValues(e))
  48008. }
  48009. ,
  48010. n.ShaderMaterial.prototype = Object.create(n.Material.prototype),
  48011. n.ShaderMaterial.prototype.constructor = n.ShaderMaterial,
  48012. n.ShaderMaterial.prototype.copy = function(e) {
  48013. return n.Material.prototype.copy.call(this, e),
  48014. this.fragmentShader = e.fragmentShader,
  48015. this.vertexShader = e.vertexShader,
  48016. this.uniforms = n.UniformsUtils.clone(e.uniforms),
  48017. this.defines = e.defines,
  48018. this.shading = e.shading,
  48019. this.wireframe = e.wireframe,
  48020. this.wireframeLinewidth = e.wireframeLinewidth,
  48021. this.fog = e.fog,
  48022. this.lights = e.lights,
  48023. this.vertexColors = e.vertexColors,
  48024. this.skinning = e.skinning,
  48025. this.morphTargets = e.morphTargets,
  48026. this.morphNormals = e.morphNormals,
  48027. this.extensions = e.extensions,
  48028. this
  48029. }
  48030. ,
  48031. n.ShaderMaterial.prototype.toJSON = function(e) {
  48032. var t = n.Material.prototype.toJSON.call(this, e);
  48033. return t.uniforms = this.uniforms,
  48034. t.vertexShader = this.vertexShader,
  48035. t.fragmentShader = this.fragmentShader,
  48036. t
  48037. }
  48038. ,
  48039. n.RawShaderMaterial = function(e) {
  48040. n.ShaderMaterial.call(this, e),
  48041. this.type = "RawShaderMaterial"
  48042. }
  48043. ,
  48044. n.RawShaderMaterial.prototype = Object.create(n.ShaderMaterial.prototype),
  48045. n.RawShaderMaterial.prototype.constructor = n.RawShaderMaterial,
  48046. n.SpriteMaterial = function(e) {
  48047. n.Material.call(this),
  48048. this.type = "SpriteMaterial",
  48049. this.color = new n.Color(16777215),
  48050. this.map = null,
  48051. this.rotation = 0,
  48052. this.fog = !1,
  48053. this.setValues(e)
  48054. }
  48055. ,
  48056. n.SpriteMaterial.prototype = Object.create(n.Material.prototype),
  48057. n.SpriteMaterial.prototype.constructor = n.SpriteMaterial,
  48058. n.SpriteMaterial.prototype.copy = function(e) {
  48059. return n.Material.prototype.copy.call(this, e),
  48060. this.color.copy(e.color),
  48061. this.map = e.map,
  48062. this.rotation = e.rotation,
  48063. this.fog = e.fog,
  48064. this
  48065. }
  48066. ,
  48067. n.Texture = function(e, t, i, r, o, a, s, l, c) {
  48068. Object.defineProperty(this, "id", {
  48069. value: n.TextureIdCount++
  48070. }),
  48071. this.uuid = n.Math.generateUUID(),
  48072. this.name = "",
  48073. this.sourceFile = "",
  48074. this.image = void 0 !== e ? e : n.Texture.DEFAULT_IMAGE,
  48075. this.mipmaps = [],
  48076. this.mapping = void 0 !== t ? t : n.Texture.DEFAULT_MAPPING,
  48077. this.wrapS = void 0 !== i ? i : n.ClampToEdgeWrapping,
  48078. this.wrapT = void 0 !== r ? r : n.ClampToEdgeWrapping,
  48079. this.magFilter = void 0 !== o ? o : n.LinearFilter,
  48080. this.minFilter = void 0 !== a ? a : n.LinearMipMapLinearFilter,
  48081. this.anisotropy = void 0 !== c ? c : 1,
  48082. this.format = void 0 !== s ? s : n.RGBAFormat,
  48083. this.type = void 0 !== l ? l : n.UnsignedByteType,
  48084. this.offset = new n.Vector2(0,0),
  48085. this.repeat = new n.Vector2(1,1),
  48086. this.generateMipmaps = !0,
  48087. this.premultiplyAlpha = !1,
  48088. this.flipY = !0,
  48089. this.unpackAlignment = 4,
  48090. this.encoding = n.LinearEncoding,
  48091. this.version = 0,
  48092. this.onUpdate = null
  48093. }
  48094. ,
  48095. n.Texture.DEFAULT_IMAGE = void 0,
  48096. n.Texture.DEFAULT_MAPPING = n.UVMapping,
  48097. n.Texture.prototype = {
  48098. constructor: n.Texture,
  48099. set needsUpdate(e) {
  48100. e === !0 && this.version++
  48101. },
  48102. clone: function() {
  48103. return (new this.constructor).copy(this)
  48104. },
  48105. copy: function(e) {
  48106. return this.image = e.image,
  48107. this.mipmaps = e.mipmaps.slice(0),
  48108. this.mapping = e.mapping,
  48109. this.wrapS = e.wrapS,
  48110. this.wrapT = e.wrapT,
  48111. this.magFilter = e.magFilter,
  48112. this.minFilter = e.minFilter,
  48113. this.anisotropy = e.anisotropy,
  48114. this.format = e.format,
  48115. this.type = e.type,
  48116. this.offset.copy(e.offset),
  48117. this.repeat.copy(e.repeat),
  48118. this.generateMipmaps = e.generateMipmaps,
  48119. this.premultiplyAlpha = e.premultiplyAlpha,
  48120. this.flipY = e.flipY,
  48121. this.unpackAlignment = e.unpackAlignment,
  48122. this.encoding = e.encoding,
  48123. this
  48124. },
  48125. toJSON: function(e) {
  48126. function t(e) {
  48127. var t;
  48128. return void 0 !== e.toDataURL ? t = e : (t = document.createElement("canvas"),
  48129. t.width = e.width,
  48130. t.height = e.height,
  48131. t.getContext("2d").drawImage(e, 0, 0, e.width, e.height)),
  48132. t.width > 2048 || t.height > 2048 ? t.toDataURL("image/jpeg", .6) : t.toDataURL("image/png")
  48133. }
  48134. if (void 0 !== e.textures[this.uuid])
  48135. return e.textures[this.uuid];
  48136. var i = {
  48137. metadata: {
  48138. version: 4.4,
  48139. type: "Texture",
  48140. generator: "Texture.toJSON"
  48141. },
  48142. uuid: this.uuid,
  48143. name: this.name,
  48144. mapping: this.mapping,
  48145. repeat: [this.repeat.x, this.repeat.y],
  48146. offset: [this.offset.x, this.offset.y],
  48147. wrap: [this.wrapS, this.wrapT],
  48148. minFilter: this.minFilter,
  48149. magFilter: this.magFilter,
  48150. anisotropy: this.anisotropy
  48151. };
  48152. if (void 0 !== this.image) {
  48153. var r = this.image;
  48154. void 0 === r.uuid && (r.uuid = n.Math.generateUUID()),
  48155. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  48156. uuid: r.uuid,
  48157. url: t(r)
  48158. }),
  48159. i.image = r.uuid
  48160. }
  48161. return e.textures[this.uuid] = i,
  48162. i
  48163. },
  48164. dispose: function() {
  48165. this.dispatchEvent({
  48166. type: "dispose"
  48167. })
  48168. },
  48169. transformUv: function(e) {
  48170. if (this.mapping === n.UVMapping) {
  48171. if (e.multiply(this.repeat),
  48172. e.add(this.offset),
  48173. e.x < 0 || e.x > 1)
  48174. switch (this.wrapS) {
  48175. case n.RepeatWrapping:
  48176. e.x = e.x - Math.floor(e.x);
  48177. break;
  48178. case n.ClampToEdgeWrapping:
  48179. e.x = e.x < 0 ? 0 : 1;
  48180. break;
  48181. case n.MirroredRepeatWrapping:
  48182. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  48183. }
  48184. if (e.y < 0 || e.y > 1)
  48185. switch (this.wrapT) {
  48186. case n.RepeatWrapping:
  48187. e.y = e.y - Math.floor(e.y);
  48188. break;
  48189. case n.ClampToEdgeWrapping:
  48190. e.y = e.y < 0 ? 0 : 1;
  48191. break;
  48192. case n.MirroredRepeatWrapping:
  48193. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  48194. }
  48195. this.flipY && (e.y = 1 - e.y)
  48196. }
  48197. }
  48198. },
  48199. n.EventDispatcher.prototype.apply(n.Texture.prototype),
  48200. n.TextureIdCount = 0,
  48201. n.CanvasTexture = function(e, t, i, r, o, a, s, l, c) {
  48202. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  48203. this.needsUpdate = !0
  48204. }
  48205. ,
  48206. n.CanvasTexture.prototype = Object.create(n.Texture.prototype),
  48207. n.CanvasTexture.prototype.constructor = n.CanvasTexture,
  48208. n.CubeTexture = function(e, t, i, r, o, a, s, l, c) {
  48209. e = void 0 !== e ? e : [],
  48210. t = void 0 !== t ? t : n.CubeReflectionMapping,
  48211. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  48212. this.flipY = !1
  48213. }
  48214. ,
  48215. n.CubeTexture.prototype = Object.create(n.Texture.prototype),
  48216. n.CubeTexture.prototype.constructor = n.CubeTexture,
  48217. Object.defineProperty(n.CubeTexture.prototype, "images", {
  48218. get: function() {
  48219. return this.image
  48220. },
  48221. set: function(e) {
  48222. this.image = e
  48223. }
  48224. }),
  48225. n.CompressedTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  48226. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  48227. this.image = {
  48228. width: t,
  48229. height: i
  48230. },
  48231. this.mipmaps = e,
  48232. this.flipY = !1,
  48233. this.generateMipmaps = !1
  48234. }
  48235. ,
  48236. n.CompressedTexture.prototype = Object.create(n.Texture.prototype),
  48237. n.CompressedTexture.prototype.constructor = n.CompressedTexture,
  48238. n.DataTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  48239. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  48240. this.image = {
  48241. data: e,
  48242. width: t,
  48243. height: i
  48244. },
  48245. this.magFilter = void 0 !== c ? c : n.NearestFilter,
  48246. this.minFilter = void 0 !== h ? h : n.NearestFilter,
  48247. this.flipY = !1,
  48248. this.generateMipmaps = !1
  48249. }
  48250. ,
  48251. n.DataTexture.prototype = Object.create(n.Texture.prototype),
  48252. n.DataTexture.prototype.constructor = n.DataTexture,
  48253. n.VideoTexture = function(e, t, i, r, o, a, s, l, c) {
  48254. function h() {
  48255. requestAnimationFrame(h),
  48256. e.readyState === e.HAVE_ENOUGH_DATA && (u.needsUpdate = !0)
  48257. }
  48258. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  48259. this.generateMipmaps = !1;
  48260. var u = this;
  48261. h()
  48262. }
  48263. ,
  48264. n.VideoTexture.prototype = Object.create(n.Texture.prototype),
  48265. n.VideoTexture.prototype.constructor = n.VideoTexture,
  48266. n.Group = function() {
  48267. n.Object3D.call(this),
  48268. this.type = "Group"
  48269. }
  48270. ,
  48271. n.Group.prototype = Object.create(n.Object3D.prototype),
  48272. n.Group.prototype.constructor = n.Group,
  48273. n.Points = function(e, t) {
  48274. n.Object3D.call(this),
  48275. this.type = "Points",
  48276. this.geometry = void 0 !== e ? e : new n.Geometry,
  48277. this.material = void 0 !== t ? t : new n.PointsMaterial({
  48278. color: 16777215 * Math.random()
  48279. })
  48280. }
  48281. ,
  48282. n.Points.prototype = Object.create(n.Object3D.prototype),
  48283. n.Points.prototype.constructor = n.Points,
  48284. n.Points.prototype.raycast = function() {
  48285. var e = new n.Matrix4
  48286. , t = new n.Ray
  48287. , i = new n.Sphere;
  48288. return function(r, o) {
  48289. function a(e, i) {
  48290. var n = t.distanceSqToPoint(e);
  48291. if (n < d) {
  48292. var a = t.closestPointToPoint(e);
  48293. a.applyMatrix4(c);
  48294. var l = r.ray.origin.distanceTo(a);
  48295. if (l < r.near || l > r.far)
  48296. return;
  48297. o.push({
  48298. distance: l,
  48299. distanceToRay: Math.sqrt(n),
  48300. point: a.clone(),
  48301. index: i,
  48302. face: null,
  48303. object: s
  48304. })
  48305. }
  48306. }
  48307. var s = this
  48308. , l = this.geometry
  48309. , c = this.matrixWorld
  48310. , h = r.params.Points.threshold;
  48311. if (null === l.boundingSphere && l.computeBoundingSphere(),
  48312. i.copy(l.boundingSphere),
  48313. i.applyMatrix4(c),
  48314. r.ray.intersectsSphere(i) !== !1) {
  48315. e.getInverse(c),
  48316. t.copy(r.ray).applyMatrix4(e);
  48317. var u = h / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  48318. , d = u * u
  48319. , p = new n.Vector3;
  48320. if (l instanceof n.BufferGeometry) {
  48321. var f = l.index
  48322. , g = l.attributes
  48323. , m = g.position.array;
  48324. if (null !== f)
  48325. for (var v = f.array, A = 0, y = v.length; A < y; A++) {
  48326. var C = v[A];
  48327. p.fromArray(m, 3 * C),
  48328. a(p, C)
  48329. }
  48330. else
  48331. for (var A = 0, I = m.length / 3; A < I; A++)
  48332. p.fromArray(m, 3 * A),
  48333. a(p, A)
  48334. } else
  48335. for (var E = l.vertices, A = 0, I = E.length; A < I; A++)
  48336. a(E[A], A)
  48337. }
  48338. }
  48339. }(),
  48340. n.Points.prototype.clone = function() {
  48341. return new this.constructor(this.geometry,this.material).copy(this)
  48342. }
  48343. ,
  48344. n.Line = function(e, t, i) {
  48345. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  48346. new n.LineSegments(e,t)) : (n.Object3D.call(this),
  48347. this.type = "Line",
  48348. this.geometry = void 0 !== e ? e : new n.Geometry,
  48349. void (this.material = void 0 !== t ? t : new n.LineBasicMaterial({
  48350. color: 16777215 * Math.random()
  48351. })))
  48352. }
  48353. ,
  48354. n.Line.prototype = Object.create(n.Object3D.prototype),
  48355. n.Line.prototype.constructor = n.Line,
  48356. n.Line.prototype.raycast = function() {
  48357. var e = new n.Matrix4
  48358. , t = new n.Ray
  48359. , i = new n.Sphere;
  48360. return function(r, o) {
  48361. var a = r.linePrecision
  48362. , s = a * a
  48363. , l = this.geometry
  48364. , c = this.matrixWorld;
  48365. if (null === l.boundingSphere && l.computeBoundingSphere(),
  48366. i.copy(l.boundingSphere),
  48367. i.applyMatrix4(c),
  48368. r.ray.intersectsSphere(i) !== !1) {
  48369. e.getInverse(c),
  48370. t.copy(r.ray).applyMatrix4(e);
  48371. var h = new n.Vector3
  48372. , u = new n.Vector3
  48373. , d = new n.Vector3
  48374. , p = new n.Vector3
  48375. , f = this instanceof n.LineSegments ? 2 : 1;
  48376. if (l instanceof n.BufferGeometry) {
  48377. var g = l.index
  48378. , m = l.attributes
  48379. , v = m.position.array;
  48380. if (null !== g)
  48381. for (var A = g.array, y = 0, C = A.length - 1; y < C; y += f) {
  48382. var I = A[y]
  48383. , E = A[y + 1];
  48384. h.fromArray(v, 3 * I),
  48385. u.fromArray(v, 3 * E);
  48386. var b = t.distanceSqToSegment(h, u, p, d);
  48387. if (!(b > s)) {
  48388. p.applyMatrix4(this.matrixWorld);
  48389. var w = r.ray.origin.distanceTo(p);
  48390. w < r.near || w > r.far || o.push({
  48391. distance: w,
  48392. point: d.clone().applyMatrix4(this.matrixWorld),
  48393. index: y,
  48394. face: null,
  48395. faceIndex: null,
  48396. object: this
  48397. })
  48398. }
  48399. }
  48400. else
  48401. for (var y = 0, C = v.length / 3 - 1; y < C; y += f) {
  48402. h.fromArray(v, 3 * y),
  48403. u.fromArray(v, 3 * y + 3);
  48404. var b = t.distanceSqToSegment(h, u, p, d);
  48405. if (!(b > s)) {
  48406. p.applyMatrix4(this.matrixWorld);
  48407. var w = r.ray.origin.distanceTo(p);
  48408. w < r.near || w > r.far || o.push({
  48409. distance: w,
  48410. point: d.clone().applyMatrix4(this.matrixWorld),
  48411. index: y,
  48412. face: null,
  48413. faceIndex: null,
  48414. object: this
  48415. })
  48416. }
  48417. }
  48418. } else if (l instanceof n.Geometry)
  48419. for (var _ = l.vertices, T = _.length, y = 0; y < T - 1; y += f) {
  48420. var b = t.distanceSqToSegment(_[y], _[y + 1], p, d);
  48421. if (!(b > s)) {
  48422. p.applyMatrix4(this.matrixWorld);
  48423. var w = r.ray.origin.distanceTo(p);
  48424. w < r.near || w > r.far || o.push({
  48425. distance: w,
  48426. point: d.clone().applyMatrix4(this.matrixWorld),
  48427. index: y,
  48428. face: null,
  48429. faceIndex: null,
  48430. object: this
  48431. })
  48432. }
  48433. }
  48434. }
  48435. }
  48436. }(),
  48437. n.Line.prototype.clone = function() {
  48438. return new this.constructor(this.geometry,this.material).copy(this)
  48439. }
  48440. ,
  48441. n.LineStrip = 0,
  48442. n.LinePieces = 1,
  48443. n.LineSegments = function(e, t) {
  48444. n.Line.call(this, e, t),
  48445. this.type = "LineSegments"
  48446. }
  48447. ,
  48448. n.LineSegments.prototype = Object.create(n.Line.prototype),
  48449. n.LineSegments.prototype.constructor = n.LineSegments,
  48450. n.Mesh = function(e, t) {
  48451. n.Object3D.call(this),
  48452. this.type = "Mesh",
  48453. this.geometry = void 0 !== e ? e : new n.Geometry,
  48454. this.material = void 0 !== t ? t : new n.MeshBasicMaterial({
  48455. color: 16777215 * Math.random()
  48456. }),
  48457. this.drawMode = n.TrianglesDrawMode,
  48458. this.updateMorphTargets()
  48459. }
  48460. ,
  48461. n.Mesh.prototype = Object.create(n.Object3D.prototype),
  48462. n.Mesh.prototype.constructor = n.Mesh,
  48463. n.Mesh.prototype.setDrawMode = function(e) {
  48464. this.drawMode = e
  48465. }
  48466. ,
  48467. n.Mesh.prototype.updateMorphTargets = function() {
  48468. if (void 0 !== this.geometry.morphTargets && this.geometry.morphTargets.length > 0) {
  48469. this.morphTargetBase = -1,
  48470. this.morphTargetInfluences = [],
  48471. this.morphTargetDictionary = {};
  48472. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  48473. this.morphTargetInfluences.push(0),
  48474. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  48475. }
  48476. }
  48477. ,
  48478. n.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  48479. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  48480. 0)
  48481. }
  48482. ,
  48483. n.Mesh.prototype.raycast = function() {
  48484. function e(e, t, i, r, o, a, s) {
  48485. return n.Triangle.barycoordFromPoint(e, t, i, r, m),
  48486. o.multiplyScalar(m.x),
  48487. a.multiplyScalar(m.y),
  48488. s.multiplyScalar(m.z),
  48489. o.add(a).add(s),
  48490. o.clone()
  48491. }
  48492. function t(e, t, i, r, o, a, s) {
  48493. var l, c = e.material;
  48494. if (l = c.side === n.BackSide ? i.intersectTriangle(a, o, r, !0, s) : i.intersectTriangle(r, o, a, c.side !== n.DoubleSide, s),
  48495. null === l)
  48496. return null;
  48497. A.copy(s),
  48498. A.applyMatrix4(e.matrixWorld);
  48499. var h = t.ray.origin.distanceTo(A);
  48500. return h < t.near || h > t.far ? null : {
  48501. distance: h,
  48502. point: A.clone(),
  48503. object: e
  48504. }
  48505. }
  48506. function i(i, r, o, a, h, u, d, m) {
  48507. s.fromArray(a, 3 * u),
  48508. l.fromArray(a, 3 * d),
  48509. c.fromArray(a, 3 * m);
  48510. var A = t(i, r, o, s, l, c, v);
  48511. return A && (h && (p.fromArray(h, 2 * u),
  48512. f.fromArray(h, 2 * d),
  48513. g.fromArray(h, 2 * m),
  48514. A.uv = e(v, s, l, c, p, f, g)),
  48515. A.face = new n.Face3(u,d,m,n.Triangle.normal(s, l, c)),
  48516. A.faceIndex = u),
  48517. A
  48518. }
  48519. var r = new n.Matrix4
  48520. , o = new n.Ray
  48521. , a = new n.Sphere
  48522. , s = new n.Vector3
  48523. , l = new n.Vector3
  48524. , c = new n.Vector3
  48525. , h = new n.Vector3
  48526. , u = new n.Vector3
  48527. , d = new n.Vector3
  48528. , p = new n.Vector2
  48529. , f = new n.Vector2
  48530. , g = new n.Vector2
  48531. , m = new n.Vector3
  48532. , v = new n.Vector3
  48533. , A = new n.Vector3;
  48534. return function(m, A) {
  48535. var y = this.geometry
  48536. , C = this.material
  48537. , I = this.matrixWorld;
  48538. if (void 0 !== C && (null === y.boundingSphere && y.computeBoundingSphere(),
  48539. a.copy(y.boundingSphere),
  48540. a.applyMatrix4(I),
  48541. m.ray.intersectsSphere(a) !== !1 && (r.getInverse(I),
  48542. o.copy(m.ray).applyMatrix4(r),
  48543. null === y.boundingBox || o.intersectsBox(y.boundingBox) !== !1))) {
  48544. var E, b;
  48545. if (y instanceof n.BufferGeometry) {
  48546. var w, _, T, x = y.index, S = y.attributes, M = S.position.array;
  48547. if (void 0 !== S.uv && (E = S.uv.array),
  48548. null !== x)
  48549. for (var R = x.array, P = 0, O = R.length; P < O; P += 3)
  48550. w = R[P],
  48551. _ = R[P + 1],
  48552. T = R[P + 2],
  48553. b = i(this, m, o, M, E, w, _, T),
  48554. b && (b.faceIndex = Math.floor(P / 3),
  48555. A.push(b));
  48556. else
  48557. for (var P = 0, O = M.length; P < O; P += 9)
  48558. w = P / 3,
  48559. _ = w + 1,
  48560. T = w + 2,
  48561. b = i(this, m, o, M, E, w, _, T),
  48562. b && (b.index = w,
  48563. A.push(b))
  48564. } else if (y instanceof n.Geometry) {
  48565. var L, D, N, B = C instanceof n.MultiMaterial, F = B === !0 ? C.materials : null, V = y.vertices, U = y.faces, k = y.faceVertexUvs[0];
  48566. k.length > 0 && (E = k);
  48567. for (var H = 0, G = U.length; H < G; H++) {
  48568. var z = U[H]
  48569. , W = B === !0 ? F[z.materialIndex] : C;
  48570. if (void 0 !== W) {
  48571. if (L = V[z.a],
  48572. D = V[z.b],
  48573. N = V[z.c],
  48574. W.morphTargets === !0) {
  48575. var j = y.morphTargets
  48576. , Y = this.morphTargetInfluences;
  48577. s.set(0, 0, 0),
  48578. l.set(0, 0, 0),
  48579. c.set(0, 0, 0);
  48580. for (var X = 0, Z = j.length; X < Z; X++) {
  48581. var q = Y[X];
  48582. if (0 !== q) {
  48583. var K = j[X].vertices;
  48584. s.addScaledVector(h.subVectors(K[z.a], L), q),
  48585. l.addScaledVector(u.subVectors(K[z.b], D), q),
  48586. c.addScaledVector(d.subVectors(K[z.c], N), q)
  48587. }
  48588. }
  48589. s.add(L),
  48590. l.add(D),
  48591. c.add(N),
  48592. L = s,
  48593. D = l,
  48594. N = c
  48595. }
  48596. if (b = t(this, m, o, L, D, N, v)) {
  48597. if (E) {
  48598. var Q = E[H];
  48599. p.copy(Q[0]),
  48600. f.copy(Q[1]),
  48601. g.copy(Q[2]),
  48602. b.uv = e(v, L, D, N, p, f, g)
  48603. }
  48604. b.face = z,
  48605. b.faceIndex = H,
  48606. A.push(b)
  48607. }
  48608. }
  48609. }
  48610. }
  48611. }
  48612. }
  48613. }(),
  48614. n.Mesh.prototype.clone = function() {
  48615. return new this.constructor(this.geometry,this.material).copy(this)
  48616. }
  48617. ,
  48618. n.Bone = function(e) {
  48619. n.Object3D.call(this),
  48620. this.type = "Bone",
  48621. this.skin = e
  48622. }
  48623. ,
  48624. n.Bone.prototype = Object.create(n.Object3D.prototype),
  48625. n.Bone.prototype.constructor = n.Bone,
  48626. n.Bone.prototype.copy = function(e) {
  48627. return n.Object3D.prototype.copy.call(this, e),
  48628. this.skin = e.skin,
  48629. this
  48630. }
  48631. ,
  48632. n.Skeleton = function(e, t, i) {
  48633. if (this.useVertexTexture = void 0 === i || i,
  48634. this.identityMatrix = new n.Matrix4,
  48635. e = e || [],
  48636. this.bones = e.slice(0),
  48637. this.useVertexTexture) {
  48638. var r = Math.sqrt(4 * this.bones.length);
  48639. r = n.Math.nextPowerOfTwo(Math.ceil(r)),
  48640. r = Math.max(r, 4),
  48641. this.boneTextureWidth = r,
  48642. this.boneTextureHeight = r,
  48643. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  48644. this.boneTexture = new n.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,n.RGBAFormat,n.FloatType)
  48645. } else
  48646. this.boneMatrices = new Float32Array(16 * this.bones.length);
  48647. if (void 0 === t)
  48648. this.calculateInverses();
  48649. else if (this.bones.length === t.length)
  48650. this.boneInverses = t.slice(0);
  48651. else {
  48652. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  48653. this.boneInverses = [];
  48654. for (var o = 0, a = this.bones.length; o < a; o++)
  48655. this.boneInverses.push(new n.Matrix4)
  48656. }
  48657. }
  48658. ,
  48659. n.Skeleton.prototype.calculateInverses = function() {
  48660. this.boneInverses = [];
  48661. for (var e = 0, t = this.bones.length; e < t; e++) {
  48662. var i = new n.Matrix4;
  48663. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  48664. this.boneInverses.push(i)
  48665. }
  48666. }
  48667. ,
  48668. n.Skeleton.prototype.pose = function() {
  48669. for (var e, t = 0, i = this.bones.length; t < i; t++)
  48670. e = this.bones[t],
  48671. e && e.matrixWorld.getInverse(this.boneInverses[t]);
  48672. for (var t = 0, i = this.bones.length; t < i; t++)
  48673. e = this.bones[t],
  48674. e && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  48675. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  48676. e.matrix.decompose(e.position, e.quaternion, e.scale));
  48677. }
  48678. ,
  48679. n.Skeleton.prototype.update = function() {
  48680. var e = new n.Matrix4;
  48681. return function() {
  48682. for (var t = 0, i = this.bones.length; t < i; t++) {
  48683. var n = this.bones[t] ? this.bones[t].matrixWorld : this.identityMatrix;
  48684. e.multiplyMatrices(n, this.boneInverses[t]),
  48685. e.flattenToArrayOffset(this.boneMatrices, 16 * t)
  48686. }
  48687. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  48688. }
  48689. }(),
  48690. n.Skeleton.prototype.clone = function() {
  48691. return new n.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  48692. }
  48693. ,
  48694. n.SkinnedMesh = function(e, t, i) {
  48695. n.Mesh.call(this, e, t),
  48696. this.type = "SkinnedMesh",
  48697. this.bindMode = "attached",
  48698. this.bindMatrix = new n.Matrix4,
  48699. this.bindMatrixInverse = new n.Matrix4;
  48700. var r = [];
  48701. if (this.geometry && void 0 !== this.geometry.bones) {
  48702. for (var o, a, s = 0, l = this.geometry.bones.length; s < l; ++s)
  48703. a = this.geometry.bones[s],
  48704. o = new n.Bone(this),
  48705. r.push(o),
  48706. o.name = a.name,
  48707. o.position.fromArray(a.pos),
  48708. o.quaternion.fromArray(a.rotq),
  48709. void 0 !== a.scl && o.scale.fromArray(a.scl);
  48710. for (var s = 0, l = this.geometry.bones.length; s < l; ++s)
  48711. a = this.geometry.bones[s],
  48712. a.parent !== -1 && null !== a.parent ? r[a.parent].add(r[s]) : this.add(r[s])
  48713. }
  48714. this.normalizeSkinWeights(),
  48715. this.updateMatrixWorld(!0),
  48716. this.bind(new n.Skeleton(r,void 0,i), this.matrixWorld)
  48717. }
  48718. ,
  48719. n.SkinnedMesh.prototype = Object.create(n.Mesh.prototype),
  48720. n.SkinnedMesh.prototype.constructor = n.SkinnedMesh,
  48721. n.SkinnedMesh.prototype.bind = function(e, t) {
  48722. this.skeleton = e,
  48723. void 0 === t && (this.updateMatrixWorld(!0),
  48724. this.skeleton.calculateInverses(),
  48725. t = this.matrixWorld),
  48726. this.bindMatrix.copy(t),
  48727. this.bindMatrixInverse.getInverse(t)
  48728. }
  48729. ,
  48730. n.SkinnedMesh.prototype.pose = function() {
  48731. this.skeleton.pose()
  48732. }
  48733. ,
  48734. n.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  48735. if (this.geometry instanceof n.Geometry)
  48736. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  48737. var t = this.geometry.skinWeights[e]
  48738. , i = 1 / t.lengthManhattan();
  48739. i !== 1 / 0 ? t.multiplyScalar(i) : t.set(1, 0, 0, 0)
  48740. }
  48741. else if (this.geometry instanceof n.BufferGeometry)
  48742. for (var r = new n.Vector4, o = this.geometry.attributes.skinWeight, e = 0; e < o.count; e++) {
  48743. r.x = o.getX(e),
  48744. r.y = o.getY(e),
  48745. r.z = o.getZ(e),
  48746. r.w = o.getW(e);
  48747. var i = 1 / r.lengthManhattan();
  48748. i !== 1 / 0 ? r.multiplyScalar(i) : r.set(1, 0, 0, 0),
  48749. o.setXYZW(e, r.x, r.y, r.z, r.w)
  48750. }
  48751. }
  48752. ,
  48753. n.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  48754. n.Mesh.prototype.updateMatrixWorld.call(this, !0),
  48755. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  48756. }
  48757. ,
  48758. n.SkinnedMesh.prototype.clone = function() {
  48759. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  48760. }
  48761. ,
  48762. n.LOD = function() {
  48763. n.Object3D.call(this),
  48764. this.type = "LOD",
  48765. Object.defineProperties(this, {
  48766. levels: {
  48767. enumerable: !0,
  48768. value: []
  48769. },
  48770. objects: {
  48771. get: function() {
  48772. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  48773. this.levels
  48774. }
  48775. }
  48776. })
  48777. }
  48778. ,
  48779. n.LOD.prototype = Object.create(n.Object3D.prototype),
  48780. n.LOD.prototype.constructor = n.LOD,
  48781. n.LOD.prototype.addLevel = function(e, t) {
  48782. void 0 === t && (t = 0),
  48783. t = Math.abs(t);
  48784. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  48785. ;
  48786. i.splice(n, 0, {
  48787. distance: t,
  48788. object: e
  48789. }),
  48790. this.add(e)
  48791. }
  48792. ,
  48793. n.LOD.prototype.getObjectForDistance = function(e) {
  48794. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  48795. ;
  48796. return t[i - 1].object
  48797. }
  48798. ,
  48799. n.LOD.prototype.raycast = function() {
  48800. var e = new n.Vector3;
  48801. return function(t, i) {
  48802. e.setFromMatrixPosition(this.matrixWorld);
  48803. var n = t.ray.origin.distanceTo(e);
  48804. this.getObjectForDistance(n).raycast(t, i)
  48805. }
  48806. }(),
  48807. n.LOD.prototype.update = function() {
  48808. var e = new n.Vector3
  48809. , t = new n.Vector3;
  48810. return function(i) {
  48811. var n = this.levels;
  48812. if (n.length > 1) {
  48813. e.setFromMatrixPosition(i.matrixWorld),
  48814. t.setFromMatrixPosition(this.matrixWorld);
  48815. var r = e.distanceTo(t);
  48816. n[0].object.visible = !0;
  48817. for (var o = 1, a = n.length; o < a && r >= n[o].distance; o++)
  48818. n[o - 1].object.visible = !1,
  48819. n[o].object.visible = !0;
  48820. for (; o < a; o++)
  48821. n[o].object.visible = !1
  48822. }
  48823. }
  48824. }(),
  48825. n.LOD.prototype.copy = function(e) {
  48826. n.Object3D.prototype.copy.call(this, e, !1);
  48827. for (var t = e.levels, i = 0, r = t.length; i < r; i++) {
  48828. var o = t[i];
  48829. this.addLevel(o.object.clone(), o.distance)
  48830. }
  48831. return this
  48832. }
  48833. ,
  48834. n.LOD.prototype.toJSON = function(e) {
  48835. var t = n.Object3D.prototype.toJSON.call(this, e);
  48836. t.object.levels = [];
  48837. for (var i = this.levels, r = 0, o = i.length; r < o; r++) {
  48838. var a = i[r];
  48839. t.object.levels.push({
  48840. object: a.object.uuid,
  48841. distance: a.distance
  48842. })
  48843. }
  48844. return t
  48845. }
  48846. ,
  48847. n.Sprite = function() {
  48848. var e = new Uint16Array([0, 1, 2, 0, 2, 3])
  48849. , t = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0])
  48850. , i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1])
  48851. , r = new n.BufferGeometry;
  48852. return r.setIndex(new n.BufferAttribute(e,1)),
  48853. r.addAttribute("position", new n.BufferAttribute(t,3)),
  48854. r.addAttribute("uv", new n.BufferAttribute(i,2)),
  48855. function(e) {
  48856. n.Object3D.call(this),
  48857. this.type = "Sprite",
  48858. this.geometry = r,
  48859. this.material = void 0 !== e ? e : new n.SpriteMaterial
  48860. }
  48861. }(),
  48862. n.Sprite.prototype = Object.create(n.Object3D.prototype),
  48863. n.Sprite.prototype.constructor = n.Sprite,
  48864. n.Sprite.prototype.raycast = function() {
  48865. var e = new n.Vector3;
  48866. return function(t, i) {
  48867. e.setFromMatrixPosition(this.matrixWorld);
  48868. var n = t.ray.distanceSqToPoint(e)
  48869. , r = this.scale.x * this.scale.y;
  48870. n > r || i.push({
  48871. distance: Math.sqrt(n),
  48872. point: this.position,
  48873. face: null,
  48874. object: this
  48875. })
  48876. }
  48877. }(),
  48878. n.Sprite.prototype.clone = function() {
  48879. return new this.constructor(this.material).copy(this)
  48880. }
  48881. ,
  48882. n.Particle = n.Sprite,
  48883. n.LensFlare = function(e, t, i, r, o) {
  48884. n.Object3D.call(this),
  48885. this.lensFlares = [],
  48886. this.positionScreen = new n.Vector3,
  48887. this.customUpdateCallback = void 0,
  48888. void 0 !== e && this.add(e, t, i, r, o)
  48889. }
  48890. ,
  48891. n.LensFlare.prototype = Object.create(n.Object3D.prototype),
  48892. n.LensFlare.prototype.constructor = n.LensFlare,
  48893. n.LensFlare.prototype.add = function(e, t, i, r, o, a) {
  48894. void 0 === t && (t = -1),
  48895. void 0 === i && (i = 0),
  48896. void 0 === a && (a = 1),
  48897. void 0 === o && (o = new n.Color(16777215)),
  48898. void 0 === r && (r = n.NormalBlending),
  48899. i = Math.min(i, Math.max(0, i)),
  48900. this.lensFlares.push({
  48901. texture: e,
  48902. size: t,
  48903. distance: i,
  48904. x: 0,
  48905. y: 0,
  48906. z: 0,
  48907. scale: 1,
  48908. rotation: 0,
  48909. opacity: a,
  48910. color: o,
  48911. blending: r
  48912. })
  48913. }
  48914. ,
  48915. n.LensFlare.prototype.updateLensFlares = function() {
  48916. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  48917. for (e = 0; e < i; e++)
  48918. t = this.lensFlares[e],
  48919. t.x = this.positionScreen.x + n * t.distance,
  48920. t.y = this.positionScreen.y + r * t.distance,
  48921. t.wantedRotation = t.x * Math.PI * .25,
  48922. t.rotation += .25 * (t.wantedRotation - t.rotation)
  48923. }
  48924. ,
  48925. n.LensFlare.prototype.copy = function(e) {
  48926. n.Object3D.prototype.copy.call(this, e),
  48927. this.positionScreen.copy(e.positionScreen),
  48928. this.customUpdateCallback = e.customUpdateCallback;
  48929. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  48930. this.lensFlares.push(e.lensFlares[t]);
  48931. return this
  48932. }
  48933. ,
  48934. n.Scene = function() {
  48935. n.Object3D.call(this),
  48936. this.type = "Scene",
  48937. this.fog = null,
  48938. this.overrideMaterial = null,
  48939. this.autoUpdate = !0
  48940. }
  48941. ,
  48942. n.Scene.prototype = Object.create(n.Object3D.prototype),
  48943. n.Scene.prototype.constructor = n.Scene,
  48944. n.Scene.prototype.copy = function(e, t) {
  48945. return n.Object3D.prototype.copy.call(this, e, t),
  48946. null !== e.fog && (this.fog = e.fog.clone()),
  48947. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  48948. this.autoUpdate = e.autoUpdate,
  48949. this.matrixAutoUpdate = e.matrixAutoUpdate,
  48950. this
  48951. }
  48952. ,
  48953. n.Fog = function(e, t, i) {
  48954. this.name = "",
  48955. this.color = new n.Color(e),
  48956. this.near = void 0 !== t ? t : 1,
  48957. this.far = void 0 !== i ? i : 1e3
  48958. }
  48959. ,
  48960. n.Fog.prototype.clone = function() {
  48961. return new n.Fog(this.color.getHex(),this.near,this.far)
  48962. }
  48963. ,
  48964. n.FogExp2 = function(e, t) {
  48965. this.name = "",
  48966. this.color = new n.Color(e),
  48967. this.density = void 0 !== t ? t : 25e-5
  48968. }
  48969. ,
  48970. n.FogExp2.prototype.clone = function() {
  48971. return new n.FogExp2(this.color.getHex(),this.density)
  48972. }
  48973. ,
  48974. n.ShaderChunk = {},
  48975. n.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  48976. n.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  48977. n.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  48978. n.ShaderChunk.aomap_fragment = "#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n",
  48979. n.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  48980. n.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  48981. n.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  48982. n.ShaderChunk.bsdfs = "bool testLightInRange( const in float lightDistance, const in float cutoffDistance ) {\n\treturn any( bvec2( cutoffDistance == 0.0, lightDistance < cutoffDistance ) );\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t\t}\n\t\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_Smith( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n",
  48983. n.ShaderChunk.bumpmap_pars_fragment = "#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n",
  48984. n.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  48985. n.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  48986. n.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  48987. n.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  48988. n.ShaderChunk.common = "#define PI 3.14159\n#define PI2 6.28318\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\n",
  48989. n.ShaderChunk.cube_uv_reflection_fragment = "#ifdef ENVMAP_TYPE_CUBE_UV\nconst float cubeUV_textureSize = 1024.0;\nint getFaceFromDirection(vec3 direction) {\n vec3 absDirection = abs(direction);\n int face = -1;\n if( absDirection.x > absDirection.z ) {\n if(absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0 : 3;\n else\n face = direction.y > 0.0 ? 1 : 4;\n }\n else {\n if(absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2 : 5;\n else\n face = direction.y > 0.0 ? 1 : 4;\n }\n return face;\n}\nconst float cubeUV_maxLods1 = log2(cubeUV_textureSize*0.25) - 1.0;\nconst float cubeUV_rangeClamp = exp2((6.0 - 1.0) * 2.0);\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n float scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n float dxRoughness = dFdx(roughness);\n float dyRoughness = dFdy(roughness);\n vec3 dx = dFdx( vec * scale * dxRoughness );\n vec3 dy = dFdy( vec * scale * dyRoughness );\n float d = max( dot( dx, dx ), dot( dy, dy ) );\n d = clamp(d, 1.0, cubeUV_rangeClamp);\n float mipLevel = 0.5 * log2(d);\n return vec2(floor(mipLevel), fract(mipLevel));\n}\nconst float cubeUV_maxLods2 = log2(cubeUV_textureSize*0.25) - 2.0;\nconst float cubeUV_rcpTextureSize = 1.0 / cubeUV_textureSize;\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n mipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n float a = 16.0 * cubeUV_rcpTextureSize;\n vec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n vec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n float powScale = exp2_packed.x * exp2_packed.y;\n float scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n float mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n bool bRes = mipLevel == 0.0;\n scale = bRes && (scale < a) ? a : scale;\n vec3 r;\n vec2 offset;\n int face = getFaceFromDirection(direction);\n float rcpPowScale = 1.0 / powScale;\n if( face == 0) {\n r = vec3(direction.x, -direction.z, direction.y);\n offset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 1) {\n r = vec3(direction.y, direction.x, direction.z);\n offset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 2) {\n r = vec3(direction.z, direction.x, direction.y);\n offset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 3) {\n r = vec3(direction.x, direction.z, direction.y);\n offset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n else if( face == 4) {\n r = vec3(direction.y, direction.x, -direction.z);\n offset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n else {\n r = vec3(direction.z, -direction.x, direction.y);\n offset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n r = normalize(r);\n float texelOffset = 0.5 * cubeUV_rcpTextureSize;\n vec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n vec2 base = offset + vec2( texelOffset );\n return base + s * ( scale - 2.0 * texelOffset );\n}\nconst float cubeUV_maxLods3 = log2(cubeUV_textureSize*0.25) - 3.0;\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n float roughnessVal = roughness* cubeUV_maxLods3;\n float r1 = floor(roughnessVal);\n float r2 = r1 + 1.0;\n float t = fract(roughnessVal);\n vec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n float s = mipInfo.y;\n float level0 = mipInfo.x;\n float level1 = level0 + 1.0;\n level1 = level1 > 5.0 ? 5.0 : level1;\n level0 += min( floor( s + 0.5 ), 5.0 );\n vec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n vec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n vec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n vec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n vec4 result = mix(color10, color20, t);\n return vec4(result.rgb, 1.0);\n}\n#endif\n",
  48990. n.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  48991. n.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  48992. n.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  48993. n.ShaderChunk.emissivemap_fragment = "#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",
  48994. n.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  48995. n.ShaderChunk.encodings_pars_fragment = "\nvec4 LinearToLinear( in vec4 value ) {\n return value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n float maxComponent = max( max( value.r, value.g ), value.b );\n float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n M = ceil( M * 255.0 ) / 255.0;\n return vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float D = max( maxRange / maxRGB, 1.0 );\n D = min( floor( D ) / 255.0, 1.0 );\n return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n vec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n vec4 vResult;\n vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n vResult.w = fract(Le);\n vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n return vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n float Le = value.z * 255.0 + value.w;\n vec3 Xp_Y_XYZp;\n Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n return vec4( max(vRGB, 0.0), 1.0 );\n}\n",
  48996. n.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  48997. n.ShaderChunk.envmap_fragment = "#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#else\n\t\tfloat flipNormal = 1.0;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n",
  48998. n.ShaderChunk.envmap_pars_fragment = "#if defined( USE_ENVMAP ) || defined( STANDARD )\n\tuniform float reflectivity;\n\tuniform float envMapIntenstiy;\n#endif\n#ifdef USE_ENVMAP\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( STANDARD )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n",
  48999. n.ShaderChunk.envmap_pars_vertex = "#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )\n\tvarying vec3 vReflect;\n\tuniform float refractionRatio;\n#endif\n",
  49000. n.ShaderChunk.envmap_vertex = "#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )\n\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t#ifdef ENVMAP_MODE_REFLECTION\n\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t#else\n\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t#endif\n#endif\n",
  49001. n.ShaderChunk.fog_fragment = "#ifdef USE_FOG\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n",
  49002. n.ShaderChunk.fog_pars_fragment = "#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",
  49003. n.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  49004. n.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  49005. n.ShaderChunk.lights_lambert_vertex = "vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tdirectLight = getPointDirectLightIrradiance( pointLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tdirectLight = getSpotDirectLightIrradiance( spotLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectLight = getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n",
  49006. n.ShaderChunk.lights_pars = "uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tIncidentLight getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tIncidentLight getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tif ( testLightInRange( lightDistance, pointLight.distance ) ) {\n\t\t\tdirectLight.color = pointLight.color;\n\t\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tIncidentLight getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( all( bvec2( angleCos > spotLight.coneCos, testLightInRange( lightDistance, spotLight.distance ) ) ) ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( STANDARD )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t#endif\n\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n",
  49007. n.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  49008. n.ShaderChunk.lights_phong_pars_fragment = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n",
  49009. n.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  49010. n.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  49011. n.ShaderChunk.lights_standard_fragment = "StandardMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\nmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n",
  49012. n.ShaderChunk.lights_standard_pars_fragment = "struct StandardMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n};\nvoid RE_Direct_Standard( const in IncidentLight directLight, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n}\nvoid RE_IndirectDiffuse_Standard( const in vec3 irradiance, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Standard( const in vec3 radiance, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectSpecular += radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Standard\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Standard\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Standard\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n",
  49013. n.ShaderChunk.lights_template = "\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tdirectLight = getPointDirectLightIrradiance( pointLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tdirectLight = getSpotDirectLightIrradiance( spotLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tdirectLight = getDirectionalDirectLightIrradiance( directionalLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t \tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\tRE_IndirectSpecular( radiance, geometry, material, reflectedLight );\n#endif\n",
  49014. n.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  49015. n.ShaderChunk.logdepthbuf_pars_fragment = "#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n",
  49016. n.ShaderChunk.logdepthbuf_pars_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif",
  49017. n.ShaderChunk.logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\t#endif\n#endif\n",
  49018. n.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  49019. n.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  49020. n.ShaderChunk.map_particle_fragment = "#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n",
  49021. n.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  49022. n.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  49023. n.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  49024. n.ShaderChunk.morphnormal_vertex = "#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n",
  49025. n.ShaderChunk.morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif";
  49026. n.ShaderChunk.morphtarget_vertex = "#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n";
  49027. n.ShaderChunk.normal_fragment = "#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\t#endif\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n",
  49028. n.ShaderChunk.normalmap_pars_fragment = "#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n",
  49029. n.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  49030. n.ShaderChunk.project_vertex = "#ifdef USE_SKINNING\n\tvec4 mvPosition = modelViewMatrix * skinned;\n#else\n\tvec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n#endif\ngl_Position = projectionMatrix * mvPosition;\n",
  49031. n.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  49032. n.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  49033. n.ShaderChunk.shadowmap_pars_fragment = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat unpackDepth( const in vec4 rgba_depth ) {\n\t\tconst 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\t\treturn dot( rgba_depth, bit_shift );\n\t}\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn 1.0;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\tfloat dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n",
  49034. n.ShaderChunk.shadowmap_pars_vertex = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n",
  49035. n.ShaderChunk.shadowmap_vertex = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n",
  49036. n.ShaderChunk.shadowmask_pars_fragment = "float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n",
  49037. n.ShaderChunk.skinbase_vertex = "#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",
  49038. n.ShaderChunk.skinning_pars_vertex = "#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneGlobalMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n",
  49039. n.ShaderChunk.skinning_vertex = "#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned = bindMatrixInverse * skinned;\n#endif\n",
  49040. n.ShaderChunk.skinnormal_vertex = "#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n",
  49041. n.ShaderChunk.specularmap_fragment = "float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",
  49042. n.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  49043. n.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  49044. n.ShaderChunk.tonemapping_pars_fragment = "#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n return toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n",
  49045. n.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  49046. n.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  49047. n.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  49048. n.ShaderChunk.uv_pars_fragment = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",
  49049. n.ShaderChunk.uv_pars_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n#endif\n",
  49050. n.ShaderChunk.uv_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",
  49051. n.ShaderChunk.worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( STANDARD ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\t#ifdef USE_SKINNING\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\t#else\n\t\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\t#endif\n#endif\n",
  49052. n.UniformsUtils = {
  49053. merge: function(e) {
  49054. for (var t = {}, i = 0; i < e.length; i++) {
  49055. var n = this.clone(e[i]);
  49056. for (var r in n)
  49057. t[r] = n[r]
  49058. }
  49059. return t
  49060. },
  49061. clone: function(e) {
  49062. var t = {};
  49063. for (var i in e) {
  49064. t[i] = {};
  49065. for (var r in e[i]) {
  49066. var o = e[i][r];
  49067. o instanceof n.Color || o instanceof n.Vector2 || o instanceof n.Vector3 || o instanceof n.Vector4 || o instanceof n.Matrix3 || o instanceof n.Matrix4 || o instanceof n.Texture ? t[i][r] = o.clone() : Array.isArray(o) ? t[i][r] = o.slice() : t[i][r] = o
  49068. }
  49069. }
  49070. return t
  49071. }
  49072. },
  49073. n.UniformsLib = {
  49074. common: {
  49075. diffuse: {
  49076. type: "c",
  49077. value: new n.Color(15658734)
  49078. },
  49079. opacity: {
  49080. type: "f",
  49081. value: 1
  49082. },
  49083. map: {
  49084. type: "t",
  49085. value: null
  49086. },
  49087. offsetRepeat: {
  49088. type: "v4",
  49089. value: new n.Vector4(0,0,1,1)
  49090. },
  49091. specularMap: {
  49092. type: "t",
  49093. value: null
  49094. },
  49095. alphaMap: {
  49096. type: "t",
  49097. value: null
  49098. },
  49099. envMap: {
  49100. type: "t",
  49101. value: null
  49102. },
  49103. flipEnvMap: {
  49104. type: "f",
  49105. value: -1
  49106. },
  49107. reflectivity: {
  49108. type: "f",
  49109. value: 1
  49110. },
  49111. refractionRatio: {
  49112. type: "f",
  49113. value: .98
  49114. }
  49115. },
  49116. aomap: {
  49117. aoMap: {
  49118. type: "t",
  49119. value: null
  49120. },
  49121. aoMapIntensity: {
  49122. type: "f",
  49123. value: 1
  49124. }
  49125. },
  49126. lightmap: {
  49127. lightMap: {
  49128. type: "t",
  49129. value: null
  49130. },
  49131. lightMapIntensity: {
  49132. type: "f",
  49133. value: 1
  49134. }
  49135. },
  49136. emissivemap: {
  49137. emissiveMap: {
  49138. type: "t",
  49139. value: null
  49140. }
  49141. },
  49142. bumpmap: {
  49143. bumpMap: {
  49144. type: "t",
  49145. value: null
  49146. },
  49147. bumpScale: {
  49148. type: "f",
  49149. value: 1
  49150. }
  49151. },
  49152. normalmap: {
  49153. normalMap: {
  49154. type: "t",
  49155. value: null
  49156. },
  49157. normalScale: {
  49158. type: "v2",
  49159. value: new n.Vector2(1,1)
  49160. }
  49161. },
  49162. displacementmap: {
  49163. displacementMap: {
  49164. type: "t",
  49165. value: null
  49166. },
  49167. displacementScale: {
  49168. type: "f",
  49169. value: 1
  49170. },
  49171. displacementBias: {
  49172. type: "f",
  49173. value: 0
  49174. }
  49175. },
  49176. roughnessmap: {
  49177. roughnessMap: {
  49178. type: "t",
  49179. value: null
  49180. }
  49181. },
  49182. metalnessmap: {
  49183. metalnessMap: {
  49184. type: "t",
  49185. value: null
  49186. }
  49187. },
  49188. fog: {
  49189. fogDensity: {
  49190. type: "f",
  49191. value: 25e-5
  49192. },
  49193. fogNear: {
  49194. type: "f",
  49195. value: 1
  49196. },
  49197. fogFar: {
  49198. type: "f",
  49199. value: 2e3
  49200. },
  49201. fogColor: {
  49202. type: "c",
  49203. value: new n.Color(16777215)
  49204. }
  49205. },
  49206. lights: {
  49207. ambientLightColor: {
  49208. type: "fv",
  49209. value: []
  49210. },
  49211. directionalLights: {
  49212. type: "sa",
  49213. value: [],
  49214. properties: {
  49215. direction: {
  49216. type: "v3"
  49217. },
  49218. color: {
  49219. type: "c"
  49220. },
  49221. shadow: {
  49222. type: "i"
  49223. },
  49224. shadowBias: {
  49225. type: "f"
  49226. },
  49227. shadowRadius: {
  49228. type: "f"
  49229. },
  49230. shadowMapSize: {
  49231. type: "v2"
  49232. }
  49233. }
  49234. },
  49235. directionalShadowMap: {
  49236. type: "tv",
  49237. value: []
  49238. },
  49239. directionalShadowMatrix: {
  49240. type: "m4v",
  49241. value: []
  49242. },
  49243. spotLights: {
  49244. type: "sa",
  49245. value: [],
  49246. properties: {
  49247. color: {
  49248. type: "c"
  49249. },
  49250. position: {
  49251. type: "v3"
  49252. },
  49253. direction: {
  49254. type: "v3"
  49255. },
  49256. distance: {
  49257. type: "f"
  49258. },
  49259. coneCos: {
  49260. type: "f"
  49261. },
  49262. penumbraCos: {
  49263. type: "f"
  49264. },
  49265. decay: {
  49266. type: "f"
  49267. },
  49268. shadow: {
  49269. type: "i"
  49270. },
  49271. shadowBias: {
  49272. type: "f"
  49273. },
  49274. shadowRadius: {
  49275. type: "f"
  49276. },
  49277. shadowMapSize: {
  49278. type: "v2"
  49279. }
  49280. }
  49281. },
  49282. spotShadowMap: {
  49283. type: "tv",
  49284. value: []
  49285. },
  49286. spotShadowMatrix: {
  49287. type: "m4v",
  49288. value: []
  49289. },
  49290. pointLights: {
  49291. type: "sa",
  49292. value: [],
  49293. properties: {
  49294. color: {
  49295. type: "c"
  49296. },
  49297. position: {
  49298. type: "v3"
  49299. },
  49300. decay: {
  49301. type: "f"
  49302. },
  49303. distance: {
  49304. type: "f"
  49305. },
  49306. shadow: {
  49307. type: "i"
  49308. },
  49309. shadowBias: {
  49310. type: "f"
  49311. },
  49312. shadowRadius: {
  49313. type: "f"
  49314. },
  49315. shadowMapSize: {
  49316. type: "v2"
  49317. }
  49318. }
  49319. },
  49320. pointShadowMap: {
  49321. type: "tv",
  49322. value: []
  49323. },
  49324. pointShadowMatrix: {
  49325. type: "m4v",
  49326. value: []
  49327. },
  49328. hemisphereLights: {
  49329. type: "sa",
  49330. value: [],
  49331. properties: {
  49332. direction: {
  49333. type: "v3"
  49334. },
  49335. skyColor: {
  49336. type: "c"
  49337. },
  49338. groundColor: {
  49339. type: "c"
  49340. }
  49341. }
  49342. }
  49343. },
  49344. points: {
  49345. diffuse: {
  49346. type: "c",
  49347. value: new n.Color(15658734)
  49348. },
  49349. opacity: {
  49350. type: "f",
  49351. value: 1
  49352. },
  49353. size: {
  49354. type: "f",
  49355. value: 1
  49356. },
  49357. scale: {
  49358. type: "f",
  49359. value: 1
  49360. },
  49361. map: {
  49362. type: "t",
  49363. value: null
  49364. },
  49365. offsetRepeat: {
  49366. type: "v4",
  49367. value: new n.Vector4(0,0,1,1)
  49368. }
  49369. }
  49370. },
  49371. n.ShaderChunk.cube_frag = "uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\t#include <logdepthbuf_fragment>\n}\n",
  49372. n.ShaderChunk.cube_vert = "varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t#include <logdepthbuf_vertex>\n}\n",
  49373. n.ShaderChunk.depth_frag = "uniform float mNear;\nuniform float mFar;\nuniform float opacity;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\tfloat color = 1.0 - smoothstep( mNear, mFar, depth );\n\tgl_FragColor = vec4( vec3( color ), opacity );\n}\n",
  49374. n.ShaderChunk.depth_vert = "#include <common>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  49375. n.ShaderChunk.depthRGBA_frag = "#include <common>\n#include <logdepthbuf_pars_fragment>\nvec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}\n",
  49376. n.ShaderChunk.depthRGBA_vert = "#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  49377. n.ShaderChunk.distanceRGBA_frag = "uniform vec3 lightPos;\nvarying vec4 vWorldPosition;\n#include <common>\nvec4 pack1K ( float depth ) {\n\tdepth /= 1000.0;\n\tconst vec4 bitSh = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bitMsk = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bitSh * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bitMsk;\n\treturn res;\n}\nfloat unpack1K ( vec4 color ) {\n\tconst vec4 bitSh = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\treturn dot( color, bitSh ) * 1000.0;\n}\nvoid main () {\n\tgl_FragColor = pack1K( length( vWorldPosition.xyz - lightPos.xyz ) );\n}\n",
  49378. n.ShaderChunk.distanceRGBA_vert = "varying vec4 vWorldPosition;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\tvWorldPosition = worldPosition;\n}\n",
  49379. n.ShaderChunk.equirect_frag = "uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <logdepthbuf_fragment>\n}\n",
  49380. n.ShaderChunk.equirect_vert = "varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t#include <logdepthbuf_vertex>\n}\n",
  49381. n.ShaderChunk.linedashed_frag = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  49382. n.ShaderChunk.linedashed_vert = "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n}\n",
  49383. n.ShaderChunk.meshbasic_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight;\n\treflectedLight.directDiffuse = vec3( 0.0 );\n\treflectedLight.directSpecular = vec3( 0.0 );\n\treflectedLight.indirectDiffuse = diffuseColor.rgb;\n\treflectedLight.indirectSpecular = vec3( 0.0 );\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  49384. n.ShaderChunk.meshbasic_vert = "#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n}\n",
  49385. n.ShaderChunk.meshlambert_frag = "uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  49386. n.ShaderChunk.meshlambert_vert = "#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  49387. n.ShaderChunk.meshphong_frag = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  49388. n.ShaderChunk.meshphong_vert = "#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <lights_phong_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_phong_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  49389. n.ShaderChunk.meshstandard_frag = "#define STANDARD\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\nuniform float envMapIntensity;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <lights_pars>\n#include <lights_standard_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_standard_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  49390. n.ShaderChunk.meshstandard_vert = "#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  49391. n.ShaderChunk.normal_frag = "uniform float opacity;\nvarying vec3 vNormal;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );\n\t#include <logdepthbuf_fragment>\n}\n",
  49392. n.ShaderChunk.normal_vert = "varying vec3 vNormal;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvNormal = normalize( normalMatrix * normal );\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  49393. n.ShaderChunk.points_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  49394. n.ShaderChunk.points_vert = "uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  49395. n.ShaderLib = {
  49396. basic: {
  49397. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.fog]),
  49398. vertexShader: n.ShaderChunk.meshbasic_vert,
  49399. fragmentShader: n.ShaderChunk.meshbasic_frag
  49400. },
  49401. lambert: {
  49402. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.fog, n.UniformsLib.lights, {
  49403. emissive: {
  49404. type: "c",
  49405. value: new n.Color(0)
  49406. }
  49407. }]),
  49408. vertexShader: n.ShaderChunk.meshlambert_vert,
  49409. fragmentShader: n.ShaderChunk.meshlambert_frag
  49410. },
  49411. phong: {
  49412. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.bumpmap, n.UniformsLib.normalmap, n.UniformsLib.displacementmap, n.UniformsLib.fog, n.UniformsLib.lights, {
  49413. emissive: {
  49414. type: "c",
  49415. value: new n.Color(0)
  49416. },
  49417. specular: {
  49418. type: "c",
  49419. value: new n.Color(1118481)
  49420. },
  49421. shininess: {
  49422. type: "f",
  49423. value: 30
  49424. }
  49425. }]),
  49426. vertexShader: n.ShaderChunk.meshphong_vert,
  49427. fragmentShader: n.ShaderChunk.meshphong_frag
  49428. },
  49429. standard: {
  49430. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.bumpmap, n.UniformsLib.normalmap, n.UniformsLib.displacementmap, n.UniformsLib.roughnessmap, n.UniformsLib.metalnessmap, n.UniformsLib.fog, n.UniformsLib.lights, {
  49431. emissive: {
  49432. type: "c",
  49433. value: new n.Color(0)
  49434. },
  49435. roughness: {
  49436. type: "f",
  49437. value: .5
  49438. },
  49439. metalness: {
  49440. type: "f",
  49441. value: 0
  49442. },
  49443. envMapIntensity: {
  49444. type: "f",
  49445. value: 1
  49446. }
  49447. }]),
  49448. vertexShader: n.ShaderChunk.meshstandard_vert,
  49449. fragmentShader: n.ShaderChunk.meshstandard_frag
  49450. },
  49451. points: {
  49452. uniforms: n.UniformsUtils.merge([n.UniformsLib.points, n.UniformsLib.fog]),
  49453. vertexShader: n.ShaderChunk.points_vert,
  49454. fragmentShader: n.ShaderChunk.points_frag
  49455. },
  49456. dashed: {
  49457. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.fog, {
  49458. scale: {
  49459. type: "f",
  49460. value: 1
  49461. },
  49462. dashSize: {
  49463. type: "f",
  49464. value: 1
  49465. },
  49466. totalSize: {
  49467. type: "f",
  49468. value: 2
  49469. }
  49470. }]),
  49471. vertexShader: n.ShaderChunk.linedashed_vert,
  49472. fragmentShader: n.ShaderChunk.linedashed_frag
  49473. },
  49474. depth: {
  49475. uniforms: {
  49476. mNear: {
  49477. type: "f",
  49478. value: 1
  49479. },
  49480. mFar: {
  49481. type: "f",
  49482. value: 2e3
  49483. },
  49484. opacity: {
  49485. type: "f",
  49486. value: 1
  49487. }
  49488. },
  49489. vertexShader: n.ShaderChunk.depth_vert,
  49490. fragmentShader: n.ShaderChunk.depth_frag
  49491. },
  49492. normal: {
  49493. uniforms: {
  49494. opacity: {
  49495. type: "f",
  49496. value: 1
  49497. }
  49498. },
  49499. vertexShader: n.ShaderChunk.normal_vert,
  49500. fragmentShader: n.ShaderChunk.normal_frag
  49501. },
  49502. cube: {
  49503. uniforms: {
  49504. tCube: {
  49505. type: "t",
  49506. value: null
  49507. },
  49508. tFlip: {
  49509. type: "f",
  49510. value: -1
  49511. }
  49512. },
  49513. vertexShader: n.ShaderChunk.cube_vert,
  49514. fragmentShader: n.ShaderChunk.cube_frag
  49515. },
  49516. equirect: {
  49517. uniforms: {
  49518. tEquirect: {
  49519. type: "t",
  49520. value: null
  49521. },
  49522. tFlip: {
  49523. type: "f",
  49524. value: -1
  49525. }
  49526. },
  49527. vertexShader: n.ShaderChunk.equirect_vert,
  49528. fragmentShader: n.ShaderChunk.equirect_frag
  49529. },
  49530. depthRGBA: {
  49531. uniforms: {},
  49532. vertexShader: n.ShaderChunk.depthRGBA_vert,
  49533. fragmentShader: n.ShaderChunk.depthRGBA_frag
  49534. },
  49535. distanceRGBA: {
  49536. uniforms: {
  49537. lightPos: {
  49538. type: "v3",
  49539. value: new n.Vector3(0,0,0)
  49540. }
  49541. },
  49542. vertexShader: n.ShaderChunk.distanceRGBA_vert,
  49543. fragmentShader: n.ShaderChunk.distanceRGBA_frag
  49544. }
  49545. },
  49546. n.WebGLRenderer = function(e) {
  49547. function t() {
  49548. return null === ye ? Oe : 1
  49549. }
  49550. function i(e, t, i, n) {
  49551. se === !0 && (e *= n,
  49552. t *= n,
  49553. i *= n),
  49554. Ye.clearColor(e, t, i, n)
  49555. }
  49556. function r() {
  49557. Ye.init(),
  49558. Ye.scissor(we.copy(Le).multiplyScalar(Oe)),
  49559. Ye.viewport(Te.copy(Ne).multiplyScalar(Oe)),
  49560. i(Se.r, Se.g, Se.b, Me)
  49561. }
  49562. function o() {
  49563. Ae = null,
  49564. be = null,
  49565. Ee = "",
  49566. Ie = -1,
  49567. Ye.reset()
  49568. }
  49569. function a(e) {
  49570. e.preventDefault(),
  49571. o(),
  49572. r(),
  49573. Xe.clear()
  49574. }
  49575. function s(e) {
  49576. var t = e.target;
  49577. t.removeEventListener("dispose", s),
  49578. h(t),
  49579. ke.textures--
  49580. }
  49581. function l(e) {
  49582. var t = e.target;
  49583. t.removeEventListener("dispose", l),
  49584. u(t),
  49585. ke.textures--
  49586. }
  49587. function c(e) {
  49588. var t = e.target;
  49589. t.removeEventListener("dispose", c),
  49590. d(t)
  49591. }
  49592. function h(e) {
  49593. var t = Xe.get(e);
  49594. if (e.image && t.__image__webglTextureCube)
  49595. Ge.deleteTexture(t.__image__webglTextureCube);
  49596. else {
  49597. if (void 0 === t.__webglInit)
  49598. return;
  49599. Ge.deleteTexture(t.__webglTexture)
  49600. }
  49601. Xe.delete(e)
  49602. }
  49603. function u(e) {
  49604. var t = Xe.get(e)
  49605. , i = Xe.get(e.texture);
  49606. if (e && void 0 !== i.__webglTexture) {
  49607. if (Ge.deleteTexture(i.__webglTexture),
  49608. e instanceof n.WebGLRenderTargetCube)
  49609. for (var r = 0; r < 6; r++)
  49610. Ge.deleteFramebuffer(t.__webglFramebuffer[r]),
  49611. Ge.deleteRenderbuffer(t.__webglDepthbuffer[r]);
  49612. else
  49613. Ge.deleteFramebuffer(t.__webglFramebuffer),
  49614. Ge.deleteRenderbuffer(t.__webglDepthbuffer);
  49615. Xe.delete(e.texture),
  49616. Xe.delete(e)
  49617. }
  49618. }
  49619. function d(e) {
  49620. p(e),
  49621. Xe.delete(e)
  49622. }
  49623. function p(e) {
  49624. var t = Xe.get(e).program;
  49625. e.program = void 0,
  49626. void 0 !== t && qe.releaseProgram(t)
  49627. }
  49628. function f(e, t, i, r) {
  49629. var o;
  49630. if (i instanceof n.InstancedBufferGeometry && (o = We.get("ANGLE_instanced_arrays"),
  49631. null === o))
  49632. return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  49633. void 0 === r && (r = 0),
  49634. Ye.initAttributes();
  49635. var a = i.attributes
  49636. , s = t.getAttributes()
  49637. , l = e.defaultAttributeValues;
  49638. for (var c in s) {
  49639. var h = s[c];
  49640. if (h >= 0) {
  49641. var u = a[c];
  49642. if (void 0 !== u) {
  49643. var d = u.itemSize
  49644. , p = Ze.getAttributeBuffer(u);
  49645. if (u instanceof n.InterleavedBufferAttribute) {
  49646. var f = u.data
  49647. , g = f.stride
  49648. , m = u.offset;
  49649. f instanceof n.InstancedInterleavedBuffer ? (Ye.enableAttributeAndDivisor(h, f.meshPerAttribute, o),
  49650. void 0 === i.maxInstancedCount && (i.maxInstancedCount = f.meshPerAttribute * f.count)) : Ye.enableAttribute(h),
  49651. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  49652. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, g * f.array.BYTES_PER_ELEMENT, (r * g + m) * f.array.BYTES_PER_ELEMENT)
  49653. } else
  49654. u instanceof n.InstancedBufferAttribute ? (Ye.enableAttributeAndDivisor(h, u.meshPerAttribute, o),
  49655. void 0 === i.maxInstancedCount && (i.maxInstancedCount = u.meshPerAttribute * u.count)) : Ye.enableAttribute(h),
  49656. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  49657. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, 0, r * d * 4)
  49658. } else if (void 0 !== l) {
  49659. var v = l[c];
  49660. if (void 0 !== v)
  49661. switch (v.length) {
  49662. case 2:
  49663. Ge.vertexAttrib2fv(h, v);
  49664. break;
  49665. case 3:
  49666. Ge.vertexAttrib3fv(h, v);
  49667. break;
  49668. case 4:
  49669. Ge.vertexAttrib4fv(h, v);
  49670. break;
  49671. default:
  49672. Ge.vertexAttrib1fv(h, v)
  49673. }
  49674. }
  49675. }
  49676. }
  49677. Ye.disableUnusedAttributes()
  49678. }
  49679. function g(e, t) {
  49680. return Math.abs(t[0]) - Math.abs(e[0])
  49681. }
  49682. function m(e, t) {
  49683. return e.object.renderOrder !== t.object.renderOrder ? e.object.renderOrder - t.object.renderOrder : e.material.id !== t.material.id ? e.material.id - t.material.id : e.z !== t.z ? e.z - t.z : e.id - t.id
  49684. }
  49685. function v(e, t) {
  49686. return e.object.renderOrder !== t.object.renderOrder ? e.object.renderOrder - t.object.renderOrder : e.z !== t.z ? t.z - e.z : e.id - t.id
  49687. }
  49688. function A(e, t, i, n, r) {
  49689. var o, a;
  49690. i.transparent ? (o = de,
  49691. a = ++pe) : (o = he,
  49692. a = ++ue);
  49693. var s = o[a];
  49694. void 0 !== s ? (s.id = e.id,
  49695. s.object = e,
  49696. s.geometry = t,
  49697. s.material = i,
  49698. s.z = Ve.z,
  49699. s.group = r) : (s = {
  49700. id: e.id,
  49701. object: e,
  49702. geometry: t,
  49703. material: i,
  49704. z: Ve.z,
  49705. group: r
  49706. },
  49707. o.push(s))
  49708. }
  49709. function y(e, t) {
  49710. if (e.visible !== !1) {
  49711. if (e.layers.test(t.layers))
  49712. if (e instanceof n.Light)
  49713. ce.push(e);
  49714. else if (e instanceof n.Sprite)
  49715. e.frustumCulled !== !1 && Be.intersectsObject(e) !== !0 || ge.push(e);
  49716. else if (e instanceof n.LensFlare)
  49717. me.push(e);
  49718. else if (e instanceof n.ImmediateRenderObject)
  49719. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  49720. Ve.applyProjection(Fe)),
  49721. A(e, null, e.material, Ve.z, null);
  49722. else if ((e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && (e instanceof n.SkinnedMesh && e.skeleton.update(),
  49723. e.frustumCulled === !1 || Be.intersectsObject(e) === !0)) {
  49724. var i = e.material;
  49725. if (i.visible === !0) {
  49726. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  49727. Ve.applyProjection(Fe));
  49728. var r = Ze.update(e);
  49729. if (i instanceof n.MultiMaterial)
  49730. for (var o = r.groups, a = i.materials, s = 0, l = o.length; s < l; s++) {
  49731. var c = o[s]
  49732. , h = a[c.materialIndex];
  49733. h.visible === !0 && A(e, r, h, Ve.z, c)
  49734. }
  49735. else
  49736. A(e, r, i, Ve.z, null)
  49737. }
  49738. }
  49739. for (var u = e.children, s = 0, l = u.length; s < l; s++)
  49740. y(u[s], t)
  49741. }
  49742. }
  49743. function C(e, t, i, r) {
  49744. for (var o = 0, a = e.length; o < a; o++) {
  49745. var s = e[o]
  49746. , l = s.object
  49747. , c = s.geometry
  49748. , h = void 0 === r ? s.material : r
  49749. , u = s.group;
  49750. if (l.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  49751. l.normalMatrix.getNormalMatrix(l.modelViewMatrix),
  49752. l instanceof n.ImmediateRenderObject) {
  49753. E(h);
  49754. var d = w(t, i, h, l);
  49755. Ee = "",
  49756. l.render(function(e) {
  49757. ve.renderBufferImmediate(e, d, h)
  49758. })
  49759. } else
  49760. ve.renderBufferDirect(t, i, c, h, l, u)
  49761. }
  49762. }
  49763. function I(e, t, i) {
  49764. var r = Xe.get(e)
  49765. , o = qe.getParameters(e, Ue, t, i)
  49766. , a = qe.getProgramCode(e, o)
  49767. , s = r.program
  49768. , l = !0;
  49769. if (void 0 === s)
  49770. e.addEventListener("dispose", c);
  49771. else if (s.code !== a)
  49772. p(e);
  49773. else {
  49774. if (void 0 !== o.shaderID)
  49775. return;
  49776. l = !1
  49777. }
  49778. if (l) {
  49779. if (o.shaderID) {
  49780. var h = n.ShaderLib[o.shaderID];
  49781. r.__webglShader = {
  49782. name: e.type,
  49783. uniforms: n.UniformsUtils.clone(h.uniforms),
  49784. vertexShader: h.vertexShader,
  49785. fragmentShader: h.fragmentShader
  49786. }
  49787. } else
  49788. r.__webglShader = {
  49789. name: e.type,
  49790. uniforms: e.uniforms,
  49791. vertexShader: e.vertexShader,
  49792. fragmentShader: e.fragmentShader
  49793. };
  49794. e.__webglShader = r.__webglShader,
  49795. s = qe.acquireProgram(e, o, a),
  49796. r.program = s,
  49797. e.program = s
  49798. }
  49799. var u = s.getAttributes();
  49800. if (e.morphTargets) {
  49801. e.numSupportedMorphTargets = 0;
  49802. for (var d = 0; d < ve.maxMorphTargets; d++)
  49803. u["morphTarget" + d] >= 0 && e.numSupportedMorphTargets++
  49804. }
  49805. if (e.morphNormals) {
  49806. e.numSupportedMorphNormals = 0;
  49807. for (var d = 0; d < ve.maxMorphNormals; d++)
  49808. u["morphNormal" + d] >= 0 && e.numSupportedMorphNormals++
  49809. }
  49810. r.uniformsList = [];
  49811. var f = r.__webglShader.uniforms
  49812. , g = r.program.getUniforms();
  49813. for (var m in f) {
  49814. var v = g[m];
  49815. v && r.uniformsList.push([r.__webglShader.uniforms[m], v])
  49816. }
  49817. (e instanceof n.MeshPhongMaterial || e instanceof n.MeshLambertMaterial || e instanceof n.MeshStandardMaterial || e.lights) && (r.lightsHash = Ue.hash,
  49818. f.ambientLightColor.value = Ue.ambient,
  49819. f.directionalLights.value = Ue.directional,
  49820. f.spotLights.value = Ue.spot,
  49821. f.pointLights.value = Ue.point,
  49822. f.hemisphereLights.value = Ue.hemi,
  49823. f.directionalShadowMap.value = Ue.directionalShadowMap,
  49824. f.directionalShadowMatrix.value = Ue.directionalShadowMatrix,
  49825. f.spotShadowMap.value = Ue.spotShadowMap,
  49826. f.spotShadowMatrix.value = Ue.spotShadowMatrix,
  49827. f.pointShadowMap.value = Ue.pointShadowMap,
  49828. f.pointShadowMatrix.value = Ue.pointShadowMatrix),
  49829. r.hasDynamicUniforms = !1;
  49830. for (var A = 0, y = r.uniformsList.length; A < y; A++) {
  49831. var C = r.uniformsList[A][0];
  49832. if (C.dynamic === !0) {
  49833. r.hasDynamicUniforms = !0;
  49834. break
  49835. }
  49836. }
  49837. }
  49838. function E(e) {
  49839. b(e),
  49840. e.transparent === !0 ? Ye.setBlending(e.blending, e.blendEquation, e.blendSrc, e.blendDst, e.blendEquationAlpha, e.blendSrcAlpha, e.blendDstAlpha, e.premultipliedAlpha) : Ye.setBlending(n.NoBlending),
  49841. Ye.setDepthFunc(e.depthFunc),
  49842. Ye.setDepthTest(e.depthTest),
  49843. Ye.setDepthWrite(e.depthWrite),
  49844. Ye.setColorWrite(e.colorWrite),
  49845. Ye.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  49846. }
  49847. function b(e) {
  49848. e.side !== n.DoubleSide ? Ye.enable(Ge.CULL_FACE) : Ye.disable(Ge.CULL_FACE),
  49849. Ye.setFlipSided(e.side === n.BackSide)
  49850. }
  49851. function w(e, t, i, r) {
  49852. xe = 0;
  49853. var o = Xe.get(i);
  49854. void 0 === o.program && (i.needsUpdate = !0),
  49855. void 0 !== o.lightsHash && o.lightsHash !== Ue.hash && (i.needsUpdate = !0),
  49856. i.needsUpdate && (I(i, t, r),
  49857. i.needsUpdate = !1);
  49858. var a = !1
  49859. , s = !1
  49860. , l = !1
  49861. , c = o.program
  49862. , h = c.getUniforms()
  49863. , u = o.__webglShader.uniforms;
  49864. if (c.id !== Ae && (Ge.useProgram(c.program),
  49865. Ae = c.id,
  49866. a = !0,
  49867. s = !0,
  49868. l = !0),
  49869. i.id !== Ie && (Ie = i.id,
  49870. s = !0),
  49871. (a || e !== be) && (Ge.uniformMatrix4fv(h.projectionMatrix, !1, e.projectionMatrix.elements),
  49872. je.logarithmicDepthBuffer && Ge.uniform1f(h.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  49873. e !== be && (be = e,
  49874. s = !0,
  49875. l = !0),
  49876. (i instanceof n.ShaderMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial || i.envMap) && void 0 !== h.cameraPosition && (Ve.setFromMatrixPosition(e.matrixWorld),
  49877. Ge.uniform3f(h.cameraPosition, Ve.x, Ve.y, Ve.z)),
  49878. (i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshBasicMaterial || i instanceof n.MeshStandardMaterial || i instanceof n.ShaderMaterial || i.skinning) && void 0 !== h.viewMatrix && Ge.uniformMatrix4fv(h.viewMatrix, !1, e.matrixWorldInverse.elements),
  49879. void 0 !== h.toneMappingExposure && Ge.uniform1f(h.toneMappingExposure, ve.toneMappingExposure),
  49880. void 0 !== h.toneMappingWhitePoint && Ge.uniform1f(h.toneMappingWhitePoint, ve.toneMappingWhitePoint)),
  49881. i.skinning)
  49882. if (r.bindMatrix && void 0 !== h.bindMatrix && Ge.uniformMatrix4fv(h.bindMatrix, !1, r.bindMatrix.elements),
  49883. r.bindMatrixInverse && void 0 !== h.bindMatrixInverse && Ge.uniformMatrix4fv(h.bindMatrixInverse, !1, r.bindMatrixInverse.elements),
  49884. je.floatVertexTextures && r.skeleton && r.skeleton.useVertexTexture) {
  49885. if (void 0 !== h.boneTexture) {
  49886. var d = B();
  49887. Ge.uniform1i(h.boneTexture, d),
  49888. ve.setTexture(r.skeleton.boneTexture, d)
  49889. }
  49890. void 0 !== h.boneTextureWidth && Ge.uniform1i(h.boneTextureWidth, r.skeleton.boneTextureWidth),
  49891. void 0 !== h.boneTextureHeight && Ge.uniform1i(h.boneTextureHeight, r.skeleton.boneTextureHeight)
  49892. } else
  49893. r.skeleton && r.skeleton.boneMatrices && void 0 !== h.boneGlobalMatrices && Ge.uniformMatrix4fv(h.boneGlobalMatrices, !1, r.skeleton.boneMatrices);
  49894. return s && ((i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshStandardMaterial || i.lights) && D(u, l),
  49895. t && i.fog && R(u, t),
  49896. (i instanceof n.MeshBasicMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial) && T(u, i),
  49897. i instanceof n.LineBasicMaterial ? x(u, i) : i instanceof n.LineDashedMaterial ? (x(u, i),
  49898. S(u, i)) : i instanceof n.PointsMaterial ? M(u, i) : i instanceof n.MeshLambertMaterial ? P(u, i) : i instanceof n.MeshPhongMaterial ? O(u, i) : i instanceof n.MeshStandardMaterial ? L(u, i) : i instanceof n.MeshDepthMaterial ? (u.mNear.value = e.near,
  49899. u.mFar.value = e.far,
  49900. u.opacity.value = i.opacity) : i instanceof n.MeshNormalMaterial && (u.opacity.value = i.opacity),
  49901. V(o.uniformsList)),
  49902. N(h, r),
  49903. void 0 !== h.modelMatrix && Ge.uniformMatrix4fv(h.modelMatrix, !1, r.matrixWorld.elements),
  49904. o.hasDynamicUniforms === !0 && _(o.uniformsList, r, e),
  49905. c
  49906. }
  49907. function _(e, t, i) {
  49908. for (var n = [], r = 0, o = e.length; r < o; r++) {
  49909. var a = e[r][0]
  49910. , s = a.onUpdateCallback;
  49911. void 0 !== s && (s.bind(a)(t, i),
  49912. n.push(e[r]))
  49913. }
  49914. V(n)
  49915. }
  49916. function T(e, t) {
  49917. e.opacity.value = t.opacity,
  49918. e.diffuse.value = t.color,
  49919. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  49920. e.map.value = t.map,
  49921. e.specularMap.value = t.specularMap,
  49922. e.alphaMap.value = t.alphaMap,
  49923. t.aoMap && (e.aoMap.value = t.aoMap,
  49924. e.aoMapIntensity.value = t.aoMapIntensity);
  49925. var i;
  49926. if (t.map ? i = t.map : t.specularMap ? i = t.specularMap : t.displacementMap ? i = t.displacementMap : t.normalMap ? i = t.normalMap : t.bumpMap ? i = t.bumpMap : t.roughnessMap ? i = t.roughnessMap : t.metalnessMap ? i = t.metalnessMap : t.alphaMap ? i = t.alphaMap : t.emissiveMap && (i = t.emissiveMap),
  49927. void 0 !== i) {
  49928. i instanceof n.WebGLRenderTarget && (i = i.texture);
  49929. var r = i.offset
  49930. , o = i.repeat;
  49931. e.offsetRepeat.value.set(r.x, r.y, o.x, o.y)
  49932. }
  49933. e.envMap.value = t.envMap,
  49934. e.flipEnvMap.value = t.envMap instanceof n.WebGLRenderTargetCube ? 1 : -1,
  49935. e.reflectivity.value = t.reflectivity,
  49936. e.refractionRatio.value = t.refractionRatio
  49937. }
  49938. function x(e, t) {
  49939. e.diffuse.value = t.color,
  49940. e.opacity.value = t.opacity
  49941. }
  49942. function S(e, t) {
  49943. e.dashSize.value = t.dashSize,
  49944. e.totalSize.value = t.dashSize + t.gapSize,
  49945. e.scale.value = t.scale
  49946. }
  49947. function M(e, t) {
  49948. if (e.diffuse.value = t.color,
  49949. e.opacity.value = t.opacity,
  49950. e.size.value = t.size * Oe,
  49951. e.scale.value = te.clientHeight / 2,
  49952. e.map.value = t.map,
  49953. null !== t.map) {
  49954. var i = t.map.offset
  49955. , n = t.map.repeat;
  49956. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  49957. }
  49958. }
  49959. function R(e, t) {
  49960. e.fogColor.value = t.color,
  49961. t instanceof n.Fog ? (e.fogNear.value = t.near,
  49962. e.fogFar.value = t.far) : t instanceof n.FogExp2 && (e.fogDensity.value = t.density)
  49963. }
  49964. function P(e, t) {
  49965. t.lightMap && (e.lightMap.value = t.lightMap,
  49966. e.lightMapIntensity.value = t.lightMapIntensity),
  49967. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  49968. }
  49969. function O(e, t) {
  49970. e.specular.value = t.specular,
  49971. e.shininess.value = Math.max(t.shininess, 1e-4),
  49972. t.lightMap && (e.lightMap.value = t.lightMap,
  49973. e.lightMapIntensity.value = t.lightMapIntensity),
  49974. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  49975. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  49976. e.bumpScale.value = t.bumpScale),
  49977. t.normalMap && (e.normalMap.value = t.normalMap,
  49978. e.normalScale.value.copy(t.normalScale)),
  49979. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  49980. e.displacementScale.value = t.displacementScale,
  49981. e.displacementBias.value = t.displacementBias)
  49982. }
  49983. function L(e, t) {
  49984. e.roughness.value = t.roughness,
  49985. e.metalness.value = t.metalness,
  49986. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  49987. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  49988. t.lightMap && (e.lightMap.value = t.lightMap,
  49989. e.lightMapIntensity.value = t.lightMapIntensity),
  49990. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  49991. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  49992. e.bumpScale.value = t.bumpScale),
  49993. t.normalMap && (e.normalMap.value = t.normalMap,
  49994. e.normalScale.value.copy(t.normalScale)),
  49995. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  49996. e.displacementScale.value = t.displacementScale,
  49997. e.displacementBias.value = t.displacementBias),
  49998. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  49999. }
  50000. function D(e, t) {
  50001. e.ambientLightColor.needsUpdate = t,
  50002. e.directionalLights.needsUpdate = t,
  50003. e.pointLights.needsUpdate = t,
  50004. e.spotLights.needsUpdate = t,
  50005. e.hemisphereLights.needsUpdate = t
  50006. }
  50007. function N(e, t) {
  50008. Ge.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  50009. e.normalMatrix && Ge.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  50010. }
  50011. function B() {
  50012. var e = xe;
  50013. return e >= je.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + je.maxTextures),
  50014. xe += 1,
  50015. e
  50016. }
  50017. function F(e, t, i, r) {
  50018. var o, a;
  50019. if ("1i" === t)
  50020. Ge.uniform1i(i, r);
  50021. else if ("1f" === t)
  50022. Ge.uniform1f(i, r);
  50023. else if ("2f" === t)
  50024. Ge.uniform2f(i, r[0], r[1]);
  50025. else if ("3f" === t)
  50026. Ge.uniform3f(i, r[0], r[1], r[2]);
  50027. else if ("4f" === t)
  50028. Ge.uniform4f(i, r[0], r[1], r[2], r[3]);
  50029. else if ("1iv" === t)
  50030. Ge.uniform1iv(i, r);
  50031. else if ("3iv" === t)
  50032. Ge.uniform3iv(i, r);
  50033. else if ("1fv" === t)
  50034. Ge.uniform1fv(i, r);
  50035. else if ("2fv" === t)
  50036. Ge.uniform2fv(i, r);
  50037. else if ("3fv" === t)
  50038. Ge.uniform3fv(i, r);
  50039. else if ("4fv" === t)
  50040. Ge.uniform4fv(i, r);
  50041. else if ("Matrix2fv" === t)
  50042. Ge.uniformMatrix2fv(i, !1, r);
  50043. else if ("Matrix3fv" === t)
  50044. Ge.uniformMatrix3fv(i, !1, r);
  50045. else if ("Matrix4fv" === t)
  50046. Ge.uniformMatrix4fv(i, !1, r);
  50047. else if ("i" === t)
  50048. Ge.uniform1i(i, r);
  50049. else if ("f" === t)
  50050. Ge.uniform1f(i, r);
  50051. else if ("v2" === t)
  50052. Ge.uniform2f(i, r.x, r.y);
  50053. else if ("v3" === t)
  50054. Ge.uniform3f(i, r.x, r.y, r.z);
  50055. else if ("v4" === t)
  50056. Ge.uniform4f(i, r.x, r.y, r.z, r.w);
  50057. else if ("c" === t)
  50058. Ge.uniform3f(i, r.r, r.g, r.b);
  50059. else if ("s" === t) {
  50060. var s = e.properties;
  50061. for (var l in s) {
  50062. var c = s[l]
  50063. , h = i[l]
  50064. , u = r[l];
  50065. F(c, c.type, h, u)
  50066. }
  50067. } else if ("sa" === t)
  50068. for (var s = e.properties, d = 0, p = r.length; d < p; d++)
  50069. for (var l in s) {
  50070. var c = s[l]
  50071. , h = i[d][l]
  50072. , u = r[d][l];
  50073. F(c, c.type, h, u)
  50074. }
  50075. else if ("iv1" === t)
  50076. Ge.uniform1iv(i, r);
  50077. else if ("iv" === t)
  50078. Ge.uniform3iv(i, r);
  50079. else if ("fv1" === t)
  50080. Ge.uniform1fv(i, r);
  50081. else if ("fv" === t)
  50082. Ge.uniform3fv(i, r);
  50083. else if ("v2v" === t) {
  50084. void 0 === e._array && (e._array = new Float32Array(2 * r.length));
  50085. for (var d = 0, f = 0, g = r.length; d < g; d++,
  50086. f += 2)
  50087. e._array[f + 0] = r[d].x,
  50088. e._array[f + 1] = r[d].y;
  50089. Ge.uniform2fv(i, e._array)
  50090. } else if ("v3v" === t) {
  50091. void 0 === e._array && (e._array = new Float32Array(3 * r.length));
  50092. for (var d = 0, m = 0, g = r.length; d < g; d++,
  50093. m += 3)
  50094. e._array[m + 0] = r[d].x,
  50095. e._array[m + 1] = r[d].y,
  50096. e._array[m + 2] = r[d].z;
  50097. Ge.uniform3fv(i, e._array)
  50098. } else if ("v4v" === t) {
  50099. void 0 === e._array && (e._array = new Float32Array(4 * r.length));
  50100. for (var d = 0, v = 0, g = r.length; d < g; d++,
  50101. v += 4)
  50102. e._array[v + 0] = r[d].x,
  50103. e._array[v + 1] = r[d].y,
  50104. e._array[v + 2] = r[d].z,
  50105. e._array[v + 3] = r[d].w;
  50106. Ge.uniform4fv(i, e._array)
  50107. } else if ("m2" === t)
  50108. Ge.uniformMatrix2fv(i, !1, r.elements);
  50109. else if ("m3" === t)
  50110. Ge.uniformMatrix3fv(i, !1, r.elements);
  50111. else if ("m3v" === t) {
  50112. void 0 === e._array && (e._array = new Float32Array(9 * r.length));
  50113. for (var d = 0, g = r.length; d < g; d++)
  50114. r[d].flattenToArrayOffset(e._array, 9 * d);
  50115. Ge.uniformMatrix3fv(i, !1, e._array)
  50116. } else if ("m4" === t)
  50117. Ge.uniformMatrix4fv(i, !1, r.elements);
  50118. else if ("m4v" === t) {
  50119. void 0 === e._array && (e._array = new Float32Array(16 * r.length));
  50120. for (var d = 0, g = r.length; d < g; d++)
  50121. r[d].flattenToArrayOffset(e._array, 16 * d);
  50122. Ge.uniformMatrix4fv(i, !1, e._array)
  50123. } else if ("t" === t) {
  50124. if (o = r,
  50125. a = B(),
  50126. Ge.uniform1i(i, a),
  50127. !o)
  50128. return;
  50129. o instanceof n.CubeTexture || Array.isArray(o.image) && 6 === o.image.length ? Y(o, a) : o instanceof n.WebGLRenderTargetCube ? X(o.texture, a) : o instanceof n.WebGLRenderTarget ? ve.setTexture(o.texture, a) : ve.setTexture(o, a)
  50130. } else if ("tv" === t) {
  50131. void 0 === e._array && (e._array = []);
  50132. for (var d = 0, g = e.value.length; d < g; d++)
  50133. e._array[d] = B();
  50134. Ge.uniform1iv(i, e._array);
  50135. for (var d = 0, g = e.value.length; d < g; d++)
  50136. o = e.value[d],
  50137. a = e._array[d],
  50138. o && (o instanceof n.CubeTexture || o.image instanceof Array && 6 === o.image.length ? Y(o, a) : o instanceof n.WebGLRenderTarget ? ve.setTexture(o.texture, a) : o instanceof n.WebGLRenderTargetCube ? X(o.texture, a) : ve.setTexture(o, a))
  50139. } else
  50140. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  50141. }
  50142. function V(e) {
  50143. for (var t = 0, i = e.length; t < i; t++) {
  50144. var n = e[t][0];
  50145. if (n.needsUpdate !== !1) {
  50146. var r = n.type
  50147. , o = e[t][1]
  50148. , a = n.value;
  50149. F(n, r, o, a)
  50150. }
  50151. }
  50152. }
  50153. function U(e, t) {
  50154. var i, r, o, a, s, l, c = 0, h = 0, u = 0, d = t.matrixWorldInverse, p = 0, f = 0, g = 0, m = 0, v = 0;
  50155. for (Ue.shadowsPointLight = 0,
  50156. i = 0,
  50157. r = e.length; i < r; i++)
  50158. if (o = e[i],
  50159. a = o.color,
  50160. s = o.intensity,
  50161. l = o.distance,
  50162. o instanceof n.AmbientLight)
  50163. c += a.r * s,
  50164. h += a.g * s,
  50165. u += a.b * s;
  50166. else if (o instanceof n.DirectionalLight) {
  50167. var A = Ke.get(o);
  50168. A.color.copy(o.color).multiplyScalar(o.intensity),
  50169. A.direction.setFromMatrixPosition(o.matrixWorld),
  50170. Ve.setFromMatrixPosition(o.target.matrixWorld),
  50171. A.direction.sub(Ve),
  50172. A.direction.transformDirection(d),
  50173. A.shadow = o.castShadow,
  50174. o.castShadow && (A.shadowBias = o.shadow.bias,
  50175. A.shadowRadius = o.shadow.radius,
  50176. A.shadowMapSize = o.shadow.mapSize,
  50177. Ue.shadows[v++] = o),
  50178. Ue.directionalShadowMap[p] = o.shadow.map,
  50179. Ue.directionalShadowMatrix[p] = o.shadow.matrix,
  50180. Ue.directional[p++] = A
  50181. } else if (o instanceof n.SpotLight) {
  50182. var A = Ke.get(o);
  50183. A.position.setFromMatrixPosition(o.matrixWorld),
  50184. A.position.applyMatrix4(d),
  50185. A.color.copy(a).multiplyScalar(s),
  50186. A.distance = l,
  50187. A.direction.setFromMatrixPosition(o.matrixWorld),
  50188. Ve.setFromMatrixPosition(o.target.matrixWorld),
  50189. A.direction.sub(Ve),
  50190. A.direction.transformDirection(d),
  50191. A.coneCos = Math.cos(o.angle),
  50192. A.penumbraCos = Math.cos(o.angle * (1 - o.penumbra)),
  50193. A.decay = 0 === o.distance ? 0 : o.decay,
  50194. A.shadow = o.castShadow,
  50195. o.castShadow && (A.shadowBias = o.shadow.bias,
  50196. A.shadowRadius = o.shadow.radius,
  50197. A.shadowMapSize = o.shadow.mapSize,
  50198. Ue.shadows[v++] = o),
  50199. Ue.spotShadowMap[g] = o.shadow.map,
  50200. Ue.spotShadowMatrix[g] = o.shadow.matrix,
  50201. Ue.spot[g++] = A
  50202. } else if (o instanceof n.PointLight) {
  50203. var A = Ke.get(o);
  50204. A.position.setFromMatrixPosition(o.matrixWorld),
  50205. A.position.applyMatrix4(d),
  50206. A.color.copy(o.color).multiplyScalar(o.intensity),
  50207. A.distance = o.distance,
  50208. A.decay = 0 === o.distance ? 0 : o.decay,
  50209. A.shadow = o.castShadow,
  50210. o.castShadow && (A.shadowBias = o.shadow.bias,
  50211. A.shadowRadius = o.shadow.radius,
  50212. A.shadowMapSize = o.shadow.mapSize,
  50213. Ue.shadows[v++] = o),
  50214. Ue.pointShadowMap[f] = o.shadow.map,
  50215. void 0 === Ue.pointShadowMatrix[f] && (Ue.pointShadowMatrix[f] = new n.Matrix4),
  50216. Ve.setFromMatrixPosition(o.matrixWorld).negate(),
  50217. Ue.pointShadowMatrix[f].identity().setPosition(Ve),
  50218. Ue.point[f++] = A
  50219. } else if (o instanceof n.HemisphereLight) {
  50220. var A = Ke.get(o);
  50221. A.direction.setFromMatrixPosition(o.matrixWorld),
  50222. A.direction.transformDirection(d),
  50223. A.direction.normalize(),
  50224. A.skyColor.copy(o.color).multiplyScalar(s),
  50225. A.groundColor.copy(o.groundColor).multiplyScalar(s),
  50226. Ue.hemi[m++] = A
  50227. }
  50228. Ue.ambient[0] = c,
  50229. Ue.ambient[1] = h,
  50230. Ue.ambient[2] = u,
  50231. Ue.directional.length = p,
  50232. Ue.spot.length = g,
  50233. Ue.point.length = f,
  50234. Ue.hemi.length = m,
  50235. Ue.shadows.length = v,
  50236. Ue.hash = p + "," + f + "," + g + "," + m + "," + v
  50237. }
  50238. function k(e, t, i) {
  50239. var r;
  50240. if (i ? (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, ee(t.wrapS)),
  50241. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, ee(t.wrapT)),
  50242. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, ee(t.magFilter)),
  50243. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, ee(t.minFilter))) : (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, Ge.CLAMP_TO_EDGE),
  50244. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, Ge.CLAMP_TO_EDGE),
  50245. t.wrapS === n.ClampToEdgeWrapping && t.wrapT === n.ClampToEdgeWrapping || console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.", t),
  50246. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, $(t.magFilter)),
  50247. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, $(t.minFilter)),
  50248. t.minFilter !== n.NearestFilter && t.minFilter !== n.LinearFilter && console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.", t)),
  50249. r = We.get("EXT_texture_filter_anisotropic")) {
  50250. if (t.type === n.FloatType && null === We.get("OES_texture_float_linear"))
  50251. return;
  50252. if (t.type === n.HalfFloatType && null === We.get("OES_texture_half_float_linear"))
  50253. return;
  50254. (t.anisotropy > 1 || Xe.get(t).__currentAnisotropy) && (Ge.texParameterf(e, r.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, ve.getMaxAnisotropy())),
  50255. Xe.get(t).__currentAnisotropy = t.anisotropy)
  50256. }
  50257. }
  50258. function H(e, t, i) {
  50259. void 0 === e.__webglInit && (e.__webglInit = !0,
  50260. t.addEventListener("dispose", s),
  50261. e.__webglTexture = Ge.createTexture(),
  50262. ke.textures++),
  50263. Ye.activeTexture(Ge.TEXTURE0 + i),
  50264. Ye.bindTexture(Ge.TEXTURE_2D, e.__webglTexture),
  50265. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, t.flipY),
  50266. Ge.pixelStorei(Ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  50267. Ge.pixelStorei(Ge.UNPACK_ALIGNMENT, t.unpackAlignment);
  50268. var r = G(t.image, je.maxTextureSize);
  50269. W(t) && z(r) === !1 && (r = j(r));
  50270. var o = z(r)
  50271. , a = ee(t.format)
  50272. , l = ee(t.type);
  50273. k(Ge.TEXTURE_2D, t, o);
  50274. var c, h = t.mipmaps;
  50275. if (t instanceof n.DataTexture)
  50276. if (h.length > 0 && o) {
  50277. for (var u = 0, d = h.length; u < d; u++)
  50278. c = h[u],
  50279. Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  50280. t.generateMipmaps = !1
  50281. } else
  50282. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, r.width, r.height, 0, a, l, r.data);
  50283. else if (t instanceof n.CompressedTexture)
  50284. for (var u = 0, d = h.length; u < d; u++)
  50285. c = h[u],
  50286. t.format !== n.RGBAFormat && t.format !== n.RGBFormat ? Ye.getCompressedTextureFormats().indexOf(a) > -1 ? Ye.compressedTexImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, c.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  50287. else if (h.length > 0 && o) {
  50288. for (var u = 0, d = h.length; u < d; u++)
  50289. c = h[u],
  50290. Ye.texImage2D(Ge.TEXTURE_2D, u, a, a, l, c);
  50291. t.generateMipmaps = !1
  50292. } else
  50293. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, a, l, r);
  50294. t.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  50295. e.__version = t.version,
  50296. t.onUpdate && t.onUpdate(t)
  50297. }
  50298. function G(e, t) {
  50299. if (e.width > t || e.height > t) {
  50300. var i = t / Math.max(e.width, e.height)
  50301. , n = document.createElement("canvas");
  50302. n.width = Math.floor(e.width * i),
  50303. n.height = Math.floor(e.height * i);
  50304. var r = n.getContext("2d");
  50305. return r.drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  50306. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  50307. n
  50308. }
  50309. return e
  50310. }
  50311. function z(e) {
  50312. return n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  50313. }
  50314. function W(e) {
  50315. return e.wrapS !== n.ClampToEdgeWrapping || e.wrapT !== n.ClampToEdgeWrapping || e.minFilter !== n.NearestFilter && e.minFilter !== n.LinearFilter
  50316. }
  50317. function j(e) {
  50318. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  50319. var t = document.createElement("canvas");
  50320. t.width = n.Math.nearestPowerOfTwo(e.width),
  50321. t.height = n.Math.nearestPowerOfTwo(e.height);
  50322. var i = t.getContext("2d");
  50323. return i.drawImage(e, 0, 0, t.width, t.height),
  50324. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  50325. t
  50326. }
  50327. return e
  50328. }
  50329. function Y(e, t) {
  50330. var i = Xe.get(e);
  50331. if (6 === e.image.length)
  50332. if (e.version > 0 && i.__version !== e.version) {
  50333. i.__image__webglTextureCube || (e.addEventListener("dispose", s),
  50334. i.__image__webglTextureCube = Ge.createTexture(),
  50335. ke.textures++),
  50336. Ye.activeTexture(Ge.TEXTURE0 + t),
  50337. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  50338. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, e.flipY);
  50339. for (var r = e instanceof n.CompressedTexture, o = e.image[0]instanceof n.DataTexture, a = [], l = 0; l < 6; l++)
  50340. !ve.autoScaleCubemaps || r || o ? a[l] = o ? e.image[l].image : e.image[l] : a[l] = G(e.image[l], je.maxCubemapSize);
  50341. var c = a[0]
  50342. , h = z(c)
  50343. , u = ee(e.format)
  50344. , d = ee(e.type);
  50345. k(Ge.TEXTURE_CUBE_MAP, e, h);
  50346. for (var l = 0; l < 6; l++)
  50347. if (r)
  50348. for (var p, f = a[l].mipmaps, g = 0, m = f.length; g < m; g++)
  50349. p = f[g],
  50350. e.format !== n.RGBAFormat && e.format !== n.RGBFormat ? Ye.getCompressedTextureFormats().indexOf(u) > -1 ? Ye.compressedTexImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, g, u, p.width, p.height, 0, p.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()") : Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, g, u, p.width, p.height, 0, u, d, p.data);
  50351. else
  50352. o ? Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, 0, u, a[l].width, a[l].height, 0, u, d, a[l].data) : Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, 0, u, u, d, a[l]);
  50353. e.generateMipmaps && h && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  50354. i.__version = e.version,
  50355. e.onUpdate && e.onUpdate(e)
  50356. } else
  50357. Ye.activeTexture(Ge.TEXTURE0 + t),
  50358. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  50359. }
  50360. function X(e, t) {
  50361. Ye.activeTexture(Ge.TEXTURE0 + t),
  50362. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, Xe.get(e).__webglTexture)
  50363. }
  50364. function Z(e, t, i, n) {
  50365. var r = ee(t.texture.format)
  50366. , o = ee(t.texture.type);
  50367. Ye.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  50368. Ge.bindFramebuffer(Ge.FRAMEBUFFER, e),
  50369. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, i, n, Xe.get(t.texture).__webglTexture, 0),
  50370. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  50371. }
  50372. function q(e, t) {
  50373. Ge.bindRenderbuffer(Ge.RENDERBUFFER, e),
  50374. t.depthBuffer && !t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_COMPONENT16, t.width, t.height),
  50375. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_ATTACHMENT, Ge.RENDERBUFFER, e)) : t.depthBuffer && t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_STENCIL, t.width, t.height),
  50376. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_STENCIL_ATTACHMENT, Ge.RENDERBUFFER, e)) : Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.RGBA4, t.width, t.height),
  50377. Ge.bindRenderbuffer(Ge.RENDERBUFFER, null)
  50378. }
  50379. function K(e) {
  50380. var t = Xe.get(e)
  50381. , i = e instanceof n.WebGLRenderTargetCube;
  50382. if (i) {
  50383. t.__webglDepthbuffer = [];
  50384. for (var r = 0; r < 6; r++)
  50385. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer[r]),
  50386. t.__webglDepthbuffer[r] = Ge.createRenderbuffer(),
  50387. q(t.__webglDepthbuffer[r], e)
  50388. } else
  50389. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer),
  50390. t.__webglDepthbuffer = Ge.createRenderbuffer(),
  50391. q(t.__webglDepthbuffer, e);
  50392. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  50393. }
  50394. function Q(e) {
  50395. var t = Xe.get(e)
  50396. , i = Xe.get(e.texture);
  50397. e.addEventListener("dispose", l),
  50398. i.__webglTexture = Ge.createTexture(),
  50399. ke.textures++;
  50400. var r = e instanceof n.WebGLRenderTargetCube
  50401. , o = n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height);
  50402. if (r) {
  50403. t.__webglFramebuffer = [];
  50404. for (var a = 0; a < 6; a++)
  50405. t.__webglFramebuffer[a] = Ge.createFramebuffer()
  50406. } else
  50407. t.__webglFramebuffer = Ge.createFramebuffer();
  50408. if (r) {
  50409. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__webglTexture),
  50410. k(Ge.TEXTURE_CUBE_MAP, e.texture, o);
  50411. for (var a = 0; a < 6; a++)
  50412. Z(t.__webglFramebuffer[a], e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + a);
  50413. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  50414. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, null)
  50415. } else
  50416. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture),
  50417. k(Ge.TEXTURE_2D, e.texture, o),
  50418. Z(t.__webglFramebuffer, e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_2D),
  50419. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  50420. Ye.bindTexture(Ge.TEXTURE_2D, null);
  50421. e.depthBuffer && K(e)
  50422. }
  50423. function J(e) {
  50424. var t = e instanceof n.WebGLRenderTargetCube ? Ge.TEXTURE_CUBE_MAP : Ge.TEXTURE_2D
  50425. , i = Xe.get(e.texture).__webglTexture;
  50426. Ye.bindTexture(t, i),
  50427. Ge.generateMipmap(t),
  50428. Ye.bindTexture(t, null)
  50429. }
  50430. function $(e) {
  50431. return e === n.NearestFilter || e === n.NearestMipMapNearestFilter || e === n.NearestMipMapLinearFilter ? Ge.NEAREST : Ge.LINEAR
  50432. }
  50433. function ee(e) {
  50434. var t;
  50435. if (e === n.RepeatWrapping)
  50436. return Ge.REPEAT;
  50437. if (e === n.ClampToEdgeWrapping)
  50438. return Ge.CLAMP_TO_EDGE;
  50439. if (e === n.MirroredRepeatWrapping)
  50440. return Ge.MIRRORED_REPEAT;
  50441. if (e === n.NearestFilter)
  50442. return Ge.NEAREST;
  50443. if (e === n.NearestMipMapNearestFilter)
  50444. return Ge.NEAREST_MIPMAP_NEAREST;
  50445. if (e === n.NearestMipMapLinearFilter)
  50446. return Ge.NEAREST_MIPMAP_LINEAR;
  50447. if (e === n.LinearFilter)
  50448. return Ge.LINEAR;
  50449. if (e === n.LinearMipMapNearestFilter)
  50450. return Ge.LINEAR_MIPMAP_NEAREST;
  50451. if (e === n.LinearMipMapLinearFilter)
  50452. return Ge.LINEAR_MIPMAP_LINEAR;
  50453. if (e === n.UnsignedByteType)
  50454. return Ge.UNSIGNED_BYTE;
  50455. if (e === n.UnsignedShort4444Type)
  50456. return Ge.UNSIGNED_SHORT_4_4_4_4;
  50457. if (e === n.UnsignedShort5551Type)
  50458. return Ge.UNSIGNED_SHORT_5_5_5_1;
  50459. if (e === n.UnsignedShort565Type)
  50460. return Ge.UNSIGNED_SHORT_5_6_5;
  50461. if (e === n.ByteType)
  50462. return Ge.BYTE;
  50463. if (e === n.ShortType)
  50464. return Ge.SHORT;
  50465. if (e === n.UnsignedShortType)
  50466. return Ge.UNSIGNED_SHORT;
  50467. if (e === n.IntType)
  50468. return Ge.INT;
  50469. if (e === n.UnsignedIntType)
  50470. return Ge.UNSIGNED_INT;
  50471. if (e === n.FloatType)
  50472. return Ge.FLOAT;
  50473. if (t = We.get("OES_texture_half_float"),
  50474. null !== t && e === n.HalfFloatType)
  50475. return t.HALF_FLOAT_OES;
  50476. if (e === n.AlphaFormat)
  50477. return Ge.ALPHA;
  50478. if (e === n.RGBFormat)
  50479. return Ge.RGB;
  50480. if (e === n.RGBAFormat)
  50481. return Ge.RGBA;
  50482. if (e === n.LuminanceFormat)
  50483. return Ge.LUMINANCE;
  50484. if (e === n.LuminanceAlphaFormat)
  50485. return Ge.LUMINANCE_ALPHA;
  50486. if (e === n.AddEquation)
  50487. return Ge.FUNC_ADD;
  50488. if (e === n.SubtractEquation)
  50489. return Ge.FUNC_SUBTRACT;
  50490. if (e === n.ReverseSubtractEquation)
  50491. return Ge.FUNC_REVERSE_SUBTRACT;
  50492. if (e === n.ZeroFactor)
  50493. return Ge.ZERO;
  50494. if (e === n.OneFactor)
  50495. return Ge.ONE;
  50496. if (e === n.SrcColorFactor)
  50497. return Ge.SRC_COLOR;
  50498. if (e === n.OneMinusSrcColorFactor)
  50499. return Ge.ONE_MINUS_SRC_COLOR;
  50500. if (e === n.SrcAlphaFactor)
  50501. return Ge.SRC_ALPHA;
  50502. if (e === n.OneMinusSrcAlphaFactor)
  50503. return Ge.ONE_MINUS_SRC_ALPHA;
  50504. if (e === n.DstAlphaFactor)
  50505. return Ge.DST_ALPHA;
  50506. if (e === n.OneMinusDstAlphaFactor)
  50507. return Ge.ONE_MINUS_DST_ALPHA;
  50508. if (e === n.DstColorFactor)
  50509. return Ge.DST_COLOR;
  50510. if (e === n.OneMinusDstColorFactor)
  50511. return Ge.ONE_MINUS_DST_COLOR;
  50512. if (e === n.SrcAlphaSaturateFactor)
  50513. return Ge.SRC_ALPHA_SATURATE;
  50514. if (t = We.get("WEBGL_compressed_texture_s3tc"),
  50515. null !== t) {
  50516. if (e === n.RGB_S3TC_DXT1_Format)
  50517. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  50518. if (e === n.RGBA_S3TC_DXT1_Format)
  50519. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  50520. if (e === n.RGBA_S3TC_DXT3_Format)
  50521. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  50522. if (e === n.RGBA_S3TC_DXT5_Format)
  50523. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  50524. }
  50525. if (t = We.get("WEBGL_compressed_texture_pvrtc"),
  50526. null !== t) {
  50527. if (e === n.RGB_PVRTC_4BPPV1_Format)
  50528. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  50529. if (e === n.RGB_PVRTC_2BPPV1_Format)
  50530. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  50531. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  50532. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  50533. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  50534. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  50535. }
  50536. if (t = We.get("WEBGL_compressed_texture_etc1"),
  50537. null !== t && e === n.RGB_ETC1_Format)
  50538. return t.COMPRESSED_RGB_ETC1_WEBGL;
  50539. if (t = We.get("EXT_blend_minmax"),
  50540. null !== t) {
  50541. if (e === n.MinEquation)
  50542. return t.MIN_EXT;
  50543. if (e === n.MaxEquation)
  50544. return t.MAX_EXT
  50545. }
  50546. return 0
  50547. }
  50548. console.log("THREE.WebGLRenderer", n.REVISION),
  50549. e = e || {};
  50550. var te = void 0 !== e.canvas ? e.canvas : document.createElement("canvas")
  50551. , ie = void 0 !== e.context ? e.context : null
  50552. , ne = void 0 !== e.alpha && e.alpha
  50553. , re = void 0 === e.depth || e.depth
  50554. , oe = void 0 === e.stencil || e.stencil
  50555. , ae = void 0 !== e.antialias && e.antialias
  50556. , se = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  50557. , le = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  50558. , ce = []
  50559. , he = []
  50560. , ue = -1
  50561. , de = []
  50562. , pe = -1
  50563. , fe = new Float32Array(8)
  50564. , ge = []
  50565. , me = [];
  50566. this.domElement = te,
  50567. this.context = null,
  50568. this.autoClear = !0,
  50569. this.autoClearColor = !0,
  50570. this.autoClearDepth = !0,
  50571. this.autoClearStencil = !0,
  50572. this.sortObjects = !0,
  50573. this.gammaFactor = 2,
  50574. this.gammaInput = !1,
  50575. this.gammaOutput = !1,
  50576. this.physicallyCorrectLights = !1,
  50577. this.toneMapping = n.LinearToneMapping,
  50578. this.toneMappingExposure = 1,
  50579. this.toneMappingWhitePoint = 1,
  50580. this.maxMorphTargets = 8,
  50581. this.maxMorphNormals = 4,
  50582. this.autoScaleCubemaps = !0;
  50583. var ve = this
  50584. , Ae = null
  50585. , ye = null
  50586. , Ce = null
  50587. , Ie = -1
  50588. , Ee = ""
  50589. , be = null
  50590. , we = new n.Vector4
  50591. , _e = null
  50592. , Te = new n.Vector4
  50593. , xe = 0
  50594. , Se = new n.Color(0)
  50595. , Me = 0
  50596. , Re = te.width
  50597. , Pe = te.height
  50598. , Oe = 1
  50599. , Le = new n.Vector4(0,0,Re,Pe)
  50600. , De = !1
  50601. , Ne = new n.Vector4(0,0,Re,Pe)
  50602. , Be = new n.Frustum
  50603. , Fe = new n.Matrix4
  50604. , Ve = new n.Vector3
  50605. , Ue = {
  50606. hash: "",
  50607. ambient: [0, 0, 0],
  50608. directional: [],
  50609. directionalShadowMap: [],
  50610. directionalShadowMatrix: [],
  50611. spot: [],
  50612. spotShadowMap: [],
  50613. spotShadowMatrix: [],
  50614. point: [],
  50615. pointShadowMap: [],
  50616. pointShadowMatrix: [],
  50617. hemi: [],
  50618. shadows: [],
  50619. shadowsPointLight: 0
  50620. }
  50621. , ke = {
  50622. geometries: 0,
  50623. textures: 0
  50624. }
  50625. , He = {
  50626. calls: 0,
  50627. vertices: 0,
  50628. faces: 0,
  50629. points: 0
  50630. };
  50631. this.info = {
  50632. render: He,
  50633. memory: ke,
  50634. programs: null
  50635. };
  50636. var Ge;
  50637. try {
  50638. var ze = {
  50639. alpha: ne,
  50640. depth: re,
  50641. stencil: oe,
  50642. antialias: ae,
  50643. premultipliedAlpha: se,
  50644. preserveDrawingBuffer: le
  50645. };
  50646. if (Ge = ie || te.getContext("webgl", ze) || te.getContext("experimental-webgl", ze),
  50647. null === Ge)
  50648. throw null !== te.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  50649. void 0 === Ge.getShaderPrecisionFormat && (Ge.getShaderPrecisionFormat = function() {
  50650. return {
  50651. rangeMin: 1,
  50652. rangeMax: 1,
  50653. precision: 1
  50654. }
  50655. }
  50656. ),
  50657. te.addEventListener("webglcontextlost", a, !1)
  50658. } catch (e) {
  50659. console.error("THREE.WebGLRenderer: " + e)
  50660. }
  50661. var We = new n.WebGLExtensions(Ge);
  50662. We.get("OES_texture_float"),
  50663. We.get("OES_texture_float_linear"),
  50664. We.get("OES_texture_half_float"),
  50665. We.get("OES_texture_half_float_linear"),
  50666. We.get("OES_standard_derivatives"),
  50667. We.get("ANGLE_instanced_arrays"),
  50668. We.get("OES_element_index_uint") && (n.BufferGeometry.MaxIndex = 4294967296);
  50669. var je = new n.WebGLCapabilities(Ge,We,e)
  50670. , Ye = new n.WebGLState(Ge,We,ee)
  50671. , Xe = new n.WebGLProperties
  50672. , Ze = new n.WebGLObjects(Ge,Xe,this.info)
  50673. , qe = new n.WebGLPrograms(this,je)
  50674. , Ke = new n.WebGLLights;
  50675. this.info.programs = qe.programs;
  50676. var Qe = new n.WebGLBufferRenderer(Ge,We,He)
  50677. , Je = new n.WebGLIndexedBufferRenderer(Ge,We,He);
  50678. r(),
  50679. this.context = Ge,
  50680. this.capabilities = je,
  50681. this.extensions = We,
  50682. this.properties = Xe,
  50683. this.state = Ye;
  50684. var $e = new n.WebGLShadowMap(this,Ue,Ze);
  50685. this.shadowMap = $e;
  50686. var et = new n.SpritePlugin(this,ge)
  50687. , tt = new n.LensFlarePlugin(this,me);
  50688. this.getContext = function() {
  50689. return Ge
  50690. }
  50691. ,
  50692. this.getContextAttributes = function() {
  50693. return Ge.getContextAttributes()
  50694. }
  50695. ,
  50696. this.forceContextLoss = function() {
  50697. We.get("WEBGL_lose_context").loseContext()
  50698. }
  50699. ,
  50700. this.getMaxAnisotropy = function() {
  50701. var e;
  50702. return function() {
  50703. if (void 0 !== e)
  50704. return e;
  50705. var t = We.get("EXT_texture_filter_anisotropic");
  50706. return e = null !== t ? Ge.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  50707. }
  50708. }(),
  50709. this.getPrecision = function() {
  50710. return je.precision
  50711. }
  50712. ,
  50713. this.getPixelRatio = function() {
  50714. return Oe
  50715. }
  50716. ,
  50717. this.setPixelRatio = function(e) {
  50718. void 0 !== e && (Oe = e,
  50719. this.setSize(Ne.z, Ne.w, !1))
  50720. }
  50721. ,
  50722. this.getSize = function() {
  50723. return {
  50724. width: Re,
  50725. height: Pe
  50726. }
  50727. }
  50728. ,
  50729. this.setSize = function(e, t, i, devicePixelRatio) {
  50730. if(devicePixelRatio != void 0) Oe = devicePixelRatio; //xzw add 改分辨率 始终保持清晰
  50731. Re = e,
  50732. Pe = t,
  50733. te.width = e * Oe,
  50734. te.height = t * Oe,
  50735. i !== !1 && (te.style.width = e + "px",
  50736. te.style.height = t + "px"),
  50737. this.setViewport(0, 0, e, t)
  50738. }
  50739. ,
  50740. this.setViewport = function(e, t, i, n) {
  50741. Ye.viewport(Ne.set(e, t, i, n))
  50742. }
  50743. ,
  50744. this.setScissor = function(e, t, i, n) {
  50745. Ye.scissor(Le.set(e, t, i, n))
  50746. }
  50747. ,
  50748. this.setScissorTest = function(e) {
  50749. Ye.setScissorTest(De = e)
  50750. }
  50751. ,
  50752. this.getClearColor = function() {
  50753. return Se
  50754. }
  50755. ,
  50756. this.setClearColor = function(e, t) {
  50757. Se.set(e),
  50758. Me = void 0 !== t ? t : 1,
  50759. i(Se.r, Se.g, Se.b, Me)
  50760. }
  50761. ,
  50762. this.getClearAlpha = function() {
  50763. return Me
  50764. }
  50765. ,
  50766. this.setClearAlpha = function(e) {
  50767. Me = e,
  50768. i(Se.r, Se.g, Se.b, Me)
  50769. }
  50770. ,
  50771. this.clear = function(e, t, i) {
  50772. var n = 0;
  50773. (void 0 === e || e) && (n |= Ge.COLOR_BUFFER_BIT),
  50774. (void 0 === t || t) && (n |= Ge.DEPTH_BUFFER_BIT),
  50775. (void 0 === i || i) && (n |= Ge.STENCIL_BUFFER_BIT),
  50776. Ge.clear(n)
  50777. }
  50778. ,
  50779. this.clearColor = function() {
  50780. this.clear(!0, !1, !1)
  50781. }
  50782. ,
  50783. this.clearDepth = function() {
  50784. this.clear(!1, !0, !1)
  50785. }
  50786. ,
  50787. this.clearStencil = function() {
  50788. this.clear(!1, !1, !0)
  50789. }
  50790. ,
  50791. this.clearTarget = function(e, t, i, n) {
  50792. this.setRenderTarget(e),
  50793. this.clear(t, i, n)
  50794. }
  50795. ,
  50796. this.resetGLState = o,
  50797. this.dispose = function() {
  50798. te.removeEventListener("webglcontextlost", a, !1)
  50799. }
  50800. ,
  50801. this.renderBufferImmediate = function(e, t, i) {
  50802. Ye.initAttributes();
  50803. var r = Xe.get(e);
  50804. e.hasPositions && !r.position && (r.position = Ge.createBuffer()),
  50805. e.hasNormals && !r.normal && (r.normal = Ge.createBuffer()),
  50806. e.hasUvs && !r.uv && (r.uv = Ge.createBuffer()),
  50807. e.hasColors && !r.color && (r.color = Ge.createBuffer());
  50808. var o = t.getAttributes();
  50809. if (e.hasPositions && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.position),
  50810. Ge.bufferData(Ge.ARRAY_BUFFER, e.positionArray, Ge.DYNAMIC_DRAW),
  50811. Ye.enableAttribute(o.position),
  50812. Ge.vertexAttribPointer(o.position, 3, Ge.FLOAT, !1, 0, 0)),
  50813. e.hasNormals) {
  50814. if (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.normal),
  50815. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === n.FlatShading)
  50816. for (var a = 0, s = 3 * e.count; a < s; a += 9) {
  50817. var l = e.normalArray
  50818. , c = (l[a + 0] + l[a + 3] + l[a + 6]) / 3
  50819. , h = (l[a + 1] + l[a + 4] + l[a + 7]) / 3
  50820. , u = (l[a + 2] + l[a + 5] + l[a + 8]) / 3;
  50821. l[a + 0] = c,
  50822. l[a + 1] = h,
  50823. l[a + 2] = u,
  50824. l[a + 3] = c,
  50825. l[a + 4] = h,
  50826. l[a + 5] = u,
  50827. l[a + 6] = c,
  50828. l[a + 7] = h,
  50829. l[a + 8] = u
  50830. }
  50831. Ge.bufferData(Ge.ARRAY_BUFFER, e.normalArray, Ge.DYNAMIC_DRAW),
  50832. Ye.enableAttribute(o.normal),
  50833. Ge.vertexAttribPointer(o.normal, 3, Ge.FLOAT, !1, 0, 0)
  50834. }
  50835. e.hasUvs && i.map && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.uv),
  50836. Ge.bufferData(Ge.ARRAY_BUFFER, e.uvArray, Ge.DYNAMIC_DRAW),
  50837. Ye.enableAttribute(o.uv),
  50838. Ge.vertexAttribPointer(o.uv, 2, Ge.FLOAT, !1, 0, 0)),
  50839. e.hasColors && i.vertexColors !== n.NoColors && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.color),
  50840. Ge.bufferData(Ge.ARRAY_BUFFER, e.colorArray, Ge.DYNAMIC_DRAW),
  50841. Ye.enableAttribute(o.color),
  50842. Ge.vertexAttribPointer(o.color, 3, Ge.FLOAT, !1, 0, 0)),
  50843. Ye.disableUnusedAttributes(),
  50844. Ge.drawArrays(Ge.TRIANGLES, 0, e.count),
  50845. e.count = 0
  50846. }
  50847. ,
  50848. this.renderBufferDirect = function(e, i, r, o, a, s) {
  50849. E(o);
  50850. var l = w(e, i, o, a)
  50851. , c = !1
  50852. , h = r.id + "_" + l.id + "_" + o.wireframe;
  50853. h !== Ee && (Ee = h,
  50854. c = !0);
  50855. var u = a.morphTargetInfluences;
  50856. if (void 0 !== u) {
  50857. for (var d = [], p = 0, m = u.length; p < m; p++) {
  50858. var v = u[p];
  50859. d.push([v, p])
  50860. }
  50861. d.sort(g),
  50862. d.length > 8 && (d.length = 8);
  50863. for (var A = r.morphAttributes, p = 0, m = d.length; p < m; p++) {
  50864. var v = d[p];
  50865. if (fe[p] = v[0],
  50866. 0 !== v[0]) {
  50867. var y = v[1];
  50868. o.morphTargets === !0 && A.position && r.addAttribute("morphTarget" + p, A.position[y]),
  50869. o.morphNormals === !0 && A.normal && r.addAttribute("morphNormal" + p, A.normal[y])
  50870. } else
  50871. o.morphTargets === !0 && r.removeAttribute("morphTarget" + p),
  50872. o.morphNormals === !0 && r.removeAttribute("morphNormal" + p)
  50873. }
  50874. var C = l.getUniforms();
  50875. null !== C.morphTargetInfluences && Ge.uniform1fv(C.morphTargetInfluences, fe),
  50876. c = !0
  50877. }
  50878. var y = r.index
  50879. , I = r.attributes.position;
  50880. o.wireframe === !0 && (y = Ze.getWireframeAttribute(r));
  50881. var b;
  50882. null !== y ? (b = Je,
  50883. b.setIndex(y)) : b = Qe,
  50884. c && (f(o, l, r),
  50885. null !== y && Ge.bindBuffer(Ge.ELEMENT_ARRAY_BUFFER, Ze.getAttributeBuffer(y)));
  50886. var _ = 0
  50887. , T = 1 / 0;
  50888. null !== y ? T = y.count : void 0 !== I && (T = I.count);
  50889. var x = r.drawRange.start
  50890. , S = r.drawRange.count
  50891. , M = null !== s ? s.start : 0
  50892. , R = null !== s ? s.count : 1 / 0
  50893. , P = Math.max(_, x, M)
  50894. , O = Math.min(_ + T, x + S, M + R) - 1
  50895. , L = Math.max(0, O - P + 1);
  50896. if (a instanceof n.Mesh)
  50897. if (o.wireframe === !0)
  50898. Ye.setLineWidth(o.wireframeLinewidth * t()),
  50899. b.setMode(Ge.LINES);
  50900. else
  50901. switch (a.drawMode) {
  50902. case n.TrianglesDrawMode:
  50903. b.setMode(Ge.TRIANGLES);
  50904. break;
  50905. case n.TriangleStripDrawMode:
  50906. b.setMode(Ge.TRIANGLE_STRIP);
  50907. break;
  50908. case n.TriangleFanDrawMode:
  50909. b.setMode(Ge.TRIANGLE_FAN)
  50910. }
  50911. else if (a instanceof n.Line) {
  50912. var D = o.linewidth;
  50913. void 0 === D && (D = 1),
  50914. Ye.setLineWidth(D * t()),
  50915. a instanceof n.LineSegments ? b.setMode(Ge.LINES) : b.setMode(Ge.LINE_STRIP)
  50916. } else
  50917. a instanceof n.Points && b.setMode(Ge.POINTS);
  50918. r instanceof n.InstancedBufferGeometry ? r.maxInstancedCount > 0 && b.renderInstances(r, P, L) : b.render(P, L)
  50919. }
  50920. ,
  50921. this.render = function(e, t, i, r) {
  50922. if (t instanceof n.Camera == !1)
  50923. return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");
  50924. var o = e.fog;
  50925. if (Ee = "",
  50926. Ie = -1,
  50927. be = null,
  50928. e.autoUpdate === !0 && e.updateMatrixWorld(),
  50929. null === t.parent && t.updateMatrixWorld(),
  50930. t.matrixWorldInverse.getInverse(t.matrixWorld),
  50931. Fe.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  50932. Be.setFromMatrix(Fe),
  50933. ce.length = 0,
  50934. ue = -1,
  50935. pe = -1,
  50936. ge.length = 0,
  50937. me.length = 0,
  50938. y(e, t),
  50939. he.length = ue + 1,
  50940. de.length = pe + 1,
  50941. ve.sortObjects === !0 && (he.sort(m),
  50942. de.sort(v)),
  50943. U(ce, t),
  50944. $e.render(e, t),
  50945. He.calls = 0,
  50946. He.vertices = 0,
  50947. He.faces = 0,
  50948. He.points = 0,
  50949. void 0 === i && (i = null),
  50950. this.setRenderTarget(i),
  50951. (this.autoClear || r) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  50952. e.overrideMaterial) {
  50953. var a = e.overrideMaterial;
  50954. C(he, t, o, a),
  50955. C(de, t, o, a)
  50956. } else
  50957. Ye.setBlending(n.NoBlending),
  50958. C(he, t, o),
  50959. C(de, t, o);
  50960. if (et.render(e, t),
  50961. tt.render(e, t, Te),
  50962. i) {
  50963. var s = i.texture;
  50964. s.generateMipmaps && z(i) && s.minFilter !== n.NearestFilter && s.minFilter !== n.LinearFilter && J(i)
  50965. }
  50966. Ye.setDepthTest(!0),
  50967. Ye.setDepthWrite(!0),
  50968. Ye.setColorWrite(!0)
  50969. }
  50970. ,
  50971. this.setFaceCulling = function(e, t) {
  50972. e === n.CullFaceNone ? Ye.disable(Ge.CULL_FACE) : (t === n.FrontFaceDirectionCW ? Ge.frontFace(Ge.CW) : Ge.frontFace(Ge.CCW),
  50973. e === n.CullFaceBack ? Ge.cullFace(Ge.BACK) : e === n.CullFaceFront ? Ge.cullFace(Ge.FRONT) : Ge.cullFace(Ge.FRONT_AND_BACK),
  50974. Ye.enable(Ge.CULL_FACE))
  50975. }
  50976. ,
  50977. this.setTexture = function(e, t) {
  50978. var i = Xe.get(e);
  50979. if (e.version > 0 && i.__version !== e.version) {
  50980. var n = e.image;
  50981. return void 0 === n ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined", e) : n.complete === !1 ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete", e) : void H(i, e, t)
  50982. }
  50983. Ye.activeTexture(Ge.TEXTURE0 + t),
  50984. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture)
  50985. }
  50986. ,
  50987. this.getCurrentRenderTarget = function() {
  50988. return ye
  50989. }
  50990. ,
  50991. this.setRenderTarget = function(e) {
  50992. ye = e,
  50993. e && void 0 === Xe.get(e).__webglFramebuffer && Q(e);
  50994. var t, i = e instanceof n.WebGLRenderTargetCube;
  50995. if (e) {
  50996. var r = Xe.get(e);
  50997. t = i ? r.__webglFramebuffer[e.activeCubeFace] : r.__webglFramebuffer,
  50998. we.copy(e.scissor),
  50999. _e = e.scissorTest,
  51000. Te.copy(e.viewport)
  51001. } else
  51002. t = null,
  51003. we.copy(Le).multiplyScalar(Oe),
  51004. _e = De,
  51005. Te.copy(Ne).multiplyScalar(Oe);
  51006. if (Ce !== t && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, t),
  51007. Ce = t),
  51008. Ye.scissor(we),
  51009. Ye.setScissorTest(_e),
  51010. Ye.viewport(Te),
  51011. i) {
  51012. var o = Xe.get(e.texture);
  51013. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, o.__webglTexture, e.activeMipMapLevel)
  51014. }
  51015. }
  51016. ,
  51017. this.readRenderTargetPixels = function(e, t, i, r, o, a) {
  51018. if (e instanceof n.WebGLRenderTarget == !1)
  51019. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
  51020. var s = Xe.get(e).__webglFramebuffer;
  51021. if (s) {
  51022. var l = !1;
  51023. s !== Ce && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, s),
  51024. l = !0);
  51025. try {
  51026. var c = e.texture;
  51027. if (c.format !== n.RGBAFormat && ee(c.format) !== Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_FORMAT))
  51028. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  51029. if (!(c.type === n.UnsignedByteType || ee(c.type) === Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_TYPE) || c.type === n.FloatType && We.get("WEBGL_color_buffer_float") || c.type === n.HalfFloatType && We.get("EXT_color_buffer_half_float")))
  51030. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  51031. Ge.checkFramebufferStatus(Ge.FRAMEBUFFER) === Ge.FRAMEBUFFER_COMPLETE ? Ge.readPixels(t, i, r, o, ee(c.format), ee(c.type), a) : console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")
  51032. } finally {
  51033. l && Ge.bindFramebuffer(Ge.FRAMEBUFFER, Ce)
  51034. }
  51035. }
  51036. }
  51037. }
  51038. ,
  51039. n.WebGLRenderTarget = function(e, t, i) {
  51040. this.uuid = n.Math.generateUUID(),
  51041. this.width = e,
  51042. this.height = t,
  51043. this.scissor = new n.Vector4(0,0,e,t),
  51044. this.scissorTest = !1,
  51045. this.viewport = new n.Vector4(0,0,e,t),
  51046. i = i || {},
  51047. void 0 === i.minFilter && (i.minFilter = n.LinearFilter),
  51048. this.texture = new n.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  51049. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  51050. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  51051. }
  51052. ,
  51053. n.WebGLRenderTarget.prototype = {
  51054. constructor: n.WebGLRenderTarget,
  51055. setSize: function(e, t) {
  51056. this.width === e && this.height === t || (this.width = e,
  51057. this.height = t,
  51058. this.dispose()),
  51059. this.viewport.set(0, 0, e, t),
  51060. this.scissor.set(0, 0, e, t)
  51061. },
  51062. clone: function() {
  51063. return (new this.constructor).copy(this)
  51064. },
  51065. copy: function(e) {
  51066. return this.width = e.width,
  51067. this.height = e.height,
  51068. this.viewport.copy(e.viewport),
  51069. this.texture = e.texture.clone(),
  51070. this.depthBuffer = e.depthBuffer,
  51071. this.stencilBuffer = e.stencilBuffer,
  51072. this
  51073. },
  51074. dispose: function() {
  51075. this.dispatchEvent({
  51076. type: "dispose"
  51077. })
  51078. }
  51079. },
  51080. n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),
  51081. n.WebGLRenderTargetCube = function(e, t, i) {
  51082. n.WebGLRenderTarget.call(this, e, t, i),
  51083. this.activeCubeFace = 0,
  51084. this.activeMipMapLevel = 0
  51085. }
  51086. ,
  51087. n.WebGLRenderTargetCube.prototype = Object.create(n.WebGLRenderTarget.prototype),
  51088. n.WebGLRenderTargetCube.prototype.constructor = n.WebGLRenderTargetCube,
  51089. n.WebGLBufferRenderer = function(e, t, i) {
  51090. function r(e) {
  51091. s = e
  51092. }
  51093. function o(t, n) {
  51094. e.drawArrays(s, t, n),
  51095. i.calls++,
  51096. i.vertices += n,
  51097. s === e.TRIANGLES && (i.faces += n / 3)
  51098. }
  51099. function a(r) {
  51100. var o = t.get("ANGLE_instanced_arrays");
  51101. if (null === o)
  51102. return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  51103. var a = r.attributes.position
  51104. , l = 0;
  51105. a instanceof n.InterleavedBufferAttribute ? (l = a.data.count,
  51106. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)) : (l = a.count,
  51107. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)),
  51108. i.calls++,
  51109. i.vertices += l * r.maxInstancedCount,
  51110. s === e.TRIANGLES && (i.faces += r.maxInstancedCount * l / 3)
  51111. }
  51112. var s;
  51113. this.setMode = r,
  51114. this.render = o,
  51115. this.renderInstances = a
  51116. }
  51117. ,
  51118. n.WebGLIndexedBufferRenderer = function(e, t, i) {
  51119. function n(e) {
  51120. s = e
  51121. }
  51122. function r(i) {
  51123. i.array instanceof Uint32Array && t.get("OES_element_index_uint") ? (l = e.UNSIGNED_INT,
  51124. c = 4) : (l = e.UNSIGNED_SHORT,
  51125. c = 2)
  51126. }
  51127. function o(t, n) {
  51128. e.drawElements(s, n, l, t * c),
  51129. i.calls++,
  51130. i.vertices += n,
  51131. s === e.TRIANGLES && (i.faces += n / 3)
  51132. }
  51133. function a(n, r, o) {
  51134. var a = t.get("ANGLE_instanced_arrays");
  51135. return null === a ? void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.") : (a.drawElementsInstancedANGLE(s, o, l, r * c, n.maxInstancedCount),
  51136. i.calls++,
  51137. i.vertices += o * n.maxInstancedCount,
  51138. void (s === e.TRIANGLES && (i.faces += n.maxInstancedCount * o / 3)))
  51139. }
  51140. var s, l, c;
  51141. this.setMode = n,
  51142. this.setIndex = r,
  51143. this.render = o,
  51144. this.renderInstances = a
  51145. }
  51146. ,
  51147. n.WebGLExtensions = function(e) {
  51148. var t = {};
  51149. this.get = function(i) {
  51150. if (void 0 !== t[i])
  51151. return t[i];
  51152. var n;
  51153. switch (i) {
  51154. case "EXT_texture_filter_anisotropic":
  51155. n = e.getExtension("EXT_texture_filter_anisotropic") || e.getExtension("MOZ_EXT_texture_filter_anisotropic") || e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  51156. break;
  51157. case "WEBGL_compressed_texture_s3tc":
  51158. n = e.getExtension("WEBGL_compressed_texture_s3tc") || e.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  51159. break;
  51160. case "WEBGL_compressed_texture_pvrtc":
  51161. n = e.getExtension("WEBGL_compressed_texture_pvrtc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  51162. break;
  51163. case "WEBGL_compressed_texture_etc1":
  51164. n = e.getExtension("WEBGL_compressed_texture_etc1");
  51165. break;
  51166. default:
  51167. n = e.getExtension(i)
  51168. }
  51169. return null === n && console.warn("THREE.WebGLRenderer: " + i + " extension not supported."),
  51170. t[i] = n,
  51171. n
  51172. }
  51173. }
  51174. ,
  51175. n.WebGLCapabilities = function(e, t, i) {
  51176. function n(t) {
  51177. if ("highp" === t) {
  51178. if (e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0)
  51179. return "highp";
  51180. t = "mediump"
  51181. }
  51182. return "mediump" === t && e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.MEDIUM_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.MEDIUM_FLOAT).precision > 0 ? "mediump" : "lowp"
  51183. }
  51184. this.getMaxPrecision = n,
  51185. this.precision = void 0 !== i.precision ? i.precision : "highp",
  51186. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  51187. this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  51188. this.maxVertexTextures = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  51189. this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE),
  51190. this.maxCubemapSize = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),
  51191. this.maxAttributes = e.getParameter(e.MAX_VERTEX_ATTRIBS),
  51192. this.maxVertexUniforms = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),
  51193. this.maxVaryings = e.getParameter(e.MAX_VARYING_VECTORS),
  51194. this.maxFragmentUniforms = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),
  51195. this.vertexTextures = this.maxVertexTextures > 0,
  51196. this.floatFragmentTextures = !!t.get("OES_texture_float"),
  51197. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  51198. var r = n(this.precision);
  51199. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  51200. this.precision = r),
  51201. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!t.get("EXT_frag_depth"))
  51202. }
  51203. ,
  51204. n.WebGLGeometries = function(e, t, i) {
  51205. function r(e) {
  51206. var t = e.geometry;
  51207. if (void 0 !== h[t.id])
  51208. return h[t.id];
  51209. t.addEventListener("dispose", o);
  51210. var r;
  51211. return t instanceof n.BufferGeometry ? r = t : t instanceof n.Geometry && (void 0 === t._bufferGeometry && (t._bufferGeometry = (new n.BufferGeometry).setFromObject(e)),
  51212. r = t._bufferGeometry),
  51213. h[t.id] = r,
  51214. i.memory.geometries++,
  51215. r
  51216. }
  51217. function o(e) {
  51218. var n = e.target
  51219. , r = h[n.id];
  51220. null !== r.index && s(r.index),
  51221. l(r.attributes),
  51222. n.removeEventListener("dispose", o),
  51223. delete h[n.id];
  51224. var a = t.get(n);
  51225. a.wireframe && s(a.wireframe),
  51226. t.delete(n);
  51227. var c = t.get(r);
  51228. c.wireframe && s(c.wireframe),
  51229. t.delete(r),
  51230. i.memory.geometries--
  51231. }
  51232. function a(e) {
  51233. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  51234. }
  51235. function s(t) {
  51236. var i = a(t);
  51237. void 0 !== i && (e.deleteBuffer(i),
  51238. c(t))
  51239. }
  51240. function l(e) {
  51241. for (var t in e)
  51242. s(e[t])
  51243. }
  51244. function c(e) {
  51245. e instanceof n.InterleavedBufferAttribute ? t.delete(e.data) : t.delete(e)
  51246. }
  51247. var h = {};
  51248. this.get = r
  51249. }
  51250. ,
  51251. n.WebGLLights = function() {
  51252. var e = {};
  51253. this.get = function(t) {
  51254. if (void 0 !== e[t.id])
  51255. return e[t.id];
  51256. var i;
  51257. switch (t.type) {
  51258. case "DirectionalLight":
  51259. i = {
  51260. direction: new n.Vector3,
  51261. color: new n.Color,
  51262. shadow: !1,
  51263. shadowBias: 0,
  51264. shadowRadius: 1,
  51265. shadowMapSize: new n.Vector2
  51266. };
  51267. break;
  51268. case "SpotLight":
  51269. i = {
  51270. position: new n.Vector3,
  51271. direction: new n.Vector3,
  51272. color: new n.Color,
  51273. distance: 0,
  51274. coneCos: 0,
  51275. penumbraCos: 0,
  51276. decay: 0,
  51277. shadow: !1,
  51278. shadowBias: 0,
  51279. shadowRadius: 1,
  51280. shadowMapSize: new n.Vector2
  51281. };
  51282. break;
  51283. case "PointLight":
  51284. i = {
  51285. position: new n.Vector3,
  51286. color: new n.Color,
  51287. distance: 0,
  51288. decay: 0,
  51289. shadow: !1,
  51290. shadowBias: 0,
  51291. shadowRadius: 1,
  51292. shadowMapSize: new n.Vector2
  51293. };
  51294. break;
  51295. case "HemisphereLight":
  51296. i = {
  51297. direction: new n.Vector3,
  51298. skyColor: new n.Color,
  51299. groundColor: new n.Color
  51300. }
  51301. }
  51302. return e[t.id] = i,
  51303. i
  51304. }
  51305. }
  51306. ,
  51307. n.WebGLObjects = function(e, t, i) {
  51308. function r(t) {
  51309. var i = u.get(t);
  51310. t.geometry instanceof n.Geometry && i.updateFromObject(t);
  51311. var r = i.index
  51312. , a = i.attributes;
  51313. null !== r && o(r, e.ELEMENT_ARRAY_BUFFER);
  51314. for (var s in a)
  51315. o(a[s], e.ARRAY_BUFFER);
  51316. var l = i.morphAttributes;
  51317. for (var s in l)
  51318. for (var c = l[s], h = 0, d = c.length; h < d; h++)
  51319. o(c[h], e.ARRAY_BUFFER);
  51320. return i
  51321. }
  51322. function o(e, i) {
  51323. var r = e instanceof n.InterleavedBufferAttribute ? e.data : e
  51324. , o = t.get(r);
  51325. void 0 === o.__webglBuffer ? a(o, r, i) : o.version !== r.version && s(o, r, i)
  51326. }
  51327. function a(t, i, n) {
  51328. t.__webglBuffer = e.createBuffer(),
  51329. e.bindBuffer(n, t.__webglBuffer);
  51330. var r = i.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW;
  51331. e.bufferData(n, i.array, r),
  51332. t.version = i.version
  51333. }
  51334. function s(t, i, n) {
  51335. e.bindBuffer(n, t.__webglBuffer),
  51336. i.dynamic === !1 || i.updateRange.count === -1 ? e.bufferSubData(n, 0, i.array) : 0 === i.updateRange.count ? console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.") : (e.bufferSubData(n, i.updateRange.offset * i.array.BYTES_PER_ELEMENT, i.array.subarray(i.updateRange.offset, i.updateRange.offset + i.updateRange.count)),
  51337. i.updateRange.count = 0),
  51338. t.version = i.version
  51339. }
  51340. function l(e) {
  51341. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  51342. }
  51343. function c(i) {
  51344. var r = t.get(i);
  51345. if (void 0 !== r.wireframe)
  51346. return r.wireframe;
  51347. var a = []
  51348. , s = i.index
  51349. , l = i.attributes
  51350. , c = l.position;
  51351. if (null !== s)
  51352. for (var u = {}, d = s.array, p = 0, f = d.length; p < f; p += 3) {
  51353. var g = d[p + 0]
  51354. , m = d[p + 1]
  51355. , v = d[p + 2];
  51356. h(u, g, m) && a.push(g, m),
  51357. h(u, m, v) && a.push(m, v),
  51358. h(u, v, g) && a.push(v, g)
  51359. }
  51360. else
  51361. for (var d = l.position.array, p = 0, f = d.length / 3 - 1; p < f; p += 3) {
  51362. var g = p + 0
  51363. , m = p + 1
  51364. , v = p + 2;
  51365. a.push(g, m, m, v, v, g)
  51366. }
  51367. var A = c.count > 65535 ? Uint32Array : Uint16Array
  51368. , y = new n.BufferAttribute(new A(a),1);
  51369. return o(y, e.ELEMENT_ARRAY_BUFFER),
  51370. r.wireframe = y,
  51371. y
  51372. }
  51373. function h(e, t, i) {
  51374. if (t > i) {
  51375. var n = t;
  51376. t = i,
  51377. i = n
  51378. }
  51379. var r = e[t];
  51380. return void 0 === r ? (e[t] = [i],
  51381. !0) : r.indexOf(i) === -1 && (r.push(i),
  51382. !0)
  51383. }
  51384. var u = new n.WebGLGeometries(e,t,i);
  51385. this.getAttributeBuffer = l,
  51386. this.getWireframeAttribute = c,
  51387. this.update = r
  51388. }
  51389. ,
  51390. n.WebGLProgram = function() {
  51391. function e(e) {
  51392. switch (e) {
  51393. case n.LinearEncoding:
  51394. return ["Linear", "( value )"];
  51395. case n.sRGBEncoding:
  51396. return ["sRGB", "( value )"];
  51397. case n.RGBEEncoding:
  51398. return ["RGBE", "( value )"];
  51399. case n.RGBM7Encoding:
  51400. return ["RGBM", "( value, 7.0 )"];
  51401. case n.RGBM16Encoding:
  51402. return ["RGBM", "( value, 16.0 )"];
  51403. case n.RGBDEncoding:
  51404. return ["RGBD", "( value, 256.0 )"];
  51405. case n.GammaEncoding:
  51406. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  51407. default:
  51408. throw new Error("unsupported encoding: " + e)
  51409. }
  51410. }
  51411. function t(t, i) {
  51412. var n = e(i);
  51413. return "vec4 " + t + "( vec4 value ) { return " + n[0] + "ToLinear" + n[1] + "; }"
  51414. }
  51415. function i(t, i) {
  51416. var n = e(i);
  51417. return "vec4 " + t + "( vec4 value ) { return LinearTo" + n[0] + n[1] + "; }"
  51418. }
  51419. function r(e, t) {
  51420. var i;
  51421. switch (t) {
  51422. case n.LinearToneMapping:
  51423. i = "Linear";
  51424. break;
  51425. case n.ReinhardToneMapping:
  51426. i = "Reinhard";
  51427. break;
  51428. case n.Uncharted2ToneMapping:
  51429. i = "Uncharted2";
  51430. break;
  51431. case n.CineonToneMapping:
  51432. i = "OptimizedCineon";
  51433. break;
  51434. default:
  51435. throw new Error("unsupported toneMapping: " + t)
  51436. }
  51437. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  51438. }
  51439. function o(e, t, i) {
  51440. e = e || {};
  51441. var n = [e.derivatives || t.envMapCubeUV || t.bumpMap || t.normalMap || t.flatShading ? "#extension GL_OES_standard_derivatives : enable" : "", (e.fragDepth || t.logarithmicDepthBuffer) && i.get("EXT_frag_depth") ? "#extension GL_EXT_frag_depth : enable" : "", e.drawBuffers && i.get("WEBGL_draw_buffers") ? "#extension GL_EXT_draw_buffers : require" : "", (e.shaderTextureLOD || t.envMap) && i.get("EXT_shader_texture_lod") ? "#extension GL_EXT_shader_texture_lod : enable" : ""];
  51442. return n.filter(c).join("\n")
  51443. }
  51444. function a(e) {
  51445. var t = [];
  51446. for (var i in e) {
  51447. var n = e[i];
  51448. n !== !1 && t.push("#define " + i + " " + n)
  51449. }
  51450. return t.join("\n")
  51451. }
  51452. function s(e, t, i) {
  51453. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), o = 0; o < r; o++) {
  51454. var a = e.getActiveUniform(t, o)
  51455. , s = a.name
  51456. , l = e.getUniformLocation(t, s)
  51457. , c = f.exec(s);
  51458. if (c) {
  51459. var h = c[1]
  51460. , u = c[2]
  51461. , d = n[h];
  51462. d || (d = n[h] = {}),
  51463. d[u] = l
  51464. } else if (c = g.exec(s)) {
  51465. var p = c[1]
  51466. , v = c[2]
  51467. , A = c[3]
  51468. , y = n[p];
  51469. y || (y = n[p] = []);
  51470. var C = y[v];
  51471. C || (C = y[v] = {}),
  51472. C[A] = l
  51473. } else if (c = m.exec(s)) {
  51474. var p = c[1];
  51475. n[p] = l
  51476. } else
  51477. n[s] = l
  51478. }
  51479. return n
  51480. }
  51481. function l(e, t, i) {
  51482. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), o = 0; o < r; o++) {
  51483. var a = e.getActiveAttrib(t, o)
  51484. , s = a.name;
  51485. n[s] = e.getAttribLocation(t, s)
  51486. }
  51487. return n
  51488. }
  51489. function c(e) {
  51490. return "" !== e
  51491. }
  51492. function h(e, t) {
  51493. return e.replace(/NUM_DIR_LIGHTS/g, t.numDirLights).replace(/NUM_SPOT_LIGHTS/g, t.numSpotLights).replace(/NUM_POINT_LIGHTS/g, t.numPointLights).replace(/NUM_HEMI_LIGHTS/g, t.numHemiLights)
  51494. }
  51495. function u(e) {
  51496. function t(e, t) {
  51497. var i = n.ShaderChunk[t];
  51498. if (void 0 === i)
  51499. throw new Error("Can not resolve #include <" + t + ">");
  51500. return u(i)
  51501. }
  51502. var i = /#include +<([\w\d.]+)>/g;
  51503. return e.replace(i, t)
  51504. }
  51505. function d(e) {
  51506. function t(e, t, i, n) {
  51507. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  51508. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  51509. return r
  51510. }
  51511. var i = /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
  51512. return e.replace(i, t)
  51513. }
  51514. var p = 0
  51515. , f = /^([\w\d_]+)\.([\w\d_]+)$/
  51516. , g = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/
  51517. , m = /^([\w\d_]+)\[0\]$/;
  51518. return function(e, f, g, m) {
  51519. var v = e.context
  51520. , A = g.extensions
  51521. , y = g.defines
  51522. , C = g.__webglShader.vertexShader
  51523. , I = g.__webglShader.fragmentShader
  51524. , E = "SHADOWMAP_TYPE_BASIC";
  51525. m.shadowMapType === n.PCFShadowMap ? E = "SHADOWMAP_TYPE_PCF" : m.shadowMapType === n.PCFSoftShadowMap && (E = "SHADOWMAP_TYPE_PCF_SOFT");
  51526. var b = "ENVMAP_TYPE_CUBE"
  51527. , w = "ENVMAP_MODE_REFLECTION"
  51528. , _ = "ENVMAP_BLENDING_MULTIPLY";
  51529. if (m.envMap) {
  51530. switch (g.envMap.mapping) {
  51531. case n.CubeReflectionMapping:
  51532. case n.CubeRefractionMapping:
  51533. b = "ENVMAP_TYPE_CUBE";
  51534. break;
  51535. case n.CubeUVReflectionMapping:
  51536. case n.CubeUVRefractionMapping:
  51537. b = "ENVMAP_TYPE_CUBE_UV";
  51538. break;
  51539. case n.EquirectangularReflectionMapping:
  51540. case n.EquirectangularRefractionMapping:
  51541. b = "ENVMAP_TYPE_EQUIREC";
  51542. break;
  51543. case n.SphericalReflectionMapping:
  51544. b = "ENVMAP_TYPE_SPHERE"
  51545. }
  51546. switch (g.envMap.mapping) {
  51547. case n.CubeRefractionMapping:
  51548. case n.EquirectangularRefractionMapping:
  51549. w = "ENVMAP_MODE_REFRACTION"
  51550. }
  51551. switch (g.combine) {
  51552. case n.MultiplyOperation:
  51553. _ = "ENVMAP_BLENDING_MULTIPLY";
  51554. break;
  51555. case n.MixOperation:
  51556. _ = "ENVMAP_BLENDING_MIX";
  51557. break;
  51558. case n.AddOperation:
  51559. _ = "ENVMAP_BLENDING_ADD"
  51560. }
  51561. }
  51562. var T, x, S = e.gammaFactor > 0 ? e.gammaFactor : 1, M = o(A, m, e.extensions), R = a(y), P = v.createProgram();
  51563. g instanceof n.RawShaderMaterial ? (T = "",
  51564. x = "") : (T = ["precision " + m.precision + " float;", "precision " + m.precision + " int;", "#define SHADER_NAME " + g.__webglShader.name, R, m.supportsVertexTextures ? "#define VERTEX_TEXTURES" : "", "#define GAMMA_FACTOR " + S, "#define MAX_BONES " + m.maxBones, m.map ? "#define USE_MAP" : "", m.envMap ? "#define USE_ENVMAP" : "", m.envMap ? "#define " + w : "", m.lightMap ? "#define USE_LIGHTMAP" : "", m.aoMap ? "#define USE_AOMAP" : "", m.emissiveMap ? "#define USE_EMISSIVEMAP" : "", m.bumpMap ? "#define USE_BUMPMAP" : "", m.normalMap ? "#define USE_NORMALMAP" : "", m.displacementMap && m.supportsVertexTextures ? "#define USE_DISPLACEMENTMAP" : "", m.specularMap ? "#define USE_SPECULARMAP" : "", m.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", m.metalnessMap ? "#define USE_METALNESSMAP" : "", m.alphaMap ? "#define USE_ALPHAMAP" : "", m.vertexColors ? "#define USE_COLOR" : "", m.flatShading ? "#define FLAT_SHADED" : "", m.skinning ? "#define USE_SKINNING" : "", m.useVertexTexture ? "#define BONE_TEXTURE" : "", m.morphTargets ? "#define USE_MORPHTARGETS" : "", m.morphNormals && m.flatShading === !1 ? "#define USE_MORPHNORMALS" : "", m.doubleSided ? "#define DOUBLE_SIDED" : "", m.flipSided ? "#define FLIP_SIDED" : "", m.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", m.shadowMapEnabled ? "#define " + E : "", m.pointLightShadows > 0 ? "#define POINT_LIGHT_SHADOWS" : "", m.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "", m.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", m.logarithmicDepthBuffer && e.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", "\tattribute vec3 color;", "#endif", "#ifdef USE_MORPHTARGETS", "\tattribute vec3 morphTarget0;", "\tattribute vec3 morphTarget1;", "\tattribute vec3 morphTarget2;", "\tattribute vec3 morphTarget3;", "\t#ifdef USE_MORPHNORMALS", "\t\tattribute vec3 morphNormal0;", "\t\tattribute vec3 morphNormal1;", "\t\tattribute vec3 morphNormal2;", "\t\tattribute vec3 morphNormal3;", "\t#else", "\t\tattribute vec3 morphTarget4;", "\t\tattribute vec3 morphTarget5;", "\t\tattribute vec3 morphTarget6;", "\t\tattribute vec3 morphTarget7;", "\t#endif", "#endif", "#ifdef USE_SKINNING", "\tattribute vec4 skinIndex;", "\tattribute vec4 skinWeight;", "#endif", "\n"].filter(c).join("\n"),
  51565. x = [M, "precision " + m.precision + " float;", "precision " + m.precision + " int;", "#define SHADER_NAME " + g.__webglShader.name, R, m.alphaTest ? "#define ALPHATEST " + m.alphaTest : "", "#define GAMMA_FACTOR " + S, m.useFog && m.fog ? "#define USE_FOG" : "", m.useFog && m.fogExp ? "#define FOG_EXP2" : "", m.map ? "#define USE_MAP" : "", m.envMap ? "#define USE_ENVMAP" : "", m.envMap ? "#define " + b : "", m.envMap ? "#define " + w : "", m.envMap ? "#define " + _ : "", m.lightMap ? "#define USE_LIGHTMAP" : "", m.aoMap ? "#define USE_AOMAP" : "", m.emissiveMap ? "#define USE_EMISSIVEMAP" : "", m.bumpMap ? "#define USE_BUMPMAP" : "", m.normalMap ? "#define USE_NORMALMAP" : "", m.specularMap ? "#define USE_SPECULARMAP" : "", m.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", m.metalnessMap ? "#define USE_METALNESSMAP" : "", m.alphaMap ? "#define USE_ALPHAMAP" : "", m.vertexColors ? "#define USE_COLOR" : "", m.flatShading ? "#define FLAT_SHADED" : "", m.doubleSided ? "#define DOUBLE_SIDED" : "", m.flipSided ? "#define FLIP_SIDED" : "", m.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", m.shadowMapEnabled ? "#define " + E : "", m.pointLightShadows > 0 ? "#define POINT_LIGHT_SHADOWS" : "", m.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "", m.physicallyCorrectLights ? "#define PHYSICALLY_CORRECT_LIGHTS" : "", m.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", m.logarithmicDepthBuffer && e.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", m.envMap && e.extensions.get("EXT_shader_texture_lod") ? "#define TEXTURE_LOD_EXT" : "", "uniform mat4 viewMatrix;", "uniform vec3 cameraPosition;", m.toneMapping !== n.NoToneMapping ? "#define TONE_MAPPING" : "", m.toneMapping !== n.NoToneMapping ? n.ShaderChunk.tonemapping_pars_fragment : "", m.toneMapping !== n.NoToneMapping ? r("toneMapping", m.toneMapping) : "", m.outputEncoding || m.mapEncoding || m.envMapEncoding || m.emissiveMapEncoding ? n.ShaderChunk.encodings_pars_fragment : "", m.mapEncoding ? t("mapTexelToLinear", m.mapEncoding) : "", m.envMapEncoding ? t("envMapTexelToLinear", m.envMapEncoding) : "", m.emissiveMapEncoding ? t("emissiveMapTexelToLinear", m.emissiveMapEncoding) : "", m.outputEncoding ? i("linearToOutputTexel", m.outputEncoding) : "", "\n"].filter(c).join("\n")),
  51566. C = u(C, m),
  51567. C = h(C, m),
  51568. I = u(I, m),
  51569. I = h(I, m),
  51570. g instanceof n.ShaderMaterial == !1 && (C = d(C),
  51571. I = d(I));
  51572. var O = T + C
  51573. , L = x + I
  51574. , D = n.WebGLShader(v, v.VERTEX_SHADER, O)
  51575. , N = n.WebGLShader(v, v.FRAGMENT_SHADER, L);
  51576. v.attachShader(P, D),
  51577. v.attachShader(P, N),
  51578. void 0 !== g.index0AttributeName ? v.bindAttribLocation(P, 0, g.index0AttributeName) : m.morphTargets === !0 && v.bindAttribLocation(P, 0, "position"),
  51579. v.linkProgram(P);
  51580. var B = v.getProgramInfoLog(P)
  51581. , F = v.getShaderInfoLog(D)
  51582. , V = v.getShaderInfoLog(N)
  51583. , U = !0
  51584. , k = !0;
  51585. v.getProgramParameter(P, v.LINK_STATUS) === !1 ? (U = !1,
  51586. console.error("THREE.WebGLProgram: shader error: ", v.getError(), "gl.VALIDATE_STATUS", v.getProgramParameter(P, v.VALIDATE_STATUS), "gl.getProgramInfoLog", B, F, V)) : "" !== B ? console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()", B) : "" !== F && "" !== V || (k = !1),
  51587. k && (this.diagnostics = {
  51588. runnable: U,
  51589. material: g,
  51590. programLog: B,
  51591. vertexShader: {
  51592. log: F,
  51593. prefix: T
  51594. },
  51595. fragmentShader: {
  51596. log: V,
  51597. prefix: x
  51598. }
  51599. }),
  51600. v.deleteShader(D),
  51601. v.deleteShader(N);
  51602. var H;
  51603. this.getUniforms = function() {
  51604. return void 0 === H && (H = s(v, P)),
  51605. H
  51606. }
  51607. ;
  51608. var G;
  51609. return this.getAttributes = function() {
  51610. return void 0 === G && (G = l(v, P)),
  51611. G
  51612. }
  51613. ,
  51614. this.destroy = function() {
  51615. v.deleteProgram(P),
  51616. this.program = void 0
  51617. }
  51618. ,
  51619. Object.defineProperties(this, {
  51620. uniforms: {
  51621. get: function() {
  51622. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  51623. this.getUniforms()
  51624. }
  51625. },
  51626. attributes: {
  51627. get: function() {
  51628. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  51629. this.getAttributes()
  51630. }
  51631. }
  51632. }),
  51633. this.id = p++,
  51634. this.code = f,
  51635. this.usedTimes = 1,
  51636. this.program = P,
  51637. this.vertexShader = D,
  51638. this.fragmentShader = N,
  51639. this
  51640. }
  51641. }(),
  51642. n.WebGLPrograms = function(e, t) {
  51643. function i(e) {
  51644. if (t.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  51645. return 1024;
  51646. var i = t.maxVertexUniforms
  51647. , r = Math.floor((i - 20) / 4)
  51648. , o = r;
  51649. return void 0 !== e && e instanceof n.SkinnedMesh && (o = Math.min(e.skeleton.bones.length, o),
  51650. o < e.skeleton.bones.length && console.warn("WebGLRenderer: too many bones - " + e.skeleton.bones.length + ", this GPU supports just " + o + " (try OpenGL instead of ANGLE)")),
  51651. o
  51652. }
  51653. function r(e, t) {
  51654. var i;
  51655. return e ? e instanceof n.Texture ? i = e.encoding : e instanceof n.WebGLRenderTarget && (i = e.texture.encoding) : i = n.LinearEncoding,
  51656. i === n.LinearEncoding && t && (i = n.GammaEncoding),
  51657. i
  51658. }
  51659. var o = []
  51660. , a = {
  51661. MeshDepthMaterial: "depth",
  51662. MeshNormalMaterial: "normal",
  51663. MeshBasicMaterial: "basic",
  51664. MeshLambertMaterial: "lambert",
  51665. MeshPhongMaterial: "phong",
  51666. MeshStandardMaterial: "standard",
  51667. LineBasicMaterial: "basic",
  51668. LineDashedMaterial: "dashed",
  51669. PointsMaterial: "points"
  51670. }
  51671. , s = ["precision", "supportsVertexTextures", "map", "mapEncoding", "envMap", "envMapMode", "envMapEncoding", "lightMap", "aoMap", "emissiveMap", "emissiveMapEncoding", "bumpMap", "normalMap", "displacementMap", "specularMap", "roughnessMap", "metalnessMap", "alphaMap", "combine", "vertexColors", "fog", "useFog", "fogExp", "flatShading", "sizeAttenuation", "logarithmicDepthBuffer", "skinning", "maxBones", "useVertexTexture", "morphTargets", "morphNormals", "maxMorphTargets", "maxMorphNormals", "premultipliedAlpha", "numDirLights", "numPointLights", "numSpotLights", "numHemiLights", "shadowMapEnabled", "pointLightShadows", "toneMapping", "physicallyCorrectLights", "shadowMapType", "alphaTest", "doubleSided", "flipSided"];
  51672. this.getParameters = function(o, s, l, c) {
  51673. var h = a[o.type]
  51674. , u = i(c)
  51675. , d = e.getPrecision();
  51676. null !== o.precision && (d = t.getMaxPrecision(o.precision),
  51677. d !== o.precision && console.warn("THREE.WebGLProgram.getParameters:", o.precision, "not supported, using", d, "instead."));
  51678. var p = {
  51679. shaderID: h,
  51680. precision: d,
  51681. supportsVertexTextures: t.vertexTextures,
  51682. outputEncoding: r(e.getCurrentRenderTarget(), e.gammaOutput),
  51683. map: !!o.map,
  51684. mapEncoding: r(o.map, e.gammaInput),
  51685. envMap: !!o.envMap,
  51686. envMapMode: o.envMap && o.envMap.mapping,
  51687. envMapEncoding: r(o.envMap, e.gammaInput),
  51688. envMapCubeUV: !!o.envMap && (o.envMap.mapping === n.CubeUVReflectionMapping || o.envMap.mapping === n.CubeUVRefractionMapping),
  51689. lightMap: !!o.lightMap,
  51690. aoMap: !!o.aoMap,
  51691. emissiveMap: !!o.emissiveMap,
  51692. emissiveMapEncoding: r(o.emissiveMap, e.gammaInput),
  51693. bumpMap: !!o.bumpMap,
  51694. normalMap: !!o.normalMap,
  51695. displacementMap: !!o.displacementMap,
  51696. roughnessMap: !!o.roughnessMap,
  51697. metalnessMap: !!o.metalnessMap,
  51698. specularMap: !!o.specularMap,
  51699. alphaMap: !!o.alphaMap,
  51700. combine: o.combine,
  51701. vertexColors: o.vertexColors,
  51702. fog: l,
  51703. useFog: o.fog,
  51704. fogExp: l instanceof n.FogExp2,
  51705. flatShading: o.shading === n.FlatShading,
  51706. sizeAttenuation: o.sizeAttenuation,
  51707. logarithmicDepthBuffer: t.logarithmicDepthBuffer,
  51708. skinning: o.skinning,
  51709. maxBones: u,
  51710. useVertexTexture: t.floatVertexTextures && c && c.skeleton && c.skeleton.useVertexTexture,
  51711. morphTargets: o.morphTargets,
  51712. morphNormals: o.morphNormals,
  51713. maxMorphTargets: e.maxMorphTargets,
  51714. maxMorphNormals: e.maxMorphNormals,
  51715. numDirLights: s.directional.length,
  51716. numPointLights: s.point.length,
  51717. numSpotLights: s.spot.length,
  51718. numHemiLights: s.hemi.length,
  51719. pointLightShadows: s.shadowsPointLight,
  51720. shadowMapEnabled: e.shadowMap.enabled && c.receiveShadow && s.shadows.length > 0,
  51721. shadowMapType: e.shadowMap.type,
  51722. toneMapping: e.toneMapping,
  51723. physicallyCorrectLights: e.physicallyCorrectLights,
  51724. premultipliedAlpha: o.premultipliedAlpha,
  51725. alphaTest: o.alphaTest,
  51726. doubleSided: o.side === n.DoubleSide,
  51727. flipSided: o.side === n.BackSide
  51728. };
  51729. return p
  51730. }
  51731. ,
  51732. this.getProgramCode = function(e, t) {
  51733. var i = [];
  51734. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  51735. i.push(e.vertexShader)),
  51736. void 0 !== e.defines)
  51737. for (var n in e.defines)
  51738. i.push(n),
  51739. i.push(e.defines[n]);
  51740. for (var r = 0; r < s.length; r++) {
  51741. var o = s[r];
  51742. i.push(o),
  51743. i.push(t[o])
  51744. }
  51745. return i.join()
  51746. }
  51747. ,
  51748. this.acquireProgram = function(t, i, r) {
  51749. for (var a, s = 0, l = o.length; s < l; s++) {
  51750. var c = o[s];
  51751. if (c.code === r) {
  51752. a = c,
  51753. ++a.usedTimes;
  51754. break
  51755. }
  51756. }
  51757. return void 0 === a && (a = new n.WebGLProgram(e,r,t,i),
  51758. o.push(a)),
  51759. a
  51760. }
  51761. ,
  51762. this.releaseProgram = function(e) {
  51763. if (0 === --e.usedTimes) {
  51764. var t = o.indexOf(e);
  51765. o[t] = o[o.length - 1],
  51766. o.pop(),
  51767. e.destroy()
  51768. }
  51769. }
  51770. ,
  51771. this.programs = o
  51772. }
  51773. ,
  51774. n.WebGLProperties = function() {
  51775. var e = {};
  51776. this.get = function(t) {
  51777. var i = t.uuid
  51778. , n = e[i];
  51779. return void 0 === n && (n = {},
  51780. e[i] = n),
  51781. n
  51782. }
  51783. ,
  51784. this.delete = function(t) {
  51785. delete e[t.uuid]
  51786. }
  51787. ,
  51788. this.clear = function() {
  51789. e = {}
  51790. }
  51791. }
  51792. ,
  51793. n.WebGLShader = function() {
  51794. function e(e) {
  51795. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  51796. t[i] = i + 1 + ": " + t[i];
  51797. return t.join("\n")
  51798. }
  51799. return function(t, i, n) {
  51800. var r = t.createShader(i);
  51801. return t.shaderSource(r, n),
  51802. t.compileShader(r),
  51803. t.getShaderParameter(r, t.COMPILE_STATUS) === !1 && console.error("THREE.WebGLShader: Shader couldn't compile."),
  51804. "" !== t.getShaderInfoLog(r) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", i === t.VERTEX_SHADER ? "vertex" : "fragment", t.getShaderInfoLog(r), e(n)),
  51805. r
  51806. }
  51807. }(),
  51808. n.WebGLShadowMap = function(e, t, i) {
  51809. function r(e, t, i, r) {
  51810. var o = e.geometry
  51811. , a = null
  51812. , s = v
  51813. , l = e.customDepthMaterial;
  51814. if (i && (s = A,
  51815. l = e.customDistanceMaterial),
  51816. l)
  51817. a = l;
  51818. else {
  51819. var c = void 0 !== o.morphTargets && o.morphTargets.length > 0 && t.morphTargets
  51820. , h = e instanceof n.SkinnedMesh && t.skinning
  51821. , u = 0;
  51822. c && (u |= f),
  51823. h && (u |= g),
  51824. a = s[u]
  51825. }
  51826. return a.visible = t.visible,
  51827. a.wireframe = t.wireframe,
  51828. a.wireframeLinewidth = t.wireframeLinewidth,
  51829. i && void 0 !== a.uniforms.lightPos && a.uniforms.lightPos.value.copy(r),
  51830. a
  51831. }
  51832. function o(e, t, i) {
  51833. if (e.visible !== !1) {
  51834. if (e.layers.test(t.layers) && (e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && e.castShadow && (e.frustumCulled === !1 || l.intersectsObject(e) === !0)) {
  51835. var r = e.material;
  51836. r.visible === !0 && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  51837. p.push(e))
  51838. }
  51839. for (var a = e.children, s = 0, c = a.length; s < c; s++)
  51840. o(a[s], t, i)
  51841. }
  51842. }
  51843. for (var a = e.context, s = e.state, l = new n.Frustum, c = new n.Matrix4, h = new n.Vector2, u = new n.Vector3, d = new n.Vector3, p = [], f = 1, g = 2, m = (f | g) + 1, v = new Array(m), A = new Array(m), y = [new n.Vector3(1,0,0), new n.Vector3(-1,0,0), new n.Vector3(0,0,1), new n.Vector3(0,0,-1), new n.Vector3(0,1,0), new n.Vector3(0,-1,0)], C = [new n.Vector3(0,1,0), new n.Vector3(0,1,0), new n.Vector3(0,1,0), new n.Vector3(0,1,0), new n.Vector3(0,0,1), new n.Vector3(0,0,-1)], I = [new n.Vector4, new n.Vector4, new n.Vector4, new n.Vector4, new n.Vector4, new n.Vector4], E = n.ShaderLib.depthRGBA, b = n.UniformsUtils.clone(E.uniforms), w = n.ShaderLib.distanceRGBA, _ = n.UniformsUtils.clone(w.uniforms), T = 0; T !== m; ++T) {
  51844. var x = 0 !== (T & f)
  51845. , S = 0 !== (T & g)
  51846. , M = new n.ShaderMaterial({
  51847. uniforms: b,
  51848. vertexShader: E.vertexShader,
  51849. fragmentShader: E.fragmentShader,
  51850. morphTargets: x,
  51851. skinning: S
  51852. });
  51853. v[T] = M;
  51854. var R = new n.ShaderMaterial({
  51855. defines: {
  51856. USE_SHADOWMAP: ""
  51857. },
  51858. uniforms: _,
  51859. vertexShader: w.vertexShader,
  51860. fragmentShader: w.fragmentShader,
  51861. morphTargets: x,
  51862. skinning: S
  51863. });
  51864. A[T] = R
  51865. }
  51866. var P = this;
  51867. this.enabled = !1,
  51868. this.autoUpdate = !0,
  51869. this.needsUpdate = !1,
  51870. this.type = n.PCFShadowMap,
  51871. this.cullFace = n.CullFaceFront,
  51872. this.render = function(f, g) {
  51873. var m, v, A = t.shadows;
  51874. if (0 !== A.length && P.enabled !== !1 && (P.autoUpdate !== !1 || P.needsUpdate !== !1)) {
  51875. s.clearColor(1, 1, 1, 1),
  51876. s.disable(a.BLEND),
  51877. s.enable(a.CULL_FACE),
  51878. a.frontFace(a.CCW),
  51879. a.cullFace(P.cullFace === n.CullFaceFront ? a.FRONT : a.BACK),
  51880. s.setDepthTest(!0),
  51881. s.setScissorTest(!1);
  51882. for (var E = 0, b = A.length; E < b; E++) {
  51883. var w = A[E]
  51884. , _ = w.shadow
  51885. , T = _.camera;
  51886. if (h.copy(_.mapSize),
  51887. w instanceof n.PointLight) {
  51888. m = 6,
  51889. v = !0;
  51890. var x = h.x
  51891. , S = h.y;
  51892. I[0].set(2 * x, S, x, S),
  51893. I[1].set(0, S, x, S),
  51894. I[2].set(3 * x, S, x, S),
  51895. I[3].set(x, S, x, S),
  51896. I[4].set(3 * x, 0, x, S),
  51897. I[5].set(x, 0, x, S),
  51898. h.x *= 4,
  51899. h.y *= 2
  51900. } else
  51901. m = 1,
  51902. v = !1;
  51903. if (null === _.map) {
  51904. var M = {
  51905. minFilter: n.NearestFilter,
  51906. magFilter: n.NearestFilter,
  51907. format: n.RGBAFormat
  51908. };
  51909. _.map = new n.WebGLRenderTarget(h.x,h.y,M),
  51910. w instanceof n.SpotLight && (T.aspect = h.x / h.y),
  51911. T.updateProjectionMatrix()
  51912. }
  51913. var R = _.map
  51914. , O = _.matrix;
  51915. d.setFromMatrixPosition(w.matrixWorld),
  51916. T.position.copy(d),
  51917. e.setRenderTarget(R),
  51918. e.clear();
  51919. for (var L = 0; L < m; L++) {
  51920. if (v) {
  51921. u.copy(T.position),
  51922. u.add(y[L]),
  51923. T.up.copy(C[L]),
  51924. T.lookAt(u);
  51925. var D = I[L];
  51926. s.viewport(D)
  51927. } else
  51928. u.setFromMatrixPosition(w.target.matrixWorld),
  51929. T.lookAt(u);
  51930. T.updateMatrixWorld(),
  51931. T.matrixWorldInverse.getInverse(T.matrixWorld),
  51932. O.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  51933. O.multiply(T.projectionMatrix),
  51934. O.multiply(T.matrixWorldInverse),
  51935. c.multiplyMatrices(T.projectionMatrix, T.matrixWorldInverse),
  51936. l.setFromMatrix(c),
  51937. p.length = 0,
  51938. o(f, g, T);
  51939. for (var N = 0, B = p.length; N < B; N++) {
  51940. var F = p[N]
  51941. , V = i.update(F)
  51942. , U = F.material;
  51943. if (U instanceof n.MultiMaterial)
  51944. for (var k = V.groups, H = U.materials, G = 0, z = k.length; G < z; G++) {
  51945. var W = k[G]
  51946. , j = H[W.materialIndex];
  51947. if (j.visible === !0) {
  51948. var Y = r(F, j, v, d);
  51949. e.renderBufferDirect(T, null, V, Y, F, W)
  51950. }
  51951. }
  51952. else {
  51953. var Y = r(F, U, v, d);
  51954. e.renderBufferDirect(T, null, V, Y, F, null)
  51955. }
  51956. }
  51957. }
  51958. }
  51959. var X = e.getClearColor()
  51960. , Z = e.getClearAlpha();
  51961. e.setClearColor(X, Z),
  51962. s.enable(a.BLEND),
  51963. P.cullFace === n.CullFaceFront && a.cullFace(a.BACK),
  51964. P.needsUpdate = !1
  51965. }
  51966. }
  51967. }
  51968. ,
  51969. n.WebGLState = function(e, t, i) {
  51970. var r = this
  51971. , o = new n.Vector4
  51972. , a = new Uint8Array(16)
  51973. , s = new Uint8Array(16)
  51974. , l = new Uint8Array(16)
  51975. , c = {}
  51976. , h = null
  51977. , u = null
  51978. , d = null
  51979. , p = null
  51980. , f = null
  51981. , g = null
  51982. , m = null
  51983. , v = null
  51984. , A = !1
  51985. , y = null
  51986. , C = null
  51987. , I = null
  51988. , E = null
  51989. , b = null
  51990. , w = null
  51991. , _ = null
  51992. , T = null
  51993. , x = null
  51994. , S = null
  51995. , M = null
  51996. , R = null
  51997. , P = null
  51998. , O = null
  51999. , L = null
  52000. , D = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  52001. , N = void 0
  52002. , B = {}
  52003. , F = new n.Vector4
  52004. , V = null
  52005. , U = null
  52006. , k = new n.Vector4
  52007. , H = new n.Vector4
  52008. , G = e.createTexture();
  52009. e.bindTexture(e.TEXTURE_2D, G),
  52010. e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR),
  52011. e.texImage2D(e.TEXTURE_2D, 0, e.RGB, 1, 1, 0, e.RGB, e.UNSIGNED_BYTE, new Uint8Array(3)),
  52012. this.init = function() {
  52013. this.clearColor(0, 0, 0, 1),
  52014. this.clearDepth(1),
  52015. this.clearStencil(0),
  52016. this.enable(e.DEPTH_TEST),
  52017. e.depthFunc(e.LEQUAL),
  52018. e.frontFace(e.CCW),
  52019. e.cullFace(e.BACK),
  52020. this.enable(e.CULL_FACE),
  52021. this.enable(e.BLEND),
  52022. e.blendEquation(e.FUNC_ADD),
  52023. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  52024. }
  52025. ,
  52026. this.initAttributes = function() {
  52027. for (var e = 0, t = a.length; e < t; e++)
  52028. a[e] = 0
  52029. }
  52030. ,
  52031. this.enableAttribute = function(i) {
  52032. if (a[i] = 1,
  52033. 0 === s[i] && (e.enableVertexAttribArray(i),
  52034. s[i] = 1),
  52035. 0 !== l[i]) {
  52036. var n = t.get("ANGLE_instanced_arrays");
  52037. n.vertexAttribDivisorANGLE(i, 0),
  52038. l[i] = 0
  52039. }
  52040. }
  52041. ,
  52042. this.enableAttributeAndDivisor = function(t, i, n) {
  52043. a[t] = 1,
  52044. 0 === s[t] && (e.enableVertexAttribArray(t),
  52045. s[t] = 1),
  52046. l[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  52047. l[t] = i)
  52048. }
  52049. ,
  52050. this.disableUnusedAttributes = function() {
  52051. for (var t = 0, i = s.length; t < i; t++)
  52052. s[t] !== a[t] && (e.disableVertexAttribArray(t),
  52053. s[t] = 0)
  52054. }
  52055. ,
  52056. this.enable = function(t) {
  52057. c[t] !== !0 && (e.enable(t),
  52058. c[t] = !0)
  52059. }
  52060. ,
  52061. this.disable = function(t) {
  52062. c[t] !== !1 && (e.disable(t),
  52063. c[t] = !1)
  52064. }
  52065. ,
  52066. this.getCompressedTextureFormats = function() {
  52067. if (null === h && (h = [],
  52068. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  52069. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  52070. h.push(i[n]);
  52071. return h
  52072. }
  52073. ,
  52074. this.setBlending = function(t, r, o, a, s, l, c, h) {
  52075. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  52076. t === u && h === A || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  52077. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  52078. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  52079. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  52080. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  52081. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  52082. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  52083. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  52084. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  52085. u = t,
  52086. A = h),
  52087. t === n.CustomBlending ? (s = s || r,
  52088. l = l || o,
  52089. c = c || a,
  52090. r === d && s === g || (e.blendEquationSeparate(i(r), i(s)),
  52091. d = r,
  52092. g = s),
  52093. o === p && a === f && l === m && c === v || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  52094. p = o,
  52095. f = a,
  52096. m = l,
  52097. v = c)) : (d = null,
  52098. p = null,
  52099. f = null,
  52100. g = null,
  52101. m = null,
  52102. v = null)
  52103. }
  52104. ,
  52105. this.setDepthFunc = function(t) {
  52106. if (y !== t) {
  52107. if (t)
  52108. switch (t) {
  52109. case n.NeverDepth:
  52110. e.depthFunc(e.NEVER);
  52111. break;
  52112. case n.AlwaysDepth:
  52113. e.depthFunc(e.ALWAYS);
  52114. break;
  52115. case n.LessDepth:
  52116. e.depthFunc(e.LESS);
  52117. break;
  52118. case n.LessEqualDepth:
  52119. e.depthFunc(e.LEQUAL);
  52120. break;
  52121. case n.EqualDepth:
  52122. e.depthFunc(e.EQUAL);
  52123. break;
  52124. case n.GreaterEqualDepth:
  52125. e.depthFunc(e.GEQUAL);
  52126. break;
  52127. case n.GreaterDepth:
  52128. e.depthFunc(e.GREATER);
  52129. break;
  52130. case n.NotEqualDepth:
  52131. e.depthFunc(e.NOTEQUAL);
  52132. break;
  52133. default:
  52134. e.depthFunc(e.LEQUAL)
  52135. }
  52136. else
  52137. e.depthFunc(e.LEQUAL);
  52138. y = t
  52139. }
  52140. }
  52141. ,
  52142. this.setDepthTest = function(t) {
  52143. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  52144. }
  52145. ,
  52146. this.setDepthWrite = function(t) {
  52147. C !== t && (e.depthMask(t),
  52148. C = t)
  52149. }
  52150. ,
  52151. this.setColorWrite = function(t) {
  52152. I !== t && (e.colorMask(t, t, t, t),
  52153. I = t)
  52154. }
  52155. ,
  52156. this.setStencilFunc = function(t, i, n) {
  52157. b === t && w === i && _ === n || (e.stencilFunc(t, i, n),
  52158. b = t,
  52159. w = i,
  52160. _ = n)
  52161. }
  52162. ,
  52163. this.setStencilOp = function(t, i, n) {
  52164. T === t && x === i && S === n || (e.stencilOp(t, i, n),
  52165. T = t,
  52166. x = i,
  52167. S = n)
  52168. }
  52169. ,
  52170. this.setStencilTest = function(t) {
  52171. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  52172. }
  52173. ,
  52174. this.setStencilWrite = function(t) {
  52175. E !== t && (e.stencilMask(t),
  52176. E = t)
  52177. }
  52178. ,
  52179. this.setFlipSided = function(t) {
  52180. M !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  52181. M = t)
  52182. }
  52183. ,
  52184. this.setLineWidth = function(t) {
  52185. t !== R && (e.lineWidth(t),
  52186. R = t)
  52187. }
  52188. ,
  52189. this.setPolygonOffset = function(t, i, n) {
  52190. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  52191. !t || P === i && O === n || (e.polygonOffset(i, n),
  52192. P = i,
  52193. O = n)
  52194. }
  52195. ,
  52196. this.getScissorTest = function() {
  52197. return L
  52198. }
  52199. ,
  52200. this.setScissorTest = function(t) {
  52201. L = t,
  52202. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  52203. }
  52204. ,
  52205. this.activeTexture = function(t) {
  52206. void 0 === t && (t = e.TEXTURE0 + D - 1),
  52207. N !== t && (e.activeTexture(t),
  52208. N = t)
  52209. }
  52210. ,
  52211. this.bindTexture = function(t, i) {
  52212. void 0 === N && r.activeTexture();
  52213. var n = B[N];
  52214. void 0 === n && (n = {
  52215. type: void 0,
  52216. texture: void 0
  52217. },
  52218. B[N] = n),
  52219. n.type === t && n.texture === i || (e.bindTexture(t, i || G),
  52220. n.type = t,
  52221. n.texture = i)
  52222. }
  52223. ,
  52224. this.compressedTexImage2D = function() {
  52225. try {
  52226. e.compressedTexImage2D.apply(e, arguments)
  52227. } catch (e) {
  52228. console.error(e)
  52229. }
  52230. }
  52231. ,
  52232. this.texImage2D = function() {
  52233. try {
  52234. e.texImage2D.apply(e, arguments)
  52235. } catch (e) {
  52236. console.error(e)
  52237. }
  52238. }
  52239. ,
  52240. this.clearColor = function(t, i, n, r) {
  52241. o.set(t, i, n, r),
  52242. F.equals(o) === !1 && (e.clearColor(t, i, n, r),
  52243. F.copy(o))
  52244. }
  52245. ,
  52246. this.clearDepth = function(t) {
  52247. V !== t && (e.clearDepth(t),
  52248. V = t)
  52249. }
  52250. ,
  52251. this.clearStencil = function(t) {
  52252. U !== t && (e.clearStencil(t),
  52253. U = t)
  52254. }
  52255. ,
  52256. this.scissor = function(t) {
  52257. k.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  52258. k.copy(t))
  52259. }
  52260. ,
  52261. this.viewport = function(t) {
  52262. H.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  52263. H.copy(t))
  52264. }
  52265. ,
  52266. this.reset = function() {
  52267. for (var t = 0; t < s.length; t++)
  52268. 1 === s[t] && (e.disableVertexAttribArray(t),
  52269. s[t] = 0);
  52270. c = {},
  52271. h = null,
  52272. N = void 0,
  52273. B = {},
  52274. u = null,
  52275. I = null,
  52276. C = null,
  52277. E = null,
  52278. M = null
  52279. }
  52280. }
  52281. ,
  52282. n.LensFlarePlugin = function(e, t) {
  52283. function i() {
  52284. var e = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1])
  52285. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  52286. o = p.createBuffer(),
  52287. a = p.createBuffer(),
  52288. p.bindBuffer(p.ARRAY_BUFFER, o),
  52289. p.bufferData(p.ARRAY_BUFFER, e, p.STATIC_DRAW),
  52290. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  52291. p.bufferData(p.ELEMENT_ARRAY_BUFFER, t, p.STATIC_DRAW),
  52292. u = p.createTexture(),
  52293. d = p.createTexture(),
  52294. f.bindTexture(p.TEXTURE_2D, u),
  52295. p.texImage2D(p.TEXTURE_2D, 0, p.RGB, 16, 16, 0, p.RGB, p.UNSIGNED_BYTE, null),
  52296. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  52297. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  52298. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  52299. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  52300. f.bindTexture(p.TEXTURE_2D, d),
  52301. p.texImage2D(p.TEXTURE_2D, 0, p.RGBA, 16, 16, 0, p.RGBA, p.UNSIGNED_BYTE, null),
  52302. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  52303. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  52304. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  52305. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  52306. h = p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0;
  52307. var i;
  52308. i = h ? {
  52309. 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"),
  52310. 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")
  52311. } : {
  52312. 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"),
  52313. 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")
  52314. },
  52315. s = r(i),
  52316. l = {
  52317. vertex: p.getAttribLocation(s, "position"),
  52318. uv: p.getAttribLocation(s, "uv")
  52319. },
  52320. c = {
  52321. renderType: p.getUniformLocation(s, "renderType"),
  52322. map: p.getUniformLocation(s, "map"),
  52323. occlusionMap: p.getUniformLocation(s, "occlusionMap"),
  52324. opacity: p.getUniformLocation(s, "opacity"),
  52325. color: p.getUniformLocation(s, "color"),
  52326. scale: p.getUniformLocation(s, "scale"),
  52327. rotation: p.getUniformLocation(s, "rotation"),
  52328. screenPosition: p.getUniformLocation(s, "screenPosition")
  52329. }
  52330. }
  52331. function r(t) {
  52332. var i = p.createProgram()
  52333. , n = p.createShader(p.FRAGMENT_SHADER)
  52334. , r = p.createShader(p.VERTEX_SHADER)
  52335. , o = "precision " + e.getPrecision() + " float;\n";
  52336. return p.shaderSource(n, o + t.fragmentShader),
  52337. p.shaderSource(r, o + t.vertexShader),
  52338. p.compileShader(n),
  52339. p.compileShader(r),
  52340. p.attachShader(i, n),
  52341. p.attachShader(i, r),
  52342. p.linkProgram(i),
  52343. i
  52344. }
  52345. var o, a, s, l, c, h, u, d, p = e.context, f = e.state;
  52346. this.render = function(r, g, m) {
  52347. if (0 !== t.length) {
  52348. var v = new n.Vector3
  52349. , A = m.w / m.z
  52350. , y = .5 * m.z
  52351. , C = .5 * m.w
  52352. , I = 16 / m.w
  52353. , E = new n.Vector2(I * A,I)
  52354. , b = new n.Vector3(1,1,0)
  52355. , w = new n.Vector2(1,1);
  52356. void 0 === s && i(),
  52357. p.useProgram(s),
  52358. f.initAttributes(),
  52359. f.enableAttribute(l.vertex),
  52360. f.enableAttribute(l.uv),
  52361. f.disableUnusedAttributes(),
  52362. p.uniform1i(c.occlusionMap, 0),
  52363. p.uniform1i(c.map, 1),
  52364. p.bindBuffer(p.ARRAY_BUFFER, o),
  52365. p.vertexAttribPointer(l.vertex, 2, p.FLOAT, !1, 16, 0),
  52366. p.vertexAttribPointer(l.uv, 2, p.FLOAT, !1, 16, 8),
  52367. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  52368. f.disable(p.CULL_FACE),
  52369. f.setDepthWrite(!1);
  52370. for (var _ = 0, T = t.length; _ < T; _++) {
  52371. I = 16 / m.w,
  52372. E.set(I * A, I);
  52373. var x = t[_];
  52374. if (v.set(x.matrixWorld.elements[12], x.matrixWorld.elements[13], x.matrixWorld.elements[14]),
  52375. v.applyMatrix4(g.matrixWorldInverse),
  52376. v.applyProjection(g.projectionMatrix),
  52377. b.copy(v),
  52378. w.x = b.x * y + y,
  52379. w.y = b.y * C + C,
  52380. h || w.x > 0 && w.x < m.z && w.y > 0 && w.y < m.w) {
  52381. f.activeTexture(p.TEXTURE0),
  52382. f.bindTexture(p.TEXTURE_2D, null),
  52383. f.activeTexture(p.TEXTURE1),
  52384. f.bindTexture(p.TEXTURE_2D, u),
  52385. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGB, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  52386. p.uniform1i(c.renderType, 0),
  52387. p.uniform2f(c.scale, E.x, E.y),
  52388. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  52389. f.disable(p.BLEND),
  52390. f.enable(p.DEPTH_TEST),
  52391. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  52392. f.activeTexture(p.TEXTURE0),
  52393. f.bindTexture(p.TEXTURE_2D, d),
  52394. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGBA, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  52395. p.uniform1i(c.renderType, 1),
  52396. f.disable(p.DEPTH_TEST),
  52397. f.activeTexture(p.TEXTURE1),
  52398. f.bindTexture(p.TEXTURE_2D, u),
  52399. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  52400. x.positionScreen.copy(b),
  52401. x.customUpdateCallback ? x.customUpdateCallback(x) : x.updateLensFlares(),
  52402. p.uniform1i(c.renderType, 2),
  52403. f.enable(p.BLEND);
  52404. for (var S = 0, M = x.lensFlares.length; S < M; S++) {
  52405. var R = x.lensFlares[S];
  52406. R.opacity > .001 && R.scale > .001 && (b.x = R.x,
  52407. b.y = R.y,
  52408. b.z = R.z,
  52409. I = R.size * R.scale / m.w,
  52410. E.x = I * A,
  52411. E.y = I,
  52412. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  52413. p.uniform2f(c.scale, E.x, E.y),
  52414. p.uniform1f(c.rotation, R.rotation),
  52415. p.uniform1f(c.opacity, R.opacity),
  52416. p.uniform3f(c.color, R.color.r, R.color.g, R.color.b),
  52417. f.setBlending(R.blending, R.blendEquation, R.blendSrc, R.blendDst),
  52418. e.setTexture(R.texture, 1),
  52419. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0))
  52420. }
  52421. }
  52422. }
  52423. f.enable(p.CULL_FACE),
  52424. f.enable(p.DEPTH_TEST),
  52425. f.setDepthWrite(!0),
  52426. e.resetGLState()
  52427. }
  52428. }
  52429. }
  52430. ,
  52431. n.SpritePlugin = function(e, t) {
  52432. function i() {
  52433. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  52434. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  52435. a = d.createBuffer(),
  52436. s = d.createBuffer(),
  52437. d.bindBuffer(d.ARRAY_BUFFER, a),
  52438. d.bufferData(d.ARRAY_BUFFER, e, d.STATIC_DRAW),
  52439. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  52440. d.bufferData(d.ELEMENT_ARRAY_BUFFER, t, d.STATIC_DRAW),
  52441. l = r(),
  52442. c = {
  52443. position: d.getAttribLocation(l, "position"),
  52444. uv: d.getAttribLocation(l, "uv")
  52445. },
  52446. h = {
  52447. uvOffset: d.getUniformLocation(l, "uvOffset"),
  52448. uvScale: d.getUniformLocation(l, "uvScale"),
  52449. rotation: d.getUniformLocation(l, "rotation"),
  52450. scale: d.getUniformLocation(l, "scale"),
  52451. color: d.getUniformLocation(l, "color"),
  52452. map: d.getUniformLocation(l, "map"),
  52453. opacity: d.getUniformLocation(l, "opacity"),
  52454. modelViewMatrix: d.getUniformLocation(l, "modelViewMatrix"),
  52455. projectionMatrix: d.getUniformLocation(l, "projectionMatrix"),
  52456. fogType: d.getUniformLocation(l, "fogType"),
  52457. fogDensity: d.getUniformLocation(l, "fogDensity"),
  52458. fogNear: d.getUniformLocation(l, "fogNear"),
  52459. fogFar: d.getUniformLocation(l, "fogFar"),
  52460. fogColor: d.getUniformLocation(l, "fogColor"),
  52461. alphaTest: d.getUniformLocation(l, "alphaTest")
  52462. };
  52463. var i = document.createElement("canvas");
  52464. i.width = 8,
  52465. i.height = 8;
  52466. var o = i.getContext("2d");
  52467. o.fillStyle = "white",
  52468. o.fillRect(0, 0, 8, 8),
  52469. u = new n.Texture(i),
  52470. u.needsUpdate = !0
  52471. }
  52472. function r() {
  52473. var t = d.createProgram()
  52474. , i = d.createShader(d.VERTEX_SHADER)
  52475. , n = d.createShader(d.FRAGMENT_SHADER);
  52476. return d.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")),
  52477. d.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")),
  52478. d.compileShader(i),
  52479. d.compileShader(n),
  52480. d.attachShader(t, i),
  52481. d.attachShader(t, n),
  52482. d.linkProgram(t),
  52483. t
  52484. }
  52485. function o(e, t) {
  52486. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  52487. }
  52488. var a, s, l, c, h, u, d = e.context, p = e.state, f = new n.Vector3, g = new n.Quaternion, m = new n.Vector3;
  52489. this.render = function(r, v) {
  52490. if (0 !== t.length) {
  52491. void 0 === l && i(),
  52492. d.useProgram(l),
  52493. p.initAttributes(),
  52494. p.enableAttribute(c.position),
  52495. p.enableAttribute(c.uv),
  52496. p.disableUnusedAttributes(),
  52497. p.disable(d.CULL_FACE),
  52498. p.enable(d.BLEND),
  52499. d.bindBuffer(d.ARRAY_BUFFER, a),
  52500. d.vertexAttribPointer(c.position, 2, d.FLOAT, !1, 16, 0),
  52501. d.vertexAttribPointer(c.uv, 2, d.FLOAT, !1, 16, 8),
  52502. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  52503. d.uniformMatrix4fv(h.projectionMatrix, !1, v.projectionMatrix.elements),
  52504. p.activeTexture(d.TEXTURE0),
  52505. d.uniform1i(h.map, 0);
  52506. var A = 0
  52507. , y = 0
  52508. , C = r.fog;
  52509. C ? (d.uniform3f(h.fogColor, C.color.r, C.color.g, C.color.b),
  52510. C instanceof n.Fog ? (d.uniform1f(h.fogNear, C.near),
  52511. d.uniform1f(h.fogFar, C.far),
  52512. d.uniform1i(h.fogType, 1),
  52513. A = 1,
  52514. y = 1) : C instanceof n.FogExp2 && (d.uniform1f(h.fogDensity, C.density),
  52515. d.uniform1i(h.fogType, 2),
  52516. A = 2,
  52517. y = 2)) : (d.uniform1i(h.fogType, 0),
  52518. A = 0,
  52519. y = 0);
  52520. for (var I = 0, E = t.length; I < E; I++) {
  52521. var b = t[I];
  52522. b.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse, b.matrixWorld),
  52523. b.z = -b.modelViewMatrix.elements[14]
  52524. }
  52525. t.sort(o);
  52526. for (var w = [], I = 0, E = t.length; I < E; I++) {
  52527. var b = t[I]
  52528. , _ = b.material;
  52529. d.uniform1f(h.alphaTest, _.alphaTest),
  52530. d.uniformMatrix4fv(h.modelViewMatrix, !1, b.modelViewMatrix.elements),
  52531. b.matrixWorld.decompose(f, g, m),
  52532. w[0] = m.x,
  52533. w[1] = m.y;
  52534. var T = 0;
  52535. r.fog && _.fog && (T = y),
  52536. A !== T && (d.uniform1i(h.fogType, T),
  52537. A = T),
  52538. null !== _.map ? (d.uniform2f(h.uvOffset, _.map.offset.x, _.map.offset.y),
  52539. d.uniform2f(h.uvScale, _.map.repeat.x, _.map.repeat.y)) : (d.uniform2f(h.uvOffset, 0, 0),
  52540. d.uniform2f(h.uvScale, 1, 1)),
  52541. d.uniform1f(h.opacity, _.opacity),
  52542. d.uniform3f(h.color, _.color.r, _.color.g, _.color.b),
  52543. d.uniform1f(h.rotation, _.rotation),
  52544. d.uniform2fv(h.scale, w),
  52545. p.setBlending(_.blending, _.blendEquation, _.blendSrc, _.blendDst),
  52546. p.setDepthTest(_.depthTest),
  52547. p.setDepthWrite(_.depthWrite),
  52548. _.map && _.map.image && _.map.image.width ? e.setTexture(_.map, 0) : e.setTexture(u, 0),
  52549. d.drawElements(d.TRIANGLES, 6, d.UNSIGNED_SHORT, 0)
  52550. }
  52551. p.enable(d.CULL_FACE),
  52552. e.resetGLState()
  52553. }
  52554. }
  52555. }
  52556. ,
  52557. Object.defineProperties(n.Box2.prototype, {
  52558. empty: {
  52559. value: function() {
  52560. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  52561. this.isEmpty()
  52562. }
  52563. },
  52564. isIntersectionBox: {
  52565. value: function(e) {
  52566. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  52567. this.intersectsBox(e)
  52568. }
  52569. }
  52570. }),
  52571. Object.defineProperties(n.Box3.prototype, {
  52572. empty: {
  52573. value: function() {
  52574. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  52575. this.isEmpty()
  52576. }
  52577. },
  52578. isIntersectionBox: {
  52579. value: function(e) {
  52580. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  52581. this.intersectsBox(e)
  52582. }
  52583. },
  52584. isIntersectionSphere: {
  52585. value: function(e) {
  52586. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  52587. this.intersectsSphere(e)
  52588. }
  52589. }
  52590. }),
  52591. Object.defineProperties(n.Matrix3.prototype, {
  52592. multiplyVector3: {
  52593. value: function(e) {
  52594. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  52595. e.applyMatrix3(this)
  52596. }
  52597. },
  52598. multiplyVector3Array: {
  52599. value: function(e) {
  52600. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  52601. this.applyToVector3Array(e)
  52602. }
  52603. }
  52604. }),
  52605. Object.defineProperties(n.Matrix4.prototype, {
  52606. extractPosition: {
  52607. value: function(e) {
  52608. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  52609. this.copyPosition(e)
  52610. }
  52611. },
  52612. setRotationFromQuaternion: {
  52613. value: function(e) {
  52614. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  52615. this.makeRotationFromQuaternion(e)
  52616. }
  52617. },
  52618. multiplyVector3: {
  52619. value: function(e) {
  52620. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  52621. e.applyProjection(this)
  52622. }
  52623. },
  52624. multiplyVector4: {
  52625. value: function(e) {
  52626. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  52627. e.applyMatrix4(this)
  52628. }
  52629. },
  52630. multiplyVector3Array: {
  52631. value: function(e) {
  52632. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  52633. this.applyToVector3Array(e)
  52634. }
  52635. },
  52636. rotateAxis: {
  52637. value: function(e) {
  52638. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  52639. e.transformDirection(this)
  52640. }
  52641. },
  52642. crossVector: {
  52643. value: function(e) {
  52644. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  52645. e.applyMatrix4(this)
  52646. }
  52647. },
  52648. translate: {
  52649. value: function(e) {
  52650. console.error("THREE.Matrix4: .translate() has been removed.")
  52651. }
  52652. },
  52653. rotateX: {
  52654. value: function(e) {
  52655. console.error("THREE.Matrix4: .rotateX() has been removed.")
  52656. }
  52657. },
  52658. rotateY: {
  52659. value: function(e) {
  52660. console.error("THREE.Matrix4: .rotateY() has been removed.")
  52661. }
  52662. },
  52663. rotateZ: {
  52664. value: function(e) {
  52665. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  52666. }
  52667. },
  52668. rotateByAxis: {
  52669. value: function(e, t) {
  52670. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  52671. }
  52672. }
  52673. }),
  52674. Object.defineProperties(n.Plane.prototype, {
  52675. isIntersectionLine: {
  52676. value: function(e) {
  52677. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  52678. this.intersectsLine(e)
  52679. }
  52680. }
  52681. }),
  52682. Object.defineProperties(n.Quaternion.prototype, {
  52683. multiplyVector3: {
  52684. value: function(e) {
  52685. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  52686. e.applyQuaternion(this)
  52687. }
  52688. }
  52689. }),
  52690. Object.defineProperties(n.Ray.prototype, {
  52691. isIntersectionBox: {
  52692. value: function(e) {
  52693. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  52694. this.intersectsBox(e)
  52695. }
  52696. },
  52697. isIntersectionPlane: {
  52698. value: function(e) {
  52699. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  52700. this.intersectsPlane(e)
  52701. }
  52702. },
  52703. isIntersectionSphere: {
  52704. value: function(e) {
  52705. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  52706. this.intersectsSphere(e)
  52707. }
  52708. }
  52709. }),
  52710. Object.defineProperties(n.Vector3.prototype, {
  52711. setEulerFromRotationMatrix: {
  52712. value: function() {
  52713. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  52714. }
  52715. },
  52716. setEulerFromQuaternion: {
  52717. value: function() {
  52718. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  52719. }
  52720. },
  52721. getPositionFromMatrix: {
  52722. value: function(e) {
  52723. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  52724. this.setFromMatrixPosition(e)
  52725. }
  52726. },
  52727. getScaleFromMatrix: {
  52728. value: function(e) {
  52729. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  52730. this.setFromMatrixScale(e)
  52731. }
  52732. },
  52733. getColumnFromMatrix: {
  52734. value: function(e, t) {
  52735. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  52736. this.setFromMatrixColumn(e, t)
  52737. }
  52738. }
  52739. }),
  52740. n.Face4 = function(e, t, i, r, o, a, s) {
  52741. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  52742. new n.Face3(e,t,i,o,a,s)
  52743. }
  52744. ,
  52745. n.Vertex = function(e, t, i) {
  52746. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  52747. new n.Vector3(e,t,i)
  52748. }
  52749. ,
  52750. Object.defineProperties(n.Object3D.prototype, {
  52751. eulerOrder: {
  52752. get: function() {
  52753. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  52754. this.rotation.order
  52755. },
  52756. set: function(e) {
  52757. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  52758. this.rotation.order = e
  52759. }
  52760. },
  52761. getChildByName: {
  52762. value: function(e) {
  52763. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  52764. this.getObjectByName(e)
  52765. }
  52766. },
  52767. renderDepth: {
  52768. set: function(e) {
  52769. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  52770. }
  52771. },
  52772. translate: {
  52773. value: function(e, t) {
  52774. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  52775. this.translateOnAxis(t, e)
  52776. }
  52777. },
  52778. useQuaternion: {
  52779. get: function() {
  52780. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  52781. },
  52782. set: function(e) {
  52783. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  52784. }
  52785. }
  52786. }),
  52787. Object.defineProperties(n, {
  52788. PointCloud: {
  52789. value: function(e, t) {
  52790. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  52791. new n.Points(e,t)
  52792. }
  52793. },
  52794. ParticleSystem: {
  52795. value: function(e, t) {
  52796. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  52797. new n.Points(e,t)
  52798. }
  52799. }
  52800. }),
  52801. Object.defineProperties(n.Light.prototype, {
  52802. onlyShadow: {
  52803. set: function(e) {
  52804. console.warn("THREE.Light: .onlyShadow has been removed.")
  52805. }
  52806. },
  52807. shadowCameraFov: {
  52808. set: function(e) {
  52809. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  52810. this.shadow.camera.fov = e
  52811. }
  52812. },
  52813. shadowCameraLeft: {
  52814. set: function(e) {
  52815. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  52816. this.shadow.camera.left = e
  52817. }
  52818. },
  52819. shadowCameraRight: {
  52820. set: function(e) {
  52821. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  52822. this.shadow.camera.right = e
  52823. }
  52824. },
  52825. shadowCameraTop: {
  52826. set: function(e) {
  52827. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  52828. this.shadow.camera.top = e
  52829. }
  52830. },
  52831. shadowCameraBottom: {
  52832. set: function(e) {
  52833. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  52834. this.shadow.camera.bottom = e
  52835. }
  52836. },
  52837. shadowCameraNear: {
  52838. set: function(e) {
  52839. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  52840. this.shadow.camera.near = e
  52841. }
  52842. },
  52843. shadowCameraFar: {
  52844. set: function(e) {
  52845. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  52846. this.shadow.camera.far = e
  52847. }
  52848. },
  52849. shadowCameraVisible: {
  52850. set: function(e) {
  52851. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  52852. }
  52853. },
  52854. shadowBias: {
  52855. set: function(e) {
  52856. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  52857. this.shadow.bias = e
  52858. }
  52859. },
  52860. shadowDarkness: {
  52861. set: function(e) {
  52862. console.warn("THREE.Light: .shadowDarkness has been removed.")
  52863. }
  52864. },
  52865. shadowMapWidth: {
  52866. set: function(e) {
  52867. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  52868. this.shadow.mapSize.width = e
  52869. }
  52870. },
  52871. shadowMapHeight: {
  52872. set: function(e) {
  52873. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  52874. this.shadow.mapSize.height = e
  52875. }
  52876. }
  52877. }),
  52878. Object.defineProperties(n.BufferAttribute.prototype, {
  52879. length: {
  52880. get: function() {
  52881. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  52882. this.array.length
  52883. }
  52884. }
  52885. }),
  52886. Object.defineProperties(n.BufferGeometry.prototype, {
  52887. drawcalls: {
  52888. get: function() {
  52889. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  52890. this.groups
  52891. }
  52892. },
  52893. offsets: {
  52894. get: function() {
  52895. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  52896. this.groups
  52897. }
  52898. },
  52899. addIndex: {
  52900. value: function(e) {
  52901. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  52902. this.setIndex(e)
  52903. }
  52904. },
  52905. addDrawCall: {
  52906. value: function(e, t, i) {
  52907. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  52908. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  52909. this.addGroup(e, t)
  52910. }
  52911. },
  52912. clearDrawCalls: {
  52913. value: function() {
  52914. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  52915. this.clearGroups()
  52916. }
  52917. },
  52918. computeTangents: {
  52919. value: function() {
  52920. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  52921. }
  52922. },
  52923. computeOffsets: {
  52924. value: function() {
  52925. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  52926. }
  52927. }
  52928. }),
  52929. Object.defineProperties(n.Material.prototype, {
  52930. wrapAround: {
  52931. get: function() {
  52932. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  52933. },
  52934. set: function(e) {
  52935. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  52936. }
  52937. },
  52938. wrapRGB: {
  52939. get: function() {
  52940. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  52941. new n.Color
  52942. }
  52943. }
  52944. }),
  52945. Object.defineProperties(n, {
  52946. PointCloudMaterial: {
  52947. value: function(e) {
  52948. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  52949. new n.PointsMaterial(e)
  52950. }
  52951. },
  52952. ParticleBasicMaterial: {
  52953. value: function(e) {
  52954. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  52955. new n.PointsMaterial(e)
  52956. }
  52957. },
  52958. ParticleSystemMaterial: {
  52959. value: function(e) {
  52960. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  52961. new n.PointsMaterial(e)
  52962. }
  52963. }
  52964. }),
  52965. Object.defineProperties(n.MeshPhongMaterial.prototype, {
  52966. metal: {
  52967. get: function() {
  52968. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  52969. !1
  52970. },
  52971. set: function(e) {
  52972. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  52973. }
  52974. }
  52975. }),
  52976. Object.defineProperties(n.ShaderMaterial.prototype, {
  52977. derivatives: {
  52978. get: function() {
  52979. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  52980. this.extensions.derivatives
  52981. },
  52982. set: function(e) {
  52983. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  52984. this.extensions.derivatives = e
  52985. }
  52986. }
  52987. }),
  52988. Object.defineProperties(n.WebGLRenderer.prototype, {
  52989. supportsFloatTextures: {
  52990. value: function() {
  52991. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  52992. this.extensions.get("OES_texture_float")
  52993. }
  52994. },
  52995. supportsHalfFloatTextures: {
  52996. value: function() {
  52997. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  52998. this.extensions.get("OES_texture_half_float")
  52999. }
  53000. },
  53001. supportsStandardDerivatives: {
  53002. value: function() {
  53003. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  53004. this.extensions.get("OES_standard_derivatives")
  53005. }
  53006. },
  53007. supportsCompressedTextureS3TC: {
  53008. value: function() {
  53009. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  53010. this.extensions.get("WEBGL_compressed_texture_s3tc")
  53011. }
  53012. },
  53013. supportsCompressedTexturePVRTC: {
  53014. value: function() {
  53015. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  53016. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  53017. }
  53018. },
  53019. supportsBlendMinMax: {
  53020. value: function() {
  53021. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  53022. this.extensions.get("EXT_blend_minmax")
  53023. }
  53024. },
  53025. supportsVertexTextures: {
  53026. value: function() {
  53027. return this.capabilities.vertexTextures
  53028. }
  53029. },
  53030. supportsInstancedArrays: {
  53031. value: function() {
  53032. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  53033. this.extensions.get("ANGLE_instanced_arrays")
  53034. }
  53035. },
  53036. enableScissorTest: {
  53037. value: function(e) {
  53038. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  53039. this.setScissorTest(e)
  53040. }
  53041. },
  53042. initMaterial: {
  53043. value: function() {
  53044. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  53045. }
  53046. },
  53047. addPrePlugin: {
  53048. value: function() {
  53049. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  53050. }
  53051. },
  53052. addPostPlugin: {
  53053. value: function() {
  53054. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  53055. }
  53056. },
  53057. updateShadowMap: {
  53058. value: function() {
  53059. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  53060. }
  53061. },
  53062. shadowMapEnabled: {
  53063. get: function() {
  53064. return this.shadowMap.enabled
  53065. },
  53066. set: function(e) {
  53067. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  53068. this.shadowMap.enabled = e
  53069. }
  53070. },
  53071. shadowMapType: {
  53072. get: function() {
  53073. return this.shadowMap.type
  53074. },
  53075. set: function(e) {
  53076. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  53077. this.shadowMap.type = e
  53078. }
  53079. },
  53080. shadowMapCullFace: {
  53081. get: function() {
  53082. return this.shadowMap.cullFace
  53083. },
  53084. set: function(e) {
  53085. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  53086. this.shadowMap.cullFace = e
  53087. }
  53088. }
  53089. }),
  53090. Object.defineProperties(n.WebGLRenderTarget.prototype, {
  53091. wrapS: {
  53092. get: function() {
  53093. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  53094. this.texture.wrapS
  53095. },
  53096. set: function(e) {
  53097. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  53098. this.texture.wrapS = e
  53099. }
  53100. },
  53101. wrapT: {
  53102. get: function() {
  53103. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  53104. this.texture.wrapT
  53105. },
  53106. set: function(e) {
  53107. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  53108. this.texture.wrapT = e
  53109. }
  53110. },
  53111. magFilter: {
  53112. get: function() {
  53113. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  53114. this.texture.magFilter
  53115. },
  53116. set: function(e) {
  53117. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  53118. this.texture.magFilter = e
  53119. }
  53120. },
  53121. minFilter: {
  53122. get: function() {
  53123. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  53124. this.texture.minFilter
  53125. },
  53126. set: function(e) {
  53127. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  53128. this.texture.minFilter = e
  53129. }
  53130. },
  53131. anisotropy: {
  53132. get: function() {
  53133. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  53134. this.texture.anisotropy
  53135. },
  53136. set: function(e) {
  53137. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  53138. this.texture.anisotropy = e
  53139. }
  53140. },
  53141. offset: {
  53142. get: function() {
  53143. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  53144. this.texture.offset
  53145. },
  53146. set: function(e) {
  53147. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  53148. this.texture.offset = e
  53149. }
  53150. },
  53151. repeat: {
  53152. get: function() {
  53153. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  53154. this.texture.repeat
  53155. },
  53156. set: function(e) {
  53157. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  53158. this.texture.repeat = e
  53159. }
  53160. },
  53161. format: {
  53162. get: function() {
  53163. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  53164. this.texture.format
  53165. },
  53166. set: function(e) {
  53167. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  53168. this.texture.format = e
  53169. }
  53170. },
  53171. type: {
  53172. get: function() {
  53173. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  53174. this.texture.type
  53175. },
  53176. set: function(e) {
  53177. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  53178. this.texture.type = e
  53179. }
  53180. },
  53181. generateMipmaps: {
  53182. get: function() {
  53183. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  53184. this.texture.generateMipmaps
  53185. },
  53186. set: function(e) {
  53187. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  53188. this.texture.generateMipmaps = e
  53189. }
  53190. }
  53191. }),
  53192. n.GeometryUtils = {
  53193. merge: function(e, t, i) {
  53194. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");
  53195. var r;
  53196. t instanceof n.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  53197. r = t.matrix,
  53198. t = t.geometry),
  53199. e.merge(t, r, i)
  53200. },
  53201. center: function(e) {
  53202. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  53203. e.center()
  53204. }
  53205. },
  53206. n.ImageUtils = {
  53207. crossOrigin: void 0,
  53208. loadTexture: function(e, t, i, r) {
  53209. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  53210. var o = new n.TextureLoader;
  53211. o.setCrossOrigin(this.crossOrigin);
  53212. var a = o.load(e, i, void 0, r);
  53213. return t && (a.mapping = t),
  53214. a
  53215. },
  53216. loadTextureCube: function(e, t, i, r) {
  53217. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  53218. var o = new n.CubeTextureLoader;
  53219. o.setCrossOrigin(this.crossOrigin);
  53220. var a = o.load(e, i, void 0, r);
  53221. return t && (a.mapping = t),
  53222. a
  53223. },
  53224. loadCompressedTexture: function() {
  53225. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  53226. },
  53227. loadCompressedTextureCube: function() {
  53228. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  53229. }
  53230. },
  53231. n.Projector = function() {
  53232. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  53233. this.projectVector = function(e, t) {
  53234. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  53235. e.project(t)
  53236. }
  53237. ,
  53238. this.unprojectVector = function(e, t) {
  53239. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  53240. e.unproject(t)
  53241. }
  53242. ,
  53243. this.pickingRay = function(e, t) {
  53244. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  53245. }
  53246. }
  53247. ,
  53248. n.CanvasRenderer = function() {
  53249. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  53250. this.domElement = document.createElement("canvas"),
  53251. this.clear = function() {}
  53252. ,
  53253. this.render = function() {}
  53254. ,
  53255. this.setClearColor = function() {}
  53256. ,
  53257. this.setSize = function() {}
  53258. }
  53259. ,
  53260. n.MeshFaceMaterial = n.MultiMaterial,
  53261. n.CurveUtils = {
  53262. tangentQuadraticBezier: function(e, t, i, n) {
  53263. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  53264. },
  53265. tangentCubicBezier: function(e, t, i, n, r) {
  53266. return -3 * t * (1 - e) * (1 - e) + 3 * i * (1 - e) * (1 - e) - 6 * e * i * (1 - e) + 6 * e * n * (1 - e) - 3 * e * e * n + 3 * e * e * r
  53267. },
  53268. tangentSpline: function(e, t, i, n, r) {
  53269. var o = 6 * e * e - 6 * e
  53270. , a = 3 * e * e - 4 * e + 1
  53271. , s = -6 * e * e + 6 * e
  53272. , l = 3 * e * e - 2 * e;
  53273. return o + a + s + l
  53274. },
  53275. interpolate: function(e, t, i, n, r) {
  53276. var o = .5 * (i - e)
  53277. , a = .5 * (n - t)
  53278. , s = r * r
  53279. , l = r * s;
  53280. return (2 * t - 2 * i + o + a) * l + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  53281. }
  53282. },
  53283. n.SceneUtils = {
  53284. createMultiMaterialObject: function(e, t) {
  53285. for (var i = new n.Group, r = 0, o = t.length; r < o; r++)
  53286. i.add(new n.Mesh(e,t[r]));
  53287. return i
  53288. },
  53289. detach: function(e, t, i) {
  53290. e.applyMatrix(t.matrixWorld),
  53291. t.remove(e),
  53292. i.add(e)
  53293. },
  53294. attach: function(e, t, i) {
  53295. var r = new n.Matrix4;
  53296. r.getInverse(i.matrixWorld),
  53297. e.applyMatrix(r),
  53298. t.remove(e),
  53299. i.add(e)
  53300. }
  53301. },
  53302. n.ShapeUtils = {
  53303. area: function(e) {
  53304. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  53305. i += e[n].x * e[r].y - e[r].x * e[n].y;
  53306. return .5 * i
  53307. },
  53308. triangulate: function() {
  53309. function e(e, t, i, n, r, o) {
  53310. var a, s, l, c, h, u, d, p, f;
  53311. if (s = e[o[t]].x,
  53312. l = e[o[t]].y,
  53313. c = e[o[i]].x,
  53314. h = e[o[i]].y,
  53315. u = e[o[n]].x,
  53316. d = e[o[n]].y,
  53317. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  53318. return !1;
  53319. var g, m, v, A, y, C, I, E, b, w, _, T, x, S, M;
  53320. for (g = u - c,
  53321. m = d - h,
  53322. v = s - u,
  53323. A = l - d,
  53324. y = c - s,
  53325. C = h - l,
  53326. a = 0; a < r; a++)
  53327. if (p = e[o[a]].x,
  53328. f = e[o[a]].y,
  53329. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = p - s,
  53330. E = f - l,
  53331. b = p - c,
  53332. w = f - h,
  53333. _ = p - u,
  53334. T = f - d,
  53335. M = g * w - m * b,
  53336. x = y * E - C * I,
  53337. S = v * T - A * _,
  53338. M >= -Number.EPSILON && S >= -Number.EPSILON && x >= -Number.EPSILON))
  53339. return !1;
  53340. return !0
  53341. }
  53342. return function(t, i) {
  53343. var r = t.length;
  53344. if (r < 3)
  53345. return null;
  53346. var o, a, s, l = [], c = [], h = [];
  53347. if (n.ShapeUtils.area(t) > 0)
  53348. for (a = 0; a < r; a++)
  53349. c[a] = a;
  53350. else
  53351. for (a = 0; a < r; a++)
  53352. c[a] = r - 1 - a;
  53353. var u = r
  53354. , d = 2 * u;
  53355. for (a = u - 1; u > 2; ) {
  53356. if (d-- <= 0)
  53357. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  53358. i ? h : l;
  53359. if (o = a,
  53360. u <= o && (o = 0),
  53361. a = o + 1,
  53362. u <= a && (a = 0),
  53363. s = a + 1,
  53364. u <= s && (s = 0),
  53365. e(t, o, a, s, u, c)) {
  53366. var p, f, g, m, v;
  53367. for (p = c[o],
  53368. f = c[a],
  53369. g = c[s],
  53370. l.push([t[p], t[f], t[g]]),
  53371. h.push([c[o], c[a], c[s]]),
  53372. m = a,
  53373. v = a + 1; v < u; m++,
  53374. v++)
  53375. c[m] = c[v];
  53376. u--,
  53377. d = 2 * u
  53378. }
  53379. }
  53380. return i ? h : l
  53381. }
  53382. }(),
  53383. triangulateShape: function(e, t) {
  53384. function i(e, t, i) {
  53385. return e.x !== t.x ? e.x < t.x ? e.x <= i.x && i.x <= t.x : t.x <= i.x && i.x <= e.x : e.y < t.y ? e.y <= i.y && i.y <= t.y : t.y <= i.y && i.y <= e.y
  53386. }
  53387. function r(e, t, n, r, o) {
  53388. var a = t.x - e.x
  53389. , s = t.y - e.y
  53390. , l = r.x - n.x
  53391. , c = r.y - n.y
  53392. , h = e.x - n.x
  53393. , u = e.y - n.y
  53394. , d = s * l - a * c
  53395. , p = s * h - a * u;
  53396. if (Math.abs(d) > Number.EPSILON) {
  53397. var f;
  53398. if (d > 0) {
  53399. if (p < 0 || p > d)
  53400. return [];
  53401. if (f = c * h - l * u,
  53402. f < 0 || f > d)
  53403. return []
  53404. } else {
  53405. if (p > 0 || p < d)
  53406. return [];
  53407. if (f = c * h - l * u,
  53408. f > 0 || f < d)
  53409. return []
  53410. }
  53411. if (0 === f)
  53412. return !o || 0 !== p && p !== d ? [e] : [];
  53413. if (f === d)
  53414. return !o || 0 !== p && p !== d ? [t] : [];
  53415. if (0 === p)
  53416. return [n];
  53417. if (p === d)
  53418. return [r];
  53419. var g = f / d;
  53420. return [{
  53421. x: e.x + g * a,
  53422. y: e.y + g * s
  53423. }]
  53424. }
  53425. if (0 !== p || c * h !== l * u)
  53426. return [];
  53427. var m = 0 === a && 0 === s
  53428. , v = 0 === l && 0 === c;
  53429. if (m && v)
  53430. return e.x !== n.x || e.y !== n.y ? [] : [e];
  53431. if (m)
  53432. return i(n, r, e) ? [e] : [];
  53433. if (v)
  53434. return i(e, t, n) ? [n] : [];
  53435. var A, y, C, I, E, b, w, _;
  53436. return 0 !== a ? (e.x < t.x ? (A = e,
  53437. C = e.x,
  53438. y = t,
  53439. I = t.x) : (A = t,
  53440. C = t.x,
  53441. y = e,
  53442. I = e.x),
  53443. n.x < r.x ? (E = n,
  53444. w = n.x,
  53445. b = r,
  53446. _ = r.x) : (E = r,
  53447. w = r.x,
  53448. b = n,
  53449. _ = n.x)) : (e.y < t.y ? (A = e,
  53450. C = e.y,
  53451. y = t,
  53452. I = t.y) : (A = t,
  53453. C = t.y,
  53454. y = e,
  53455. I = e.y),
  53456. n.y < r.y ? (E = n,
  53457. w = n.y,
  53458. b = r,
  53459. _ = r.y) : (E = r,
  53460. w = r.y,
  53461. b = n,
  53462. _ = n.y)),
  53463. C <= w ? I < w ? [] : I === w ? o ? [] : [E] : I <= _ ? [E, y] : [E, b] : C > _ ? [] : C === _ ? o ? [] : [A] : I <= _ ? [A, y] : [A, b]
  53464. }
  53465. function o(e, t, i, n) {
  53466. var r = t.x - e.x
  53467. , o = t.y - e.y
  53468. , a = i.x - e.x
  53469. , s = i.y - e.y
  53470. , l = n.x - e.x
  53471. , c = n.y - e.y
  53472. , h = r * s - o * a
  53473. , u = r * c - o * l;
  53474. if (Math.abs(h) > Number.EPSILON) {
  53475. var d = l * s - c * a;
  53476. return h > 0 ? u >= 0 && d >= 0 : u >= 0 || d >= 0
  53477. }
  53478. return u > 0
  53479. }
  53480. function a(e, t) {
  53481. function i(e, t) {
  53482. var i = A.length - 1
  53483. , n = e - 1;
  53484. n < 0 && (n = i);
  53485. var r = e + 1;
  53486. r > i && (r = 0);
  53487. var a = o(A[e], A[n], A[r], s[t]);
  53488. if (!a)
  53489. return !1;
  53490. var l = s.length - 1
  53491. , c = t - 1;
  53492. c < 0 && (c = l);
  53493. var h = t + 1;
  53494. return h > l && (h = 0),
  53495. a = o(s[t], s[c], s[h], A[e]),
  53496. !!a
  53497. }
  53498. function n(e, t) {
  53499. var i, n, o;
  53500. for (i = 0; i < A.length; i++)
  53501. if (n = i + 1,
  53502. n %= A.length,
  53503. o = r(e, t, A[i], A[n], !0),
  53504. o.length > 0)
  53505. return !0;
  53506. return !1
  53507. }
  53508. function a(e, i) {
  53509. var n, o, a, s, l;
  53510. for (n = 0; n < y.length; n++)
  53511. for (o = t[y[n]],
  53512. a = 0; a < o.length; a++)
  53513. if (s = a + 1,
  53514. s %= o.length,
  53515. l = r(e, i, o[a], o[s], !0),
  53516. l.length > 0)
  53517. return !0;
  53518. return !1
  53519. }
  53520. for (var s, l, c, h, u, d, p, f, g, m, v, A = e.concat(), y = [], C = [], I = 0, E = t.length; I < E; I++)
  53521. y.push(I);
  53522. for (var b = 0, w = 2 * y.length; y.length > 0; ) {
  53523. if (w--,
  53524. w < 0) {
  53525. console.log("Infinite Loop! Holes left:" + y.length + ", Probably Hole outside Shape!");
  53526. break
  53527. }
  53528. for (c = b; c < A.length; c++) {
  53529. h = A[c],
  53530. l = -1;
  53531. for (var I = 0; I < y.length; I++)
  53532. if (d = y[I],
  53533. p = h.x + ":" + h.y + ":" + d,
  53534. void 0 === C[p]) {
  53535. s = t[d];
  53536. for (var _ = 0; _ < s.length; _++)
  53537. if (u = s[_],
  53538. i(c, _) && !n(h, u) && !a(h, u)) {
  53539. l = _,
  53540. y.splice(I, 1),
  53541. f = A.slice(0, c + 1),
  53542. g = A.slice(c),
  53543. m = s.slice(l),
  53544. v = s.slice(0, l + 1),
  53545. A = f.concat(m).concat(v).concat(g),
  53546. b = c;
  53547. break
  53548. }
  53549. if (l >= 0)
  53550. break;
  53551. C[p] = !0
  53552. }
  53553. if (l >= 0)
  53554. break
  53555. }
  53556. }
  53557. return A
  53558. }
  53559. for (var s, l, c, h, u, d, p = {}, f = e.concat(), g = 0, m = t.length; g < m; g++)
  53560. Array.prototype.push.apply(f, t[g]);
  53561. for (s = 0,
  53562. l = f.length; s < l; s++)
  53563. u = f[s].x + ":" + f[s].y,
  53564. void 0 !== p[u] && console.warn("THREE.Shape: Duplicate point", u),
  53565. p[u] = s;
  53566. var v = a(e, t)
  53567. , A = n.ShapeUtils.triangulate(v, !1);
  53568. for (s = 0,
  53569. l = A.length; s < l; s++)
  53570. for (h = A[s],
  53571. c = 0; c < 3; c++)
  53572. u = h[c].x + ":" + h[c].y,
  53573. d = p[u],
  53574. void 0 !== d && (h[c] = d);
  53575. return A.concat()
  53576. },
  53577. isClockWise: function(e) {
  53578. return n.ShapeUtils.area(e) < 0
  53579. },
  53580. b2: function() {
  53581. function e(e, t) {
  53582. var i = 1 - e;
  53583. return i * i * t
  53584. }
  53585. function t(e, t) {
  53586. return 2 * (1 - e) * e * t
  53587. }
  53588. function i(e, t) {
  53589. return e * e * t
  53590. }
  53591. return function(n, r, o, a) {
  53592. return e(n, r) + t(n, o) + i(n, a)
  53593. }
  53594. }(),
  53595. b3: function() {
  53596. function e(e, t) {
  53597. var i = 1 - e;
  53598. return i * i * i * t
  53599. }
  53600. function t(e, t) {
  53601. var i = 1 - e;
  53602. return 3 * i * i * e * t
  53603. }
  53604. function i(e, t) {
  53605. var i = 1 - e;
  53606. return 3 * i * e * e * t
  53607. }
  53608. function n(e, t) {
  53609. return e * e * e * t
  53610. }
  53611. return function(r, o, a, s, l) {
  53612. return e(r, o) + t(r, a) + i(r, s) + n(r, l)
  53613. }
  53614. }()
  53615. },
  53616. n.Curve = function() {}
  53617. ,
  53618. n.Curve.prototype = {
  53619. constructor: n.Curve,
  53620. getPoint: function(e) {
  53621. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  53622. null
  53623. },
  53624. getPointAt: function(e) {
  53625. var t = this.getUtoTmapping(e);
  53626. return this.getPoint(t)
  53627. },
  53628. getPoints: function(e) {
  53629. e || (e = 5);
  53630. var t, i = [];
  53631. for (t = 0; t <= e; t++)
  53632. i.push(this.getPoint(t / e));
  53633. return i
  53634. },
  53635. getSpacedPoints: function(e) {
  53636. e || (e = 5);
  53637. var t, i = [];
  53638. for (t = 0; t <= e; t++)
  53639. i.push(this.getPointAt(t / e));
  53640. return i
  53641. },
  53642. getLength: function() {
  53643. var e = this.getLengths();
  53644. return e[e.length - 1]
  53645. },
  53646. getLengths: function(e) {
  53647. if (e || (e = this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  53648. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  53649. return this.cacheArcLengths;
  53650. this.needsUpdate = !1;
  53651. var t, i, n = [], r = this.getPoint(0), o = 0;
  53652. for (n.push(0),
  53653. i = 1; i <= e; i++)
  53654. t = this.getPoint(i / e),
  53655. o += t.distanceTo(r),
  53656. n.push(o),
  53657. r = t;
  53658. return this.cacheArcLengths = n,
  53659. n
  53660. },
  53661. updateArcLengths: function() {
  53662. this.needsUpdate = !0,
  53663. this.getLengths()
  53664. },
  53665. getUtoTmapping: function(e, t) {
  53666. var i, n = this.getLengths(), r = 0, o = n.length;
  53667. i = t ? t : e * n[o - 1];
  53668. for (var a, s = 0, l = o - 1; s <= l; )
  53669. if (r = Math.floor(s + (l - s) / 2),
  53670. a = n[r] - i,
  53671. a < 0)
  53672. s = r + 1;
  53673. else {
  53674. if (!(a > 0)) {
  53675. l = r;
  53676. break
  53677. }
  53678. l = r - 1
  53679. }
  53680. if (r = l,
  53681. n[r] === i) {
  53682. var c = r / (o - 1);
  53683. return c
  53684. }
  53685. var h = n[r]
  53686. , u = n[r + 1]
  53687. , d = u - h
  53688. , p = (i - h) / d
  53689. , c = (r + p) / (o - 1);
  53690. return c
  53691. },
  53692. getTangent: function(e) {
  53693. var t = 1e-4
  53694. , i = e - t
  53695. , n = e + t;
  53696. i < 0 && (i = 0),
  53697. n > 1 && (n = 1);
  53698. var r = this.getPoint(i)
  53699. , o = this.getPoint(n)
  53700. , a = o.clone().sub(r);
  53701. return a.normalize()
  53702. },
  53703. getTangentAt: function(e) {
  53704. var t = this.getUtoTmapping(e);
  53705. return this.getTangent(t)
  53706. }
  53707. },
  53708. n.Curve.create = function(e, t) {
  53709. return e.prototype = Object.create(n.Curve.prototype),
  53710. e.prototype.constructor = e,
  53711. e.prototype.getPoint = t,
  53712. e
  53713. }
  53714. ,
  53715. n.CurvePath = function() {
  53716. this.curves = [],
  53717. this.autoClose = !1
  53718. }
  53719. ,
  53720. n.CurvePath.prototype = Object.create(n.Curve.prototype),
  53721. n.CurvePath.prototype.constructor = n.CurvePath,
  53722. n.CurvePath.prototype.add = function(e) {
  53723. this.curves.push(e)
  53724. }
  53725. ,
  53726. n.CurvePath.prototype.closePath = function() {
  53727. var e = this.curves[0].getPoint(0)
  53728. , t = this.curves[this.curves.length - 1].getPoint(1);
  53729. e.equals(t) || this.curves.push(new n.LineCurve(t,e))
  53730. }
  53731. ,
  53732. n.CurvePath.prototype.getPoint = function(e) {
  53733. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  53734. if (i[n] >= t) {
  53735. var r = i[n] - t
  53736. , o = this.curves[n]
  53737. , a = 1 - r / o.getLength();
  53738. return o.getPointAt(a)
  53739. }
  53740. n++
  53741. }
  53742. return null
  53743. }
  53744. ,
  53745. n.CurvePath.prototype.getLength = function() {
  53746. var e = this.getCurveLengths();
  53747. return e[e.length - 1]
  53748. }
  53749. ,
  53750. n.CurvePath.prototype.getCurveLengths = function() {
  53751. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  53752. return this.cacheLengths;
  53753. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  53754. t += this.curves[i].getLength(),
  53755. e.push(t);
  53756. return this.cacheLengths = e,
  53757. e
  53758. }
  53759. ,
  53760. n.CurvePath.prototype.createPointsGeometry = function(e) {
  53761. var t = this.getPoints(e);
  53762. return this.createGeometry(t)
  53763. }
  53764. ,
  53765. n.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  53766. var t = this.getSpacedPoints(e);
  53767. return this.createGeometry(t)
  53768. }
  53769. ,
  53770. n.CurvePath.prototype.createGeometry = function(e) {
  53771. for (var t = new n.Geometry, i = 0, r = e.length; i < r; i++) {
  53772. var o = e[i];
  53773. t.vertices.push(new n.Vector3(o.x,o.y,o.z || 0))
  53774. }
  53775. return t
  53776. }
  53777. ,
  53778. n.Font = function(e) {
  53779. this.data = e
  53780. }
  53781. ,
  53782. n.Font.prototype = {
  53783. constructor: n.Font,
  53784. generateShapes: function(e, t, i) {
  53785. function r(e) {
  53786. for (var i = String(e).split(""), n = t / a.resolution, r = 0, s = [], l = 0; l < i.length; l++) {
  53787. var c = o(i[l], n, r);
  53788. r += c.offset,
  53789. s.push(c.path)
  53790. }
  53791. return s
  53792. }
  53793. function o(e, t, r) {
  53794. var o = a.glyphs[e] || a.glyphs["?"];
  53795. if (o) {
  53796. var s, l, c, h, u, d, p, f, g, m, v, A = new n.Path, y = [], C = n.ShapeUtils.b2, I = n.ShapeUtils.b3;
  53797. if (o.o)
  53798. for (var E = o._cachedOutline || (o._cachedOutline = o.o.split(" ")), b = 0, w = E.length; b < w; ) {
  53799. var _ = E[b++];
  53800. switch (_) {
  53801. case "m":
  53802. s = E[b++] * t + r,
  53803. l = E[b++] * t,
  53804. A.moveTo(s, l);
  53805. break;
  53806. case "l":
  53807. s = E[b++] * t + r,
  53808. l = E[b++] * t,
  53809. A.lineTo(s, l);
  53810. break;
  53811. case "q":
  53812. if (c = E[b++] * t + r,
  53813. h = E[b++] * t,
  53814. p = E[b++] * t + r,
  53815. f = E[b++] * t,
  53816. A.quadraticCurveTo(p, f, c, h),
  53817. v = y[y.length - 1]) {
  53818. u = v.x,
  53819. d = v.y;
  53820. for (var T = 1; T <= i; T++) {
  53821. var x = T / i;
  53822. C(x, u, p, c),
  53823. C(x, d, f, h)
  53824. }
  53825. }
  53826. break;
  53827. case "b":
  53828. if (c = E[b++] * t + r,
  53829. h = E[b++] * t,
  53830. p = E[b++] * t + r,
  53831. f = E[b++] * t,
  53832. g = E[b++] * t + r,
  53833. m = E[b++] * t,
  53834. A.bezierCurveTo(p, f, g, m, c, h),
  53835. v = y[y.length - 1]) {
  53836. u = v.x,
  53837. d = v.y;
  53838. for (var T = 1; T <= i; T++) {
  53839. var x = T / i;
  53840. I(x, u, p, g, c),
  53841. I(x, d, f, m, h)
  53842. }
  53843. }
  53844. }
  53845. }
  53846. return {
  53847. offset: o.ha * t,
  53848. path: A
  53849. }
  53850. }
  53851. }
  53852. void 0 === t && (t = 100),
  53853. void 0 === i && (i = 4);
  53854. for (var a = this.data, s = r(e), l = [], c = 0, h = s.length; c < h; c++)
  53855. Array.prototype.push.apply(l, s[c].toShapes());
  53856. return l
  53857. }
  53858. },
  53859. n.Path = function(e) {
  53860. n.CurvePath.call(this),
  53861. this.actions = [],
  53862. e && this.fromPoints(e)
  53863. }
  53864. ,
  53865. n.Path.prototype = Object.create(n.CurvePath.prototype),
  53866. n.Path.prototype.constructor = n.Path,
  53867. n.Path.prototype.fromPoints = function(e) {
  53868. this.moveTo(e[0].x, e[0].y);
  53869. for (var t = 1, i = e.length; t < i; t++)
  53870. this.lineTo(e[t].x, e[t].y)
  53871. }
  53872. ,
  53873. n.Path.prototype.moveTo = function(e, t) {
  53874. this.actions.push({
  53875. action: "moveTo",
  53876. args: [e, t]
  53877. })
  53878. }
  53879. ,
  53880. n.Path.prototype.lineTo = function(e, t) {
  53881. var i = this.actions[this.actions.length - 1].args
  53882. , r = i[i.length - 2]
  53883. , o = i[i.length - 1]
  53884. , a = new n.LineCurve(new n.Vector2(r,o),new n.Vector2(e,t));
  53885. this.curves.push(a),
  53886. this.actions.push({
  53887. action: "lineTo",
  53888. args: [e, t]
  53889. })
  53890. }
  53891. ,
  53892. n.Path.prototype.quadraticCurveTo = function(e, t, i, r) {
  53893. var o = this.actions[this.actions.length - 1].args
  53894. , a = o[o.length - 2]
  53895. , s = o[o.length - 1]
  53896. , l = new n.QuadraticBezierCurve(new n.Vector2(a,s),new n.Vector2(e,t),new n.Vector2(i,r));
  53897. this.curves.push(l),
  53898. this.actions.push({
  53899. action: "quadraticCurveTo",
  53900. args: [e, t, i, r]
  53901. })
  53902. }
  53903. ,
  53904. n.Path.prototype.bezierCurveTo = function(e, t, i, r, o, a) {
  53905. var s = this.actions[this.actions.length - 1].args
  53906. , l = s[s.length - 2]
  53907. , c = s[s.length - 1]
  53908. , h = new n.CubicBezierCurve(new n.Vector2(l,c),new n.Vector2(e,t),new n.Vector2(i,r),new n.Vector2(o,a));
  53909. this.curves.push(h),
  53910. this.actions.push({
  53911. action: "bezierCurveTo",
  53912. args: [e, t, i, r, o, a]
  53913. })
  53914. }
  53915. ,
  53916. n.Path.prototype.splineThru = function(e) {
  53917. var t = Array.prototype.slice.call(arguments)
  53918. , i = this.actions[this.actions.length - 1].args
  53919. , r = i[i.length - 2]
  53920. , o = i[i.length - 1]
  53921. , a = [new n.Vector2(r,o)];
  53922. Array.prototype.push.apply(a, e);
  53923. var s = new n.SplineCurve(a);
  53924. this.curves.push(s),
  53925. this.actions.push({
  53926. action: "splineThru",
  53927. args: t
  53928. })
  53929. }
  53930. ,
  53931. n.Path.prototype.arc = function(e, t, i, n, r, o) {
  53932. var a = this.actions[this.actions.length - 1].args
  53933. , s = a[a.length - 2]
  53934. , l = a[a.length - 1];
  53935. this.absarc(e + s, t + l, i, n, r, o)
  53936. }
  53937. ,
  53938. n.Path.prototype.absarc = function(e, t, i, n, r, o) {
  53939. this.absellipse(e, t, i, i, n, r, o)
  53940. }
  53941. ,
  53942. n.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  53943. var l = this.actions[this.actions.length - 1].args
  53944. , c = l[l.length - 2]
  53945. , h = l[l.length - 1];
  53946. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  53947. }
  53948. ,
  53949. n.Path.prototype.absellipse = function(e, t, i, r, o, a, s, l) {
  53950. var c = [e, t, i, r, o, a, s, l || 0]
  53951. , h = new n.EllipseCurve(e,t,i,r,o,a,s,l);
  53952. this.curves.push(h);
  53953. var u = h.getPoint(1);
  53954. c.push(u.x),
  53955. c.push(u.y),
  53956. this.actions.push({
  53957. action: "ellipse",
  53958. args: c
  53959. })
  53960. }
  53961. ,
  53962. n.Path.prototype.getSpacedPoints = function(e) {
  53963. e || (e = 40);
  53964. for (var t = [], i = 0; i < e; i++)
  53965. t.push(this.getPoint(i / e));
  53966. return this.autoClose && t.push(t[0]),
  53967. t
  53968. }
  53969. ,
  53970. n.Path.prototype.getPoints = function(e) {
  53971. e = e || 12;
  53972. for (var t, i, r, o, a, s, l, c, h, u, d, p = n.ShapeUtils.b2, f = n.ShapeUtils.b3, g = [], m = 0, v = this.actions.length; m < v; m++) {
  53973. var A = this.actions[m]
  53974. , y = A.action
  53975. , C = A.args;
  53976. switch (y) {
  53977. case "moveTo":
  53978. g.push(new n.Vector2(C[0],C[1]));
  53979. break;
  53980. case "lineTo":
  53981. g.push(new n.Vector2(C[0],C[1]));
  53982. break;
  53983. case "quadraticCurveTo":
  53984. t = C[2],
  53985. i = C[3],
  53986. a = C[0],
  53987. s = C[1],
  53988. g.length > 0 ? (h = g[g.length - 1],
  53989. l = h.x,
  53990. c = h.y) : (h = this.actions[m - 1].args,
  53991. l = h[h.length - 2],
  53992. c = h[h.length - 1]);
  53993. for (var I = 1; I <= e; I++) {
  53994. var E = I / e;
  53995. u = p(E, l, a, t),
  53996. d = p(E, c, s, i),
  53997. g.push(new n.Vector2(u,d))
  53998. }
  53999. break;
  54000. case "bezierCurveTo":
  54001. t = C[4],
  54002. i = C[5],
  54003. a = C[0],
  54004. s = C[1],
  54005. r = C[2],
  54006. o = C[3],
  54007. g.length > 0 ? (h = g[g.length - 1],
  54008. l = h.x,
  54009. c = h.y) : (h = this.actions[m - 1].args,
  54010. l = h[h.length - 2],
  54011. c = h[h.length - 1]);
  54012. for (var I = 1; I <= e; I++) {
  54013. var E = I / e;
  54014. u = f(E, l, a, r, t),
  54015. d = f(E, c, s, o, i),
  54016. g.push(new n.Vector2(u,d))
  54017. }
  54018. break;
  54019. case "splineThru":
  54020. h = this.actions[m - 1].args;
  54021. var b = new n.Vector2(h[h.length - 2],h[h.length - 1])
  54022. , w = [b]
  54023. , _ = e * C[0].length;
  54024. w = w.concat(C[0]);
  54025. for (var T = new n.SplineCurve(w), I = 1; I <= _; I++)
  54026. g.push(T.getPointAt(I / _));
  54027. break;
  54028. case "arc":
  54029. for (var x, S = C[0], M = C[1], R = C[2], P = C[3], O = C[4], L = !!C[5], D = O - P, N = 2 * e, I = 1; I <= N; I++) {
  54030. var E = I / N;
  54031. L || (E = 1 - E),
  54032. x = P + E * D,
  54033. u = S + R * Math.cos(x),
  54034. d = M + R * Math.sin(x),
  54035. g.push(new n.Vector2(u,d))
  54036. }
  54037. break;
  54038. case "ellipse":
  54039. var x, B, F, S = C[0], M = C[1], V = C[2], U = C[3], P = C[4], O = C[5], L = !!C[6], k = C[7], D = O - P, N = 2 * e;
  54040. 0 !== k && (B = Math.cos(k),
  54041. F = Math.sin(k));
  54042. for (var I = 1; I <= N; I++) {
  54043. var E = I / N;
  54044. if (L || (E = 1 - E),
  54045. x = P + E * D,
  54046. u = S + V * Math.cos(x),
  54047. d = M + U * Math.sin(x),
  54048. 0 !== k) {
  54049. var H = u
  54050. , G = d;
  54051. u = (H - S) * B - (G - M) * F + S,
  54052. d = (H - S) * F + (G - M) * B + M
  54053. }
  54054. g.push(new n.Vector2(u,d))
  54055. }
  54056. }
  54057. }
  54058. var z = g[g.length - 1];
  54059. return Math.abs(z.x - g[0].x) < Number.EPSILON && Math.abs(z.y - g[0].y) < Number.EPSILON && g.splice(g.length - 1, 1),
  54060. this.autoClose && g.push(g[0]),
  54061. g
  54062. }
  54063. ,
  54064. n.Path.prototype.toShapes = function(e, t) {
  54065. function i(e) {
  54066. for (var t = [], i = new n.Path, r = 0, o = e.length; r < o; r++) {
  54067. var a = e[r]
  54068. , s = a.args
  54069. , l = a.action;
  54070. "moveTo" === l && 0 !== i.actions.length && (t.push(i),
  54071. i = new n.Path),
  54072. i[l].apply(i, s)
  54073. }
  54074. return 0 !== i.actions.length && t.push(i),
  54075. t
  54076. }
  54077. function r(e) {
  54078. for (var t = [], i = 0, r = e.length; i < r; i++) {
  54079. var o = e[i]
  54080. , a = new n.Shape;
  54081. a.actions = o.actions,
  54082. a.curves = o.curves,
  54083. t.push(a)
  54084. }
  54085. return t
  54086. }
  54087. function o(e, t) {
  54088. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  54089. var a = t[r]
  54090. , s = t[o]
  54091. , l = s.x - a.x
  54092. , c = s.y - a.y;
  54093. if (Math.abs(c) > Number.EPSILON) {
  54094. if (c < 0 && (a = t[o],
  54095. l = -l,
  54096. s = t[r],
  54097. c = -c),
  54098. e.y < a.y || e.y > s.y)
  54099. continue;
  54100. if (e.y === a.y) {
  54101. if (e.x === a.x)
  54102. return !0
  54103. } else {
  54104. var h = c * (e.x - a.x) - l * (e.y - a.y);
  54105. if (0 === h)
  54106. return !0;
  54107. if (h < 0)
  54108. continue;
  54109. n = !n
  54110. }
  54111. } else {
  54112. if (e.y !== a.y)
  54113. continue;
  54114. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  54115. return !0
  54116. }
  54117. }
  54118. return n
  54119. }
  54120. var a = n.ShapeUtils.isClockWise
  54121. , s = i(this.actions);
  54122. if (0 === s.length)
  54123. return [];
  54124. if (t === !0)
  54125. return r(s);
  54126. var l, c, h, u = [];
  54127. if (1 === s.length)
  54128. return c = s[0],
  54129. h = new n.Shape,
  54130. h.actions = c.actions,
  54131. h.curves = c.curves,
  54132. u.push(h),
  54133. u;
  54134. var d = !a(s[0].getPoints());
  54135. d = e ? !d : d;
  54136. var p, f = [], g = [], m = [], v = 0;
  54137. g[v] = void 0,
  54138. m[v] = [];
  54139. for (var A = 0, y = s.length; A < y; A++)
  54140. c = s[A],
  54141. p = c.getPoints(),
  54142. l = a(p),
  54143. l = e ? !l : l,
  54144. l ? (!d && g[v] && v++,
  54145. g[v] = {
  54146. s: new n.Shape,
  54147. p: p
  54148. },
  54149. g[v].s.actions = c.actions,
  54150. g[v].s.curves = c.curves,
  54151. d && v++,
  54152. m[v] = []) : m[v].push({
  54153. h: c,
  54154. p: p[0]
  54155. });
  54156. if (!g[0])
  54157. return r(s);
  54158. if (g.length > 1) {
  54159. for (var C = !1, I = [], E = 0, b = g.length; E < b; E++)
  54160. f[E] = [];
  54161. for (var E = 0, b = g.length; E < b; E++)
  54162. for (var w = m[E], _ = 0; _ < w.length; _++) {
  54163. for (var T = w[_], x = !0, S = 0; S < g.length; S++)
  54164. o(T.p, g[S].p) && (E !== S && I.push({
  54165. froms: E,
  54166. tos: S,
  54167. hole: _
  54168. }),
  54169. x ? (x = !1,
  54170. f[S].push(T)) : C = !0);
  54171. x && f[E].push(T)
  54172. }
  54173. I.length > 0 && (C || (m = f))
  54174. }
  54175. for (var M, A = 0, R = g.length; A < R; A++) {
  54176. h = g[A].s,
  54177. u.push(h),
  54178. M = m[A];
  54179. for (var P = 0, O = M.length; P < O; P++)
  54180. h.holes.push(M[P].h)
  54181. }
  54182. return u
  54183. }
  54184. ,
  54185. n.Shape = function() {
  54186. n.Path.apply(this, arguments),
  54187. this.holes = []
  54188. }
  54189. ,
  54190. n.Shape.prototype = Object.create(n.Path.prototype),
  54191. n.Shape.prototype.constructor = n.Shape,
  54192. n.Shape.prototype.extrude = function(e) {
  54193. return new n.ExtrudeGeometry(this,e)
  54194. }
  54195. ,
  54196. n.Shape.prototype.makeGeometry = function(e) {
  54197. return new n.ShapeGeometry(this,e)
  54198. }
  54199. ,
  54200. n.Shape.prototype.getPointsHoles = function(e) {
  54201. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  54202. t[i] = this.holes[i].getPoints(e);
  54203. return t
  54204. }
  54205. ,
  54206. n.Shape.prototype.extractAllPoints = function(e) {
  54207. return {
  54208. shape: this.getPoints(e),
  54209. holes: this.getPointsHoles(e)
  54210. }
  54211. }
  54212. ,
  54213. n.Shape.prototype.extractPoints = function(e) {
  54214. return this.extractAllPoints(e)
  54215. }
  54216. ,
  54217. n.LineCurve = function(e, t) {
  54218. this.v1 = e,
  54219. this.v2 = t
  54220. }
  54221. ,
  54222. n.LineCurve.prototype = Object.create(n.Curve.prototype),
  54223. n.LineCurve.prototype.constructor = n.LineCurve,
  54224. n.LineCurve.prototype.getPoint = function(e) {
  54225. var t = this.v2.clone().sub(this.v1);
  54226. return t.multiplyScalar(e).add(this.v1),
  54227. t
  54228. }
  54229. ,
  54230. n.LineCurve.prototype.getPointAt = function(e) {
  54231. return this.getPoint(e)
  54232. }
  54233. ,
  54234. n.LineCurve.prototype.getTangent = function(e) {
  54235. var t = this.v2.clone().sub(this.v1);
  54236. return t.normalize()
  54237. }
  54238. ,
  54239. n.QuadraticBezierCurve = function(e, t, i) {
  54240. this.v0 = e,
  54241. this.v1 = t,
  54242. this.v2 = i
  54243. }
  54244. ,
  54245. n.QuadraticBezierCurve.prototype = Object.create(n.Curve.prototype),
  54246. n.QuadraticBezierCurve.prototype.constructor = n.QuadraticBezierCurve,
  54247. n.QuadraticBezierCurve.prototype.getPoint = function(e) {
  54248. var t = n.ShapeUtils.b2;
  54249. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y))
  54250. }
  54251. ,
  54252. n.QuadraticBezierCurve.prototype.getTangent = function(e) {
  54253. var t = n.CurveUtils.tangentQuadraticBezier;
  54254. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y)).normalize()
  54255. }
  54256. ,
  54257. n.CubicBezierCurve = function(e, t, i, n) {
  54258. this.v0 = e,
  54259. this.v1 = t,
  54260. this.v2 = i,
  54261. this.v3 = n
  54262. }
  54263. ,
  54264. n.CubicBezierCurve.prototype = Object.create(n.Curve.prototype),
  54265. n.CubicBezierCurve.prototype.constructor = n.CubicBezierCurve,
  54266. n.CubicBezierCurve.prototype.getPoint = function(e) {
  54267. var t = n.ShapeUtils.b3;
  54268. return new n.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))
  54269. }
  54270. ,
  54271. n.CubicBezierCurve.prototype.getTangent = function(e) {
  54272. var t = n.CurveUtils.tangentCubicBezier;
  54273. return new n.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()
  54274. }
  54275. ,
  54276. n.SplineCurve = function(e) {
  54277. this.points = void 0 == e ? [] : e
  54278. }
  54279. ,
  54280. n.SplineCurve.prototype = Object.create(n.Curve.prototype),
  54281. n.SplineCurve.prototype.constructor = n.SplineCurve,
  54282. n.SplineCurve.prototype.getPoint = function(e) {
  54283. var t = this.points
  54284. , i = (t.length - 1) * e
  54285. , r = Math.floor(i)
  54286. , o = i - r
  54287. , a = t[0 === r ? r : r - 1]
  54288. , s = t[r]
  54289. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  54290. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  54291. , h = n.CurveUtils.interpolate;
  54292. return new n.Vector2(h(a.x, s.x, l.x, c.x, o),h(a.y, s.y, l.y, c.y, o))
  54293. }
  54294. ,
  54295. n.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  54296. this.aX = e,
  54297. this.aY = t,
  54298. this.xRadius = i,
  54299. this.yRadius = n,
  54300. this.aStartAngle = r,
  54301. this.aEndAngle = o,
  54302. this.aClockwise = a,
  54303. this.aRotation = s || 0
  54304. }
  54305. ,
  54306. n.EllipseCurve.prototype = Object.create(n.Curve.prototype),
  54307. n.EllipseCurve.prototype.constructor = n.EllipseCurve,
  54308. n.EllipseCurve.prototype.getPoint = function(e) {
  54309. var t = this.aEndAngle - this.aStartAngle;
  54310. t < 0 && (t += 2 * Math.PI),
  54311. t > 2 * Math.PI && (t -= 2 * Math.PI);
  54312. var i;
  54313. i = this.aClockwise === !0 ? this.aEndAngle + (1 - e) * (2 * Math.PI - t) : this.aStartAngle + e * t;
  54314. var r = this.aX + this.xRadius * Math.cos(i)
  54315. , o = this.aY + this.yRadius * Math.sin(i);
  54316. if (0 !== this.aRotation) {
  54317. var a = Math.cos(this.aRotation)
  54318. , s = Math.sin(this.aRotation)
  54319. , l = r
  54320. , c = o;
  54321. r = (l - this.aX) * a - (c - this.aY) * s + this.aX,
  54322. o = (l - this.aX) * s + (c - this.aY) * a + this.aY
  54323. }
  54324. return new n.Vector2(r,o)
  54325. }
  54326. ,
  54327. n.ArcCurve = function(e, t, i, r, o, a) {
  54328. n.EllipseCurve.call(this, e, t, i, i, r, o, a)
  54329. }
  54330. ,
  54331. n.ArcCurve.prototype = Object.create(n.EllipseCurve.prototype),
  54332. n.ArcCurve.prototype.constructor = n.ArcCurve,
  54333. n.LineCurve3 = n.Curve.create(function(e, t) {
  54334. this.v1 = e,
  54335. this.v2 = t
  54336. }, function(e) {
  54337. var t = new n.Vector3;
  54338. return t.subVectors(this.v2, this.v1),
  54339. t.multiplyScalar(e),
  54340. t.add(this.v1),
  54341. t
  54342. }),
  54343. n.QuadraticBezierCurve3 = n.Curve.create(function(e, t, i) {
  54344. this.v0 = e,
  54345. this.v1 = t,
  54346. this.v2 = i
  54347. }, function(e) {
  54348. var t = n.ShapeUtils.b2;
  54349. return new n.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))
  54350. }),
  54351. n.CubicBezierCurve3 = n.Curve.create(function(e, t, i, n) {
  54352. this.v0 = e,
  54353. this.v1 = t,
  54354. this.v2 = i,
  54355. this.v3 = n
  54356. }, function(e) {
  54357. var t = n.ShapeUtils.b3;
  54358. return new n.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))
  54359. }),
  54360. n.SplineCurve3 = n.Curve.create(function(e) {
  54361. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  54362. this.points = void 0 == e ? [] : e
  54363. }, function(e) {
  54364. var t = this.points
  54365. , i = (t.length - 1) * e
  54366. , r = Math.floor(i)
  54367. , o = i - r
  54368. , a = t[0 == r ? r : r - 1]
  54369. , s = t[r]
  54370. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  54371. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  54372. , h = n.CurveUtils.interpolate;
  54373. return new n.Vector3(h(a.x, s.x, l.x, c.x, o),h(a.y, s.y, l.y, c.y, o),h(a.z, s.z, l.z, c.z, o))
  54374. }),
  54375. n.CatmullRomCurve3 = function() {
  54376. function e() {}
  54377. var t = new n.Vector3
  54378. , i = new e
  54379. , r = new e
  54380. , o = new e;
  54381. return e.prototype.init = function(e, t, i, n) {
  54382. this.c0 = e,
  54383. this.c1 = i,
  54384. this.c2 = -3 * e + 3 * t - 2 * i - n,
  54385. this.c3 = 2 * e - 2 * t + i + n
  54386. }
  54387. ,
  54388. e.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  54389. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  54390. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  54391. s *= o,
  54392. l *= o,
  54393. this.init(t, i, s, l)
  54394. }
  54395. ,
  54396. e.prototype.initCatmullRom = function(e, t, i, n, r) {
  54397. this.init(t, i, r * (i - e), r * (n - t))
  54398. }
  54399. ,
  54400. e.prototype.calc = function(e) {
  54401. var t = e * e
  54402. , i = t * e;
  54403. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  54404. }
  54405. ,
  54406. n.Curve.create(function(e) {
  54407. this.points = e || [],
  54408. this.closed = !1
  54409. }, function(e) {
  54410. var a, s, l, c, h = this.points;
  54411. c = h.length,
  54412. c < 2 && console.log("duh, you need at least 2 points"),
  54413. a = (c - (this.closed ? 0 : 1)) * e,
  54414. s = Math.floor(a),
  54415. l = a - s,
  54416. this.closed ? s += s > 0 ? 0 : (Math.floor(Math.abs(s) / h.length) + 1) * h.length : 0 === l && s === c - 1 && (s = c - 2,
  54417. l = 1);
  54418. var u, d, p, f;
  54419. if (this.closed || s > 0 ? u = h[(s - 1) % c] : (t.subVectors(h[0], h[1]).add(h[0]),
  54420. u = t),
  54421. d = h[s % c],
  54422. p = h[(s + 1) % c],
  54423. this.closed || s + 2 < c ? f = h[(s + 2) % c] : (t.subVectors(h[c - 1], h[c - 2]).add(h[c - 1]),
  54424. f = t),
  54425. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  54426. var g = "chordal" === this.type ? .5 : .25
  54427. , m = Math.pow(u.distanceToSquared(d), g)
  54428. , v = Math.pow(d.distanceToSquared(p), g)
  54429. , A = Math.pow(p.distanceToSquared(f), g);
  54430. v < 1e-4 && (v = 1),
  54431. m < 1e-4 && (m = v),
  54432. A < 1e-4 && (A = v),
  54433. i.initNonuniformCatmullRom(u.x, d.x, p.x, f.x, m, v, A),
  54434. r.initNonuniformCatmullRom(u.y, d.y, p.y, f.y, m, v, A),
  54435. o.initNonuniformCatmullRom(u.z, d.z, p.z, f.z, m, v, A)
  54436. } else if ("catmullrom" === this.type) {
  54437. var y = void 0 !== this.tension ? this.tension : .5;
  54438. i.initCatmullRom(u.x, d.x, p.x, f.x, y),
  54439. r.initCatmullRom(u.y, d.y, p.y, f.y, y),
  54440. o.initCatmullRom(u.z, d.z, p.z, f.z, y)
  54441. }
  54442. var C = new n.Vector3(i.calc(l),r.calc(l),o.calc(l));
  54443. return C
  54444. })
  54445. }(),
  54446. n.ClosedSplineCurve3 = function(e) {
  54447. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  54448. n.CatmullRomCurve3.call(this, e),
  54449. this.type = "catmullrom",
  54450. this.closed = !0
  54451. }
  54452. ,
  54453. n.ClosedSplineCurve3.prototype = Object.create(n.CatmullRomCurve3.prototype),
  54454. n.BoxGeometry = function(e, t, i, r, o, a) {
  54455. n.Geometry.call(this),
  54456. this.type = "BoxGeometry",
  54457. this.parameters = {
  54458. width: e,
  54459. height: t,
  54460. depth: i,
  54461. widthSegments: r,
  54462. heightSegments: o,
  54463. depthSegments: a
  54464. },
  54465. this.fromBufferGeometry(new n.BoxBufferGeometry(e,t,i,r,o,a)),
  54466. this.mergeVertices()
  54467. }
  54468. ,
  54469. n.BoxGeometry.prototype = Object.create(n.Geometry.prototype),
  54470. n.BoxGeometry.prototype.constructor = n.BoxGeometry,
  54471. n.CubeGeometry = n.BoxGeometry,
  54472. n.BoxBufferGeometry = function(e, t, i, r, o, a) {
  54473. function s(e, t, i) {
  54474. var n = 0;
  54475. return n += e * t * 2,
  54476. n += e * i * 2,
  54477. n += i * t * 2,
  54478. 4 * n
  54479. }
  54480. function l(e, t, i, r, o, a, s, l, h, u, I) {
  54481. for (var E = a / h, b = s / u, w = a / 2, _ = s / 2, T = l / 2, x = h + 1, S = u + 1, M = 0, R = 0, P = new n.Vector3, O = 0; O < S; O++)
  54482. for (var L = O * b - _, D = 0; D < x; D++) {
  54483. var N = D * E - w;
  54484. P[e] = N * r,
  54485. P[t] = L * o,
  54486. P[i] = T,
  54487. p[m] = P.x,
  54488. p[m + 1] = P.y,
  54489. p[m + 2] = P.z,
  54490. P[e] = 0,
  54491. P[t] = 0,
  54492. P[i] = l > 0 ? 1 : -1,
  54493. f[m] = P.x,
  54494. f[m + 1] = P.y,
  54495. f[m + 2] = P.z,
  54496. g[v] = D / h,
  54497. g[v + 1] = 1 - O / u,
  54498. m += 3,
  54499. v += 2,
  54500. M += 1
  54501. }
  54502. for (O = 0; O < u; O++)
  54503. for (D = 0; D < h; D++) {
  54504. var B = y + D + x * O
  54505. , F = y + D + x * (O + 1)
  54506. , V = y + (D + 1) + x * (O + 1)
  54507. , U = y + (D + 1) + x * O;
  54508. d[A] = B,
  54509. d[A + 1] = F,
  54510. d[A + 2] = U,
  54511. d[A + 3] = F,
  54512. d[A + 4] = V,
  54513. d[A + 5] = U,
  54514. A += 6,
  54515. R += 6
  54516. }
  54517. c.addGroup(C, R, I),
  54518. C += R,
  54519. y += M
  54520. }
  54521. n.BufferGeometry.call(this),
  54522. this.type = "BoxBufferGeometry",
  54523. this.parameters = {
  54524. width: e,
  54525. height: t,
  54526. depth: i,
  54527. widthSegments: r,
  54528. heightSegments: o,
  54529. depthSegments: a
  54530. };
  54531. var c = this;
  54532. r = Math.floor(r) || 1,
  54533. o = Math.floor(o) || 1,
  54534. a = Math.floor(a) || 1;
  54535. var h = s(r, o, a)
  54536. , u = h / 4 * 6
  54537. , d = new (u > 65535 ? Uint32Array : Uint16Array)(u)
  54538. , p = new Float32Array(3 * h)
  54539. , f = new Float32Array(3 * h)
  54540. , g = new Float32Array(2 * h)
  54541. , m = 0
  54542. , v = 0
  54543. , A = 0
  54544. , y = 0
  54545. , C = 0;
  54546. l("z", "y", "x", -1, -1, i, t, e, a, o, 0),
  54547. l("z", "y", "x", 1, -1, i, t, -e, a, o, 1),
  54548. l("x", "z", "y", 1, 1, e, i, t, r, a, 2),
  54549. l("x", "z", "y", 1, -1, e, i, -t, r, a, 3),
  54550. l("x", "y", "z", 1, -1, e, t, i, r, o, 4),
  54551. l("x", "y", "z", -1, -1, e, t, -i, r, o, 5),
  54552. this.setIndex(new n.BufferAttribute(d,1)),
  54553. this.addAttribute("position", new n.BufferAttribute(p,3)),
  54554. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  54555. this.addAttribute("uv", new n.BufferAttribute(g,2))
  54556. }
  54557. ,
  54558. n.BoxBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54559. n.BoxBufferGeometry.prototype.constructor = n.BoxBufferGeometry,
  54560. n.CircleGeometry = function(e, t, i, r) {
  54561. n.Geometry.call(this),
  54562. this.type = "CircleGeometry",
  54563. this.parameters = {
  54564. radius: e,
  54565. segments: t,
  54566. thetaStart: i,
  54567. thetaLength: r
  54568. },
  54569. this.fromBufferGeometry(new n.CircleBufferGeometry(e,t,i,r))
  54570. }
  54571. ,
  54572. n.CircleGeometry.prototype = Object.create(n.Geometry.prototype),
  54573. n.CircleGeometry.prototype.constructor = n.CircleGeometry,
  54574. n.CircleBufferGeometry = function(e, t, i, r) {
  54575. n.BufferGeometry.call(this),
  54576. this.type = "CircleBufferGeometry",
  54577. this.parameters = {
  54578. radius: e,
  54579. segments: t,
  54580. thetaStart: i,
  54581. thetaLength: r
  54582. },
  54583. e = e || 50,
  54584. t = void 0 !== t ? Math.max(3, t) : 8,
  54585. i = void 0 !== i ? i : 0,
  54586. r = void 0 !== r ? r : 2 * Math.PI;
  54587. var o = t + 2
  54588. , a = new Float32Array(3 * o)
  54589. , s = new Float32Array(3 * o)
  54590. , l = new Float32Array(2 * o);
  54591. s[2] = 1,
  54592. l[0] = .5,
  54593. l[1] = .5;
  54594. for (var c = 0, h = 3, u = 2; c <= t; c++,
  54595. h += 3,
  54596. u += 2) {
  54597. var d = i + c / t * r;
  54598. a[h] = e * Math.cos(d),
  54599. a[h + 1] = e * Math.sin(d),
  54600. s[h + 2] = 1,
  54601. l[u] = (a[h] / e + 1) / 2,
  54602. l[u + 1] = (a[h + 1] / e + 1) / 2
  54603. }
  54604. for (var p = [], h = 1; h <= t; h++)
  54605. p.push(h, h + 1, 0);
  54606. this.setIndex(new n.BufferAttribute(new Uint16Array(p),1)),
  54607. this.addAttribute("position", new n.BufferAttribute(a,3)),
  54608. this.addAttribute("normal", new n.BufferAttribute(s,3)),
  54609. this.addAttribute("uv", new n.BufferAttribute(l,2)),
  54610. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  54611. }
  54612. ,
  54613. n.CircleBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54614. n.CircleBufferGeometry.prototype.constructor = n.CircleBufferGeometry,
  54615. n.CylinderBufferGeometry = function(e, t, i, r, o, a, s, l) {
  54616. function c() {
  54617. var e = (r + 1) * (o + 1);
  54618. return a === !1 && (e += 2 * (r + 1) + 2 * r),
  54619. e
  54620. }
  54621. function h() {
  54622. var e = r * o * 2 * 3;
  54623. return a === !1 && (e += 2 * r * 3),
  54624. e
  54625. }
  54626. function u() {
  54627. var a, c, h = new n.Vector3, u = new n.Vector3, d = (t - e) / i;
  54628. for (c = 0; c <= o; c++) {
  54629. var p = []
  54630. , f = c / o
  54631. , b = f * (t - e) + e;
  54632. for (a = 0; a <= r; a++) {
  54633. var w = a / r;
  54634. u.x = b * Math.sin(w * l + s),
  54635. u.y = -f * i + E,
  54636. u.z = b * Math.cos(w * l + s),
  54637. m.setXYZ(y, u.x, u.y, u.z),
  54638. h.copy(u),
  54639. (0 === e && 0 === c || 0 === t && c === o) && (h.x = Math.sin(w * l + s),
  54640. h.z = Math.cos(w * l + s)),
  54641. h.setY(Math.sqrt(h.x * h.x + h.z * h.z) * d).normalize(),
  54642. v.setXYZ(y, h.x, h.y, h.z),
  54643. A.setXY(y, w, 1 - f),
  54644. p.push(y),
  54645. y++
  54646. }
  54647. I.push(p)
  54648. }
  54649. for (a = 0; a < r; a++)
  54650. for (c = 0; c < o; c++) {
  54651. var _ = I[c][a]
  54652. , T = I[c + 1][a]
  54653. , x = I[c + 1][a + 1]
  54654. , S = I[c][a + 1];
  54655. g.setX(C, _),
  54656. C++,
  54657. g.setX(C, T),
  54658. C++,
  54659. g.setX(C, S),
  54660. C++,
  54661. g.setX(C, T),
  54662. C++,
  54663. g.setX(C, x),
  54664. C++,
  54665. g.setX(C, S),
  54666. C++
  54667. }
  54668. }
  54669. function d(i) {
  54670. var o, a, c, h = new n.Vector2, u = new n.Vector3, d = i === !0 ? e : t, p = i === !0 ? 1 : -1;
  54671. for (a = y,
  54672. o = 1; o <= r; o++)
  54673. m.setXYZ(y, 0, E * p, 0),
  54674. v.setXYZ(y, 0, p, 0),
  54675. i === !0 ? (h.x = o / r,
  54676. h.y = 0) : (h.x = (o - 1) / r,
  54677. h.y = 1),
  54678. A.setXY(y, h.x, h.y),
  54679. y++;
  54680. for (c = y,
  54681. o = 0; o <= r; o++) {
  54682. var f = o / r;
  54683. u.x = d * Math.sin(f * l + s),
  54684. u.y = E * p,
  54685. u.z = d * Math.cos(f * l + s),
  54686. m.setXYZ(y, u.x, u.y, u.z),
  54687. v.setXYZ(y, 0, p, 0),
  54688. A.setXY(y, f, i === !0 ? 1 : 0),
  54689. y++
  54690. }
  54691. for (o = 0; o < r; o++) {
  54692. var I = a + o
  54693. , b = c + o;
  54694. i === !0 ? (g.setX(C, b),
  54695. C++,
  54696. g.setX(C, b + 1),
  54697. C++,
  54698. g.setX(C, I),
  54699. C++) : (g.setX(C, b + 1),
  54700. C++,
  54701. g.setX(C, b),
  54702. C++,
  54703. g.setX(C, I),
  54704. C++)
  54705. }
  54706. }
  54707. n.BufferGeometry.call(this),
  54708. this.type = "CylinderBufferGeometry",
  54709. this.parameters = {
  54710. radiusTop: e,
  54711. radiusBottom: t,
  54712. height: i,
  54713. radialSegments: r,
  54714. heightSegments: o,
  54715. openEnded: a,
  54716. thetaStart: s,
  54717. thetaLength: l
  54718. },
  54719. e = void 0 !== e ? e : 20,
  54720. t = void 0 !== t ? t : 20,
  54721. i = void 0 !== i ? i : 100,
  54722. r = Math.floor(r) || 8,
  54723. o = Math.floor(o) || 1,
  54724. a = void 0 !== a && a,
  54725. s = void 0 !== s ? s : 0,
  54726. l = void 0 !== l ? l : 2 * Math.PI;
  54727. var p = c()
  54728. , f = h()
  54729. , g = new n.BufferAttribute(new (f > 65535 ? Uint32Array : Uint16Array)(f),1)
  54730. , m = new n.BufferAttribute(new Float32Array(3 * p),3)
  54731. , v = new n.BufferAttribute(new Float32Array(3 * p),3)
  54732. , A = new n.BufferAttribute(new Float32Array(2 * p),2)
  54733. , y = 0
  54734. , C = 0
  54735. , I = []
  54736. , E = i / 2;
  54737. u(),
  54738. a === !1 && (e > 0 && d(!0),
  54739. t > 0 && d(!1)),
  54740. this.setIndex(g),
  54741. this.addAttribute("position", m),
  54742. this.addAttribute("normal", v),
  54743. this.addAttribute("uv", A)
  54744. }
  54745. ,
  54746. n.CylinderBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54747. n.CylinderBufferGeometry.prototype.constructor = n.CylinderBufferGeometry,
  54748. n.CylinderGeometry = function(e, t, i, r, o, a, s, l) {
  54749. n.Geometry.call(this),
  54750. this.type = "CylinderGeometry",
  54751. this.parameters = {
  54752. radiusTop: e,
  54753. radiusBottom: t,
  54754. height: i,
  54755. radialSegments: r,
  54756. heightSegments: o,
  54757. openEnded: a,
  54758. thetaStart: s,
  54759. thetaLength: l
  54760. },
  54761. this.fromBufferGeometry(new n.CylinderBufferGeometry(e,t,i,r,o,a,s,l)),
  54762. this.mergeVertices()
  54763. }
  54764. ,
  54765. n.CylinderGeometry.prototype = Object.create(n.Geometry.prototype),
  54766. n.CylinderGeometry.prototype.constructor = n.CylinderGeometry,
  54767. n.EdgesGeometry = function(e, t) {
  54768. function i(e, t) {
  54769. return e - t
  54770. }
  54771. n.BufferGeometry.call(this),
  54772. t = void 0 !== t ? t : 1;
  54773. var r, o = Math.cos(n.Math.degToRad(t)), a = [0, 0], s = {}, l = ["a", "b", "c"];
  54774. e instanceof n.BufferGeometry ? (r = new n.Geometry,
  54775. r.fromBufferGeometry(e)) : r = e.clone(),
  54776. r.mergeVertices(),
  54777. r.computeFaceNormals();
  54778. for (var c = r.vertices, h = r.faces, u = 0, d = h.length; u < d; u++)
  54779. for (var p = h[u], f = 0; f < 3; f++) {
  54780. a[0] = p[l[f]],
  54781. a[1] = p[l[(f + 1) % 3]],
  54782. a.sort(i);
  54783. var g = a.toString();
  54784. void 0 === s[g] ? s[g] = {
  54785. vert1: a[0],
  54786. vert2: a[1],
  54787. face1: u,
  54788. face2: void 0
  54789. } : s[g].face2 = u
  54790. }
  54791. var m = [];
  54792. for (var g in s) {
  54793. var v = s[g];
  54794. if (void 0 === v.face2 || h[v.face1].normal.dot(h[v.face2].normal) <= o) {
  54795. var A = c[v.vert1];
  54796. m.push(A.x),
  54797. m.push(A.y),
  54798. m.push(A.z),
  54799. A = c[v.vert2],
  54800. m.push(A.x),
  54801. m.push(A.y),
  54802. m.push(A.z)
  54803. }
  54804. }
  54805. this.addAttribute("position", new n.BufferAttribute(new Float32Array(m),3))
  54806. }
  54807. ,
  54808. n.EdgesGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54809. n.EdgesGeometry.prototype.constructor = n.EdgesGeometry,
  54810. n.ExtrudeGeometry = function(e, t) {
  54811. return "undefined" == typeof e ? void (e = []) : (n.Geometry.call(this),
  54812. this.type = "ExtrudeGeometry",
  54813. e = Array.isArray(e) ? e : [e],
  54814. this.addShapeList(e, t),
  54815. void this.computeFaceNormals())
  54816. }
  54817. ;
  54818. n.ExtrudeGeometry.prototype = Object.create(n.Geometry.prototype);
  54819. n.ExtrudeGeometry.prototype.constructor = n.ExtrudeGeometry,
  54820. n.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  54821. for (var i = e.length, n = 0; n < i; n++) {
  54822. var r = e[n];
  54823. this.addShape(r, t)
  54824. }
  54825. }
  54826. ,
  54827. n.ExtrudeGeometry.prototype.addShape = function(e, t) {
  54828. function i(e, t, i) {
  54829. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  54830. t.clone().multiplyScalar(i).add(e)
  54831. }
  54832. function r(e, t, i) {
  54833. var r, o, a = 1, s = e.x - t.x, l = e.y - t.y, c = i.x - e.x, h = i.y - e.y, u = s * s + l * l, d = s * h - l * c;
  54834. if (Math.abs(d) > Number.EPSILON) {
  54835. var p = Math.sqrt(u)
  54836. , f = Math.sqrt(c * c + h * h)
  54837. , g = t.x - l / p
  54838. , m = t.y + s / p
  54839. , v = i.x - h / f
  54840. , A = i.y + c / f
  54841. , y = ((v - g) * h - (A - m) * c) / (s * h - l * c);
  54842. r = g + s * y - e.x,
  54843. o = m + l * y - e.y;
  54844. var C = r * r + o * o;
  54845. if (C <= 2)
  54846. return new n.Vector2(r,o);
  54847. a = Math.sqrt(C / 2)
  54848. } else {
  54849. var I = !1;
  54850. s > Number.EPSILON ? c > Number.EPSILON && (I = !0) : s < -Number.EPSILON ? c < -Number.EPSILON && (I = !0) : Math.sign(l) === Math.sign(h) && (I = !0),
  54851. I ? (r = -l,
  54852. o = s,
  54853. a = Math.sqrt(u)) : (r = s,
  54854. o = l,
  54855. a = Math.sqrt(u / 2))
  54856. }
  54857. return new n.Vector2(r / a,o / a)
  54858. }
  54859. function o() {
  54860. if (C) {
  54861. var e = 0
  54862. , t = z * e;
  54863. for (Y = 0; Y < W; Y++)
  54864. G = N[Y],
  54865. c(G[2] + t, G[1] + t, G[0] + t);
  54866. for (e = E + 2 * y,
  54867. t = z * e,
  54868. Y = 0; Y < W; Y++)
  54869. G = N[Y],
  54870. c(G[0] + t, G[1] + t, G[2] + t)
  54871. } else {
  54872. for (Y = 0; Y < W; Y++)
  54873. G = N[Y],
  54874. c(G[2], G[1], G[0]);
  54875. for (Y = 0; Y < W; Y++)
  54876. G = N[Y],
  54877. c(G[0] + z * E, G[1] + z * E, G[2] + z * E)
  54878. }
  54879. }
  54880. function a() {
  54881. var e = 0;
  54882. for (s(B, e),
  54883. e += B.length,
  54884. x = 0,
  54885. S = L.length; x < S; x++)
  54886. T = L[x],
  54887. s(T, e),
  54888. e += T.length
  54889. }
  54890. function s(e, t) {
  54891. var i, n;
  54892. for (Y = e.length; --Y >= 0; ) {
  54893. i = Y,
  54894. n = Y - 1,
  54895. n < 0 && (n = e.length - 1);
  54896. var r = 0
  54897. , o = E + 2 * y;
  54898. for (r = 0; r < o; r++) {
  54899. var a = z * r
  54900. , s = z * (r + 1)
  54901. , l = t + i + a
  54902. , c = t + n + a
  54903. , u = t + n + s
  54904. , d = t + i + s;
  54905. h(l, c, u, d, e, r, o, i, n)
  54906. }
  54907. }
  54908. }
  54909. function l(e, t, i) {
  54910. M.vertices.push(new n.Vector3(e,t,i))
  54911. }
  54912. function c(e, t, i) {
  54913. e += R,
  54914. t += R,
  54915. i += R,
  54916. M.faces.push(new n.Face3(e,t,i,null,null,0));
  54917. var r = _.generateTopUV(M, e, t, i);
  54918. M.faceVertexUvs[0].push(r)
  54919. }
  54920. function h(e, t, i, r, o, a, s, l, c) {
  54921. e += R,
  54922. t += R,
  54923. i += R,
  54924. r += R,
  54925. M.faces.push(new n.Face3(e,t,r,null,null,1)),
  54926. M.faces.push(new n.Face3(t,i,r,null,null,1));
  54927. var h = _.generateSideWallUV(M, e, t, i, r);
  54928. M.faceVertexUvs[0].push([h[0], h[1], h[3]]),
  54929. M.faceVertexUvs[0].push([h[1], h[2], h[3]])
  54930. }
  54931. var u, d, p, f, g, m = void 0 !== t.amount ? t.amount : 100, v = void 0 !== t.bevelThickness ? t.bevelThickness : 6, A = void 0 !== t.bevelSize ? t.bevelSize : v - 2, y = void 0 !== t.bevelSegments ? t.bevelSegments : 3, C = void 0 === t.bevelEnabled || t.bevelEnabled, I = void 0 !== t.curveSegments ? t.curveSegments : 12, E = void 0 !== t.steps ? t.steps : 1, b = t.extrudePath, w = !1, _ = void 0 !== t.UVGenerator ? t.UVGenerator : n.ExtrudeGeometry.WorldUVGenerator;
  54932. b && (u = b.getSpacedPoints(E),
  54933. w = !0,
  54934. C = !1,
  54935. d = void 0 !== t.frames ? t.frames : new n.TubeGeometry.FrenetFrames(b,E,!1),
  54936. p = new n.Vector3,
  54937. f = new n.Vector3,
  54938. g = new n.Vector3),
  54939. C || (y = 0,
  54940. v = 0,
  54941. A = 0);
  54942. var T, x, S, M = this, R = this.vertices.length, P = e.extractPoints(I), O = P.shape, L = P.holes, D = !n.ShapeUtils.isClockWise(O);
  54943. if (D) {
  54944. for (O = O.reverse(),
  54945. x = 0,
  54946. S = L.length; x < S; x++)
  54947. T = L[x],
  54948. n.ShapeUtils.isClockWise(T) && (L[x] = T.reverse());
  54949. D = !1
  54950. }
  54951. var N = n.ShapeUtils.triangulateShape(O, L)
  54952. , B = O;
  54953. for (x = 0,
  54954. S = L.length; x < S; x++)
  54955. T = L[x],
  54956. O = O.concat(T);
  54957. for (var F, V, U, k, H, G, z = O.length, W = N.length, j = [], Y = 0, X = B.length, Z = X - 1, q = Y + 1; Y < X; Y++,
  54958. Z++,
  54959. q++)
  54960. Z === X && (Z = 0),
  54961. q === X && (q = 0),
  54962. j[Y] = r(B[Y], B[Z], B[q]);
  54963. var K, Q = [], J = j.concat();
  54964. for (x = 0,
  54965. S = L.length; x < S; x++) {
  54966. for (T = L[x],
  54967. K = [],
  54968. Y = 0,
  54969. X = T.length,
  54970. Z = X - 1,
  54971. q = Y + 1; Y < X; Y++,
  54972. Z++,
  54973. q++)
  54974. Z === X && (Z = 0),
  54975. q === X && (q = 0),
  54976. K[Y] = r(T[Y], T[Z], T[q]);
  54977. Q.push(K),
  54978. J = J.concat(K)
  54979. }
  54980. for (F = 0; F < y; F++) {
  54981. for (U = F / y,
  54982. k = v * (1 - U),
  54983. V = A * Math.sin(U * Math.PI / 2),
  54984. Y = 0,
  54985. X = B.length; Y < X; Y++)
  54986. H = i(B[Y], j[Y], V),
  54987. l(H.x, H.y, -k);
  54988. for (x = 0,
  54989. S = L.length; x < S; x++)
  54990. for (T = L[x],
  54991. K = Q[x],
  54992. Y = 0,
  54993. X = T.length; Y < X; Y++)
  54994. H = i(T[Y], K[Y], V),
  54995. l(H.x, H.y, -k)
  54996. }
  54997. for (V = A,
  54998. Y = 0; Y < z; Y++)
  54999. H = C ? i(O[Y], J[Y], V) : O[Y],
  55000. w ? (f.copy(d.normals[0]).multiplyScalar(H.x),
  55001. p.copy(d.binormals[0]).multiplyScalar(H.y),
  55002. g.copy(u[0]).add(f).add(p),
  55003. l(g.x, g.y, g.z)) : l(H.x, H.y, 0);
  55004. var $;
  55005. for ($ = 1; $ <= E; $++)
  55006. for (Y = 0; Y < z; Y++)
  55007. H = C ? i(O[Y], J[Y], V) : O[Y],
  55008. w ? (f.copy(d.normals[$]).multiplyScalar(H.x),
  55009. p.copy(d.binormals[$]).multiplyScalar(H.y),
  55010. g.copy(u[$]).add(f).add(p),
  55011. l(g.x, g.y, g.z)) : l(H.x, H.y, m / E * $);
  55012. for (F = y - 1; F >= 0; F--) {
  55013. for (U = F / y,
  55014. k = v * (1 - U),
  55015. V = A * Math.sin(U * Math.PI / 2),
  55016. Y = 0,
  55017. X = B.length; Y < X; Y++)
  55018. H = i(B[Y], j[Y], V),
  55019. l(H.x, H.y, m + k);
  55020. for (x = 0,
  55021. S = L.length; x < S; x++)
  55022. for (T = L[x],
  55023. K = Q[x],
  55024. Y = 0,
  55025. X = T.length; Y < X; Y++)
  55026. H = i(T[Y], K[Y], V),
  55027. w ? l(H.x, H.y + u[E - 1].y, u[E - 1].x + k) : l(H.x, H.y, m + k)
  55028. }
  55029. o(),
  55030. a()
  55031. }
  55032. ,
  55033. n.ExtrudeGeometry.WorldUVGenerator = {
  55034. generateTopUV: function(e, t, i, r) {
  55035. var o = e.vertices
  55036. , a = o[t]
  55037. , s = o[i]
  55038. , l = o[r];
  55039. return [new n.Vector2(a.x,a.y), new n.Vector2(s.x,s.y), new n.Vector2(l.x,l.y)]
  55040. },
  55041. generateSideWallUV: function(e, t, i, r, o) {
  55042. var a = e.vertices
  55043. , s = a[t]
  55044. , l = a[i]
  55045. , c = a[r]
  55046. , h = a[o];
  55047. return Math.abs(s.y - l.y) < .01 ? [new n.Vector2(s.x,1 - s.z), new n.Vector2(l.x,1 - l.z), new n.Vector2(c.x,1 - c.z), new n.Vector2(h.x,1 - h.z)] : [new n.Vector2(s.y,1 - s.z), new n.Vector2(l.y,1 - l.z), new n.Vector2(c.y,1 - c.z), new n.Vector2(h.y,1 - h.z)]
  55048. }
  55049. },
  55050. n.ShapeGeometry = function(e, t) {
  55051. n.Geometry.call(this),
  55052. this.type = "ShapeGeometry",
  55053. Array.isArray(e) === !1 && (e = [e]),
  55054. this.addShapeList(e, t),
  55055. this.computeFaceNormals()
  55056. }
  55057. ,
  55058. n.ShapeGeometry.prototype = Object.create(n.Geometry.prototype),
  55059. n.ShapeGeometry.prototype.constructor = n.ShapeGeometry,
  55060. n.ShapeGeometry.prototype.addShapeList = function(e, t) {
  55061. for (var i = 0, n = e.length; i < n; i++)
  55062. this.addShape(e[i], t);
  55063. return this
  55064. }
  55065. ,
  55066. n.ShapeGeometry.prototype.addShape = function(e, t) {
  55067. void 0 === t && (t = {});
  55068. var i, r, o, a = void 0 !== t.curveSegments ? t.curveSegments : 12, s = t.material, l = void 0 === t.UVGenerator ? n.ExtrudeGeometry.WorldUVGenerator : t.UVGenerator, c = this.vertices.length, h = e.extractPoints(a), u = h.shape, d = h.holes, p = !n.ShapeUtils.isClockWise(u);
  55069. if (p) {
  55070. for (u = u.reverse(),
  55071. i = 0,
  55072. r = d.length; i < r; i++)
  55073. o = d[i],
  55074. n.ShapeUtils.isClockWise(o) && (d[i] = o.reverse());
  55075. p = !1
  55076. }
  55077. var f = n.ShapeUtils.triangulateShape(u, d);
  55078. for (i = 0,
  55079. r = d.length; i < r; i++)
  55080. o = d[i],
  55081. u = u.concat(o);
  55082. var g, m, v = u.length, A = f.length;
  55083. for (i = 0; i < v; i++)
  55084. g = u[i],
  55085. this.vertices.push(new n.Vector3(g.x,g.y,0));
  55086. for (i = 0; i < A; i++) {
  55087. m = f[i];
  55088. var y = m[0] + c
  55089. , C = m[1] + c
  55090. , I = m[2] + c;
  55091. this.faces.push(new n.Face3(y,C,I,null,null,s)),
  55092. this.faceVertexUvs[0].push(l.generateTopUV(this, y, C, I))
  55093. }
  55094. }
  55095. ,
  55096. n.LatheBufferGeometry = function(e, t, i, r) {
  55097. n.BufferGeometry.call(this),
  55098. this.type = "LatheBufferGeometry",
  55099. this.parameters = {
  55100. points: e,
  55101. segments: t,
  55102. phiStart: i,
  55103. phiLength: r
  55104. },
  55105. t = Math.floor(t) || 12,
  55106. i = i || 0,
  55107. r = r || 2 * Math.PI,
  55108. r = n.Math.clamp(r, 0, 2 * Math.PI);
  55109. var o, a, s, l = (t + 1) * e.length, c = t * e.length * 2 * 3, h = new n.BufferAttribute(new (c > 65535 ? Uint32Array : Uint16Array)(c),1), u = new n.BufferAttribute(new Float32Array(3 * l),3), d = new n.BufferAttribute(new Float32Array(2 * l),2), p = 0, f = 0, g = (1 / (e.length - 1),
  55110. 1 / t), m = new n.Vector3, v = new n.Vector2;
  55111. for (a = 0; a <= t; a++) {
  55112. var A = i + a * g * r
  55113. , y = Math.sin(A)
  55114. , C = Math.cos(A);
  55115. for (s = 0; s <= e.length - 1; s++)
  55116. m.x = e[s].x * y,
  55117. m.y = e[s].y,
  55118. m.z = e[s].x * C,
  55119. u.setXYZ(p, m.x, m.y, m.z),
  55120. v.x = a / t,
  55121. v.y = s / (e.length - 1),
  55122. d.setXY(p, v.x, v.y),
  55123. p++
  55124. }
  55125. for (a = 0; a < t; a++)
  55126. for (s = 0; s < e.length - 1; s++) {
  55127. o = s + a * e.length;
  55128. var I = o
  55129. , E = o + e.length
  55130. , b = o + e.length + 1
  55131. , w = o + 1;
  55132. h.setX(f, I),
  55133. f++,
  55134. h.setX(f, E),
  55135. f++,
  55136. h.setX(f, w),
  55137. f++,
  55138. h.setX(f, E),
  55139. f++,
  55140. h.setX(f, b),
  55141. f++,
  55142. h.setX(f, w),
  55143. f++
  55144. }
  55145. if (this.setIndex(h),
  55146. this.addAttribute("position", u),
  55147. this.addAttribute("uv", d),
  55148. this.computeVertexNormals(),
  55149. r === 2 * Math.PI) {
  55150. var _ = this.attributes.normal.array
  55151. , T = new n.Vector3
  55152. , x = new n.Vector3
  55153. , S = new n.Vector3;
  55154. for (o = t * e.length * 3,
  55155. a = 0,
  55156. s = 0; a < e.length; a++,
  55157. s += 3)
  55158. T.x = _[s + 0],
  55159. T.y = _[s + 1],
  55160. T.z = _[s + 2],
  55161. x.x = _[o + s + 0],
  55162. x.y = _[o + s + 1],
  55163. x.z = _[o + s + 2],
  55164. S.addVectors(T, x).normalize(),
  55165. _[s + 0] = _[o + s + 0] = S.x,
  55166. _[s + 1] = _[o + s + 1] = S.y,
  55167. _[s + 2] = _[o + s + 2] = S.z
  55168. }
  55169. }
  55170. ,
  55171. n.LatheBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55172. n.LatheBufferGeometry.prototype.constructor = n.LatheBufferGeometry,
  55173. n.LatheGeometry = function(e, t, i, r) {
  55174. n.Geometry.call(this),
  55175. this.type = "LatheGeometry",
  55176. this.parameters = {
  55177. points: e,
  55178. segments: t,
  55179. phiStart: i,
  55180. phiLength: r
  55181. },
  55182. this.fromBufferGeometry(new n.LatheBufferGeometry(e,t,i,r)),
  55183. this.mergeVertices()
  55184. }
  55185. ,
  55186. n.LatheGeometry.prototype = Object.create(n.Geometry.prototype),
  55187. n.LatheGeometry.prototype.constructor = n.LatheGeometry,
  55188. n.PlaneGeometry = function(e, t, i, r) {
  55189. n.Geometry.call(this),
  55190. this.type = "PlaneGeometry",
  55191. this.parameters = {
  55192. width: e,
  55193. height: t,
  55194. widthSegments: i,
  55195. heightSegments: r
  55196. },
  55197. this.fromBufferGeometry(new n.PlaneBufferGeometry(e,t,i,r))
  55198. }
  55199. ,
  55200. n.PlaneGeometry.prototype = Object.create(n.Geometry.prototype),
  55201. n.PlaneGeometry.prototype.constructor = n.PlaneGeometry,
  55202. n.PlaneBufferGeometry = function(e, t, i, r) {
  55203. n.BufferGeometry.call(this),
  55204. this.type = "PlaneBufferGeometry",
  55205. this.parameters = {
  55206. width: e,
  55207. height: t,
  55208. widthSegments: i,
  55209. heightSegments: r
  55210. };
  55211. for (var o = e / 2, a = t / 2, s = Math.floor(i) || 1, l = Math.floor(r) || 1, c = s + 1, h = l + 1, u = e / s, d = t / l, p = new Float32Array(c * h * 3), f = new Float32Array(c * h * 3), g = new Float32Array(c * h * 2), m = 0, v = 0, A = 0; A < h; A++)
  55212. for (var y = A * d - a, C = 0; C < c; C++) {
  55213. var I = C * u - o;
  55214. p[m] = I,
  55215. p[m + 1] = -y,
  55216. f[m + 2] = 1,
  55217. g[v] = C / s,
  55218. g[v + 1] = 1 - A / l,
  55219. m += 3,
  55220. v += 2
  55221. }
  55222. m = 0;
  55223. for (var E = new (p.length / 3 > 65535 ? Uint32Array : Uint16Array)(s * l * 6), A = 0; A < l; A++)
  55224. for (var C = 0; C < s; C++) {
  55225. var b = C + c * A
  55226. , w = C + c * (A + 1)
  55227. , _ = C + 1 + c * (A + 1)
  55228. , T = C + 1 + c * A;
  55229. E[m] = b,
  55230. E[m + 1] = w,
  55231. E[m + 2] = T,
  55232. E[m + 3] = w,
  55233. E[m + 4] = _,
  55234. E[m + 5] = T,
  55235. m += 6
  55236. }
  55237. this.setIndex(new n.BufferAttribute(E,1)),
  55238. this.addAttribute("position", new n.BufferAttribute(p,3)),
  55239. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  55240. this.addAttribute("uv", new n.BufferAttribute(g,2))
  55241. }
  55242. ,
  55243. n.PlaneBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55244. n.PlaneBufferGeometry.prototype.constructor = n.PlaneBufferGeometry,
  55245. n.RingBufferGeometry = function(e, t, i, r, o, a) {
  55246. n.BufferGeometry.call(this),
  55247. this.type = "RingBufferGeometry",
  55248. this.parameters = {
  55249. innerRadius: e,
  55250. outerRadius: t,
  55251. thetaSegments: i,
  55252. phiSegments: r,
  55253. thetaStart: o,
  55254. thetaLength: a
  55255. },
  55256. e = e || 20,
  55257. t = t || 50,
  55258. o = void 0 !== o ? o : 0,
  55259. a = void 0 !== a ? a : 2 * Math.PI,
  55260. i = void 0 !== i ? Math.max(3, i) : 8,
  55261. r = void 0 !== r ? Math.max(1, r) : 1;
  55262. var s, l, c, h = (i + 1) * (r + 1), u = i * r * 2 * 3, d = new n.BufferAttribute(new (u > 65535 ? Uint32Array : Uint16Array)(u),1), p = new n.BufferAttribute(new Float32Array(3 * h),3), f = new n.BufferAttribute(new Float32Array(3 * h),3), g = new n.BufferAttribute(new Float32Array(2 * h),2), m = 0, v = 0, A = e, y = (t - e) / r, C = new n.Vector3, I = new n.Vector2;
  55263. for (l = 0; l <= r; l++) {
  55264. for (c = 0; c <= i; c++)
  55265. s = o + c / i * a,
  55266. C.x = A * Math.cos(s),
  55267. C.y = A * Math.sin(s),
  55268. p.setXYZ(m, C.x, C.y, C.z),
  55269. f.setXYZ(m, 0, 0, 1),
  55270. I.x = (C.x / t + 1) / 2,
  55271. I.y = (C.y / t + 1) / 2,
  55272. g.setXY(m, I.x, I.y),
  55273. m++;
  55274. A += y
  55275. }
  55276. for (l = 0; l < r; l++) {
  55277. var E = l * (i + 1);
  55278. for (c = 0; c < i; c++) {
  55279. s = c + E;
  55280. var b = s
  55281. , w = s + i + 1
  55282. , _ = s + i + 2
  55283. , T = s + 1;
  55284. d.setX(v, b),
  55285. v++,
  55286. d.setX(v, w),
  55287. v++,
  55288. d.setX(v, _),
  55289. v++,
  55290. d.setX(v, b),
  55291. v++,
  55292. d.setX(v, _),
  55293. v++,
  55294. d.setX(v, T),
  55295. v++
  55296. }
  55297. }
  55298. this.setIndex(d),
  55299. this.addAttribute("position", p),
  55300. this.addAttribute("normal", f),
  55301. this.addAttribute("uv", g)
  55302. }
  55303. ,
  55304. n.RingBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55305. n.RingBufferGeometry.prototype.constructor = n.RingBufferGeometry,
  55306. n.RingGeometry = function(e, t, i, r, o, a) {
  55307. n.Geometry.call(this),
  55308. this.type = "RingGeometry",
  55309. this.parameters = {
  55310. innerRadius: e,
  55311. outerRadius: t,
  55312. thetaSegments: i,
  55313. phiSegments: r,
  55314. thetaStart: o,
  55315. thetaLength: a
  55316. },
  55317. this.fromBufferGeometry(new n.RingBufferGeometry(e,t,i,r,o,a))
  55318. }
  55319. ,
  55320. n.RingGeometry.prototype = Object.create(n.Geometry.prototype),
  55321. n.RingGeometry.prototype.constructor = n.RingGeometry,
  55322. n.SphereGeometry = function(e, t, i, r, o, a, s) {
  55323. n.Geometry.call(this),
  55324. this.type = "SphereGeometry",
  55325. this.parameters = {
  55326. radius: e,
  55327. widthSegments: t,
  55328. heightSegments: i,
  55329. phiStart: r,
  55330. phiLength: o,
  55331. thetaStart: a,
  55332. thetaLength: s
  55333. },
  55334. this.fromBufferGeometry(new n.SphereBufferGeometry(e,t,i,r,o,a,s))
  55335. }
  55336. ,
  55337. n.SphereGeometry.prototype = Object.create(n.Geometry.prototype),
  55338. n.SphereGeometry.prototype.constructor = n.SphereGeometry,
  55339. n.SphereBufferGeometry = function(e, t, i, r, o, a, s) {
  55340. n.BufferGeometry.call(this),
  55341. this.type = "SphereBufferGeometry",
  55342. this.parameters = {
  55343. radius: e,
  55344. widthSegments: t,
  55345. heightSegments: i,
  55346. phiStart: r,
  55347. phiLength: o,
  55348. thetaStart: a,
  55349. thetaLength: s
  55350. },
  55351. e = e || 50,
  55352. t = Math.max(3, Math.floor(t) || 8),
  55353. i = Math.max(2, Math.floor(i) || 6),
  55354. r = void 0 !== r ? r : 0,
  55355. o = void 0 !== o ? o : 2 * Math.PI,
  55356. a = void 0 !== a ? a : 0,
  55357. s = void 0 !== s ? s : Math.PI;
  55358. for (var l = a + s, c = (t + 1) * (i + 1), h = new n.BufferAttribute(new Float32Array(3 * c),3), u = new n.BufferAttribute(new Float32Array(3 * c),3), d = new n.BufferAttribute(new Float32Array(2 * c),2), p = 0, f = [], g = new n.Vector3, m = 0; m <= i; m++) {
  55359. for (var v = [], A = m / i, y = 0; y <= t; y++) {
  55360. var C = y / t
  55361. , I = -e * Math.cos(r + C * o) * Math.sin(a + A * s)
  55362. , E = e * Math.cos(a + A * s)
  55363. , b = e * Math.sin(r + C * o) * Math.sin(a + A * s);
  55364. g.set(I, E, b).normalize(),
  55365. h.setXYZ(p, I, E, b),
  55366. u.setXYZ(p, g.x, g.y, g.z),
  55367. d.setXY(p, C, 1 - A),
  55368. v.push(p),
  55369. p++
  55370. }
  55371. f.push(v)
  55372. }
  55373. for (var w = [], m = 0; m < i; m++)
  55374. for (var y = 0; y < t; y++) {
  55375. var _ = f[m][y + 1]
  55376. , T = f[m][y]
  55377. , x = f[m + 1][y]
  55378. , S = f[m + 1][y + 1];
  55379. (0 !== m || a > 0) && w.push(_, T, S),
  55380. (m !== i - 1 || l < Math.PI) && w.push(T, x, S)
  55381. }
  55382. this.setIndex(new (h.count > 65535 ? n.Uint32Attribute : n.Uint16Attribute)(w,1)),
  55383. this.addAttribute("position", h),
  55384. this.addAttribute("normal", u),
  55385. this.addAttribute("uv", d),
  55386. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  55387. }
  55388. ,
  55389. n.SphereBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55390. n.SphereBufferGeometry.prototype.constructor = n.SphereBufferGeometry,
  55391. n.TextGeometry = function(e, t) {
  55392. t = t || {};
  55393. var i = t.font;
  55394. if (i instanceof n.Font == !1)
  55395. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  55396. new n.Geometry;
  55397. var r = i.generateShapes(e, t.size, t.curveSegments);
  55398. t.amount = void 0 !== t.height ? t.height : 50,
  55399. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  55400. void 0 === t.bevelSize && (t.bevelSize = 8),
  55401. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  55402. n.ExtrudeGeometry.call(this, r, t),
  55403. this.type = "TextGeometry"
  55404. }
  55405. ,
  55406. n.TextGeometry.prototype = Object.create(n.ExtrudeGeometry.prototype),
  55407. n.TextGeometry.prototype.constructor = n.TextGeometry,
  55408. n.TorusBufferGeometry = function(e, t, i, r, o) {
  55409. n.BufferGeometry.call(this),
  55410. this.type = "TorusBufferGeometry",
  55411. this.parameters = {
  55412. radius: e,
  55413. tube: t,
  55414. radialSegments: i,
  55415. tubularSegments: r,
  55416. arc: o
  55417. },
  55418. e = e || 100,
  55419. t = t || 40,
  55420. i = Math.floor(i) || 8,
  55421. r = Math.floor(r) || 6,
  55422. o = o || 2 * Math.PI;
  55423. var a, s, l = (i + 1) * (r + 1), c = i * r * 2 * 3, h = new (c > 65535 ? Uint32Array : Uint16Array)(c), u = new Float32Array(3 * l), d = new Float32Array(3 * l), p = new Float32Array(2 * l), f = 0, g = 0, m = 0, v = new n.Vector3, A = new n.Vector3, y = new n.Vector3;
  55424. for (a = 0; a <= i; a++)
  55425. for (s = 0; s <= r; s++) {
  55426. var C = s / r * o
  55427. , I = a / i * Math.PI * 2;
  55428. A.x = (e + t * Math.cos(I)) * Math.cos(C),
  55429. A.y = (e + t * Math.cos(I)) * Math.sin(C),
  55430. A.z = t * Math.sin(I),
  55431. u[f] = A.x,
  55432. u[f + 1] = A.y,
  55433. u[f + 2] = A.z,
  55434. v.x = e * Math.cos(C),
  55435. v.y = e * Math.sin(C),
  55436. y.subVectors(A, v).normalize(),
  55437. d[f] = y.x,
  55438. d[f + 1] = y.y,
  55439. d[f + 2] = y.z,
  55440. p[g] = s / r,
  55441. p[g + 1] = a / i,
  55442. f += 3,
  55443. g += 2
  55444. }
  55445. for (a = 1; a <= i; a++)
  55446. for (s = 1; s <= r; s++) {
  55447. var E = (r + 1) * a + s - 1
  55448. , b = (r + 1) * (a - 1) + s - 1
  55449. , w = (r + 1) * (a - 1) + s
  55450. , _ = (r + 1) * a + s;
  55451. h[m] = E,
  55452. h[m + 1] = b,
  55453. h[m + 2] = _,
  55454. h[m + 3] = b,
  55455. h[m + 4] = w,
  55456. h[m + 5] = _,
  55457. m += 6
  55458. }
  55459. this.setIndex(new n.BufferAttribute(h,1)),
  55460. this.addAttribute("position", new n.BufferAttribute(u,3)),
  55461. this.addAttribute("normal", new n.BufferAttribute(d,3)),
  55462. this.addAttribute("uv", new n.BufferAttribute(p,2))
  55463. }
  55464. ,
  55465. n.TorusBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55466. n.TorusBufferGeometry.prototype.constructor = n.TorusBufferGeometry,
  55467. n.TorusGeometry = function(e, t, i, r, o) {
  55468. n.Geometry.call(this),
  55469. this.type = "TorusGeometry",
  55470. this.parameters = {
  55471. radius: e,
  55472. tube: t,
  55473. radialSegments: i,
  55474. tubularSegments: r,
  55475. arc: o
  55476. },
  55477. this.fromBufferGeometry(new n.TorusBufferGeometry(e,t,i,r,o))
  55478. }
  55479. ,
  55480. n.TorusGeometry.prototype = Object.create(n.Geometry.prototype),
  55481. n.TorusGeometry.prototype.constructor = n.TorusGeometry,
  55482. n.TorusKnotBufferGeometry = function(e, t, i, r, o, a) {
  55483. function s(e, t, i, n, r) {
  55484. var o = Math.cos(e)
  55485. , a = Math.sin(e)
  55486. , s = i / t * e
  55487. , l = Math.cos(s);
  55488. r.x = n * (2 + l) * .5 * o,
  55489. r.y = n * (2 + l) * a * .5,
  55490. r.z = n * Math.sin(s) * .5
  55491. }
  55492. n.BufferGeometry.call(this),
  55493. this.type = "TorusKnotBufferGeometry",
  55494. this.parameters = {
  55495. radius: e,
  55496. tube: t,
  55497. tubularSegments: i,
  55498. radialSegments: r,
  55499. p: o,
  55500. q: a
  55501. },
  55502. e = e || 100,
  55503. t = t || 40,
  55504. i = Math.floor(i) || 64,
  55505. r = Math.floor(r) || 8,
  55506. o = o || 2,
  55507. a = a || 3;
  55508. var l, c, h = (r + 1) * (i + 1), u = r * i * 2 * 3, d = new n.BufferAttribute(new (u > 65535 ? Uint32Array : Uint16Array)(u),1), p = new n.BufferAttribute(new Float32Array(3 * h),3), f = new n.BufferAttribute(new Float32Array(3 * h),3), g = new n.BufferAttribute(new Float32Array(2 * h),2), m = 0, v = 0, A = new n.Vector3, y = new n.Vector3, C = new n.Vector2, I = new n.Vector3, E = new n.Vector3, b = new n.Vector3, w = new n.Vector3, _ = new n.Vector3;
  55509. for (l = 0; l <= i; ++l) {
  55510. var T = l / i * o * Math.PI * 2;
  55511. for (s(T, o, a, e, I),
  55512. s(T + .01, o, a, e, E),
  55513. w.subVectors(E, I),
  55514. _.addVectors(E, I),
  55515. b.crossVectors(w, _),
  55516. _.crossVectors(b, w),
  55517. b.normalize(),
  55518. _.normalize(),
  55519. c = 0; c <= r; ++c) {
  55520. var x = c / r * Math.PI * 2
  55521. , S = -t * Math.cos(x)
  55522. , M = t * Math.sin(x);
  55523. A.x = I.x + (S * _.x + M * b.x),
  55524. A.y = I.y + (S * _.y + M * b.y),
  55525. A.z = I.z + (S * _.z + M * b.z),
  55526. p.setXYZ(m, A.x, A.y, A.z),
  55527. y.subVectors(A, I).normalize(),
  55528. f.setXYZ(m, y.x, y.y, y.z),
  55529. C.x = l / i,
  55530. C.y = c / r,
  55531. g.setXY(m, C.x, C.y),
  55532. m++
  55533. }
  55534. }
  55535. for (c = 1; c <= i; c++)
  55536. for (l = 1; l <= r; l++) {
  55537. var R = (r + 1) * (c - 1) + (l - 1)
  55538. , P = (r + 1) * c + (l - 1)
  55539. , O = (r + 1) * c + l
  55540. , L = (r + 1) * (c - 1) + l;
  55541. d.setX(v, R),
  55542. v++,
  55543. d.setX(v, P),
  55544. v++,
  55545. d.setX(v, L),
  55546. v++,
  55547. d.setX(v, P),
  55548. v++,
  55549. d.setX(v, O),
  55550. v++,
  55551. d.setX(v, L),
  55552. v++
  55553. }
  55554. this.setIndex(d),
  55555. this.addAttribute("position", p),
  55556. this.addAttribute("normal", f),
  55557. this.addAttribute("uv", g)
  55558. }
  55559. ,
  55560. n.TorusKnotBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55561. n.TorusKnotBufferGeometry.prototype.constructor = n.TorusKnotBufferGeometry,
  55562. n.TorusKnotGeometry = function(e, t, i, r, o, a, s) {
  55563. n.Geometry.call(this),
  55564. this.type = "TorusKnotGeometry",
  55565. this.parameters = {
  55566. radius: e,
  55567. tube: t,
  55568. tubularSegments: i,
  55569. radialSegments: r,
  55570. p: o,
  55571. q: a
  55572. },
  55573. void 0 !== s && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  55574. this.fromBufferGeometry(new n.TorusKnotBufferGeometry(e,t,i,r,o,a)),
  55575. this.mergeVertices()
  55576. }
  55577. ,
  55578. n.TorusKnotGeometry.prototype = Object.create(n.Geometry.prototype),
  55579. n.TorusKnotGeometry.prototype.constructor = n.TorusKnotGeometry,
  55580. n.TubeGeometry = function(e, t, i, r, o, a) {
  55581. function s(e, t, i) {
  55582. return R.vertices.push(new n.Vector3(e,t,i)) - 1
  55583. }
  55584. n.Geometry.call(this),
  55585. this.type = "TubeGeometry",
  55586. this.parameters = {
  55587. path: e,
  55588. segments: t,
  55589. radius: i,
  55590. radialSegments: r,
  55591. closed: o,
  55592. taper: a
  55593. },
  55594. t = t || 64,
  55595. i = i || 1,
  55596. r = r || 8,
  55597. o = o || !1,
  55598. a = a || n.TubeGeometry.NoTaper;
  55599. var l, c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w, _, T, x, S, M = [], R = this, P = t + 1, O = new n.Vector3, L = new n.TubeGeometry.FrenetFrames(e,t,o), D = L.tangents, N = L.normals, B = L.binormals;
  55600. for (this.tangents = D,
  55601. this.normals = N,
  55602. this.binormals = B,
  55603. v = 0; v < P; v++)
  55604. for (M[v] = [],
  55605. u = v / (P - 1),
  55606. m = e.getPointAt(u),
  55607. l = D[v],
  55608. c = N[v],
  55609. h = B[v],
  55610. p = i * a(u),
  55611. A = 0; A < r; A++)
  55612. d = A / r * 2 * Math.PI,
  55613. f = -p * Math.cos(d),
  55614. g = p * Math.sin(d),
  55615. O.copy(m),
  55616. O.x += f * c.x + g * h.x,
  55617. O.y += f * c.y + g * h.y,
  55618. O.z += f * c.z + g * h.z,
  55619. M[v][A] = s(O.x, O.y, O.z);
  55620. for (v = 0; v < t; v++)
  55621. for (A = 0; A < r; A++)
  55622. y = o ? (v + 1) % t : v + 1,
  55623. C = (A + 1) % r,
  55624. I = M[v][A],
  55625. E = M[y][A],
  55626. b = M[y][C],
  55627. w = M[v][C],
  55628. _ = new n.Vector2(v / t,A / r),
  55629. T = new n.Vector2((v + 1) / t,A / r),
  55630. x = new n.Vector2((v + 1) / t,(A + 1) / r),
  55631. S = new n.Vector2(v / t,(A + 1) / r),
  55632. this.faces.push(new n.Face3(I,E,w)),
  55633. this.faceVertexUvs[0].push([_, T, S]),
  55634. this.faces.push(new n.Face3(E,b,w)),
  55635. this.faceVertexUvs[0].push([T.clone(), x, S.clone()]);
  55636. this.computeFaceNormals(),
  55637. this.computeVertexNormals()
  55638. }
  55639. ,
  55640. n.TubeGeometry.prototype = Object.create(n.Geometry.prototype),
  55641. n.TubeGeometry.prototype.constructor = n.TubeGeometry,
  55642. n.TubeGeometry.NoTaper = function(e) {
  55643. return 1
  55644. }
  55645. ,
  55646. n.TubeGeometry.SinusoidalTaper = function(e) {
  55647. return Math.sin(Math.PI * e)
  55648. }
  55649. ,
  55650. n.TubeGeometry.FrenetFrames = function(e, t, i) {
  55651. function r() {
  55652. f[0] = new n.Vector3,
  55653. g[0] = new n.Vector3,
  55654. a = Number.MAX_VALUE,
  55655. s = Math.abs(p[0].x),
  55656. l = Math.abs(p[0].y),
  55657. c = Math.abs(p[0].z),
  55658. s <= a && (a = s,
  55659. d.set(1, 0, 0)),
  55660. l <= a && (a = l,
  55661. d.set(0, 1, 0)),
  55662. c <= a && d.set(0, 0, 1),
  55663. m.crossVectors(p[0], d).normalize(),
  55664. f[0].crossVectors(p[0], m),
  55665. g[0].crossVectors(p[0], f[0])
  55666. }
  55667. var o, a, s, l, c, h, u, d = new n.Vector3, p = [], f = [], g = [], m = new n.Vector3, v = new n.Matrix4, A = t + 1;
  55668. for (this.tangents = p,
  55669. this.normals = f,
  55670. this.binormals = g,
  55671. h = 0; h < A; h++)
  55672. u = h / (A - 1),
  55673. p[h] = e.getTangentAt(u),
  55674. p[h].normalize();
  55675. for (r(),
  55676. h = 1; h < A; h++)
  55677. f[h] = f[h - 1].clone(),
  55678. g[h] = g[h - 1].clone(),
  55679. m.crossVectors(p[h - 1], p[h]),
  55680. m.length() > Number.EPSILON && (m.normalize(),
  55681. o = Math.acos(n.Math.clamp(p[h - 1].dot(p[h]), -1, 1)),
  55682. f[h].applyMatrix4(v.makeRotationAxis(m, o))),
  55683. g[h].crossVectors(p[h], f[h]);
  55684. if (i)
  55685. for (o = Math.acos(n.Math.clamp(f[0].dot(f[A - 1]), -1, 1)),
  55686. o /= A - 1,
  55687. p[0].dot(m.crossVectors(f[0], f[A - 1])) > 0 && (o = -o),
  55688. h = 1; h < A; h++)
  55689. f[h].applyMatrix4(v.makeRotationAxis(p[h], o * h)),
  55690. g[h].crossVectors(p[h], f[h])
  55691. }
  55692. ,
  55693. n.PolyhedronGeometry = function(e, t, i, r) {
  55694. function o(e) {
  55695. var t = e.normalize().clone();
  55696. t.index = u.vertices.push(t) - 1;
  55697. var i = l(e) / 2 / Math.PI + .5
  55698. , r = c(e) / Math.PI + .5;
  55699. return t.uv = new n.Vector2(i,1 - r),
  55700. t
  55701. }
  55702. function a(e, t, i, r) {
  55703. var o = new n.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,r);
  55704. u.faces.push(o),
  55705. C.copy(e).add(t).add(i).divideScalar(3);
  55706. var a = l(C);
  55707. u.faceVertexUvs[0].push([h(e.uv, e, a), h(t.uv, t, a), h(i.uv, i, a)])
  55708. }
  55709. function s(e, t) {
  55710. for (var i = Math.pow(2, t), n = o(u.vertices[e.a]), r = o(u.vertices[e.b]), s = o(u.vertices[e.c]), l = [], c = e.materialIndex, h = 0; h <= i; h++) {
  55711. l[h] = [];
  55712. for (var d = o(n.clone().lerp(s, h / i)), p = o(r.clone().lerp(s, h / i)), f = i - h, g = 0; g <= f; g++)
  55713. 0 === g && h === i ? l[h][g] = d : l[h][g] = o(d.clone().lerp(p, g / f))
  55714. }
  55715. for (var h = 0; h < i; h++)
  55716. for (var g = 0; g < 2 * (i - h) - 1; g++) {
  55717. var m = Math.floor(g / 2);
  55718. g % 2 === 0 ? a(l[h][m + 1], l[h + 1][m], l[h][m], c) : a(l[h][m + 1], l[h + 1][m + 1], l[h + 1][m], c)
  55719. }
  55720. }
  55721. function l(e) {
  55722. return Math.atan2(e.z, -e.x)
  55723. }
  55724. function c(e) {
  55725. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  55726. }
  55727. function h(e, t, i) {
  55728. return i < 0 && 1 === e.x && (e = new n.Vector2(e.x - 1,e.y)),
  55729. 0 === t.x && 0 === t.z && (e = new n.Vector2(i / 2 / Math.PI + .5,e.y)),
  55730. e.clone()
  55731. }
  55732. n.Geometry.call(this),
  55733. this.type = "PolyhedronGeometry",
  55734. this.parameters = {
  55735. vertices: e,
  55736. indices: t,
  55737. radius: i,
  55738. detail: r
  55739. },
  55740. i = i || 1,
  55741. r = r || 0;
  55742. for (var u = this, d = 0, p = e.length; d < p; d += 3)
  55743. o(new n.Vector3(e[d],e[d + 1],e[d + 2]));
  55744. for (var f = this.vertices, g = [], d = 0, m = 0, p = t.length; d < p; d += 3,
  55745. m++) {
  55746. var v = f[t[d]]
  55747. , A = f[t[d + 1]]
  55748. , y = f[t[d + 2]];
  55749. g[m] = new n.Face3(v.index,A.index,y.index,[v.clone(), A.clone(), y.clone()],void 0,m)
  55750. }
  55751. for (var C = new n.Vector3, d = 0, p = g.length; d < p; d++)
  55752. s(g[d], r);
  55753. for (var d = 0, p = this.faceVertexUvs[0].length; d < p; d++) {
  55754. var I = this.faceVertexUvs[0][d]
  55755. , E = I[0].x
  55756. , b = I[1].x
  55757. , w = I[2].x
  55758. , _ = Math.max(E, b, w)
  55759. , T = Math.min(E, b, w);
  55760. _ > .9 && T < .1 && (E < .2 && (I[0].x += 1),
  55761. b < .2 && (I[1].x += 1),
  55762. w < .2 && (I[2].x += 1))
  55763. }
  55764. for (var d = 0, p = this.vertices.length; d < p; d++)
  55765. this.vertices[d].multiplyScalar(i);
  55766. this.mergeVertices(),
  55767. this.computeFaceNormals(),
  55768. this.boundingSphere = new n.Sphere(new n.Vector3,i)
  55769. }
  55770. ,
  55771. n.PolyhedronGeometry.prototype = Object.create(n.Geometry.prototype),
  55772. n.PolyhedronGeometry.prototype.constructor = n.PolyhedronGeometry,
  55773. n.DodecahedronGeometry = function(e, t) {
  55774. var i = (1 + Math.sqrt(5)) / 2
  55775. , r = 1 / i
  55776. , o = [-1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 0, -r, -i, 0, -r, i, 0, r, -i, 0, r, i, -r, -i, 0, -r, i, 0, r, -i, 0, r, i, 0, -i, 0, -r, i, 0, -r, -i, 0, r, i, 0, r]
  55777. , 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];
  55778. n.PolyhedronGeometry.call(this, o, a, e, t),
  55779. this.type = "DodecahedronGeometry",
  55780. this.parameters = {
  55781. radius: e,
  55782. detail: t
  55783. }
  55784. }
  55785. ,
  55786. n.DodecahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  55787. n.DodecahedronGeometry.prototype.constructor = n.DodecahedronGeometry,
  55788. n.IcosahedronGeometry = function(e, t) {
  55789. var i = (1 + Math.sqrt(5)) / 2
  55790. , r = [-1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, 0, 0, -1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, i, 0, -1, i, 0, 1, -i, 0, -1, -i, 0, 1]
  55791. , o = [0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, 1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1];
  55792. n.PolyhedronGeometry.call(this, r, o, e, t),
  55793. this.type = "IcosahedronGeometry",
  55794. this.parameters = {
  55795. radius: e,
  55796. detail: t
  55797. }
  55798. }
  55799. ,
  55800. n.IcosahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  55801. n.IcosahedronGeometry.prototype.constructor = n.IcosahedronGeometry,
  55802. n.OctahedronGeometry = function(e, t) {
  55803. var i = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1]
  55804. , r = [0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4, 1, 4, 2];
  55805. n.PolyhedronGeometry.call(this, i, r, e, t),
  55806. this.type = "OctahedronGeometry",
  55807. this.parameters = {
  55808. radius: e,
  55809. detail: t
  55810. }
  55811. }
  55812. ,
  55813. n.OctahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  55814. n.OctahedronGeometry.prototype.constructor = n.OctahedronGeometry,
  55815. n.TetrahedronGeometry = function(e, t) {
  55816. var i = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1]
  55817. , r = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1];
  55818. n.PolyhedronGeometry.call(this, i, r, e, t),
  55819. this.type = "TetrahedronGeometry",
  55820. this.parameters = {
  55821. radius: e,
  55822. detail: t
  55823. }
  55824. }
  55825. ,
  55826. n.TetrahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  55827. n.TetrahedronGeometry.prototype.constructor = n.TetrahedronGeometry,
  55828. n.ParametricGeometry = function(e, t, i) {
  55829. n.Geometry.call(this),
  55830. this.type = "ParametricGeometry",
  55831. this.parameters = {
  55832. func: e,
  55833. slices: t,
  55834. stacks: i
  55835. };
  55836. var r, o, a, s, l, c = this.vertices, h = this.faces, u = this.faceVertexUvs[0], d = t + 1;
  55837. for (r = 0; r <= i; r++)
  55838. for (l = r / i,
  55839. o = 0; o <= t; o++)
  55840. s = o / t,
  55841. a = e(s, l),
  55842. c.push(a);
  55843. var p, f, g, m, v, A, y, C;
  55844. for (r = 0; r < i; r++)
  55845. for (o = 0; o < t; o++)
  55846. p = r * d + o,
  55847. f = r * d + o + 1,
  55848. g = (r + 1) * d + o + 1,
  55849. m = (r + 1) * d + o,
  55850. v = new n.Vector2(o / t,r / i),
  55851. A = new n.Vector2((o + 1) / t,r / i),
  55852. y = new n.Vector2((o + 1) / t,(r + 1) / i),
  55853. C = new n.Vector2(o / t,(r + 1) / i),
  55854. h.push(new n.Face3(p,f,m)),
  55855. u.push([v, A, C]),
  55856. h.push(new n.Face3(f,g,m)),
  55857. u.push([A.clone(), y, C.clone()]);
  55858. this.computeFaceNormals(),
  55859. this.computeVertexNormals()
  55860. }
  55861. ,
  55862. n.ParametricGeometry.prototype = Object.create(n.Geometry.prototype),
  55863. n.ParametricGeometry.prototype.constructor = n.ParametricGeometry,
  55864. n.WireframeGeometry = function(e) {
  55865. function t(e, t) {
  55866. return e - t
  55867. }
  55868. n.BufferGeometry.call(this);
  55869. var i = [0, 0]
  55870. , r = {}
  55871. , o = ["a", "b", "c"];
  55872. if (e instanceof n.Geometry) {
  55873. for (var a = e.vertices, s = e.faces, l = 0, c = new Uint32Array(6 * s.length), h = 0, u = s.length; h < u; h++)
  55874. for (var d = s[h], p = 0; p < 3; p++) {
  55875. i[0] = d[o[p]],
  55876. i[1] = d[o[(p + 1) % 3]],
  55877. i.sort(t);
  55878. var f = i.toString();
  55879. void 0 === r[f] && (c[2 * l] = i[0],
  55880. c[2 * l + 1] = i[1],
  55881. r[f] = !0,
  55882. l++)
  55883. }
  55884. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  55885. for (var p = 0; p < 2; p++) {
  55886. var m = a[c[2 * h + p]]
  55887. , v = 6 * h + 3 * p;
  55888. g[v + 0] = m.x,
  55889. g[v + 1] = m.y,
  55890. g[v + 2] = m.z
  55891. }
  55892. this.addAttribute("position", new n.BufferAttribute(g,3))
  55893. } else if (e instanceof n.BufferGeometry)
  55894. if (null !== e.index) {
  55895. var A = e.index.array
  55896. , a = e.attributes.position
  55897. , y = e.groups
  55898. , l = 0;
  55899. 0 === y.length && e.addGroup(0, A.length);
  55900. for (var c = new Uint32Array(2 * A.length), C = 0, I = y.length; C < I; ++C)
  55901. for (var E = y[C], b = E.start, w = E.count, h = b, _ = b + w; h < _; h += 3)
  55902. for (var p = 0; p < 3; p++) {
  55903. i[0] = A[h + p],
  55904. i[1] = A[h + (p + 1) % 3],
  55905. i.sort(t);
  55906. var f = i.toString();
  55907. void 0 === r[f] && (c[2 * l] = i[0],
  55908. c[2 * l + 1] = i[1],
  55909. r[f] = !0,
  55910. l++)
  55911. }
  55912. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  55913. for (var p = 0; p < 2; p++) {
  55914. var v = 6 * h + 3 * p
  55915. , T = c[2 * h + p];
  55916. g[v + 0] = a.getX(T),
  55917. g[v + 1] = a.getY(T),
  55918. g[v + 2] = a.getZ(T)
  55919. }
  55920. this.addAttribute("position", new n.BufferAttribute(g,3))
  55921. } else {
  55922. for (var a = e.attributes.position.array, l = a.length / 3, x = l / 3, g = new Float32Array(2 * l * 3), h = 0, u = x; h < u; h++)
  55923. for (var p = 0; p < 3; p++) {
  55924. var v = 18 * h + 6 * p
  55925. , S = 9 * h + 3 * p;
  55926. g[v + 0] = a[S],
  55927. g[v + 1] = a[S + 1],
  55928. g[v + 2] = a[S + 2];
  55929. var T = 9 * h + 3 * ((p + 1) % 3);
  55930. g[v + 3] = a[T],
  55931. g[v + 4] = a[T + 1],
  55932. g[v + 5] = a[T + 2]
  55933. }
  55934. this.addAttribute("position", new n.BufferAttribute(g,3))
  55935. }
  55936. }
  55937. ,
  55938. n.WireframeGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55939. n.WireframeGeometry.prototype.constructor = n.WireframeGeometry,
  55940. n.AxisHelper = function(e) {
  55941. e = e || 1;
  55942. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  55943. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  55944. , r = new n.BufferGeometry;
  55945. r.addAttribute("position", new n.BufferAttribute(t,3)),
  55946. r.addAttribute("color", new n.BufferAttribute(i,3));
  55947. var o = new n.LineBasicMaterial({
  55948. vertexColors: n.VertexColors
  55949. });
  55950. n.LineSegments.call(this, r, o)
  55951. }
  55952. ,
  55953. n.AxisHelper.prototype = Object.create(n.LineSegments.prototype),
  55954. n.AxisHelper.prototype.constructor = n.AxisHelper,
  55955. n.ArrowHelper = function() {
  55956. var e = new n.Geometry;
  55957. e.vertices.push(new n.Vector3(0,0,0), new n.Vector3(0,1,0));
  55958. var t = new n.CylinderGeometry(0,.5,1,5,1);
  55959. return t.translate(0, -.5, 0),
  55960. function(i, r, o, a, s, l) {
  55961. n.Object3D.call(this),
  55962. void 0 === a && (a = 16776960),
  55963. void 0 === o && (o = 1),
  55964. void 0 === s && (s = .2 * o),
  55965. void 0 === l && (l = .2 * s),
  55966. this.position.copy(r),
  55967. this.line = new n.Line(e,new n.LineBasicMaterial({
  55968. color: a
  55969. })),
  55970. this.line.matrixAutoUpdate = !1,
  55971. this.add(this.line),
  55972. this.cone = new n.Mesh(t,new n.MeshBasicMaterial({
  55973. color: a
  55974. })),
  55975. this.cone.matrixAutoUpdate = !1,
  55976. this.add(this.cone),
  55977. this.setDirection(i),
  55978. this.setLength(o, s, l)
  55979. }
  55980. }(),
  55981. n.ArrowHelper.prototype = Object.create(n.Object3D.prototype),
  55982. n.ArrowHelper.prototype.constructor = n.ArrowHelper,
  55983. n.ArrowHelper.prototype.setDirection = function() {
  55984. var e, t = new n.Vector3;
  55985. return function(i) {
  55986. i.y > .99999 ? this.quaternion.set(0, 0, 0, 1) : i.y < -.99999 ? this.quaternion.set(1, 0, 0, 0) : (t.set(i.z, 0, -i.x).normalize(),
  55987. e = Math.acos(i.y),
  55988. this.quaternion.setFromAxisAngle(t, e))
  55989. }
  55990. }(),
  55991. n.ArrowHelper.prototype.setLength = function(e, t, i) {
  55992. void 0 === t && (t = .2 * e),
  55993. void 0 === i && (i = .2 * t),
  55994. this.line.scale.set(1, Math.max(0, e - t), 1),
  55995. this.line.updateMatrix(),
  55996. this.cone.scale.set(i, t, i),
  55997. this.cone.position.y = e,
  55998. this.cone.updateMatrix()
  55999. }
  56000. ,
  56001. n.ArrowHelper.prototype.setColor = function(e) {
  56002. this.line.material.color.set(e),
  56003. this.cone.material.color.set(e)
  56004. }
  56005. ,
  56006. n.BoxHelper = function(e) {
  56007. 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])
  56008. , i = new Float32Array(24)
  56009. , r = new n.BufferGeometry;
  56010. r.setIndex(new n.BufferAttribute(t,1)),
  56011. r.addAttribute("position", new n.BufferAttribute(i,3)),
  56012. n.LineSegments.call(this, r, new n.LineBasicMaterial({
  56013. color: 16776960
  56014. })),
  56015. void 0 !== e && this.update(e)
  56016. }
  56017. ,
  56018. n.BoxHelper.prototype = Object.create(n.LineSegments.prototype),
  56019. n.BoxHelper.prototype.constructor = n.BoxHelper,
  56020. n.BoxHelper.prototype.update = function() {
  56021. var e = new n.Box3;
  56022. return function(t) {
  56023. if (e.setFromObject(t),
  56024. !e.isEmpty()) {
  56025. var i = e.min
  56026. , n = e.max
  56027. , r = this.geometry.attributes.position
  56028. , o = r.array;
  56029. o[0] = n.x,
  56030. o[1] = n.y,
  56031. o[2] = n.z,
  56032. o[3] = i.x,
  56033. o[4] = n.y,
  56034. o[5] = n.z,
  56035. o[6] = i.x,
  56036. o[7] = i.y,
  56037. o[8] = n.z,
  56038. o[9] = n.x,
  56039. o[10] = i.y,
  56040. o[11] = n.z,
  56041. o[12] = n.x,
  56042. o[13] = n.y,
  56043. o[14] = i.z,
  56044. o[15] = i.x,
  56045. o[16] = n.y,
  56046. o[17] = i.z,
  56047. o[18] = i.x,
  56048. o[19] = i.y,
  56049. o[20] = i.z,
  56050. o[21] = n.x,
  56051. o[22] = i.y,
  56052. o[23] = i.z,
  56053. r.needsUpdate = !0,
  56054. this.geometry.computeBoundingSphere()
  56055. }
  56056. }
  56057. }(),
  56058. n.BoundingBoxHelper = function(e, t) {
  56059. var i = void 0 !== t ? t : 8947848;
  56060. this.object = e,
  56061. this.box = new n.Box3,
  56062. n.Mesh.call(this, new n.BoxGeometry(1,1,1), new n.MeshBasicMaterial({
  56063. color: i,
  56064. wireframe: !0
  56065. }))
  56066. }
  56067. ,
  56068. n.BoundingBoxHelper.prototype = Object.create(n.Mesh.prototype),
  56069. n.BoundingBoxHelper.prototype.constructor = n.BoundingBoxHelper,
  56070. n.BoundingBoxHelper.prototype.update = function() {
  56071. this.box.setFromObject(this.object),
  56072. this.box.size(this.scale),
  56073. this.box.center(this.position)
  56074. }
  56075. ,
  56076. n.CameraHelper = function(e) {
  56077. function t(e, t, n) {
  56078. i(e, n),
  56079. i(t, n)
  56080. }
  56081. function i(e, t) {
  56082. r.vertices.push(new n.Vector3),
  56083. r.colors.push(new n.Color(t)),
  56084. void 0 === a[e] && (a[e] = []),
  56085. a[e].push(r.vertices.length - 1)
  56086. }
  56087. var r = new n.Geometry
  56088. , o = new n.LineBasicMaterial({
  56089. color: 16777215,
  56090. vertexColors: n.FaceColors
  56091. })
  56092. , a = {}
  56093. , s = 16755200
  56094. , l = 16711680
  56095. , c = 43775
  56096. , h = 16777215
  56097. , u = 3355443;
  56098. t("n1", "n2", s),
  56099. t("n2", "n4", s),
  56100. t("n4", "n3", s),
  56101. t("n3", "n1", s),
  56102. t("f1", "f2", s),
  56103. t("f2", "f4", s),
  56104. t("f4", "f3", s),
  56105. t("f3", "f1", s),
  56106. t("n1", "f1", s),
  56107. t("n2", "f2", s),
  56108. t("n3", "f3", s),
  56109. t("n4", "f4", s),
  56110. t("p", "n1", l),
  56111. t("p", "n2", l),
  56112. t("p", "n3", l),
  56113. t("p", "n4", l),
  56114. t("u1", "u2", c),
  56115. t("u2", "u3", c),
  56116. t("u3", "u1", c),
  56117. t("c", "t", h),
  56118. t("p", "c", u),
  56119. t("cn1", "cn2", u),
  56120. t("cn3", "cn4", u),
  56121. t("cf1", "cf2", u),
  56122. t("cf3", "cf4", u),
  56123. n.LineSegments.call(this, r, o),
  56124. this.camera = e,
  56125. this.camera.updateProjectionMatrix(),
  56126. this.matrix = e.matrixWorld,
  56127. this.matrixAutoUpdate = !1,
  56128. this.pointMap = a,
  56129. this.update()
  56130. }
  56131. ,
  56132. n.CameraHelper.prototype = Object.create(n.LineSegments.prototype),
  56133. n.CameraHelper.prototype.constructor = n.CameraHelper,
  56134. n.CameraHelper.prototype.update = function() {
  56135. function e(e, n, a, s) {
  56136. r.set(n, a, s).unproject(o);
  56137. var l = i[e];
  56138. if (void 0 !== l)
  56139. for (var c = 0, h = l.length; c < h; c++)
  56140. t.vertices[l[c]].copy(r)
  56141. }
  56142. var t, i, r = new n.Vector3, o = new n.Camera;
  56143. return function() {
  56144. t = this.geometry,
  56145. i = this.pointMap;
  56146. var n = 1
  56147. , r = 1;
  56148. o.projectionMatrix.copy(this.camera.projectionMatrix),
  56149. e("c", 0, 0, -1),
  56150. e("t", 0, 0, 1),
  56151. e("n1", -n, -r, -1),
  56152. e("n2", n, -r, -1),
  56153. e("n3", -n, r, -1),
  56154. e("n4", n, r, -1),
  56155. e("f1", -n, -r, 1),
  56156. e("f2", n, -r, 1),
  56157. e("f3", -n, r, 1),
  56158. e("f4", n, r, 1),
  56159. e("u1", .7 * n, 1.1 * r, -1),
  56160. e("u2", .7 * -n, 1.1 * r, -1),
  56161. e("u3", 0, 2 * r, -1),
  56162. e("cf1", -n, 0, 1),
  56163. e("cf2", n, 0, 1),
  56164. e("cf3", 0, -r, 1),
  56165. e("cf4", 0, r, 1),
  56166. e("cn1", -n, 0, -1),
  56167. e("cn2", n, 0, -1),
  56168. e("cn3", 0, -r, -1),
  56169. e("cn4", 0, r, -1),
  56170. t.verticesNeedUpdate = !0
  56171. }
  56172. }(),
  56173. n.DirectionalLightHelper = function(e, t) {
  56174. n.Object3D.call(this),
  56175. this.light = e,
  56176. this.light.updateMatrixWorld(),
  56177. this.matrix = e.matrixWorld,
  56178. this.matrixAutoUpdate = !1,
  56179. t = t || 1;
  56180. var i = new n.Geometry;
  56181. i.vertices.push(new n.Vector3(-t,t,0), new n.Vector3(t,t,0), new n.Vector3(t,-t,0), new n.Vector3(-t,-t,0), new n.Vector3(-t,t,0));
  56182. var r = new n.LineBasicMaterial({
  56183. fog: !1
  56184. });
  56185. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  56186. this.lightPlane = new n.Line(i,r),
  56187. this.add(this.lightPlane),
  56188. i = new n.Geometry,
  56189. i.vertices.push(new n.Vector3, new n.Vector3),
  56190. r = new n.LineBasicMaterial({
  56191. fog: !1
  56192. }),
  56193. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  56194. this.targetLine = new n.Line(i,r),
  56195. this.add(this.targetLine),
  56196. this.update()
  56197. }
  56198. ,
  56199. n.DirectionalLightHelper.prototype = Object.create(n.Object3D.prototype),
  56200. n.DirectionalLightHelper.prototype.constructor = n.DirectionalLightHelper,
  56201. n.DirectionalLightHelper.prototype.dispose = function() {
  56202. this.lightPlane.geometry.dispose(),
  56203. this.lightPlane.material.dispose(),
  56204. this.targetLine.geometry.dispose(),
  56205. this.targetLine.material.dispose()
  56206. }
  56207. ,
  56208. n.DirectionalLightHelper.prototype.update = function() {
  56209. var e = new n.Vector3
  56210. , t = new n.Vector3
  56211. , i = new n.Vector3;
  56212. return function() {
  56213. e.setFromMatrixPosition(this.light.matrixWorld),
  56214. t.setFromMatrixPosition(this.light.target.matrixWorld),
  56215. i.subVectors(t, e),
  56216. this.lightPlane.lookAt(i),
  56217. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  56218. this.targetLine.geometry.vertices[1].copy(i),
  56219. this.targetLine.geometry.verticesNeedUpdate = !0,
  56220. this.targetLine.material.color.copy(this.lightPlane.material.color)
  56221. }
  56222. }(),
  56223. n.EdgesHelper = function(e, t, i) {
  56224. var r = void 0 !== t ? t : 16777215;
  56225. n.LineSegments.call(this, new n.EdgesGeometry(e.geometry,i), new n.LineBasicMaterial({
  56226. color: r
  56227. })),
  56228. this.matrix = e.matrixWorld,
  56229. this.matrixAutoUpdate = !1
  56230. }
  56231. ,
  56232. n.EdgesHelper.prototype = Object.create(n.LineSegments.prototype),
  56233. n.EdgesHelper.prototype.constructor = n.EdgesHelper,
  56234. n.FaceNormalsHelper = function(e, t, i, r) {
  56235. this.object = e,
  56236. this.size = void 0 !== t ? t : 1;
  56237. var o = void 0 !== i ? i : 16776960
  56238. , a = void 0 !== r ? r : 1
  56239. , s = 0
  56240. , l = this.object.geometry;
  56241. l instanceof n.Geometry ? s = l.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  56242. var c = new n.BufferGeometry
  56243. , h = new n.Float32Attribute(2 * s * 3,3);
  56244. c.addAttribute("position", h),
  56245. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  56246. color: o,
  56247. linewidth: a
  56248. })),
  56249. this.matrixAutoUpdate = !1,
  56250. this.update()
  56251. }
  56252. ,
  56253. n.FaceNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  56254. n.FaceNormalsHelper.prototype.constructor = n.FaceNormalsHelper,
  56255. n.FaceNormalsHelper.prototype.update = function() {
  56256. var e = new n.Vector3
  56257. , t = new n.Vector3
  56258. , i = new n.Matrix3;
  56259. return function() {
  56260. this.object.updateMatrixWorld(!0),
  56261. i.getNormalMatrix(this.object.matrixWorld);
  56262. for (var n = this.object.matrixWorld, r = this.geometry.attributes.position, o = this.object.geometry, a = o.vertices, s = o.faces, l = 0, c = 0, h = s.length; c < h; c++) {
  56263. var u = s[c]
  56264. , d = u.normal;
  56265. e.copy(a[u.a]).add(a[u.b]).add(a[u.c]).divideScalar(3).applyMatrix4(n),
  56266. t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  56267. r.setXYZ(l, e.x, e.y, e.z),
  56268. l += 1,
  56269. r.setXYZ(l, t.x, t.y, t.z),
  56270. l += 1
  56271. }
  56272. return r.needsUpdate = !0,
  56273. this
  56274. }
  56275. }(),
  56276. n.GridHelper = function(e, t) {
  56277. var i = new n.Geometry
  56278. , r = new n.LineBasicMaterial({
  56279. vertexColors: n.VertexColors
  56280. });
  56281. this.color1 = new n.Color(4473924),
  56282. this.color2 = new n.Color(8947848);
  56283. for (var o = -e; o <= e; o += t) {
  56284. i.vertices.push(new n.Vector3(-e,0,o), new n.Vector3(e,0,o), new n.Vector3(o,0,-e), new n.Vector3(o,0,e));
  56285. var a = 0 === o ? this.color1 : this.color2;
  56286. i.colors.push(a, a, a, a)
  56287. }
  56288. n.LineSegments.call(this, i, r)
  56289. }
  56290. ,
  56291. n.GridHelper.prototype = Object.create(n.LineSegments.prototype),
  56292. n.GridHelper.prototype.constructor = n.GridHelper,
  56293. n.GridHelper.prototype.setColors = function(e, t) {
  56294. this.color1.set(e),
  56295. this.color2.set(t),
  56296. this.geometry.colorsNeedUpdate = !0
  56297. }
  56298. ,
  56299. n.HemisphereLightHelper = function(e, t) {
  56300. n.Object3D.call(this),
  56301. this.light = e,
  56302. this.light.updateMatrixWorld(),
  56303. this.matrix = e.matrixWorld,
  56304. this.matrixAutoUpdate = !1,
  56305. this.colors = [new n.Color, new n.Color];
  56306. var i = new n.SphereGeometry(t,4,2);
  56307. i.rotateX(-Math.PI / 2);
  56308. for (var r = 0, o = 8; r < o; r++)
  56309. i.faces[r].color = this.colors[r < 4 ? 0 : 1];
  56310. var a = new n.MeshBasicMaterial({
  56311. vertexColors: n.FaceColors,
  56312. wireframe: !0
  56313. });
  56314. this.lightSphere = new n.Mesh(i,a),
  56315. this.add(this.lightSphere),
  56316. this.update()
  56317. }
  56318. ,
  56319. n.HemisphereLightHelper.prototype = Object.create(n.Object3D.prototype),
  56320. n.HemisphereLightHelper.prototype.constructor = n.HemisphereLightHelper,
  56321. n.HemisphereLightHelper.prototype.dispose = function() {
  56322. this.lightSphere.geometry.dispose(),
  56323. this.lightSphere.material.dispose()
  56324. }
  56325. ,
  56326. n.HemisphereLightHelper.prototype.update = function() {
  56327. var e = new n.Vector3;
  56328. return function() {
  56329. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  56330. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  56331. this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),
  56332. this.lightSphere.geometry.colorsNeedUpdate = !0
  56333. }
  56334. }(),
  56335. n.PointLightHelper = function(e, t) {
  56336. this.light = e,
  56337. this.light.updateMatrixWorld();
  56338. var i = new n.SphereGeometry(t,4,2)
  56339. , r = new n.MeshBasicMaterial({
  56340. wireframe: !0,
  56341. fog: !1
  56342. });
  56343. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  56344. n.Mesh.call(this, i, r),
  56345. this.matrix = this.light.matrixWorld,
  56346. this.matrixAutoUpdate = !1
  56347. }
  56348. ,
  56349. n.PointLightHelper.prototype = Object.create(n.Mesh.prototype),
  56350. n.PointLightHelper.prototype.constructor = n.PointLightHelper,
  56351. n.PointLightHelper.prototype.dispose = function() {
  56352. this.geometry.dispose(),
  56353. this.material.dispose()
  56354. }
  56355. ,
  56356. n.PointLightHelper.prototype.update = function() {
  56357. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  56358. }
  56359. ,
  56360. n.SkeletonHelper = function(e) {
  56361. this.bones = this.getBoneList(e);
  56362. for (var t = new n.Geometry, i = 0; i < this.bones.length; i++) {
  56363. var r = this.bones[i];
  56364. r.parent instanceof n.Bone && (t.vertices.push(new n.Vector3),
  56365. t.vertices.push(new n.Vector3),
  56366. t.colors.push(new n.Color(0,0,1)),
  56367. t.colors.push(new n.Color(0,1,0)))
  56368. }
  56369. t.dynamic = !0;
  56370. var o = new n.LineBasicMaterial({
  56371. vertexColors: n.VertexColors,
  56372. depthTest: !1,
  56373. depthWrite: !1,
  56374. transparent: !0
  56375. });
  56376. n.LineSegments.call(this, t, o),
  56377. this.root = e,
  56378. this.matrix = e.matrixWorld,
  56379. this.matrixAutoUpdate = !1,
  56380. this.update()
  56381. }
  56382. ,
  56383. n.SkeletonHelper.prototype = Object.create(n.LineSegments.prototype),
  56384. n.SkeletonHelper.prototype.constructor = n.SkeletonHelper,
  56385. n.SkeletonHelper.prototype.getBoneList = function(e) {
  56386. var t = [];
  56387. e instanceof n.Bone && t.push(e);
  56388. for (var i = 0; i < e.children.length; i++)
  56389. t.push.apply(t, this.getBoneList(e.children[i]));
  56390. return t
  56391. }
  56392. ,
  56393. n.SkeletonHelper.prototype.update = function() {
  56394. for (var e = this.geometry, t = (new n.Matrix4).getInverse(this.root.matrixWorld), i = new n.Matrix4, r = 0, o = 0; o < this.bones.length; o++) {
  56395. var a = this.bones[o];
  56396. a.parent instanceof n.Bone && (i.multiplyMatrices(t, a.matrixWorld),
  56397. e.vertices[r].setFromMatrixPosition(i),
  56398. i.multiplyMatrices(t, a.parent.matrixWorld),
  56399. e.vertices[r + 1].setFromMatrixPosition(i),
  56400. r += 2)
  56401. }
  56402. e.verticesNeedUpdate = !0,
  56403. e.computeBoundingSphere()
  56404. }
  56405. ,
  56406. n.SpotLightHelper = function(e) {
  56407. n.Object3D.call(this),
  56408. this.light = e,
  56409. this.light.updateMatrixWorld(),
  56410. this.matrix = e.matrixWorld,
  56411. this.matrixAutoUpdate = !1;
  56412. var t = new n.CylinderGeometry(0,1,1,8,1,!0);
  56413. t.translate(0, -.5, 0),
  56414. t.rotateX(-Math.PI / 2);
  56415. var i = new n.MeshBasicMaterial({
  56416. wireframe: !0,
  56417. fog: !1
  56418. });
  56419. this.cone = new n.Mesh(t,i),
  56420. this.add(this.cone),
  56421. this.update()
  56422. }
  56423. ,
  56424. n.SpotLightHelper.prototype = Object.create(n.Object3D.prototype),
  56425. n.SpotLightHelper.prototype.constructor = n.SpotLightHelper,
  56426. n.SpotLightHelper.prototype.dispose = function() {
  56427. this.cone.geometry.dispose(),
  56428. this.cone.material.dispose()
  56429. }
  56430. ,
  56431. n.SpotLightHelper.prototype.update = function() {
  56432. var e = new n.Vector3
  56433. , t = new n.Vector3;
  56434. return function() {
  56435. var i = this.light.distance ? this.light.distance : 1e4
  56436. , n = i * Math.tan(this.light.angle);
  56437. this.cone.scale.set(n, n, i),
  56438. e.setFromMatrixPosition(this.light.matrixWorld),
  56439. t.setFromMatrixPosition(this.light.target.matrixWorld),
  56440. this.cone.lookAt(t.sub(e)),
  56441. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  56442. }
  56443. }(),
  56444. n.VertexNormalsHelper = function(e, t, i, r) {
  56445. this.object = e,
  56446. this.size = void 0 !== t ? t : 1;
  56447. var o = void 0 !== i ? i : 16711680
  56448. , a = void 0 !== r ? r : 1
  56449. , s = 0
  56450. , l = this.object.geometry;
  56451. l instanceof n.Geometry ? s = 3 * l.faces.length : l instanceof n.BufferGeometry && (s = l.attributes.normal.count);
  56452. var c = new n.BufferGeometry
  56453. , h = new n.Float32Attribute(2 * s * 3,3);
  56454. c.addAttribute("position", h),
  56455. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  56456. color: o,
  56457. linewidth: a
  56458. })),
  56459. this.matrixAutoUpdate = !1,
  56460. this.update()
  56461. }
  56462. ,
  56463. n.VertexNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  56464. n.VertexNormalsHelper.prototype.constructor = n.VertexNormalsHelper,
  56465. n.VertexNormalsHelper.prototype.update = function() {
  56466. var e = new n.Vector3
  56467. , t = new n.Vector3
  56468. , i = new n.Matrix3;
  56469. return function() {
  56470. var r = ["a", "b", "c"];
  56471. this.object.updateMatrixWorld(!0),
  56472. i.getNormalMatrix(this.object.matrixWorld);
  56473. var o = this.object.matrixWorld
  56474. , a = this.geometry.attributes.position
  56475. , s = this.object.geometry;
  56476. if (s instanceof n.Geometry)
  56477. for (var l = s.vertices, c = s.faces, h = 0, u = 0, d = c.length; u < d; u++)
  56478. for (var p = c[u], f = 0, g = p.vertexNormals.length; f < g; f++) {
  56479. var m = l[p[r[f]]]
  56480. , v = p.vertexNormals[f];
  56481. e.copy(m).applyMatrix4(o),
  56482. t.copy(v).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  56483. a.setXYZ(h, e.x, e.y, e.z),
  56484. h += 1,
  56485. a.setXYZ(h, t.x, t.y, t.z),
  56486. h += 1
  56487. }
  56488. else if (s instanceof n.BufferGeometry)
  56489. for (var A = s.attributes.position, y = s.attributes.normal, h = 0, f = 0, g = A.count; f < g; f++)
  56490. e.set(A.getX(f), A.getY(f), A.getZ(f)).applyMatrix4(o),
  56491. t.set(y.getX(f), y.getY(f), y.getZ(f)),
  56492. t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  56493. a.setXYZ(h, e.x, e.y, e.z),
  56494. h += 1,
  56495. a.setXYZ(h, t.x, t.y, t.z),
  56496. h += 1;
  56497. return a.needsUpdate = !0,
  56498. this
  56499. }
  56500. }(),
  56501. n.WireframeHelper = function(e, t) {
  56502. var i = void 0 !== t ? t : 16777215;
  56503. n.LineSegments.call(this, new n.WireframeGeometry(e.geometry), new n.LineBasicMaterial({
  56504. color: i
  56505. })),
  56506. this.matrix = e.matrixWorld,
  56507. this.matrixAutoUpdate = !1
  56508. }
  56509. ,
  56510. n.WireframeHelper.prototype = Object.create(n.LineSegments.prototype),
  56511. n.WireframeHelper.prototype.constructor = n.WireframeHelper,
  56512. n.ImmediateRenderObject = function(e) {
  56513. n.Object3D.call(this),
  56514. this.material = e,
  56515. this.render = function(e) {}
  56516. }
  56517. ,
  56518. n.ImmediateRenderObject.prototype = Object.create(n.Object3D.prototype),
  56519. n.ImmediateRenderObject.prototype.constructor = n.ImmediateRenderObject,
  56520. n.MorphBlendMesh = function(e, t) {
  56521. n.Mesh.call(this, e, t),
  56522. this.animationsMap = {},
  56523. this.animationsList = [];
  56524. var i = this.geometry.morphTargets.length
  56525. , r = "__default"
  56526. , o = 0
  56527. , a = i - 1
  56528. , s = i / 1;
  56529. this.createAnimation(r, o, a, s),
  56530. this.setAnimationWeight(r, 1)
  56531. }
  56532. ,
  56533. n.MorphBlendMesh.prototype = Object.create(n.Mesh.prototype),
  56534. n.MorphBlendMesh.prototype.constructor = n.MorphBlendMesh,
  56535. n.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  56536. var r = {
  56537. start: t,
  56538. end: i,
  56539. length: i - t + 1,
  56540. fps: n,
  56541. duration: (i - t) / n,
  56542. lastFrame: 0,
  56543. currentFrame: 0,
  56544. active: !1,
  56545. time: 0,
  56546. direction: 1,
  56547. weight: 1,
  56548. directionBackwards: !1,
  56549. mirroredLoop: !1
  56550. };
  56551. this.animationsMap[e] = r,
  56552. this.animationsList.push(r)
  56553. }
  56554. ,
  56555. n.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  56556. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  56557. var s = r.morphTargets[o]
  56558. , l = s.name.match(i);
  56559. if (l && l.length > 1) {
  56560. var c = l[1];
  56561. n[c] || (n[c] = {
  56562. start: 1 / 0,
  56563. end: -(1 / 0)
  56564. });
  56565. var h = n[c];
  56566. o < h.start && (h.start = o),
  56567. o > h.end && (h.end = o),
  56568. t || (t = c)
  56569. }
  56570. }
  56571. for (var c in n) {
  56572. var h = n[c];
  56573. this.createAnimation(c, h.start, h.end, e)
  56574. }
  56575. this.firstAnimation = t
  56576. }
  56577. ,
  56578. n.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  56579. var t = this.animationsMap[e];
  56580. t && (t.direction = 1,
  56581. t.directionBackwards = !1)
  56582. }
  56583. ,
  56584. n.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  56585. var t = this.animationsMap[e];
  56586. t && (t.direction = -1,
  56587. t.directionBackwards = !0)
  56588. }
  56589. ,
  56590. n.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  56591. var i = this.animationsMap[e];
  56592. i && (i.fps = t,
  56593. i.duration = (i.end - i.start) / i.fps)
  56594. }
  56595. ,
  56596. n.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  56597. var i = this.animationsMap[e];
  56598. i && (i.duration = t,
  56599. i.fps = (i.end - i.start) / i.duration)
  56600. }
  56601. ,
  56602. n.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  56603. var i = this.animationsMap[e];
  56604. i && (i.weight = t)
  56605. }
  56606. ,
  56607. n.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  56608. var i = this.animationsMap[e];
  56609. i && (i.time = t)
  56610. }
  56611. ,
  56612. n.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  56613. var t = 0
  56614. , i = this.animationsMap[e];
  56615. return i && (t = i.time),
  56616. t
  56617. }
  56618. ,
  56619. n.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  56620. var t = -1
  56621. , i = this.animationsMap[e];
  56622. return i && (t = i.duration),
  56623. t
  56624. }
  56625. ,
  56626. n.MorphBlendMesh.prototype.playAnimation = function(e) {
  56627. var t = this.animationsMap[e];
  56628. t ? (t.time = 0,
  56629. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  56630. }
  56631. ,
  56632. n.MorphBlendMesh.prototype.stopAnimation = function(e) {
  56633. var t = this.animationsMap[e];
  56634. t && (t.active = !1)
  56635. }
  56636. ,
  56637. n.MorphBlendMesh.prototype.update = function(e) {
  56638. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  56639. var r = this.animationsList[t];
  56640. if (r.active) {
  56641. var o = r.duration / r.length;
  56642. r.time += r.direction * e,
  56643. r.mirroredLoop ? (r.time > r.duration || r.time < 0) && (r.direction *= -1,
  56644. r.time > r.duration && (r.time = r.duration,
  56645. r.directionBackwards = !0),
  56646. r.time < 0 && (r.time = 0,
  56647. r.directionBackwards = !1)) : (r.time = r.time % r.duration,
  56648. r.time < 0 && (r.time += r.duration));
  56649. var a = r.start + n.Math.clamp(Math.floor(r.time / o), 0, r.length - 1)
  56650. , s = r.weight;
  56651. a !== r.currentFrame && (this.morphTargetInfluences[r.lastFrame] = 0,
  56652. this.morphTargetInfluences[r.currentFrame] = 1 * s,
  56653. this.morphTargetInfluences[a] = 0,
  56654. r.lastFrame = r.currentFrame,
  56655. r.currentFrame = a);
  56656. var l = r.time % o / o;
  56657. r.directionBackwards && (l = 1 - l),
  56658. r.currentFrame !== r.lastFrame ? (this.morphTargetInfluences[r.currentFrame] = l * s,
  56659. this.morphTargetInfluences[r.lastFrame] = (1 - l) * s) : this.morphTargetInfluences[r.currentFrame] = s
  56660. }
  56661. }
  56662. }
  56663. ,
  56664. "undefined" != typeof i ? ("undefined" != typeof t && t.exports && (i = t.exports = n),
  56665. i.THREE = n) : this.THREE = n
  56666. }
  56667. , {}]
  56668. }, {}, [116]);