main_2018_edit.js 2.4 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658556595566055661556625566355664556655566655667556685566955670556715567255673556745567555676556775567855679556805568155682556835568455685556865568755688556895569055691556925569355694556955569655697556985569955700557015570255703557045570555706557075570855709557105571155712557135571455715557165571755718557195572055721557225572355724557255572655727557285572955730557315573255733557345573555736557375573855739557405574155742557435574455745557465574755748557495575055751557525575355754557555575655757557585575955760557615576255763557645576555766557675576855769557705577155772557735577455775557765577755778557795578055781557825578355784557855578655787557885578955790557915579255793557945579555796557975579855799558005580155802558035580455805558065580755808558095581055811558125581355814558155581655817558185581955820558215582255823558245582555826558275582855829558305583155832558335583455835558365583755838558395584055841558425584355844558455584655847558485584955850558515585255853558545585555856558575585855859558605586155862558635586455865558665586755868558695587055871558725587355874558755587655877558785587955880558815588255883558845588555886558875588855889558905589155892558935589455895558965589755898558995590055901559025590355904559055590655907559085590955910559115591255913559145591555916559175591855919559205592155922559235592455925559265592755928559295593055931559325593355934559355593655937559385593955940559415594255943559445594555946559475594855949
  1. /* 许钟文修改的 标记 xzw
  2. 另外 所有"matter"字样已被我删除 原因:删除matterport信息
  3. */
  4. !function() {
  5. "use strict";
  6. function t(t, i) {
  7. return typeof t === i
  8. }
  9. function i(t, i) {
  10. return t instanceof i
  11. }
  12. function n(t) {
  13. return t && t.nodeType
  14. }
  15. function e(t) {
  16. return n(t) ? t : i(t, g) ? t[0] : void 0
  17. }
  18. function o(t, i, n) {
  19. return g.each(t, function(t, e) {
  20. n = i.call(e, n, t, e)
  21. }),
  22. n
  23. }
  24. function r(t, i, n) {
  25. var e, o, r;
  26. if (t === i)
  27. return !0;
  28. if (!t || !i || t.constructor !== i.constructor)
  29. return !1;
  30. for (e = 0,
  31. o = n.length; o > e; e += 1) {
  32. if (r = n[e],
  33. t[r] && y(t[r].equals) && !t[r].equals(i[r]))
  34. return !1;
  35. if (t[r] !== i[r])
  36. return !1
  37. }
  38. return !0
  39. }
  40. function s(t, i, n, e) {
  41. this.left = E(t),
  42. this.top = E(i),
  43. this.width = E(n),
  44. this.height = E(e),
  45. this.right = this.left + this.width,
  46. this.bottom = this.top + this.height
  47. }
  48. function h(t, i, n, e) {
  49. this.visible = t || 0,
  50. this.viewport = i || 0,
  51. this.possible = n || 0,
  52. this.rects = e && T({}, e) || null
  53. }
  54. function l(t, i) {
  55. this.els = t,
  56. this.viewport = i
  57. }
  58. function c(t, i, n) {
  59. var e;
  60. return g.inArray(n, q) >= 0 ? e = s.ofElement(t) : g.inArray(n, S) >= 0 && (e = h.of(t, i)),
  61. e ? e[n] : 0
  62. }
  63. function u(t, i) {
  64. return t.val - i.val
  65. }
  66. function a(t, i) {
  67. return i.val - t.val
  68. }
  69. function f(t) {
  70. var i = s.ofContent(t, !0)
  71. , n = s.ofViewport(t, !0)
  72. , e = i.width - n.width
  73. , o = i.height - n.height;
  74. this.content = i,
  75. this.viewport = n,
  76. this.width = 0 >= e ? null : n.left / e,
  77. this.height = 0 >= o ? null : n.top / o,
  78. this.left = n.left,
  79. this.top = n.top,
  80. this.right = i.right - n.right,
  81. this.bottom = i.bottom - n.bottom
  82. }
  83. function p(t) {
  84. this.el = t || window
  85. }
  86. function d(t, i) {
  87. this.context = t,
  88. this.viewport = i,
  89. this.init()
  90. }
  91. function v(t, i, n, e) {
  92. this.context = new l(t,i),
  93. this.property = n,
  94. this.descending = e,
  95. this.init()
  96. }
  97. function w(t) {
  98. t && t !== window && t !== document ? (this.context = t,
  99. this.$autoTarget = g(t)) : this.context = window,
  100. this.init()
  101. }
  102. var g = jQuery
  103. , m = g(window)
  104. , b = g(document)
  105. , T = g.extend
  106. , y = g.isFunction
  107. , k = Math.max
  108. , V = Math.min
  109. , E = Math.round
  110. , x = function() {
  111. var t = {}
  112. , i = 1;
  113. return function(n) {
  114. return n ? (t[n] || (t[n] = i,
  115. i += 1),
  116. t[n]) : 0
  117. }
  118. }();
  119. T(s.prototype, {
  120. equals: function(t) {
  121. return r(this, t, ["left", "top", "width", "height"])
  122. },
  123. area: function() {
  124. return this.width * this.height
  125. },
  126. relativeTo: function(t) {
  127. return new s(this.left - t.left,this.top - t.top,this.width,this.height)
  128. },
  129. intersection: function(t) {
  130. if (!i(t, s))
  131. return null;
  132. var n = k(this.left, t.left)
  133. , e = V(this.right, t.right)
  134. , o = k(this.top, t.top)
  135. , r = V(this.bottom, t.bottom)
  136. , h = e - n
  137. , l = r - o;
  138. return h >= 0 && l >= 0 ? new s(n,o,h,l) : null
  139. },
  140. envelope: function(t) {
  141. if (!i(t, s))
  142. return this;
  143. var n = V(this.left, t.left)
  144. , e = k(this.right, t.right)
  145. , o = V(this.top, t.top)
  146. , r = k(this.bottom, t.bottom)
  147. , h = e - n
  148. , l = r - o;
  149. return new s(n,o,h,l)
  150. }
  151. }),
  152. T(s, {
  153. ofContent: function(t, i) {
  154. 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())
  155. },
  156. ofViewport: function(t, i) {
  157. 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())
  158. },
  159. ofElement: function(t) {
  160. var i = g(t);
  161. if (!i.is(":visible"))
  162. return null;
  163. var n = i.offset();
  164. return new s(n.left,n.top,i.outerWidth(),i.outerHeight())
  165. }
  166. }),
  167. T(h.prototype, {
  168. equals: function(t) {
  169. return this.fracsEqual(t) && this.rectsEqual(t)
  170. },
  171. fracsEqual: function(t) {
  172. return r(this, t, ["visible", "viewport", "possible"])
  173. },
  174. rectsEqual: function(t) {
  175. return r(this.rects, t.rects, ["document", "element", "viewport"])
  176. }
  177. }),
  178. T(h, {
  179. of: function(t, i) {
  180. var e, o, r;
  181. return t = n(t) && s.ofElement(t) || t,
  182. i = n(i) && s.ofViewport(i) || i || s.ofViewport(),
  183. t instanceof s && (e = t.intersection(i)) ? (o = e.area(),
  184. r = V(t.width, i.width) * V(t.height, i.height),
  185. new h(o / t.area(),o / i.area(),o / r,{
  186. document: e,
  187. element: e.relativeTo(t),
  188. viewport: e.relativeTo(i)
  189. })) : new h
  190. }
  191. });
  192. var q = ["width", "height", "left", "right", "top", "bottom"]
  193. , S = ["possible", "visible", "viewport"];
  194. T(l.prototype, {
  195. sorted: function(t, i) {
  196. var n = this.viewport;
  197. return g.map(this.els, function(i) {
  198. return {
  199. el: i,
  200. val: c(i, n, t)
  201. }
  202. }).sort(i ? a : u)
  203. },
  204. best: function(t, i) {
  205. return this.els.length ? this.sorted(t, i)[0] : null
  206. }
  207. }),
  208. T(f.prototype, {
  209. equals: function(t) {
  210. return r(this, t, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  211. }
  212. }),
  213. T(p.prototype, {
  214. equals: function(t) {
  215. return r(this, t, ["el"])
  216. },
  217. scrollState: function() {
  218. return new f(this.el)
  219. },
  220. scrollTo: function(t, i, n) {
  221. var e = g(this.el === window ? "html,body" : this.el);
  222. t = t || 0,
  223. i = i || 0,
  224. n = isNaN(n) ? 1e3 : n,
  225. e.stop(!0).animate({
  226. scrollLeft: t,
  227. scrollTop: i
  228. }, n)
  229. },
  230. scroll: function(t, i, n) {
  231. var e = this.el === window ? m : g(this.el);
  232. t = t || 0,
  233. i = i || 0,
  234. this.scrollTo(e.scrollLeft() + t, e.scrollTop() + i, n)
  235. },
  236. scrollToRect: function(t, i, n, e) {
  237. i = i || 0,
  238. n = n || 0,
  239. this.scrollTo(t.left - i, t.top - n, e)
  240. },
  241. scrollToElement: function(t, i, n, e) {
  242. var o = s.ofElement(t).relativeTo(s.ofContent(this.el));
  243. this.scrollToRect(o, i, n, e)
  244. }
  245. });
  246. var C = {
  247. init: function() {
  248. this.callbacks = g.Callbacks("memory unique"),
  249. this.currVal = null,
  250. this.prevVal = null,
  251. this.checkProxy = g.proxy(this.check, this),
  252. this.autoCheck()
  253. },
  254. bind: function(t) {
  255. this.callbacks.add(t)
  256. },
  257. unbind: function(t) {
  258. t ? this.callbacks.remove(t) : this.callbacks.empty()
  259. },
  260. trigger: function() {
  261. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  262. },
  263. check: function(t) {
  264. var i = this.updatedValue(t);
  265. return void 0 !== i && (this.prevVal = this.currVal,
  266. this.currVal = i,
  267. this.trigger(),
  268. !0)
  269. },
  270. $autoTarget: m,
  271. autoEvents: "load resize scroll",
  272. autoCheck: function(t) {
  273. this.$autoTarget[t === !1 ? "off" : "on"](this.autoEvents, this.checkProxy)
  274. }
  275. };
  276. T(d.prototype, C, {
  277. updatedValue: function() {
  278. var t = h.of(this.context, this.viewport);
  279. return this.currVal && this.currVal.equals(t) ? void 0 : t
  280. }
  281. }),
  282. T(v.prototype, C, {
  283. updatedValue: function() {
  284. var t = this.context.best(this.property, this.descending);
  285. return t && (t = t.val > 0 ? t.el : null,
  286. this.currVal !== t) ? t : void 0
  287. }
  288. }),
  289. T(w.prototype, C, {
  290. updatedValue: function() {
  291. var t = new f(this.context);
  292. return this.currVal && this.currVal.equals(t) ? void 0 : t
  293. }
  294. });
  295. var L = function(t, i) {
  296. var n = [].slice
  297. , e = jQuery
  298. , o = e.extend
  299. , r = e.isFunction
  300. , s = o({}, i)
  301. , h = function(i, n, o, s) {
  302. return o = r(o) ? o.apply(i, n) : o,
  303. r(s[o]) ? s[o].apply(i, n) : void e.error('Method "' + o + '" does not exist on jQuery.' + t)
  304. }
  305. , l = function() {
  306. return h(this, n.call(arguments), s.defaultStatic, l)
  307. }
  308. , c = function(t) {
  309. return r(c[t]) ? c[t].apply(this, n.call(arguments, 1)) : h(this, n.call(arguments), s.defaultMethod, c)
  310. }
  311. , u = function(t) {
  312. t && (o(l, t.statics),
  313. o(c, t.methods)),
  314. l.modplug = u
  315. };
  316. u.prev = {
  317. statics: e[t],
  318. methods: e.fn[t]
  319. },
  320. u(i),
  321. e[t] = l,
  322. e.fn[t] = c
  323. }
  324. , M = "fracs";
  325. L(M, {
  326. statics: {
  327. version: "0.15.0",
  328. Rect: s,
  329. Fractions: h,
  330. Group: l,
  331. ScrollState: f,
  332. Viewport: p,
  333. FracsCallbacks: d,
  334. GroupCallbacks: v,
  335. ScrollStateCallbacks: w,
  336. fracs: function(t, i) {
  337. return h.of(t, i)
  338. }
  339. },
  340. methods: {
  341. content: function(t) {
  342. return this.length ? s.ofContent(this[0], t) : null
  343. },
  344. envelope: function() {
  345. return o(this, function(t) {
  346. var i = s.ofElement(this);
  347. return t ? t.envelope(i) : i
  348. })
  349. },
  350. fracs: function(i, n, o) {
  351. t(i, "string") || (o = n,
  352. n = i,
  353. i = null),
  354. y(n) || (o = n,
  355. n = null),
  356. o = e(o);
  357. var r = M + ".fracs." + x(o);
  358. return "unbind" === i ? this.each(function() {
  359. var t = g(this).data(r);
  360. t && t.unbind(n)
  361. }) : "check" === i ? this.each(function() {
  362. var t = g(this).data(r);
  363. t && t.check()
  364. }) : y(n) ? this.each(function() {
  365. var t = g(this)
  366. , i = t.data(r);
  367. i || (i = new d(this,o),
  368. t.data(r, i)),
  369. i.bind(n)
  370. }) : this.length ? h.of(this[0], o) : null
  371. },
  372. intersection: function() {
  373. return o(this, function(t) {
  374. var i = s.ofElement(this);
  375. return t ? t.intersection(i) : i
  376. })
  377. },
  378. max: function(t, i, n) {
  379. return y(i) || (n = i,
  380. i = null),
  381. n = e(n),
  382. i ? (new v(this,n,t,!0).bind(i),
  383. this) : this.pushStack(new l(this,n).best(t, !0).el)
  384. },
  385. min: function(t, i, n) {
  386. return y(i) || (n = i,
  387. i = null),
  388. n = e(n),
  389. i ? (new v(this,n,t).bind(i),
  390. this) : this.pushStack(new l(this,n).best(t).el)
  391. },
  392. rect: function() {
  393. return this.length ? s.ofElement(this[0]) : null
  394. },
  395. scrollState: function(i, n) {
  396. var e = M + ".scrollState";
  397. return t(i, "string") || (n = i,
  398. i = null),
  399. "unbind" === i ? this.each(function() {
  400. var t = g(this).data(e);
  401. t && t.unbind(n)
  402. }) : "check" === i ? this.each(function() {
  403. var t = g(this).data(e);
  404. t && t.check()
  405. }) : y(n) ? this.each(function() {
  406. var t = g(this)
  407. , i = t.data(e);
  408. i || (i = new w(this),
  409. t.data(e, i)),
  410. i.bind(n)
  411. }) : this.length ? new f(this[0]) : null
  412. },
  413. scroll: function(t, i, n) {
  414. return this.each(function() {
  415. new p(this).scroll(t, i, n)
  416. })
  417. },
  418. scrollTo: function(t, i, n, o) {
  419. return g.isNumeric(t) && (o = n,
  420. n = i,
  421. i = t,
  422. t = null),
  423. t = e(t),
  424. this.each(function() {
  425. t ? new p(this).scrollToElement(t, i, n, o) : new p(this).scrollTo(i, n, o)
  426. })
  427. },
  428. scrollToThis: function(t, i, n, o) {
  429. return o = new p(e(o)),
  430. o.scrollToElement(this[0], t, i, n),
  431. this
  432. },
  433. softLink: function(t, i, n, o) {
  434. return o = new p(e(o)),
  435. this.filter("a[href^=#]").each(function() {
  436. var e = g(this);
  437. e.on("click", function() {
  438. o.scrollToElement(g(e.attr("href"))[0], t, i, n)
  439. })
  440. })
  441. },
  442. sort: function(i, n, o) {
  443. return t(n, "boolean") || (o = n,
  444. n = null),
  445. o = e(o),
  446. this.pushStack(g.map(new l(this,o).sorted(i, !n), function(t) {
  447. return t.el
  448. }))
  449. },
  450. viewport: function(t) {
  451. return this.length ? s.ofViewport(this[0], t) : null
  452. }
  453. },
  454. defaultStatic: "fracs",
  455. defaultMethod: "fracs"
  456. })
  457. }();
  458. if ("undefined" == typeof jQuery)
  459. throw new Error("Bootstrap's JavaScript requires jQuery");
  460. +function(t) {
  461. "use strict";
  462. function e(e) {
  463. return this.each(function() {
  464. var o = t(this)
  465. , s = o.data("bs.tooltip")
  466. , n = "object" == typeof e && e;
  467. (s || "destroy" != e) && (s || o.data("bs.tooltip", s = new i(this,n)),
  468. "string" == typeof e && s[e]())
  469. })
  470. }
  471. var i = function(t, e) {
  472. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  473. this.init("tooltip", t, e)
  474. };
  475. i.VERSION = "3.2.0",
  476. i.DEFAULTS = {
  477. animation: !0,
  478. placement: "top",
  479. selector: !1,
  480. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  481. trigger: "hover focus",
  482. title: "",
  483. delay: 0,
  484. html: !1,
  485. container: !1,
  486. viewport: {
  487. selector: "body",
  488. padding: 0
  489. }
  490. },
  491. i.prototype.init = function(e, i, o) {
  492. this.enabled = !0,
  493. this.type = e,
  494. this.$element = t(i),
  495. this.options = this.getOptions(o),
  496. this.$viewport = this.options.viewport && t(this.options.viewport.selector || this.options.viewport);
  497. for (var s = this.options.trigger.split(" "), n = s.length; n--; ) {
  498. var r = s[n];
  499. if ("click" == r)
  500. this.$element.on("click." + this.type, this.options.selector, t.proxy(this.toggle, this));
  501. else if ("manual" != r) {
  502. var a = "hover" == r ? "mouseenter" : "focusin"
  503. , l = "hover" == r ? "mouseleave" : "focusout";
  504. this.$element.on(a + "." + this.type, this.options.selector, t.proxy(this.enter, this)),
  505. this.$element.on(l + "." + this.type, this.options.selector, t.proxy(this.leave, this))
  506. }
  507. }
  508. this.options.selector ? this._options = t.extend({}, this.options, {
  509. trigger: "manual",
  510. selector: ""
  511. }) : this.fixTitle()
  512. }
  513. ,
  514. i.prototype.getDefaults = function() {
  515. return i.DEFAULTS
  516. }
  517. ,
  518. i.prototype.getOptions = function(e) {
  519. return e = t.extend({}, this.getDefaults(), this.$element.data(), e),
  520. e.delay && "number" == typeof e.delay && (e.delay = {
  521. show: e.delay,
  522. hide: e.delay
  523. }),
  524. e
  525. }
  526. ,
  527. i.prototype.getDelegateOptions = function() {
  528. var e = {}
  529. , i = this.getDefaults();
  530. return this._options && t.each(this._options, function(t, o) {
  531. i[t] != o && (e[t] = o)
  532. }),
  533. e
  534. }
  535. ,
  536. i.prototype.enter = function(e) {
  537. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  538. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  539. t(e.currentTarget).data("bs." + this.type, i)),
  540. clearTimeout(i.timeout),
  541. i.hoverState = "in",
  542. i.options.delay && i.options.delay.show ? void (i.timeout = setTimeout(function() {
  543. "in" == i.hoverState && i.show()
  544. }, i.options.delay.show)) : i.show()
  545. }
  546. ,
  547. i.prototype.leave = 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 = "out",
  553. i.options.delay && i.options.delay.hide ? void (i.timeout = setTimeout(function() {
  554. "out" == i.hoverState && i.hide()
  555. }, i.options.delay.hide)) : i.hide()
  556. }
  557. ,
  558. i.prototype.show = function() {
  559. var e = t.Event("show.bs." + this.type);
  560. if (this.hasContent() && this.enabled) {
  561. this.$element.trigger(e);
  562. var i = t.contains(document.documentElement, this.$element[0]);
  563. if (e.isDefaultPrevented() || !i)
  564. return;
  565. var o = this
  566. , s = this.tip()
  567. , n = this.getUID(this.type);
  568. this.setContent(),
  569. s.attr("id", n),
  570. this.$element.attr("aria-describedby", n),
  571. this.options.animation && s.addClass("fade");
  572. var r = "function" == typeof this.options.placement ? this.options.placement.call(this, s[0], this.$element[0]) : this.options.placement
  573. , a = /\s?auto?\s?/i
  574. , l = a.test(r);
  575. l && (r = r.replace(a, "") || "top"),
  576. s.detach().css({
  577. top: 0,
  578. left: 0,
  579. display: "block"
  580. }).addClass(r).data("bs." + this.type, this),
  581. this.options.container ? s.appendTo(this.options.container) : s.insertAfter(this.$element);
  582. var p = this.getPosition()
  583. , h = s[0].offsetWidth
  584. , f = s[0].offsetHeight;
  585. if (l) {
  586. var u = r
  587. , c = this.$element.parent()
  588. , d = this.getPosition(c);
  589. 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,
  590. s.removeClass(u).addClass(r)
  591. }
  592. var g = this.getCalculatedOffset(r, p, h, f);
  593. this.applyPlacement(g, r);
  594. var y = function() {
  595. o.$element.trigger("shown.bs." + o.type),
  596. o.hoverState = null
  597. };
  598. t.support.transition && this.$tip.hasClass("fade") ? s.one("bsTransitionEnd", y).emulateTransitionEnd(150) : y()
  599. }
  600. }
  601. ,
  602. i.prototype.applyPlacement = function(e, i) {
  603. var o = this.tip()
  604. , s = o[0].offsetWidth
  605. , n = o[0].offsetHeight
  606. , r = parseInt(o.css("margin-top"), 10)
  607. , a = parseInt(o.css("margin-left"), 10);
  608. isNaN(r) && (r = 0),
  609. isNaN(a) && (a = 0),
  610. e.top = e.top + r,
  611. e.left = e.left + a,
  612. t.offset.setOffset(o[0], t.extend({
  613. using: function(t) {
  614. o.css({
  615. top: Math.round(t.top),
  616. left: Math.round(t.left)
  617. })
  618. }
  619. }, e), 0),
  620. o.addClass("in");
  621. var l = o[0].offsetWidth
  622. , p = o[0].offsetHeight;
  623. "top" == i && p != n && (e.top = e.top + n - p);
  624. var h = this.getViewportAdjustedDelta(i, e, l, p);
  625. h.left ? e.left += h.left : e.top += h.top;
  626. var f = h.left ? 2 * h.left - s + l : 2 * h.top - n + p
  627. , u = h.left ? "left" : "top"
  628. , c = h.left ? "offsetWidth" : "offsetHeight";
  629. o.offset(e),
  630. this.replaceArrow(f, o[0][c], u)
  631. }
  632. ,
  633. i.prototype.replaceArrow = function(t, e, i) {
  634. this.arrow().css(i, t ? 50 * (1 - t / e) + "%" : "")
  635. }
  636. ,
  637. i.prototype.setContent = function() {
  638. var t = this.tip()
  639. , e = this.getTitle();
  640. t.find(".tooltip-inner")[this.options.html ? "html" : "text"](e),
  641. t.removeClass("fade in top bottom left right")
  642. }
  643. ,
  644. i.prototype.hide = function() {
  645. function e() {
  646. "in" != i.hoverState && o.detach(),
  647. i.$element.trigger("hidden.bs." + i.type)
  648. }
  649. var i = this
  650. , o = this.tip()
  651. , s = t.Event("hide.bs." + this.type);
  652. if (this.$element.removeAttr("aria-describedby"),
  653. this.$element.trigger(s),
  654. !s.isDefaultPrevented())
  655. return o.removeClass("in"),
  656. t.support.transition && this.$tip.hasClass("fade") ? o.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  657. this.hoverState = null,
  658. this
  659. }
  660. ,
  661. i.prototype.fixTitle = function() {
  662. var t = this.$element;
  663. (t.attr("title") || "string" != typeof t.attr("data-original-title")) && t.attr("data-original-title", t.attr("title") || "").attr("title", "")
  664. }
  665. ,
  666. i.prototype.hasContent = function() {
  667. return this.getTitle()
  668. }
  669. ,
  670. i.prototype.getPosition = function(e) {
  671. e = e || this.$element;
  672. var i = e[0]
  673. , o = "BODY" == i.tagName;
  674. return t.extend({}, "function" == typeof i.getBoundingClientRect ? i.getBoundingClientRect() : null, {
  675. scroll: o ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  676. width: o ? t(window).width() : e.outerWidth(),
  677. height: o ? t(window).height() : e.outerHeight()
  678. }, o ? {
  679. top: 0,
  680. left: 0
  681. } : e.offset())
  682. }
  683. ,
  684. i.prototype.getCalculatedOffset = function(t, e, i, o) {
  685. return "bottom" == t ? {
  686. top: e.top + e.height,
  687. left: e.left + e.width / 2 - i / 2
  688. } : "top" == t ? {
  689. top: e.top - o,
  690. left: e.left + e.width / 2 - i / 2
  691. } : "left" == t ? {
  692. top: e.top + e.height / 2 - o / 2,
  693. left: e.left - i
  694. } : {
  695. top: e.top + e.height / 2 - o / 2,
  696. left: e.left + e.width
  697. }
  698. }
  699. ,
  700. i.prototype.getViewportAdjustedDelta = function(t, e, i, o) {
  701. var s = {
  702. top: 0,
  703. left: 0
  704. };
  705. if (!this.$viewport)
  706. return s;
  707. var n = this.options.viewport && this.options.viewport.padding || 0
  708. , r = this.getPosition(this.$viewport);
  709. if (/right|left/.test(t)) {
  710. var a = e.top - n - r.scroll
  711. , l = e.top + n - r.scroll + o;
  712. a < r.top ? s.top = r.top - a : l > r.top + r.height && (s.top = r.top + r.height - l)
  713. } else {
  714. var p = e.left - n
  715. , h = e.left + n + i;
  716. p < r.left ? s.left = r.left - p : h > r.width && (s.left = r.left + r.width - h)
  717. }
  718. return s
  719. }
  720. ,
  721. i.prototype.getTitle = function() {
  722. var t, e = this.$element, i = this.options;
  723. return t = e.attr("data-original-title") || ("function" == typeof i.title ? i.title.call(e[0]) : i.title)
  724. }
  725. ,
  726. i.prototype.getUID = function(t) {
  727. do
  728. t += ~~(1e6 * Math.random());
  729. while (document.getElementById(t));return t
  730. }
  731. ,
  732. i.prototype.tip = function() {
  733. return this.$tip = this.$tip || t(this.options.template)
  734. }
  735. ,
  736. i.prototype.arrow = function() {
  737. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  738. }
  739. ,
  740. i.prototype.validate = function() {
  741. this.$element[0].parentNode || (this.hide(),
  742. this.$element = null,
  743. this.options = null)
  744. }
  745. ,
  746. i.prototype.enable = function() {
  747. this.enabled = !0
  748. }
  749. ,
  750. i.prototype.disable = function() {
  751. this.enabled = !1
  752. }
  753. ,
  754. i.prototype.toggleEnabled = function() {
  755. this.enabled = !this.enabled
  756. }
  757. ,
  758. i.prototype.toggle = function(e) {
  759. var i = this;
  760. e && (i = t(e.currentTarget).data("bs." + this.type),
  761. i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  762. t(e.currentTarget).data("bs." + this.type, i))),
  763. i.tip().hasClass("in") ? i.leave(i) : i.enter(i)
  764. }
  765. ,
  766. i.prototype.destroy = function() {
  767. clearTimeout(this.timeout),
  768. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  769. }
  770. ;
  771. var o = t.fn.tooltip;
  772. t.fn.tooltip = e,
  773. t.fn.tooltip.Constructor = i,
  774. t.fn.tooltip.noConflict = function() {
  775. return t.fn.tooltip = o,
  776. this
  777. }
  778. }(jQuery);
  779. !function(e, t, n) {
  780. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  781. }("Keen", this, function() {
  782. "use strict";
  783. function Keen() {
  784. return _init.apply(this, arguments)
  785. }
  786. function _init(e) {
  787. if (_isUndefined(e))
  788. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  789. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  790. throw new Error("Please provide a projectId");
  791. this.configure(e)
  792. }
  793. function _extend(e) {
  794. for (var t = 1; t < arguments.length; t++)
  795. for (var n in arguments[t])
  796. e[n] = arguments[t][n];
  797. return e
  798. }
  799. function _isUndefined(e) {
  800. return void 0 === e
  801. }
  802. function _type(e) {
  803. var t = e && e.constructor ? e.constructor.toString() : void 0;
  804. return t ? t.match(/function (.*)\(/)[1] : "Null"
  805. }
  806. function _each(e, t, n) {
  807. var r;
  808. if (!e)
  809. return 0;
  810. if (n = n ? n : e,
  811. "array" === _type(e)) {
  812. for (r = 0; r < e.length; r++)
  813. if (t.call(n, e[r], r, e) === !1)
  814. return 0
  815. } else
  816. for (r in e)
  817. if (e.hasOwnProperty(r) && t.call(n, e[r], r, e) === !1)
  818. return 0;
  819. return 1
  820. }
  821. function _parse_params(e) {
  822. for (var t, n = {}, r = /\+/g, i = /([^&=]+)=?([^&]*)/g, o = function(e) {
  823. return decodeURIComponent(e.replace(r, " "))
  824. }, a = e.split("?")[1]; t = i.exec(a); )
  825. n[o(t[1])] = o(t[2]);
  826. return n
  827. }
  828. function _set_protocol(e) {
  829. switch (e) {
  830. case "http":
  831. return "http";
  832. case "auto":
  833. return location.protocol.replace(/:/g, "");
  834. case "https":
  835. case void 0:
  836. default:
  837. return "https"
  838. }
  839. }
  840. function _set_request_type(e) {
  841. var t = e || "jsonp"
  842. , n = !1;
  843. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (n = !0),
  844. null == t || "xhr" == t ? n ? "xhr" : "jsonp" : t
  845. }
  846. function _build_url(e) {
  847. return this.client.endpoint + "/projects/" + this.client.projectId + e
  848. }
  849. function _uploadEvent(e, t, n, r, i) {
  850. var o = _build_url.apply(this, ["/events/" + e])
  851. , a = {};
  852. n = n !== !1,
  853. this.client.globalProperties && (a = this.client.globalProperties(e));
  854. for (var c in t)
  855. t.hasOwnProperty(c) && (a[c] = t[c]);
  856. switch (this.client.requestType) {
  857. case "xhr":
  858. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, n, r, i]);
  859. break;
  860. case "jsonp":
  861. var s = JSON.stringify(a)
  862. , l = Keen.Base64.encode(s);
  863. o = o + "?api_key=" + this.client.writeKey,
  864. o = o + "&data=" + l,
  865. o = o + "&modified=" + (new Date).getTime(),
  866. _request.jsonp.apply(this, [o, this.client.writeKey, r, i]);
  867. break;
  868. case "beacon":
  869. var s = JSON.stringify(a)
  870. , l = Keen.Base64.encode(s);
  871. o = o + "?api_key=" + encodeURIComponent(this.client.writeKey),
  872. o = o + "&data=" + encodeURIComponent(l),
  873. o = o + "&modified=" + encodeURIComponent((new Date).getTime()),
  874. o += "&c=clv1",
  875. _request.beacon.apply(this, [o, null, r, i])
  876. }
  877. }
  878. Keen.prototype.configure = function(e) {
  879. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  880. e.protocol = _set_protocol(e.protocol),
  881. e.requestType = _set_request_type(e.requestType),
  882. this.client = {
  883. projectId: e.projectId,
  884. writeKey: e.writeKey,
  885. readKey: e.readKey,
  886. globalProperties: null,
  887. endpoint: e.protocol + "://" + e.host,
  888. requestType: e.requestType
  889. },
  890. Keen.trigger("client", this, e),
  891. this.trigger("ready"),
  892. this
  893. }
  894. ;
  895. var _request = {
  896. xhr: function(e, t, n, r, i, o, a, c) {
  897. if (!i)
  898. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  899. var s = new XMLHttpRequest;
  900. if (s.onreadystatechange = function() {
  901. if (4 == s.readyState)
  902. if (s.status >= 200 && s.status < 300) {
  903. var e;
  904. try {
  905. e = JSON.parse(s.responseText)
  906. } catch (e) {
  907. Keen.log("Could not JSON parse HTTP response: " + s.responseText),
  908. c && c(s, e)
  909. }
  910. a && e && a(e)
  911. } else
  912. Keen.log("HTTP request failed."),
  913. c && c(s, null)
  914. }
  915. ,
  916. s.open(e, t, o),
  917. i && s.setRequestHeader("Authorization", i),
  918. r && s.setRequestHeader("Content-Type", "application/json"),
  919. n)
  920. for (var l in n)
  921. n.hasOwnProperty(l) && s.setRequestHeader(l, n[l]);
  922. var u = r ? JSON.stringify(r) : null;
  923. s.send(u)
  924. },
  925. jsonp: function(e, t, n, r) {
  926. if (!t)
  927. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  928. if (t && e.indexOf("api_key") < 0) {
  929. var i = e.indexOf("?") > 0 ? "&" : "?";
  930. e = e + i + "api_key=" + t
  931. }
  932. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  933. o += "a";
  934. var a = !1;
  935. window[o] = function(e) {
  936. a = !0,
  937. n && e && n(e),
  938. window[o] = void 0
  939. }
  940. ,
  941. e = e + "&jsonp=" + o;
  942. var c = document.createElement("script");
  943. c.id = "keen-jsonp",
  944. c.src = e,
  945. document.getElementsByTagName("head")[0].appendChild(c),
  946. c.onreadystatechange = function() {
  947. a === !1 && "loaded" === this.readyState && (a = !0,
  948. r && r())
  949. }
  950. ,
  951. c.onerror = function() {
  952. a === !1 && (a = !0,
  953. r && r())
  954. }
  955. },
  956. beacon: function(e, t, n, r) {
  957. if (t && e.indexOf("api_key") < 0) {
  958. var i = e.indexOf("?") > 0 ? "&" : "?";
  959. e = e + i + "api_key=" + t
  960. }
  961. var o = !1
  962. , a = document.createElement("img");
  963. a.onload = function() {
  964. if (o = !0,
  965. "naturalHeight"in this) {
  966. if (this.naturalHeight + this.naturalWidth === 0)
  967. return void this.onerror()
  968. } else if (this.width + this.height === 0)
  969. return void this.onerror();
  970. n && n({
  971. created: !0
  972. })
  973. }
  974. ,
  975. a.onerror = function() {
  976. o = !0,
  977. r && r()
  978. }
  979. ,
  980. a.src = e
  981. }
  982. }
  983. , Events = Keen.Events = {
  984. on: function(e, t) {
  985. this.listeners || (this.listeners = {});
  986. var n = this.listeners[e] || (this.listeners[e] = []);
  987. return n.push({
  988. callback: t
  989. }),
  990. this
  991. },
  992. off: function(e, t) {
  993. if (!e && !t)
  994. return this.listeners = void 0,
  995. delete this.listeners,
  996. this;
  997. for (var n = this.listeners[e] || [], r = n.length; r--; )
  998. t && t == n[r].callback && this.listeners[e].splice(r, 1),
  999. t && 0 != n.length || (this.listeners[e] = void 0,
  1000. delete this.listeners[e]);
  1001. return this
  1002. },
  1003. trigger: function(e) {
  1004. if (!this.listeners)
  1005. return this;
  1006. for (var t = Array.prototype.slice.call(arguments, 1), n = this.listeners[e] || [], r = 0; r < n.length; r++)
  1007. n[r].callback.apply(this, t);
  1008. return this
  1009. }
  1010. };
  1011. _extend(Keen.prototype, Events),
  1012. _extend(Keen, Events),
  1013. Keen.loaded = !0,
  1014. Keen.utils = {
  1015. each: _each,
  1016. extend: _extend,
  1017. parseParams: _parse_params
  1018. },
  1019. Keen.ready = function(e) {
  1020. Keen.loaded ? e() : Keen.on("ready", e)
  1021. }
  1022. ,
  1023. Keen.log = function(e) {
  1024. "object" == typeof console && console.log("[Keen IO]", e)
  1025. }
  1026. ;
  1027. var Plugins = Keen.Plugins = {};
  1028. Keen.prototype.addEvent = function() {
  1029. _uploadEvent.apply(this, arguments)
  1030. }
  1031. ,
  1032. Keen.prototype.addEventSync = function(e, t, n, r) {
  1033. _uploadEvent.apply(this, [e, t, !1, n, r])
  1034. }
  1035. ,
  1036. Keen.prototype.trackExternalLink = function(e, t, n, r, i) {
  1037. var o = e
  1038. , a = o.metaKey
  1039. , c = o.target
  1040. , s = !1
  1041. , l = function() {};
  1042. return void 0 === r && (r = 500),
  1043. "A" === c.nodeName ? l = function() {
  1044. a || s || (s = !0,
  1045. window.location = c.href)
  1046. }
  1047. : "FORM" === c.nodeName && (l = function() {
  1048. s || (s = !0,
  1049. c.submit())
  1050. }
  1051. ),
  1052. i && (l = function() {
  1053. s || (s = !0,
  1054. i())
  1055. }
  1056. ),
  1057. _uploadEvent.call(this, t, n, l, l),
  1058. setTimeout(function() {
  1059. l()
  1060. }, r),
  1061. !!a && void 0
  1062. }
  1063. ,
  1064. Keen.prototype.setGlobalProperties = function(e) {
  1065. if (!this.client)
  1066. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1067. if (!e || "function" != typeof e)
  1068. throw new Error("Invalid value for global properties: " + e);
  1069. this.client.globalProperties = e
  1070. }
  1071. ,
  1072. Keen.Base64 = {
  1073. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1074. encode: function(e) {
  1075. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map;
  1076. for (e = this.utf8.encode(e); l < e.length; )
  1077. t = e.charCodeAt(l++),
  1078. n = e.charCodeAt(l++),
  1079. r = e.charCodeAt(l++),
  1080. i = t >> 2,
  1081. o = (3 & t) << 4 | n >> 4,
  1082. a = isNaN(n) ? 64 : (15 & n) << 2 | r >> 6,
  1083. c = isNaN(n) || isNaN(r) ? 64 : 63 & r,
  1084. s = s + u.charAt(i) + u.charAt(o) + u.charAt(a) + u.charAt(c);
  1085. return s
  1086. },
  1087. decode: function(e) {
  1088. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map, f = String.fromCharCode;
  1089. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1090. t = u.indexOf(e.charAt(l++)),
  1091. n = u.indexOf(e.charAt(l++)),
  1092. r = u.indexOf(e.charAt(l++)),
  1093. i = u.indexOf(e.charAt(l++)),
  1094. o = t << 2 | n >> 4,
  1095. a = (15 & n) << 4 | r >> 2,
  1096. c = (3 & r) << 6 | i,
  1097. s = s + (f(o) + (64 != r ? f(a) : "")) + (64 != i ? f(c) : "");
  1098. return this.utf8.decode(s)
  1099. },
  1100. utf8: {
  1101. encode: function(e) {
  1102. for (var t, n = "", r = 0, i = String.fromCharCode; r < e.length; )
  1103. t = e.charCodeAt(r++),
  1104. 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);
  1105. return n
  1106. },
  1107. decode: function(e) {
  1108. for (var t, n, r = "", i = 0, o = String.fromCharCode; i < e.length; )
  1109. n = e.charCodeAt(i),
  1110. 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];
  1111. return r
  1112. }
  1113. }
  1114. },
  1115. "object" != typeof JSON && (JSON = {}),
  1116. function() {
  1117. function f(e) {
  1118. return 10 > e ? "0" + e : e
  1119. }
  1120. function quote(e) {
  1121. return escapable.lastIndex = 0,
  1122. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1123. var t = meta[e];
  1124. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1125. }) + '"' : '"' + e + '"'
  1126. }
  1127. function str(e, t) {
  1128. var n, r, i, o, a, c = gap, s = t[e];
  1129. switch (s && "object" == typeof s && "function" == typeof s.toJSON && (s = s.toJSON(e)),
  1130. "function" == typeof rep && (s = rep.call(t, e, s)),
  1131. typeof s) {
  1132. case "string":
  1133. return quote(s);
  1134. case "number":
  1135. return isFinite(s) ? String(s) : "null";
  1136. case "boolean":
  1137. case "null":
  1138. return String(s);
  1139. case "object":
  1140. if (!s)
  1141. return "null";
  1142. if (gap += indent,
  1143. a = [],
  1144. "[object Array]" === Object.prototype.toString.apply(s)) {
  1145. for (o = s.length,
  1146. n = 0; o > n; n += 1)
  1147. a[n] = str(n, s) || "null";
  1148. return i = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + c + "]" : "[" + a.join(",") + "]",
  1149. gap = c,
  1150. i
  1151. }
  1152. if (rep && "object" == typeof rep)
  1153. for (o = rep.length,
  1154. n = 0; o > n; n += 1)
  1155. "string" == typeof rep[n] && (r = rep[n],
  1156. i = str(r, s),
  1157. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1158. else
  1159. for (r in s)
  1160. Object.prototype.hasOwnProperty.call(s, r) && (i = str(r, s),
  1161. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1162. return i = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + c + "}" : "{" + a.join(",") + "}",
  1163. gap = c,
  1164. i
  1165. }
  1166. }
  1167. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1168. 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
  1169. }
  1170. ,
  1171. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1172. return this.valueOf()
  1173. }
  1174. );
  1175. 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 = {
  1176. "\b": "\\b",
  1177. "\t": "\\t",
  1178. "\n": "\\n",
  1179. "\f": "\\f",
  1180. "\r": "\\r",
  1181. '"': '\\"',
  1182. "\\": "\\\\"
  1183. }, rep;
  1184. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, n) {
  1185. var r;
  1186. if (gap = "",
  1187. indent = "",
  1188. "number" == typeof n)
  1189. for (r = 0; n > r; r += 1)
  1190. indent += " ";
  1191. else
  1192. "string" == typeof n && (indent = n);
  1193. if (rep = t,
  1194. t && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1195. throw new Error("JSON.stringify");
  1196. return str("", {
  1197. "": e
  1198. })
  1199. }
  1200. ),
  1201. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1202. function walk(e, t) {
  1203. var n, r, i = e[t];
  1204. if (i && "object" == typeof i)
  1205. for (n in i)
  1206. Object.prototype.hasOwnProperty.call(i, n) && (r = walk(i, n),
  1207. void 0 !== r ? i[n] = r : delete i[n]);
  1208. return reviver.call(e, t, i)
  1209. }
  1210. var j;
  1211. if (text = String(text),
  1212. cx.lastIndex = 0,
  1213. cx.test(text) && (text = text.replace(cx, function(e) {
  1214. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1215. })),
  1216. /^[\],:{}\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, "")))
  1217. return j = eval("(" + text + ")"),
  1218. "function" == typeof reviver ? walk({
  1219. "": j
  1220. }, "") : j;
  1221. throw new SyntaxError("JSON.parse")
  1222. }
  1223. )
  1224. }(),
  1225. !function(e, t, n) {
  1226. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  1227. }("domready", Keen.utils, function(e) {
  1228. function t(e) {
  1229. for (d = 1; e = r.shift(); )
  1230. e()
  1231. }
  1232. 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]);
  1233. return o[l] && o[l](s, n = function() {
  1234. o.removeEventListener(s, n, i),
  1235. t()
  1236. }
  1237. , i),
  1238. c && o.attachEvent(u, n = function() {
  1239. /^c/.test(o[f]) && (o.detachEvent(u, n),
  1240. t())
  1241. }
  1242. ),
  1243. e = c ? function(t) {
  1244. self != top ? d ? t() : r.push(t) : function() {
  1245. try {
  1246. a.doScroll("left")
  1247. } catch (n) {
  1248. return setTimeout(function() {
  1249. e(t)
  1250. }, 50)
  1251. }
  1252. t()
  1253. }()
  1254. }
  1255. : function(e) {
  1256. d ? e() : r.push(e)
  1257. }
  1258. });
  1259. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1260. if (loaded && cached) {
  1261. clients = cached.clients || {},
  1262. ready = cached.ready || [];
  1263. for (var instance in clients)
  1264. if (clients.hasOwnProperty(instance)) {
  1265. var client = clients[instance];
  1266. for (var method in Keen.prototype)
  1267. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1268. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1269. ,
  1270. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1271. ,
  1272. client._config && (client.configure.call(client, client._config),
  1273. delete client._config),
  1274. client._setGlobalProperties) {
  1275. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1276. client.setGlobalProperties.apply(client, globals[i]);
  1277. delete client._setGlobalProperties
  1278. }
  1279. if (client._addEvent) {
  1280. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1281. client.addEvent.apply(client, queue[i]);
  1282. delete client._addEvent
  1283. }
  1284. var callback = client._on || [];
  1285. if (client._on) {
  1286. for (var i = 0; i < callback.length; i++)
  1287. client.on.apply(client, callback[i]);
  1288. client.trigger("ready"),
  1289. delete client._on
  1290. }
  1291. }
  1292. for (var i = 0; i < ready.length; i++) {
  1293. var callback = ready[i];
  1294. Keen.on("ready", function() {
  1295. callback()
  1296. })
  1297. }
  1298. }
  1299. return Keen.loaded && setTimeout(function() {
  1300. Keen.utils.domready(function() {
  1301. Keen.trigger("ready")
  1302. })
  1303. }, 0),
  1304. Keen
  1305. });
  1306. !function() {
  1307. var t = window.analytics = window.analytics || [];
  1308. if (!t.initialize) {
  1309. if (t.invoked)
  1310. return void (window.console && console.error && console.error("Segment snippet included twice."));
  1311. t.invoked = !0,
  1312. t.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1313. t.factory = function(e) {
  1314. return function() {
  1315. var n = Array.prototype.slice.call(arguments);
  1316. return n.unshift(e),
  1317. t.push(n),
  1318. t
  1319. }
  1320. }
  1321. ;
  1322. for (var e = 0; e < t.methods.length; e++) {
  1323. var n = t.methods[e];
  1324. t[n] = t.factory(n)
  1325. }
  1326. t.load = function(t) {
  1327. var e = document.createElement("script");
  1328. e.type = "text/javascript",
  1329. e.async = !0,
  1330. e.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + t + "/analytics.min.js";
  1331. var n = document.getElementsByTagName("script")[0];
  1332. n.parentNode.insertBefore(e, n)
  1333. }
  1334. ,
  1335. t.SNIPPET_VERSION = "4.0.0"
  1336. }
  1337. }();
  1338. !function(i, e) {
  1339. "use strict";
  1340. var s = ""
  1341. , r = "?"
  1342. , o = "function"
  1343. , a = "undefined"
  1344. , n = "object"
  1345. , t = "major"
  1346. , d = "model"
  1347. , w = "name"
  1348. , l = "type"
  1349. , p = "vendor"
  1350. , m = "version"
  1351. , c = "architecture"
  1352. , u = "console"
  1353. , g = "mobile"
  1354. , f = "tablet"
  1355. , h = "smarttv"
  1356. , b = {
  1357. has: function(i, e) {
  1358. return e.toLowerCase().indexOf(i.toLowerCase()) !== -1
  1359. },
  1360. lowerize: function(i) {
  1361. return i.toLowerCase()
  1362. }
  1363. }
  1364. , y = {
  1365. rgx: function() {
  1366. for (var i, s, r, t, d, w, l, p = 0, m = arguments; p < m.length; p += 2) {
  1367. var c = m[p]
  1368. , u = m[p + 1];
  1369. if (typeof i === a) {
  1370. i = {};
  1371. for (t in u)
  1372. d = u[t],
  1373. typeof d === n ? i[d[0]] = e : i[d] = e
  1374. }
  1375. for (s = r = 0; s < c.length; s++)
  1376. if (w = c[s].exec(this.getUA())) {
  1377. for (t = 0; t < u.length; t++)
  1378. l = w[++r],
  1379. d = u[t],
  1380. 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;
  1381. break
  1382. }
  1383. if (w)
  1384. break
  1385. }
  1386. return i
  1387. },
  1388. str: function(i, s) {
  1389. for (var o in s)
  1390. if (typeof s[o] === n && s[o].length > 0) {
  1391. for (var a = 0; a < s[o].length; a++)
  1392. if (b.has(s[o][a], i))
  1393. return o === r ? e : o
  1394. } else if (b.has(s[o], i))
  1395. return o === r ? e : o;
  1396. return i
  1397. }
  1398. }
  1399. , v = {
  1400. browser: {
  1401. oldsafari: {
  1402. major: {
  1403. 1: ["/8", "/1", "/3"],
  1404. 2: "/4",
  1405. "?": "/"
  1406. },
  1407. version: {
  1408. "1.0": "/8",
  1409. 1.2: "/1",
  1410. 1.3: "/3",
  1411. "2.0": "/412",
  1412. "2.0.2": "/416",
  1413. "2.0.3": "/417",
  1414. "2.0.4": "/419",
  1415. "?": "/"
  1416. }
  1417. }
  1418. },
  1419. device: {
  1420. sprint: {
  1421. model: {
  1422. "Evo Shift 4G": "7373KT"
  1423. },
  1424. vendor: {
  1425. HTC: "APA",
  1426. Sprint: "Sprint"
  1427. }
  1428. }
  1429. },
  1430. os: {
  1431. windows: {
  1432. version: {
  1433. ME: "4.90",
  1434. "NT 3.11": "NT3.51",
  1435. "NT 4.0": "NT4.0",
  1436. 2e3: "NT 5.0",
  1437. XP: ["NT 5.1", "NT 5.2"],
  1438. Vista: "NT 6.0",
  1439. 7: "NT 6.1",
  1440. 8: "NT 6.2",
  1441. 8.1: "NT 6.3",
  1442. RT: "ARM"
  1443. }
  1444. }
  1445. }
  1446. }
  1447. , k = {
  1448. 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]],
  1449. 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]],
  1450. 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]],
  1451. 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]],
  1452. 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]]
  1453. }
  1454. , x = function(e) {
  1455. var r = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : s);
  1456. return this instanceof x ? (this.getBrowser = function() {
  1457. return y.rgx.apply(this, k.browser)
  1458. }
  1459. ,
  1460. this.getCPU = function() {
  1461. return y.rgx.apply(this, k.cpu)
  1462. }
  1463. ,
  1464. this.getDevice = function() {
  1465. return y.rgx.apply(this, k.device)
  1466. }
  1467. ,
  1468. this.getEngine = function() {
  1469. return y.rgx.apply(this, k.engine)
  1470. }
  1471. ,
  1472. this.getOS = function() {
  1473. return y.rgx.apply(this, k.os)
  1474. }
  1475. ,
  1476. this.getResult = function() {
  1477. return {
  1478. ua: this.getUA(),
  1479. browser: this.getBrowser(),
  1480. engine: this.getEngine(),
  1481. os: this.getOS(),
  1482. device: this.getDevice(),
  1483. cpu: this.getCPU()
  1484. }
  1485. }
  1486. ,
  1487. this.getUA = function() {
  1488. return r
  1489. }
  1490. ,
  1491. this.setUA = function(i) {
  1492. return r = i,
  1493. this
  1494. }
  1495. ,
  1496. void this.setUA(r)) : new x(e).getResult()
  1497. };
  1498. if (typeof exports !== a)
  1499. typeof module !== a && module.exports && (exports = module.exports = x),
  1500. exports.UAParser = x;
  1501. else if (i.UAParser = x,
  1502. typeof define === o && define.amd && define(function() {
  1503. return x
  1504. }),
  1505. typeof i.jQuery !== a) {
  1506. var A = i.jQuery
  1507. , _ = new x;
  1508. A.ua = _.getResult(),
  1509. A.ua.get = function() {
  1510. return _.getUA()
  1511. }
  1512. ,
  1513. A.ua.set = function(i) {
  1514. _.setUA(i);
  1515. var e = _.getResult();
  1516. for (var s in e)
  1517. A.ua[s] = e[s]
  1518. }
  1519. }
  1520. }(this);
  1521. window.Modernizr = function(n, e, t) {
  1522. function o(n) {
  1523. d.cssText = n
  1524. }
  1525. function r(n, e) {
  1526. return typeof n === e
  1527. }
  1528. var i, c, u, a = "2.8.2", f = {}, s = e.documentElement, l = "modernizr", p = e.createElement(l), d = p.style, y = ({}.toString,
  1529. {}), w = [], b = w.slice, v = {}.hasOwnProperty;
  1530. u = r(v, "undefined") || r(v.call, "undefined") ? function(n, e) {
  1531. return e in n && r(n.constructor.prototype[e], "undefined")
  1532. }
  1533. : function(n, e) {
  1534. return v.call(n, e)
  1535. }
  1536. ,
  1537. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1538. var e = this;
  1539. if ("function" != typeof e)
  1540. throw new TypeError;
  1541. var t = b.call(arguments, 1)
  1542. , o = function() {
  1543. if (this instanceof o) {
  1544. var r = function() {};
  1545. r.prototype = e.prototype;
  1546. var i = new r
  1547. , c = e.apply(i, t.concat(b.call(arguments)));
  1548. return Object(c) === c ? c : i
  1549. }
  1550. return e.apply(n, t.concat(b.call(arguments)))
  1551. };
  1552. return o
  1553. }
  1554. ),
  1555. y.webgl = function() {
  1556. return !!n.WebGLRenderingContext
  1557. }
  1558. ;
  1559. for (var h in y)
  1560. u(y, h) && (c = h.toLowerCase(),
  1561. f[c] = y[h](),
  1562. w.push((f[c] ? "" : "no-") + c));
  1563. return f.addTest = function(n, e) {
  1564. if ("object" == typeof n)
  1565. for (var o in n)
  1566. u(n, o) && f.addTest(o, n[o]);
  1567. else {
  1568. if (n = n.toLowerCase(),
  1569. f[n] !== t)
  1570. return f;
  1571. e = "function" == typeof e ? e() : e,
  1572. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (e ? "" : "no-") + n),
  1573. f[n] = e
  1574. }
  1575. return f
  1576. }
  1577. ,
  1578. o(""),
  1579. p = i = null,
  1580. f._version = a,
  1581. f
  1582. }(this, this.document);
  1583. !function(e, t, a) {
  1584. "use strict";
  1585. function n(t, h, m) {
  1586. function H(a) {
  1587. var n = 0
  1588. , i = Ee.length;
  1589. if (Ce.old = e.extend({}, Ce),
  1590. Ie = we ? 0 : be[ge.horizontal ? "width" : "height"](),
  1591. ke = Be[ge.horizontal ? "width" : "height"](),
  1592. ze = we ? t : Pe[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1593. Ee.length = 0,
  1594. Ce.start = 0,
  1595. Ce.end = q(ze - Ie, 0),
  1596. Re) {
  1597. n = Ne.length,
  1598. qe = Pe.children(ge.itemSelector),
  1599. Ne.length = 0;
  1600. 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;
  1601. ze = 0,
  1602. qe.each(function(t, a) {
  1603. var n = e(a)
  1604. , i = a.getBoundingClientRect()
  1605. , l = E(ge.horizontal ? i.width || i.right - i.left : i.height || i.bottom - i.top)
  1606. , d = c(n, ge.horizontal ? "marginLeft" : "marginTop")
  1607. , p = c(n, ge.horizontal ? "marginRight" : "marginBottom")
  1608. , h = l + d + p
  1609. , m = !d || !p
  1610. , g = {};
  1611. g.el = a,
  1612. g.size = m ? l : h,
  1613. g.half = g.size / 2,
  1614. g.start = ze + (m ? d : 0),
  1615. g.center = g.start - E(Ie / 2 - g.size / 2),
  1616. g.end = g.start - Ie + g.size,
  1617. t || (ze += s),
  1618. ze += h,
  1619. ge.horizontal || u || p && d && t > 0 && (ze -= N(d, p)),
  1620. t === v && (g.end += o,
  1621. ze += o,
  1622. f = m ? p : 0),
  1623. Ne.push(g),
  1624. r = g
  1625. }),
  1626. Pe[0].style[ge.horizontal ? "width" : "height"] = (l ? ze : ze - s - o) + "px",
  1627. ze -= f,
  1628. Ne.length ? (Ce.start = Ne[0][Me ? "center" : "start"],
  1629. Ce.end = Me ? r.center : ze > Ie ? r.end : Ce.start) : Ce.start = Ce.end = 0
  1630. }
  1631. if (Ce.center = E(Ce.end / 2 + Ce.start / 2),
  1632. Q(),
  1633. Se.length && ke > 0 && (ge.dynamicHandle ? (Te = Ce.start === Ce.end ? ke : E(ke * Ie / ze),
  1634. Te = d(Te, ge.minHandleSize, ke),
  1635. Se[0].style[ge.horizontal ? "width" : "height"] = Te + "px") : Te = Se[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1636. xe.end = ke - Te,
  1637. it || j()),
  1638. !we && Ie > 0) {
  1639. var p = Ce.start
  1640. , h = "";
  1641. if (Re)
  1642. e.each(Ne, function(e, t) {
  1643. Me ? Ee.push(t.center) : t.start + t.size > p && p <= Ce.end && (p = t.start,
  1644. Ee.push(p),
  1645. p += Ie,
  1646. p > Ce.end && p < Ce.end + Ie && Ee.push(Ce.end))
  1647. });
  1648. else
  1649. for (; p - Ie < Ce.end; )
  1650. Ee.push(p),
  1651. p += Ie;
  1652. if (De[0] && i !== Ee.length) {
  1653. for (var m = 0; m < Ee.length; m++)
  1654. h += ge.pageBuilder.call(ye, m);
  1655. Ae = De.html(h).children(),
  1656. Ae.eq(Oe.activePage).addClass(ge.activeClass)
  1657. }
  1658. }
  1659. if (Oe.slideeSize = ze,
  1660. Oe.frameSize = Ie,
  1661. Oe.sbSize = ke,
  1662. Oe.handleSize = Te,
  1663. Re) {
  1664. a && null != ge.startAt && (W(ge.startAt),
  1665. ye[Le ? "toCenter" : "toStart"](ge.startAt));
  1666. var g = Ne[Oe.activeItem];
  1667. X(Le && g ? g.center : d(Ce.dest, Ce.start, Ce.end))
  1668. } else
  1669. a ? null != ge.startAt && X(ge.startAt, 1) : X(d(Ce.dest, Ce.start, Ce.end));
  1670. pe("load")
  1671. }
  1672. function X(e, t, a) {
  1673. if (Re && at.released && !a) {
  1674. var n = $(e)
  1675. , i = e > Ce.start && e < Ce.end;
  1676. Le ? (i && (e = Ne[n.centerItem].center),
  1677. Me && ge.activateMiddle && W(n.centerItem)) : i && (e = Ne[n.firstItem].start)
  1678. }
  1679. 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),
  1680. et.start = +new Date,
  1681. et.time = 0,
  1682. et.from = Ce.cur,
  1683. et.to = e,
  1684. et.delta = e - Ce.cur,
  1685. et.tweesing = at.tweese || at.init && !at.slidee,
  1686. et.immediate = !et.tweesing && (t || at.init && at.slidee || !ge.speed),
  1687. at.tweese = 0,
  1688. e !== Ce.dest && (Ce.dest = e,
  1689. pe("change"),
  1690. it || Y()),
  1691. K(),
  1692. Q(),
  1693. Z(),
  1694. F()
  1695. }
  1696. function Y() {
  1697. if (ye.initialized) {
  1698. if (!it)
  1699. return it = w(Y),
  1700. void (at.released && pe("moveStart"));
  1701. et.immediate ? Ce.cur = et.to : et.tweesing ? (et.tweeseDelta = et.to - Ce.cur,
  1702. 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),
  1703. Ce.cur = et.from + et.delta * e.easing[ge.easing](et.time / ge.speed, et.time, 0, 1, ge.speed)),
  1704. et.to === Ce.cur ? (Ce.cur = et.to,
  1705. at.tweese = it = 0) : it = w(Y),
  1706. pe("move"),
  1707. 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"),
  1708. !it && at.released && pe("moveEnd"),
  1709. j()
  1710. }
  1711. }
  1712. function j() {
  1713. 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,
  1714. xe.cur = d(E(xe.cur), xe.start, xe.end),
  1715. _e.hPos !== xe.cur && (_e.hPos = xe.cur,
  1716. f ? Se[0].style[f] = v + (ge.horizontal ? "translateX" : "translateY") + "(" + xe.cur + "px)" : Se[0].style[ge.horizontal ? "left" : "top"] = xe.cur + "px"))
  1717. }
  1718. function F() {
  1719. Ae[0] && _e.page !== Oe.activePage && (_e.page = Oe.activePage,
  1720. Ae.removeClass(ge.activeClass).eq(Oe.activePage).addClass(ge.activeClass),
  1721. pe("activePage", _e.page))
  1722. }
  1723. function M() {
  1724. tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) || ye.stop(),
  1725. ot = at.init ? w(M) : 0,
  1726. tt.now = +new Date,
  1727. tt.pos = Ce.cur + (tt.now - tt.lastTime) / 1e3 * tt.speed,
  1728. X(at.init ? tt.pos : E(tt.pos)),
  1729. at.init || Ce.cur !== Ce.dest || pe("moveEnd"),
  1730. tt.lastTime = tt.now
  1731. }
  1732. function L(e, t, n) {
  1733. if ("boolean" === i(t) && (n = t,
  1734. t = a),
  1735. t === a)
  1736. X(Ce[e], n);
  1737. else {
  1738. if (Le && "center" !== e)
  1739. return;
  1740. var r = ye.getPos(t);
  1741. r && X(r[e], n, !Le)
  1742. }
  1743. }
  1744. function R(e) {
  1745. return null != e ? l(e) ? e >= 0 && e < Ne.length ? e : -1 : qe.index(e) : -1
  1746. }
  1747. function U(e) {
  1748. return R(l(e) && 0 > e ? e + Ne.length : e)
  1749. }
  1750. function W(e, t) {
  1751. var a = R(e);
  1752. return !(!Re || 0 > a) && ((_e.active !== a || t) && (qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  1753. qe.eq(a).addClass(ge.activeClass),
  1754. _e.active = Oe.activeItem = a,
  1755. Z(),
  1756. pe("active", a)),
  1757. a)
  1758. }
  1759. function $(e) {
  1760. e = d(l(e) ? e : Ce.dest, Ce.start, Ce.end);
  1761. var t = {}
  1762. , a = Me ? 0 : Ie / 2;
  1763. if (!we)
  1764. for (var n = 0, i = Ee.length; i > n; n++) {
  1765. if (e >= Ce.end || n === Ee.length - 1) {
  1766. t.activePage = Ee.length - 1;
  1767. break
  1768. }
  1769. if (e <= Ee[n] + a) {
  1770. t.activePage = n;
  1771. break
  1772. }
  1773. }
  1774. if (Re) {
  1775. for (var r = !1, s = !1, o = !1, c = 0, u = Ne.length; u > c; c++)
  1776. if (r === !1 && e <= Ne[c].start + Ne[c].half && (r = c),
  1777. o === !1 && e <= Ne[c].center + Ne[c].half && (o = c),
  1778. c === u - 1 || e <= Ne[c].end + Ne[c].half) {
  1779. s = c;
  1780. break
  1781. }
  1782. t.firstItem = l(r) ? r : 0,
  1783. t.centerItem = l(o) ? o : t.firstItem,
  1784. t.lastItem = l(s) ? s : t.centerItem
  1785. }
  1786. return t
  1787. }
  1788. function Q(t) {
  1789. e.extend(Oe, $(t))
  1790. }
  1791. function Z() {
  1792. var e = Ce.dest <= Ce.start
  1793. , t = Ce.dest >= Ce.end
  1794. , a = (e ? 1 : 0) | (t ? 2 : 0);
  1795. if (_e.slideePosState !== a && (_e.slideePosState = a,
  1796. Je.is("button,input") && Je.prop("disabled", e),
  1797. Ke.is("button,input") && Ke.prop("disabled", t),
  1798. Je.add(Qe)[e ? "addClass" : "removeClass"](ge.disabledClass),
  1799. Ke.add($e)[t ? "addClass" : "removeClass"](ge.disabledClass)),
  1800. _e.fwdbwdState !== a && at.released && (_e.fwdbwdState = a,
  1801. Qe.is("button,input") && Qe.prop("disabled", e),
  1802. $e.is("button,input") && $e.prop("disabled", t)),
  1803. Re && null != Oe.activeItem) {
  1804. var n = 0 === Oe.activeItem
  1805. , i = Oe.activeItem >= Ne.length - 1
  1806. , r = (n ? 1 : 0) | (i ? 2 : 0);
  1807. _e.itemsButtonState !== r && (_e.itemsButtonState = r,
  1808. Ze.is("button,input") && Ze.prop("disabled", n),
  1809. Ge.is("button,input") && Ge.prop("disabled", i),
  1810. Ze[n ? "addClass" : "removeClass"](ge.disabledClass),
  1811. Ge[i ? "addClass" : "removeClass"](ge.disabledClass))
  1812. }
  1813. }
  1814. function G(e, t, a) {
  1815. if (e = U(e),
  1816. t = U(t),
  1817. e > -1 && t > -1 && e !== t && (!a || t !== e - 1) && (a || t !== e + 1)) {
  1818. qe.eq(e)[a ? "insertAfter" : "insertBefore"](Ne[t].el);
  1819. var n = t > e ? e : a ? t : t - 1
  1820. , i = e > t ? e : a ? t + 1 : t
  1821. , r = e > t;
  1822. 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)),
  1823. H()
  1824. }
  1825. }
  1826. function J(e, t) {
  1827. for (var a = 0, n = Ve[e].length; n > a; a++)
  1828. if (Ve[e][a] === t)
  1829. return a;
  1830. return -1
  1831. }
  1832. function K() {
  1833. at.released && !ye.isPaused && ye.resume()
  1834. }
  1835. function V(e) {
  1836. return E(d(e, xe.start, xe.end) / xe.end * (Ce.end - Ce.start)) + Ce.start
  1837. }
  1838. function _() {
  1839. at.history[0] = at.history[1],
  1840. at.history[1] = at.history[2],
  1841. at.history[2] = at.history[3],
  1842. at.history[3] = at.delta
  1843. }
  1844. function ee(e) {
  1845. at.released = 0,
  1846. at.source = e,
  1847. at.slidee = "slidee" === e
  1848. }
  1849. function te(t) {
  1850. var a = "touchstart" === t.type
  1851. , n = t.data.source
  1852. , i = "slidee" === n;
  1853. 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),
  1854. ee(n),
  1855. at.init = 0,
  1856. at.$source = e(t.target),
  1857. at.touch = a,
  1858. at.pointer = a ? t.originalEvent.touches[0] : t,
  1859. at.initX = at.pointer.pageX,
  1860. at.initY = at.pointer.pageY,
  1861. at.initPos = i ? Ce.cur : xe.cur,
  1862. at.start = +new Date,
  1863. at.time = 0,
  1864. at.path = 0,
  1865. at.delta = 0,
  1866. at.locked = 0,
  1867. at.history = [0, 0, 0, 0],
  1868. at.pathToLock = i ? a ? 30 : 10 : 0,
  1869. b.on(a ? z : I, ae),
  1870. ye.pause(1),
  1871. (i ? Pe : Se).addClass(ge.draggedClass),
  1872. pe("moveStart"),
  1873. i && (rt = setInterval(_, 10)))
  1874. }
  1875. function ae(e) {
  1876. if (at.released = "mouseup" === e.type || "touchend" === e.type,
  1877. at.pointer = at.touch ? e.originalEvent[at.released ? "changedTouches" : "touches"][0] : e,
  1878. at.pathX = at.pointer.pageX - at.initX,
  1879. at.pathY = at.pointer.pageY - at.initY,
  1880. at.path = D(A(at.pathX, 2) + A(at.pathY, 2)),
  1881. at.delta = ge.horizontal ? at.pathX : at.pathY,
  1882. at.released || !(at.path < 1)) {
  1883. if (!at.init) {
  1884. if (!(ge.horizontal ? x(at.pathX) > x(at.pathY) : x(at.pathX) < x(at.pathY)))
  1885. return ne();
  1886. at.init = 1
  1887. }
  1888. r(e),
  1889. !at.locked && at.path > at.pathToLock && at.slidee && (at.locked = 1,
  1890. at.$source.on(B, s)),
  1891. at.released && (ne(),
  1892. ge.releaseSwing && at.slidee && (at.swing = (at.delta - at.history[0]) / 40 * 300,
  1893. at.delta += at.swing,
  1894. at.tweese = x(at.swing) > 10)),
  1895. X(at.slidee ? E(at.initPos - at.delta) : V(at.initPos + at.delta))
  1896. }
  1897. }
  1898. function ne() {
  1899. clearInterval(rt),
  1900. at.released = !0,
  1901. b.off(at.touch ? z : I, ae),
  1902. (at.slidee ? Pe : Se).removeClass(ge.draggedClass),
  1903. setTimeout(function() {
  1904. at.$source.off(B, s)
  1905. }),
  1906. Ce.cur === Ce.dest && at.init && pe("moveEnd"),
  1907. ye.resume(1),
  1908. at.init = 0
  1909. }
  1910. function ie(t) {
  1911. return ~e.inArray(t.nodeName, k) || e(t).is(ge.interactive)
  1912. }
  1913. function re() {
  1914. ye.stop(),
  1915. b.off("mouseup", re)
  1916. }
  1917. function se(e) {
  1918. switch (r(e),
  1919. this) {
  1920. case $e[0]:
  1921. case Qe[0]:
  1922. ye.moveBy($e.is(this) ? ge.moveBy : -ge.moveBy),
  1923. b.on("mouseup", re);
  1924. break;
  1925. case Ze[0]:
  1926. ye.prev();
  1927. break;
  1928. case Ge[0]:
  1929. ye.next();
  1930. break;
  1931. case Je[0]:
  1932. ye.prevPage();
  1933. break;
  1934. case Ke[0]:
  1935. ye.nextPage()
  1936. }
  1937. }
  1938. function oe(e) {
  1939. return nt.curDelta = (ge.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  1940. nt.curDelta /= 1 === e.deltaMode ? 3 : 100,
  1941. Re ? (p = +new Date,
  1942. nt.last < p - nt.resetTime && (nt.delta = 0),
  1943. nt.last = p,
  1944. nt.delta += nt.curDelta,
  1945. x(nt.delta) < 1 ? nt.finalDelta = 0 : (nt.finalDelta = E(nt.delta / 1),
  1946. nt.delta %= 1),
  1947. nt.finalDelta) : nt.curDelta
  1948. }
  1949. function le(e) {
  1950. e.originalEvent[g] = ye;
  1951. var t = +new Date;
  1952. if (O + ge.scrollHijack > t && Ue[0] !== document && Ue[0] !== window)
  1953. return void (O = t);
  1954. if (ge.scrollBy && Ce.start !== Ce.end) {
  1955. var a = oe(e.originalEvent);
  1956. (ge.scrollTrap || a > 0 && Ce.dest < Ce.end || 0 > a && Ce.dest > Ce.start) && r(e, 1),
  1957. ye.slideBy(ge.scrollBy * a)
  1958. }
  1959. }
  1960. function ce(e) {
  1961. ge.clickBar && e.target === Be[0] && (r(e),
  1962. X(V((ge.horizontal ? e.pageX - Be.offset().left : e.pageY - Be.offset().top) - Te / 2)))
  1963. }
  1964. function de(e) {
  1965. if (ge.keyboardNavBy)
  1966. switch (e.which) {
  1967. case ge.horizontal ? 37 : 38:
  1968. r(e),
  1969. ye["pages" === ge.keyboardNavBy ? "prevPage" : "prev"]();
  1970. break;
  1971. case ge.horizontal ? 39 : 40:
  1972. r(e),
  1973. ye["pages" === ge.keyboardNavBy ? "nextPage" : "next"]()
  1974. }
  1975. }
  1976. function ue(e) {
  1977. return ie(this) ? void (e.originalEvent[g + "ignore"] = !0) : void (this.parentNode !== Pe[0] || e.originalEvent[g + "ignore"] || ye.activate(this))
  1978. }
  1979. function fe() {
  1980. this.parentNode === De[0] && ye.activatePage(Ae.index(this))
  1981. }
  1982. function ve(e) {
  1983. ge.pauseOnHover && ye["mouseenter" === e.type ? "pause" : "resume"](2)
  1984. }
  1985. function pe(e, t) {
  1986. if (Ve[e]) {
  1987. for (me = Ve[e].length,
  1988. T.length = 0,
  1989. he = 0; me > he; he++)
  1990. T.push(Ve[e][he]);
  1991. for (he = 0; me > he; he++)
  1992. T[he].call(ye, e, t)
  1993. }
  1994. }
  1995. 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 = {
  1996. start: 0,
  1997. center: 0,
  1998. end: 0,
  1999. cur: 0,
  2000. dest: 0
  2001. }, Be = e(ge.scrollBar).eq(0), Se = Be.children().eq(0), ke = 0, Te = 0, xe = {
  2002. start: 0,
  2003. end: 0,
  2004. cur: 0
  2005. }, De = e(ge.pagesBar), Ae = 0, Ee = [], qe = 0, Ne = [], Oe = {
  2006. firstItem: 0,
  2007. lastItem: 0,
  2008. centerItem: 0,
  2009. activeItem: null,
  2010. activePage: 0
  2011. }, 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 = {
  2012. released: 1
  2013. }, nt = {
  2014. last: 0,
  2015. delta: 0,
  2016. resetTime: 200
  2017. }, it = 0, rt = 0, st = 0, ot = 0;
  2018. we || (t = be[0]),
  2019. ye.initialized = 0,
  2020. ye.frame = t,
  2021. ye.slidee = Pe[0],
  2022. ye.pos = Ce,
  2023. ye.rel = Oe,
  2024. ye.items = Ne,
  2025. ye.pages = Ee,
  2026. ye.isPaused = 0,
  2027. ye.options = ge,
  2028. ye.dragging = at,
  2029. ye.reload = function() {
  2030. H()
  2031. }
  2032. ,
  2033. ye.getPos = function(e) {
  2034. if (Re) {
  2035. var t = R(e);
  2036. return -1 !== t && Ne[t]
  2037. }
  2038. var a = Pe.find(e).eq(0);
  2039. if (a[0]) {
  2040. var n = ge.horizontal ? a.offset().left - Pe.offset().left : a.offset().top - Pe.offset().top
  2041. , i = a[ge.horizontal ? "outerWidth" : "outerHeight"]();
  2042. return {
  2043. start: n,
  2044. center: n - Ie / 2 + i / 2,
  2045. end: n - Ie + i,
  2046. size: i
  2047. }
  2048. }
  2049. return !1
  2050. }
  2051. ,
  2052. ye.moveBy = function(e) {
  2053. tt.speed = e,
  2054. !at.init && tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) && (tt.lastTime = +new Date,
  2055. tt.startPos = Ce.cur,
  2056. ee("button"),
  2057. at.init = 1,
  2058. pe("moveStart"),
  2059. y(ot),
  2060. M())
  2061. }
  2062. ,
  2063. ye.stop = function() {
  2064. "button" === at.source && (at.init = 0,
  2065. at.released = 1)
  2066. }
  2067. ,
  2068. ye.prev = function() {
  2069. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem - 1)
  2070. }
  2071. ,
  2072. ye.next = function() {
  2073. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem + 1)
  2074. }
  2075. ,
  2076. ye.prevPage = function() {
  2077. ye.activatePage(Oe.activePage - 1)
  2078. }
  2079. ,
  2080. ye.nextPage = function() {
  2081. ye.activatePage(Oe.activePage + 1)
  2082. }
  2083. ,
  2084. ye.slideBy = function(e, t) {
  2085. e && (Re ? ye[Le ? "toCenter" : "toStart"](d((Le ? Oe.centerItem : Oe.firstItem) + ge.scrollBy * e, 0, Ne.length)) : X(Ce.dest + e, t))
  2086. }
  2087. ,
  2088. ye.slideTo = function(e, t) {
  2089. X(e, t)
  2090. }
  2091. ,
  2092. ye.toStart = function(e, t) {
  2093. L("start", e, t)
  2094. }
  2095. ,
  2096. ye.toEnd = function(e, t) {
  2097. L("end", e, t)
  2098. }
  2099. ,
  2100. ye.toCenter = function(e, t) {
  2101. L("center", e, t)
  2102. }
  2103. ,
  2104. ye.getIndex = R,
  2105. ye.activate = function(e, t) {
  2106. var a = W(e);
  2107. ge.smart && a !== !1 && (Le ? ye.toCenter(a, t) : a >= Oe.lastItem ? ye.toStart(a, t) : a <= Oe.firstItem ? ye.toEnd(a, t) : K())
  2108. }
  2109. ,
  2110. ye.activatePage = function(e, t) {
  2111. l(e) && X(Ee[d(e, 0, Ee.length - 1)], t)
  2112. }
  2113. ,
  2114. ye.resume = function(e) {
  2115. ge.cycleBy && ge.cycleInterval && ("items" !== ge.cycleBy || Ne[0] && null != Oe.activeItem) && !(e < ye.isPaused) && (ye.isPaused = 0,
  2116. st ? st = clearTimeout(st) : pe("resume"),
  2117. st = setTimeout(function() {
  2118. switch (pe("cycle"),
  2119. ge.cycleBy) {
  2120. case "items":
  2121. ye.activate(Oe.activeItem >= Ne.length - 1 ? 0 : Oe.activeItem + 1);
  2122. break;
  2123. case "pages":
  2124. ye.activatePage(Oe.activePage >= Ee.length - 1 ? 0 : Oe.activePage + 1)
  2125. }
  2126. }, ge.cycleInterval))
  2127. }
  2128. ,
  2129. ye.pause = function(e) {
  2130. e < ye.isPaused || (ye.isPaused = e || 100,
  2131. st && (st = clearTimeout(st),
  2132. pe("pause")))
  2133. }
  2134. ,
  2135. ye.toggle = function() {
  2136. ye[st ? "pause" : "resume"]()
  2137. }
  2138. ,
  2139. ye.set = function(t, a) {
  2140. e.isPlainObject(t) ? e.extend(ge, t) : ge.hasOwnProperty(t) && (ge[t] = a)
  2141. }
  2142. ,
  2143. ye.add = function(t, a) {
  2144. var n = e(t);
  2145. Re ? (null == a || !Ne[0] || a >= Ne.length ? n.appendTo(Pe) : Ne.length && n.insertBefore(Ne[a].el),
  2146. null != Oe.activeItem && a <= Oe.activeItem && (_e.active = Oe.activeItem += n.length)) : Pe.append(n),
  2147. H()
  2148. }
  2149. ,
  2150. ye.remove = function(t) {
  2151. if (Re) {
  2152. var a = U(t);
  2153. if (a > -1) {
  2154. qe.eq(a).remove();
  2155. var n = a === Oe.activeItem;
  2156. null != Oe.activeItem && a < Oe.activeItem && (_e.active = --Oe.activeItem),
  2157. H(),
  2158. n && (_e.active = null,
  2159. ye.activate(Oe.activeItem))
  2160. }
  2161. } else
  2162. e(t).remove(),
  2163. H()
  2164. }
  2165. ,
  2166. ye.moveAfter = function(e, t) {
  2167. G(e, t, 1)
  2168. }
  2169. ,
  2170. ye.moveBefore = function(e, t) {
  2171. G(e, t)
  2172. }
  2173. ,
  2174. ye.on = function(e, t) {
  2175. if ("object" === i(e))
  2176. for (var a in e)
  2177. e.hasOwnProperty(a) && ye.on(a, e[a]);
  2178. else if ("function" === i(t))
  2179. for (var n = e.split(" "), r = 0, s = n.length; s > r; r++)
  2180. Ve[n[r]] = Ve[n[r]] || [],
  2181. -1 === J(n[r], t) && Ve[n[r]].push(t);
  2182. else if ("array" === i(t))
  2183. for (var o = 0, l = t.length; l > o; o++)
  2184. ye.on(e, t[o])
  2185. }
  2186. ,
  2187. ye.one = function(e, t) {
  2188. function a() {
  2189. t.apply(ye, arguments),
  2190. ye.off(e, a)
  2191. }
  2192. ye.on(e, a)
  2193. }
  2194. ,
  2195. ye.off = function(e, t) {
  2196. if (t instanceof Array)
  2197. for (var a = 0, n = t.length; n > a; a++)
  2198. ye.off(e, t[a]);
  2199. else
  2200. for (var i = e.split(" "), r = 0, s = i.length; s > r; r++)
  2201. if (Ve[i[r]] = Ve[i[r]] || [],
  2202. null == t)
  2203. Ve[i[r]].length = 0;
  2204. else {
  2205. var o = J(i[r], t);
  2206. -1 !== o && Ve[i[r]].splice(o, 1)
  2207. }
  2208. }
  2209. ,
  2210. ye.destroy = function() {
  2211. return Ue.add(Se).add(Be).add(De).add($e).add(Qe).add(Ze).add(Ge).add(Je).add(Ke).off("." + g),
  2212. b.off("keydown", de),
  2213. Ze.add(Ge).add(Je).add(Ke).removeClass(ge.disabledClass),
  2214. qe && null != Oe.activeItem && qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2215. De.empty(),
  2216. we || (be.off("." + g),
  2217. He.restore(),
  2218. Xe.restore(),
  2219. Ye.restore(),
  2220. je.restore(),
  2221. e.removeData(t, g)),
  2222. Ne.length = Ee.length = 0,
  2223. _e = {},
  2224. ye.initialized = 0,
  2225. ye
  2226. }
  2227. ,
  2228. ye.init = function() {
  2229. if (!ye.initialized) {
  2230. ye.on(m);
  2231. var e = ["overflow", "position"]
  2232. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2233. He.save.apply(He, e),
  2234. Ye.save.apply(Ye, e),
  2235. Xe.save.apply(Xe, t),
  2236. je.save.apply(je, t);
  2237. var a = Se;
  2238. return we || (a = a.add(Pe),
  2239. be.css("overflow", "hidden"),
  2240. f || "static" !== be.css("position") || be.css("position", "relative")),
  2241. f ? v && a.css(f, v) : ("static" === Be.css("position") && Be.css("position", "relative"),
  2242. a.css({
  2243. position: "absolute"
  2244. })),
  2245. ge.forward && $e.on(S, se),
  2246. ge.backward && Qe.on(S, se),
  2247. ge.prev && Ze.on(B, se),
  2248. ge.next && Ge.on(B, se),
  2249. ge.prevPage && Je.on(B, se),
  2250. ge.nextPage && Ke.on(B, se),
  2251. Ue.on(C, le),
  2252. Be[0] && Be.on(B, ce),
  2253. Re && ge.activateOn && be.on(ge.activateOn + "." + g, "*", ue),
  2254. De[0] && ge.activatePageOn && De.on(ge.activatePageOn + "." + g, "*", fe),
  2255. We.on(P, {
  2256. source: "slidee"
  2257. }, te),
  2258. Se && Se.on(P, {
  2259. source: "handle"
  2260. }, te),
  2261. b.on("keydown", de),
  2262. we || (be.on("mouseenter." + g + " mouseleave." + g, ve),
  2263. be.on("scroll." + g, o)),
  2264. ye.initialized = 1,
  2265. H(!0),
  2266. ge.cycleBy && !we && ye[ge.startPaused ? "pause" : "resume"](),
  2267. ye
  2268. }
  2269. }
  2270. }
  2271. function i(e) {
  2272. 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
  2273. }
  2274. function r(e, t) {
  2275. e.preventDefault(),
  2276. t && e.stopPropagation()
  2277. }
  2278. function s(t) {
  2279. r(t, 1),
  2280. e(this).off(t.type, s)
  2281. }
  2282. function o() {
  2283. this.scrollLeft = 0,
  2284. this.scrollTop = 0
  2285. }
  2286. function l(e) {
  2287. return !isNaN(parseFloat(e)) && isFinite(e)
  2288. }
  2289. function c(e, t) {
  2290. return 0 | E(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2291. }
  2292. function d(e, t, a) {
  2293. return t > e ? t : e > a ? a : e
  2294. }
  2295. function u(e) {
  2296. var t = {};
  2297. return t.style = {},
  2298. t.save = function() {
  2299. if (e && e.nodeType) {
  2300. for (var a = 0; a < arguments.length; a++)
  2301. t.style[arguments[a]] = e.style[arguments[a]];
  2302. return t
  2303. }
  2304. }
  2305. ,
  2306. t.restore = function() {
  2307. if (e && e.nodeType) {
  2308. for (var a in t.style)
  2309. t.style.hasOwnProperty(a) && (e.style[a] = t.style[a]);
  2310. return t
  2311. }
  2312. }
  2313. ,
  2314. t
  2315. }
  2316. 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;
  2317. b.on(C, function(e) {
  2318. var t = e.originalEvent[g]
  2319. , a = +new Date;
  2320. (!t || t.options.scrollHijack < a - O) && (O = a)
  2321. }),
  2322. function(e) {
  2323. function t(e) {
  2324. var t = (new Date).getTime()
  2325. , n = Math.max(0, 16 - (t - a))
  2326. , i = setTimeout(e, n);
  2327. return a = t,
  2328. i
  2329. }
  2330. w = e.requestAnimationFrame || e.webkitRequestAnimationFrame || t;
  2331. var a = (new Date).getTime()
  2332. , n = e.cancelAnimationFrame || e.webkitCancelAnimationFrame || e.clearTimeout;
  2333. y = function(t) {
  2334. n.call(e, t)
  2335. }
  2336. }(window),
  2337. function() {
  2338. function e(e) {
  2339. for (var n = 0, i = t.length; i > n; n++) {
  2340. var r = t[n] ? t[n] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2341. if (null != a.style[r])
  2342. return r
  2343. }
  2344. }
  2345. var t = ["", "webkit", "moz", "ms", "o"]
  2346. , a = document.createElement("div");
  2347. f = e("transform"),
  2348. v = e("perspective") ? "translateZ(0) " : ""
  2349. }(),
  2350. t[m] = n,
  2351. e.fn[h] = function(t, a) {
  2352. var r, s;
  2353. return e.isPlainObject(t) || (("string" === i(t) || t === !1) && (r = t === !1 ? "destroy" : t,
  2354. s = Array.prototype.slice.call(arguments, 1)),
  2355. t = {}),
  2356. this.each(function(i, o) {
  2357. var l = e.data(o, g);
  2358. l || r ? l && r && l[r] && l[r].apply(l, s) : l = e.data(o, g, new n(o,t,a).init())
  2359. })
  2360. }
  2361. ,
  2362. n.defaults = {
  2363. slidee: null,
  2364. horizontal: !1,
  2365. itemNav: null,
  2366. itemSelector: null,
  2367. smart: !1,
  2368. activateOn: null,
  2369. activateMiddle: !1,
  2370. scrollSource: null,
  2371. scrollBy: 0,
  2372. scrollHijack: 300,
  2373. scrollTrap: !1,
  2374. dragSource: null,
  2375. mouseDragging: !1,
  2376. touchDragging: !1,
  2377. releaseSwing: !1,
  2378. swingSpeed: .2,
  2379. elasticBounds: !1,
  2380. interactive: null,
  2381. scrollBar: null,
  2382. dragHandle: !1,
  2383. dynamicHandle: !1,
  2384. minHandleSize: 50,
  2385. clickBar: !1,
  2386. syncSpeed: .5,
  2387. pagesBar: null,
  2388. activatePageOn: null,
  2389. pageBuilder: function(e) {
  2390. return "<li>" + (e + 1) + "</li>"
  2391. },
  2392. forward: null,
  2393. backward: null,
  2394. prev: null,
  2395. next: null,
  2396. prevPage: null,
  2397. nextPage: null,
  2398. cycleBy: null,
  2399. cycleInterval: 5e3,
  2400. pauseOnHover: !1,
  2401. startPaused: !1,
  2402. moveBy: 300,
  2403. speed: 0,
  2404. easing: "swing",
  2405. startAt: null,
  2406. keyboardNavBy: null,
  2407. draggedClass: "dragged",
  2408. activeClass: "active",
  2409. disabledClass: "disabled"
  2410. }
  2411. }(jQuery, window);
  2412. !function e(t, i, n) {
  2413. function r(a, s) {
  2414. if (!i[a]) {
  2415. if (!t[a]) {
  2416. var l = "function" == typeof require && require;
  2417. if (!s && l)
  2418. return l(a, !0);
  2419. if (o)
  2420. return o(a, !0);
  2421. var c = new Error("Cannot find module '" + a + "'");
  2422. throw c.code = "MODULE_NOT_FOUND",
  2423. c
  2424. }
  2425. var h = i[a] = {
  2426. exports: {}
  2427. };
  2428. t[a][0].call(h.exports, function(e) {
  2429. var i = t[a][1][e];
  2430. return r(i ? i : e)
  2431. }, h, h.exports, e, t, i, n)
  2432. }
  2433. return i[a].exports
  2434. }
  2435. for (var o = "function" == typeof require && require, a = 0; a < n.length; a++)
  2436. r(n[a]);
  2437. return r
  2438. }({
  2439. 1: [function(e, t, i) {
  2440. (function(i) {
  2441. "use strict";
  2442. function n(e) {
  2443. this.player = null,
  2444. this.director = null,
  2445. this.modelManager = null,
  2446. this.container = null,
  2447. this.tagManager = null,
  2448. this.fadeInSpeed = e,
  2449. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2450. }
  2451. var r = e("three")
  2452. , o = e("./util/logger")
  2453. , a = (e("./util/common"),
  2454. e("./enum/PlayerEvents"))
  2455. , s = e("./enum/DirectorEvents")
  2456. , l = e("./settings")
  2457. , c = e("./enum/Viewmode")
  2458. , h = (e("./enum/WarpStyle"),
  2459. e("./enum/BlackoutStyle"),
  2460. e("./enum/ModelManagerEvents"))
  2461. , u = e("./enum/tagEvents")
  2462. , d = e("./util/transitions")
  2463. , p = e("./util/lerp")
  2464. , f = new o(i);
  2465. n.prototype.init = function(e, t, i, n, r) {
  2466. this.player = t,
  2467. this.director = e,
  2468. this.modelManager = i,
  2469. this.tagManager = n,
  2470. this.container = r,
  2471. this.updateModel(),
  2472. this.bindEvents()
  2473. }
  2474. ,
  2475. n.prototype.bindEvents = function() {
  2476. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  2477. this.player.on(a.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2478. this.player.on(a.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2479. this.player.on(a.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2480. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  2481. this.player.on(a.StartOutside, this.handleStartOutside.bind(this)),
  2482. this.player.on(a.WarpStarted, this.handleWarpStarted.bind(this)),
  2483. this.director.on(s.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2484. this.tagManager.on(u.TagActivated, this.ontagActivated.bind(this)),
  2485. this.tagManager.on(u.TagNavigation, this.onNavigationTotag.bind(this))
  2486. }
  2487. ,
  2488. n.prototype.updateModel = function() {
  2489. this.model = this.modelManager.getActiveModel()
  2490. }
  2491. ,
  2492. n.prototype.handleWarpStarted = function() {
  2493. this.hidePlayerReticule()
  2494. }
  2495. ,
  2496. n.prototype.ontagActivated = function() {
  2497. this.hidePlayerReticule()
  2498. }
  2499. ,
  2500. n.prototype.onNavigationTotag = function() {
  2501. this.hidePlayerReticule()
  2502. }
  2503. ,
  2504. n.prototype.handlePlayerModeChanging = function(e, t, i) {
  2505. var n = this.modelManager.getActiveModel()
  2506. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : l[t].markerOpacity;
  2507. n.fadePanoMarkers(r),
  2508. n.setMode(t)
  2509. }
  2510. ,
  2511. n.prototype.handlePlayerModeChanged = function(e, t) {
  2512. var i = this.modelManager.getActiveModel()
  2513. , n = t === c.PANORAMA ? r.DoubleSide : r.FrontSide;
  2514. i.setSide(n),
  2515. i.setMode(t)
  2516. }
  2517. ,
  2518. n.prototype.handleClosestPanoChanging = function(e, t, i) {
  2519. i !== c.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2520. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2521. }
  2522. ,
  2523. n.prototype.handleActionInterruption = function() {}
  2524. ,
  2525. n.prototype.handleStartInside = function(e) {
  2526. var t = l[this.player.mode]
  2527. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2528. this.fadeIn(this.fadeInSpeed),
  2529. this.model.alpha = 0,
  2530. this.model.skybox.material.uniforms.opacity.value = 1,
  2531. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2532. var n = this.player.reticule;
  2533. d.start(p.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2534. }
  2535. ,
  2536. n.prototype.handleStartOutside = function(e) {
  2537. this.fadeIn(e)
  2538. }
  2539. ,
  2540. n.prototype.fadeIn = function(e) {
  2541. null !== e && void 0 !== e || (e = 2e3,
  2542. f.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2543. $(this.container).fadeIn(e)
  2544. }
  2545. ,
  2546. n.prototype.hidePlayerReticule = function() {
  2547. this.player.reticule.hide()
  2548. }
  2549. ,
  2550. t.exports = n
  2551. }
  2552. ).call(this, "/js/DisplayController.js")
  2553. }
  2554. , {
  2555. "./enum/BlackoutStyle": 18,
  2556. "./enum/DirectorEvents": 23,
  2557. "./enum/tagEvents": 32,
  2558. "./enum/ModelManagerEvents": 33,
  2559. "./enum/PlayerEvents": 40,
  2560. "./enum/Viewmode": 51,
  2561. "./enum/WarpStyle": 52,
  2562. "./settings": 166,
  2563. "./util/common": 185,
  2564. "./util/lerp": 188,
  2565. "./util/logger": 189,
  2566. "./util/transitions": 195,
  2567. three: 217
  2568. }],
  2569. 2: [function(e, t, i) {
  2570. "use strict";
  2571. function n() {
  2572. this.baseStartTime = performance.timing.navigationStart,
  2573. this.loadingStartTime = null,
  2574. this.waitingStartTime = null,
  2575. this.appReadyTime = null
  2576. }
  2577. n.prototype.setBaseStartTime = function(e) {
  2578. this.baseStartTime = e || Date.now()
  2579. }
  2580. ,
  2581. n.prototype.setWaitingStartTime = function(e) {
  2582. this.waitingStartTime = e || Date.now()
  2583. }
  2584. ,
  2585. n.prototype.setLoadingStartTime = function(e) {
  2586. this.loadingStartTime = e || Date.now()
  2587. }
  2588. ,
  2589. n.prototype.setAppReadyTime = function(e) {
  2590. this.appReadyTime = e || Date.now()
  2591. }
  2592. ,
  2593. n.prototype.calcFullLoadingTime = function() {
  2594. var e = this.appReadyTime - this.baseStartTime;
  2595. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2596. e
  2597. }
  2598. ,
  2599. t.exports = n
  2600. }
  2601. , {}],
  2602. 3: [function(e, t, i) {
  2603. (function(i) {
  2604. "use strict";
  2605. function n() {
  2606. return 100 * Math.random()
  2607. }
  2608. var r = e("./util/logger")
  2609. , o = e("./util/browser")
  2610. , a = new r(i)
  2611. , s = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2612. initialized: !1,
  2613. init: function(e, t) {
  2614. if (t = t || {},
  2615. !this.initialized) {
  2616. this.initialized = !0,
  2617. o.valueFromHash("tilegen") && (t.tilegen = 1 === o.valueFromHash("tilegen", 0)),
  2618. o.valueFromHash("imgopt") && (t.imgopt = 1 === o.valueFromHash("imgopt", 0));
  2619. for (var i in e) {
  2620. var r = i.match("^sc_tilegen_([0-9]+)$");
  2621. r && (s.tilegen = n() < parseInt(r[1]));
  2622. var l = i.match("^sc_imgopt_([0-9]+)$");
  2623. l && (s.imgopt = n() < parseInt(l[1]))
  2624. }
  2625. for (var c in t)
  2626. s[c] = t[c],
  2627. a.debug("A/B override:", c, s[c])
  2628. }
  2629. },
  2630. changeIfTileGenerating: function(e) {
  2631. return s.tilegen && (e += e.indexOf("?") === -1 ? "?" : "&",
  2632. e += "imgopt=1"),
  2633. e
  2634. },
  2635. changeIfImageOptimzing: function(e) {
  2636. return s.imgopt && e.indexOf("imgopt=1") === -1 && (e += e.indexOf("?") === -1 ? "?" : "&",
  2637. e += "imgopt=1"),
  2638. e
  2639. },
  2640. tilegen: !1,
  2641. imgopt: !1
  2642. };
  2643. t.exports = s
  2644. }
  2645. ).call(this, "/js/ab.js")
  2646. }
  2647. , {
  2648. "./util/browser": 182,
  2649. "./util/logger": 189
  2650. }],
  2651. 4: [function(e, t, i) {
  2652. (function(i) {
  2653. "use strict";
  2654. function n() {
  2655. return {
  2656. addons: [{
  2657. name: "keen:ua_parser",
  2658. input: {
  2659. ua_string: "user_agent"
  2660. },
  2661. output: "parsed_user_agent"
  2662. }]
  2663. }
  2664. }
  2665. function r(e, t, i, n) {
  2666. function r(t) {
  2667. l[t.sid] = !0;
  2668. var i = t.billboard.media && t.billboard.media.type
  2669. , n = {
  2670. tag_id: t.sid,
  2671. tags_visited: Object.keys(l).length,
  2672. tag_count: Object.keys(e.tags).length,
  2673. tag_view_count: ++E,
  2674. has_media: !!i
  2675. };
  2676. i && (n.media_type = i),
  2677. u("tag_opened", n)
  2678. }
  2679. var l = {}
  2680. , h = Date.now() - N
  2681. , f = null;
  2682. n && (f = Date.now() - window.navigationStart);
  2683. var g;
  2684. try {
  2685. g = e.data.player_options.highlight_reel && e.heroLocations.length > 1
  2686. } catch (e) {
  2687. g = !1
  2688. }
  2689. var v, A = e.supportsVR;
  2690. A || (v = "VR disabled at the model/account level",
  2691. 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"))),
  2692. u("model_loaded", {
  2693. duration: h,
  2694. duration_from_navigation_start: f,
  2695. has_hlr: g,
  2696. has_vr: A,
  2697. vr_reason: v
  2698. });
  2699. var I = 0;
  2700. e.panos.forEach(function(e) {
  2701. e.on("enter", function() {
  2702. c("pano_viewed", {
  2703. pano_id: e.id,
  2704. pano_view_count: ++I,
  2705. alignment_type: e.alignmentType,
  2706. interaction_source: O,
  2707. navigation_source: p
  2708. })
  2709. })
  2710. });
  2711. var E = 0;
  2712. for (var T in e.tags)
  2713. e.tags[T].billboard.on(M.OPENED, r.bind(this, e.tags[T]));
  2714. t.on("tour_auto", function(e) {
  2715. p = "tour_" + e
  2716. }),
  2717. t.on("tour_manual", function(e) {
  2718. O = "gui-" + e,
  2719. p = "tour_manual"
  2720. }),
  2721. i.on(C.InteractionKey, function() {
  2722. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionKey)
  2723. }),
  2724. i.on(C.InteractionDirect, function() {
  2725. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionDirect)
  2726. }),
  2727. o(t),
  2728. a(),
  2729. s()
  2730. }
  2731. function o(e) {
  2732. I.on(T.OPENED, function() {
  2733. c("showcase_share_intent", {
  2734. pano_id: e.currentPano && e.currentPano.id
  2735. })
  2736. }),
  2737. I.on(T.LINK_CLICKED, function(t) {
  2738. c("showcase_share_action", {
  2739. channel: t.channel,
  2740. pano_id: e.currentPano && e.currentPano.id
  2741. })
  2742. }),
  2743. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2744. c("showcase_share_origin_link_clicked")
  2745. })
  2746. }
  2747. function a() {}
  2748. function s() {
  2749. b.on(S.OPENED, c.bind(this, "showcase_gui", {
  2750. gui_action: "click_vr_button"
  2751. })),
  2752. b.on(S.LAUNCH, function(e) {
  2753. c("showcase_gui", {
  2754. gui_action: "launch_vr",
  2755. vr_platform: e.vr_platform,
  2756. vr_app: e.vr_app
  2757. })
  2758. }),
  2759. b.on(S.PREV, c.bind(this, "showcase_gui", {
  2760. gui_action: "vr_modal_prev"
  2761. })),
  2762. b.on(S.NEXT, function(e) {
  2763. c("showcase_gui", {
  2764. gui_action: e.nextAction
  2765. })
  2766. }),
  2767. b.on(S.CLOSED, c.bind(this, "showcase_gui", {
  2768. gui_action: "vr_modal_close"
  2769. })),
  2770. b.on(S.falseICECHOSEN, function(e) {
  2771. c("showcase_gui", {
  2772. gui_action: e.name + " "
  2773. })
  2774. }),
  2775. b.on(S.STORE, function(e) {
  2776. c("showcase_gui", {
  2777. gui_action: "launch_store",
  2778. store: e
  2779. })
  2780. })
  2781. }
  2782. function l(e, t) {
  2783. if (f)
  2784. try {
  2785. f.addEvent(e, v.extendObject({
  2786. host: window.location.host,
  2787. keen: n(),
  2788. user_agent: "${keen.user_agent}",
  2789. referrer: {
  2790. url: v.normalizeUrl(document.referrer),
  2791. domain: v.domainFromUrl(document.referrer),
  2792. url_original: document.referrer
  2793. },
  2794. embedded: m.inIframe(),
  2795. is_mobile: m.isMobile(),
  2796. version: "2.25.6-0-gd87e5b1"
  2797. }, t))
  2798. } catch (e) {
  2799. P.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2800. }
  2801. }
  2802. function c(e, t) {
  2803. if (t = t || {},
  2804. L)
  2805. try {
  2806. window.analytics.track(e, v.extendObject(t, B), {
  2807. context: {
  2808. app: {
  2809. name: "showcase",
  2810. version: "2.25.6-0-gd87e5b1"
  2811. },
  2812. screen: {
  2813. width: window.screen.width,
  2814. height: window.screen.height,
  2815. density: window.devicePixelRatio
  2816. }
  2817. }
  2818. })
  2819. } catch (t) {
  2820. console.warn("Failed to send data to segment for " + e)
  2821. }
  2822. }
  2823. function h(e, t) {
  2824. if (t = t || {},
  2825. navigator.sendBeacon && L)
  2826. try {
  2827. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2828. event: e,
  2829. anonymousId: window.analytics.user().anonymousId(),
  2830. properties: v.extendObject(t, B),
  2831. writeKey: L,
  2832. sentAt: Date.now(),
  2833. type: "track",
  2834. context: {
  2835. userAgent: m.userAgent(),
  2836. library: {
  2837. name: "showcase-beacon",
  2838. version: "2.25.6-0-gd87e5b1"
  2839. },
  2840. app: {
  2841. name: "showcase",
  2842. version: "2.25.6-0-gd87e5b1"
  2843. }
  2844. }
  2845. }))
  2846. } catch (e) {
  2847. console.warn("Failed to send async segment request")
  2848. }
  2849. }
  2850. function u(e, t) {
  2851. t = t || {},
  2852. c(e, t)
  2853. }
  2854. function d(e, t) {
  2855. O = e === C.InteractionGui ? "gui-" + t : e,
  2856. p = "self_guided"
  2857. }
  2858. var p, f, g = (e("three"),
  2859. e("./util/ajax"),
  2860. e("./ab")), m = e("./util/browser"), v = e("./util/common"), A = e("./settings"), y = (e("./localization/localize"),
  2861. 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"),
  2862. "direct"), L = null, D = !1, N = null, B = null, F = v.uuid4();
  2863. t.exports = {
  2864. report: function(e, t, i, n) {
  2865. l("Session starts", {
  2866. model: e,
  2867. status: t,
  2868. loadtime: Date.now() - (N || Date.now()),
  2869. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2870. autoplay: i,
  2871. quickstart: n,
  2872. ab_tilegen: g.tilegen,
  2873. ab_imgopt: g.imgopt
  2874. })
  2875. },
  2876. impression: function(e) {
  2877. e = e || {};
  2878. var t = void 0 === e.isVisible || e.isVisible
  2879. , i = (void 0 !== e.immediate && e.immediate,
  2880. window.location.search.substr(1).split("&"));
  2881. u("impression", {
  2882. visible: t,
  2883. url_params: i
  2884. })
  2885. },
  2886. initKeen: function(e) {
  2887. return e.token && e.appId ? void (f = new Keen({
  2888. projectId: e.appId,
  2889. writeKey: e.token,
  2890. readKey: "",
  2891. requestType: "xhr"
  2892. })) : void P.warn("no keen token/appId")
  2893. },
  2894. initSegment: function(e) {
  2895. return e.token ? (L = e.token,
  2896. window.analytics.load(e.token),
  2897. B = {
  2898. model_id: e.model,
  2899. start_source: e.startSource,
  2900. autoplay: e.autoplay,
  2901. quickstart: e.quickstart,
  2902. language_tag: A.languageTag,
  2903. is_mobile: m.isMobile(),
  2904. iframe: m.inIframe(),
  2905. aspect_ratio: m.aspectRatio(),
  2906. session_id: F,
  2907. window: {
  2908. width: $("#player").width(),
  2909. height: $("#player").height()
  2910. },
  2911. platform: {
  2912. browser: {
  2913. name: $.ua.browser.name,
  2914. major: $.ua.browser.major,
  2915. version: $.ua.browser.version
  2916. },
  2917. os: {
  2918. name: $.ua.os.name,
  2919. version: $.ua.os.version
  2920. },
  2921. device: {
  2922. vendor: $.ua.device.vendor,
  2923. model: $.ua.device.model,
  2924. type: $.ua.device.type
  2925. }
  2926. }
  2927. },
  2928. D = Math.random() < A.analytics.sessionTrackingRate,
  2929. P.debug("tracking sample rate = " + A.analytics.sessionTrackingRate),
  2930. void P.debug("tracking this session = " + D)) : void P.warn("no segment token")
  2931. },
  2932. sessionStart: function(e) {
  2933. P.debug("analytics user_session_start"),
  2934. c("session_started"),
  2935. N = Date.now(),
  2936. window.addEventListener("unload", function() {
  2937. h("session_ended", {
  2938. duration: Date.now() - N
  2939. })
  2940. })
  2941. },
  2942. modelLoaded: function(e, t, i, n) {
  2943. r(e, t, i, n)
  2944. },
  2945. loadComplete: function(e) {
  2946. var t = {
  2947. time_to_app_start: e
  2948. };
  2949. c("load_times", t)
  2950. },
  2951. track: function(e, t) {
  2952. D && (P.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  2953. c(e, t))
  2954. },
  2955. trackAlways: function(e, t) {
  2956. P.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  2957. c(e, t)
  2958. },
  2959. getSessionId: function() {
  2960. return F
  2961. },
  2962. updateInteraction: d
  2963. }
  2964. }
  2965. ).call(this, "/js/analytics.js")
  2966. }
  2967. , {
  2968. "./ab": 3,
  2969. "./enum/ControlEvents": 21,
  2970. "./enum/PlayerEvents": 40,
  2971. "./enum/VROption": 47,
  2972. "./enum/VRPlatforms": 49,
  2973. "./enum/Viewmode": 51,
  2974. "./gui/sharing/ShareEvents": 76,
  2975. "./gui/sharing/modal": 77,
  2976. "./gui/title/TitleEvents": 80,
  2977. "./gui/title/titleBar": 82,
  2978. "./gui/vr/vrEvent": 85,
  2979. "./gui/vr/vrModal": 87,
  2980. "./localization/localize": 108,
  2981. "./tag/Billboard/BillboardEvent": 120,
  2982. "./settings": 166,
  2983. "./util/ajax": 181,
  2984. "./util/browser": 182,
  2985. "./util/common": 185,
  2986. "./util/logger": 189,
  2987. three: 217
  2988. }],
  2989. 5: [function(e, t, i) {
  2990. "use strict";
  2991. function n() {
  2992. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  2993. this.controls = null
  2994. }
  2995. var r = e("three")
  2996. , o = e("../constants")
  2997. , a = e("../util/cameraLight");
  2998. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  2999. n.prototype.updateAspect = function(e) {
  3000. this.aspect = e,
  3001. this.updateProjectionMatrix()
  3002. }
  3003. ,
  3004. t.exports = n
  3005. }
  3006. , {
  3007. "../constants": 8,
  3008. "../util/cameraLight": 184,
  3009. three: 217
  3010. }],
  3011. 6: [function(e, t, i) {
  3012. "use strict";
  3013. function n() {
  3014. var e = $("#player").width() / $("#player").height();
  3015. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  3016. this.controls = null,
  3017. this.updateAspect(e)
  3018. }
  3019. var r = e("three")
  3020. , o = e("../constants");
  3021. n.prototype = Object.create(r.OrthographicCamera.prototype),
  3022. n.prototype.updateAspect = function(e) {
  3023. this.aspect = e,
  3024. this.top = o.orthoBase / e,
  3025. this.bottom = -o.orthoBase / e,
  3026. this.updateProjectionMatrix()
  3027. }
  3028. ,
  3029. t.exports = n
  3030. }
  3031. , {
  3032. "../constants": 8,
  3033. three: 217
  3034. }],
  3035. 7: [function(e, t, i) {
  3036. "use strict";
  3037. function n() {
  3038. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  3039. this.controls = null
  3040. }
  3041. var r = e("three")
  3042. , o = e("../settings")
  3043. , a = e("../util/cameraLight");
  3044. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3045. n.prototype.updateAspect = function(e) {
  3046. this.aspect = e,
  3047. this.updateProjectionMatrix()
  3048. }
  3049. ,
  3050. t.exports = n
  3051. }
  3052. , {
  3053. "../settings": 166,
  3054. "../util/cameraLight": 184,
  3055. three: 217
  3056. }],
  3057. 8: [function(e, t, i) {
  3058. "use strict";
  3059. t.exports = {
  3060. signedUrlDefaultExpireTime: 24e4,
  3061. signedUrlCheckInterval: 1e4,
  3062. signedUrlRefreshBuffer: 15e3,
  3063. dollhouseFOV: 70,
  3064. dollhouseNear: 1,
  3065. dollhouseFar: 5e3,
  3066. insideFOV: 70,
  3067. insideFOVMax: 120,
  3068. insideNear: .1,
  3069. insideFar: 5e3,
  3070. insideLookSpeed: .12,
  3071. insideLookLimitUp: 40,
  3072. insideLookLimitDown: -40,
  3073. orthoNear: 1,
  3074. orthoFar: 5e3,
  3075. orthoBase: 10,
  3076. narrowLandscapeHeight: 290,
  3077. reallyNarrowLandscapeHeight: 250,
  3078. visionTilingStartDate: new Date("8/26/2016"),
  3079. visionTilingStartVersion: "1.1.407.13667",
  3080. windowHeightHighQualityThreshold: 900,
  3081. tourStepDelayDefault: 3500,
  3082. tourStepDelaySlideShow: 5e3,
  3083. workshopApsect: 9 / 16,
  3084. highQualityMaxZoom: 2,
  3085. ultraHighQualityMaxZoom: 3
  3086. }
  3087. }
  3088. , {}],
  3089. 9: [function(e, t, i) {
  3090. "use strict";
  3091. function n() {
  3092. this.activeControl = null,
  3093. this.controls = {},
  3094. this.cameras = {}
  3095. }
  3096. var r = e("./PanoramaControls")
  3097. , o = e("./DollhouseControls")
  3098. , a = e("./FloorplanControls")
  3099. , s = e("../cameras/PanoramaCamera")
  3100. , l = e("../cameras/DollhouseCamera")
  3101. , c = e("../cameras/FloorplanCamera")
  3102. , h = e("events").EventEmitter
  3103. , u = e("../enum/ControlEvents")
  3104. , d = e("../enum/ModelManagerEvents")
  3105. , p = e("../enum/Viewmode")
  3106. , f = e("../settings");
  3107. n.prototype = Object.create(h.prototype),
  3108. n.prototype.init = function(e, t) {
  3109. this.setUpControls(),
  3110. this.bindEvents(e, t)
  3111. }
  3112. ,
  3113. n.prototype.activateControls = function(e) {
  3114. this.activeControl && (this.activeControl.reset(),
  3115. this.activeControl.enabled = !1),
  3116. this.controls[e] && (this.controls[e].enabled = !0),
  3117. this.activeControl = this.controls[e]
  3118. }
  3119. ,
  3120. n.prototype.setUpControls = function() {
  3121. var e = {}
  3122. , t = {}
  3123. , i = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3124. , n = [s, l, c]
  3125. , h = [r, o, a];
  3126. i.forEach(function(i, r) {
  3127. e[i] = new n[r],
  3128. t[i] = new h[r](e[i]),
  3129. t[i].on(u.Move, this.emit.bind(this, u.Move)),
  3130. t[i].on(u.InputStart, this.emit.bind(this, u.InputStart)),
  3131. t[i].on(u.InteractionDirect, this.emit.bind(this, u.InteractionDirect)),
  3132. t[i].on(u.InteractionKey, this.emit.bind(this, u.InteractionKey)),
  3133. t[i].on(u.Pinch, this.emit.bind(this, u.Pinch)),
  3134. t[i].on(u.Scroll, this.emit.bind(this, u.Scroll))
  3135. }
  3136. .bind(this)),
  3137. this.controls = t,
  3138. this.cameras = e
  3139. }
  3140. ,
  3141. n.prototype.bindEvents = function(e, t) {
  3142. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3143. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3144. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3145. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3146. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this)),
  3147. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3148. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3149. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3150. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3151. e.addEventListener("contextmenu", function(e) {
  3152. e.preventDefault()
  3153. }),
  3154. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3155. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3156. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3157. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3158. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3159. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3160. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3161. t.on(d.ActiveModelChanged, function(e) {
  3162. this.setModelForControls(e.model)
  3163. }
  3164. .bind(this))
  3165. }
  3166. ,
  3167. n.prototype.setModelForControls = function(e) {
  3168. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3169. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3170. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3171. this.controls[e].setBounds(t)
  3172. }
  3173. .bind(this))
  3174. }
  3175. ,
  3176. n.prototype.onMouseDown = function(e) {
  3177. e.preventDefault(),
  3178. this.activeControl && this.activeControl.onMouseDown(e)
  3179. }
  3180. ,
  3181. n.prototype.onMouseMove = function(e) {
  3182. e.preventDefault(),
  3183. this.activeControl && this.activeControl.onMouseMove(e)
  3184. }
  3185. ,
  3186. n.prototype.onMouseUp = function(e) {
  3187. e.preventDefault(),
  3188. this.activeControl && this.activeControl.onMouseUp(e)
  3189. }
  3190. ,
  3191. n.prototype.onMouseOver = function(e) {
  3192. e.preventDefault(),
  3193. this.activeControl && this.activeControl.onMouseOver(e)
  3194. }
  3195. ,
  3196. n.prototype.onMouseWheel = function(e) {
  3197. e.preventDefault(),
  3198. this.activeControl && this.activeControl.onMouseWheel(e)
  3199. }
  3200. ,
  3201. n.prototype.onTouchStart = function(e) {
  3202. e.preventDefault(),
  3203. this.activeControl && this.activeControl.onTouchStart(e)
  3204. }
  3205. ,
  3206. n.prototype.onTouchMove = function(e) {
  3207. e.preventDefault(),
  3208. this.activeControl && this.activeControl.onTouchMove(e)
  3209. }
  3210. ,
  3211. n.prototype.onTouchEnd = function(e) {
  3212. e.preventDefault(),
  3213. this.activeControl && this.activeControl.onTouchEnd(e)
  3214. }
  3215. ,
  3216. n.prototype.onPointerDown = function(e) {
  3217. if (e.preventDefault(),
  3218. this.activeControl)
  3219. switch (e.pointerType) {
  3220. case "mouse":
  3221. this.activeControl.onMouseDown(e);
  3222. break;
  3223. default:
  3224. this.activeControl.onPointerDown(e)
  3225. }
  3226. }
  3227. ,
  3228. n.prototype.onPointerMove = function(e) {
  3229. if (e.preventDefault(),
  3230. this.activeControl)
  3231. switch (e.pointerType) {
  3232. case "mouse":
  3233. this.activeControl.onMouseMove(e);
  3234. break;
  3235. default:
  3236. this.activeControl.onPointerMove(e)
  3237. }
  3238. }
  3239. ,
  3240. n.prototype.onPointerUp = function(e) {
  3241. if (e.preventDefault(),
  3242. this.activeControl)
  3243. switch (e.pointerType) {
  3244. case "mouse":
  3245. this.activeControl.onMouseUp(e);
  3246. break;
  3247. default:
  3248. this.activeControl.onPointerUp(e)
  3249. }
  3250. }
  3251. ,
  3252. n.prototype.onPointerCancel = function(e) {
  3253. e.preventDefault(),
  3254. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3255. }
  3256. ,
  3257. n.prototype.onKeyDown = function(e) {
  3258. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3259. this.activeControl && this.activeControl.onKeyDown(e))
  3260. }
  3261. ,
  3262. n.prototype.onKeyUp = function(e) {
  3263. e.preventDefault(),
  3264. this.activeControl && this.activeControl.onKeyUp(e)
  3265. }
  3266. ,
  3267. t.exports = n
  3268. }
  3269. , {
  3270. "../cameras/DollhouseCamera": 5,
  3271. "../cameras/FloorplanCamera": 6,
  3272. "../cameras/PanoramaCamera": 7,
  3273. "../enum/ControlEvents": 21,
  3274. "../enum/ModelManagerEvents": 33,
  3275. "../enum/Viewmode": 51,
  3276. "../settings": 166,
  3277. "./DollhouseControls": 10,
  3278. "./FloorplanControls": 11,
  3279. "./PanoramaControls": 13,
  3280. events: 202
  3281. }],
  3282. 10: [function(e, t, i) {
  3283. "use strict";
  3284. function n(e) {
  3285. a.call(this, e),
  3286. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3287. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3288. this.minDistance = o.dollhouseDefault.minDistance,
  3289. this.maxDistance = o.dollhouseDefault.maxDistance,
  3290. this.adjustedMinDistance = this.minDistance,
  3291. this.adjustedMaxDistance = this.maxDistance
  3292. }
  3293. var r = e("three")
  3294. , o = e("../settings")
  3295. , a = e("./OutsideControls");
  3296. n.prototype = Object.create(a.prototype),
  3297. n.prototype.pan = function(e, t) {
  3298. this.camera.updateMatrix();
  3299. var i = this.camera.position.clone().sub(this.target).length();
  3300. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3301. this.panLeft(2 * e * i / $("#player").height()),
  3302. this.panUp(-2 * t * i / $("#player").height())
  3303. }
  3304. ,
  3305. n.prototype.updateZoom = function() {
  3306. var e = this.offset.length();
  3307. return e * this.scale
  3308. }
  3309. ,
  3310. n.prototype.setZoomBounds = function(e) {
  3311. var t = e.min.distanceTo(e.max);
  3312. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3313. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3314. this.minDistance = this.adjustedMinDistance,
  3315. this.maxDistance = this.adjustedMaxDistance
  3316. }
  3317. ,
  3318. n.prototype.resetRanges = function(e, t) {
  3319. e ? (this.minDistance = Math.min(e, this.minDistance),
  3320. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3321. this.maxDistance = this.adjustedMaxDistance),
  3322. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3323. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3324. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3325. }
  3326. ,
  3327. n.prototype.toJSON = function() {
  3328. return a.prototype.toJSON.call(this)
  3329. }
  3330. ,
  3331. t.exports = n
  3332. }
  3333. , {
  3334. "../settings": 166,
  3335. "./OutsideControls": 12,
  3336. three: 217
  3337. }],
  3338. 11: [function(e, t, i) {
  3339. "use strict";
  3340. function n(e) {
  3341. a.call(this, e),
  3342. this.minDistance = 15,
  3343. this.maxDistance = 50,
  3344. this.noRotateUpDown = !0,
  3345. this.minPolarAngle = 0,
  3346. this.maxPolarAngle = 0,
  3347. this.mouseActions[l.LEFT] = s.PAN,
  3348. this.mouseActions[l.MIDDLE] = s.DOLLY,
  3349. this.mouseActions[l.RIGHT] = s.ROTATE,
  3350. this.touchActions[1] = s.PAN,
  3351. this.touchActions[2] = s.ROTATE_DOLLY,
  3352. this.absoluteScale = 1,
  3353. this.currentScale = 1
  3354. }
  3355. var r = e("three")
  3356. , o = e("../settings")
  3357. , a = e("./OutsideControls")
  3358. , s = e("../enum/ControlActions")
  3359. , l = e("../enum/MouseButton")
  3360. , c = e("../util/math")
  3361. , h = e("../util/browser");
  3362. n.prototype = Object.create(a.prototype),
  3363. n.prototype.zoomToContain = function(e) {
  3364. var t = Math.max(e.x, e.z)
  3365. , i = Math.min(e.x, e.z)
  3366. , n = Math.max(t, i * this.camera.aspect)
  3367. , r = Math.max(i, t * this.camera.aspect);
  3368. this.absoluteScale = (h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase * 1.2,
  3369. this.currentScale = this.absoluteScale
  3370. }
  3371. ,
  3372. n.prototype.rotateToView = function(e, t) {
  3373. var i = 0
  3374. , n = h.aspectRatio() < 1
  3375. , r = e.x < e.z;
  3376. n === r ? t.z > 0 && (i = Math.PI) : i = t.x > 0 ? Math.PI / 2 : -Math.PI / 2,
  3377. this.rotateLeft(i),
  3378. this.update(0)
  3379. }
  3380. ,
  3381. n.prototype.pan = function(e, t) {
  3382. this.camera.updateMatrix(),
  3383. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3384. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3385. }
  3386. ,
  3387. n.prototype.updateZoom = function() {
  3388. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3389. this.absoluteScale = Math.max(o.zoomNearLimit, Math.min(this.absoluteScale, o.zoomFarLimit)),
  3390. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3391. this.camera.left = -o.orthoBase * this.currentScale,
  3392. this.camera.right = o.orthoBase * this.currentScale,
  3393. this.camera.top = o.orthoBase * this.currentScale / this.camera.aspect,
  3394. this.camera.bottom = -o.orthoBase * this.currentScale / this.camera.aspect,
  3395. this.camera.updateProjectionMatrix(),
  3396. this.offset.length()
  3397. }
  3398. ,
  3399. n.prototype.toJSON = function() {
  3400. var e = new r.Quaternion
  3401. , t = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  3402. , i = new r.Quaternion;
  3403. return function() {
  3404. var n = a.prototype.toJSON.call(this);
  3405. return e.copy(n.camera_quaternion),
  3406. i.copy(t),
  3407. i.multiply(e),
  3408. n.camera_quaternion.x = c.toPrecision(i.x, 4),
  3409. n.camera_quaternion.y = c.toPrecision(i.y, 4),
  3410. n.camera_quaternion.z = c.toPrecision(i.z, 4),
  3411. n.camera_quaternion.w = c.toPrecision(i.w, 4),
  3412. n.ortho_zoom = c.toPrecision(this.currentScale * this.camera.aspect, 4),
  3413. n
  3414. }
  3415. }(),
  3416. t.exports = n
  3417. }
  3418. , {
  3419. "../enum/ControlActions": 20,
  3420. "../enum/MouseButton": 34,
  3421. "../settings": 166,
  3422. "../util/browser": 182,
  3423. "../util/math": 190,
  3424. "./OutsideControls": 12,
  3425. three: 217
  3426. }],
  3427. 12: [function(e, t, i) {
  3428. "use strict";
  3429. function n(e) {
  3430. this.camera = e,
  3431. this.camera.controls = this,
  3432. this.enabled = !1,
  3433. this.target = new r.Vector3,
  3434. this.targetBounds = new r.Box3,
  3435. this.zoomSpeed = 1,
  3436. this.minDistance = 0,
  3437. this.maxDistance = 1 / 0,
  3438. this.noRotateUpDown = !1,
  3439. this.rotateSpeed = 1,
  3440. this.keyboardZoomSpeed = 0,
  3441. this.keyPanSpeed = 7,
  3442. this.autoRotate = !1,
  3443. this.autoRotateSpeed = 2,
  3444. this.autoPan = !1,
  3445. this.autoPanPosition = new r.Vector3,
  3446. this.minPolarAngle = r.Math.degToRad(25),
  3447. this.maxPolarAngle = r.Math.degToRad(65),
  3448. this.rotationAcceleration = new r.Vector2,
  3449. this.rotationSpeed = new r.Vector2,
  3450. this.panAcceleration = new r.Vector2,
  3451. this.panSpeed = new r.Vector2,
  3452. this.rotateStart = new r.Vector2,
  3453. this.rotateEnd = new r.Vector2,
  3454. this.rotateDelta = new r.Vector2,
  3455. this.panStart = new r.Vector2,
  3456. this.panEnd = new r.Vector2,
  3457. this.panDelta = new r.Vector2,
  3458. this.panOffset = new r.Vector3,
  3459. this.offset = new r.Vector3,
  3460. this.dollyStart = new r.Vector2,
  3461. this.dollyEnd = new r.Vector2,
  3462. this.dollyDelta = new r.Vector2,
  3463. this.phiDelta = 0,
  3464. this.thetaDelta = 0,
  3465. this.scale = 1,
  3466. this.panVector = new r.Vector3,
  3467. this.lastPosition = new r.Vector3,
  3468. this.state = c.NONE,
  3469. this.mouseActions = {},
  3470. this.mouseActions[h.LEFT] = c.ROTATE,
  3471. this.mouseActions[h.MIDDLE] = c.DOLLY,
  3472. this.mouseActions[h.RIGHT] = c.PAN,
  3473. this.touchActions = {},
  3474. this.touchActions[1] = c.ROTATE,
  3475. this.touchActions[2] = c.PAN_DOLLY,
  3476. this.lastMoveTime = 0,
  3477. this.pointersLimit = 2,
  3478. this.pointers = []
  3479. }
  3480. var r = e("three")
  3481. , o = e("../settings")
  3482. , a = e("../util/common")
  3483. , s = e("../util/math")
  3484. , l = e("../enum/Vectors")
  3485. , c = e("../enum/ControlActions")
  3486. , h = e("../enum/MouseButton")
  3487. , u = e("../enum/Keys")
  3488. , d = e("../enum/ControlEvents")
  3489. , p = e("events").EventEmitter
  3490. , f = 1e-6;
  3491. n.prototype = Object.create(p.prototype),
  3492. n.prototype.setBounds = function(e) {
  3493. this.targetBounds = e
  3494. }
  3495. ,
  3496. n.prototype.isEngaged = function() {
  3497. return this.state !== c.NONE
  3498. }
  3499. ,
  3500. n.prototype.rotateLeft = function(e) {
  3501. void 0 === e && (e = this.getAutoRotationAngle()),
  3502. this.thetaDelta -= e
  3503. }
  3504. ,
  3505. n.prototype.rotateUp = function(e) {
  3506. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3507. this.phiDelta -= e)
  3508. }
  3509. ,
  3510. n.prototype.panLeft = function(e) {
  3511. var t = this.camera.matrix.elements;
  3512. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3513. this.panOffset.multiplyScalar(-e),
  3514. this.panVector.add(this.panOffset)
  3515. }
  3516. ,
  3517. n.prototype.panUp = function(e) {
  3518. var t = this.camera.matrix.elements;
  3519. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3520. this.panOffset.multiplyScalar(-e),
  3521. this.panVector.add(this.panOffset)
  3522. }
  3523. ,
  3524. n.prototype.startRotating = function(e, t) {
  3525. e && this.navRotationAcc("x", e),
  3526. t && this.navRotationAcc("y", t)
  3527. }
  3528. ,
  3529. n.prototype.stopRotating = function(e) {
  3530. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3531. this.navRotationAcc("x", 0),
  3532. this.navRotationAcc("y", 0)
  3533. }
  3534. ,
  3535. n.prototype.setAutoPanPosition = function(e, t) {
  3536. var i = new r.Vector3
  3537. , n = new r.Vector3;
  3538. return function(e, t) {
  3539. i.copy(this.camera.position),
  3540. void 0 === e && null === e || i.setX(e),
  3541. void 0 === t && null === t || i.setZ(t);
  3542. var r = this.camera.position.distanceTo(this.target)
  3543. , o = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3544. this.targetClamped = !1,
  3545. n.copy(i).addScaledVector(o, r),
  3546. this.targetBounds.containsPoint(n) || (this.targetBounds.clampPoint(n, n),
  3547. i.copy(n).addScaledVector(o, -r),
  3548. this.targetClamped = !0),
  3549. this.autoPanPosition.x = i.x,
  3550. this.autoPanPosition.z = i.z,
  3551. this.autoPan && this.stopAutoPanning()
  3552. }
  3553. }(),
  3554. n.prototype.stopAutoPanning = function() {
  3555. var e = this.autoPan;
  3556. this.autoPan = !1,
  3557. this.emit(this.targetClamped ? d.AutoPanClamped : e ? d.AutoPanInterrupt : d.AutoPanComplete)
  3558. }
  3559. ,
  3560. n.prototype.dollyIn = function(e) {
  3561. void 0 === e && (e = this.getZoomScale()),
  3562. this.scale /= e
  3563. }
  3564. ,
  3565. n.prototype.dollyOut = function(e) {
  3566. void 0 === e && (e = this.getZoomScale()),
  3567. this.scale *= e
  3568. }
  3569. ,
  3570. n.prototype.updatePan = function(e) {
  3571. if (this.panSpeed.multiplyScalar(1 - o.panFriction).addScaledVector(this.panAcceleration, o.panAccelerationOutside * e),
  3572. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3573. this.autoPan) {
  3574. var t = (new r.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3575. t.setY(0).clampLength(0, 50 * e),
  3576. this.target.add(t),
  3577. this.camera.position.add(t),
  3578. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3579. this.stopAutoPanning())
  3580. }
  3581. }
  3582. ,
  3583. n.prototype.update = function(e) {
  3584. e || (e = 1 / 60),
  3585. this.rotationSpeed.multiplyScalar(1 - o.rotationFriction).addScaledVector(this.rotationAcceleration, o.rotationAccelerationOutside * e),
  3586. this.rotateLeft(-this.rotationSpeed.x),
  3587. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3588. this.updatePan(e);
  3589. var t = this.camera.position;
  3590. this.offset.copy(t).sub(this.target);
  3591. var i = Math.atan2(this.offset.x, this.offset.z)
  3592. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3593. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3594. i += this.thetaDelta,
  3595. n += this.phiDelta,
  3596. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3597. n = Math.max(f, Math.min(Math.PI - f, n));
  3598. var r = this.updateZoom();
  3599. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3600. this.target.add(this.panVector),
  3601. this.targetBounds.clampPoint(this.target, this.target),
  3602. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3603. this.offset.y = r * Math.cos(n),
  3604. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3605. t.copy(this.target).add(this.offset),
  3606. this.camera.lookAt(this.target),
  3607. this.thetaDelta = 0,
  3608. this.phiDelta = 0,
  3609. this.scale = 1,
  3610. this.panVector.set(0, 0, 0),
  3611. this.lastPosition.distanceTo(this.camera.position) > 0 && this.lastPosition.copy(this.camera.position)
  3612. }
  3613. ,
  3614. n.prototype.getAutoRotationAngle = function() {
  3615. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3616. }
  3617. ,
  3618. n.prototype.getZoomScale = function() {
  3619. return Math.pow(.95, this.zoomSpeed)
  3620. }
  3621. ,
  3622. n.prototype.onMouseDown = function(e) {
  3623. if (this.enabled) {
  3624. switch (e.preventDefault(),
  3625. this.stopAutoPanning(),
  3626. this.mouseDown = !0,
  3627. this.state = this.mouseActions[e.button],
  3628. this.state) {
  3629. case c.ROTATE:
  3630. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3631. this.rotationSpeed.set(0, 0);
  3632. break;
  3633. case c.DOLLY:
  3634. this.dollyStart.set(e.clientX, e.clientY);
  3635. break;
  3636. case c.PAN:
  3637. this.panStart.set(e.clientX, e.clientY)
  3638. }
  3639. this.emit(d.InputStart, "mouse")
  3640. }
  3641. }
  3642. ,
  3643. n.prototype.onMouseMove = function(e) {
  3644. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3645. switch (e.preventDefault(),
  3646. this.state) {
  3647. case c.ROTATE:
  3648. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3649. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3650. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3651. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3652. this.rotateStart.copy(this.rotateEnd);
  3653. break;
  3654. case c.DOLLY:
  3655. this.dollyEnd.set(e.clientX, e.clientY),
  3656. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart);
  3657. var t = this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut;
  3658. t.call(this),
  3659. this.dollyStart.copy(this.dollyEnd);
  3660. break;
  3661. case c.PAN:
  3662. this.panEnd.set(e.clientX, e.clientY),
  3663. this.panDelta.subVectors(this.panEnd, this.panStart),
  3664. this.pan(this.panDelta.x, this.panDelta.y),
  3665. this.panStart.copy(this.panEnd)
  3666. }
  3667. this.emit(d.Move, "mouse"),
  3668. this.lastMoveTime = e.timeStamp,
  3669. this.update()
  3670. }
  3671. }
  3672. ,
  3673. n.prototype.onMouseUp = function(e) {
  3674. this.enabled && (this.mouseDown = !1,
  3675. this.state = c.NONE,
  3676. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3677. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3678. this.update(),
  3679. this.rotationAcceleration.set(0, 0),
  3680. this.rotateDelta.set(0, 0)))
  3681. }
  3682. ,
  3683. n.prototype.onMouseOver = function(e) {
  3684. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3685. }
  3686. ,
  3687. n.prototype.onMouseWheel = function(e) {
  3688. if (this.enabled && o.useWheel) {
  3689. this.emit(d.Move, "wheel");
  3690. var t = e.wheelDelta || -e.detail
  3691. , i = t > 0 ? this.dollyOut : this.dollyIn;
  3692. i.call(this),
  3693. this.update()
  3694. }
  3695. }
  3696. ,
  3697. n.prototype.onKeyDown = function(e) {
  3698. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3699. this.handleKeyDown(e.which)))
  3700. }
  3701. ,
  3702. n.prototype.navRotationAcc = function(e, t) {
  3703. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3704. }
  3705. ,
  3706. n.prototype.navPanAcc = function(e, t) {
  3707. this.stopAutoPanning(),
  3708. this.panAcceleration[e] = t
  3709. }
  3710. ,
  3711. n.prototype.handleKeyDown = function(e) {
  3712. var t = !0;
  3713. switch (e) {
  3714. case u.UPARROW:
  3715. case u.I:
  3716. this.navRotationAcc("y", 1);
  3717. break;
  3718. case u.DOWNARROW:
  3719. case u.K:
  3720. this.navRotationAcc("y", -1);
  3721. break;
  3722. case u.LEFTARROW:
  3723. case u.J:
  3724. this.navRotationAcc("x", -1);
  3725. break;
  3726. case u.RIGHTARROW:
  3727. case u.L:
  3728. this.navRotationAcc("x", 1);
  3729. break;
  3730. case u.W:
  3731. this.navPanAcc("y", 1);
  3732. break;
  3733. case u.S:
  3734. this.navPanAcc("y", -1);
  3735. break;
  3736. case u.A:
  3737. this.navPanAcc("x", -1);
  3738. break;
  3739. case u.D:
  3740. this.navPanAcc("x", 1);
  3741. break;
  3742. default:
  3743. t = !1
  3744. }
  3745. t && this.emit(d.Move, "key")
  3746. }
  3747. ,
  3748. n.prototype.onKeyUp = function(e) {
  3749. this.enabled && (e.preventDefault(),
  3750. e.stopPropagation(),
  3751. this.handleKeyUp(e.which))
  3752. }
  3753. ,
  3754. n.prototype.handleKeyUp = function(e) {
  3755. switch (e) {
  3756. case u.I:
  3757. case u.K:
  3758. case u.UPARROW:
  3759. case u.DOWNARROW:
  3760. this.keyboardZoomSpeed = 0,
  3761. this.rotationAcceleration.y = 0;
  3762. break;
  3763. case u.J:
  3764. case u.L:
  3765. case u.LEFTARROW:
  3766. case u.RIGHTARROW:
  3767. this.rotationAcceleration.x = 0;
  3768. break;
  3769. case u.S:
  3770. case u.W:
  3771. this.panAcceleration.y = 0;
  3772. break;
  3773. case u.A:
  3774. case u.D:
  3775. this.panAcceleration.x = 0
  3776. }
  3777. }
  3778. ,
  3779. n.prototype.onTouchStart = function(e) {
  3780. if (this.enabled || this.state === c.NONE) {
  3781. e.preventDefault(),
  3782. e.stopPropagation(),
  3783. this.stopAutoPanning();
  3784. var t = function() {
  3785. if (2 === e.touches.length) {
  3786. var t = e.touches[0].pageX - e.touches[1].pageX
  3787. , i = e.touches[0].pageY - e.touches[1].pageY;
  3788. this.dollyStart.set(t, i)
  3789. }
  3790. }
  3791. .bind(this)
  3792. , i = function() {
  3793. this.panStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3794. }
  3795. .bind(this)
  3796. , n = function() {
  3797. this.rotateStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3798. }
  3799. .bind(this);
  3800. switch (this.state = this.touchActions[e.touches.length],
  3801. this.state) {
  3802. case c.PAN_DOLLY:
  3803. t();
  3804. case c.PAN:
  3805. i();
  3806. break;
  3807. case c.ROTATE_DOLLY:
  3808. t();
  3809. case c.ROTATE:
  3810. n()
  3811. }
  3812. this.rotationSpeed.set(0, 0),
  3813. this.emit(d.InputStart, "touch")
  3814. }
  3815. }
  3816. ,
  3817. n.prototype.onTouchMove = function(e) {
  3818. if (this.enabled && this.state !== c.NONE) {
  3819. e.preventDefault(),
  3820. e.stopPropagation();
  3821. var t = function() {
  3822. var t = e.touches[0].pageX - e.touches[1].pageX
  3823. , i = e.touches[0].pageY - e.touches[1].pageY;
  3824. this.dollyEnd.set(t, i);
  3825. var n = this.dollyStart.length() - this.dollyEnd.length();
  3826. n > 0 ? this.dollyOut(1 + n / 500) : this.dollyIn(1 - n / 500),
  3827. this.dollyStart.copy(this.dollyEnd)
  3828. }
  3829. .bind(this)
  3830. , i = function() {
  3831. this.panEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3832. this.panDelta.subVectors(this.panEnd, this.panStart),
  3833. this.pan(this.panDelta.x, this.panDelta.y),
  3834. this.panStart.copy(this.panEnd),
  3835. this.rotateDelta.set(0, 0)
  3836. }
  3837. .bind(this)
  3838. , n = function() {
  3839. this.rotateEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3840. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3841. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3842. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3843. this.rotateStart.copy(this.rotateEnd)
  3844. }
  3845. .bind(this)
  3846. , r = function() {
  3847. if (2 === e.touches.length) {
  3848. var i = window.devicePixelRatio || 1
  3849. , r = e.touches[1].pageX - e.touches[0].pageX
  3850. , s = e.touches[1].pageY - e.touches[0].pageY
  3851. , l = Math.sqrt(r * r + s * s)
  3852. , h = Math.abs(this.dollyStart.length() - l);
  3853. if (h > o.input.touchMoveThreshold * i)
  3854. this.state = c.DOLLY,
  3855. t();
  3856. else {
  3857. var u = a.average(e.touches, "pageX")
  3858. , d = a.average(e.touches, "pageY")
  3859. , p = this.rotateDelta.set(u, d).sub(this.rotateStart).length();
  3860. p > o.input.touchMoveThreshold && (this.state = c.ROTATE,
  3861. this.rotateStart.set(u, d),
  3862. n())
  3863. }
  3864. }
  3865. }
  3866. .bind(this);
  3867. switch (this.state) {
  3868. case c.PAN_DOLLY:
  3869. t();
  3870. case c.PAN:
  3871. i();
  3872. break;
  3873. case c.ROTATE_DOLLY:
  3874. r();
  3875. break;
  3876. case c.DOLLY:
  3877. t();
  3878. break;
  3879. case c.ROTATE:
  3880. n();
  3881. break;
  3882. default:
  3883. this.state = c.NONE
  3884. }
  3885. this.lastMoveTime = e.timeStamp,
  3886. this.emit(d.Move, "touch")
  3887. }
  3888. }
  3889. ,
  3890. n.prototype.onTouchEnd = function(e) {
  3891. this.enabled && (this.state === c.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3892. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3893. this.state = c.NONE,
  3894. this.update(),
  3895. this.rotationAcceleration.set(0, 0),
  3896. this.rotateDelta.set(0, 0))
  3897. }
  3898. ,
  3899. n.prototype.onPointerDown = function(e) {
  3900. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3901. id: e.pointerId,
  3902. pageX: e.pageX,
  3903. pageY: e.pageY
  3904. }),
  3905. e.touches = this.pointers,
  3906. this.onTouchStart(e)),
  3907. this.emit(d.InputStart, "pointer"))
  3908. }
  3909. ,
  3910. n.prototype.onPointerMove = function(e) {
  3911. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  3912. e.pointerId === t.id && (t.pageX = e.pageX,
  3913. t.pageY = e.pageY)
  3914. }),
  3915. e.touches = this.pointers,
  3916. this.onTouchMove(e))
  3917. }
  3918. ,
  3919. n.prototype.onPointerUp = function(e) {
  3920. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  3921. e.pointerId === t.id && this.pointers.splice(i, 1)
  3922. }
  3923. .bind(this)),
  3924. e.touches = this.pointers,
  3925. this.onTouchEnd(e))
  3926. }
  3927. ,
  3928. n.prototype.reset = function() {
  3929. this.state = c.NONE,
  3930. this.stopAutoPanning(),
  3931. this.rotationSpeed.set(0, 0),
  3932. this.rotationAcceleration.set(0, 0),
  3933. this.panSpeed.set(0, 0),
  3934. this.panAcceleration.set(0, 0)
  3935. }
  3936. ,
  3937. n.prototype.toJSON = function() {
  3938. var e = {
  3939. camera_position: {
  3940. x: s.toPrecision(this.camera.position.x, 4),
  3941. y: s.toPrecision(this.camera.position.y, 4),
  3942. z: s.toPrecision(this.camera.position.z, 4)
  3943. },
  3944. camera_quaternion: {
  3945. x: s.toPrecision(this.camera.quaternion.x, 4),
  3946. y: s.toPrecision(this.camera.quaternion.y, 4),
  3947. z: s.toPrecision(this.camera.quaternion.z, 4),
  3948. w: s.toPrecision(this.camera.quaternion.w, 4)
  3949. }
  3950. };
  3951. return e
  3952. }
  3953. ,
  3954. t.exports = n
  3955. }
  3956. , {
  3957. "../enum/ControlActions": 20,
  3958. "../enum/ControlEvents": 21,
  3959. "../enum/Keys": 30,
  3960. "../enum/MouseButton": 34,
  3961. "../enum/Vectors": 50,
  3962. "../settings": 166,
  3963. "../util/common": 185,
  3964. "../util/math": 190,
  3965. events: 202,
  3966. three: 217
  3967. }],
  3968. 13: [function(e, t, i) {
  3969. (function(i) {
  3970. "use strict";
  3971. function n(e) {
  3972. this.camera = e,
  3973. this.camera.controls = this,
  3974. this.target = new r.Vector3(0,0,0),
  3975. this.lookVector = new r.Vector3,
  3976. this.lookSpeed = .05,
  3977. this.rotationAcc = new r.Vector2,
  3978. this.rotationSpeed = new r.Vector2,
  3979. this.lat = 0,
  3980. this.lon = 0,
  3981. this.phi = 0,
  3982. this.theta = 0,
  3983. this.enabled = !1,
  3984. this.locked = !1,
  3985. this.pointer = new r.Vector2(0,0),
  3986. this.rotationHistory = [],
  3987. this.rotationDifference = new r.Vector2,
  3988. this.pointerDragOn = !1,
  3989. this.pointerDragStart = new r.Vector2(0,0),
  3990. this.pinchDistance = 0,
  3991. this.moveStart = new r.Vector2,
  3992. this.moveTolerance = .01,
  3993. this.pointersLimit = 2,
  3994. this.pointers = []
  3995. }
  3996. var r = e("three")
  3997. , o = e("../util/logger")
  3998. , a = e("../settings")
  3999. , s = e("../util/common")
  4000. , l = e("../util/math")
  4001. , c = (e("../enum/Vectors"),
  4002. e("../enum/MouseButton"))
  4003. , h = e("../enum/Keys")
  4004. , u = e("../enum/ControlEvents")
  4005. , d = e("events").EventEmitter;
  4006. new o(i);
  4007. n.prototype = Object.create(d.prototype),
  4008. n.prototype.usable = function() {
  4009. return this.enabled && !this.locked
  4010. }
  4011. ,
  4012. n.prototype.lookAt = function(e) {
  4013. var t = this.camera.position.clone().sub(e)
  4014. , i = Math.atan(t.z / t.x);
  4015. i += t.x < 0 ? Math.PI : 0,
  4016. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0,
  4017. this.lon = r.Math.radToDeg(i) + 180;
  4018. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4019. , o = Math.atan(t.y / n);
  4020. this.lat = -r.Math.radToDeg(o)
  4021. }
  4022. ,
  4023. n.prototype.startRotationFrom = function(e, t) {
  4024. l.convertScreenPositionToNDC(e, t, this.pointer),
  4025. this.pointerDragOn = !0,
  4026. this.pointerDragStart.copy(this.pointer),
  4027. this.moveStart.copy(this.pointer),
  4028. this.rotationHistory = [],
  4029. this.rotationSpeed.set(0, 0)
  4030. }
  4031. ,
  4032. n.prototype.onMouseOver = function(e) {
  4033. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  4034. }
  4035. ,
  4036. n.prototype.onTouchStart = function(e) {
  4037. if (this.usable()) {
  4038. switch (e.preventDefault(),
  4039. e.stopPropagation(),
  4040. e.touches.length) {
  4041. case 1:
  4042. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4043. break;
  4044. case 2:
  4045. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4046. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  4047. this.pinchDistance = Math.sqrt(t * t + i * i)
  4048. }
  4049. this.emit(u.InputStart, "touch")
  4050. }
  4051. }
  4052. ,
  4053. n.prototype.onPointerDown = function(e) {
  4054. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4055. id: e.pointerId,
  4056. clientX: e.clientX,
  4057. clientY: e.clientY
  4058. }),
  4059. e.touches = this.pointers,
  4060. this.onTouchStart(e),
  4061. this.emit(u.InputStart, "pointer"))
  4062. }
  4063. ,
  4064. n.prototype.onMouseDown = function(e) {
  4065. if (this.usable()) {
  4066. switch (e.preventDefault(),
  4067. e.stopPropagation(),
  4068. e.button) {
  4069. case c.LEFT:
  4070. this.startRotationFrom(e.clientX, e.clientY)
  4071. }
  4072. this.emit(u.InputStart, "mouse")
  4073. }
  4074. }
  4075. ,
  4076. n.prototype.updateRotation = function() {
  4077. if (this.usable() && this.pointerDragOn) {
  4078. var e = new r.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4079. , t = new r.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4080. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4081. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4082. , o = Math.atan2(e.y, i)
  4083. , a = Math.atan2(t.y, n);
  4084. this.rotationDifference.y = r.Math.radToDeg(o - a),
  4085. e.y = 0,
  4086. t.y = 0;
  4087. var s = Math.acos(e.dot(t) / e.length() / t.length());
  4088. isNaN(s) || (this.rotationDifference.x = r.Math.radToDeg(s),
  4089. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4090. this.pointerDragStart.copy(this.pointer)
  4091. }
  4092. }
  4093. ,
  4094. n.prototype.onMouseMove = function(e) {
  4095. this.usable() && (l.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4096. 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"))
  4097. }
  4098. ,
  4099. n.prototype.onTouchMove = function(e) {
  4100. if (this.usable())
  4101. switch (this.emit(u.Move, "touch"),
  4102. e.touches.length) {
  4103. case 1:
  4104. l.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4105. break;
  4106. case 2:
  4107. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4108. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4109. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4110. Math.abs(n) > .01 && (this.emit(u.InteractionDirect),
  4111. this.emit(u.Pinch, n),
  4112. this.pinchDistance -= n)
  4113. }
  4114. }
  4115. ,
  4116. n.prototype.onPointerMove = function(e) {
  4117. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  4118. e.pointerId === t.id && (t.clientX = e.clientX,
  4119. t.clientY = e.clientY)
  4120. }),
  4121. e.touches = this.pointers,
  4122. this.onTouchMove(e))
  4123. }
  4124. ,
  4125. n.prototype.endRotation = function() {
  4126. this.pointerDragOn = !1;
  4127. var e = s.averageVectors(this.rotationHistory);
  4128. this.rotationSpeed.set(e.x * a.rotationAfterMoveMultiplier, e.y * a.rotationAfterMoveMultiplier)
  4129. }
  4130. ,
  4131. n.prototype.onTouchEnd = function(e) {
  4132. this.usable() && (e.preventDefault(),
  4133. e.stopPropagation(),
  4134. this.endRotation())
  4135. }
  4136. ,
  4137. n.prototype.onMouseUp = function(e) {
  4138. this.usable() && (e.preventDefault(),
  4139. e.stopPropagation(),
  4140. this.endRotation())
  4141. }
  4142. ,
  4143. n.prototype.onPointerUp = function(e) {
  4144. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  4145. e.pointerId === t.id && this.pointers.splice(i, 1)
  4146. }
  4147. .bind(this)),
  4148. e.touches = this.pointers,
  4149. this.onTouchEnd(e))
  4150. }
  4151. ,
  4152. n.prototype.update = function(e) {
  4153. this.lon,
  4154. this.lat;
  4155. for (this.updateRotation(),
  4156. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > a.rotationAfterMoveHistoryCount; )
  4157. this.rotationHistory.shift();
  4158. this.lon += this.rotationDifference.x,
  4159. this.lat += this.rotationDifference.y,
  4160. this.rotationDifference.set(0, 0),
  4161. this.rotationSpeed.x = this.rotationSpeed.x * (1 - a.rotationFriction) + this.rotationAcc.x * a.rotationAccelerationInside,
  4162. this.rotationSpeed.y = this.rotationSpeed.y * (1 - a.rotationFriction) + this.rotationAcc.y * a.rotationAccelerationInside,
  4163. this.lon += this.rotationSpeed.x * e,
  4164. this.lat += this.rotationSpeed.y * e,
  4165. this.lat = Math.max(a.insideLookLimitDown, Math.min(a.insideLookLimitUp, this.lat)),
  4166. this.phi = r.Math.degToRad(90 - this.lat),
  4167. this.theta = r.Math.degToRad(this.lon),
  4168. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4169. this.lookVector.y = Math.cos(this.phi),
  4170. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4171. this.target.copy(this.lookVector).add(this.camera.position),
  4172. this.camera.lookAt(this.target)
  4173. }
  4174. ,
  4175. n.prototype.onMouseWheel = function(e) {
  4176. if (this.usable()) {
  4177. var t = e.wheelDelta || -e.detail;
  4178. this.emit(u.InteractionDirect),
  4179. this.emit(u.Scroll, t)
  4180. }
  4181. }
  4182. ,
  4183. n.prototype.onKeyDown = function(e) {
  4184. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4185. this.handleKeyDown(e.which)))
  4186. }
  4187. ,
  4188. n.prototype.handleKeyDown = function(e) {
  4189. var t = function(e, t) {
  4190. this.rotationAcc[e] = t
  4191. }
  4192. .bind(this);
  4193. this.emit(u.InteractionKey);
  4194. var i = !0;
  4195. switch (e) {
  4196. case h.LEFTARROW:
  4197. case h.J:
  4198. t("x", -1);
  4199. break;
  4200. case h.RIGHTARROW:
  4201. case h.L:
  4202. t("x", 1);
  4203. break;
  4204. case h.I:
  4205. t("y", 1);
  4206. break;
  4207. case h.K:
  4208. t("y", -1);
  4209. break;
  4210. default:
  4211. i = !1
  4212. }
  4213. i && this.emit(u.Move, "key")
  4214. }
  4215. ,
  4216. n.prototype.onKeyUp = function(e) {
  4217. this.usable() && (e.preventDefault(),
  4218. e.stopPropagation(),
  4219. this.handleKeyUp(e.which))
  4220. }
  4221. ,
  4222. n.prototype.handleKeyUp = function(e) {
  4223. switch (e) {
  4224. case h.LEFTARROW:
  4225. case h.J:
  4226. case h.RIGHTARROW:
  4227. case h.L:
  4228. this.rotationAcc.x = 0;
  4229. break;
  4230. case h.I:
  4231. case h.K:
  4232. this.rotationAcc.y = 0
  4233. }
  4234. }
  4235. ,
  4236. n.prototype.startRotating = function(e, t) {
  4237. e && (this.rotationAcc.x = e),
  4238. t && (this.rotationAcc.y = t)
  4239. }
  4240. ,
  4241. n.prototype.stopRotating = function(e) {
  4242. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4243. this.rotationAcc.set(0, 0)
  4244. }
  4245. ,
  4246. n.prototype.reset = function() {
  4247. this.pointerDragOn = !1,
  4248. this.rotationAcc.set(0, 0),
  4249. this.rotationSpeed.set(0, 0),
  4250. this.pointers = []
  4251. }
  4252. ,
  4253. n.prototype.toJSON = function() {
  4254. var e = {
  4255. camera_position: {
  4256. x: l.toPrecision(this.camera.position.x, 4),
  4257. y: l.toPrecision(this.camera.position.y, 4),
  4258. z: l.toPrecision(this.camera.position.z, 4)
  4259. },
  4260. camera_quaternion: {
  4261. x: l.toPrecision(this.camera.quaternion.x, 4),
  4262. y: l.toPrecision(this.camera.quaternion.y, 4),
  4263. z: l.toPrecision(this.camera.quaternion.z, 4),
  4264. w: l.toPrecision(this.camera.quaternion.w, 4)
  4265. }
  4266. };
  4267. return e
  4268. }
  4269. ,
  4270. n.prototype.setStateFromJSON = function(e) {
  4271. this.camera.position.copy(e.camera_position),
  4272. this.camera.quaternion.copy(e.camera_quaternion)
  4273. }
  4274. ,
  4275. t.exports = n
  4276. }
  4277. ).call(this, "/js/controls/PanoramaControls.js")
  4278. }
  4279. , {
  4280. "../enum/ControlEvents": 21,
  4281. "../enum/Keys": 30,
  4282. "../enum/MouseButton": 34,
  4283. "../enum/Vectors": 50,
  4284. "../settings": 166,
  4285. "../util/common": 185,
  4286. "../util/logger": 189,
  4287. "../util/math": 190,
  4288. events: 202,
  4289. three: 217
  4290. }],
  4291. 14: [function(e, t, i) {
  4292. (function(i) {
  4293. "use strict";
  4294. var n = e("three")
  4295. , r = e("../enum/Viewmode")
  4296. , o = e("../util/logger")
  4297. , a = new o(i);
  4298. t.exports = {
  4299. serialize: function(e) {
  4300. return encodeURI(JSON.stringify(e))
  4301. },
  4302. deserialize: function(e) {
  4303. function t(e) {
  4304. function t(e, t) {
  4305. return e && "number" == typeof t && !isNaN(t)
  4306. }
  4307. return e.reduce(t, !0)
  4308. }
  4309. try {
  4310. var i = JSON.parse(decodeURI(e))
  4311. , o = {
  4312. mode: r.fromInt(i.camera_mode),
  4313. panoId: i.scan_id,
  4314. position: (new n.Vector3).copy(i.camera_position),
  4315. quaternion: (new n.Quaternion).copy(i.camera_quaternion),
  4316. zoom: i.ortho_zoom,
  4317. floorVisibility: i.floor_visibility
  4318. }
  4319. , s = o.position;
  4320. t([s.x, s.y, s.z]) || o.position.set(0, 0, 0);
  4321. var l = o.quaternion;
  4322. return t([l.x, l.y, l.z, l.w]) || o.quaternion.set(0, 0, 0, 1),
  4323. o
  4324. } catch (i) {
  4325. a.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4326. try {
  4327. var c = e.split(",")
  4328. , h = {
  4329. x: parseFloat(c[2]),
  4330. y: parseFloat(c[3]),
  4331. z: parseFloat(c[4])
  4332. }
  4333. , u = {
  4334. x: parseFloat(c[5]),
  4335. y: parseFloat(c[6]),
  4336. z: parseFloat(c[7]),
  4337. w: parseFloat(c[8])
  4338. };
  4339. return t([h.x, h.y, h.z]) || (h.x = 0,
  4340. h.y = 0,
  4341. h.z = 0),
  4342. t([u.x, u.y, u.z, u.w]) || (u.x = 0,
  4343. u.y = 0,
  4344. u.z = 0,
  4345. u.w = 1),
  4346. {
  4347. mode: r.fromInt(c[0]),
  4348. panoId: c[1],
  4349. position: (new n.Vector3).copy(h),
  4350. quaternion: (new n.Quaternion).copy(u)
  4351. }
  4352. } catch (t) {
  4353. a.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4354. }
  4355. }
  4356. return null
  4357. }
  4358. }
  4359. }
  4360. ).call(this, "/js/controls/serializer.js")
  4361. }
  4362. , {
  4363. "../enum/Viewmode": 51,
  4364. "../util/logger": 189,
  4365. three: 217
  4366. }],
  4367. 15: [function(e, t, i) {
  4368. (function(i) {
  4369. "use strict";
  4370. function n() {
  4371. this.endlessLoop = a.warp.loop,
  4372. this.clock = new r.Clock(!0),
  4373. this.model = null,
  4374. this.player = null,
  4375. this.currentItem = null,
  4376. this.destinationItem = null,
  4377. this.tourIsPlaying = !1,
  4378. this.transitionStage = y.None,
  4379. this.nextFunc = null,
  4380. this.onTheBus = !1,
  4381. this.tourInProgress = !1,
  4382. this.reachSource = null,
  4383. this.interrupted = !1,
  4384. this.nItems = 0,
  4385. this.walkingSectionPaused = !1
  4386. }
  4387. var r = e("three")
  4388. , o = e("./util/logger")
  4389. , a = e("./settings")
  4390. , s = e("./util/transitions")
  4391. , l = e("events").EventEmitter
  4392. , c = e("./enum/Viewmode")
  4393. , h = e("./analytics")
  4394. , u = e("./enum/WarpStyle")
  4395. , s = e("./util/transitions")
  4396. , d = (e("./model/ModelManager"),
  4397. e("./enum/ModelManagerEvents"))
  4398. , p = e("./enum/DirectorEvents")
  4399. , f = e("./enum/PlayerEvents")
  4400. , g = (e("./enum/ControlEvents"),
  4401. e("./enum/BlackoutStyle"))
  4402. , m = e("./enum/PathDiscardMode")
  4403. , v = e("./enum/PathDisplayMode")
  4404. , A = (e("./player"),
  4405. new o(i))
  4406. , y = Object.freeze({
  4407. None: 0,
  4408. Moving: 1,
  4409. Aiming: 2,
  4410. Interlude: 3
  4411. })
  4412. , C = Object.freeze({
  4413. Forward: 1,
  4414. NoChange: 0,
  4415. Backwards: -1
  4416. })
  4417. , I = s.getUniqueId();
  4418. n.prototype = Object.create(l.prototype),
  4419. n.prototype.init = function(e, t) {
  4420. this.player = e,
  4421. this.modelManager = t,
  4422. this.updateModel(),
  4423. this.resetAll(),
  4424. this.bindEvents()
  4425. }
  4426. ,
  4427. n.prototype.resetAll = function() {
  4428. if (this.currentItem = null,
  4429. this.destinationItem = null,
  4430. this.tourIsPlaying = !1,
  4431. this.bgmReplay(),//xzw
  4432. this.transitionStage = y.None,
  4433. this.nextFunc = null,
  4434. this.onTheBus = !1,
  4435. this.reachSource = null,
  4436. this.interrupted = !1,
  4437. this.model) {
  4438. var e = a.path.typ === u.WALK ? u.WALK : u.STD;
  4439. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && this.model.data.player_options.fast_transitions === !1 ? e : u.BLACK
  4440. } else
  4441. this.defaultWarpStyle = u.BLACK,
  4442. A.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4443. this.resetSpecialTransition()
  4444. }
  4445. ,
  4446. n.prototype.updateModel = function() {
  4447. this.model = this.modelManager.getActiveModel(),
  4448. this.nItems = this.model.heroLocations.length
  4449. }
  4450. ,
  4451. n.prototype.bindEvents = function() {
  4452. this.modelManager.on(d.ActiveModelChanged, this.updateModel.bind(this)),
  4453. this.player.on(f.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4454. this.player.on(f.Move, this.handlePlayerMove.bind(this)),
  4455. this.player.on(f.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4456. this.player.on(f.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4457. this.player.on(f.InputStart, this.handlePlayerInputStart.bind(this)),
  4458. this.player.on(f.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4459. this.player.once(f.Move, function() {
  4460. s.cancelById(I)
  4461. })
  4462. }
  4463. ,
  4464. n.prototype.checkAndHandleWalkingtourInterruption = function(e) {
  4465. return e === u.WALK && (this.interrupt(g.NONE),
  4466. this.pauseWalkingSection(),
  4467. this.player.fastForwardActivePanoFlight(),
  4468. !0)
  4469. }
  4470. ,
  4471. n.prototype.handlePlayerMove = function(e) {
  4472. this.transitionStage === y.Interlude && this.interrupt(g.NONE),
  4473. this.emit("update.controls")
  4474. }
  4475. ,
  4476. n.prototype.handlePlayerPanoChosen = function(e, t) {
  4477. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4478. this.emit("update.controls"))
  4479. }
  4480. ,
  4481. n.prototype.handlePlayerModeChanged = function(e, t) {
  4482. this.intermediateState() || e === t || (this.onTheBus = !1,
  4483. this.emit("update.controls"))
  4484. }
  4485. ,
  4486. n.prototype.handlePlayerInputStart = function(e) {
  4487. this.transitionStage === y.Interlude && this.interrupt(g.NONE)
  4488. }
  4489. ,
  4490. n.prototype.handlePlayerFlyingStarted = function() {
  4491. this.clearWalkingSectionPaused()
  4492. }
  4493. ,
  4494. n.prototype.describe = function() {
  4495. return {
  4496. nItems: this.nItems,
  4497. currentItem: this.currentItem,
  4498. destinationItem: this.destinationItem,
  4499. tourIsPlaying: this.tourIsPlaying,
  4500. onTheBus: this.onTheBus,
  4501. endlessLoop: this.endlessLoop,
  4502. viewMode: this.player.mode,
  4503. inTransition: this._inTransition(),
  4504. transitionStage: this.transitionStage,
  4505. tourInProgress: this.tourInProgress
  4506. }
  4507. }
  4508. ,
  4509. n.prototype._inTransition = function() {
  4510. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === c.TRANSITIONING || this.tourIsPlaying
  4511. }
  4512. ,
  4513. n.prototype.bounceable = function() {
  4514. var e = this.clock.getDelta();
  4515. return this.isInterrupted() || e < .9 && e > .01 || this.player.flying && !this.player.isWarping()
  4516. }
  4517. ,
  4518. n.prototype.currentMoveDirection = function() {
  4519. return null === this.currentItem || void 0 === this.currentItem ? C.Forward : this.destinationItem === this.currentItem ? C.NoChange : this.destinationItem > this.currentItem ? C.Forward : C.Backwards
  4520. }
  4521. ,
  4522. n.prototype.clearPath = function() {
  4523. this._inTransition() || this.player.path.discardPathObject()
  4524. }
  4525. ,
  4526. n.prototype.allFloors = function() {
  4527. this.model.toggleAllFloors()
  4528. }
  4529. ,
  4530. n.prototype.actionComplete = function(e) {
  4531. if (this.interrupted = !1,
  4532. this.transitionStage = y.None,
  4533. this.resetSpecialTransition(),
  4534. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4535. this.tourIsPlaying || (this.player.disablePreRendering(),
  4536. this.player.mode === c.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4537. this.emit("update.controls"),
  4538. this.nextFunc) {
  4539. var t = this.nextFunc;
  4540. this.nextFunc = null,
  4541. t()
  4542. }
  4543. }
  4544. ,
  4545. n.prototype.awaitCompletion = function(e, t) {
  4546. this.nextFunc = t,
  4547. e()
  4548. }
  4549. ,
  4550. n.prototype.updateSuccessFunction = function(e) {
  4551. this.nextFunc = e
  4552. }
  4553. ,
  4554. n.prototype.interrupt = function(e, t) {
  4555. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4556. this.tourIsPlaying = !1,
  4557. this.bgmReplay(),//xzw
  4558. this.interrupted = !0,
  4559. this.nextFunc = null,
  4560. this.emit(p.ActionInterrupted),
  4561. null !== e && void 0 !== e || (e = g.BEGINNING),
  4562. this.player.interruptAndFastForward(e, t),
  4563. !0)
  4564. }
  4565. ,
  4566. n.prototype.wouldInterrupt = function() {
  4567. return this.transitionStage !== y.None
  4568. }
  4569. ,
  4570. n.prototype.intermediateState = function() {
  4571. return this.transitionStage !== y.None
  4572. }
  4573. ,
  4574. n.prototype.isInterrupted = function() {
  4575. return this.interrupted
  4576. }
  4577. ,
  4578. n.prototype.pauseWalkingSection = function() {
  4579. this.walkingSectionPaused = !0
  4580. }
  4581. ,
  4582. n.prototype.clearWalkingSectionPaused = function() {
  4583. this.walkingSectionPaused = !1
  4584. }
  4585. ,
  4586. n.prototype.autoTour = function() {
  4587. var e = Date.now();
  4588. this.model.auxDataPromise.then(function() {
  4589. e = Date.now() - e;
  4590. var t = a.warp.auto
  4591. , i = this.model.data && this.model.data.player_options && this.model.data.player_options.highlight_reel;
  4592. t >= 0 && this.model.heroCount() > 1 && i && s.trigger({
  4593. duration: Math.max(1e3 * Math.min(300, t) - e, 0),
  4594. done: function() {
  4595. this.playTour()
  4596. }
  4597. .bind(this),
  4598. name: "_atr",
  4599. id: I
  4600. })
  4601. }
  4602. .bind(this))
  4603. }
  4604. ,
  4605. n.prototype.atDestinationPano = function() {
  4606. if (!this.player.currentPano || null === this.destinationItem)
  4607. return !1;
  4608. var e = this.player.currentPano.id;
  4609. if (void 0 === e)
  4610. return !1;
  4611. var t = this.model.heroLocations;
  4612. return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4613. }
  4614. ,
  4615. n.prototype.redirectToItem = function(e, t) {
  4616. if (null === e || void 0 === e)
  4617. return void A.warn("Director.redirectToItem() -> Redirecting to null item.");
  4618. if (!this.wouldInterrupt())
  4619. return void A.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4620. if (this.player.mode === c.TRANSITIONING)
  4621. return void A.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4622. A.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4623. var i = function() {
  4624. s.setTimeout(function() {
  4625. this.setDestinationItem(e),
  4626. this.goToDestination(!0, g.BEGINNING, a.warp.warpInterruptionRedirectTime, !1)
  4627. }
  4628. .bind(this), 0)
  4629. }
  4630. .bind(this);
  4631. this.interrupt(g.END, 0),
  4632. this.updateSuccessFunction(i)
  4633. }
  4634. ,
  4635. n.prototype.useSpecialTransition = function(e) {
  4636. void 0 !== e && this.defaultWarpStyle !== u.BLACK && A.debug("useSpecialTransition(): " + e),
  4637. this.nextWarpStyle = u.BLACK
  4638. }
  4639. ,
  4640. n.prototype.resetSpecialTransition = function() {
  4641. this.nextWarpStyle = this.defaultWarpStyle
  4642. }
  4643. ,
  4644. n.prototype.arrivedAtDestination = function(e) {
  4645. if (this.player.flying || this.player.isWarping())
  4646. A.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4647. else {
  4648. this.transitionStage = y.Aiming;
  4649. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4650. this.player.model.fadePanoMarkers(0),
  4651. this.awaitCompletion(function() {
  4652. this.resetSpecialTransition(),
  4653. e ? this.player.aimTourCamera(this.destinationItem, v.Retain, v.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4654. }
  4655. .bind(this), t)
  4656. }
  4657. }
  4658. ,
  4659. n.prototype.goToDestination = function(e, t, i, n) {
  4660. //xzw add:
  4661. if(g_data2.tourAudio){
  4662. var tM = g_data2.tourAudio[this.model.heroLocations[this.destinationItem].sid];
  4663. if(tM && tM.music){
  4664. var s = g_Prefix+"/audio/"+g_index+"/"+tM.music;
  4665. if(g_tourAudio.src==s && !g_tourAudio.paused) return;
  4666. g_tourAudio.src = s;
  4667. g_playAudio = g_tourAudio;
  4668. g_play && g_tourAudio.play();
  4669. g_bgAudio && g_bgAudio.pause();
  4670. }
  4671. }
  4672. if (this.onTheBus = !0,
  4673. this.emit("update.controls"),
  4674. this.player.updateLastView(),
  4675. !n && this.atDestinationPano())
  4676. return void this.arrivedAtDestination(!0);
  4677. if (this.player.flying || this.player.isWarping())
  4678. A.warn("Cannot go to new destination while player is flying or warping.");
  4679. else {
  4680. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4681. , o = null
  4682. , a = null;
  4683. if (r.isPano()) {
  4684. var s = 0 === this.destinationItem || e ? u.BLACK : this.nextWarpStyle;
  4685. a = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, v.Show, m.Slow, s, t, i, this.actionComplete.bind(this)),
  4686. o = this.arrivedAtDestination.bind(this, !0)
  4687. } else
  4688. a = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4689. o = this.arrivedAtDestination.bind(this, !1);
  4690. this.transitionStage = y.Moving,
  4691. this.model.fadePanoMarkers(0),
  4692. this.awaitCompletion(function() {
  4693. a()
  4694. }
  4695. .bind(this), o),
  4696. this.emit("update.controls")
  4697. }
  4698. }
  4699. ,
  4700. n.prototype.tourInterlude = function() {
  4701. if (h.trackAlways("reach_highlight", {
  4702. reach_source: this.reachSource
  4703. }),
  4704. this.model.fadePanoMarkers(0),
  4705. this.emit("update.controls"),
  4706. this.tourIsPlaying)
  4707. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4708. this.stopTour(),
  4709. this.emit(p.TourEnd),
  4710. void (this.player.mode === c.PANORAMA && this.model.fadePanoMarkers(a.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4711. this.transitionStage = y.Interlude,
  4712. this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4713. }
  4714. .bind(this), this.goNext.bind(this))
  4715. }
  4716. ,
  4717. n.prototype.playTour = function() {
  4718. if (!this.bounceable())
  4719. return this.tourIsPlaying ? void A.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4720. this.tourInProgress = !0,
  4721. this.reachSource = "play",
  4722. this.tourIsPlaying = !0,
  4723. this.wasZoomEnabled = this.player.zoomEnabled,
  4724. this.player.zoomEnabled = !1,
  4725. this.resetSpecialTransition(),
  4726. this.emit("update.controls"),
  4727. this.emit(p.TourStart),
  4728. this.player.enablePreRendering(),
  4729. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4730. this.goToDestination()) : this.goNext()))
  4731. }
  4732. ,
  4733. n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
  4734. if(g_tourAudio && g_tourAudio.paused && g_bgAudio && g_bgAudio.paused){
  4735. g_playAudio = g_bgAudio;
  4736. g_bgAudio.play()
  4737. }
  4738. }
  4739. ,
  4740. n.prototype.stopTour = function() {
  4741. this.isInterrupted() || this.transitionStage === y.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4742. this.tourIsPlaying = !1,
  4743. this.bgmReplay(),//xzw
  4744. this.interrupt(),
  4745. this.clearWalkingSectionPaused(),
  4746. this.resetSpecialTransition(),
  4747. this.emit("update.controls"))
  4748. }
  4749. ,
  4750. n.prototype.endTourProgress = function() {
  4751. this.tourInProgress = !1,
  4752. this.emit("update.controls"),
  4753. this.emit(p.TourEnd)
  4754. }
  4755. ,
  4756. n.prototype.goToHighlight = function(e) {
  4757. if (this.wouldInterrupt())
  4758. e === this.destinationItem ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4759. else {
  4760. if (A.debug("<tour.goto " + e + ">"),
  4761. this.isInterrupted())
  4762. return;
  4763. this.clearWalkingSectionPaused(),
  4764. this.setDestinationItem(e),
  4765. this.useSpecialTransition("Hilight"),
  4766. this.goToDestination(),
  4767. h.trackAlways("reach_highlight", {
  4768. reach_source: "thumb"
  4769. })
  4770. }
  4771. }
  4772. ,
  4773. n.prototype.prevHighlight = function() {
  4774. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4775. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4776. this.reachSource = "prev",
  4777. this.goPrev()))
  4778. }
  4779. ,
  4780. n.prototype.nextHighlight = function() {
  4781. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4782. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4783. this.reachSource = "next",
  4784. this.goNext()))
  4785. }
  4786. ,
  4787. n.prototype.changeMode = function(e) {
  4788. var t = $.Deferred()
  4789. , i = t.resolve.bind(t)
  4790. , n = t.reject.bind(t);
  4791. this.emit(p.StartModeChange);
  4792. var r = function() {
  4793. return this.clearWalkingSectionPaused(),
  4794. !!this.wouldInterrupt() && (this.interrupt(),
  4795. !0)
  4796. }
  4797. .bind(this);
  4798. if (!r()) {
  4799. switch (e) {
  4800. case c.PANORAMA:
  4801. 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);
  4802. break;
  4803. case c.DOLLHOUSE:
  4804. case c.FLOORPLAN:
  4805. this.player.flyToNewMode({
  4806. mode: e
  4807. }).done(i).fail(n);
  4808. break;
  4809. case c.OUTDOOR:
  4810. 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)
  4811. }
  4812. return t.promise()
  4813. }
  4814. }
  4815. ,
  4816. n.prototype.atEndOfTour = function() {
  4817. var e = this.currentItem >= this.nItems - 1;
  4818. return e
  4819. }
  4820. ,
  4821. n.prototype.firstDestination = function() {
  4822. return this.nItems > 0 ? 0 : null
  4823. }
  4824. ,
  4825. n.prototype.finalDestination = function() {
  4826. return this.nItems > 0 ? this.nItems - 1 : null
  4827. }
  4828. ,
  4829. n.prototype.goPrev = function() {
  4830. this.tourAdvance(-1)
  4831. }
  4832. ,
  4833. n.prototype.goNext = function() {
  4834. this.tourAdvance(1)
  4835. }
  4836. ,
  4837. n.prototype.setDestinationItem = function(e) {
  4838. this.destinationItem = e,
  4839. this.emit("update.controls")
  4840. }
  4841. ,
  4842. n.prototype.setCurrentItem = function(e) {
  4843. this.currentItem = e,
  4844. this.emit("update.controls")
  4845. }
  4846. ,
  4847. n.prototype.nextItem = function(e) {
  4848. return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4849. }
  4850. ,
  4851. n.prototype.prevItem = function(e) {
  4852. return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4853. }
  4854. ,
  4855. n.prototype.tourAdvance = function(e) {
  4856. A.debug("tourAdvance(" + e + ")"),
  4857. null === this.currentItem || void 0 === this.currentItem ? this.setDestinationItem(this.firstDestination()) : this.setDestinationItem(this.currentItem + e),
  4858. this.destinationItem < 0 ? (this.setDestinationItem(this.finalDestination()),
  4859. this.useSpecialTransition("reverse-looping to end")) : this.destinationItem >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  4860. this.useSpecialTransition("looping back to start")),
  4861. this.goToDestination()
  4862. }
  4863. ,
  4864. t.exports = n
  4865. }
  4866. ).call(this, "/js/director.js")
  4867. }
  4868. , {
  4869. "./analytics": 4,
  4870. "./enum/BlackoutStyle": 18,
  4871. "./enum/ControlEvents": 21,
  4872. "./enum/DirectorEvents": 23,
  4873. "./enum/ModelManagerEvents": 33,
  4874. "./enum/PathDiscardMode": 38,
  4875. "./enum/PathDisplayMode": 39,
  4876. "./enum/PlayerEvents": 40,
  4877. "./enum/Viewmode": 51,
  4878. "./enum/WarpStyle": 52,
  4879. "./model/ModelManager": 140,
  4880. "./player": 155,
  4881. "./settings": 166,
  4882. "./util/logger": 189,
  4883. "./util/transitions": 195,
  4884. events: 202,
  4885. three: 217
  4886. }],
  4887. 16: [function(e, t, i) {
  4888. "use strict";
  4889. var n = e("three")
  4890. , r = e("./enum/Viewmode")
  4891. , o = (e("./settings"),
  4892. e("./util/transitions"))
  4893. , a = e("./enum/PlayerEvents")
  4894. , s = new n.ShaderPass(n.HorizontalBlurShader)
  4895. , l = new n.ShaderPass(n.VerticalBlurShader);
  4896. l.renderToScreen = !0;
  4897. var c = $("#player").width() / $("#player").height();
  4898. isNaN(c) && (c = 1);
  4899. var h = {
  4900. currentBlur: 0,
  4901. aspect: c,
  4902. blurStrength: 1,
  4903. hblurPass: s,
  4904. vblurPass: l,
  4905. bindEvents: function(e) {
  4906. e.on(a.ModeChanged, function(e, t) {
  4907. e === r.PANORAMA && (o.cancel(h.blur),
  4908. o.cancel(h.addBlur),
  4909. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  4910. })
  4911. },
  4912. blur: function(e) {
  4913. h.currentBlur = e;
  4914. var t = e * h.blurStrength;
  4915. l.uniforms.v.value = t / 512 * h.aspect,
  4916. s.uniforms.h.value = t / 512
  4917. },
  4918. addBlur: function(e) {
  4919. e = Math.max(e, h.currentBlur),
  4920. h.blur(e)
  4921. },
  4922. removeBlur: function(e) {
  4923. e = Math.min(1 - e, h.currentBlur),
  4924. h.blur(e)
  4925. }
  4926. };
  4927. h.blur(0),
  4928. t.exports = h
  4929. }
  4930. , {
  4931. "./enum/PlayerEvents": 40,
  4932. "./enum/Viewmode": 51,
  4933. "./settings": 166,
  4934. "./util/transitions": 195,
  4935. three: 217
  4936. }],
  4937. 17: [function(e, t, i) {
  4938. "use strict";
  4939. t.exports = {
  4940. UNKNOWN: 0,
  4941. ALIGNED: 1,
  4942. UNALIGNED: 2,
  4943. PLACED: 3
  4944. }
  4945. }
  4946. , {}],
  4947. 18: [function(e, t, i) {
  4948. "use strict";
  4949. t.exports = {
  4950. NONE: 0,
  4951. MIDDLE: 1,
  4952. END: 2,
  4953. BEGINNING: 3,
  4954. FADEIN: 4
  4955. }
  4956. }
  4957. , {}],
  4958. 19: [function(e, t, i) {
  4959. "use strict";
  4960. var n = e("three");
  4961. t.exports = {
  4962. newBlue: new n.Color(4967932),
  4963. altBlue: new n.Color(47355),
  4964. tagDefault: new n.Color(223357),
  4965. classicBlue: new n.Color(53759),
  4966. mpYellow: new n.Color(16502016),
  4967. mpOrange: new n.Color(16428055),
  4968. mpBlue: new n.Color(12096),
  4969. mpLtGrey: new n.Color(13751252),
  4970. mpDkGrey: new n.Color(10000019),
  4971. mpRed: new n.Color(12525854),
  4972. mpOrangeDesat: new n.Color(16764529),
  4973. mpBlueDesat: new n.Color(4034734),
  4974. mpRedDesat: new n.Color(14705505),
  4975. white: new n.Color(16777215),
  4976. black: new n.Color(0),
  4977. _desat: function(e, t) {
  4978. var i = t || .3
  4979. , r = (new n.Color).copy(e).getHSL();
  4980. return (new n.Color).setHSL(r.h, r.s * (1 - i), r.l)
  4981. },
  4982. _darken: function(e, t) {
  4983. var i = t || .2
  4984. , r = e.getHSL();
  4985. return (new n.Color).setHSL(r.h, r.s, r.l * (1 - i))
  4986. }
  4987. }
  4988. }
  4989. , {
  4990. three: 217
  4991. }],
  4992. 20: [function(e, t, i) {
  4993. "use strict";
  4994. t.exports = {
  4995. NONE: -1,
  4996. ROTATE: 0,
  4997. DOLLY: 1,
  4998. PAN: 2,
  4999. ROTATE_DOLLY: 3,
  5000. PAN_DOLLY: 4
  5001. }
  5002. }
  5003. , {}],
  5004. 21: [function(e, t, i) {
  5005. "use strict";
  5006. t.exports = {
  5007. Move: "move",
  5008. InteractionDirect: "interaction.direct",
  5009. InteractionKey: "interaction.key",
  5010. InteractionGui: "interaction.gui",
  5011. FlyInDirection: "fly.direction",
  5012. InputStart: "input.start",
  5013. Pinch: "input.pinch",
  5014. Scroll: "input.scroll",
  5015. AutoPanInterrupt: "autopan.interrupt",
  5016. AutoPanComplete: "autopan.complete",
  5017. AutoPanClamped: "autopan.clamped",
  5018. LongTap: "longtap"
  5019. }
  5020. }
  5021. , {}],
  5022. 22: [function(e, t, i) {
  5023. "use strict";
  5024. t.exports = Object.freeze({
  5025. FORWARD: "FORWARD",
  5026. LEFT: "LEFT",
  5027. RIGHT: "RIGHT",
  5028. BACK: "BACK",
  5029. UP: "UP",
  5030. DOWN: "DOWN"
  5031. })
  5032. }
  5033. , {}],
  5034. 23: [function(e, t, i) {
  5035. "use strict";
  5036. t.exports = {
  5037. ActionInterrupted: "action.interrupted",
  5038. TourStart: "tour.start",
  5039. TourEnd: "tour.end",
  5040. StartModeChange: "mode.startChange"
  5041. }
  5042. }
  5043. , {}],
  5044. 24: [function(e, t, i) {
  5045. "use strict";
  5046. t.exports = Object.freeze({
  5047. None: 0,
  5048. Queued: 1,
  5049. ForceQueued: 2,
  5050. Downloading: 3,
  5051. Downloaded: 4,
  5052. DownloadFailed: 5
  5053. })
  5054. }
  5055. , {}],
  5056. 25: [function(e, t, i) {
  5057. "use strict";
  5058. t.exports = {
  5059. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5060. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5061. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5062. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5063. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5064. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5065. }
  5066. }
  5067. , {}],
  5068. 26: [function(e, t, i) {
  5069. "use strict";
  5070. t.exports = {
  5071. Texture2D: 0,
  5072. TextureCube: 1
  5073. }
  5074. }
  5075. , {}],
  5076. 27: [function(e, t, i) {
  5077. "use strict";
  5078. t.exports = {
  5079. SMALL: "small",
  5080. LARGE: "large"
  5081. }
  5082. }
  5083. , {}],
  5084. 28: [function(e, t, i) {
  5085. "use strict";
  5086. var n = e("./Viewmode")
  5087. , r = {
  5088. LANDING: {},
  5089. NAVIGATION: "navigation",
  5090. MORE_HELP: "moreHelp",
  5091. TOUR_INTERACTION: {}
  5092. };
  5093. r.LANDING[n.PANORAMA] = "panorama.landing",
  5094. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5095. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5096. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5097. r.TOUR_INTERACTION.standard = "standard.tour",
  5098. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5099. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5100. t.exports = r
  5101. }
  5102. , {
  5103. "./Viewmode": 51
  5104. }],
  5105. 29: [function(e, t, i) {
  5106. "use strict";
  5107. var n = {
  5108. UP: 1,
  5109. DOWN: -1,
  5110. LEFT: "L",
  5111. RIGHT: "R",
  5112. FORWARD: "F",
  5113. BACK: "B",
  5114. reverse: {},
  5115. opposite: function(e) {
  5116. return this.reverse[e.toString()]
  5117. }
  5118. };
  5119. !function() {
  5120. n.reverse[n.UP] = n.DOWN,
  5121. n.reverse[n.DOWN] = n.UP,
  5122. n.reverse[n.LEFT] = n.RIGHT,
  5123. n.reverse[n.RIGHT] = n.LEFT,
  5124. n.reverse[n.FORWARD] = n.BACK,
  5125. n.reverse[n.BACK] = n.FORWARD
  5126. }(),
  5127. t.exports = n
  5128. }
  5129. , {}],
  5130. 30: [function(e, t, i) {
  5131. "use strict";
  5132. var n = e("../util/browser")
  5133. , r = {
  5134. ZERO: 48,
  5135. ONE: 49,
  5136. TWO: 50,
  5137. THREE: 51,
  5138. FOUR: 52,
  5139. FIVE: 53,
  5140. SIX: 54,
  5141. SEVEN: 55,
  5142. EIGHT: 56,
  5143. NINE: 57,
  5144. LEFTARROW: 37,
  5145. UPARROW: 38,
  5146. RIGHTARROW: 39,
  5147. DOWNARROW: 40,
  5148. A: 65,
  5149. B: 66,
  5150. C: 67,
  5151. D: 68,
  5152. E: 69,
  5153. F: 70,
  5154. G: 71,
  5155. H: 72,
  5156. I: 73,
  5157. J: 74,
  5158. K: 75,
  5159. L: 76,
  5160. M: 77,
  5161. N: 78,
  5162. O: 79,
  5163. P: 80,
  5164. Q: 81,
  5165. R: 82,
  5166. S: 83,
  5167. T: 84,
  5168. U: 85,
  5169. V: 86,
  5170. W: 87,
  5171. X: 88,
  5172. Y: 89,
  5173. Z: 90,
  5174. SPACE: 32,
  5175. RETURN: 13,
  5176. SEMICOLON: 186,
  5177. PLUSEQUALS: 187,
  5178. DASHUNDERSCORE: 189,
  5179. OPENBRACKET: 219
  5180. };
  5181. n.detectFirefox() && (r.SEMICOLON = 59,
  5182. r.PLUSEQUALS = 61,
  5183. r.DASHUNDERSCORE = 173),
  5184. t.exports = r
  5185. }
  5186. , {
  5187. "../util/browser": 182
  5188. }],
  5189. 31: [function(e, t, i) {
  5190. "use strict";
  5191. t.exports = {
  5192. EN_US: "en-US",
  5193. ES_MX: "es-MX",
  5194. FR_FR: "fr-FR",
  5195. DE_DE: "de-DE",
  5196. RU_RU: "ru-RU",
  5197. CN_CN: "cn-CN",
  5198. JP_JP: "jp-JP"
  5199. }
  5200. }
  5201. , {}],
  5202. 32: [function(e, t, i) {
  5203. "use strict";
  5204. t.exports = {
  5205. TagActivated: "tag.activated",
  5206. TagDismissed: "tag.dismissed",
  5207. TagNavigation: "tag.navigation"
  5208. }
  5209. }
  5210. , {}],
  5211. 33: [function(e, t, i) {
  5212. "use strict";
  5213. t.exports = {
  5214. ModelAdded: "model-added",
  5215. ActiveModelChanged: "active-model-changed"
  5216. }
  5217. }
  5218. , {}],
  5219. 34: [function(e, t, i) {
  5220. "use strict";
  5221. t.exports = {
  5222. LEFT: 0,
  5223. MIDDLE: 1,
  5224. RIGHT: 2
  5225. }
  5226. }
  5227. , {}],
  5228. 35: [function(e, t, i) {
  5229. "use strict";
  5230. t.exports = {
  5231. PanoRenderComplete: "panorama.render.complete",
  5232. TileRenderFailure: "panorama.tile.render.failed",
  5233. TileRenderSuccess: "panorama.tile.render.success",
  5234. TileUploadAttempted: "panorama.tile.upload.attempted",
  5235. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5236. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5237. }
  5238. }
  5239. , {}],
  5240. 36: [function(e, t, i) {
  5241. "use strict";
  5242. t.exports = {
  5243. BASE: 1,
  5244. STANDARD: 2,
  5245. HIGH: 3,
  5246. ULTRAHIGH: 4
  5247. }
  5248. }
  5249. , {}],
  5250. 37: [function(e, t, i) {
  5251. "use strict";
  5252. t.exports = {
  5253. LoadComplete: "panorama.load.complete",
  5254. LoadFailed: "panorama.load.failed",
  5255. TileLoaded: "panorama.tile.loaded"
  5256. }
  5257. }
  5258. , {}],
  5259. 38: [function(e, t, i) {
  5260. "use strict";
  5261. t.exports = Object.freeze({
  5262. Standard: 0,
  5263. Slow: 1,
  5264. Retain: 2
  5265. })
  5266. }
  5267. , {}],
  5268. 39: [function(e, t, i) {
  5269. "use strict";
  5270. t.exports = Object.freeze({
  5271. Show: 0,
  5272. Hide: 1,
  5273. Retain: 2
  5274. })
  5275. }
  5276. , {}],
  5277. 40: [function(e, t, i) {
  5278. "use strict";
  5279. t.exports = {
  5280. Move: "move",
  5281. MoveComplete: "move.complete",
  5282. ModeChanged: "mode.changed",
  5283. ModeChanging: "mode.changing",
  5284. PanoChosen: "pano.chosen",
  5285. ClosestPanoChanging: "closest.pano.changing",
  5286. WarpStarted: "warp.started",
  5287. WarpInterrupted: "warp.interrupted",
  5288. WarpEnded: "warp.ended",
  5289. FlyinFinished: "flyin.finished",
  5290. FlyingStarted: "flying.started",
  5291. FlyingInterrupted: "flying.interrupted",
  5292. FlyingEnded: "flying.ended",
  5293. Ready: "ready",
  5294. StartInside: "start.inside",
  5295. StartOutside: "start.outside",
  5296. ViewChanged: "view.changed",
  5297. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5298. InputStart: "input.start"
  5299. }
  5300. }
  5301. , {}],
  5302. 41: [function(e, t, i) {
  5303. "use strict";
  5304. t.exports = Object.freeze({
  5305. DEFAULT: 0,
  5306. PANOMARKERS: 1,
  5307. RETICULE: 2,
  5308. TAG: 3
  5309. })
  5310. }
  5311. , {}],
  5312. 42: [function(e, t, i) {
  5313. "use strict";
  5314. t.exports = {
  5315. visibleFloor: 1,
  5316. ghostFloor: 3,
  5317. boundingSkybox: 1,
  5318. panoMarker: 2,
  5319. reticule: 3,
  5320. tagStem: 4,
  5321. tagDisc: 5,
  5322. ribbon: 100
  5323. }
  5324. }
  5325. , {}],
  5326. 43: [function(e, t, i) {
  5327. "use strict";
  5328. t.exports = {
  5329. ContextCreated: "scene-renderer-context-created",
  5330. AfterRender: "after-render",
  5331. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5332. }
  5333. }
  5334. , {}],
  5335. 44: [function(e, t, i) {
  5336. "use strict";
  5337. t.exports = {
  5338. IDLE: "idle",
  5339. BROWSE: "browse",
  5340. EXAMINE: "examine"
  5341. }
  5342. }
  5343. , {}],
  5344. 45: [function(e, t, i) {
  5345. "use strict";
  5346. t.exports = {
  5347. TileDownloadSuccess: "tiledownloader.download.success",
  5348. TileDownloadFailure: "tiledownloader.download.failure",
  5349. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5350. }
  5351. }
  5352. , {}],
  5353. 46: [function(e, t, i) {
  5354. "use strict";
  5355. t.exports = {
  5356. CardboardAndroid: "googlevr",
  5357. GearVR: "gearvr",
  5358. CardboardIOS: "googlevrios",
  5359. Cardboard: "googlevr"
  5360. }
  5361. }
  5362. , {}],
  5363. 47: [function(e, t, i) {
  5364. "use strict";
  5365. t.exports = {
  5366. NONE: 0,
  5367. CONTEXTUAL: 1,
  5368. ANDROID: 2
  5369. }
  5370. }
  5371. , {}],
  5372. 48: [function(e, t, i) {
  5373. "use strict";
  5374. var n = {
  5375. Title: 0,
  5376. Cardboard: 1
  5377. }
  5378. , r = {
  5379. Title: 0,
  5380. Cardboard: 1,
  5381. Gear: 2
  5382. };
  5383. !function() {
  5384. [n, r].forEach(function(e) {
  5385. e.pageCount = Object.keys(e).length
  5386. })
  5387. }(),
  5388. t.exports.ios = n,
  5389. t.exports.standard = r
  5390. }
  5391. , {}],
  5392. 49: [function(e, t, i) {
  5393. "use strict";
  5394. t.exports = {
  5395. Android: "android",
  5396. IOS: "ios",
  5397. Desktop: "desktop",
  5398. UnsupportedAndroid: "android-unsupported"
  5399. }
  5400. }
  5401. , {}],
  5402. 50: [function(e, t, i) {
  5403. "use strict";
  5404. var n = e("three");
  5405. t.exports = {
  5406. UP: new n.Vector3(0,1,0),
  5407. DOWN: new n.Vector3(0,-1,0),
  5408. LEFT: new n.Vector3(-1,0,0),
  5409. RIGHT: new n.Vector3(1,0,0),
  5410. FORWARD: new n.Vector3(0,0,-1),
  5411. BACK: new n.Vector3(0,0,1)
  5412. }
  5413. }
  5414. , {
  5415. three: 217
  5416. }],
  5417. 51: [function(e, t, i) {
  5418. "use strict";
  5419. var n = e("../exception/ViewmodeConvertException")
  5420. , r = e("./coreViewmodes")
  5421. , o = e("../util/common")
  5422. , a = {
  5423. MESH: "mesh",
  5424. OUTDOOR: "outdoor",
  5425. TRANSITIONING: "transitioning",
  5426. toInt: function(e) {
  5427. switch (e) {
  5428. case this.PANORAMA:
  5429. return 1;
  5430. case this.DOLLHOUSE:
  5431. return 2;
  5432. case this.FLOORPLAN:
  5433. return 3;
  5434. case this.OUTDOOR:
  5435. return 4;
  5436. case this.TRANSITIONING:
  5437. return -1
  5438. }
  5439. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5440. },
  5441. fromInt: function(e) {
  5442. switch (e) {
  5443. case "1":
  5444. case 1:
  5445. return this.PANORAMA;
  5446. case "2":
  5447. case 2:
  5448. return this.DOLLHOUSE;
  5449. case "3":
  5450. case 3:
  5451. return this.FLOORPLAN;
  5452. case "4":
  5453. case 4:
  5454. return this.OUTDOOR
  5455. }
  5456. throw new n("No known conversion for int to viewmode for int: " + e)
  5457. },
  5458. convertWorkshopModeInt: function(e) {
  5459. switch (e) {
  5460. case "0":
  5461. case 0:
  5462. case undefined: //xzw add
  5463. return this.PANORAMA;
  5464. case "1":
  5465. case 1:
  5466. return this.FLOORPLAN;
  5467. case "2":
  5468. case 2:
  5469. return this.DOLLHOUSE;
  5470. case "3":
  5471. case 3:
  5472. return this.MESH
  5473. }
  5474. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5475. }
  5476. };
  5477. o.extendObject(a, r),
  5478. t.exports = a
  5479. }
  5480. , {
  5481. "../exception/ViewmodeConvertException": 58,
  5482. "../util/common": 185,
  5483. "./coreViewmodes": 54
  5484. }],
  5485. 52: [function(e, t, i) {
  5486. "use strict";
  5487. t.exports = {
  5488. BLACK: "black",
  5489. STD: "std",
  5490. WALK: "walk"
  5491. }
  5492. }
  5493. , {}],
  5494. 53: [function(e, t, i) {
  5495. "use strict";
  5496. t.exports = {
  5497. ZoomIn: "zoom.in",
  5498. ZoomOut: "zoom.out",
  5499. ZoomMax: "zoom.max",
  5500. ZoomMin: "zoom.min"
  5501. }
  5502. }
  5503. , {}],
  5504. 54: [function(e, t, i) {
  5505. "use strict";
  5506. t.exports = {
  5507. PANORAMA: "panorama",
  5508. DOLLHOUSE: "dollhouse",
  5509. FLOORPLAN: "floorplan"
  5510. }
  5511. }
  5512. , {}],
  5513. 55: [function(e, t, i) {
  5514. "use strict";
  5515. function n(e) {
  5516. this.message = e
  5517. }
  5518. t.exports = n
  5519. }
  5520. , {}],
  5521. 56: [function(e, t, i) {
  5522. "use strict";
  5523. function n(e) {
  5524. r.call(this, e)
  5525. }
  5526. var r = e("./BasicException");
  5527. n.prototype = Object.create(r.prototype),
  5528. t.exports = n
  5529. }
  5530. , {
  5531. "./BasicException": 55
  5532. }],
  5533. 57: [function(e, t, i) {
  5534. "use strict";
  5535. function n(e) {
  5536. r.call(this, e)
  5537. }
  5538. var r = e("./BasicException");
  5539. n.prototype = Object.create(r.prototype),
  5540. t.exports = n
  5541. }
  5542. , {
  5543. "./BasicException": 55
  5544. }],
  5545. 58: [function(e, t, i) {
  5546. "use strict";
  5547. function n(e) {
  5548. r.call(this, e)
  5549. }
  5550. var r = e("./BasicException");
  5551. n.prototype = Object.create(r.prototype),
  5552. t.exports = n
  5553. }
  5554. , {
  5555. "./BasicException": 55
  5556. }],
  5557. 59: [function(e, t, i) {
  5558. (function(i) {
  5559. "use strict";
  5560. function n(e) {
  5561. var t = {};
  5562. if (e) {
  5563. var i = e.flags;
  5564. if (i)
  5565. for (var n in i)
  5566. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5567. return t
  5568. }
  5569. return l.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5570. null
  5571. }
  5572. var r = e("./util/ajax")
  5573. , o = e("./util/showcase")
  5574. , a = e("./util/logger")
  5575. , s = ""
  5576. , l = new a(i)
  5577. , c = {};
  5578. t.exports = {
  5579. loadFeatureFlags: function(e) {
  5580. var t = $.Deferred();
  5581. return r.get(e.urlBase + s, {
  5582. responseType: "json",
  5583. prefetchFrom: "user",
  5584. auth: o.getAuthorizationHeader()
  5585. }).done(function(e) {
  5586. c = n(e),
  5587. c ? t.resolve(c) : t.reject("loading-failed")
  5588. }).fail(function() {
  5589. l.debug("Retrieval of feature flags failed."),
  5590. t.reject("loading-failed")
  5591. }),
  5592. t.promise()
  5593. },
  5594. getFlags: function() {
  5595. return c
  5596. },
  5597. updateDependentSettings: function(e, t) {
  5598. e = e || c,
  5599. e.labels && (t.labels.enabled = !0),
  5600. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5601. e.showcase_sdk && (t.sdkInit = !0),
  5602. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5603. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5604. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5605. e.hide_sc_sharing && (t.share.enabled = !1)
  5606. }
  5607. }
  5608. }
  5609. ).call(this, "/js/featureflags.js")
  5610. }
  5611. , {
  5612. "./util/ajax": 181,
  5613. "./util/logger": 189,
  5614. "./util/showcase": 193
  5615. }],
  5616. 60: [function(e, t, i) {
  5617. "use strict";
  5618. var n = (e("../util/common"),
  5619. {
  5620. status: 0,
  5621. set: function(e) {
  5622. if (isNaN(e))
  5623. return !1;
  5624. var t = $('.progressbar');
  5625. 0 > e && (e = 0);
  5626. e > 100 && (e = 100);
  5627. var width = parseInt(t.css('width').replace("px",""))/100; //获取进度条总长度除以100
  5628. var barperc = e*width;
  5629. var perc = Math.round(e);
  5630. var labelpos = (parseInt(barperc)-15);
  5631. t.find('.bar').css('width',barperc); //已经再跑颜色的百分比
  5632. t.find('.label').css('left', labelpos); //上面跟着的字的百分比
  5633. t.find('.perc').text(perc+'%'); //具体数字的百分比
  5634. this.status = e
  5635. },
  5636. done: function(e) {
  5637. return e || this.status ? (this.status = null,
  5638. this.set(100)) : this
  5639. }
  5640. });
  5641. t.exports.circleLoader = n
  5642. }
  5643. , {
  5644. "../util/common": 185
  5645. }],
  5646. 61: [function(e, t, i) {
  5647. "use strict";
  5648. t.exports = Object.freeze({
  5649. CLOSE: "modal.closer.close"
  5650. })
  5651. }
  5652. , {}],
  5653. 62: [function(e, t, i) {
  5654. "use strict";
  5655. function n(e, t) {
  5656. t && (t.stopPropagation(),
  5657. t.preventDefault()),
  5658. e && this.emit(l.CLOSE, e),
  5659. g.reset()
  5660. }
  5661. function r(e, t) {
  5662. function i() {
  5663. var t = e.offsetHeight >= $("#player").height() && e.offsetWidth >= $("#player").width();
  5664. t !== f && (f = t,
  5665. t ? (e.classList.add("closeByFooter"),
  5666. h.classList.add("closeByFooter")) : (e.classList.remove("closeByFooter"),
  5667. h.classList.remove("closeByFooter")))
  5668. }
  5669. t ? setTimeout(i, o.guiAnimationSpeed) : i()
  5670. }
  5671. var o = e("../../settings")
  5672. , a = (e("../../tag/Media/MediaEvent"),
  5673. e("../../util/browser"))
  5674. , s = e("../../util/common")
  5675. , l = e("./ModalCloserEvent")
  5676. , c = e("events").EventEmitter
  5677. , h = document.getElementsByClassName("footer")[0]
  5678. , u = h.querySelectorAll(".close")[0]
  5679. , d = null
  5680. , p = null
  5681. , f = null
  5682. , g = (a.isMobile(),
  5683. {
  5684. open: function(e) {
  5685. e && (r(e),
  5686. d && u.removeEventListener("click", d, !0),
  5687. d = n.bind(this, e.id),
  5688. u.addEventListener("click", d, !0),
  5689. p && window.removeEventListener("resize", p, !0),
  5690. p = r.bind(this, e),
  5691. window.addEventListener("resize", p, !0))
  5692. },
  5693. reset: function() {
  5694. h.classList.remove("closeByFooter"),
  5695. u.removeEventListener("click", d, !0),
  5696. window.removeEventListener("resize", p, !0),
  5697. d = p = f = null
  5698. }
  5699. });
  5700. s.extendObject(g, c.prototype),
  5701. t.exports = g
  5702. }
  5703. , {
  5704. "../../tag/Media/MediaEvent": 131,
  5705. "../../settings": 166,
  5706. "../../util/browser": 182,
  5707. "../../util/common": 185,
  5708. "./ModalCloserEvent": 61,
  5709. events: 202
  5710. }],
  5711. 63: [function(e, t, i) {
  5712. "use strict";
  5713. function n(e, t, i) {
  5714. var n = new r.GUI({
  5715. width: 400
  5716. })
  5717. , u = n.addFolder("Flydown from Dollhouse");
  5718. u.add(h.flydown, "movementEasing", Object.keys(a)),
  5719. u.add(h.flydown, "movementDelay", 0, 1).step(.01),
  5720. u.add(h.flydown, "rotationEasing", Object.keys(a)),
  5721. u.add(h.flydown, "rotationDelay", 0, 1).step(.01),
  5722. u.add(h.flydown, "modelTextureDelay", 0, 1).step(.01),
  5723. u.add(h.flydown, "skyboxDelay", 0, 1).step(.01),
  5724. u.add(h.dollhouseDefault, "minPolarAngle", 0, o.Math.degToRad(50)),
  5725. u.add(h.dollhouseDefault, "maxPolarAngle", o.Math.degToRad(50), o.Math.degToRad(170));
  5726. var d = n.addFolder("Transition between panos");
  5727. d.add(h.transition, "blur", 0, 10).onFinishChange(function() {}),
  5728. d.add(h.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5729. h.transition.flyTime = 0,
  5730. d.__controllers.forEach(function(e) {
  5731. e.updateDisplay()
  5732. })
  5733. }),
  5734. d.add(h.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5735. h.transition.flySpeed = 0,
  5736. d.__controllers.forEach(function(e) {
  5737. e.updateDisplay()
  5738. })
  5739. }),
  5740. d.add(h.transition, "aimTime", 500, 2500).step(50),
  5741. d.add(h.transition, "aimSlowFactor", 1, 3).step(.1),
  5742. d.add(h.transition, "movementEasing", Object.keys(a));
  5743. var p = n.addFolder("Path Display");
  5744. p.add(h.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5745. p.add(h.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5746. p.add(h.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5747. p.add(h.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5748. p.add(h.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5749. p.add(h.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5750. p.add(h.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5751. p.add(h.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5752. p.add(h.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5753. p.add(h.path, "color", Object.keys(l)).onFinishChange(function() {
  5754. h.path.color = l[h.path.color],
  5755. h.path.colorUp = l._desat(h.path.color),
  5756. h.path.colorDown = l.darken(h.path.color)
  5757. }),
  5758. p.add(h, "reticuleColor", Object.keys(l)).onFinishChange(function() {
  5759. h.reticuleColor = l[h.reticuleColor]
  5760. });
  5761. var f = n.addFolder("Warping")
  5762. , g = f.addFolder("Warp/Teleport");
  5763. g.add(h.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5764. g.add(h.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5765. g.add(h.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5766. g.add(h.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5767. g.add(h.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5768. g.add(h.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5769. g.add(h.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5770. g.add(h.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5771. g.add(h.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5772. g.add(h.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5773. g.add(h.path, "mapGuides").onFinishChange(function() {}),
  5774. g.add(h.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5775. g.add(h.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5776. g.add(h.path, "typ", Object.keys(c)).onFinishChange(function() {
  5777. h.path.typ = c[h.path.typ]
  5778. }),
  5779. g.add(h.warp, "loop").onChange(function() {}).onFinishChange(function() {
  5780. t.endlessLoop = h.warp.loop
  5781. }),
  5782. g.add(h.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  5783. g.add(h.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  5784. g.add(h.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  5785. var m = f.addFolder("Long Warp Only");
  5786. m.add(h.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  5787. h.warp.flySpeed = 0,
  5788. m.__controllers.forEach(function(e) {
  5789. e.updateDisplay()
  5790. })
  5791. }),
  5792. m.add(h.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  5793. m.add(h.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  5794. m.add(h.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  5795. m.add(h.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5796. m.add(h.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5797. m.add(h.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  5798. m.add(h.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  5799. m.add(h.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  5800. m.add(h.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  5801. var v = n.addFolder("Warp Esoterica");
  5802. v.add(h.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  5803. v.add(h.warp, "blur", .01, 1).onFinishChange(function() {}),
  5804. v.add(h.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5805. h.warp.minWarpTime = 0,
  5806. v.__controllers.forEach(function(e) {
  5807. e.updateDisplay()
  5808. })
  5809. }),
  5810. v.add(h.warp, "showBunny").onFinishChange(function() {}),
  5811. v.add(h.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  5812. v.add(h.warp, "movementEasing", Object.keys(a));
  5813. var A = n.addFolder("Misc");
  5814. A.add(h, "dollhouseFOV", 10, 180).onChange(function() {
  5815. i.cameras[s.DOLLHOUSE].fov = h.dollhouseFOV
  5816. }),
  5817. A.add(h, "insideFOV", 10, 180).onChange(function() {
  5818. i.cameras[s.PANORAMA].fov = h.insideFOV
  5819. }),
  5820. A.add(h, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  5821. A.add(h, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  5822. A.add(h, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  5823. var y = n.addFolder("Navigation");
  5824. y.add(h.navigation, "panoScores").onFinishChange(function() {
  5825. h.navigation.panoScores || e.panos.forEach(function(e) {
  5826. e.floor.remove(e.text3d),
  5827. e.text3d = null
  5828. })
  5829. }),
  5830. y.add(h.navigation, "mouseDirection"),
  5831. y.add(h.navigation, "filterStrictness", 0, 1),
  5832. y.add(h.navigation, "angleFactor", -60, 0),
  5833. y.add(h.navigation, "directionFactor", 1, 20),
  5834. y.add(h.navigation, "distanceFactor", -5, 5),
  5835. y.add(h.navigation, "optionalityFactor", .1, 10);
  5836. var C = n.addFolder("tags")
  5837. , I = C.addFolder("Tag Creation");
  5838. I.add(h.tags.pole, "enabled").name("poleEnabled"),
  5839. I.add(h.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  5840. I.add(h.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  5841. I.add(h.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  5842. var E = C.addFolder("Visibility");
  5843. E.add(h.tags.visibility, "anyDistance"),
  5844. E.add(h.tags.visibility, "visibleDistance", .1, 30).step(.1),
  5845. E.add(h.tags.visibility, "cameraClearance", 0, 1).step(.01),
  5846. E.add(h.tags.visibility, "hideViaFloor"),
  5847. E.add(h.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  5848. E.add(h.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  5849. var b = C.addFolder("Disc Parameters");
  5850. b.add(h.tags.disc.scale, "nearBound", .1, 10).step(.1),
  5851. b.add(h.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  5852. b.add(h.tags.disc.scale, "linkFarBound").onChange(function(e) {
  5853. e && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - h.tags.disc.scale.linkPercent / 100))
  5854. }),
  5855. b.add(h.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  5856. h.tags.disc.scale.linkFarBound && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - e / 100))
  5857. }),
  5858. b.add(h.tags.disc.scale, "maxSize", 40, 200).step(1),
  5859. b.add(h.tags.disc.scale, "minSize", 20, 100).step(1),
  5860. b.add(h.tags.disc.scale, "responsiveness", 0, 100).step(1);
  5861. var w = C.addFolder("Navigate");
  5862. w.add(h.tags.navigate, "nearestPano").name("nearestPano"),
  5863. w.add(h.tags.navigate, "lineOfSight").name("lineOfSight"),
  5864. w.add(h.tags.navigate, "reactivate").name("reactivate"),
  5865. w.add(h.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  5866. w.add(h.tags.navigate, "tiltTolerance", 0, 50).step(1),
  5867. w.add(h.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  5868. var _ = n.addFolder("Debug");
  5869. _.add(h, "wireframe").onFinishChange(function() {
  5870. e.chunks.forEach(function(t) {
  5871. t.material && (t.wireframeTwin || (t.wireframeTwin = new o.WireframeHelper(t),
  5872. t.wireframeTwin.material.depthWrite = !1,
  5873. t.wireframeTwin.material.depthTest = !1,
  5874. t.wireframeTwin.material.opacity = .5,
  5875. t.wireframeTwin.material.transparent = !0),
  5876. h.wireframe ? e.add(t.wireframeTwin) : e.remove(t.wireframeTwin))
  5877. })
  5878. }),
  5879. _.add(h, "skyboxWireframe").onFinishChange(function() {
  5880. h.skyboxWireframe ? (e.skybox.wireframe = new o.WireframeHelper(e.skybox),
  5881. e.add(e.skybox.wireframe)) : (e.remove(e.skybox.wireframe),
  5882. e.skybox.wireframe = null)
  5883. }),
  5884. _.add(h, "showSweeps").onFinishChange(function() {
  5885. e.setSweepVisibility(h.showSweeps)
  5886. }),
  5887. _.add(h, "showMesh").onFinishChange(function() {
  5888. e.chunks.forEach(function(e) {
  5889. e.visible = h.showMesh
  5890. })
  5891. }),
  5892. _.add(h, "showFloors").onFinishChange(function() {
  5893. e.floors.forEach(function(e) {
  5894. e.collider.children.forEach(function(e) {
  5895. e.material.visible = h.showFloors
  5896. })
  5897. })
  5898. }),
  5899. _.add(h, "showSkyboxes").onFinishChange(function() {
  5900. e.panos.forEach(function(e) {
  5901. e.skyboxMesh.visible = h.showSkyboxes
  5902. })
  5903. }),
  5904. _.add(h, "showNeighbors").onChange(function() {}),
  5905. _.add(e, "alpha", 0, 1)
  5906. }
  5907. var r = e("../lib/dat.gui")
  5908. , o = e("three")
  5909. , a = e("../util/easing")
  5910. , s = e("../enum/Viewmode")
  5911. , l = e("../enum/Colors")
  5912. , c = e("../enum/WarpStyle")
  5913. , h = e("../settings");
  5914. e("../tag/tag");
  5915. r.GUI.prototype.removeFolder = function(e) {
  5916. var t = this.__folders[e];
  5917. t && (t.close(),
  5918. this.__ul.removeChild(t.domElement.parentNode),
  5919. delete this.__folders[e],
  5920. this.onResize())
  5921. }
  5922. ,
  5923. t.exports.toggle = n
  5924. }
  5925. , {
  5926. "../enum/Colors": 19,
  5927. "../enum/Viewmode": 51,
  5928. "../enum/WarpStyle": 52,
  5929. "../lib/dat.gui": 93,
  5930. "../tag/tag": 123,
  5931. "../settings": 166,
  5932. "../util/easing": 186,
  5933. three: 217
  5934. }],
  5935. 64: [function(e, t, i) {
  5936. (function(i) {
  5937. "use strict";
  5938. function n(e, t, i, n) {
  5939. $(".gui-error .error-problem-text").text(e),
  5940. $(".gui-error .error-solution-text").text(t),
  5941. $(".gui-error .error-explanation").text(i),
  5942. $(".gui-error .error-actions").html(n),
  5943. $(window).resize(),
  5944. $(".gui-error").fadeIn(),
  5945. $("#bottom-logo").fadeIn()
  5946. }
  5947. function r(e) {
  5948. 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("");
  5949. n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
  5950. s.isMobile() || $("[rel=tiletip]").tooltip({
  5951. placement: "bottom",
  5952. delay: {
  5953. show: 50,
  5954. hide: 0
  5955. },
  5956. trigger: "hover",
  5957. viewport: {
  5958. selector: "body",
  5959. padding: 10
  5960. }
  5961. })
  5962. }
  5963. function o() {
  5964. var e = s.isMobile() ? "" : '<span class="link install-browser">' + h.ERROR_GENERIC_ACTIONS_2 + "</span>" + h.ERROR_GENERIC_ACTIONS_3
  5965. , t = [h.ERROR_GENERIC_ACTIONS_1, e,].join("");
  5966. n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, "", t),
  5967. s.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  5968. e.preventDefault(),
  5969. e.stopPropagation(),
  5970. r(" ")
  5971. })
  5972. }
  5973. function a(e) {
  5974. if ($("head title").text(c.pageTitle),
  5975. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  5976. $("#gui-loading").fadeOut(250),
  5977. $("#quick-blackout").hide(),
  5978. l.track("showcase_error", {
  5979. error_key: e
  5980. }),
  5981. h.locale || h.init(),
  5982. "webgl-unsupported" === e)
  5983. s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  5984. else if ("webgl-ios" === e)
  5985. 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>.");
  5986. else if ("webgl-safari" === e)
  5987. 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>.");
  5988. else if ("webgl-generic" === e)
  5989. o();
  5990. else if ("missing-urls" === e)
  5991. n(h.ERROR_MISSING_URLS_PROBLEM, "", h.ERROR_MISSING_URLS_EXPLANATION);
  5992. else if ("loading-failed" === e)
  5993. 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>.");
  5994. else {
  5995. if ("loading-failed-maintenance" !== e)
  5996. return void d.error("Unhandled error: " + e);
  5997. n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION)
  5998. }
  5999. }
  6000. var s = e("./../util/browser")
  6001. , l = e("./../analytics")
  6002. , c = e("./../settings")
  6003. , h = e("../localization/localize")
  6004. , u = e("./../util/logger")
  6005. , d = new u(i)
  6006. , p = '"https://support.port.com/hc/articles/208220058"';
  6007. t.exports.error = a
  6008. }
  6009. ).call(this, "/js/gui/error.js")
  6010. }
  6011. , {
  6012. "../localization/localize": 108,
  6013. "./../analytics": 4,
  6014. "./../settings": 166,
  6015. "./../util/browser": 182,
  6016. "./../util/logger": 189
  6017. }],
  6018. 65: [function(e, t, i) {
  6019. (function(i) {
  6020. "use strict";
  6021. function n() {
  6022. Ue = [],
  6023. je.floors.visible && Ue.push(".gui-floor", ".gui-floor-title"),
  6024. Ue.push(".hideTarget", ".pinTop.right")
  6025. }
  6026. function r() {
  6027. for (var e in je)
  6028. if (je.hasOwnProperty(e)) {
  6029. var t = je[e];
  6030. if (!t.visible)
  6031. for (var i = 0; i < t.elements.length; i++)
  6032. $(t.elements[i]).hide()
  6033. }
  6034. je.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6035. je.tourControls.visible === !1 && $("#drawer").addClass("fullWidth"),
  6036. n()
  6037. }
  6038. function o(e, t) {
  6039. var i = !K.isMobile() && Q.zoom.enabled && t.mode === _e.PANORAMA && !e.tourIsPlaying;
  6040. $("#gui-zoomin").toggle(i),
  6041. $("#gui-zoomout").toggle(i)
  6042. }
  6043. function a() {
  6044. c(),
  6045. $(".pinBottom").toggleClass("open"),
  6046. $("#drawer").toggleClass("open"),
  6047. $(".footer").toggleClass("open"),
  6048. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", Re.CLOSE_HIGHLIGHTS),
  6049. Ze("highlights")) : ($("#pullTab .icon").attr("data-original-title", Re.OPEN_HIGHLIGHTS),
  6050. ie.resetDrawer()),
  6051. setTimeout(function() {
  6052. $("#pullTab").toggleClass("opened");
  6053. }, $("#drawer").hasClass("open") ? 0 : Q.highlightAnimationDuration),
  6054. $(".pinBottom").hasClass("open") && s($(".vr-popup")) && $(".vr-popup").is(":visible") && Ae.dismiss()
  6055. }
  6056. function s(e) {
  6057. var t;
  6058. "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6059. t = e.position().top + e.outerHeight(),
  6060. e.attr("style", "display: none"));
  6061. var i = $("#player").outerHeight()
  6062. , n = i - 130;
  6063. return n < t + 25
  6064. }
  6065. function l(e) {
  6066. "touchstart" === e.type && e.preventDefault(),
  6067. e.stopPropagation()
  6068. }
  6069. function c() {
  6070. W && (W.reload(),
  6071. W.init())
  6072. }
  6073. function h(e) {
  6074. ne.show(e),
  6075. r()
  6076. }
  6077. function u(e) {
  6078. ne.progress(e)
  6079. }
  6080. function d(e, t, i) {
  6081. var n = t.player;
  6082. $("#gui-thumb").fadeOut(2500),
  6083. ne.hide(function() {
  6084. Ge = !1
  6085. }),
  6086. me.init(e, i),
  6087. de.finishSetup(Object.keys(e.tags).length),
  6088. i.on(Te.IMAGE_OPENED, Ze.bind(this, "tag"));
  6089. var s = function() {
  6090. i.dismissExaminedTag(),
  6091. i.disableHovering()
  6092. };
  6093. Ae.on(ye.OPENED, s),
  6094. Ce.on(Me.OPENED, s),
  6095. he.on(ue.OPENED, s),
  6096. fe.on(ge.OPENED, s);
  6097. var l = i.enableHovering.bind(i);
  6098. if (Ae.on(ye.CLOSED, l),
  6099. Ce.on(Me.CLOSED, l),
  6100. he.on(ue.CLOSED, l),
  6101. fe.on(ge.CLOSED, l),
  6102. Q.labels.enabled && Object.keys(e.labels).length,
  6103. e.floors.length <= 1 || !je.floors.visible ? je.floors.visible = !1 : (y(e, t),
  6104. C(e.currentFloor, n.mode)),
  6105. r(),
  6106. o(t, t.player),
  6107. $("#gui").fadeIn(1500),
  6108. je.highlight.visible && (2 !== Q.startHighlights || e.has360Views) && setTimeout(function() {
  6109. a(),
  6110. (!e.has360Views && 1 !== Q.startHighlights || e.has360Views && 0 === Q.startHighlights) && setTimeout(a, 2e3)
  6111. }, 2e3),
  6112. !K.isMobile())
  6113. for (var c = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], h = 0; h < c.length; h++)
  6114. $(c[h]).addClass("hasHover");
  6115. O(e),
  6116. de.setupToggling();
  6117. //xzw:
  6118. editHotPanel();
  6119. //czj
  6120. navBorderRadius();
  6121. //czj 编辑界面
  6122. new EditingInterface(n.sceneRenderer);
  6123. }
  6124. function editHotPanel(){//如果是编辑状态
  6125. $('#addHot').css("display","block");
  6126. $('#addHot>div').children()[0].addEventListener("click",function(){//点击添加热点
  6127. g_HotStatus = "add";
  6128. $("#player").css("cursor","cell");
  6129. })
  6130. $('#addHot>div').children()[1].addEventListener("click",function(){//点击输出新热点
  6131. var str = ""
  6132. for(var i=0; i<g_newHot.length; i++){
  6133. str+=( '"'+g_newHot[i].sid + '":{ "position":['+g_newHot[i].position+'], "rotation":['+g_newHot[i].rotation+']},\r');
  6134. }
  6135. if(str=="")logData("没有添加新热点")
  6136. else logData(str)
  6137. })
  6138. $('#addHot>div').children()[2].addEventListener("click",function(){//点击截取视图
  6139. var ev=document.createEvent("MouseEvent");//"MouseEvent"
  6140. ev.initMouseEvent("snapshotBegin",true,true,document.defaultView,0,0,0,0,0,false,false,false,false,0,null);
  6141. window.dispatchEvent(ev);
  6142. })
  6143. $('#addHot textarea').on("mousewheel",function(e){
  6144. e.stopPropagation();
  6145. })
  6146. window.logData = function(v){
  6147. $('#addHot textarea')[0].value += (v+"\r");
  6148. $('#addHot textarea')[0].scrollTop = $('#addHot textarea')[0].scrollHeight;
  6149. }
  6150. }
  6151. function navBorderRadius(){
  6152. var pullTab = $("#pullTab"),
  6153. mobileRadius = {
  6154. "bottom":{"border-bottom-left-radius":"10px","border-bottom-right-radius":"10px"},
  6155. "top":{"border-top-left-radius":"10px","border-top-right-radius":"10px"}
  6156. },
  6157. topRadius = {
  6158. "bottom":{"border-top-right-radius":"10px","border-bottom-right-radius":"10px"},
  6159. "top":{"border-bottom-left-radius":"10px","border-top-left-radius":"10px"}
  6160. }
  6161. function BorderRadius(bottom,top){
  6162. $("#gui-modes-map > div:visible:last").css(bottom);
  6163. if(pullTab.is(':visible')){
  6164. $(".viewContainer > div:visible:first").css(top);
  6165. }else{
  6166. $("#gui-modes-map > div:visible:first").css(top);
  6167. }
  6168. }
  6169. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  6170. BorderRadius(mobileRadius.bottom,mobileRadius.top);
  6171. }else{
  6172. BorderRadius(topRadius.bottom,topRadius.top);
  6173. }
  6174. }
  6175. function p(e) {
  6176. e || (e = 0),
  6177. We = !1,
  6178. window.setTimeout(function() {
  6179. We || (ze = !0,
  6180. $("#gui-spinner").stop(!0, !0).show())
  6181. }
  6182. .bind(this), e)
  6183. }
  6184. function f() {
  6185. $("#gui-spinner").stop(!0, !0),
  6186. $("#gui-spinner").fadeOut(1e3),
  6187. We = !0,
  6188. ze = !1
  6189. }
  6190. function g(e, t) {
  6191. var i = e.mode
  6192. , n = t || e.currentPano;
  6193. $("#gui-modes-dollhouse").toggleClass("active", i === _e.DOLLHOUSE),
  6194. $("#gui-modes-floorplan").toggleClass("active", i === _e.FLOORPLAN),
  6195. $("#gui-modes-inside").toggleClass("active", i === _e.PANORAMA),
  6196. i === _e.PANORAMA ? ($("#view-controllers").slideUp(500),
  6197. Q.show360Views.enabled && !n.isAligned() ? (
  6198. $(".gui-floor").addClass("hidden"),
  6199. $("#gui-modes-outside").addClass("desktop-only")) : (
  6200. $(".gui-floor").removeClass("hidden"),
  6201. $("#gui-modes-outside").removeClass("desktop-only")),
  6202. $("#gui-modes-outside").removeClass("hidden")) : i !== _e.TRANSITIONING && (f(),
  6203. Be = i,
  6204. $("#gui-modes-outside").addClass("hidden"),
  6205. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6206. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(Q.guiAnimationSpeed))
  6207. }
  6208. function m(e, t) {
  6209. var i = t.player;
  6210. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6211. l(e),
  6212. J.updateInteraction(Se.InteractionGui, "inside-button"),
  6213. J.track("USER", {
  6214. event_type: "showcase_gui",
  6215. gui_action: "click_inside_mode_button"
  6216. }),
  6217. t.changeMode(_e.PANORAMA);
  6218. }),
  6219. $("#gui-modes-outside").find("a").on("click", function(e) {
  6220. l(e),
  6221. J.track("showcase_gui", {
  6222. gui_action: "click_outside_mode_button"
  6223. }),
  6224. t.changeMode(Be)
  6225. }),
  6226. $("#gui-modes-floorplan").on("click", function(e) {
  6227. l(e),
  6228. i.mode !== _e.FLOORPLAN && (J.track("showcase_gui", {
  6229. gui_action: "click_floorplan_mode_button"
  6230. }),
  6231. t.changeMode(_e.FLOORPLAN));
  6232. }),
  6233. $("#gui-modes-dollhouse").on("click", function(e) {
  6234. l(e),
  6235. i.mode !== _e.DOLLHOUSE && (J.track("showcase_gui", {
  6236. gui_action: "click_dollhouse_mode_button"
  6237. }),
  6238. t.changeMode(_e.DOLLHOUSE));
  6239. })
  6240. }
  6241. function v(e, t) {
  6242. function i() {
  6243. document.getElementById("vr").classList.remove("hidden"),
  6244. Q.vr.allowWebVR ? K.getVRDisplay().then(function(e) {
  6245. K.supportsFullscreen() ? n(e) : (De.warn("Unable to use WebVR when full screen is not supported"),
  6246. $(".improper-embed").toggleClass("hidden", !1),
  6247. r())
  6248. }, function(e) {
  6249. r()
  6250. }) : r()
  6251. }
  6252. function n(i) {
  6253. De.info(i.displayName + " detected, VR button activates WebVR experience"),
  6254. Ie.init(e.data, t, i, q),
  6255. Ie.on(Ee.OPENED, Ze.bind(gui, "vr")),
  6256. Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe))
  6257. }
  6258. function r() {
  6259. De.info("WebVR support not found, VR button activates native app VR modal"),
  6260. Ae.init(e.data, q),
  6261. Ae.on(ye.OPENED, function() {
  6262. var e = document.getElementById("vr-modal");
  6263. return function() {
  6264. Ze("vr"),
  6265. le.open(e)
  6266. }
  6267. }()),
  6268. Ae.on(ye.CLOSED, le.reset)
  6269. }
  6270. if (Q.vr.enabled && e.supportsVR && !K.valueFromHash("mls", 0))
  6271. switch (Q.vr.option) {
  6272. case Pe.CONTEXTUAL:
  6273. i();
  6274. break;
  6275. case Pe.ANDROID:
  6276. K.detectAndroid() && i();
  6277. break;
  6278. case Pe.NONE:
  6279. }
  6280. }
  6281. function A(e, t) {
  6282. $("#play").find("a").on("mousedown touchstart", function(e) {
  6283. l(e);
  6284. Ze("tour");
  6285. ve.play();
  6286. J.trackAlways("showcase_gui", {
  6287. gui_action: "play_highlights"
  6288. })
  6289. }),
  6290. $("#pause").find("a").on("mousedown touchstart", function(e) {
  6291. l(e),
  6292. ve.pause(),
  6293. J.trackAlways("showcase_gui", {
  6294. gui_action: "pause_highlights"
  6295. })
  6296. }),
  6297. $("#gui-zoomin").find("a").on("click", function(e) {
  6298. l(e),
  6299. t.player.zoomInIncrementally()
  6300. }),
  6301. $("#gui-zoomout").find("a").on("click", function(e) {
  6302. l(e),
  6303. t.player.zoomOutIncrementally()
  6304. })
  6305. }
  6306. function y(e, t) {
  6307. for (var i = $(".gui-floor"), n = 0; n < e.floors.length; n++) {
  6308. var r = $('<div class="floorChoice" data-index="' + n + '"></div>').text(e.floors.get(n).name);
  6309. $(".gui-floor").find(".container").prepend(r)
  6310. }
  6311. i.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + Re.FLOOR_ALL + "</div>"),
  6312. i.on("click", function(e) {
  6313. l(e),
  6314. Ze("floor"),
  6315. i.toggleClass("open")
  6316. }),
  6317. $(".floorChoice").on("click", function(e) {
  6318. l(e);
  6319. var n = $(this).data("index");
  6320. "all" !== n ? (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6321. t.player.gotoFloor(n),
  6322. J.track("showcase_gui", {
  6323. gui_action: "click_floor_select_button",
  6324. interaction_source: "gui"
  6325. })) : (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6326. Ze("move"),
  6327. t.allFloors(),
  6328. J.track("showcase_gui", {
  6329. gui_action: "click_toggle_all_floors_button",
  6330. interaction_source: "gui"
  6331. })),
  6332. i.removeClass("open")
  6333. })
  6334. }
  6335. function C(e, t) {
  6336. e && (t === _e.DOLLHOUSE || t === _e.FLOORPLAN ? $(".allFloorBtn").show() : $(".allFloorBtn").hide(),
  6337. e.model.allFloorsVisible ? ($(".gui-floor-title").text(Re.FLOOR_ALL),
  6338. $(".gui-floor-number").text(Re.FLOOR_ALL),
  6339. $(".floorChoice").removeClass("active"),
  6340. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6341. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6342. $(".floorChoice").removeClass("active"),
  6343. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6344. }
  6345. function I(e) {
  6346. return e.describe().inTransition
  6347. }
  6348. function E(e) {
  6349. $("<img/>").attr("src", e).on("load", function() {
  6350. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  6351. $(this).remove()
  6352. })
  6353. }
  6354. function b(e, t, i) {
  6355. Fe = e.heroLocations.length;
  6356. var n = '<li class="thumbImg" data-index=""><img src=""></li>'
  6357. , r = 100 / Fe + "%"
  6358. , o = $("#thumb-container")
  6359. , a = $("#progressBar");
  6360. $("#status").find(".totalSteps").text(Fe);
  6361. for (var s = 0; s < Fe; s++) {
  6362. var c = e.heroLocations[s]
  6363. , h = $(n);
  6364. if (h.attr("data-index", s),
  6365. je.highlight.visible && h.find("img").attr("src", c.thumbUrl),
  6366. c.name) {
  6367. var u = $('<div class="overlay"></div>').text(c.name);
  6368. h.prepend(u)
  6369. }
  6370. if (e.has360Views && c.cameraMode === _e.PANORAMA) {
  6371. var d = e.panos.get(c.panoId)
  6372. , p = d && !d.isAligned()
  6373. , 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>';
  6374. h.prepend(f)
  6375. }
  6376. o.append(h),
  6377. a.append('<div class="step" data-idx="' + s + '" style="width:' + r + '"></div>')
  6378. }
  6379. j = 144 * Fe,
  6380. Y = 111 * Fe,
  6381. $(".thumbImg").on("mouseover", function() {
  6382. I(t) || i.showPathToHeroLocation($(this).data("index"))
  6383. }),
  6384. $(".thumbImg").on("mouseout", function() {
  6385. t.clearPath()
  6386. }),
  6387. $(".thumbImg").on("click", function(e) {
  6388. l(e);
  6389. var i = $(this);
  6390. J.updateInteraction(Se.InteractionGui, "thumbnail"),
  6391. J.trackAlways("showcase_gui", {
  6392. gui_action: "click_highlight"
  6393. }),
  6394. t.goToHighlight(i.data("index"))
  6395. }),
  6396. $(".previous").find("a").on("click", function(e) {
  6397. l(e),
  6398. J.trackAlways("showcase_gui", {
  6399. gui_action: "prev_highlight"
  6400. }),
  6401. t.prevHighlight()
  6402. }),
  6403. $(".next").find("a").on("click", function(e) {
  6404. l(e),
  6405. J.trackAlways("showcase_gui", {
  6406. gui_action: "next_highlight"
  6407. }),
  6408. t.nextHighlight()
  6409. }),
  6410. $("#drawer").on("mouseleave", function(e) {
  6411. l(e);
  6412. var t;
  6413. try {
  6414. t = new MouseEvent("mouseup",{
  6415. clientX: e.clientX,
  6416. clientY: e.clientY,
  6417. screenX: e.screenX,
  6418. screenY: e.screenY
  6419. })
  6420. } catch (i) {
  6421. t = document.createEvent("MouseEvents"),
  6422. 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)
  6423. }
  6424. document.dispatchEvent(t)
  6425. }),
  6426. W = new Sly($("#scrollFrame"),{
  6427. horizontal: !0,
  6428. itemNav: "centered",
  6429. smart: !0,
  6430. scrollTrap: !0,
  6431. scrollBy: 1,
  6432. mouseDragging: !0,
  6433. touchDragging: !0,
  6434. speed: 300,
  6435. dragHandle: !0,
  6436. dynamicHandle: !0,
  6437. clickBar: !0,
  6438. scrollBar: $("#scroller"),
  6439. activateOn: null
  6440. }).init(),
  6441. W.on("active", function(e, t) {
  6442. Ve = t,
  6443. Ze("tour"),
  6444. $(".step").removeClass("active"),
  6445. $("#status").find(".curIdx").text(t + 1);
  6446. for (var i = 0; i <= t; i++)
  6447. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6448. }),
  6449. w()
  6450. }
  6451. function w() {
  6452. var e = $("#player").width() - 20
  6453. , t = $("#scroller")
  6454. , i = $("#drawer")
  6455. , n = $(".pinBottom");
  6456. if ($("#player").width() < 488 || $("#player").height() < 488)
  6457. t.addClass("hidden"),
  6458. i.addClass("noScroll"),
  6459. n.addClass("noScroll");
  6460. else {
  6461. var r = j > e
  6462. , o = !i.hasClass("noScroll")
  6463. , a = r !== o;
  6464. a && (t.toggleClass("hidden"),
  6465. i.toggleClass("noScroll"),
  6466. n.toggleClass("noScroll"))
  6467. }
  6468. }
  6469. function _(e) {
  6470. je.tourControls.visible = e.tour_buttons && K.valueFromHash("gt", 1),
  6471. je.coBrand.visible = e.presented_by && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", !1),
  6472. je.highlight.visible = e.highlight_reel && 1 !== Q.specialEdition && Q.showHighlights
  6473. }
  6474. function T(e) {
  6475. function t(t, i) {
  6476. return !!e.player_options[t] && e[i || t]
  6477. }
  6478. $(".model-title").text(e.name);
  6479. var i = Q.pageTitle;
  6480. 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
  6481. document.title = i,
  6482. K.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  6483. delay: {
  6484. show: 50,
  6485. hide: 0
  6486. },
  6487. trigger: "hover",
  6488. html: !1,
  6489. viewport: {
  6490. selector: "body",
  6491. padding: 10
  6492. }
  6493. }),
  6494. K.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  6495. // 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"),
  6496. de.populate({
  6497. name: t("model_name", "name"),
  6498. coBrand: t("presented_by"),
  6499. description: t("model_summary", "summary"),
  6500. contactName: t("contact_name"),
  6501. address: t("address"),
  6502. phone: t("contact_phone"),
  6503. formattedPhone: e.formatted_contact_phone,
  6504. email: t("contact_email"),
  6505. url: t("external_url"),
  6506. socialSharing: e.enable_social_sharing && e.is_public
  6507. })
  6508. }
  6509. function x(e, t, i, n, r, o) {
  6510. function a() {
  6511. o.setLoadingStartTime(),
  6512. H(),
  6513. r ? (re.showMessage(t, i, je.coBrand.visible),
  6514. l()) : h(l)
  6515. }
  6516. var s = $.Deferred()
  6517. , l = s.resolve.bind(s);
  6518. return Ge = !0,
  6519. O(e),
  6520. e.data.player_options && _(e.data.player_options),
  6521. 1 === Q.specialEdition && $("body").addClass("specialEdition"),
  6522. Re.localizeGUI(),
  6523. T(e.data),
  6524. r || $(".quick").addClass("hidden"),
  6525. e.data.image && !r && E(e.data.image),
  6526. n ? (J.impression(),
  6527. a()) : (o.setWaitingStartTime(),
  6528. oe.show(r, a)),
  6529. s
  6530. }
  6531. function S(e, t, i, n, r, a, s) {
  6532. q = s,
  6533. e.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6534. e.supportedModes[_e.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6535. ae.init(),
  6536. re.init(e, a),
  6537. Oe.init(e, t, n),
  6538. $(".icon").on("mouseover", function() {
  6539. t.player && t.player.reticule.hide()
  6540. }),
  6541. m(e, t),
  6542. A(e, t),
  6543. e.data.enable_social_sharing && e.data.is_public && Q.share.enabled && (Ce.init(e.data.name),
  6544. Ce.on(Me.OPENED, function() {
  6545. var e = document.getElementById("share-modal");
  6546. return function() {
  6547. Ze("share"),
  6548. le.open(e)
  6549. }
  6550. }()),
  6551. Ce.on(Me.CLOSED, le.reset)),
  6552. e.heroLocations.length > 1 ? b(e, t, i) : (je.highlight.visible = !1,
  6553. je.tourControls.visible = !1),
  6554. de.on(pe.OPEN_INFO, Ze.bind(this, "info")),
  6555. z(),
  6556. g(i),
  6557. v(e, r),
  6558. e.on("floor.changed", C),
  6559. e.on("waiting", R.bind(this, e)),
  6560. e.on("waiting-done", P.bind(this, e)),
  6561. i.on(xe.ModeChanged, function(e, n) {
  6562. g(i),
  6563. o(t, i),
  6564. n === _e.PANORAMA && i.currentPano && !i.currentPano.isAligned() && (n = _e.OUTDOOR),
  6565. he.updateMode(n)
  6566. }),
  6567. n.on(Se.Move, Ze.bind(this, "move")),
  6568. i.on(xe.Ready, function() {
  6569. ie.init(n, i, i.tagManager, t),
  6570. i.on(xe.ModeChanged, function(e, t) {
  6571. e !== t && $(".vr-popup").is(":visible") && Ae.dismiss()
  6572. })
  6573. }),
  6574. i.on(xe.PanoChosen, function(e, t) {
  6575. g(i, t),
  6576. he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA)
  6577. }),
  6578. le.on(ce.CLOSE, function(e) {
  6579. switch (e) {
  6580. case "vr-modal":
  6581. Ae.dismiss();
  6582. break;
  6583. case "share-modal":
  6584. Ce.hide();
  6585. break;
  6586. case "terms-modal":
  6587. fe.hide()
  6588. }
  6589. });
  6590. var l = $("#play").eq(0)
  6591. , c = $("#pause").eq(0)
  6592. , h = $(".pinBottom").toArray()
  6593. , u = $("#drawer").eq(0)
  6594. , d = $("#playHead").eq(0)
  6595. , p = $("#progressBar").eq(0)
  6596. , f = $("#thumb-container").eq(0)
  6597. , y = f.children()
  6598. , I = p.children();
  6599. t.on("update.controls", function() {
  6600. var n = t.describe();
  6601. n.tourIsPlaying || i.isWarping() ? (je.tourControls.visible && (l.hide(),
  6602. c.show()),
  6603. n.tourInProgress && (h.forEach(function(e) {
  6604. e.classList.add("playing")
  6605. }),
  6606. u.addClass("playing"),
  6607. d.addClass("playing"))) : (je.tourControls.visible && (l.show(),
  6608. c.hide()),
  6609. n.tourInProgress || (ve.stopTour(),
  6610. h.forEach(function(e) {
  6611. e.classList.remove("playing")
  6612. }),
  6613. u.removeClass("playing"),
  6614. d.removeClass("playing")));
  6615. var r, a, s;
  6616. if (null !== n.currentItem) {
  6617. var p, f;
  6618. $("#status").find(".curIdx").text(n.currentItem + 1),
  6619. n.onTheBus ? (p = "active",
  6620. f = "recent") : (f = "active",
  6621. p = "recent");
  6622. var g = null === n.destinationItem || n.currentItem === n.destinationItem;
  6623. for (r = 0; r < e.heroLocations.length; r += 1)
  6624. s = y.eq(r),
  6625. a = I.eq(r),
  6626. s.removeClass(f),
  6627. a.removeClass(f),
  6628. n.onTheBus && r === n.destinationItem ? (s.addClass(p),
  6629. a.addClass(p),
  6630. W.activate(r)) : n.onTheBus && g && r === n.currentItem ? (s.addClass(p),
  6631. a.addClass(p)) : (s.removeClass(p),
  6632. a.removeClass(p))
  6633. } else
  6634. for (r = 0; r < e.heroLocations.length; r += 1)
  6635. s = y.eq(r),
  6636. a = I.eq(r),
  6637. s.removeClass("active recent"),
  6638. a.removeClass("active recent");
  6639. o(t, i)
  6640. }),
  6641. document.addEventListener("keydown", function(n) {
  6642. switch (J.updateInteraction(Se.InteractionKey),
  6643. n.which) {
  6644. case we.ZERO:
  6645. Q.debug && e.toggleAlpha();
  6646. break;
  6647. case we.NINE:
  6648. Q.debug && se.toggle();
  6649. break;
  6650. case we.ONE:
  6651. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.PANORAMA);
  6652. break;
  6653. case we.TWO:
  6654. e.outsideAllowed() && !i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) && t.changeMode(_e.DOLLHOUSE);
  6655. break;
  6656. case we.THREE:
  6657. e.outsideAllowed() && !i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) && t.changeMode(_e.FLOORPLAN);
  6658. break;
  6659. case we.FOUR:
  6660. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR);
  6661. break;
  6662. case we.SPACE:
  6663. je.tourControls.visible && ($("#playHead").hasClass("playing") || Ze("tour"));
  6664. break;
  6665. case we.RETURN:
  6666. Q.debug && e.toggleExplodeUp();
  6667. break;
  6668. case we.P:
  6669. k();
  6670. break;
  6671. case we.U:
  6672. B();
  6673. break;
  6674. case we.X:
  6675. Q.debug && e.toggleExplode();
  6676. break;
  6677. case we.PLUSEQUALS:
  6678. t.player.activatePersistentZooming(!0),
  6679. ie.hideUi();
  6680. break;
  6681. case we.DASHUNDERSCORE:
  6682. t.player.activatePersistentZooming(!1),
  6683. ie.hideUi();
  6684. break;
  6685. case we.SEVEN:
  6686. De.info("Zoom level: " + t.player.zoomLevel + ", FOV: " + t.player.zoomFov);
  6687. break;
  6688. case we.EIGHT:
  6689. t.player.decreaseZoomSpeed();
  6690. break;
  6691. case we.NINE:
  6692. t.player.increaseZoomSpeed()
  6693. }
  6694. return i && i.reticule.hide(),
  6695. !0
  6696. }
  6697. .bind(this)),
  6698. document.addEventListener("keyup", function(e) {
  6699. switch (e.which) {
  6700. case we.PLUSEQUALS:
  6701. t.player.deactivatePersistentZooming();
  6702. break;
  6703. case we.DASHUNDERSCORE:
  6704. t.player.deactivatePersistentZooming()
  6705. }
  6706. }
  6707. .bind(this)),
  6708. F(e),
  6709. L(e, t.player),
  6710. M(i),
  6711. te.setAutoPlay(e.heroCount()),
  6712. he.init(i, a.mode),
  6713. he.on(ue.OPENED, Ze.bind(this, "help")),
  6714. fe.init(),
  6715. fe.on(ge.OPENED, function() {
  6716. var e = document.getElementById("terms-modal");
  6717. return function() {
  6718. Ze("terms"),
  6719. le.open(e)
  6720. }
  6721. }()),
  6722. fe.on(ge.CLOSED, le.reset),
  6723. Q.quickstart.enabled || re.delayLanding(a.mode).then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
  6724. (Q.quickstart.enabled || i.model.outsideAllowed()) && ie.init(n, i, i.tagManager, t),
  6725. Q.profiling.enabled && se.show(),
  6726. ve.init(t)
  6727. }
  6728. function M(e) {
  6729. var t = function(e, t) {
  6730. $(e).find("a").each(function(e, i) {
  6731. t ? $(i).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(i).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  6732. i.style.pointerEvents = t ? "auto" : "none"
  6733. })
  6734. }
  6735. , i = function() {
  6736. e.zoomLevel >= Q.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  6737. e.zoomLevel <= Q.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  6738. };
  6739. e.on(Ne.ZoomMax, function() {
  6740. t("#gui-zoomin", !1),
  6741. t("#gui-zoomout", !0)
  6742. }),
  6743. e.on(Ne.ZoomMin, function() {
  6744. t("#gui-zoomin", !0),
  6745. t("#gui-zoomout", !1)
  6746. }),
  6747. e.on(Ne.ZoomIn, function() {
  6748. t("#gui-zoomout", !0)
  6749. }),
  6750. e.on(Ne.ZoomOut, function() {
  6751. t("#gui-zoomin", !0)
  6752. }),
  6753. i()
  6754. }
  6755. function R(e) {
  6756. O(e)
  6757. }
  6758. function P(e) {
  6759. O(e)
  6760. }
  6761. function O(e) {
  6762. var t = e.waitQueue.length;
  6763. t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay)
  6764. }
  6765. function L(e, t) {
  6766. He = {
  6767. gui: null,
  6768. visible: !1,
  6769. model: e,
  6770. player: t
  6771. }
  6772. }
  6773. function D(e, t) {
  6774. function i() {
  6775. var i = t.toJSON();
  6776. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + e.sid + "&start=" + be.serialize(i),
  6777. t.tagManager.activeTag && (n.linkToLocation += "&tag=" + t.tagManager.activeTag.sid)
  6778. }
  6779. var n = {}
  6780. , r = new Le.GUI({
  6781. autoPlace: !0,
  6782. width: "60%"
  6783. });
  6784. i(),
  6785. t.on(xe.ViewChanged, i),
  6786. r.add(n, "linkToLocation").name(Re.LINK_TO_LOCATION).listen(),
  6787. r.domElement.id = "datLinks";
  6788. var o = [].slice.call(r.domElement.querySelectorAll(".property-name"));
  6789. return o.forEach(function(e) {
  6790. if (!K.detectSafari()) {
  6791. var t = document.createElement("button");
  6792. t.classList.add("btn-deep-link"),
  6793. t.innerText = Re.MENU_COPY,
  6794. e.nextSibling.appendChild(t);
  6795. var i = function() {
  6796. alert(Re.LINK_ALERT_COPY),
  6797. t.hide()
  6798. };
  6799. t.addEventListener("click", function(e) {
  6800. try {
  6801. var t = e.target.parentNode.childNodes[0];
  6802. t.select();
  6803. var n = document.execCommand("copy");
  6804. t.blur(),
  6805. n || i()
  6806. } catch (e) {
  6807. i()
  6808. }
  6809. })
  6810. }
  6811. }),
  6812. $(r.__closeButton).hide(),
  6813. r
  6814. }
  6815. function N(e) {
  6816. He.gui || (He.gui = D(He.model, He.player)),
  6817. He.visible = e,
  6818. e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide()
  6819. }
  6820. function B() {
  6821. N(!He.visible)
  6822. }
  6823. function F(e) {
  6824. ke = {
  6825. gui: null,
  6826. visible: !1,
  6827. model: e
  6828. }
  6829. }
  6830. function V(e) {
  6831. var t = new Le.GUI;
  6832. return t.add(Q, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6833. e.setSweepVisibility(Q.showSweeps)
  6834. }),
  6835. t.add(Q, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6836. t.add(Q.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6837. Q.transition.flySpeed = 0,
  6838. t.__controllers.forEach(function(e) {
  6839. e.updateDisplay()
  6840. })
  6841. }),
  6842. t.add(Q.path, "opacity", 0, 1).name("Path opacity"),
  6843. $(t.__closeButton).hide(),
  6844. t
  6845. }
  6846. function U(e) {
  6847. ke.gui || (ke.gui = V(ke.model)),
  6848. ke.visible = e,
  6849. e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide()
  6850. }
  6851. function k() {
  6852. U(!ke.visible)
  6853. }
  6854. function H() {
  6855. function e(e) {
  6856. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target) || e.preventDefault()
  6857. }
  6858. $("body").css("touch-action", "none"),
  6859. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {
  6860. e.preventDefault()
  6861. });
  6862. var t = document.getElementById("terms-text")
  6863. , i = document.getElementById("more-help-wrapper")
  6864. , n = (document.getElementById("navigation-help-wrapper"),
  6865. document.getElementById("help-dialog"),
  6866. document.getElementById("tag-billboards"));
  6867. Q.useWheel && (document.body.addEventListener("mousewheel", e),
  6868. document.body.addEventListener("DOMMouseScroll", e)),
  6869. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  6870. e.stopPropagation()
  6871. })
  6872. }
  6873. function G(e, t) {
  6874. for (var i = []; e; )
  6875. i.push(e),
  6876. e = e.parentNode;
  6877. for (; t && i.indexOf(t) === -1; )
  6878. t = t.parentNode;
  6879. return t
  6880. }
  6881. function z() {
  6882. var e, t = function(t) {
  6883. e = 0 === t.button || 1 === t.which ? t.target : null
  6884. }, i = function(t) {
  6885. e !== t.target && (e = G(e, t.target));
  6886. var i = document.getElementById("gui-parent");
  6887. if (G(i, e) !== i && (e = null),
  6888. e) {
  6889. var n;
  6890. try {
  6891. n = new MouseEvent("click",t)
  6892. } catch (e) {
  6893. n = document.createEvent("MouseEvents"),
  6894. 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)
  6895. }
  6896. n.syntheticClick = !0,
  6897. e.dispatchEvent(n),
  6898. e = null
  6899. }
  6900. };
  6901. document.body.addEventListener("mousedown", t, !0),
  6902. document.body.addEventListener("mouseup", i, !0),
  6903. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6904. e.syntheticClick || (e.stopPropagation(),
  6905. "A" === e.target.nodeName && e.preventDefault())
  6906. }, !0)
  6907. }
  6908. var W, j, Y, X, Z, q, K = (e("three"),
  6909. e("../util/ajax"),
  6910. e("../util/browser")), Q = e("../settings"), J = e("../analytics"), ee = (e("../util/transitions"),
  6911. e("../util/camera"),
  6912. e("../util/logger")), te = (e("../objects/Snapshot"),
  6913. 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"),
  6914. e("../tag/Media/MediaEvent")), xe = (e("../enum/PathDiscardMode"),
  6915. e("../enum/PathDisplayMode"),
  6916. e("../enum/DirectorEvents"),
  6917. e("../enum/PlayerEvents")), Se = e("../enum/ControlEvents"), Me = e("./sharing/ShareEvents"), Re = e("../localization/localize"), Pe = (e("../enum/Vectors"),
  6918. e("../enum/WarpStyle"),
  6919. e("../enum/AlignmentType"),
  6920. e("../enum/VROption")), Oe = e("./konami"), Le = e("../lib/dat.gui"), De = new ee(i), Ne = (e("../util/showcase"),
  6921. e("../enum/ZoomEvents")), Be = _e.DOLLHOUSE, Fe = 0, Ve = 0, Ue = [".hideTarget"], ke = null, He = null, Ge = !1, ze = !1, We = !1, je = {
  6922. coBrand: {
  6923. visible: !0,
  6924. elements: [".co-brand", "#loaderCoBrand"]
  6925. },
  6926. help: {
  6927. visible: !0,
  6928. elements: [".nav-help", "#nav-help"]
  6929. },
  6930. tourControls: {
  6931. visible: !0,
  6932. elements: [".next", ".previous", "#play"]
  6933. },
  6934. highlight: {
  6935. visible: !0,
  6936. elements: ["#drawer", "#pullTab"]
  6937. },
  6938. share: {
  6939. visible: !0,
  6940. elements: [".socialButton", "#share"]
  6941. },
  6942. fullScreen: {
  6943. visible: !0,
  6944. elements: ["#gui-fullscreen"]
  6945. },
  6946. floors: {
  6947. visible: !0,
  6948. elements: [".gui-floor"]
  6949. }
  6950. }, Ye = function() {
  6951. var e = document.getElementById("drawer");
  6952. return function() {
  6953. $("#player").height() < 400 && e.classList.contains("open") && a()
  6954. }
  6955. }(), Xe = function() {
  6956. var e = document.getElementById("meta-info");
  6957. return function() {
  6958. $("#player").height() < 400 && e.classList.contains("expand") && de.toggleMeta(!0)
  6959. }
  6960. }(), Ze = function(e) {
  6961. function t() {
  6962. u.classList.contains("expand") && de.toggleMeta(!0)
  6963. }
  6964. function i() {
  6965. fe.hide()
  6966. }
  6967. function n() {
  6968. he.close()
  6969. }
  6970. function r() {
  6971. Ae.dismiss()
  6972. }
  6973. function o() {
  6974. p.hasClass("open") && a(!0)
  6975. }
  6976. function l() {
  6977. Ce.hide()
  6978. }
  6979. function c() {
  6980. f.hasClass("open") && f.removeClass("open")
  6981. }
  6982. function h() {
  6983. d.classList.contains("fadeIn") && (d.classList.contains("landing") ? re.dismissModal() : d.classList.contains("tour") && ve.dismissModal())
  6984. }
  6985. var u = document.getElementById("meta-info")
  6986. , d = document.getElementById("interaction-modal")
  6987. , p = $("#drawer").eq(0)
  6988. , f = $(".gui-floor").eq(0)
  6989. , g = $(".vr-popup").eq(0);
  6990. return function(e) {
  6991. switch (e) {
  6992. case "info":
  6993. i(),
  6994. n(),
  6995. Ye(),
  6996. l(),
  6997. c(),
  6998. r(),
  6999. h();
  7000. break;
  7001. case "terms":
  7002. t(),
  7003. n(),
  7004. o(),
  7005. l(),
  7006. c(),
  7007. r(),
  7008. h();
  7009. break;
  7010. case "help":
  7011. t(),
  7012. i(),
  7013. l(),
  7014. c(),
  7015. r(),
  7016. h();
  7017. break;
  7018. case "vr":
  7019. t(),
  7020. i(),
  7021. l(),
  7022. c(),
  7023. n(),
  7024. h(),
  7025. s(g) && o();
  7026. break;
  7027. case "highlights":
  7028. Xe(),
  7029. i(),
  7030. l(),
  7031. c();
  7032. break;
  7033. case "share":
  7034. t(),
  7035. i(),
  7036. n(),
  7037. c(),
  7038. r(),
  7039. h();
  7040. break;
  7041. case "floor":
  7042. i(),
  7043. l(),
  7044. r();
  7045. break;
  7046. case "view":
  7047. c(),
  7048. l(),
  7049. i(),
  7050. r();
  7051. break;
  7052. case "tour":
  7053. i(),
  7054. l(),
  7055. c(),
  7056. r();
  7057. break;
  7058. case "move":
  7059. i(),
  7060. l(),
  7061. c(),
  7062. r();
  7063. break;
  7064. case "resize":
  7065. t(),
  7066. Ye(),
  7067. c();
  7068. break;
  7069. case "tag":
  7070. i(),
  7071. n(),
  7072. l(),
  7073. c(),
  7074. r()
  7075. }
  7076. }
  7077. }();
  7078. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  7079. $("#gui-fullscreen").toggle(!K.isFullscreen()),
  7080. $("#gui-fullscreen-exit").toggle(!!K.isFullscreen()),
  7081. setTimeout(function() {
  7082. $(".icon:visible").hide().show(0)
  7083. }, 100)
  7084. }),
  7085. $("#gui-fullscreen").find("a").on("click", function(e) {
  7086. l(e),
  7087. K.requestFullscreen($("body")[0]),
  7088. J.track("showcase_gui", {
  7089. gui_action: "click_enter_fullscreen",
  7090. interaction_source: "gui"
  7091. }),
  7092. W.reload()
  7093. }),
  7094. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  7095. l(e),
  7096. K.exitFullscreen(),
  7097. J.track("showcase_gui", {
  7098. gui_action: "click_exit_fullscreen",
  7099. interaction_source: "gui"
  7100. })
  7101. }),
  7102. $("#volume").find("a").on("click", function(e) {//xzw 声音
  7103. l(e);
  7104. if($("#volume img")[0].src.indexOf("btn_on.png")>-1)
  7105. {
  7106. g_play = 0;
  7107. //g_bgAudio.pause();
  7108. //g_tourAudio.pause(); //g_tourAudio.volume = 0;//ios 无法改变音量
  7109. g_playAudio && g_playAudio.pause();
  7110. $("#volume img").attr("src", "./images/Volume btn_off.png");
  7111. $("#volume").attr("title", "关闭声音");
  7112. }
  7113. else if($("#volume img")[0].src.indexOf("btn_off.png")>-1)
  7114. {
  7115. g_play = 1;
  7116. g_playAudio && g_playAudio.play()
  7117. /* if(g_tourAudio && g_tourAudio.src) g_tourAudio.play();
  7118. else if(g_bgAudio)g_bgAudio.play() */
  7119. $("#volume img").attr("src", "./images/Volume btn_on.png");
  7120. $("#volume").attr("title", "打开声音");
  7121. }
  7122. }),
  7123. $(window).on("resize", function(e) {
  7124. var t = e.target.innerHeight
  7125. , i = e.target.innerWidth;
  7126. t === X && i === Z || (je.highlight.visible && w(),
  7127. Ze("resize"),
  7128. $(".pinTop.right").removeClass("hideUnderMeta"),
  7129. c(),
  7130. X = t,
  7131. Z = i)
  7132. }).resize(),
  7133. K.supportsFullscreen() || $("#gui-fullscreen").hide(),
  7134. $("#pullTab").on("click", function(e) {
  7135. l(e),
  7136. $("#drawer").hasClass("open") ? (J.trackAlways("showcase_gui", {
  7137. gui_action: "hide_highlight_reel"
  7138. }),
  7139. $(this).addClass("open").children("img").attr("src","images/auto.png")) : (J.trackAlways("showcase_gui", {
  7140. gui_action: "show_highlight_reel"
  7141. }),
  7142. $(this).removeClass("open").children("img").attr("src","images/auto-suspend.png")),
  7143. a()
  7144. }),
  7145. $("#more-menu-button").on("click", function(e) {
  7146. l(e);
  7147. var t = $("#more-menu");
  7148. t.toggleClass("open")
  7149. }),
  7150. t.exports.init = S,
  7151. t.exports.startLoading = x,
  7152. t.exports.endLoading = d,
  7153. t.exports.onProgress = u
  7154. }
  7155. ).call(this, "/js/gui/gui.js")
  7156. }
  7157. , {
  7158. "../analytics": 4,
  7159. "../controls/serializer": 14,
  7160. "../enum/AlignmentType": 17,
  7161. "../enum/BlackoutStyle": 18,
  7162. "../enum/ControlEvents": 21,
  7163. "../enum/DirectorEvents": 23,
  7164. "../enum/Keys": 30,
  7165. "../enum/PathDiscardMode": 38,
  7166. "../enum/PathDisplayMode": 39,
  7167. "../enum/PlayerEvents": 40,
  7168. "../enum/VROption": 47,
  7169. "../enum/Vectors": 50,
  7170. "../enum/Viewmode": 51,
  7171. "../enum/WarpStyle": 52,
  7172. "../enum/ZoomEvents": 53,
  7173. "../lib/dat.gui": 93,
  7174. "../localization/localize": 108,
  7175. "../tag/Media/MediaEvent": 131,
  7176. "../objects/Snapshot": 153,
  7177. "../settings": 166,
  7178. "../util/ajax": 181,
  7179. "../util/browser": 182,
  7180. "../util/camera": 183,
  7181. "../util/logger": 189,
  7182. "../util/showcase": 193,
  7183. "../util/transitions": 195,
  7184. "./closer/ModalCloserEvent": 61,
  7185. "./closer/modalCloser": 62,
  7186. "./help/HelpEvent": 66,
  7187. "./help/help": 67,
  7188. "./helpManager": 68,
  7189. "./immersiveMode": 69,
  7190. "./konami": 70,
  7191. "./landingScreen": 71,
  7192. "./loadingScreen": 72,
  7193. "./memoryUsage": 73,
  7194. "./playButton": 74,
  7195. "./populateModal": 75,
  7196. "./sharing/ShareEvents": 76,
  7197. "./sharing/modal": 77,
  7198. "./terms/TermsEvent": 78,
  7199. "./terms/terms": 79,
  7200. "./title/TitleEvents": 80,
  7201. "./title/tagToggle": 81,
  7202. "./title/titleBar": 82,
  7203. "./tourInteraction": 84,
  7204. "./vr/vrEvent": 85,
  7205. "./vr/vrModal": 87,
  7206. "./webvr/WebVrEvent": 88,
  7207. "./webvr/webVRgui": 89,
  7208. three: 217
  7209. }],
  7210. 66: [function(e, t, i) {
  7211. "use strict";
  7212. t.exports = Object.freeze({
  7213. OPENED: "help.opened",
  7214. CLOSED: "help.closed"
  7215. })
  7216. }
  7217. , {}],
  7218. 67: [function(e, t, i) {
  7219. "use strict";
  7220. function n() {
  7221. g.on("click", function(e) {
  7222. if (S && S !== l.TRANSITIONING) {
  7223. var t = window.getComputedStyle(y).getPropertyValue("opacity") > 0;
  7224. t && !M ? R.close() : r()
  7225. }
  7226. }),
  7227. w.on("click", function(e) {
  7228. R.close()
  7229. }),
  7230. E.on("click", function(e) {
  7231. S && S !== l.TRANSITIONING && (s(),
  7232. o())
  7233. }),
  7234. b.on("click", function(e) {
  7235. s(),
  7236. a()
  7237. })
  7238. }
  7239. function r() {
  7240. S && S !== l.TRANSITIONING && (M = !0,
  7241. setTimeout(function() {
  7242. M = !1
  7243. }, d.help.modalStayDuration),
  7244. R.emit(h.OPENED),
  7245. m.addClass("open " + S),
  7246. g.addClass("open"),
  7247. s(),
  7248. o(),
  7249. y.style.removeProperty ? y.style.removeProperty("display") : y.style.removeAttribute("display"),
  7250. y.classList.add("fadeIn"))
  7251. }
  7252. function o() {
  7253. E.addClass("underline-tab"),
  7254. u.fill(_, c.NAVIGATION, S),
  7255. m.addClass(S)
  7256. }
  7257. function a() {
  7258. b.addClass("underline-tab"),
  7259. u.fill(T, c.MORE_HELP),
  7260. m.addClass("more-help")
  7261. }
  7262. function s(e, t) {
  7263. m.removeClass("more-help " + l.PANORAMA + " " + l.DOLLHOUSE + " " + l.FLOORPLAN + " " + l.OUTDOOR),
  7264. I.forEach(function(e) {
  7265. e.classList.remove("underline-tab")
  7266. })
  7267. }
  7268. var l = e("../../enum/Viewmode")
  7269. , c = e("../../enum/HelpModalType")
  7270. , h = e("./HelpEvent")
  7271. , u = (e("../helpManager"),
  7272. e("./../populateModal"))
  7273. , d = e("../../settings")
  7274. , p = e("../../util/common")
  7275. , f = e("events").EventEmitter
  7276. , g = $(".footer-help").eq(0)
  7277. , m = $("#help-dialog").eq(0)
  7278. , v = document.querySelector("#quick-logo")
  7279. , A = document.querySelector("#loaderCoBrand")
  7280. , y = document.querySelector("#help-dialog")
  7281. , C = document.querySelector(".footer")
  7282. , I = $(".help-tabs").children().toArray()
  7283. , E = $(".navigation-tab").eq(0)
  7284. , b = $(".more-help-tab").eq(0)
  7285. , w = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7286. m.find(".close").eq(0))
  7287. , _ = m.find(".interactions").toArray()
  7288. , T = m.find(".ui-instructions").toArray()
  7289. , x = l.PANORAMA
  7290. , S = l.PANORAMA
  7291. , M = !1
  7292. , R = {
  7293. init: function(e, t) {
  7294. S = t,
  7295. x = t,
  7296. [y, A, v, C].forEach(function(e) {
  7297. e.classList.add(u.deviceType)
  7298. }),
  7299. n()
  7300. },
  7301. close: function() {
  7302. if (m.hasClass("open") && (this.emit(h.CLOSED),
  7303. g.removeClass("open"),
  7304. m.removeClass("open"),
  7305. y.classList.contains("fadeIn"))) {
  7306. y.classList.remove("fadeIn");
  7307. var e = S === l.TRANSITIONING ? x : S;
  7308. u.clear(_, c.NAVIGATION, e)
  7309. }
  7310. },
  7311. updateMode: function(e) {
  7312. x = S,
  7313. S = e
  7314. }
  7315. };
  7316. p.extendObject(R, f.prototype),
  7317. t.exports = R
  7318. }
  7319. , {
  7320. "../../enum/HelpModalType": 28,
  7321. "../../enum/Viewmode": 51,
  7322. "../../settings": 166,
  7323. "../../util/common": 185,
  7324. "../helpManager": 68,
  7325. "./../populateModal": 75,
  7326. "./HelpEvent": 66,
  7327. events: 202
  7328. }],
  7329. 68: [function(e, t, i) {
  7330. (function(i) {
  7331. "use strict";
  7332. var n = e("../util/browser")
  7333. , r = e("./../util/logger")
  7334. , o = e("./../settings")
  7335. , a = new r(i)
  7336. , s = function() {
  7337. var e;
  7338. try {
  7339. return e = window.localStorage.getItem("visitCount") || "0",
  7340. e = (parseFloat(e) + 1).toString(),
  7341. window.localStorage.setItem("visitCount", e),
  7342. a.debug("visitCount = " + e),
  7343. e
  7344. } catch (t) {
  7345. e = "1",
  7346. a.debug("couldn't set local storage")
  7347. }
  7348. }()
  7349. , l = !1;
  7350. t.exports = {
  7351. isHelpDisabled: function() {
  7352. return "0" === n.valueFromHash("help", null) || l
  7353. },
  7354. isLargeHelpEnabled: function() {
  7355. return ("1" === s || "1" === n.valueFromHash("help", null)) && !this.isHelpDisabled()
  7356. },
  7357. isSmallHelpEnabled: function() {
  7358. return "2" === n.valueFromHash("help", null) && !this.isHelpDisabled()
  7359. },
  7360. isHelpEnabled: function() {
  7361. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7362. },
  7363. setAutoPlay: function(e) {
  7364. l = o.warp.auto >= 0 && e > 1
  7365. }
  7366. }
  7367. }
  7368. ).call(this, "/js/gui/helpManager.js")
  7369. }
  7370. , {
  7371. "../util/browser": 182,
  7372. "./../settings": 166,
  7373. "./../util/logger": 189
  7374. }],
  7375. 69: [function(e, t, i) {
  7376. "use strict";
  7377. function n(e, t, i, n) {
  7378. F = n,
  7379. r(e, t, i, F),
  7380. o(),
  7381. N = t.mode
  7382. }
  7383. function r(e, t, i, n) {
  7384. [C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function(t) {
  7385. e.controls[t].on(v.Move, a),
  7386. e.controls[t].on(v.LongTap, c)
  7387. }),
  7388. M.on("mousewheel DOMMouseScroll", a),
  7389. i.on(m.TagActivated, a),
  7390. i.on(m.TagNavigation, a),
  7391. t.on(A.FlyingEnded, s),
  7392. t.on(A.ModeChanging, function(e, t) {
  7393. B = t !== C.PANORAMA && e !== C.PANORAMA
  7394. }),
  7395. t.on(A.ModeChanged, function(e, i) {
  7396. N = t.mode,
  7397. i !== C.TRANSITIONING ? l() : a("modeChange")
  7398. }),
  7399. n.on(y.TourStart, function() {
  7400. L = !0,
  7401. a()
  7402. }),
  7403. n.on(y.TourEnd, function() {
  7404. L = !1,
  7405. l()
  7406. }),
  7407. n.on(y.ActionInterrupted, function() {
  7408. L = !1
  7409. }),
  7410. R.addEventListener("touchend", function() {
  7411. $("#pullTab").hasClass("opened") && !L && l()
  7412. }, !0)
  7413. }
  7414. function o() {
  7415. p.isMobile() ? (b.forEach(function(e) {
  7416. e.classList.add("mobile")
  7417. }),
  7418. w.click(l)) : (b.forEach(function(e) {
  7419. e.addEventListener("mouseleave", function() {
  7420. !M.is(":hover") && b[0].classList.contains("detectHover") && l()
  7421. }, !0)
  7422. }),
  7423. M.mouseleave(function() {
  7424. b[0].classList.contains("detectHover") && l()
  7425. }))
  7426. }
  7427. function a(e) {
  7428. D || d(e) && _.hasClass("playing") || (clearTimeout(O),
  7429. P = !0,
  7430. g.close(),
  7431. h(e),
  7432. N !== C.DOLLHOUSE && N !== C.FLOORPLAN && (x.hasClass("expand") && !S.hasClass("closed") || 2 === p.valueFromHash("title", 1) ,
  7433. _.hasClass("playing") || (b.forEach(function(e) {
  7434. e.classList.add("detectHover")
  7435. }),
  7436. O = setTimeout(l, f.immersive.timeToShowAgain))))
  7437. }
  7438. function s() {
  7439. _.hasClass("playing") || (clearTimeout(O),
  7440. O = setTimeout(l, f.immersive.timeToShowAgain))
  7441. }
  7442. function l() {
  7443. clearTimeout(O),
  7444. P = !1,
  7445. I.forEach(function(e) {
  7446. e.classList.remove("drawerOpen")
  7447. }),
  7448. L || E.forEach(function(e) {
  7449. e.classList.remove("duringTour")
  7450. }),
  7451. b.forEach(function(e) {
  7452. e.classList.remove("detectHover")
  7453. })
  7454. }
  7455. function c() {
  7456. P ? l() : a(),
  7457. D = !0,
  7458. setTimeout(function() {
  7459. D = !1
  7460. }, f.immersive.uiStayDuration)
  7461. }
  7462. function h(e) {
  7463. !d(e) && L ? E.forEach(function(e) {
  7464. e.classList.remove("drawerOpen"),
  7465. e.classList.add("duringTour")
  7466. }) : _.hasClass("open") ? E.forEach(function(e) {
  7467. e.classList.remove("duringTour"),
  7468. e.classList.add("drawerOpen")
  7469. }) : B || N === C.FLOORPLAN || N === C.DOLLHOUSE || E.forEach(function(e) {
  7470. e.classList.add("fadeOut")
  7471. })
  7472. }
  7473. function u() {
  7474. T.hasClass("duringTour") || (L = !1,
  7475. a("gui"),
  7476. l())
  7477. }
  7478. function d(e) {
  7479. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7480. }
  7481. var p = e("../util/browser")
  7482. , f = e("../settings")
  7483. , g = e("./help/help")
  7484. , m = e("../enum/tagEvents")
  7485. , v = e("../enum/ControlEvents")
  7486. , A = e("../enum/PlayerEvents")
  7487. , y = e("../enum/DirectorEvents")
  7488. , A = e("../enum/PlayerEvents")
  7489. , C = e("../enum/Viewmode")
  7490. , I = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7491. , E = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7492. , b = $("#hover-bottom, #hover-top").toArray()
  7493. , w = ($("#pullTab").eq(0),
  7494. $("#playHead").eq(0),
  7495. $(".pinBottom-container").eq(0))
  7496. , _ = $("#drawer").eq(0)
  7497. , T = $("#drawer-container").eq(0)
  7498. , x = $("#meta-info").eq(0)
  7499. , S = $(".pinTop.left").eq(0)
  7500. , M = $("#player").eq(0)
  7501. , R = document.getElementById("pullTab")
  7502. , P = !1
  7503. , O = null
  7504. , L = !1
  7505. , D = !1
  7506. , N = null
  7507. , B = !1
  7508. , F = null;
  7509. t.exports.init = n,
  7510. t.exports.hideUi = a,
  7511. t.exports.resetDrawer = u
  7512. }
  7513. , {
  7514. "../enum/ControlEvents": 21,
  7515. "../enum/DirectorEvents": 23,
  7516. "../enum/tagEvents": 32,
  7517. "../enum/PlayerEvents": 40,
  7518. "../enum/Viewmode": 51,
  7519. "../settings": 166,
  7520. "../util/browser": 182,
  7521. "./help/help": 67
  7522. }],
  7523. 70: [function(e, t, i) {
  7524. (function(i) {
  7525. "use strict";
  7526. function n(e, t, i) {
  7527. l.debug("konami has the modelInstance");
  7528. var n = [];
  7529. $(window).on("keydown", function(e) {
  7530. n.push(e.which),
  7531. n.length > o.secretPanelWord.length && n.shift(),
  7532. s.equalLists(n, o.secretPanelWord) && (l.debug("Developer mode active."),
  7533. o.debug = !0)
  7534. }),
  7535. $(window).on("keydown", function n(r) {
  7536. o.debug && 72 === r.which && (e && i ? (a.toggle(e, t, i),
  7537. $(window).off("keydown", n)) : console.warn("sorry we're not ready yet"))
  7538. })
  7539. }
  7540. var r = e("./../util/logger")
  7541. , o = e("./../settings")
  7542. , a = e("./debug")
  7543. , s = e("./../util/common")
  7544. , l = (e("./gui"),
  7545. new r(i));
  7546. o.console && $("body").append('<div id="debug-console"></div>'),
  7547. t.exports.init = n
  7548. }
  7549. ).call(this, "/js/gui/konami.js")
  7550. }
  7551. , {
  7552. "./../settings": 166,
  7553. "./../util/common": 185,
  7554. "./../util/logger": 189,
  7555. "./debug": 63,
  7556. "./gui": 65
  7557. }],
  7558. 71: [function(e, t, i) {
  7559. "use strict";
  7560. function n(e, t) {
  7561. E = t.mode === p.PANORAMA && t.pano && !t.pano.isAligned() ? p.OUTDOOR : t.mode
  7562. }
  7563. function r(e) {
  7564. var t = $.Deferred();
  7565. e || t.resolve();
  7566. var i = c.startupFlyinDelay;
  7567. return e === p.PANORAMA && (i += c.dollhouse.transitionTime),
  7568. setTimeout(t.resolve.bind(t), i),
  7569. t
  7570. }
  7571. function o(e, t, i) {
  7572. var n = 0;
  7573. c.quickstart.enabled && (a(i),
  7574. n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay);
  7575. var r = function() {
  7576. e.once(g.Move, l),
  7577. t.once(f.TourStart, l)
  7578. };
  7579. s(n, r)
  7580. }
  7581. function a(e) {
  7582. return e && (y.addClass("quick-brand"),
  7583. v.before(y),
  7584. A = $(".quick-brand").toArray()),
  7585. m.addClass("fadeOut"),
  7586. setTimeout(function() {
  7587. A.forEach(function(e) {
  7588. e.classList.add("fadeIn")
  7589. })
  7590. }, c.quickstart.showTextDelay),
  7591. setTimeout(function() {
  7592. A.forEach(function(e) {
  7593. e.classList.add("fadeOut")
  7594. })
  7595. }, c.quickstart.fadeOutDelay),
  7596. !0
  7597. }
  7598. function s(e, t) {
  7599. setTimeout(function() {
  7600. if (h.isHelpEnabled()) {
  7601. if (t(),
  7602. u.init(),
  7603. C.addClass("fadeIn landing " + u.deviceType),
  7604. h.isSmallHelpEnabled())
  7605. return void C.addClass("small");
  7606. u.fill(I, d.LANDING[E]),
  7607. C.addClass(E)
  7608. }
  7609. }, e)
  7610. //csz 用户引导界面
  7611. var helpData = {
  7612. "pc":["images/pc_step1.png","images/pc_step2.png","images/pc_step3.png"],
  7613. "mobile":["images/phone_step1.png","images/phone_step2.png","images/phone_step3.png"]
  7614. }
  7615. var navIcon = $(".nav-icon .icon");
  7616. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) navIcon.attr("src",helpData.mobile[0]);
  7617. function paging(id){
  7618. id.on("click",function(){
  7619. var navPage = null;
  7620. $(this).attr("data-id") == "plus" ? navPage = +navIcon.attr("data-page")+1 : navPage = +navIcon.attr("data-page")-1;
  7621. if(navPage > helpData.length || navPage < 1) return false
  7622. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  7623. navIcon.attr({"data-page":navPage,"src":helpData.mobile[navPage - 1]});
  7624. }else{
  7625. navIcon.attr({"data-page":navPage,"src":helpData.pc[navPage - 1]});
  7626. }
  7627. })
  7628. };
  7629. paging($(".next-button"));
  7630. paging($(".prev-button"));
  7631. }
  7632. function l() {
  7633. u.clear(I, d.LANDING[E]),
  7634. C.removeClass("fadeIn")
  7635. }
  7636. var c = e("../settings")
  7637. , h = (e("./help/help"),
  7638. e("./helpManager"))
  7639. , u = e("./populateModal")
  7640. , d = e("../enum/HelpModalType")
  7641. , p = e("../enum/Viewmode")
  7642. , f = e("../enum/DirectorEvents")
  7643. , g = e("../enum/PlayerEvents")
  7644. , m = $("#quick-blackout").eq(0)
  7645. , v = $("#quick-logo").eq(0)
  7646. , A = $(".quick-brand").toArray()
  7647. , y = $("#loaderCoBrand").eq(0)
  7648. , C = $("#interaction-modal").eq(0)
  7649. , I = C.find(".interaction").toArray()
  7650. , E = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7651. "");
  7652. t.exports.delayLanding = r,
  7653. t.exports.showMessage = o,
  7654. t.exports.init = n,
  7655. t.exports.dismissModal = l
  7656. }
  7657. , {
  7658. "../enum/DirectorEvents": 23,
  7659. "../enum/HelpModalType": 28,
  7660. "../enum/PlayerEvents": 40,
  7661. "../enum/Viewmode": 51,
  7662. "../settings": 166,
  7663. "./help/help": 67,
  7664. "./helpManager": 68,
  7665. "./populateModal": 75
  7666. }],
  7667. 72: [function(e, t, i) {
  7668. "use strict";
  7669. var n = e("./circleLoader").circleLoader;
  7670. t.exports = {
  7671. element: $("#gui-loading"),
  7672. hide: function(e) {
  7673. n.done(),
  7674. this.element.fadeOut(2500, e)
  7675. },
  7676. show: function(e) {
  7677. this.element.fadeIn(500, function() {
  7678. this.element.css("display", "table"),
  7679. e && e()
  7680. }
  7681. .bind(this))
  7682. },
  7683. progress: function(e) {
  7684. n.set(e)
  7685. }
  7686. }
  7687. }
  7688. , {
  7689. "./circleLoader": 60
  7690. }],
  7691. 73: [function(e, t, i) {
  7692. "use strict";
  7693. var n = e("../settings")
  7694. , r = $("#memory-info")
  7695. , o = r.find("#memory-gpu")
  7696. , a = !1;
  7697. t.exports = {
  7698. show: function() {
  7699. n.profiling.enabled && (r.show(),
  7700. a = !0)
  7701. },
  7702. hide: function() {
  7703. r.hide(),
  7704. a = !1
  7705. },
  7706. toggle: function() {
  7707. a ? this.hide() : this.show()
  7708. },
  7709. update: function(e) {
  7710. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7711. }
  7712. }
  7713. }
  7714. , {
  7715. "../settings": 166
  7716. }],
  7717. 74: [function(e, t, i) {
  7718. "use strict";
  7719. var n = e("../util/browser")
  7720. , r = e("../analytics");
  7721. e("../settings");
  7722. t.exports = {
  7723. show: function(e, t) {
  7724. $("#gui-message").fadeIn(250, function() {
  7725. $(this).css("display", "table");
  7726. var e = $("#gui-message").fracs().visible >= .5;
  7727. r.impression({
  7728. visible: e,
  7729. immediate: !0
  7730. })
  7731. }),
  7732. e && $("#quick-blackout").addClass("fadeOut"),
  7733. $("#button-play").on("click", function(i) {
  7734. return n.inIframe() && n.isMobile() ? n.valueFromHash("nt", !1) ? window.open(self.location.href, "_blank") : void (top.location.href = self.location.href) : e ? (i.stopPropagation(),
  7735. $("#quick-blackout").removeClass("fadeOut"),
  7736. $("#gui-message").hide(),
  7737. void t()) : void $("#gui-message").fadeOut(500, function() {
  7738. t()
  7739. })
  7740. })
  7741. }
  7742. }
  7743. }
  7744. , {
  7745. "../analytics": 4,
  7746. "../settings": 166,
  7747. "../util/browser": 182
  7748. }],
  7749. 75: [function(e, t, i) {
  7750. "use strict";
  7751. function n(e, t, i, n) {
  7752. function r(e) {
  7753. return e.classList.contains(a)
  7754. }
  7755. var o = i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType];
  7756. //for (var a in o) {
  7757. //var s = e.find(r);
  7758. //for (var l in o[a]) {
  7759. //var c = o[a][l];
  7760. //if ("top-info" === l || "bottom-info" === l) {
  7761. //var h = n ? c : "";
  7762. //czj 注释掉第一次打开的用户引导
  7763. //s.querySelector("." + l).textContent = h
  7764. //} else {
  7765. //var u = n ? c : "";
  7766. //, d = s.querySelector("." + l);
  7767. //d.src = u,
  7768. //n ? d.classList.remove("hidden") : d.classList.add("hidden")
  7769. //}
  7770. //}
  7771. //}
  7772. //var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
  7773. // p.forEach(function(e) {
  7774. // n ? e.classList.remove("hidden") : e.classList.add("hidden")
  7775. // })
  7776. }
  7777. var r = e("../util/browser")
  7778. , o = e("../localization/localize")
  7779. , a = e("../enum/HelpModalType")
  7780. , s = (e("../enum/HelpModalSize"),
  7781. e("../enum/Viewmode"));
  7782. t.exports = {
  7783. init: function() {
  7784. if (!this.hasInitialized) {
  7785. this.hasInitialized = !0,
  7786. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7787. this.assets = {},
  7788. this.assets[a.LANDING[s.PANORAMA]] = {
  7789. desktop: {
  7790. left: {
  7791. "top-info": o.ROTATE,
  7792. "big-image": "images/nav_help_mouse_drag_left.png",
  7793. keyboard: "images/nav_help_keyboard_left_right.png"
  7794. },
  7795. middle: {
  7796. "top-info": o.MOVE,
  7797. "big-image": "images/nav_help_mouse_click.png",
  7798. keyboard: "images/nav_help_keyboard_up_down.png"
  7799. },
  7800. right: {
  7801. "top-info": o.ZOOM,
  7802. "big-image": "images/nav_help_mouse_zoom.png",
  7803. keyboard: "images/nav_help_zoom_keys.png"
  7804. }
  7805. },
  7806. mobile: {
  7807. left: {
  7808. "top-info": o.ROTATE,
  7809. "big-image": "images/nav_help_gesture_drag.png"
  7810. },
  7811. middle: {
  7812. "top-info": o.MOVE,
  7813. "big-image": "images/nav_help_gesture_tap.png"
  7814. },
  7815. right: {
  7816. "top-info": o.ZOOM,
  7817. "big-image": "images/nav_help_gesture_pinch.png"
  7818. }
  7819. }
  7820. },
  7821. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7822. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7823. desktop: {
  7824. left: {
  7825. "top-info": o.ROTATE,
  7826. "big-image": "images/nav_help_mouse_drag_left.png",
  7827. keyboard: "images/nav_help_keyboard_left_right.png"
  7828. },
  7829. middle: {
  7830. "top-info": o.MOVE,
  7831. "big-image": "images/nav_help_mouse_position_right.png"
  7832. }
  7833. },
  7834. mobile: {
  7835. left: {
  7836. "top-info": o.ROTATE,
  7837. "big-image": "images/nav_help_gesture_drag.png"
  7838. },
  7839. middle: {
  7840. "top-info": o.MOVE,
  7841. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7842. }
  7843. }
  7844. },
  7845. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7846. desktop: {
  7847. left: {
  7848. "top-info": o.MOVE,
  7849. "big-image": "images/nav_help_mouse_position_left.png"
  7850. },
  7851. middle: {
  7852. "top-info": o.ROTATE,
  7853. "big-image": "images/nav_help_mouse_drag_right.png",
  7854. keyboard: "images/nav_help_keyboard_left_right.png"
  7855. }
  7856. },
  7857. mobile: {
  7858. left: {
  7859. "top-info": o.MOVE,
  7860. "big-image": "images/nav_help_gesture_position.png"
  7861. },
  7862. middle: {
  7863. "top-info": o.ROTATE,
  7864. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7865. }
  7866. }
  7867. };
  7868. var e = {
  7869. "top-info": o.INSIDE,
  7870. "big-image": "images/nav_help_click_inside.png",
  7871. keyboard: "images/nav_help_inside_key.png"
  7872. };
  7873. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7874. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7875. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7876. var t = {
  7877. "top-info": o.INSIDE,
  7878. "big-image": "images/nav_help_tap_inside.png"
  7879. };
  7880. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7881. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7882. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7883. this.assets[a.NAVIGATION] = {},
  7884. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7885. desktop: {
  7886. left: {
  7887. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7888. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7889. "big-image": "images/nav_help_mouse_drag_left.png",
  7890. keyboard: "images/nav_help_keyboard_left_right.png"
  7891. },
  7892. middle: {
  7893. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7894. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7895. "big-image": "images/nav_help_mouse_click.png",
  7896. keyboard: "images/nav_help_keyboard_up_down.png"
  7897. },
  7898. right: {
  7899. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7900. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7901. "big-image": "images/nav_help_mouse_zoom.png",
  7902. keyboard: "images/nav_help_zoom_keys.png"
  7903. }
  7904. },
  7905. mobile: {
  7906. left: {
  7907. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7908. "big-image": "images/nav_help_gesture_drag.png"
  7909. },
  7910. middle: {
  7911. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7912. "big-image": "images/nav_help_gesture_tap.png"
  7913. },
  7914. right: {
  7915. "top-info": o.HELP_MOBILE_3,
  7916. "big-image": "images/nav_help_gesture_pinch.png"
  7917. }
  7918. }
  7919. },
  7920. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  7921. desktop: {
  7922. left: {
  7923. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  7924. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  7925. "big-image": "images/nav_help_mouse_drag_left.png",
  7926. keyboard: "images/nav_help_keyboard_all.png"
  7927. },
  7928. middle: {
  7929. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  7930. "big-image": "images/nav_help_mouse_position_right.png"
  7931. },
  7932. right: {
  7933. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  7934. "big-image": "images/nav_help_mouse_zoom.png"
  7935. }
  7936. },
  7937. mobile: {
  7938. left: {
  7939. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  7940. "big-image": "images/nav_help_gesture_drag.png"
  7941. },
  7942. middle: {
  7943. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  7944. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7945. },
  7946. right: {
  7947. "top-info": o.HELP_MOBILE_3,
  7948. "big-image": "images/nav_help_gesture_pinch.png"
  7949. }
  7950. }
  7951. },
  7952. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  7953. desktop: {
  7954. left: {
  7955. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  7956. "big-image": "images/nav_help_mouse_position_left.png"
  7957. },
  7958. middle: {
  7959. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  7960. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  7961. "big-image": "images/nav_help_mouse_drag_right.png",
  7962. keyboard: "images/nav_help_keyboard_left_right.png"
  7963. },
  7964. right: {
  7965. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  7966. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  7967. "big-image": "images/nav_help_mouse_zoom.png",
  7968. keyboard: "images/nav_help_keyboard_up_down.png"
  7969. }
  7970. },
  7971. mobile: {
  7972. left: {
  7973. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  7974. "big-image": "images/nav_help_gesture_position.png"
  7975. },
  7976. middle: {
  7977. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  7978. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7979. },
  7980. right: {
  7981. "top-info": o.HELP_MOBILE_3,
  7982. "big-image": "images/nav_help_gesture_pinch.png"
  7983. }
  7984. }
  7985. },
  7986. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  7987. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  7988. "top-info": o.HELP_DESKTOP_360_2A,
  7989. "bottom-info": o.HELP_DESKTOP_360_2B,
  7990. "big-image": "images/nav_help_click_inside.png",
  7991. keyboard: "images/nav_help_inside_key.png"
  7992. },
  7993. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  7994. "top-info": o.HELP_MOBILE_360_2,
  7995. "big-image": "images/nav_help_tap_inside.png"
  7996. },
  7997. this.assets[a.MORE_HELP] = {
  7998. desktop: {
  7999. "more-help-hlr": {
  8000. "top-info": o.HELP_MORE_HLR_A,
  8001. "big-image": "images/nav_help_expand.svg",
  8002. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8003. },
  8004. "more-help-dollhouse": {
  8005. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8006. "big-image": "images/nav_help_dollhouse.svg",
  8007. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  8008. },
  8009. "more-help-floors": {
  8010. "top-info": o.HELP_MORE_FLOORS_A,
  8011. "big-image": "images/nav_help_floor picker.svg",
  8012. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8013. },
  8014. "more-help-tag": {
  8015. "top-info": o.HELP_MORE_TAG_A,
  8016. "big-image": "images/nav_help_tag.svg",
  8017. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  8018. },
  8019. "more-help-zoom": {
  8020. "top-info": o.HELP_MORE_ZOOM_A,
  8021. "big-image": "images/nav_help_zoom.svg",
  8022. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  8023. },
  8024. "more-help-tour": {
  8025. "top-info": o.HELP_MORE_TOUR_A,
  8026. "big-image": "images/nav_help_play.png",
  8027. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8028. },
  8029. "more-help-inside": {
  8030. "top-info": o.HELP_MORE_INSIDE_A,
  8031. "big-image": "images/nav_help_inside.svg",
  8032. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  8033. },
  8034. "more-help-vr": {
  8035. "top-info": o.HELP_MORE_VR_A,
  8036. "big-image": "images/nav_help_vr.svg",
  8037. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  8038. },
  8039. "more-help-360": {
  8040. "top-info": o.HELP_MORE_360_A,
  8041. "big-image": "images/nav_help_360.svg",
  8042. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  8043. },
  8044. "more-help-fullscreen": {
  8045. "top-info": o.HELP_MORE_FULLSCREEN_A,
  8046. "big-image": "images/nav_help_fullscreen.svg",
  8047. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8048. }
  8049. },
  8050. mobile: {
  8051. "more-help-hlr": {
  8052. "top-info": o.HELP_MORE_HLR_A,
  8053. "big-image": "images/nav_help_expand.svg",
  8054. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8055. },
  8056. "more-help-dollhouse": {
  8057. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8058. "big-image": "images/nav_help_dollhouse.svg",
  8059. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8060. },
  8061. "more-help-floors": {
  8062. "top-info": o.HELP_MORE_FLOORS_A,
  8063. "big-image": "images/nav_help_floor picker.svg",
  8064. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8065. },
  8066. "more-help-tag": {
  8067. "top-info": o.HELP_MORE_TAG_A,
  8068. "big-image": "images/nav_help_tag.svg",
  8069. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8070. },
  8071. "more-help-tour": {
  8072. "top-info": o.HELP_MORE_TOUR_A,
  8073. "big-image": "images/nav_help_play.png",
  8074. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8075. },
  8076. "more-help-inside": {
  8077. "top-info": o.HELP_MORE_INSIDE_A,
  8078. "big-image": "images/nav_help_inside.svg",
  8079. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8080. },
  8081. "more-help-vr": {
  8082. "top-info": o.HELP_MORE_VR_A,
  8083. "big-image": "images/webvr.svg",
  8084. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8085. },
  8086. "more-help-360": {
  8087. "top-info": o.HELP_MORE_360_A,
  8088. "big-image": "images/nav_help_360.svg",
  8089. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8090. }
  8091. }
  8092. },
  8093. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8094. desktop: {
  8095. left: {
  8096. "top-info": o.ROTATE,
  8097. "big-image": "images/nav_help_mouse_drag_left.png",
  8098. keyboard: "images/nav_help_keyboard_left_right.png"
  8099. },
  8100. middle: {
  8101. "top-info": o.MOVE,
  8102. "big-image": "images/nav_help_mouse_click.png",
  8103. keyboard: "images/nav_help_keyboard_up_down.png"
  8104. },
  8105. right: {
  8106. "top-info": o.PLAY,
  8107. "big-image": "images/Desktop-help-play-button.svg",
  8108. keyboard: "images/Desktop-help-spacebar-2.svg"
  8109. }
  8110. },
  8111. mobile: {
  8112. left: {
  8113. "top-info": o.ROTATE,
  8114. "big-image": "images/nav_help_gesture_drag.png"
  8115. },
  8116. middle: {
  8117. "top-info": o.MOVE,
  8118. "big-image": "images/nav_help_gesture_tap.png"
  8119. },
  8120. right: {
  8121. "top-info": o.PLAY,
  8122. "big-image": "images/mobile-help-play-button.svg"
  8123. }
  8124. }
  8125. },
  8126. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8127. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8128. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8129. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8130. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8131. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8132. }
  8133. },
  8134. fill: function(e, t, i) {
  8135. n.call(this, e, t, i, !0)
  8136. },
  8137. clear: function(e, t, i) {
  8138. n.call(this, e, t, i, !1)
  8139. }
  8140. }
  8141. }
  8142. , {
  8143. "../enum/HelpModalSize": 27,
  8144. "../enum/HelpModalType": 28,
  8145. "../enum/Viewmode": 51,
  8146. "../localization/localize": 108,
  8147. "../util/browser": 182
  8148. }],
  8149. 76: [function(e, t, i) {
  8150. "use strict";
  8151. t.exports = Object.freeze({
  8152. OPENED: "share.open",
  8153. CLOSED: "share.closed",
  8154. LINK_CLICKED: "share.linked"
  8155. })
  8156. }
  8157. , {}],
  8158. 77: [function(e, t, i) {
  8159. "use strict";
  8160. function n(e) {
  8161. function t(t, i) {
  8162. var n = window.screenY + ($("#player").height() - i) / 2
  8163. , r = window.screenX + ($("#player").width() - t) / 2
  8164. , o = "top=" + n + ",left=" + r + ",width=" + t + ",height=" + i;
  8165. I.emit(l.LINK_CLICKED, {
  8166. channel: e
  8167. }),
  8168. window.open(C[e], "shareWindow", o)
  8169. }
  8170. switch (e) {
  8171. case y.FACEBOOK:
  8172. t(580, 420);
  8173. break;
  8174. case y.TWITTER:
  8175. t(550, 440);
  8176. break;
  8177. case y.MAIL:
  8178. I.emit(l.LINK_CLICKED, {
  8179. channel: "email"
  8180. }),
  8181. window.open(C[e], "_blank");
  8182. break;
  8183. case y.LINKEDIN:
  8184. }
  8185. }
  8186. function r(e) {
  8187. I.emit(l.LINK_CLICKED, {
  8188. channel: "copylink"
  8189. });
  8190. var t = document.createRange();
  8191. t.selectNodeContents(v);
  8192. var i = window.getSelection();
  8193. i.removeAllRanges(),
  8194. i.addRange(t),
  8195. document.execCommand("copy"),
  8196. A.classList.remove("hidden"),
  8197. v.classList.add("highlighted")
  8198. }
  8199. function o(e) {
  8200. e && (e.stopPropagation(),
  8201. e.target === v) || (window.getSelection().removeAllRanges(),
  8202. v.classList.remove("highlighted"),
  8203. A.classList.add("hidden"))
  8204. }
  8205. var a = e("../../util/browser")
  8206. , s = e("../../localization/localize")
  8207. , l = e("./ShareEvents")
  8208. , c = e("../../util/common")
  8209. , h = e("events").EventEmitter
  8210. , u = document.getElementById("sharing")
  8211. , d = document.getElementById("share-modal")
  8212. , p = document.getElementById("share-close")
  8213. , f = document.getElementById("facebook-share")
  8214. , g = document.getElementById("twitter-share")
  8215. , m = document.getElementById("mail-share")
  8216. , v = document.getElementById("share-url-text")
  8217. , A = document.getElementById("copy-success")
  8218. , y = Object.freeze({
  8219. FACEBOOK: "facebook",
  8220. TWITTER: "twitter",
  8221. MAIL: "mail",
  8222. LINKEDIN: "linkedin"
  8223. })
  8224. , C = {};
  8225. C[y.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8226. C[y.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8227. C[y.MAIL] = "mailto:?subject=";
  8228. var I = {
  8229. init: function(e) {
  8230. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8231. C[y.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8232. C[y.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8233. C[y.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8234. u.addEventListener("click", this.toggle.bind(this)),
  8235. p.addEventListener("click", this.hide.bind(this)),
  8236. v.addEventListener("click", r),
  8237. d.addEventListener("click", o),
  8238. f.addEventListener("click", n.bind(this, y.FACEBOOK)),
  8239. g.addEventListener("click", n.bind(this, y.TWITTER)),
  8240. m.addEventListener("click", n.bind(this, y.MAIL)),
  8241. v.textContent = window.location.href + "&utm_source=4",
  8242. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8243. u.classList.remove("hidden")
  8244. },
  8245. show: function() {
  8246. this.emit(l.OPENED),
  8247. d.classList.add("fadeIn")
  8248. },
  8249. hide: function() {
  8250. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8251. document.selection && document.selection.empty(),
  8252. window.getSelection().removeAllRanges(),
  8253. o(),
  8254. d.classList.remove("fadeIn"))
  8255. },
  8256. toggle: function() {
  8257. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8258. }
  8259. };
  8260. c.extendObject(I, h.prototype),
  8261. t.exports = I
  8262. }
  8263. , {
  8264. "../../localization/localize": 108,
  8265. "../../util/browser": 182,
  8266. "../../util/common": 185,
  8267. "./ShareEvents": 76,
  8268. events: 202
  8269. }],
  8270. 78: [function(e, t, i) {
  8271. "use strict";
  8272. t.exports = Object.freeze({
  8273. OPENED: "terms.opened",
  8274. CLOSED: "terms.closed"
  8275. })
  8276. }
  8277. , {}],
  8278. 79: [function(e, t, i) {
  8279. "use strict";
  8280. var n = e("./TermsEvent")
  8281. , r = e("../../localization/localize")
  8282. , o = e("../../analytics")
  8283. , a = e("../../util/ajax")
  8284. , s = e("../../util/common")
  8285. , l = e("events").EventEmitter
  8286. , c = document.getElementById("terms-modal")
  8287. , h = {
  8288. init: function() {
  8289. $(".footer-terms").on("click", function(e) {
  8290. e.preventDefault(),
  8291. this.show()
  8292. }
  8293. .bind(this)),
  8294. $("#terms-modal .close").on("click", this.hide.bind(this))
  8295. },
  8296. show: function() {
  8297. this.emit(n.OPENED),
  8298. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8299. var t = $("#terms-text").html(e);
  8300. o.track("showcase_gui", {
  8301. gui_action: "click_terms_button",
  8302. interaction_source: "gui"
  8303. }),
  8304. t.find("a").attr("target", "_blank")
  8305. }).fail(function() {
  8306. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8307. }),
  8308. c.classList.add("fadeIn")
  8309. },
  8310. hide: function(e) {
  8311. e && e.preventDefault(),
  8312. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8313. c.classList.remove("fadeIn")
  8314. }
  8315. };
  8316. s.extendObject(h, l.prototype),
  8317. t.exports = h
  8318. }
  8319. , {
  8320. "../../analytics": 4,
  8321. "../../localization/localize": 108,
  8322. "../../util/ajax": 181,
  8323. "../../util/common": 185,
  8324. "./TermsEvent": 78,
  8325. events: 202
  8326. }],
  8327. 80: [function(e, t, i) {
  8328. "use strict";
  8329. t.exports = Object.freeze({
  8330. OPEN_INFO: "title.open.info",
  8331. CLOSE_INFO: "title.close.info",
  8332. SHOW_INFO: "title.show.info",
  8333. HIDE_INFO: "title.hide.info",
  8334. LINK_CLICKED: "title.link.click",
  8335. CONTACT_LINK_CLICKED: "title.contact.click",
  8336. ORIGIN_LINK_CLICKED: "title.origin.click"
  8337. })
  8338. }
  8339. , {}],
  8340. 81: [function(e, t, i) {
  8341. "use strict";
  8342. function n(e, t) {
  8343. o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t)
  8344. }
  8345. function r(e, t) {
  8346. function i(i) {
  8347. e.shouldShowtags = "show" === this.value,
  8348. e.shouldShowtags ? t.showAlltags(o.tags.startup.fadeInDuration) : t.hideAlltags(o.tags.startup.fadeInDuration)
  8349. }
  8350. document.getElementById("tag-toggles").classList.remove("hidden"),
  8351. document.getElementById("radio-tag-show").checked = !0;
  8352. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8353. n[r].addEventListener("change", i)
  8354. }
  8355. var o = e("../../settings");
  8356. t.exports.init = n
  8357. }
  8358. , {
  8359. "../../settings": 166
  8360. }],
  8361. 82: [function(e, t, i) {
  8362. (function(i) {
  8363. "use strict";
  8364. function n(e, t) {
  8365. return e && u.valueFromHash("title", 1) && 2 !== u.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e,
  8366. e.length > g.minTooltipCharacters && I.parentElement.setAttribute("data-original-title", e),
  8367. t && 1 !== m.specialEdition && m.brand && !m.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8368. document.getElementById("gui-name").classList.add("noCoBrand"),
  8369. document.getElementById("cobrandTitle").classList.add("hidden")),
  8370. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8371. !1)
  8372. }
  8373. function r(e) {
  8374. return e ? (L = !0,
  8375. void (_.innerText = e)) : void _.classList.add("hidden")
  8376. }
  8377. function o(e, t, i, n) {
  8378. if (!e && !t && !i || !m.brand || u.valueFromHash("mls", !1))
  8379. return void T.classList.add("hidden");
  8380. L = !0;
  8381. var r = []
  8382. , o = c(r, "<br>");
  8383. if (e && o('<span id="contactName">' + e + "</span>"),
  8384. t) {
  8385. var a = n || t
  8386. , s = u.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>";
  8387. o(s)
  8388. }
  8389. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8390. r[0] = "",
  8391. x.innerHTML = r.join("")
  8392. }
  8393. function a(e) {
  8394. if ("string" == typeof e)
  8395. try {
  8396. e = JSON.parse(e)
  8397. } catch (e) {
  8398. return y.warn("Unable to parse address data"),
  8399. void S.parentElement.classList.add("hidden")
  8400. }
  8401. if (!(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)))
  8402. return void S.parentElement.classList.add("hidden");
  8403. L = !0;
  8404. var t = []
  8405. , i = c(t, " ");
  8406. e.address_1 && i(e.address_1),
  8407. e.address_2 && i(e.address_2),
  8408. e.city && i(e.city, ", "),
  8409. e.state && i(e.state, ", "),
  8410. e.zip && i(e.zip, e.state ? " " : ", "),
  8411. t[0] = "",
  8412. S.innerText = t.join("")
  8413. }
  8414. function s(e) {
  8415. var t = document.createElement("a");
  8416. return t.id = "url",
  8417. t.target = "_blank",
  8418. t.href = e,
  8419. t.innerText = e,
  8420. t.addEventListener("click", N.emit.bind(N, v.ORIGIN_LINK_CLICKED)),
  8421. t
  8422. }
  8423. function l(e) {
  8424. return !(!e || u.inIframe() && document.referrer === e) && (R.classList.remove("hidden"),
  8425. P.innerHTML = f.WEBVR_LEARN_MORE + ": ",
  8426. P.appendChild(s(e)),
  8427. O.forEach(function(e) {
  8428. e.classList.add("share-link")
  8429. }),
  8430. !0)
  8431. }
  8432. function c(e, t) {
  8433. var i = e
  8434. , n = t;
  8435. return function(e, t) {
  8436. i.push(t || n, e)
  8437. }
  8438. }
  8439. function h() {
  8440. document.getElementById("title-toggle").addEventListener("click", N.toggleTitle.bind(N)),
  8441. L && I.addEventListener("click", N.toggleMeta.bind(N, !1));
  8442. var e = [].slice.call(_.querySelectorAll("a"));
  8443. e.forEach(function(e) {
  8444. e.addEventListener("click", N.emit.bind(N, v.LINK_CLICKED))
  8445. });
  8446. var t = [].slice.call(T.querySelectorAll("a"));
  8447. t.forEach(function(e) {
  8448. e.addEventListener("click", N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
  8449. contact_type: e.getAttribute("id")
  8450. }))
  8451. })
  8452. }
  8453. var u = e("../../util/browser")
  8454. , d = e("../../util/common")
  8455. , p = e("../../util/logger")
  8456. , f = e("../../localization/localize")
  8457. , g = e("./titleBarSettings")
  8458. , m = e("../../settings")
  8459. , v = e("./TitleEvents")
  8460. , A = e("events").EventEmitter
  8461. , y = new p(i)
  8462. , C = document.querySelector(".pinTop.left")
  8463. , I = document.getElementsByClassName("title-container")[0]
  8464. , E = document.getElementById("title-toggle").querySelector("i")
  8465. , b = document.getElementById("meta-info-wrapper")
  8466. , w = document.getElementById("meta-info")
  8467. , _ = document.getElementById("meta-description")
  8468. , T = document.getElementsByClassName("contact-info")[0]
  8469. , x = document.getElementById("contact-data")
  8470. , S = document.getElementById("addressTxt")
  8471. , M = document.getElementById("tag-toggles")
  8472. , R = document.getElementById("share-origin")
  8473. , P = document.getElementById("share-link-wrapper")
  8474. , O = [w, b, I]
  8475. , L = !1
  8476. , D = !1
  8477. , N = {
  8478. populate: function(e) {
  8479. if (n(e.name, e.coBrand)) {
  8480. if (r(e.description),
  8481. o(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8482. a(e.address),
  8483. L) {
  8484. var t = document.createElement("br");
  8485. M.insertBefore(t, M.firstElementChild)
  8486. }
  8487. e.socialSharing && m.share.enabled && (D = l(e.url))
  8488. }
  8489. },
  8490. finishSetup: function(e) {
  8491. L = L || !!e,
  8492. h(),
  8493. L || (D ? I.classList.add("share-only") : I.classList.add("no-meta"))
  8494. },
  8495. toggleMeta: function(e, t) {
  8496. t && t.preventDefault();
  8497. var i = w.classList.contains("expand");
  8498. e && !i || (i ? (O.forEach(function(e) {
  8499. e.classList.remove("expand")
  8500. }),
  8501. this.emit(v.CLOSE_INFO)) : (O.forEach(function(e) {
  8502. e.classList.add("expand")
  8503. }),
  8504. this.emit(v.OPEN_INFO)))
  8505. },
  8506. setupToggling: function() {
  8507. b.style.height = w.offsetHeight + "px",
  8508. w.addEventListener("transitionend", function() {
  8509. b.style.height = w.offsetHeight + "px"
  8510. })
  8511. },
  8512. toggleTitle: function(e) {
  8513. e && e.preventDefault(),
  8514. C.classList.contains("closed") ? (C.classList.add("open"),
  8515. E.classList.remove("icon-dpad-right"),
  8516. E.classList.add("icon-dpad-left"),
  8517. this.emit(v.SHOW_INFO),
  8518. setTimeout(function() {
  8519. C.classList.remove("closed"),
  8520. C.classList.remove("open")
  8521. }, g.removeAnimationClasses)) : (C.classList.add("closed"),
  8522. E.classList.remove("icon-dpad-left"),
  8523. E.classList.add("icon-dpad-right"),
  8524. this.emit(v.HIDE_INFO))
  8525. }
  8526. };
  8527. d.extendObject(N, A.prototype),
  8528. t.exports = N
  8529. }
  8530. ).call(this, "/js/gui/title/titleBar.js")
  8531. }
  8532. , {
  8533. "../../localization/localize": 108,
  8534. "../../settings": 166,
  8535. "../../util/browser": 182,
  8536. "../../util/common": 185,
  8537. "../../util/logger": 189,
  8538. "./TitleEvents": 80,
  8539. "./titleBarSettings": 83,
  8540. events: 202
  8541. }],
  8542. 83: [function(e, t, i) {
  8543. "use strict";
  8544. t.exports = Object.freeze({
  8545. minTooltipCharacters: 19,
  8546. removeAnimationClasses: 500
  8547. })
  8548. }
  8549. , {}],
  8550. 84: [function(e, t, i) {
  8551. "use strict";
  8552. function n(e) {
  8553. C = e,
  8554. P.forEach(function(e) {
  8555. b.addEventListener(e, u.bind(this, !1), !0),
  8556. w.addEventListener(e, u.bind(this, !0), !0),
  8557. E.addEventListener(e, o, !0),
  8558. S.forEach(function(t) {
  8559. t.addEventListener(e, a, !0)
  8560. }),
  8561. $("#drawer img").on(e, a)
  8562. }),
  8563. document.addEventListener("keydown", u.bind(this, !1), !0),
  8564. C.on(v.TourStart, function() {
  8565. E.classList.add("playing")
  8566. })
  8567. }
  8568. function r() {
  8569. C.playTour(),
  8570. I && clearTimeout(I),
  8571. d(),
  8572. _.removeClass("fadeIn")
  8573. }
  8574. function o() {
  8575. E.classList.contains("playing") && (C.stopTour(),
  8576. _.addClass("fadeIn"),
  8577. setTimeout(function() {
  8578. _.removeClass("fadeIn")
  8579. }, p.tourInteraction.showPauseButton),
  8580. O || (clearTimeout(I),
  8581. I = setTimeout(h, p.tourInteraction.showModal)),
  8582. setTimeout(function() {
  8583. E.classList.remove("playing")
  8584. }, p.tourInteraction.allowNextClick))
  8585. }
  8586. function a() {
  8587. C.tourInProgress && (C.stopTour(),
  8588. C.endTourProgress(),
  8589. E.classList.remove("playing"))
  8590. }
  8591. function s() {
  8592. T.is(":visible") ? r() : o()
  8593. }
  8594. function l() {
  8595. x.hasClass("playing") && (clearTimeout(I),
  8596. C.atEndOfTour() ? c() : _.removeClass("fadeIn"))
  8597. }
  8598. function c() {
  8599. E.classList.remove("playing"),
  8600. h()
  8601. }
  8602. function h() {
  8603. if (!p.tourInteraction.disabled) {
  8604. M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
  8605. M.addClass("fadeIn tour " + m.deviceType);
  8606. var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
  8607. if (!p.tourInteraction.smallModal) {
  8608. var t;
  8609. 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,
  8610. m.fill(R, A.TOUR_INTERACTION[t]),
  8611. M.addClass(t)
  8612. }
  8613. M.addClass(e)
  8614. }
  8615. }
  8616. function u(e, t) {
  8617. if (t) {
  8618. var i = "keydown" === t.type
  8619. , n = t.which === f.SPACE || C.tourIsPlaying;
  8620. i && n || e || (O = !0),
  8621. C.atEndOfTour() && d(),
  8622. !C.tourIsPlaying && C.tourInProgress && (_.removeClass("fadeIn"),
  8623. d(),
  8624. t.which !== f.SPACE && a()),
  8625. i && n && s()
  8626. }
  8627. }
  8628. function d() {
  8629. M.removeClass("fadeIn")
  8630. }
  8631. var p = (e("../util/browser"),
  8632. e("../settings"))
  8633. , f = e("../enum/Keys")
  8634. , g = e("../enum/Viewmode")
  8635. , m = (e("./helpManager"),
  8636. e("./populateModal"))
  8637. , v = e("../enum/DirectorEvents")
  8638. , A = e("../enum/HelpModalType")
  8639. , y = e("../enum/HelpModalSize")
  8640. , C = null
  8641. , I = null
  8642. , E = document.getElementById("pause-overlay")
  8643. , b = document.getElementById("player")
  8644. , w = document.getElementById("gui")
  8645. , _ = $("#pause-icon").eq(0)
  8646. , T = $("#play").eq(0)
  8647. , x = $("#playHead").eq(0)
  8648. , S = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8649. , M = $("#interaction-modal").eq(0)
  8650. , R = $("#interaction-modal .interaction").toArray()
  8651. , P = ["touchstart", "mousedown", "pointerdown"]
  8652. , O = !1;
  8653. t.exports.init = n,
  8654. t.exports.play = r,
  8655. t.exports.pause = o,
  8656. t.exports.pauseWithoutCTA = a,
  8657. t.exports.togglePlay = s,
  8658. t.exports.stopTour = l,
  8659. t.exports.dismissModal = d
  8660. }
  8661. , {
  8662. "../enum/DirectorEvents": 23,
  8663. "../enum/HelpModalSize": 27,
  8664. "../enum/HelpModalType": 28,
  8665. "../enum/Keys": 30,
  8666. "../enum/Viewmode": 51,
  8667. "../settings": 166,
  8668. "../util/browser": 182,
  8669. "./helpManager": 68,
  8670. "./populateModal": 75
  8671. }],
  8672. 85: [function(e, t, i) {
  8673. "use strict";
  8674. t.exports = Object.freeze({
  8675. OPENED: "vr.modal.opened",
  8676. LAUNCH: "vr.modal.launch",
  8677. CLOSED: "vr.modal.closed",
  8678. NEXT: "vr.modal.next",
  8679. PREV: "vr.modal.prev",
  8680. STORE: "vr.modal.store",
  8681. falseICECHOSEN: "vr.modal.device"
  8682. })
  8683. }
  8684. , {}],
  8685. 86: [function(e, t, i) {
  8686. "use strict";
  8687. function n(e, t, i) {
  8688. function n(e, t, n, r) {
  8689. function o() {
  8690. return p + "&m=" + t + "&display=" + e
  8691. }
  8692. function s() {
  8693. var e = "&utm_medium=" + (a.inIframe() ? "embed" : "direct")
  8694. , t = "&utm_source=" + u
  8695. , n = "&utm_showcase_session_id=" + i;
  8696. return e + t + n
  8697. }
  8698. function l() {
  8699. return d + "&sids=" + t + "&lsid=" + t + "&ln=" + encodeURIComponent(n) + "&ld=" + encodeURIComponent(r) + "&display=" + e
  8700. }
  8701. return a.valueFromHash("vrcoll", !1) ? l() + s() : o() + s()
  8702. }
  8703. function r(e, t, i, r) {
  8704. var o = "https://api.branch.io/v1/url"
  8705. , a = n(e, t, i, r)
  8706. , s = {
  8707. responseType: "json",
  8708. data: {
  8709. branch_key: h.appConfig.branch_key,
  8710. data: {
  8711. m: t,
  8712. full_url: a,
  8713. $desktop_url: m,
  8714. $og_app_id: "331853976762864119",
  8715. $og_title: i,
  8716. $og_description: r,
  8717. $og_image_url: location.origin + "/api/v1/player/models/" + t + "/thumb",
  8718. $canonical_url: window.location.href
  8719. }
  8720. }
  8721. };
  8722. c.post(o, s).done(function(t) {
  8723. f[e] = t.url
  8724. }).fail(function(t) {
  8725. f[e] = t
  8726. }
  8727. .bind(this, a))
  8728. }
  8729. function o(e, t, i) {
  8730. for (var r in s) {
  8731. var o = s[r]
  8732. , a = n(o, e, t, i);
  8733. f[o] = a
  8734. }
  8735. }
  8736. var u = a.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8737. , d = g + "/vr/dlist/?ret=" + u
  8738. , p = g + "/vr/show/?ret=" + u
  8739. , m = "https://support.port.com/hc/en-us/articles/224728887-What-do-I-need-for-Virtual-Reality";
  8740. switch (e) {
  8741. case l.IOS:
  8742. r(s.CardboardIOS, t.sid, t.name, t.summary);
  8743. break;
  8744. default:
  8745. o(t.sid, t.name, t.summary)
  8746. }
  8747. }
  8748. function r(e) {
  8749. var t = f[e];
  8750. window.open(t, "_blank")
  8751. }
  8752. function o(e) {
  8753. var t = u[e];
  8754. window.open(t, "_blank")
  8755. }
  8756. var a = e("../../util/browser")
  8757. , s = e("../../enum/VRApps")
  8758. , l = e("../../enum/VRPlatforms")
  8759. , c = e("../../util/ajax")
  8760. , h = e("../../settings")
  8761. , u = {};
  8762. u[s.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8763. u[s.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8764. u[s.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=";
  8765. for (var d in s) {
  8766. var p = s[d];
  8767. u[p] += encodeURIComponent(document.referrer + "&display=" + p)
  8768. }
  8769. var f = {}
  8770. , g = function() {
  8771. var e = window.location.host;
  8772. return e.indexOf(".port.com") === -1 && e.indexOf("localhost") === -1 && (e = "my.port.com"),
  8773. "https://" + e
  8774. }();
  8775. t.exports.init = n,
  8776. t.exports.launch = r,
  8777. t.exports.launchStore = o
  8778. }
  8779. , {
  8780. "../../enum/VRApps": 46,
  8781. "../../enum/VRPlatforms": 49,
  8782. "../../settings": 166,
  8783. "../../util/ajax": 181,
  8784. "../../util/browser": 182
  8785. }],
  8786. 87: [function(e, t, i) {
  8787. "use strict";
  8788. function n(e) {
  8789. var t;
  8790. switch (e) {
  8791. case m.IOS:
  8792. return t = p.iosVersion(),
  8793. t.major > 9 || 9 === t.major && t.minor >= 1;
  8794. case m.Android:
  8795. return t = p.androidVersion(),
  8796. t.major > 4 || 4 === t.major && t.minor > 4 || 4 === t.major && 4 === t.minor && t.patch >= 4
  8797. }
  8798. return !1
  8799. }
  8800. function r(e, t) {
  8801. function i(e) {
  8802. K.emit(A.STORE, {
  8803. type: e
  8804. }),
  8805. f.launchStore(e)
  8806. }
  8807. function r(e) {
  8808. switch (e !== _.pageCount && (a(e),
  8809. N.text(e + 1 + " / " + _.pageCount)),
  8810. e) {
  8811. case _.Title:
  8812. O.css("display", "none"),
  8813. L.text(u[e]),
  8814. o(s);
  8815. break;
  8816. case _.Cardboard:
  8817. O.css("display", "block"),
  8818. L.text(u[e]),
  8819. M.filter(".cardboard").off(),
  8820. M.filter(".gearvr").off(),
  8821. c(e, s),
  8822. h(H, X, Z);
  8823. break;
  8824. case _.Gear:
  8825. L.text(u[e]),
  8826. c(e, s),
  8827. T.addClass("lastPage"),
  8828. h(G, X, Z);
  8829. break;
  8830. case _.pageCount:
  8831. T.removeClass("fadeIn"),
  8832. K.emit(A.CLOSED)
  8833. }
  8834. B.filter("[src='']").hide()
  8835. }
  8836. var s = function() {
  8837. return p.detectAndroid() ? p.detectAndroidMobile() && n(m.Android) ? (T.addClass("supported"),
  8838. w = ".show-supported",
  8839. m.Android) : (T.addClass("unsupported"),
  8840. w = ".show-unsupported",
  8841. m.UnsupportedAndroid) : p.detectIPhone() || p.detectIPod() ? (T.addClass("ios"),
  8842. w = ".show-ios",
  8843. _ = v.ios,
  8844. m.IOS) : (T.addClass("desktop"),
  8845. w = ".show-desktop",
  8846. m.Desktop)
  8847. }();
  8848. f.init(s, e, t),
  8849. s !== m.Desktop && T.addClass("mobile");
  8850. var l = function(e) {
  8851. K.emit(A.LAUNCH, {
  8852. vr_platform: s,
  8853. vr_app: e
  8854. }),
  8855. f.launch(e)
  8856. };
  8857. q.cardboardAndroid = l.bind(this, g.CardboardAndroid),
  8858. q.gear = l.bind(this, g.GearVR),
  8859. q.cardboardIOS = l.bind(this, g.CardboardIOS),
  8860. d(),
  8861. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  8862. $(w).show();
  8863. var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS]
  8864. , y = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  8865. s === m.IOS && (u.splice(1, 1),
  8866. y.splice(1, 1)),
  8867. $("#vr").on("click", function(e) {
  8868. e.preventDefault(),
  8869. T.hasClass("fadeIn") ? K.dismiss() : (b = 0,
  8870. r(b),
  8871. T.addClass("fadeIn"),
  8872. K.emit(A.OPENED))
  8873. });
  8874. var I = "https://my.port.com/vr/show/?m=" + e.sid;
  8875. s === m.IOS ? $(".cardboardLink").on("click", i.bind(this, g.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, g.CardboardAndroid)),
  8876. $(".gearLink").on("click", i.bind(this, g.GearVR)),
  8877. $("span.modelLink").text(I),
  8878. O.on("click", function(e) {
  8879. K.emit(A.PREV),
  8880. b--,
  8881. r(b)
  8882. }),
  8883. L.on("click", function(e) {
  8884. L.text();
  8885. K.emit(A.NEXT, {
  8886. nextAction: y[b]
  8887. }),
  8888. b++,
  8889. r(b)
  8890. }),
  8891. T.find(".close").on("click", K.dismiss)
  8892. }
  8893. function o(e) {
  8894. switch (e) {
  8895. case m.Android:
  8896. M.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8897. M.filter(".gearvr").off().on("click", q.gear),
  8898. s(H, G, "logo-button", "same-line");
  8899. break;
  8900. case m.UnsupportedAndroid:
  8901. s("", z, "", "");
  8902. break;
  8903. case m.IOS:
  8904. M.filter(".cardboard").off().on("click", q.cardboardIOS),
  8905. s(H, "", "logo-button", "");
  8906. break;
  8907. case m.Desktop:
  8908. M.filter(".cardboard").off().on("click", l.bind(this, null, F, U)),
  8909. M.filter(".gearvr").off().on("click", l.bind(this, G, V, null)),
  8910. s(H, G, "logo-button", "same-line"),
  8911. Q.cardboard()
  8912. }
  8913. }
  8914. function a(e) {
  8915. $(".p1, .p2, .p3").hide(),
  8916. x.insertAfter(S),
  8917. T.removeClass("front-page"),
  8918. T.removeClass("details-page"),
  8919. T.removeClass("lastPage"),
  8920. M.removeClass("logo-button"),
  8921. M.removeClass("same-line"),
  8922. S.removeClass("headsetOptions"),
  8923. R.attr("src", ""),
  8924. R.filter(".second").removeClass("gear"),
  8925. R.css("display", "inline-block"),
  8926. R.off(),
  8927. P.filter(".second").css("display", ""),
  8928. D.css("display", "none"),
  8929. $(".p" + (e + 1) + w).show(),
  8930. R.filter(".third").insertBefore(P.filter(".third"))
  8931. }
  8932. function s(e, t, i, n) {
  8933. T.addClass("front-page"),
  8934. R.filter(".first").attr("src", e),
  8935. R.filter(".second").attr("src", t),
  8936. M.filter(".first").addClass(i),
  8937. M.filter(".second").addClass(i),
  8938. M.addClass(n),
  8939. ".show-desktop" === w && S.insertAfter(x)
  8940. }
  8941. function l(e, t, i) {
  8942. S.addClass("headsetOptions"),
  8943. M.off(),
  8944. R.filter(".second").attr("src", t),
  8945. D.css("display", "block"),
  8946. P.filter(".second").css("display", "none"),
  8947. D.on("click", function() {
  8948. a(_.Title),
  8949. o(m.Desktop)
  8950. }),
  8951. e && (K.emit(A.falseICECHOSEN, {
  8952. name: g.GearVR
  8953. }),
  8954. R.filter(".first").attr("src", e),
  8955. R.filter(".second").addClass("gear"),
  8956. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  8957. Q.gearvr()),
  8958. i && (K.emit(A.falseICECHOSEN, {
  8959. name: g.Cardboard
  8960. }),
  8961. R.filter(".third").attr("src", i),
  8962. R.filter(".third").show(),
  8963. R.filter(".third").insertAfter(R.filter(".second")),
  8964. R.filter(".third").addClass("link"),
  8965. R.filter(".second").addClass("link"),
  8966. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  8967. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid)),
  8968. Q.cardboard())
  8969. }
  8970. function c(e, t) {
  8971. switch (t) {
  8972. case m.IOS:
  8973. X = Y,
  8974. Z = j;
  8975. break;
  8976. case m.Desktop:
  8977. e === _.Cardboard ? (X = F,
  8978. Z = U,
  8979. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  8980. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid))) : (X = V,
  8981. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  8982. Z = "");
  8983. break;
  8984. default:
  8985. e === _.Cardboard ? (X = z,
  8986. Z = j) : (X = k,
  8987. Z = W)
  8988. }
  8989. }
  8990. function h(e, t, i) {
  8991. T.find(".inner").addClass("details-page"),
  8992. T.addClass("details-page"),
  8993. R.filter(".first").attr("src", e),
  8994. R.filter(".second").attr("src", t),
  8995. R.filter(".third").attr("src", i)
  8996. }
  8997. function u() {
  8998. T.hasClass("fadeIn") && (T.removeClass("fadeIn"),
  8999. K.emit(A.CLOSED))
  9000. }
  9001. function d() {
  9002. var e = p.aspectRatio() > 1 && p.isMobile();
  9003. T.toggleClass("landscape", e).toggleClass("portrait", !e),
  9004. T.toggleClass("tiny", $("#player").height() <= y.narrowLandscapeHeight),
  9005. T.toggleClass("tinier", $("#player").height() <= y.reallyNarrowLandscapeHeight)
  9006. }
  9007. var p = e("../../util/browser")
  9008. , f = e("./vrLink")
  9009. , g = e("../../enum/VRApps")
  9010. , m = e("../../enum/VRPlatforms")
  9011. , v = e("../../enum/VRPages")
  9012. , A = e("./vrEvent")
  9013. , y = (e("../../settings"),
  9014. e("../../constants"))
  9015. , C = e("../../localization/localize")
  9016. , I = e("../../util/common")
  9017. , E = e("events").EventEmitter
  9018. , b = 0
  9019. , w = null
  9020. , _ = v.standard
  9021. , T = $(".vr-popup")
  9022. , x = T.find(".vr-popup-body")
  9023. , S = T.find(".vr-images")
  9024. , M = T.find(".img-container")
  9025. , R = T.find(".vr-sm-image")
  9026. , P = M.find(".vr-img-caption")
  9027. , O = $(".vr-buttons").find(".prev-button")
  9028. , L = $(".vr-buttons").find(".next-button")
  9029. , D = S.find(".front-close")
  9030. , N = $(".vr-page")
  9031. , B = T.find("img")
  9032. , F = "images/apple-store.png"
  9033. , V = "images/badge-oculus.png"
  9034. , U = "images/badge-cardboard.png"
  9035. , k = "images/logo-samsung.png"
  9036. , H = "images/headset-cardboard.png"
  9037. , G = "images/headset-gearvr.png"
  9038. , z = "images/ico-android-robot.png"
  9039. , W = "images/ico-gearvr.png"
  9040. , j = "images/ico-vr.png"
  9041. , Y = "images/apple-logo-white.svg"
  9042. , X = null
  9043. , Z = null
  9044. , q = {}
  9045. , K = {
  9046. init: r,
  9047. dismiss: u,
  9048. isDeviceSupported: n
  9049. };
  9050. I.extendObject(K, E.prototype),
  9051. $(window).resize(d);
  9052. var Q = function() {
  9053. var e = P.filter(".first").find(".cardboard")
  9054. , t = P.filter(".first").find(".gearvr");
  9055. return {
  9056. cardboard: function() {
  9057. t.addClass("hidden"),
  9058. e.removeClass("hidden")
  9059. },
  9060. gearvr: function() {
  9061. e.addClass("hidden"),
  9062. t.removeClass("hidden")
  9063. }
  9064. }
  9065. }();
  9066. t.exports = K
  9067. }
  9068. , {
  9069. "../../constants": 8,
  9070. "../../enum/VRApps": 46,
  9071. "../../enum/VRPages": 48,
  9072. "../../enum/VRPlatforms": 49,
  9073. "../../localization/localize": 108,
  9074. "../../settings": 166,
  9075. "../../util/browser": 182,
  9076. "../../util/common": 185,
  9077. "./vrEvent": 85,
  9078. "./vrLink": 86,
  9079. events: 202
  9080. }],
  9081. 88: [function(e, t, i) {
  9082. "use strict";
  9083. t.exports = Object.freeze({
  9084. OPENED: "webvr.modal.opened",
  9085. SHOW_TERMS: "webvr.footer.show.terms"
  9086. })
  9087. }
  9088. , {}],
  9089. 89: [function(e, t, i) {
  9090. (function(i) {
  9091. "use strict";
  9092. function n(e, t, i, n) {
  9093. function r(e) {
  9094. e.preventDefault(),
  9095. a(e.currentTarget.id)
  9096. }
  9097. function a(e) {
  9098. ne[e](),
  9099. Object.keys(ne).map(function(t, i) {
  9100. $("#" + t).toggleClass("tabs-underlined", t === e)
  9101. })
  9102. }
  9103. y = i,
  9104. v = t,
  9105. w.init(E.Android, e, n),
  9106. m();
  9107. var l = new RegExp("daydream","i")
  9108. , c = l.test(y.displayName);
  9109. c ? (a("tabdaydream"),
  9110. B.filter(".device-headset-side").attr("src", H),
  9111. D.find(".title").text(x.localizeText("WEBVR_FOR_DAYDREAM"))) : (a("tabcardboard"),
  9112. B.filter(".device-headset-side").attr("src", Y),
  9113. D.find(".title").text(x.localizeText("WEBVR_FOR_CARDBOARD"))),
  9114. $("#vr").on("click", function(e) {
  9115. e.preventDefault(),
  9116. g("click_webvr_button"),
  9117. L.is(":hidden") && (ie.emit(_.OPENED),
  9118. o())
  9119. }),
  9120. $(".webvr-popup .close").on("click", function(e) {
  9121. e.preventDefault(),
  9122. D.hasClass("hidden") ? (g("webvr_help_close"),
  9123. p()) : s()
  9124. }),
  9125. $("#tabcardboard").on("click", r),
  9126. $("#tabdaydream").on("click", r),
  9127. $("#tabnative").on("click", r),
  9128. $(".webvr-popup .open-with-app").on("click", function(e) {
  9129. e.preventDefault(),
  9130. g("webvr_learn_more"),
  9131. a("tabnative"),
  9132. p()
  9133. }),
  9134. $(".webvr-popup .help").on("click", function(e) {
  9135. e.preventDefault(),
  9136. g(D.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9137. p()
  9138. }),
  9139. $(".webvr-popup .terms").on("click", function(e) {
  9140. e.preventDefault(),
  9141. g("webvr_click_terms"),
  9142. s(),
  9143. ie.emit(_.SHOW_TERMS)
  9144. }),
  9145. F.on("click", function(e) {
  9146. e.preventDefault(),
  9147. g(ee),
  9148. window.open(J, "_blank")
  9149. }),
  9150. V.on("click", function(e) {
  9151. e.preventDefault(),
  9152. g("webvr_phone_link"),
  9153. window.open(te, "_blank")
  9154. }),
  9155. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9156. e.preventDefault(),
  9157. g("webvr_cardboard_link"),
  9158. w.launch(b.CardboardAndroid)
  9159. }),
  9160. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9161. e.preventDefault(),
  9162. g("webvr_oculus_link"),
  9163. w.launch(b.GearVR)
  9164. })
  9165. }
  9166. function r() {
  9167. function e() {
  9168. y.isPresenting || (f(),
  9169. window.removeEventListener("vrdisplaypresentchange", e))
  9170. }
  9171. R.info("Headset mounted"),
  9172. v.suspend();
  9173. var t = document.createElement("canvas");
  9174. for (t.getContext("webgl"),
  9175. t.className = "webvr-canvas",
  9176. document.bgColor = "#000",
  9177. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9178. document.body.removeChild(document.body.firstChild);
  9179. document.body.appendChild(t),
  9180. g("webvr_enter_app"),
  9181. y.requestPresent([{
  9182. source: t,
  9183. predistorted: !0
  9184. }]).catch(function(t) {
  9185. R.error("Failed to present: " + t),
  9186. g("webvr_exit_calibrate"),
  9187. e()
  9188. }),
  9189. A.then(function() {
  9190. window.dispatchEvent(new Event("vrapp-start"))
  9191. }),
  9192. window.addEventListener("vrdisplaypresentchange", e)
  9193. }
  9194. function o() {
  9195. O.fadeOut(I.guiAnimationSpeed),
  9196. L.fadeIn(I.guiAnimationSpeed),
  9197. a()
  9198. }
  9199. function a() {
  9200. if (!A) {
  9201. var e = C.valueFromHash("webvr") || I.appConfig.webvr_version
  9202. , t = "https://static.port.com/webvr/" + e + "/js/main.js";
  9203. A = new Promise(function(e, i) {
  9204. var n = document.createElement("script");
  9205. n.type = "text/javascript",
  9206. n.src = t,
  9207. n.onload = e,
  9208. document.head.appendChild(n)
  9209. }
  9210. )
  9211. }
  9212. D.find(".enter-button").on("click", r)
  9213. }
  9214. function s() {
  9215. g("webvr_modal_close"),
  9216. D.find(".enter-button").off("click", r),
  9217. L.fadeOut(I.guiAnimationSpeed, function() {
  9218. D.toggleClass("hidden", !1),
  9219. N.toggleClass("hidden", !0),
  9220. C.exitFullscreen()
  9221. }),
  9222. O.fadeIn(I.guiAnimationSpeed)
  9223. }
  9224. function l() {
  9225. k.toggleClass("hidden", !1),
  9226. U.toggleClass("hidden", !0)
  9227. }
  9228. function c() {
  9229. k.toggleClass("hidden", !0),
  9230. U.toggleClass("hidden", !1)
  9231. }
  9232. function h() {
  9233. B.filter(".device-headset").attr("src", G),
  9234. B.filter(".device-phone").attr("src", z),
  9235. J = Z,
  9236. ee = K,
  9237. F.text(x.localizeText("WEBVR_DAYDREAM_VIEW")),
  9238. V.text(x.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9239. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9240. c()
  9241. }
  9242. function u() {
  9243. B.filter(".badge-cardboard").attr("src", j),
  9244. B.filter(".badge-oculus").attr("src", X),
  9245. l()
  9246. }
  9247. function d() {
  9248. B.filter(".device-headset").attr("src", Y),
  9249. B.filter(".device-phone").attr("src", W),
  9250. J = q,
  9251. ee = Q,
  9252. F.text(x.localizeText("VR_GOOGLE_CARDBOARD")),
  9253. V.text(x.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9254. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9255. c()
  9256. }
  9257. function p() {
  9258. D.toggleClass("hidden"),
  9259. N.toggleClass("hidden")
  9260. }
  9261. function f() {
  9262. R.info("exiting webVR"),
  9263. g("webvr_exit_app"),
  9264. window.location.search.indexOf("&qs=1") === -1 ? window.location = window.location + "&qs=1" : window.location = window.location
  9265. }
  9266. function g(e) {
  9267. var t = C.isLandscape() ? "landscape" : "portrait";
  9268. T.trackAlways("showcase_gui", {
  9269. gui_action: e,
  9270. orientation: t
  9271. })
  9272. }
  9273. function m() {
  9274. var e = C.isLandscape();
  9275. L.toggleClass("landscape", e).toggleClass("portrait", !e)
  9276. }
  9277. var v, A, y, C = e("../../util/browser"), I = e("../../settings"), E = (e("./../gui"),
  9278. e("../../enum/VRPlatforms")), b = e("../../enum/VRApps"), w = e("./../vr/vrLink"), _ = e("./WebVrEvent"), T = e("../../analytics"), x = (e("../../constants"),
  9279. 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 = {
  9280. init: n
  9281. }, ne = {
  9282. tabcardboard: d,
  9283. tabdaydream: h,
  9284. tabnative: u
  9285. };
  9286. S.extendObject(ie, P.prototype),
  9287. $(window).resize(m),
  9288. t.exports = ie
  9289. }
  9290. ).call(this, "/js/gui/webvr/webVRgui.js")
  9291. }
  9292. , {
  9293. "../../analytics": 4,
  9294. "../../constants": 8,
  9295. "../../enum/VRApps": 46,
  9296. "../../enum/VRPlatforms": 49,
  9297. "../../localization/localize": 108,
  9298. "../../settings": 166,
  9299. "../../util/browser": 182,
  9300. "../../util/common": 185,
  9301. "../../util/logger": 189,
  9302. "./../gui": 65,
  9303. "./../vr/vrLink": 86,
  9304. "./WebVrEvent": 88,
  9305. events: 202
  9306. }],
  9307. 90: [function(e, t, i) {
  9308. "use strict";
  9309. function n(e, t, i, n, o) {
  9310. n || 0 === n ? this.floorId = n : this.floorId = -1,
  9311. this.roomId = o || "",
  9312. this.labelId = e,
  9313. this.position = (new r.Vector3).copy(t),
  9314. this.text = i
  9315. }
  9316. var r = e("three")
  9317. , o = e("../util/browser");
  9318. n.prototype.build = function() {
  9319. var e = window.document.createElement("div");
  9320. o.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9321. var t = window.document.createElement("div");
  9322. t.setAttribute("class", "gui-floorplan-label-text");
  9323. var i = window.document.createTextNode(this.text);
  9324. t.appendChild(i),
  9325. e.appendChild(t),
  9326. window.document.body.appendChild(e),
  9327. this.labelGui = e,
  9328. this.textBlock = t,
  9329. $(this.labelGui).hide();
  9330. var n = window.getComputedStyle(this.labelGui);
  9331. this.initialTransform = n.transform || n.webkitTransform
  9332. }
  9333. ,
  9334. t.exports = n
  9335. }
  9336. , {
  9337. "../util/browser": 182,
  9338. three: 217
  9339. }],
  9340. 91: [function(e, t, i) {
  9341. "use strict";
  9342. function n() {
  9343. this.player = null,
  9344. this.modelManager = null,
  9345. this.container = null
  9346. }
  9347. var r = e("three")
  9348. , o = (e("../util/common"),
  9349. e("../enum/PlayerEvents"))
  9350. , a = (e("../enum/DirectorEvents"),
  9351. e("../enum/ModelManagerEvents"))
  9352. , s = e("../settings")
  9353. , l = e("../enum/Viewmode")
  9354. , c = (e("../enum/WarpStyle"),
  9355. e("../util/transitions"),
  9356. e("../util/lerp"),
  9357. e("../util/browser"));
  9358. n.prototype.init = function(e, t, i) {
  9359. this.player = e,
  9360. this.modelManager = t,
  9361. this.container = i,
  9362. this.updateModel(),
  9363. this.bindEvents()
  9364. }
  9365. ,
  9366. n.prototype.bindEvents = function() {
  9367. this.modelManager.on(a.ActiveModelChanged, this.updateModel.bind(this)),
  9368. this.player.on(o.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9369. this.player.on(o.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9370. this.player.on(o.StartInside, this.handleStartInside.bind(this)),
  9371. this.player.on(o.StartOutside, this.handleStartOutside.bind(this))
  9372. }
  9373. ,
  9374. n.prototype.updateModel = function() {
  9375. this.model = this.modelManager.getActiveModel()
  9376. }
  9377. ,
  9378. n.prototype.handlePlayerViewChanged = function() {
  9379. this.updateLabelVisibility(),
  9380. this.updateLabelDisplay()
  9381. }
  9382. ,
  9383. n.prototype.getLabelsForFloor = function(e, t) {
  9384. return t = t || [],
  9385. t.length = 0,
  9386. this.model.labels.forEach(function(i) {
  9387. this.labelVisibleForFloor(i, e) && t.push(i)
  9388. }
  9389. .bind(this)),
  9390. t
  9391. }
  9392. ,
  9393. n.prototype.getLabelsForCurrentFloor = function(e) {
  9394. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9395. }
  9396. ,
  9397. n.prototype.labelVisibleForFloor = function(e, t) {
  9398. var i = c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.mobile || !c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.desktop;
  9399. if (!this.model.showingLabels || !e.labelGui || !i)
  9400. return !1;
  9401. var n = e.floorId === this.model.floors.size() - 1;
  9402. return this.model.allFloorsVisible ? n : e.floorId === t
  9403. }
  9404. ,
  9405. n.prototype.updateLabelVisibility = function(e) {
  9406. this.model.labels.forEach(function(e) {
  9407. 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)
  9408. }
  9409. .bind(this))
  9410. }
  9411. ,
  9412. n.prototype.showAllLabels = function(e, t) {
  9413. this.model.labels.forEach(function(i) {
  9414. this.showLabel(i, e, t)
  9415. }
  9416. .bind(this))
  9417. }
  9418. ,
  9419. n.prototype.hideAllLabels = function(e, t) {
  9420. this.model.labels.forEach(function(i) {
  9421. this.hideLabel(i, e, t)
  9422. }
  9423. .bind(this))
  9424. }
  9425. ,
  9426. n.prototype.showLabel = function(e, t, i) {
  9427. this.model.showingLabels && (e.visible || (e.visible = !0,
  9428. e.labelGui.style.display = "block",
  9429. e.labelGui.style.opacity = 0,
  9430. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9431. }
  9432. ,
  9433. n.prototype.hideLabel = function(e, t, i) {
  9434. e.visible && (e.visible = !1,
  9435. c.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9436. }
  9437. ,
  9438. n.prototype.supportedMode = function() {
  9439. return this.player.mode === l.FLOORPLAN
  9440. }
  9441. ,
  9442. n.prototype.updateLabelDisplay = function() {
  9443. var e = (new r.Vector3,
  9444. new r.Vector3,
  9445. []);
  9446. return function() {
  9447. var t = this.player.getLabelScaleFactor()
  9448. , i = .6
  9449. , n = 1.2
  9450. , r = (1 - t) * n + i
  9451. , o = c.isMobile() ? s.labels.zoomTruncateThreshhold.mobile : s.labels.zoomTruncateThreshhold.desktop;
  9452. this.getLabelsForCurrentFloor(e);
  9453. for (var a = 0; a < e.length; a++) {
  9454. var l = e[a];
  9455. this.supportedMode() && l.labelGui && (this.updateProjectedGuiElement(l.labelGui, l.textBlock, l.position, r, r),
  9456. 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)
  9457. }
  9458. }
  9459. }(),
  9460. n.prototype.updateProjectedGuiElement = function() {
  9461. var e = new r.Vector3;
  9462. new r.Vector3;
  9463. return function(t, i, n, r, o) {
  9464. i.style.fontSize = 100 * o + "%";
  9465. var a = $("#player").width()
  9466. , s = $("#player").height()
  9467. , l = .5 * a
  9468. , c = .5 * s;
  9469. e.copy(n),
  9470. e.project(this.player.camera);
  9471. var h = e.x * l + l
  9472. , u = -(e.y * c) + c;
  9473. h -= t.offsetWidth / 2,
  9474. u -= t.offsetHeight / 2,
  9475. t.style.left = h + "px",
  9476. t.style.top = u + "px"
  9477. }
  9478. }(),
  9479. n.prototype.handleStartInside = function(e) {
  9480. this.updateLabelVisibility()
  9481. }
  9482. ,
  9483. n.prototype.handleStartOutside = function() {
  9484. this.updateLabelVisibility()
  9485. }
  9486. ,
  9487. t.exports = n
  9488. }
  9489. , {
  9490. "../enum/DirectorEvents": 23,
  9491. "../enum/ModelManagerEvents": 33,
  9492. "../enum/PlayerEvents": 40,
  9493. "../enum/Viewmode": 51,
  9494. "../enum/WarpStyle": 52,
  9495. "../settings": 166,
  9496. "../util/browser": 182,
  9497. "../util/common": 185,
  9498. "../util/lerp": 188,
  9499. "../util/transitions": 195,
  9500. three: 217
  9501. }],
  9502. 92: [function(e, t, i) {
  9503. "use strict";
  9504. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9505. if (null == this)
  9506. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9507. if ("function" != typeof e)
  9508. throw new TypeError("predicate must be a function");
  9509. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9510. if (t = i[o],
  9511. e.call(r, t, o, i))
  9512. return o;
  9513. return -1
  9514. }
  9515. ),
  9516. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9517. value: function(e) {
  9518. if (null == this)
  9519. throw new TypeError('"this" is null or not defined');
  9520. var t = Object(this)
  9521. , i = t.length >>> 0;
  9522. if ("function" != typeof e)
  9523. throw new TypeError("predicate must be a function");
  9524. for (var n = arguments[1], r = 0; r < i; ) {
  9525. var o = t[r];
  9526. if (e.call(n, o, r, t))
  9527. return o;
  9528. r++
  9529. }
  9530. }
  9531. })
  9532. }
  9533. , {}],
  9534. 93: [function(e, t, i) {
  9535. "use strict";
  9536. var n = n || {};
  9537. t.exports = n,
  9538. n.gui = n.gui || {},
  9539. n.utils = n.utils || {},
  9540. n.controllers = n.controllers || {},
  9541. n.dom = n.dom || {},
  9542. n.color = n.color || {},
  9543. n.utils.css = function() {
  9544. return {
  9545. load: function(e, t) {
  9546. t = t || document;
  9547. var i = t.createElement("link");
  9548. i.type = "text/css",
  9549. i.rel = "stylesheet",
  9550. i.href = e,
  9551. t.getElementsByTagName("head")[0].appendChild(i)
  9552. },
  9553. inject: function(e, t) {
  9554. t = t || document;
  9555. var i = document.createElement("style");
  9556. i.type = "text/css",
  9557. i.innerHTML = e,
  9558. t.getElementsByTagName("head")[0].appendChild(i)
  9559. }
  9560. }
  9561. }(),
  9562. n.utils.common = function() {
  9563. var e = Array.prototype.forEach
  9564. , t = Array.prototype.slice;
  9565. return {
  9566. BREAK: {},
  9567. extend: function(e) {
  9568. return this.each(t.call(arguments, 1), function(t) {
  9569. for (var i in t)
  9570. this.isUndefined(t[i]) || (e[i] = t[i])
  9571. }, this),
  9572. e
  9573. },
  9574. defaults: function(e) {
  9575. return this.each(t.call(arguments, 1), function(t) {
  9576. for (var i in t)
  9577. this.isUndefined(e[i]) && (e[i] = t[i])
  9578. }, this),
  9579. e
  9580. },
  9581. compose: function() {
  9582. var e = t.call(arguments);
  9583. return function() {
  9584. for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--)
  9585. i = [e[n].apply(this, i)];
  9586. return i[0]
  9587. }
  9588. },
  9589. each: function(t, i, n) {
  9590. if (t)
  9591. if (e && t.forEach && t.forEach === e)
  9592. t.forEach(i, n);
  9593. else if (t.length === t.length + 0) {
  9594. for (var r = 0, o = t.length; r < o; r++)
  9595. if (r in t && i.call(n, t[r], r) === this.BREAK)
  9596. return
  9597. } else
  9598. for (var r in t)
  9599. if (i.call(n, t[r], r) === this.BREAK)
  9600. return
  9601. },
  9602. defer: function(e) {
  9603. setTimeout(e, 0)
  9604. },
  9605. toArray: function(e) {
  9606. return e.toArray ? e.toArray() : t.call(e)
  9607. },
  9608. isUndefined: function(e) {
  9609. return void 0 === e
  9610. },
  9611. isNull: function(e) {
  9612. return null === e
  9613. },
  9614. isNaN: function(e) {
  9615. return e !== e
  9616. },
  9617. isArray: Array.isArray || function(e) {
  9618. return e.constructor === Array
  9619. }
  9620. ,
  9621. isObject: function(e) {
  9622. return e === Object(e)
  9623. },
  9624. isNumber: function(e) {
  9625. return e === e + 0
  9626. },
  9627. isString: function(e) {
  9628. return e === e + ""
  9629. },
  9630. isBoolean: function(e) {
  9631. return e === !1 || e === !0
  9632. },
  9633. isFunction: function(e) {
  9634. return "[object Function]" === Object.prototype.toString.call(e)
  9635. }
  9636. }
  9637. }(),
  9638. n.controllers.Controller = function(e) {
  9639. var t = function(e, t) {
  9640. this.initialValue = e[t],
  9641. this.domElement = document.createElement("div"),
  9642. this.object = e,
  9643. this.property = t,
  9644. this.__onChange = void 0,
  9645. this.__onFinishChange = void 0
  9646. };
  9647. return e.extend(t.prototype, {
  9648. onChange: function(e) {
  9649. return this.__onChange = e,
  9650. this
  9651. },
  9652. onFinishChange: function(e) {
  9653. return this.__onFinishChange = e,
  9654. this
  9655. },
  9656. setValue: function(e) {
  9657. return this.object[this.property] = e,
  9658. this.__onChange && this.__onChange.call(this, e),
  9659. this.updateDisplay(),
  9660. this
  9661. },
  9662. getValue: function() {
  9663. return this.object[this.property]
  9664. },
  9665. updateDisplay: function() {
  9666. return this
  9667. },
  9668. isModified: function() {
  9669. return this.initialValue !== this.getValue()
  9670. }
  9671. }),
  9672. t
  9673. }(n.utils.common),
  9674. n.dom.dom = function(e) {
  9675. function t(t) {
  9676. if ("0" === t || e.isUndefined(t))
  9677. return 0;
  9678. var i = t.match(r);
  9679. return e.isNull(i) ? 0 : parseFloat(i[1])
  9680. }
  9681. var i = {
  9682. HTMLEvents: ["change"],
  9683. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9684. KeyboardEvents: ["keydown"]
  9685. }
  9686. , n = {};
  9687. e.each(i, function(t, i) {
  9688. e.each(t, function(e) {
  9689. n[e] = i
  9690. })
  9691. });
  9692. var r = /(\d+(\.\d+)?)px/
  9693. , o = {
  9694. makeSelectable: function(e, t) {
  9695. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9696. return !1
  9697. }
  9698. : function() {}
  9699. ,
  9700. e.style.MozUserSelect = t ? "auto" : "none",
  9701. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9702. e.unselectable = t ? "on" : "off")
  9703. },
  9704. makeFullscreen: function(t, i, n) {
  9705. e.isUndefined(i) && (i = !0),
  9706. e.isUndefined(n) && (n = !0),
  9707. t.style.position = "absolute",
  9708. i && (t.style.left = 0,
  9709. t.style.right = 0),
  9710. n && (t.style.top = 0,
  9711. t.style.bottom = 0)
  9712. },
  9713. fakeEvent: function(t, i, r, o) {
  9714. r = r || {};
  9715. var a = n[i];
  9716. if (!a)
  9717. throw new Error("Event type " + i + " not supported.");
  9718. var s = document.createEvent(a);
  9719. switch (a) {
  9720. case "MouseEvents":
  9721. var l = r.x || r.clientX || 0
  9722. , c = r.y || r.clientY || 0;
  9723. s.initMouseEvent(i, r.bubbles || !1, r.cancelable || !0, window, r.clickCount || 1, 0, 0, l, c, !1, !1, !1, !1, 0, null);
  9724. break;
  9725. case "KeyboardEvents":
  9726. var h = s.initKeyboardEvent || s.initKeyEvent;
  9727. e.defaults(r, {
  9728. cancelable: !0,
  9729. ctrlKey: !1,
  9730. altKey: !1,
  9731. shiftKey: !1,
  9732. metaKey: !1,
  9733. keyCode: void 0,
  9734. charCode: void 0
  9735. }),
  9736. h(i, r.bubbles || !1, r.cancelable, window, r.ctrlKey, r.altKey, r.shiftKey, r.metaKey, r.keyCode, r.charCode);
  9737. break;
  9738. default:
  9739. s.initEvent(i, r.bubbles || !1, r.cancelable || !0)
  9740. }
  9741. e.defaults(s, o),
  9742. t.dispatchEvent(s)
  9743. },
  9744. bind: function(e, t, i, n) {
  9745. return n = n || !1,
  9746. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9747. o
  9748. },
  9749. unbind: function(e, t, i, n) {
  9750. return n = n || !1,
  9751. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9752. o
  9753. },
  9754. addClass: function(e, t) {
  9755. if (void 0 === e.className)
  9756. e.className = t;
  9757. else if (e.className !== t) {
  9758. var i = e.className.split(/ +/);
  9759. i.indexOf(t) == -1 && (i.push(t),
  9760. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9761. }
  9762. return o
  9763. },
  9764. removeClass: function(e, t) {
  9765. if (t)
  9766. if (void 0 === e.className)
  9767. ;
  9768. else if (e.className === t)
  9769. e.removeAttribute("class");
  9770. else {
  9771. var i = e.className.split(/ +/)
  9772. , n = i.indexOf(t);
  9773. n != -1 && (i.splice(n, 1),
  9774. e.className = i.join(" "))
  9775. }
  9776. else
  9777. e.className = void 0;
  9778. return o
  9779. },
  9780. hasClass: function(e, t) {
  9781. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9782. },
  9783. getWidth: function(e) {
  9784. var i = getComputedStyle(e);
  9785. return t(i["border-left-width"]) + t(i["border-right-width"]) + t(i["padding-left"]) + t(i["padding-right"]) + t(i.width)
  9786. },
  9787. getHeight: function(e) {
  9788. var i = getComputedStyle(e);
  9789. return t(i["border-top-width"]) + t(i["border-bottom-width"]) + t(i["padding-top"]) + t(i["padding-bottom"]) + t(i.height)
  9790. },
  9791. getOffset: function(e) {
  9792. var t = {
  9793. left: 0,
  9794. top: 0
  9795. };
  9796. if (e.offsetParent)
  9797. do
  9798. t.left += e.offsetLeft,
  9799. t.top += e.offsetTop;
  9800. while (e = e.offsetParent);return t
  9801. },
  9802. isActive: function(e) {
  9803. return e === document.activeElement && (e.type || e.href)
  9804. }
  9805. };
  9806. return o
  9807. }(n.utils.common),
  9808. n.controllers.OptionController = function(e, t, i) {
  9809. var n = function(e, r, o) {
  9810. n.superclass.call(this, e, r);
  9811. var a = this;
  9812. if (this.__select = document.createElement("select"),
  9813. i.isArray(o)) {
  9814. var s = {};
  9815. i.each(o, function(e) {
  9816. s[e] = e
  9817. }),
  9818. o = s
  9819. }
  9820. i.each(o, function(e, t) {
  9821. var i = document.createElement("option");
  9822. i.innerHTML = t,
  9823. i.setAttribute("value", e),
  9824. a.__select.appendChild(i)
  9825. }),
  9826. this.updateDisplay(),
  9827. t.bind(this.__select, "change", function() {
  9828. var e = this.options[this.selectedIndex].value;
  9829. a.setValue(e)
  9830. }),
  9831. this.domElement.appendChild(this.__select)
  9832. };
  9833. return n.superclass = e,
  9834. i.extend(n.prototype, e.prototype, {
  9835. setValue: function(e) {
  9836. var t = n.superclass.prototype.setValue.call(this, e);
  9837. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9838. t
  9839. },
  9840. updateDisplay: function() {
  9841. return this.__select.value = this.getValue(),
  9842. n.superclass.prototype.updateDisplay.call(this)
  9843. }
  9844. }),
  9845. n
  9846. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  9847. n.controllers.NumberController = function(e, t) {
  9848. function i(e) {
  9849. return e = e.toString(),
  9850. e.indexOf(".") > -1 ? e.length - e.indexOf(".") - 1 : 0
  9851. }
  9852. var n = function(e, r, o) {
  9853. n.superclass.call(this, e, r),
  9854. o = o || {},
  9855. this.__min = o.min,
  9856. this.__max = o.max,
  9857. this.__step = o.step,
  9858. 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,
  9859. this.__precision = i(this.__impliedStep)
  9860. };
  9861. return n.superclass = e,
  9862. t.extend(n.prototype, e.prototype, {
  9863. setValue: function(e) {
  9864. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9865. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9866. n.superclass.prototype.setValue.call(this, e)
  9867. },
  9868. min: function(e) {
  9869. return this.__min = e,
  9870. this
  9871. },
  9872. max: function(e) {
  9873. return this.__max = e,
  9874. this
  9875. },
  9876. step: function(e) {
  9877. return this.__step = e,
  9878. this.__impliedStep = e,
  9879. this.__precision = i(e),
  9880. this
  9881. }
  9882. }),
  9883. n
  9884. }(n.controllers.Controller, n.utils.common),
  9885. n.controllers.NumberControllerBox = function(e, t, i) {
  9886. function n(e, t) {
  9887. var i = Math.pow(10, t);
  9888. return Math.round(e * i) / i
  9889. }
  9890. var r = function(e, n, o) {
  9891. function a() {
  9892. var e = parseFloat(d.__input.value);
  9893. i.isNaN(e) || d.setValue(e)
  9894. }
  9895. function s() {
  9896. a(),
  9897. d.__onFinishChange && d.__onFinishChange.call(d, d.getValue())
  9898. }
  9899. function l(e) {
  9900. t.bind(window, "mousemove", c),
  9901. t.bind(window, "mouseup", h),
  9902. u = e.clientY
  9903. }
  9904. function c(e) {
  9905. var t = u - e.clientY;
  9906. d.setValue(d.getValue() + t * d.__impliedStep),
  9907. u = e.clientY
  9908. }
  9909. function h() {
  9910. t.unbind(window, "mousemove", c),
  9911. t.unbind(window, "mouseup", h)
  9912. }
  9913. this.__truncationSuspended = !1,
  9914. r.superclass.call(this, e, n, o);
  9915. var u, d = this;
  9916. this.__input = document.createElement("input"),
  9917. this.__input.setAttribute("type", "text"),
  9918. t.bind(this.__input, "change", a),
  9919. t.bind(this.__input, "blur", s),
  9920. t.bind(this.__input, "mousedown", l),
  9921. t.bind(this.__input, "keydown", function(e) {
  9922. 13 === e.keyCode && (d.__truncationSuspended = !0,
  9923. this.blur(),
  9924. d.__truncationSuspended = !1)
  9925. }),
  9926. this.updateDisplay(),
  9927. this.domElement.appendChild(this.__input)
  9928. };
  9929. return r.superclass = e,
  9930. i.extend(r.prototype, e.prototype, {
  9931. updateDisplay: function() {
  9932. return this.__input.value = this.__truncationSuspended ? this.getValue() : n(this.getValue(), this.__precision),
  9933. r.superclass.prototype.updateDisplay.call(this)
  9934. }
  9935. }),
  9936. r
  9937. }(n.controllers.NumberController, n.dom.dom, n.utils.common),
  9938. n.controllers.NumberControllerSlider = function(e, t, i, n, r) {
  9939. function o(e, t, i, n, r) {
  9940. return n + (r - n) * ((e - t) / (i - t))
  9941. }
  9942. var a = function(e, i, n, r, s) {
  9943. function l(e) {
  9944. t.bind(window, "mousemove", c),
  9945. t.bind(window, "mouseup", h),
  9946. c(e)
  9947. }
  9948. function c(e) {
  9949. e.preventDefault();
  9950. var i = t.getOffset(u.__background)
  9951. , n = t.getWidth(u.__background);
  9952. return u.setValue(o(e.clientX, i.left, i.left + n, u.__min, u.__max)),
  9953. !1
  9954. }
  9955. function h() {
  9956. t.unbind(window, "mousemove", c),
  9957. t.unbind(window, "mouseup", h),
  9958. u.__onFinishChange && u.__onFinishChange.call(u, u.getValue())
  9959. }
  9960. a.superclass.call(this, e, i, {
  9961. min: n,
  9962. max: r,
  9963. step: s
  9964. });
  9965. var u = this;
  9966. this.__background = document.createElement("div"),
  9967. this.__foreground = document.createElement("div"),
  9968. t.bind(this.__background, "mousedown", l),
  9969. t.addClass(this.__background, "slider"),
  9970. t.addClass(this.__foreground, "slider-fg"),
  9971. this.updateDisplay(),
  9972. this.__background.appendChild(this.__foreground),
  9973. this.domElement.appendChild(this.__background)
  9974. };
  9975. return a.superclass = e,
  9976. a.useDefaultStyles = function() {
  9977. i.inject(r)
  9978. }
  9979. ,
  9980. n.extend(a.prototype, e.prototype, {
  9981. updateDisplay: function() {
  9982. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  9983. return this.__foreground.style.width = 100 * e + "%",
  9984. a.superclass.prototype.updateDisplay.call(this)
  9985. }
  9986. }),
  9987. a
  9988. }(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}"),
  9989. n.controllers.FunctionController = function(e, t, i) {
  9990. var n = function(e, i, r) {
  9991. n.superclass.call(this, e, i);
  9992. var o = this;
  9993. this.__button = document.createElement("div"),
  9994. this.__button.innerHTML = void 0 === r ? "Fire" : r,
  9995. t.bind(this.__button, "click", function(e) {
  9996. return e.preventDefault(),
  9997. o.fire(),
  9998. !1
  9999. }),
  10000. t.addClass(this.__button, "button"),
  10001. this.domElement.appendChild(this.__button)
  10002. };
  10003. return n.superclass = e,
  10004. i.extend(n.prototype, e.prototype, {
  10005. fire: function() {
  10006. this.__onChange && this.__onChange.call(this),
  10007. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10008. this.getValue().call(this.object)
  10009. }
  10010. }),
  10011. n
  10012. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10013. n.controllers.BooleanController = function(e, t, i) {
  10014. var n = function(e, i) {
  10015. function r() {
  10016. o.setValue(!o.__prev)
  10017. }
  10018. n.superclass.call(this, e, i);
  10019. var o = this;
  10020. this.__prev = this.getValue(),
  10021. this.__checkbox = document.createElement("input"),
  10022. this.__checkbox.setAttribute("type", "checkbox"),
  10023. t.bind(this.__checkbox, "change", r, !1),
  10024. this.domElement.appendChild(this.__checkbox),
  10025. this.updateDisplay()
  10026. };
  10027. return n.superclass = e,
  10028. i.extend(n.prototype, e.prototype, {
  10029. setValue: function(e) {
  10030. var t = n.superclass.prototype.setValue.call(this, e);
  10031. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10032. this.__prev = this.getValue(),
  10033. t
  10034. },
  10035. updateDisplay: function() {
  10036. return this.getValue() === !0 ? (this.__checkbox.setAttribute("checked", "checked"),
  10037. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  10038. n.superclass.prototype.updateDisplay.call(this)
  10039. }
  10040. }),
  10041. n
  10042. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10043. n.color.toString = function(e) {
  10044. return function(t) {
  10045. if (1 == t.a || e.isUndefined(t.a)) {
  10046. for (var i = t.hex.toString(16); i.length < 6; )
  10047. i = "0" + i;
  10048. return "#" + i
  10049. }
  10050. return "rgba(" + Math.round(t.r) + "," + Math.round(t.g) + "," + Math.round(t.b) + "," + t.a + ")"
  10051. }
  10052. }(n.utils.common),
  10053. n.color.interpret = function(e, t) {
  10054. var i, n, r = function() {
  10055. n = !1;
  10056. var e = arguments.length > 1 ? t.toArray(arguments) : arguments[0];
  10057. return t.each(o, function(r) {
  10058. if (r.litmus(e))
  10059. return t.each(r.conversions, function(r, o) {
  10060. if (i = r.read(e),
  10061. n === !1 && i !== !1)
  10062. return n = i,
  10063. i.conversionName = o,
  10064. i.conversion = r,
  10065. t.BREAK
  10066. }),
  10067. t.BREAK
  10068. }),
  10069. n
  10070. }, o = [{
  10071. litmus: t.isString,
  10072. conversions: {
  10073. THREE_CHAR_HEX: {
  10074. read: function(e) {
  10075. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10076. return null !== t && {
  10077. space: "HEX",
  10078. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10079. }
  10080. },
  10081. write: e
  10082. },
  10083. SIX_CHAR_HEX: {
  10084. read: function(e) {
  10085. var t = e.match(/^#([A-F0-9]{6})$/i);
  10086. return null !== t && {
  10087. space: "HEX",
  10088. hex: parseInt("0x" + t[1].toString())
  10089. }
  10090. },
  10091. write: e
  10092. },
  10093. CSS_RGB: {
  10094. read: function(e) {
  10095. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10096. return null !== t && {
  10097. space: "RGB",
  10098. r: parseFloat(t[1]),
  10099. g: parseFloat(t[2]),
  10100. b: parseFloat(t[3])
  10101. }
  10102. },
  10103. write: e
  10104. },
  10105. CSS_RGBA: {
  10106. read: function(e) {
  10107. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10108. return null !== t && {
  10109. space: "RGB",
  10110. r: parseFloat(t[1]),
  10111. g: parseFloat(t[2]),
  10112. b: parseFloat(t[3]),
  10113. a: parseFloat(t[4])
  10114. }
  10115. },
  10116. write: e
  10117. }
  10118. }
  10119. }, {
  10120. litmus: t.isNumber,
  10121. conversions: {
  10122. HEX: {
  10123. read: function(e) {
  10124. return {
  10125. space: "HEX",
  10126. hex: e,
  10127. conversionName: "HEX"
  10128. }
  10129. },
  10130. write: function(e) {
  10131. return e.hex
  10132. }
  10133. }
  10134. }
  10135. }, {
  10136. litmus: t.isArray,
  10137. conversions: {
  10138. RGB_ARRAY: {
  10139. read: function(e) {
  10140. return 3 == e.length && {
  10141. space: "RGB",
  10142. r: e[0],
  10143. g: e[1],
  10144. b: e[2]
  10145. }
  10146. },
  10147. write: function(e) {
  10148. return [e.r, e.g, e.b]
  10149. }
  10150. },
  10151. RGBA_ARRAY: {
  10152. read: function(e) {
  10153. return 4 == e.length && {
  10154. space: "RGB",
  10155. r: e[0],
  10156. g: e[1],
  10157. b: e[2],
  10158. a: e[3]
  10159. }
  10160. },
  10161. write: function(e) {
  10162. return [e.r, e.g, e.b, e.a]
  10163. }
  10164. }
  10165. }
  10166. }, {
  10167. litmus: t.isObject,
  10168. conversions: {
  10169. RGBA_OBJ: {
  10170. read: function(e) {
  10171. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b) && t.isNumber(e.a)) && {
  10172. space: "RGB",
  10173. r: e.r,
  10174. g: e.g,
  10175. b: e.b,
  10176. a: e.a
  10177. }
  10178. },
  10179. write: function(e) {
  10180. return {
  10181. r: e.r,
  10182. g: e.g,
  10183. b: e.b,
  10184. a: e.a
  10185. }
  10186. }
  10187. },
  10188. RGB_OBJ: {
  10189. read: function(e) {
  10190. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b)) && {
  10191. space: "RGB",
  10192. r: e.r,
  10193. g: e.g,
  10194. b: e.b
  10195. }
  10196. },
  10197. write: function(e) {
  10198. return {
  10199. r: e.r,
  10200. g: e.g,
  10201. b: e.b
  10202. }
  10203. }
  10204. },
  10205. HSVA_OBJ: {
  10206. read: function(e) {
  10207. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v) && t.isNumber(e.a)) && {
  10208. space: "HSV",
  10209. h: e.h,
  10210. s: e.s,
  10211. v: e.v,
  10212. a: e.a
  10213. }
  10214. },
  10215. write: function(e) {
  10216. return {
  10217. h: e.h,
  10218. s: e.s,
  10219. v: e.v,
  10220. a: e.a
  10221. }
  10222. }
  10223. },
  10224. HSV_OBJ: {
  10225. read: function(e) {
  10226. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v)) && {
  10227. space: "HSV",
  10228. h: e.h,
  10229. s: e.s,
  10230. v: e.v
  10231. }
  10232. },
  10233. write: function(e) {
  10234. return {
  10235. h: e.h,
  10236. s: e.s,
  10237. v: e.v
  10238. }
  10239. }
  10240. }
  10241. }
  10242. }];
  10243. return r
  10244. }(n.color.toString, n.utils.common),
  10245. n.GUI = n.gui.GUI = function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
  10246. function g(e, t, i, o) {
  10247. if (void 0 === t[i])
  10248. throw new Error("Object " + t + ' has no property "' + i + '"');
  10249. var a;
  10250. if (o.color)
  10251. a = new h(t,i);
  10252. else {
  10253. var s = [t, i].concat(o.factoryArgs);
  10254. a = n.apply(e, s)
  10255. }
  10256. o.before instanceof r && (o.before = o.before.__li),
  10257. A(e, a),
  10258. p.addClass(a.domElement, "c");
  10259. var l = document.createElement("span");
  10260. p.addClass(l, "property-name"),
  10261. l.innerHTML = a.property;
  10262. var c = document.createElement("div");
  10263. c.appendChild(l),
  10264. c.appendChild(a.domElement);
  10265. var u = m(e, c, o.before);
  10266. return p.addClass(u, V.CLASS_CONTROLLER_ROW),
  10267. p.addClass(u, typeof a.getValue()),
  10268. v(e, u, a),
  10269. e.__controllers.push(a),
  10270. a
  10271. }
  10272. function m(e, t, i) {
  10273. var n = document.createElement("li");
  10274. return t && n.appendChild(t),
  10275. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10276. e.onResize(),
  10277. n
  10278. }
  10279. function v(e, t, i) {
  10280. if (i.__li = t,
  10281. i.__gui = e,
  10282. f.extend(i, {
  10283. options: function(t) {
  10284. return arguments.length > 1 ? (i.remove(),
  10285. g(e, i.object, i.property, {
  10286. before: i.__li.nextElementSibling,
  10287. factoryArgs: [f.toArray(arguments)]
  10288. })) : f.isArray(t) || f.isObject(t) ? (i.remove(),
  10289. g(e, i.object, i.property, {
  10290. before: i.__li.nextElementSibling,
  10291. factoryArgs: [t]
  10292. })) : void 0
  10293. },
  10294. name: function(e) {
  10295. return i.__li.firstElementChild.firstElementChild.innerHTML = e,
  10296. i
  10297. },
  10298. listen: function() {
  10299. return i.__gui.listen(i),
  10300. i
  10301. },
  10302. remove: function() {
  10303. return i.__gui.remove(i),
  10304. i
  10305. }
  10306. }),
  10307. i instanceof l) {
  10308. var n = new s(i.object,i.property,{
  10309. min: i.__min,
  10310. max: i.__max,
  10311. step: i.__step
  10312. });
  10313. f.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10314. var t = i[e]
  10315. , r = n[e];
  10316. i[e] = n[e] = function() {
  10317. var e = Array.prototype.slice.call(arguments);
  10318. return t.apply(i, e),
  10319. r.apply(n, e)
  10320. }
  10321. }),
  10322. p.addClass(t, "has-slider"),
  10323. i.domElement.insertBefore(n.domElement, i.domElement.firstElementChild)
  10324. } else if (i instanceof s) {
  10325. var r = function(t) {
  10326. return f.isNumber(i.__min) && f.isNumber(i.__max) ? (i.remove(),
  10327. g(e, i.object, i.property, {
  10328. before: i.__li.nextElementSibling,
  10329. factoryArgs: [i.__min, i.__max, i.__step]
  10330. })) : t
  10331. };
  10332. i.min = f.compose(r, i.min),
  10333. i.max = f.compose(r, i.max)
  10334. } else
  10335. i instanceof o ? (p.bind(t, "click", function() {
  10336. p.fakeEvent(i.__checkbox, "click")
  10337. }),
  10338. p.bind(i.__checkbox, "click", function(e) {
  10339. e.stopPropagation()
  10340. })) : i instanceof a ? (p.bind(t, "click", function() {
  10341. p.fakeEvent(i.__button, "click")
  10342. }),
  10343. p.bind(t, "mouseover", function() {
  10344. p.addClass(i.__button, "hover")
  10345. }),
  10346. p.bind(t, "mouseout", function() {
  10347. p.removeClass(i.__button, "hover")
  10348. })) : i instanceof h && (p.addClass(t, "color"),
  10349. i.updateDisplay = f.compose(function(e) {
  10350. return t.style.borderLeftColor = i.__color.toString(),
  10351. e
  10352. }, i.updateDisplay),
  10353. i.updateDisplay());
  10354. i.setValue = f.compose(function(t) {
  10355. return e.getRoot().__preset_select && i.isModified() && T(e.getRoot(), !0),
  10356. t
  10357. }, i.setValue)
  10358. }
  10359. function A(e, t) {
  10360. var i = e.getRoot()
  10361. , n = i.__rememberedObjects.indexOf(t.object);
  10362. if (n != -1) {
  10363. var r = i.__rememberedObjectIndecesToControllers[n];
  10364. if (void 0 === r && (r = {},
  10365. i.__rememberedObjectIndecesToControllers[n] = r),
  10366. r[t.property] = t,
  10367. i.load && i.load.remembered) {
  10368. var o, a = i.load.remembered;
  10369. if (a[e.preset])
  10370. o = a[e.preset];
  10371. else {
  10372. if (!a[L])
  10373. return;
  10374. o = a[L]
  10375. }
  10376. if (o[n] && void 0 !== o[n][t.property]) {
  10377. var s = o[n][t.property];
  10378. t.initialValue = s,
  10379. t.setValue(s)
  10380. }
  10381. }
  10382. }
  10383. }
  10384. function y(e, t) {
  10385. return document.location.href + "." + t
  10386. }
  10387. function C(e) {
  10388. var t = e.__save_row = document.createElement("li");
  10389. p.addClass(e.domElement, "has-save"),
  10390. e.__ul.insertBefore(t, e.__ul.firstChild),
  10391. p.addClass(t, "save-row");
  10392. var i = document.createElement("span");
  10393. i.innerHTML = "&nbsp;",
  10394. p.addClass(i, "button gears");
  10395. var n = document.createElement("span");
  10396. n.innerHTML = "Save",
  10397. p.addClass(n, "button"),
  10398. p.addClass(n, "save");
  10399. var r = document.createElement("span");
  10400. r.innerHTML = "New",
  10401. p.addClass(r, "button"),
  10402. p.addClass(r, "save-as");
  10403. var o = document.createElement("span");
  10404. o.innerHTML = "Revert",
  10405. p.addClass(o, "button"),
  10406. p.addClass(o, "revert");
  10407. var a = e.__preset_select = document.createElement("select");
  10408. if (e.load && e.load.remembered ? f.each(e.load.remembered, function(t, i) {
  10409. w(e, i, i == e.preset)
  10410. }) : w(e, L, !1),
  10411. p.bind(a, "change", function() {
  10412. for (var t = 0; t < e.__preset_select.length; t++)
  10413. e.__preset_select[t].innerHTML = e.__preset_select[t].value;
  10414. e.preset = this.value
  10415. }),
  10416. t.appendChild(a),
  10417. t.appendChild(i),
  10418. t.appendChild(n),
  10419. t.appendChild(r),
  10420. t.appendChild(o),
  10421. D) {
  10422. var s = document.getElementById("dg-save-locally")
  10423. , l = document.getElementById("dg-local-explain");
  10424. s.style.display = "block";
  10425. var c = document.getElementById("dg-local-storage");
  10426. "true" === localStorage.getItem(y(e, "isLocal")) && c.setAttribute("checked", "checked");
  10427. var h = function() {
  10428. l.style.display = e.useLocalStorage ? "block" : "none"
  10429. };
  10430. h(),
  10431. p.bind(c, "change", function() {
  10432. e.useLocalStorage = !e.useLocalStorage,
  10433. h()
  10434. })
  10435. }
  10436. var u = document.getElementById("dg-new-constructor");
  10437. p.bind(u, "keydown", function(e) {
  10438. !e.metaKey || 67 !== e.which && 67 != e.keyCode || S.hide()
  10439. }),
  10440. p.bind(i, "click", function() {
  10441. u.innerHTML = JSON.stringify(e.getSaveObject(), void 0, 2),
  10442. S.show(),
  10443. u.focus(),
  10444. u.select()
  10445. }),
  10446. p.bind(n, "click", function() {
  10447. e.save()
  10448. }),
  10449. p.bind(r, "click", function() {
  10450. var t = prompt("Enter a new preset name.");
  10451. t && e.saveAs(t)
  10452. }),
  10453. p.bind(o, "click", function() {
  10454. e.revert()
  10455. })
  10456. }
  10457. function I(e) {
  10458. function t(t) {
  10459. return t.preventDefault(),
  10460. r = t.clientX,
  10461. p.addClass(e.__closeButton, V.CLASS_DRAG),
  10462. p.bind(window, "mousemove", i),
  10463. p.bind(window, "mouseup", n),
  10464. !1
  10465. }
  10466. function i(t) {
  10467. return t.preventDefault(),
  10468. e.width += r - t.clientX,
  10469. e.onResize(),
  10470. r = t.clientX,
  10471. !1
  10472. }
  10473. function n() {
  10474. p.removeClass(e.__closeButton, V.CLASS_DRAG),
  10475. p.unbind(window, "mousemove", i),
  10476. p.unbind(window, "mouseup", n)
  10477. }
  10478. e.__resize_handle = document.createElement("div"),
  10479. f.extend(e.__resize_handle.style, {
  10480. width: "6px",
  10481. marginLeft: "-3px",
  10482. height: "200px",
  10483. cursor: "ew-resize",
  10484. position: "absolute"
  10485. });
  10486. var r;
  10487. p.bind(e.__resize_handle, "mousedown", t),
  10488. p.bind(e.__closeButton, "mousedown", t),
  10489. e.domElement.insertBefore(e.__resize_handle, e.domElement.firstElementChild)
  10490. }
  10491. function E(e, t) {
  10492. e.domElement.style.width = t + "px",
  10493. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10494. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10495. }
  10496. function b(e, t) {
  10497. var i = {};
  10498. return f.each(e.__rememberedObjects, function(n, r) {
  10499. var o = {}
  10500. , a = e.__rememberedObjectIndecesToControllers[r];
  10501. f.each(a, function(e, i) {
  10502. o[i] = t ? e.initialValue : e.getValue()
  10503. }),
  10504. i[r] = o
  10505. }),
  10506. i
  10507. }
  10508. function w(e, t, i) {
  10509. var n = document.createElement("option");
  10510. n.innerHTML = t,
  10511. n.value = t,
  10512. e.__preset_select.appendChild(n),
  10513. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10514. }
  10515. function _(e) {
  10516. for (var t = 0; t < e.__preset_select.length; t++)
  10517. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10518. }
  10519. function T(e, t) {
  10520. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10521. t ? i.innerHTML = i.value + "*" : i.innerHTML = i.value
  10522. }
  10523. function x(e) {
  10524. 0 != e.length && u(function() {
  10525. x(e)
  10526. }),
  10527. f.each(e, function(e) {
  10528. e.updateDisplay()
  10529. })
  10530. }
  10531. e.inject(i);
  10532. var S, M, R = "dg", P = 72, O = 20, L = "Default", D = function() {
  10533. try {
  10534. return "localStorage"in window && null !== window.localStorage
  10535. } catch (e) {
  10536. return !1
  10537. }
  10538. }(), N = !0, B = !1, F = [], V = function(e) {
  10539. function t() {
  10540. var e = i.getRoot();
  10541. e.width += 1,
  10542. f.defer(function() {
  10543. e.width -= 1
  10544. })
  10545. }
  10546. var i = this;
  10547. this.domElement = document.createElement("div"),
  10548. this.__ul = document.createElement("ul"),
  10549. this.domElement.appendChild(this.__ul),
  10550. p.addClass(this.domElement, R),
  10551. this.__folders = {},
  10552. this.__controllers = [],
  10553. this.__rememberedObjects = [],
  10554. this.__rememberedObjectIndecesToControllers = [],
  10555. this.__listening = [],
  10556. e = e || {},
  10557. e = f.defaults(e, {
  10558. autoPlace: !0,
  10559. width: V.DEFAULT_WIDTH
  10560. }),
  10561. e = f.defaults(e, {
  10562. resizable: e.autoPlace,
  10563. hideable: e.autoPlace
  10564. }),
  10565. f.isUndefined(e.load) ? e.load = {
  10566. preset: L
  10567. } : e.preset && (e.load.preset = e.preset),
  10568. f.isUndefined(e.parent) && e.hideable && F.push(this),
  10569. e.resizable = f.isUndefined(e.parent) && e.resizable,
  10570. e.autoPlace && f.isUndefined(e.scrollable) && (e.scrollable = !0);
  10571. var n, r = D && "true" === localStorage.getItem(y(this, "isLocal"));
  10572. if (Object.defineProperties(this, {
  10573. parent: {
  10574. get: function() {
  10575. return e.parent
  10576. }
  10577. },
  10578. scrollable: {
  10579. get: function() {
  10580. return e.scrollable
  10581. }
  10582. },
  10583. autoPlace: {
  10584. get: function() {
  10585. return e.autoPlace
  10586. }
  10587. },
  10588. preset: {
  10589. get: function() {
  10590. return i.parent ? i.getRoot().preset : e.load.preset
  10591. },
  10592. set: function(t) {
  10593. i.parent ? i.getRoot().preset = t : e.load.preset = t,
  10594. _(this),
  10595. i.revert()
  10596. }
  10597. },
  10598. width: {
  10599. get: function() {
  10600. return e.width
  10601. },
  10602. set: function(t) {
  10603. e.width = t,
  10604. E(i, t)
  10605. }
  10606. },
  10607. name: {
  10608. get: function() {
  10609. return e.name
  10610. },
  10611. set: function(t) {
  10612. e.name = t,
  10613. a && (a.innerHTML = e.name)
  10614. }
  10615. },
  10616. closed: {
  10617. get: function() {
  10618. return e.closed
  10619. },
  10620. set: function(t) {
  10621. e.closed = t,
  10622. e.closed ? p.addClass(i.__ul, V.CLASS_CLOSED) : p.removeClass(i.__ul, V.CLASS_CLOSED),
  10623. this.onResize(),
  10624. i.__closeButton && (i.__closeButton.innerHTML = t ? V.TEXT_OPEN : V.TEXT_CLOSED)
  10625. }
  10626. },
  10627. load: {
  10628. get: function() {
  10629. return e.load
  10630. }
  10631. },
  10632. useLocalStorage: {
  10633. get: function() {
  10634. return r
  10635. },
  10636. set: function(e) {
  10637. D && (r = e,
  10638. e ? p.bind(window, "unload", n) : p.unbind(window, "unload", n),
  10639. localStorage.setItem(y(i, "isLocal"), e))
  10640. }
  10641. }
  10642. }),
  10643. f.isUndefined(e.parent)) {
  10644. if (e.closed = !1,
  10645. p.addClass(this.domElement, V.CLASS_MAIN),
  10646. p.makeSelectable(this.domElement, !1),
  10647. D && r) {
  10648. i.useLocalStorage = !0;
  10649. var o = localStorage.getItem(y(this, "gui"));
  10650. o && (e.load = JSON.parse(o))
  10651. }
  10652. this.__closeButton = document.createElement("div"),
  10653. this.__closeButton.innerHTML = V.TEXT_CLOSED,
  10654. p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
  10655. this.domElement.appendChild(this.__closeButton),
  10656. p.bind(this.__closeButton, "click", function() {
  10657. i.closed = !i.closed
  10658. })
  10659. } else {
  10660. void 0 === e.closed && (e.closed = !0);
  10661. var a = document.createTextNode(e.name);
  10662. p.addClass(a, "controller-name");
  10663. var s = m(i, a)
  10664. , l = function(e) {
  10665. return e.preventDefault(),
  10666. i.closed = !i.closed,
  10667. !1
  10668. };
  10669. p.addClass(this.__ul, V.CLASS_CLOSED),
  10670. p.addClass(s, "title"),
  10671. p.bind(s, "click", l),
  10672. e.closed || (this.closed = !1)
  10673. }
  10674. e.autoPlace && (f.isUndefined(e.parent) && (N && (M = document.createElement("div"),
  10675. p.addClass(M, R),
  10676. p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER),
  10677. document.body.appendChild(M),
  10678. N = !1),
  10679. M.appendChild(this.domElement),
  10680. p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
  10681. this.parent || E(i, e.width)),
  10682. p.bind(window, "resize", function() {
  10683. i.onResize()
  10684. }),
  10685. p.bind(this.__ul, "webkitTransitionEnd", function() {
  10686. i.onResize()
  10687. }),
  10688. p.bind(this.__ul, "transitionend", function() {
  10689. i.onResize()
  10690. }),
  10691. p.bind(this.__ul, "oTransitionEnd", function() {
  10692. i.onResize()
  10693. }),
  10694. this.onResize(),
  10695. e.resizable && I(this),
  10696. n = function() {
  10697. D && "true" === localStorage.getItem(y(i, "isLocal")) && localStorage.setItem(y(i, "gui"), JSON.stringify(i.getSaveObject()))
  10698. }
  10699. ,
  10700. this.saveToLocalStorageIfPossible = n;
  10701. i.getRoot();
  10702. e.parent || t()
  10703. };
  10704. return V.toggleHide = function() {
  10705. B = !B,
  10706. f.each(F, function(e) {
  10707. e.domElement.style.zIndex = B ? -999 : 999,
  10708. e.domElement.style.opacity = B ? 0 : 1
  10709. })
  10710. }
  10711. ,
  10712. V.CLASS_AUTO_PLACE = "a",
  10713. V.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10714. V.CLASS_MAIN = "main",
  10715. V.CLASS_CONTROLLER_ROW = "cr",
  10716. V.CLASS_TOO_TALL = "taller-than-window",
  10717. V.CLASS_CLOSED = "closed",
  10718. V.CLASS_CLOSE_BUTTON = "close-button",
  10719. V.CLASS_DRAG = "drag",
  10720. V.DEFAULT_WIDTH = 245,
  10721. V.TEXT_CLOSED = "Close Controls",
  10722. V.TEXT_OPEN = "Open Controls",
  10723. p.bind(window, "keydown", function(e) {
  10724. "text" === document.activeElement.type || e.which !== P && e.keyCode != P || V.toggleHide()
  10725. }, !1),
  10726. f.extend(V.prototype, {
  10727. add: function(e, t) {
  10728. return g(this, e, t, {
  10729. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10730. })
  10731. },
  10732. addColor: function(e, t) {
  10733. return g(this, e, t, {
  10734. color: !0
  10735. })
  10736. },
  10737. remove: function(e) {
  10738. this.__ul.removeChild(e.__li),
  10739. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10740. var t = this;
  10741. f.defer(function() {
  10742. t.onResize()
  10743. })
  10744. },
  10745. destroy: function() {
  10746. this.autoPlace && M.removeChild(this.domElement)
  10747. },
  10748. addFolder: function(e) {
  10749. if (void 0 !== this.__folders[e])
  10750. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10751. var t = {
  10752. name: e,
  10753. parent: this
  10754. };
  10755. t.autoPlace = this.autoPlace,
  10756. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10757. t.load = this.load.folders[e]);
  10758. var i = new V(t);
  10759. this.__folders[e] = i;
  10760. var n = m(this, i.domElement);
  10761. return p.addClass(n, "folder"),
  10762. i
  10763. },
  10764. open: function() {
  10765. this.closed = !1
  10766. },
  10767. close: function() {
  10768. this.closed = !0
  10769. },
  10770. onResize: function() {
  10771. var e = this.getRoot();
  10772. if (e.scrollable) {
  10773. var t = p.getOffset(e.__ul).top
  10774. , i = 0;
  10775. f.each(e.__ul.childNodes, function(t) {
  10776. e.autoPlace && t === e.__save_row || (i += p.getHeight(t))
  10777. }),
  10778. $("#player").height() - t - O < i ? (p.addClass(e.domElement, V.CLASS_TOO_TALL),
  10779. e.__ul.style.height = $("#player").height() - t - O + "px") : (p.removeClass(e.domElement, V.CLASS_TOO_TALL),
  10780. e.__ul.style.height = "auto")
  10781. }
  10782. e.__resize_handle && f.defer(function() {
  10783. e.__resize_handle.style.height = e.__ul.offsetHeight + "px"
  10784. }),
  10785. e.__closeButton && (e.__closeButton.style.width = e.width + "px")
  10786. },
  10787. remember: function() {
  10788. if (f.isUndefined(S) && (S = new d,
  10789. S.domElement.innerHTML = t),
  10790. this.parent)
  10791. throw new Error("You can only call remember on a top level GUI.");
  10792. var e = this;
  10793. f.each(Array.prototype.slice.call(arguments), function(t) {
  10794. 0 == e.__rememberedObjects.length && C(e),
  10795. e.__rememberedObjects.indexOf(t) == -1 && e.__rememberedObjects.push(t)
  10796. }),
  10797. this.autoPlace && E(this, this.width)
  10798. },
  10799. getRoot: function() {
  10800. for (var e = this; e.parent; )
  10801. e = e.parent;
  10802. return e
  10803. },
  10804. getSaveObject: function() {
  10805. var e = this.load;
  10806. return e.closed = this.closed,
  10807. this.__rememberedObjects.length > 0 && (e.preset = this.preset,
  10808. e.remembered || (e.remembered = {}),
  10809. e.remembered[this.preset] = b(this)),
  10810. e.folders = {},
  10811. f.each(this.__folders, function(t, i) {
  10812. e.folders[i] = t.getSaveObject()
  10813. }),
  10814. e
  10815. },
  10816. save: function() {
  10817. this.load.remembered || (this.load.remembered = {}),
  10818. this.load.remembered[this.preset] = b(this),
  10819. T(this, !1),
  10820. this.saveToLocalStorageIfPossible()
  10821. },
  10822. saveAs: function(e) {
  10823. this.load.remembered || (this.load.remembered = {},
  10824. this.load.remembered[L] = b(this, !0)),
  10825. this.load.remembered[e] = b(this),
  10826. this.preset = e,
  10827. w(this, e, !0),
  10828. this.saveToLocalStorageIfPossible()
  10829. },
  10830. revert: function(e) {
  10831. f.each(this.__controllers, function(t) {
  10832. this.getRoot().load.remembered ? A(e || this.getRoot(), t) : t.setValue(t.initialValue)
  10833. }, this),
  10834. f.each(this.__folders, function(e) {
  10835. e.revert(e)
  10836. }),
  10837. e || T(this.getRoot(), !1)
  10838. },
  10839. listen: function(e) {
  10840. var t = 0 == this.__listening.length;
  10841. this.__listening.push(e),
  10842. t && x(this.__listening)
  10843. }
  10844. }),
  10845. V
  10846. }(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) {
  10847. return function(s, l) {
  10848. var c = s[l];
  10849. 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,{
  10850. min: arguments[2],
  10851. max: arguments[3]
  10852. }) : a.isString(c) ? new n(s,l) : a.isFunction(c) ? new r(s,l,"") : a.isBoolean(c) ? new o(s,l) : void 0
  10853. }
  10854. }(n.controllers.OptionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.StringController = function(e, t, i) {
  10855. var n = function(e, i) {
  10856. function r() {
  10857. a.setValue(a.__input.value)
  10858. }
  10859. function o() {
  10860. a.__onFinishChange && a.__onFinishChange.call(a, a.getValue())
  10861. }
  10862. n.superclass.call(this, e, i);
  10863. var a = this;
  10864. this.__input = document.createElement("input"),
  10865. this.__input.setAttribute("type", "text"),
  10866. t.bind(this.__input, "keyup", r),
  10867. t.bind(this.__input, "change", r),
  10868. t.bind(this.__input, "blur", o),
  10869. t.bind(this.__input, "keydown", function(e) {
  10870. 13 === e.keyCode && this.blur()
  10871. }),
  10872. this.updateDisplay(),
  10873. this.domElement.appendChild(this.__input)
  10874. };
  10875. return n.superclass = e,
  10876. i.extend(n.prototype, e.prototype, {
  10877. updateDisplay: function() {
  10878. return t.isActive(this.__input) || (this.__input.value = this.getValue()),
  10879. n.superclass.prototype.updateDisplay.call(this)
  10880. }
  10881. }),
  10882. n
  10883. }(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) {
  10884. function o(e, t, i, n) {
  10885. e.style.background = "",
  10886. r.each(l, function(r) {
  10887. e.style.cssText += "background: " + r + "linear-gradient(" + t + ", " + i + " 0%, " + n + " 100%); "
  10888. })
  10889. }
  10890. function a(e) {
  10891. e.style.background = "",
  10892. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  10893. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10894. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10895. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10896. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  10897. }
  10898. var s = function(e, l) {
  10899. function c(e) {
  10900. p(e),
  10901. t.bind(window, "mousemove", p),
  10902. t.bind(window, "mouseup", h)
  10903. }
  10904. function h() {
  10905. t.unbind(window, "mousemove", p),
  10906. t.unbind(window, "mouseup", h)
  10907. }
  10908. function u() {
  10909. var e = n(this.value);
  10910. e !== !1 ? (g.__color.__state = e,
  10911. g.setValue(g.__color.toOriginal())) : this.value = g.__color.toString()
  10912. }
  10913. function d() {
  10914. t.unbind(window, "mousemove", f),
  10915. t.unbind(window, "mouseup", d)
  10916. }
  10917. function p(e) {
  10918. e.preventDefault();
  10919. var i = t.getWidth(g.__saturation_field)
  10920. , n = t.getOffset(g.__saturation_field)
  10921. , r = (e.clientX - n.left + document.body.scrollLeft) / i
  10922. , o = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  10923. return o > 1 ? o = 1 : o < 0 && (o = 0),
  10924. r > 1 ? r = 1 : r < 0 && (r = 0),
  10925. g.__color.v = o,
  10926. g.__color.s = r,
  10927. g.setValue(g.__color.toOriginal()),
  10928. !1
  10929. }
  10930. function f(e) {
  10931. e.preventDefault();
  10932. var i = t.getHeight(g.__hue_field)
  10933. , n = t.getOffset(g.__hue_field)
  10934. , r = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  10935. return r > 1 ? r = 1 : r < 0 && (r = 0),
  10936. g.__color.h = 360 * r,
  10937. g.setValue(g.__color.toOriginal()),
  10938. !1
  10939. }
  10940. s.superclass.call(this, e, l),
  10941. this.__color = new i(this.getValue()),
  10942. this.__temp = new i(0);
  10943. var g = this;
  10944. this.domElement = document.createElement("div"),
  10945. t.makeSelectable(this.domElement, !1),
  10946. this.__selector = document.createElement("div"),
  10947. this.__selector.className = "selector",
  10948. this.__saturation_field = document.createElement("div"),
  10949. this.__saturation_field.className = "saturation-field",
  10950. this.__field_knob = document.createElement("div"),
  10951. this.__field_knob.className = "field-knob",
  10952. this.__field_knob_border = "2px solid ",
  10953. this.__hue_knob = document.createElement("div"),
  10954. this.__hue_knob.className = "hue-knob",
  10955. this.__hue_field = document.createElement("div"),
  10956. this.__hue_field.className = "hue-field",
  10957. this.__input = document.createElement("input"),
  10958. this.__input.type = "text",
  10959. this.__input_textShadow = "0 1px 1px ",
  10960. t.bind(this.__input, "keydown", function(e) {
  10961. 13 === e.keyCode && u.call(this)
  10962. }),
  10963. t.bind(this.__input, "blur", u),
  10964. t.bind(this.__selector, "mousedown", function(e) {
  10965. t.addClass(this, "drag").bind(window, "mouseup", function(e) {
  10966. t.removeClass(g.__selector, "drag")
  10967. })
  10968. });
  10969. var m = document.createElement("div");
  10970. r.extend(this.__selector.style, {
  10971. width: "122px",
  10972. height: "102px",
  10973. padding: "3px",
  10974. backgroundColor: "#222",
  10975. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  10976. }),
  10977. r.extend(this.__field_knob.style, {
  10978. position: "absolute",
  10979. width: "12px",
  10980. height: "12px",
  10981. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  10982. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  10983. borderRadius: "12px",
  10984. zIndex: 1
  10985. }),
  10986. r.extend(this.__hue_knob.style, {
  10987. position: "absolute",
  10988. width: "15px",
  10989. height: "2px",
  10990. borderRight: "4px solid #fff",
  10991. zIndex: 1
  10992. }),
  10993. r.extend(this.__saturation_field.style, {
  10994. width: "100px",
  10995. height: "100px",
  10996. border: "1px solid #555",
  10997. marginRight: "3px",
  10998. display: "inline-block",
  10999. cursor: "pointer"
  11000. }),
  11001. r.extend(m.style, {
  11002. width: "100%",
  11003. height: "100%",
  11004. background: "none"
  11005. }),
  11006. o(m, "top", "rgba(0,0,0,0)", "#000"),
  11007. r.extend(this.__hue_field.style, {
  11008. width: "15px",
  11009. height: "100px",
  11010. display: "inline-block",
  11011. border: "1px solid #555",
  11012. cursor: "ns-resize"
  11013. }),
  11014. a(this.__hue_field),
  11015. r.extend(this.__input.style, {
  11016. outline: "none",
  11017. textAlign: "center",
  11018. color: "#fff",
  11019. border: 0,
  11020. fontWeight: "bold",
  11021. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  11022. }),
  11023. t.bind(this.__saturation_field, "mousedown", c),
  11024. t.bind(this.__field_knob, "mousedown", c),
  11025. t.bind(this.__hue_field, "mousedown", function(e) {
  11026. f(e),
  11027. t.bind(window, "mousemove", f),
  11028. t.bind(window, "mouseup", d)
  11029. }),
  11030. this.__saturation_field.appendChild(m),
  11031. this.__selector.appendChild(this.__field_knob),
  11032. this.__selector.appendChild(this.__saturation_field),
  11033. this.__selector.appendChild(this.__hue_field),
  11034. this.__hue_field.appendChild(this.__hue_knob),
  11035. this.domElement.appendChild(this.__input),
  11036. this.domElement.appendChild(this.__selector),
  11037. this.updateDisplay()
  11038. };
  11039. s.superclass = e,
  11040. r.extend(s.prototype, e.prototype, {
  11041. updateDisplay: function() {
  11042. var e = n(this.getValue());
  11043. if (e !== !1) {
  11044. var t = !1;
  11045. r.each(i.COMPONENTS, function(i) {
  11046. if (!r.isUndefined(e[i]) && !r.isUndefined(this.__color.__state[i]) && e[i] !== this.__color.__state[i])
  11047. return t = !0,
  11048. {}
  11049. }, this),
  11050. t && r.extend(this.__color.__state, e)
  11051. }
  11052. r.extend(this.__temp.__state, this.__color.__state),
  11053. this.__temp.a = 1;
  11054. var a = this.__color.v < .5 || this.__color.s > .5 ? 255 : 0
  11055. , s = 255 - a;
  11056. r.extend(this.__field_knob.style, {
  11057. marginLeft: 100 * this.__color.s - 7 + "px",
  11058. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11059. backgroundColor: this.__temp.toString(),
  11060. border: this.__field_knob_border + "rgb(" + a + "," + a + "," + a + ")"
  11061. }),
  11062. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11063. this.__temp.s = 1,
  11064. this.__temp.v = 1,
  11065. o(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11066. r.extend(this.__input.style, {
  11067. backgroundColor: this.__input.value = this.__color.toString(),
  11068. color: "rgb(" + a + "," + a + "," + a + ")",
  11069. textShadow: this.__input_textShadow + "rgba(" + s + "," + s + "," + s + ",.7)"
  11070. })
  11071. }
  11072. });
  11073. var l = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11074. return s
  11075. }(n.controllers.Controller, n.dom.dom, n.color.Color = function(e, t, i, n) {
  11076. function r(e, t, i) {
  11077. Object.defineProperty(e, t, {
  11078. get: function() {
  11079. return "RGB" === this.__state.space ? this.__state[t] : (a(this, t, i),
  11080. this.__state[t])
  11081. },
  11082. set: function(e) {
  11083. "RGB" !== this.__state.space && (a(this, t, i),
  11084. this.__state.space = "RGB"),
  11085. this.__state[t] = e
  11086. }
  11087. })
  11088. }
  11089. function o(e, t) {
  11090. Object.defineProperty(e, t, {
  11091. get: function() {
  11092. return "HSV" === this.__state.space ? this.__state[t] : (s(this),
  11093. this.__state[t])
  11094. },
  11095. set: function(e) {
  11096. "HSV" !== this.__state.space && (s(this),
  11097. this.__state.space = "HSV"),
  11098. this.__state[t] = e
  11099. }
  11100. })
  11101. }
  11102. function a(e, i, r) {
  11103. if ("HEX" === e.__state.space)
  11104. e.__state[i] = t.component_from_hex(e.__state.hex, r);
  11105. else {
  11106. if ("HSV" !== e.__state.space)
  11107. throw "Corrupted color state";
  11108. n.extend(e.__state, t.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  11109. }
  11110. }
  11111. function s(e) {
  11112. var i = t.rgb_to_hsv(e.r, e.g, e.b);
  11113. n.extend(e.__state, {
  11114. s: i.s,
  11115. v: i.v
  11116. }),
  11117. n.isNaN(i.h) ? n.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = i.h
  11118. }
  11119. var l = function() {
  11120. if (this.__state = e.apply(this, arguments),
  11121. this.__state === !1)
  11122. throw "Failed to interpret color arguments";
  11123. this.__state.a = this.__state.a || 1
  11124. };
  11125. return l.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11126. n.extend(l.prototype, {
  11127. toString: function() {
  11128. return i(this)
  11129. },
  11130. toOriginal: function() {
  11131. return this.__state.conversion.write(this)
  11132. }
  11133. }),
  11134. r(l.prototype, "r", 2),
  11135. r(l.prototype, "g", 1),
  11136. r(l.prototype, "b", 0),
  11137. o(l.prototype, "h"),
  11138. o(l.prototype, "s"),
  11139. o(l.prototype, "v"),
  11140. Object.defineProperty(l.prototype, "a", {
  11141. get: function() {
  11142. return this.__state.a
  11143. },
  11144. set: function(e) {
  11145. this.__state.a = e
  11146. }
  11147. }),
  11148. Object.defineProperty(l.prototype, "hex", {
  11149. get: function() {
  11150. return "HEX" !== !this.__state.space && (this.__state.hex = t.rgb_to_hex(this.r, this.g, this.b)),
  11151. this.__state.hex
  11152. },
  11153. set: function(e) {
  11154. this.__state.space = "HEX",
  11155. this.__state.hex = e
  11156. }
  11157. }),
  11158. l
  11159. }(n.color.interpret, n.color.math = function() {
  11160. var e;
  11161. return {
  11162. hsv_to_rgb: function(e, t, i) {
  11163. var n = Math.floor(e / 60) % 6
  11164. , r = e / 60 - Math.floor(e / 60)
  11165. , o = i * (1 - t)
  11166. , a = i * (1 - r * t)
  11167. , s = i * (1 - (1 - r) * t)
  11168. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11169. return {
  11170. r: 255 * l[0],
  11171. g: 255 * l[1],
  11172. b: 255 * l[2]
  11173. }
  11174. },
  11175. rgb_to_hsv: function(e, t, i) {
  11176. var n, r, o = Math.min(e, t, i), a = Math.max(e, t, i), s = a - o;
  11177. return 0 == a ? {
  11178. h: NaN,
  11179. s: 0,
  11180. v: 0
  11181. } : (r = s / a,
  11182. n = e == a ? (t - i) / s : t == a ? 2 + (i - e) / s : 4 + (e - t) / s,
  11183. n /= 6,
  11184. n < 0 && (n += 1),
  11185. {
  11186. h: 360 * n,
  11187. s: r,
  11188. v: a / 255
  11189. })
  11190. },
  11191. rgb_to_hex: function(e, t, i) {
  11192. var n = this.hex_with_component(0, 2, e);
  11193. return n = this.hex_with_component(n, 1, t),
  11194. n = this.hex_with_component(n, 0, i)
  11195. },
  11196. component_from_hex: function(e, t) {
  11197. return e >> 8 * t & 255
  11198. },
  11199. hex_with_component: function(t, i, n) {
  11200. return n << (e = 8 * i) | t & ~(255 << e)
  11201. }
  11202. }
  11203. }(), n.color.toString, n.utils.common), n.color.interpret, n.utils.common), n.utils.requestAnimationFrame = function() {
  11204. return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11205. window.setTimeout(e, 1e3 / 60)
  11206. }
  11207. }(), n.dom.CenteredDiv = function(e, t) {
  11208. var i = function() {
  11209. this.backgroundElement = document.createElement("div"),
  11210. t.extend(this.backgroundElement.style, {
  11211. backgroundColor: "rgba(0,0,0,0.8)",
  11212. top: 0,
  11213. left: 0,
  11214. display: "none",
  11215. zIndex: "1000",
  11216. opacity: 0,
  11217. WebkitTransition: "opacity 0.2s linear"
  11218. }),
  11219. e.makeFullscreen(this.backgroundElement),
  11220. this.backgroundElement.style.position = "fixed",
  11221. this.domElement = document.createElement("div"),
  11222. t.extend(this.domElement.style, {
  11223. position: "fixed",
  11224. display: "none",
  11225. zIndex: "1001",
  11226. opacity: 0,
  11227. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  11228. }),
  11229. document.body.appendChild(this.backgroundElement),
  11230. document.body.appendChild(this.domElement);
  11231. var i = this;
  11232. e.bind(this.backgroundElement, "click", function() {
  11233. i.hide()
  11234. })
  11235. };
  11236. return i.prototype.show = function() {
  11237. var e = this;
  11238. this.backgroundElement.style.display = "block",
  11239. this.domElement.style.display = "block",
  11240. this.domElement.style.opacity = 0,
  11241. this.domElement.style.webkitTransform = "scale(1.1)",
  11242. this.layout(),
  11243. t.defer(function() {
  11244. e.backgroundElement.style.opacity = 1,
  11245. e.domElement.style.opacity = 1,
  11246. e.domElement.style.webkitTransform = "scale(1)"
  11247. })
  11248. }
  11249. ,
  11250. i.prototype.hide = function() {
  11251. var t = this
  11252. , i = function() {
  11253. t.domElement.style.display = "none",
  11254. t.backgroundElement.style.display = "none",
  11255. e.unbind(t.domElement, "webkitTransitionEnd", i),
  11256. e.unbind(t.domElement, "transitionend", i),
  11257. e.unbind(t.domElement, "oTransitionEnd", i)
  11258. };
  11259. e.bind(this.domElement, "webkitTransitionEnd", i),
  11260. e.bind(this.domElement, "transitionend", i),
  11261. e.bind(this.domElement, "oTransitionEnd", i),
  11262. this.backgroundElement.style.opacity = 0,
  11263. this.domElement.style.opacity = 0,
  11264. this.domElement.style.webkitTransform = "scale(1.1)"
  11265. }
  11266. ,
  11267. i.prototype.layout = function() {
  11268. this.domElement.style.left = $("#player").width() / 2 - e.getWidth(this.domElement) / 2 + "px",
  11269. this.domElement.style.top = $("#player").height() / 2 - e.getHeight(this.domElement) / 2 + "px"
  11270. }
  11271. ,
  11272. i
  11273. }(n.dom.dom, n.utils.common), n.dom.dom, n.utils.common)
  11274. }
  11275. , {}],
  11276. 94: [function(e, t, i) {
  11277. (function(e) {
  11278. "use strict";
  11279. function i(t) {
  11280. function i(e) {
  11281. 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++) {
  11282. var n = _((t[i] * e + 50) / 100);
  11283. n < 1 ? n = 1 : n > 255 && (n = 255),
  11284. T[G[i]] = n
  11285. }
  11286. 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++) {
  11287. var a = _((r[o] * e + 50) / 100);
  11288. a < 1 ? a = 1 : a > 255 && (a = 255),
  11289. x[G[o]] = a
  11290. }
  11291. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11292. for (var h = 0; h < 8; h++)
  11293. S[l] = 1 / (T[G[l]] * s[c] * s[h] * 8),
  11294. M[l] = 1 / (x[G[l]] * s[c] * s[h] * 8),
  11295. l++
  11296. }
  11297. function n(e, t) {
  11298. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11299. for (var a = 1; a <= e[o]; a++)
  11300. r[t[n]] = [],
  11301. r[t[n]][0] = i,
  11302. r[t[n]][1] = o,
  11303. n++,
  11304. i++;
  11305. i *= 2
  11306. }
  11307. return r
  11308. }
  11309. function r() {
  11310. C = n(z, W),
  11311. I = n(X, Z),
  11312. E = n(j, Y),
  11313. b = n(q, K)
  11314. }
  11315. function o() {
  11316. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11317. for (var n = e; n < t; n++)
  11318. P[32767 + n] = i,
  11319. R[32767 + n] = [],
  11320. R[32767 + n][1] = i,
  11321. R[32767 + n][0] = n;
  11322. for (var r = -(t - 1); r <= -e; r++)
  11323. P[32767 + r] = i,
  11324. R[32767 + r] = [],
  11325. R[32767 + r][1] = i,
  11326. R[32767 + r][0] = t - 1 + r;
  11327. e <<= 1,
  11328. t <<= 1
  11329. }
  11330. }
  11331. function a() {
  11332. for (var e = 0; e < 256; e++)
  11333. H[e] = 19595 * e,
  11334. H[e + 256 >> 0] = 38470 * e,
  11335. H[e + 512 >> 0] = 7471 * e + 32768,
  11336. H[e + 768 >> 0] = -11059 * e,
  11337. H[e + 1024 >> 0] = -21709 * e,
  11338. H[e + 1280 >> 0] = 32768 * e + 8421375,
  11339. H[e + 1536 >> 0] = -27439 * e,
  11340. H[e + 1792 >> 0] = -5329 * e
  11341. }
  11342. function s(e) {
  11343. for (var t = e[0], i = e[1] - 1; i >= 0; )
  11344. t & 1 << i && (N |= 1 << B),
  11345. i--,
  11346. B--,
  11347. B < 0 && (255 == N ? (l(255),
  11348. l(0)) : l(N),
  11349. B = 7,
  11350. N = 0)
  11351. }
  11352. function l(e) {
  11353. D.push(e)
  11354. }
  11355. function c(e) {
  11356. l(e >> 8 & 255),
  11357. l(255 & e)
  11358. }
  11359. function h(e, t) {
  11360. var i, n, r, o, a, s, l, c, h, u = 0, d = 8, p = 64;
  11361. for (h = 0; h < d; ++h) {
  11362. i = e[u],
  11363. n = e[u + 1],
  11364. r = e[u + 2],
  11365. o = e[u + 3],
  11366. a = e[u + 4],
  11367. s = e[u + 5],
  11368. l = e[u + 6],
  11369. c = e[u + 7];
  11370. var f = i + c
  11371. , g = i - c
  11372. , m = n + l
  11373. , v = n - l
  11374. , A = r + s
  11375. , y = r - s
  11376. , C = o + a
  11377. , I = o - a
  11378. , E = f + C
  11379. , b = f - C
  11380. , w = m + A
  11381. , _ = m - A;
  11382. e[u] = E + w,
  11383. e[u + 4] = E - w;
  11384. var T = .707106781 * (_ + b);
  11385. e[u + 2] = b + T,
  11386. e[u + 6] = b - T,
  11387. E = I + y,
  11388. w = y + v,
  11389. _ = v + g;
  11390. var x = .382683433 * (E - _)
  11391. , S = .5411961 * E + x
  11392. , M = 1.306562965 * _ + x
  11393. , R = .707106781 * w
  11394. , P = g + R
  11395. , L = g - R;
  11396. e[u + 5] = L + S,
  11397. e[u + 3] = L - S,
  11398. e[u + 1] = P + M,
  11399. e[u + 7] = P - M,
  11400. u += 8
  11401. }
  11402. for (u = 0,
  11403. h = 0; h < d; ++h) {
  11404. i = e[u],
  11405. n = e[u + 8],
  11406. r = e[u + 16],
  11407. o = e[u + 24],
  11408. a = e[u + 32],
  11409. s = e[u + 40],
  11410. l = e[u + 48],
  11411. c = e[u + 56];
  11412. var D = i + c
  11413. , N = i - c
  11414. , B = n + l
  11415. , F = n - l
  11416. , V = r + s
  11417. , U = r - s
  11418. , k = o + a
  11419. , H = o - a
  11420. , G = D + k
  11421. , z = D - k
  11422. , W = B + V
  11423. , j = B - V;
  11424. e[u] = G + W,
  11425. e[u + 32] = G - W;
  11426. var Y = .707106781 * (j + z);
  11427. e[u + 16] = z + Y,
  11428. e[u + 48] = z - Y,
  11429. G = H + U,
  11430. W = U + F,
  11431. j = F + N;
  11432. var X = .382683433 * (G - j)
  11433. , Z = .5411961 * G + X
  11434. , q = 1.306562965 * j + X
  11435. , K = .707106781 * W
  11436. , Q = N + K
  11437. , J = N - K;
  11438. e[u + 40] = J + Z,
  11439. e[u + 24] = J - Z,
  11440. e[u + 8] = Q + q,
  11441. e[u + 56] = Q - q,
  11442. u++
  11443. }
  11444. var $;
  11445. for (h = 0; h < p; ++h)
  11446. $ = e[h] * t[h],
  11447. O[h] = $ > 0 ? $ + .5 | 0 : $ - .5 | 0;
  11448. return O
  11449. }
  11450. function u() {
  11451. c(65504),
  11452. c(16),
  11453. l(74),
  11454. l(70),
  11455. l(73),
  11456. l(70),
  11457. l(0),
  11458. l(1),
  11459. l(1),
  11460. l(0),
  11461. c(1),
  11462. c(1),
  11463. l(0),
  11464. l(0)
  11465. }
  11466. function d(e, t) {
  11467. c(65472),
  11468. c(17),
  11469. l(8),
  11470. c(t),
  11471. c(e),
  11472. l(3),
  11473. l(1),
  11474. l(17),
  11475. l(0),
  11476. l(2),
  11477. l(17),
  11478. l(1),
  11479. l(3),
  11480. l(17),
  11481. l(1)
  11482. }
  11483. function p() {
  11484. c(65499),
  11485. c(132),
  11486. l(0);
  11487. for (var e = 0; e < 64; e++)
  11488. l(T[e]);
  11489. l(1);
  11490. for (var t = 0; t < 64; t++)
  11491. l(x[t])
  11492. }
  11493. function f() {
  11494. c(65476),
  11495. c(418),
  11496. l(0);
  11497. for (var e = 0; e < 16; e++)
  11498. l(z[e + 1]);
  11499. for (var t = 0; t <= 11; t++)
  11500. l(W[t]);
  11501. l(16);
  11502. for (var i = 0; i < 16; i++)
  11503. l(j[i + 1]);
  11504. for (var n = 0; n <= 161; n++)
  11505. l(Y[n]);
  11506. l(1);
  11507. for (var r = 0; r < 16; r++)
  11508. l(X[r + 1]);
  11509. for (var o = 0; o <= 11; o++)
  11510. l(Z[o]);
  11511. l(17);
  11512. for (var a = 0; a < 16; a++)
  11513. l(q[a + 1]);
  11514. for (var s = 0; s <= 161; s++)
  11515. l(K[s])
  11516. }
  11517. function g() {
  11518. c(65498),
  11519. c(12),
  11520. l(3),
  11521. l(1),
  11522. l(0),
  11523. l(2),
  11524. l(17),
  11525. l(3),
  11526. l(17),
  11527. l(0),
  11528. l(63),
  11529. l(0)
  11530. }
  11531. function m(e, t, i, n, r) {
  11532. for (var o, a = r[0], l = r[240], c = 16, u = 63, d = 64, p = h(e, t), f = 0; f < d; ++f)
  11533. L[G[f]] = p[f];
  11534. var g = L[0] - i;
  11535. i = L[0],
  11536. 0 == g ? s(n[0]) : (o = 32767 + g,
  11537. s(n[P[o]]),
  11538. s(R[o]));
  11539. for (var m = 63; m > 0 && 0 == L[m]; m--)
  11540. ;
  11541. if (0 == m)
  11542. return s(a),
  11543. i;
  11544. for (var v, A = 1; A <= m; ) {
  11545. for (var y = A; 0 == L[A] && A <= m; ++A)
  11546. ;
  11547. var C = A - y;
  11548. if (C >= c) {
  11549. v = C >> 4;
  11550. for (var I = 1; I <= v; ++I)
  11551. s(l);
  11552. C &= 15
  11553. }
  11554. o = 32767 + L[A],
  11555. s(r[(C << 4) + P[o]]),
  11556. s(R[o]),
  11557. A++
  11558. }
  11559. return m != u && s(a),
  11560. i
  11561. }
  11562. function v() {
  11563. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11564. k[t] = e(t)
  11565. }
  11566. function A(e) {
  11567. if (e <= 0 && (e = 1),
  11568. e > 100 && (e = 100),
  11569. w != e) {
  11570. var t = 0;
  11571. t = e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e),
  11572. i(t),
  11573. w = e
  11574. }
  11575. }
  11576. function y() {
  11577. var e = (new Date).getTime();
  11578. t || (t = 50),
  11579. v(),
  11580. r(),
  11581. o(),
  11582. a(),
  11583. A(t);
  11584. (new Date).getTime() - e
  11585. }
  11586. var C, I, E, b, w, _ = (Math.round,
  11587. 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];
  11588. this.encode = function(t, i) {
  11589. var n = ((new Date).getTime(),
  11590. i.quality);
  11591. n && A(n),
  11592. D = new Array,
  11593. N = 0,
  11594. B = 7,
  11595. c(65496),
  11596. u(),
  11597. p(),
  11598. d(t.width, t.height),
  11599. f(),
  11600. g();
  11601. var r = 0
  11602. , o = 0
  11603. , a = 0;
  11604. N = 0,
  11605. B = 7,
  11606. this.encode.displayName = "_encode_";
  11607. 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; ) {
  11608. for (l = 0; l < G; ) {
  11609. for (w = G * z + l,
  11610. _ = w,
  11611. T = -1,
  11612. x = 0,
  11613. R = 0; R < 64; R++)
  11614. x = (k ? 63 - R : R) >> 3,
  11615. T = 4 * (7 & R),
  11616. _ = w + x * G + T,
  11617. z + x >= L && (_ -= G * (z + 1 + x - L)),
  11618. l + T >= G && (_ -= l + T - G + 4),
  11619. h = P[_++],
  11620. v = P[_++],
  11621. y = P[_++],
  11622. F[R] = (H[h] + H[v + 256 >> 0] + H[y + 512 >> 0] >> 16) - 128,
  11623. V[R] = (H[h + 768 >> 0] + H[v + 1024 >> 0] + H[y + 1280 >> 0] >> 16) - 128,
  11624. U[R] = (H[h + 1280 >> 0] + H[v + 1536 >> 0] + H[y + 1792 >> 0] >> 16) - 128;
  11625. r = m(F, S, r, C, E),
  11626. o = m(V, M, o, I, b),
  11627. a = m(U, M, a, I, b),
  11628. l += 32
  11629. }
  11630. z += W
  11631. }
  11632. if (B >= 0) {
  11633. var j = [];
  11634. j[1] = B + 1,
  11635. j[0] = (1 << B + 1) - 1,
  11636. s(j)
  11637. }
  11638. return c(65497),
  11639. new e(D)
  11640. }
  11641. ,
  11642. y()
  11643. }
  11644. function n(e, t) {
  11645. t = t || {},
  11646. t.quality = t.quality || 50;
  11647. var n = t.quality
  11648. , r = new i(n)
  11649. , o = r.encode(e, t);
  11650. return {
  11651. data: o,
  11652. width: e.width,
  11653. height: e.height
  11654. }
  11655. }
  11656. t.exports.encode = n
  11657. }
  11658. ).call(this, e("buffer").Buffer)
  11659. }
  11660. , {
  11661. buffer: 198
  11662. }],
  11663. 95: [function(e, t, i) {
  11664. "use strict";
  11665. !function() {
  11666. if ("performance"in window == !1 && (window.performance = {}),
  11667. Date.now = Date.now || function() {
  11668. return (new Date).getTime()
  11669. }
  11670. ,
  11671. "now"in window.performance == !1) {
  11672. var e = Date.now();
  11673. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11674. window.performance.now = function() {
  11675. return Date.now() - e
  11676. }
  11677. }
  11678. }()
  11679. }
  11680. , {}],
  11681. 96: [function(e, t, i) {
  11682. "use strict";
  11683. var n = e("three");
  11684. n.EffectComposer = function(e, t) {
  11685. if (this.renderer = e,
  11686. void 0 === t) {
  11687. var i = {
  11688. minFilter: n.LinearFilter,
  11689. magFilter: n.LinearFilter,
  11690. format: n.RGBAFormat,
  11691. stencilBuffer: !1
  11692. }
  11693. , r = e.getSize();
  11694. t = new n.WebGLRenderTarget(r.width,r.height,i)
  11695. }
  11696. this.renderTarget1 = t,
  11697. this.renderTarget2 = t.clone(),
  11698. this.writeBuffer = this.renderTarget1,
  11699. this.readBuffer = this.renderTarget2,
  11700. this.passes = [],
  11701. void 0 === n.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11702. this.copyPass = new n.ShaderPass(n.CopyShader)
  11703. }
  11704. ,
  11705. n.EffectComposer.prototype = {
  11706. swapBuffers: function() {
  11707. var e = this.readBuffer;
  11708. this.readBuffer = this.writeBuffer,
  11709. this.writeBuffer = e
  11710. },
  11711. addPass: function(e) {
  11712. this.passes.push(e)
  11713. },
  11714. insertPass: function(e, t) {
  11715. this.passes.splice(t, 0, e)
  11716. },
  11717. render: function(e) {
  11718. this.writeBuffer = this.renderTarget1,
  11719. this.readBuffer = this.renderTarget2;
  11720. var t, i, r = !1, o = this.passes.length;
  11721. for (i = 0; i < o; i++)
  11722. if (t = this.passes[i],
  11723. t.enabled) {
  11724. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, r),
  11725. t.needsSwap) {
  11726. if (r) {
  11727. var a = this.renderer.context;
  11728. a.stencilFunc(a.NOTEQUAL, 1, 4294967295),
  11729. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11730. a.stencilFunc(a.EQUAL, 1, 4294967295)
  11731. }
  11732. this.swapBuffers()
  11733. }
  11734. t instanceof n.MaskPass ? r = !0 : t instanceof n.ClearMaskPass && (r = !1)
  11735. }
  11736. },
  11737. reset: function(e) {
  11738. if (void 0 === e) {
  11739. var t = this.renderer.getSize();
  11740. e = this.renderTarget1.clone(),
  11741. e.setSize(t.width, t.height)
  11742. }
  11743. this.renderTarget1.dispose(),
  11744. this.renderTarget2.dispose(),
  11745. this.renderTarget1 = e,
  11746. this.renderTarget2 = e.clone(),
  11747. this.writeBuffer = this.renderTarget1,
  11748. this.readBuffer = this.renderTarget2
  11749. },
  11750. setSize: function(e, t) {
  11751. this.renderTarget1.setSize(e, t),
  11752. this.renderTarget2.setSize(e, t)
  11753. }
  11754. }
  11755. }
  11756. , {
  11757. three: 217
  11758. }],
  11759. 97: [function(e, t, i) {
  11760. "use strict";
  11761. var n = e("three");
  11762. n.MaskPass = function(e, t) {
  11763. this.scene = e,
  11764. this.camera = t,
  11765. this.enabled = !0,
  11766. this.clear = !0,
  11767. this.needsSwap = !1,
  11768. this.inverse = !1
  11769. }
  11770. ,
  11771. n.MaskPass.prototype = {
  11772. render: function(e, t, i, n) {
  11773. var r = e.context;
  11774. r.colorMask(!1, !1, !1, !1),
  11775. r.depthMask(!1);
  11776. var o, a;
  11777. this.inverse ? (o = 0,
  11778. a = 1) : (o = 1,
  11779. a = 0),
  11780. r.enable(r.STENCIL_TEST),
  11781. r.stencilOp(r.REPLACE, r.REPLACE, r.REPLACE),
  11782. r.stencilFunc(r.ALWAYS, o, 4294967295),
  11783. r.clearStencil(a),
  11784. e.render(this.scene, this.camera, i, this.clear),
  11785. e.render(this.scene, this.camera, t, this.clear),
  11786. r.colorMask(!0, !0, !0, !0),
  11787. r.depthMask(!0),
  11788. r.stencilFunc(r.EQUAL, 1, 4294967295),
  11789. r.stencilOp(r.KEEP, r.KEEP, r.KEEP)
  11790. }
  11791. },
  11792. n.ClearMaskPass = function() {
  11793. this.enabled = !0
  11794. }
  11795. ,
  11796. n.ClearMaskPass.prototype = {
  11797. render: function(e, t, i, n) {
  11798. var r = e.context;
  11799. r.disable(r.STENCIL_TEST)
  11800. }
  11801. }
  11802. }
  11803. , {
  11804. three: 217
  11805. }],
  11806. 98: [function(e, t, i) {
  11807. "use strict";
  11808. var n = e("three");
  11809. n.RenderPass = function(e, t, i, r, o) {
  11810. this.scene = e,
  11811. this.camera = t,
  11812. this.overrideMaterial = i,
  11813. this.clearColor = r,
  11814. this.clearAlpha = void 0 !== o ? o : 1,
  11815. this.oldClearColor = new n.Color,
  11816. this.oldClearAlpha = 1,
  11817. this.enabled = !0,
  11818. this.clear = !0,
  11819. this.needsSwap = !1
  11820. }
  11821. ,
  11822. n.RenderPass.prototype = {
  11823. render: function(e, t, i, n) {
  11824. this.scene.overrideMaterial = this.overrideMaterial,
  11825. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11826. this.oldClearAlpha = e.getClearAlpha(),
  11827. e.setClearColor(this.clearColor, this.clearAlpha)),
  11828. e.render(this.scene, this.camera, i, this.clear),
  11829. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11830. this.scene.overrideMaterial = null
  11831. }
  11832. }
  11833. }
  11834. , {
  11835. three: 217
  11836. }],
  11837. 99: [function(e, t, i) {
  11838. "use strict";
  11839. var n = e("three");
  11840. n.ShaderPass = function(e, t) {
  11841. this.textureID = void 0 !== t ? t : "tDiffuse",
  11842. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11843. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11844. this.material = new n.ShaderMaterial({
  11845. defines: e.defines || {},
  11846. uniforms: this.uniforms,
  11847. vertexShader: e.vertexShader,
  11848. fragmentShader: e.fragmentShader
  11849. })),
  11850. this.renderToScreen = !1,
  11851. this.enabled = !0,
  11852. this.needsSwap = !0,
  11853. this.clear = !1,
  11854. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11855. this.scene = new n.Scene,
  11856. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11857. this.scene.add(this.quad)
  11858. }
  11859. ,
  11860. n.ShaderPass.prototype = {
  11861. render: function(e, t, i, n) {
  11862. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11863. this.quad.material = this.material,
  11864. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11865. }
  11866. }
  11867. }
  11868. , {
  11869. three: 217
  11870. }],
  11871. 100: [function(e, t, i) {
  11872. "use strict";
  11873. var n = e("three");
  11874. n.CopyShader = {
  11875. uniforms: {
  11876. tDiffuse: {
  11877. type: "t",
  11878. value: null
  11879. },
  11880. opacity: {
  11881. type: "f",
  11882. value: 1
  11883. }
  11884. },
  11885. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11886. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11887. }
  11888. }
  11889. , {
  11890. three: 217
  11891. }],
  11892. 101: [function(e, t, i) {
  11893. "use strict";
  11894. var n = e("three");
  11895. n.HorizontalBlurShader = {
  11896. uniforms: {
  11897. tDiffuse: {
  11898. type: "t",
  11899. value: null
  11900. },
  11901. h: {
  11902. type: "f",
  11903. value: 1 / 512
  11904. }
  11905. },
  11906. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11907. 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")
  11908. }
  11909. }
  11910. , {
  11911. three: 217
  11912. }],
  11913. 102: [function(e, t, i) {
  11914. "use strict";
  11915. var n = e("three");
  11916. n.VerticalBlurShader = {
  11917. uniforms: {
  11918. tDiffuse: {
  11919. type: "t",
  11920. value: null
  11921. },
  11922. v: {
  11923. type: "f",
  11924. value: 1 / 512
  11925. }
  11926. },
  11927. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11928. 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")
  11929. }
  11930. }
  11931. , {
  11932. three: 217
  11933. }],
  11934. 103: [function(e, t, i) {
  11935. "use strict";
  11936. var n = e("three");
  11937. !function() {
  11938. if ("performance"in window == 0 && (window.performance = {}),
  11939. "now"in window.performance == 0) {
  11940. var e = Date.now();
  11941. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11942. window.performance.now = function() {
  11943. return Date.now() - e
  11944. }
  11945. }
  11946. }(),
  11947. n.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  11948. var t, i = this.extensions, r = this.context;
  11949. if (e === n.RepeatWrapping)
  11950. return r.REPEAT;
  11951. if (e === n.ClampToEdgeWrapping)
  11952. return r.CLAMP_TO_EDGE;
  11953. if (e === n.MirroredRepeatWrapping)
  11954. return r.MIRRORED_REPEAT;
  11955. if (e === n.NearestFilter)
  11956. return r.NEAREST;
  11957. if (e === n.NearestMipMapNearestFilter)
  11958. return r.NEAREST_MIPMAP_NEAREST;
  11959. if (e === n.NearestMipMapLinearFilter)
  11960. return r.NEAREST_MIPMAP_LINEAR;
  11961. if (e === n.LinearFilter)
  11962. return r.LINEAR;
  11963. if (e === n.LinearMipMapNearestFilter)
  11964. return r.LINEAR_MIPMAP_NEAREST;
  11965. if (e === n.LinearMipMapLinearFilter)
  11966. return r.LINEAR_MIPMAP_LINEAR;
  11967. if (e === n.UnsignedByteType)
  11968. return r.UNSIGNED_BYTE;
  11969. if (e === n.UnsignedShort4444Type)
  11970. return r.UNSIGNED_SHORT_4_4_4_4;
  11971. if (e === n.UnsignedShort5551Type)
  11972. return r.UNSIGNED_SHORT_5_5_5_1;
  11973. if (e === n.UnsignedShort565Type)
  11974. return r.UNSIGNED_SHORT_5_6_5;
  11975. if (e === n.ByteType)
  11976. return r.BYTE;
  11977. if (e === n.ShortType)
  11978. return r.SHORT;
  11979. if (e === n.UnsignedShortType)
  11980. return r.UNSIGNED_SHORT;
  11981. if (e === n.IntType)
  11982. return r.INT;
  11983. if (e === n.UnsignedIntType)
  11984. return r.UNSIGNED_INT;
  11985. if (e === n.FloatType)
  11986. return r.FLOAT;
  11987. if (t = i.get("OES_texture_half_float"),
  11988. null !== t && e === n.HalfFloatType)
  11989. return t.HALF_FLOAT_OES;
  11990. if (e === n.AlphaFormat)
  11991. return r.ALPHA;
  11992. if (e === n.RGBFormat)
  11993. return r.RGB;
  11994. if (e === n.RGBAFormat)
  11995. return r.RGBA;
  11996. if (e === n.LuminanceFormat)
  11997. return r.LUMINANCE;
  11998. if (e === n.LuminanceAlphaFormat)
  11999. return r.LUMINANCE_ALPHA;
  12000. if (e === n.AddEquation)
  12001. return r.FUNC_ADD;
  12002. if (e === n.SubtractEquation)
  12003. return r.FUNC_SUBTRACT;
  12004. if (e === n.ReverseSubtractEquation)
  12005. return r.FUNC_REVERSE_SUBTRACT;
  12006. if (e === n.ZeroFactor)
  12007. return r.ZERO;
  12008. if (e === n.OneFactor)
  12009. return r.ONE;
  12010. if (e === n.SrcColorFactor)
  12011. return r.SRC_COLOR;
  12012. if (e === n.OneMinusSrcColorFactor)
  12013. return r.ONE_MINUS_SRC_COLOR;
  12014. if (e === n.SrcAlphaFactor)
  12015. return r.SRC_ALPHA;
  12016. if (e === n.OneMinusSrcAlphaFactor)
  12017. return r.ONE_MINUS_SRC_ALPHA;
  12018. if (e === n.DstAlphaFactor)
  12019. return r.DST_ALPHA;
  12020. if (e === n.OneMinusDstAlphaFactor)
  12021. return r.ONE_MINUS_DST_ALPHA;
  12022. if (e === n.DstColorFactor)
  12023. return r.DST_COLOR;
  12024. if (e === n.OneMinusDstColorFactor)
  12025. return r.ONE_MINUS_DST_COLOR;
  12026. if (e === n.SrcAlphaSaturateFactor)
  12027. return r.SRC_ALPHA_SATURATE;
  12028. if (t = i.get("WEBGL_compressed_texture_s3tc"),
  12029. null !== t) {
  12030. if (e === n.RGB_S3TC_DXT1_Format)
  12031. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  12032. if (e === n.RGBA_S3TC_DXT1_Format)
  12033. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  12034. if (e === n.RGBA_S3TC_DXT3_Format)
  12035. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  12036. if (e === n.RGBA_S3TC_DXT5_Format)
  12037. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  12038. }
  12039. if (t = i.get("WEBGL_compressed_texture_pvrtc"),
  12040. null !== t) {
  12041. if (e === n.RGB_PVRTC_4BPPV1_Format)
  12042. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  12043. if (e === n.RGB_PVRTC_2BPPV1_Format)
  12044. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  12045. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  12046. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  12047. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  12048. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  12049. }
  12050. if (t = i.get("WEBGL_compressed_texture_etc1"),
  12051. null !== t && e === n.RGB_ETC1_Format)
  12052. return t.COMPRESSED_RGB_ETC1_WEBGL;
  12053. if (t = i.get("EXT_blend_minmax"),
  12054. null !== t) {
  12055. if (e === n.MinEquation)
  12056. return t.MIN_EXT;
  12057. if (e === n.MaxEquation)
  12058. return t.MAX_EXT
  12059. }
  12060. return 0
  12061. }
  12062. ,
  12063. n.WebGLState = function(e, t, i) {
  12064. var r = this
  12065. , o = new n.Vector4
  12066. , a = e.getParameter(e.MAX_VERTEX_ATTRIBS)
  12067. , s = new Uint8Array(a)
  12068. , l = new Uint8Array(a)
  12069. , c = new Uint8Array(a)
  12070. , h = {}
  12071. , u = null
  12072. , d = null
  12073. , p = null
  12074. , f = null
  12075. , g = null
  12076. , m = null
  12077. , v = null
  12078. , A = null
  12079. , y = !1
  12080. , C = null
  12081. , I = null
  12082. , E = null
  12083. , b = null
  12084. , w = null
  12085. , _ = null
  12086. , T = null
  12087. , x = null
  12088. , S = null
  12089. , M = null
  12090. , R = null
  12091. , P = null
  12092. , O = null
  12093. , L = null
  12094. , D = null
  12095. , N = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  12096. , B = void 0
  12097. , F = {}
  12098. , V = new n.Vector4
  12099. , U = null
  12100. , k = null
  12101. , H = new n.Vector4
  12102. , G = new n.Vector4;
  12103. this.init = function() {
  12104. this.clearColor(0, 0, 0, 1),
  12105. this.clearDepth(1),
  12106. this.clearStencil(0),
  12107. this.enable(e.DEPTH_TEST),
  12108. e.depthFunc(e.LEQUAL),
  12109. e.frontFace(e.CCW),
  12110. e.cullFace(e.BACK),
  12111. this.enable(e.CULL_FACE),
  12112. this.enable(e.BLEND),
  12113. e.blendEquation(e.FUNC_ADD),
  12114. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  12115. }
  12116. ,
  12117. this.initAttributes = function() {
  12118. for (var e = 0, t = s.length; e < t; e++)
  12119. s[e] = 0
  12120. }
  12121. ,
  12122. this.enableAttribute = function(i) {
  12123. if (s[i] = 1,
  12124. 0 === l[i] && (e.enableVertexAttribArray(i),
  12125. l[i] = 1),
  12126. 0 !== c[i]) {
  12127. var n = t.get("ANGLE_instanced_arrays");
  12128. n.vertexAttribDivisorANGLE(i, 0),
  12129. c[i] = 0
  12130. }
  12131. }
  12132. ,
  12133. this.enableAttributeAndDivisor = function(t, i, n) {
  12134. s[t] = 1,
  12135. 0 === l[t] && (e.enableVertexAttribArray(t),
  12136. l[t] = 1),
  12137. c[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  12138. c[t] = i)
  12139. }
  12140. ,
  12141. this.disableUnusedAttributes = function() {
  12142. for (var t = 0, i = l.length; t < i; t++)
  12143. l[t] !== s[t] && (e.disableVertexAttribArray(t),
  12144. l[t] = 0)
  12145. }
  12146. ,
  12147. this.enable = function(t) {
  12148. h[t] !== !0 && (e.enable(t),
  12149. h[t] = !0)
  12150. }
  12151. ,
  12152. this.disable = function(t) {
  12153. h[t] !== !1 && (e.disable(t),
  12154. h[t] = !1)
  12155. }
  12156. ,
  12157. this.getCompressedTextureFormats = function() {
  12158. if (null === u && (u = [],
  12159. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  12160. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  12161. u.push(i[n]);
  12162. return u
  12163. }
  12164. ,
  12165. this.setBlending = function(t, r, o, a, s, l, c, h) {
  12166. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  12167. t === d && h === y || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12168. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  12169. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12170. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12171. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12172. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12173. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12174. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12175. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  12176. d = t,
  12177. y = h),
  12178. t === n.CustomBlending ? (s = s || r,
  12179. l = l || o,
  12180. c = c || a,
  12181. r === p && s === m || (e.blendEquationSeparate(i(r), i(s)),
  12182. p = r,
  12183. m = s),
  12184. o === f && a === g && l === v && c === A || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  12185. f = o,
  12186. g = a,
  12187. v = l,
  12188. A = c)) : (p = null,
  12189. f = null,
  12190. g = null,
  12191. m = null,
  12192. v = null,
  12193. A = null)
  12194. }
  12195. ,
  12196. this.setDepthFunc = function(t) {
  12197. if (C !== t) {
  12198. if (t)
  12199. switch (t) {
  12200. case n.NeverDepth:
  12201. e.depthFunc(e.NEVER);
  12202. break;
  12203. case n.AlwaysDepth:
  12204. e.depthFunc(e.ALWAYS);
  12205. break;
  12206. case n.LessDepth:
  12207. e.depthFunc(e.LESS);
  12208. break;
  12209. case n.LessEqualDepth:
  12210. e.depthFunc(e.LEQUAL);
  12211. break;
  12212. case n.EqualDepth:
  12213. e.depthFunc(e.EQUAL);
  12214. break;
  12215. case n.GreaterEqualDepth:
  12216. e.depthFunc(e.GEQUAL);
  12217. break;
  12218. case n.GreaterDepth:
  12219. e.depthFunc(e.GREATER);
  12220. break;
  12221. case n.NotEqualDepth:
  12222. e.depthFunc(e.NOTEQUAL);
  12223. break;
  12224. default:
  12225. e.depthFunc(e.LEQUAL)
  12226. }
  12227. else
  12228. e.depthFunc(e.LEQUAL);
  12229. C = t
  12230. }
  12231. }
  12232. ,
  12233. this.setDepthTest = function(t) {
  12234. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  12235. }
  12236. ,
  12237. this.setDepthWrite = function(t) {
  12238. I !== t && (e.depthMask(t),
  12239. I = t)
  12240. }
  12241. ,
  12242. this.setColorWrite = function(t) {
  12243. E !== t && (e.colorMask(t, t, t, t),
  12244. E = t)
  12245. }
  12246. ,
  12247. this.setStencilFunc = function(t, i, n) {
  12248. w === t && _ === i && T === n || (e.stencilFunc(t, i, n),
  12249. w = t,
  12250. _ = i,
  12251. T = n)
  12252. }
  12253. ,
  12254. this.setStencilOp = function(t, i, n) {
  12255. x === t && S === i && M === n || (e.stencilOp(t, i, n),
  12256. x = t,
  12257. S = i,
  12258. M = n)
  12259. }
  12260. ,
  12261. this.setStencilTest = function(t) {
  12262. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  12263. }
  12264. ,
  12265. this.setStencilWrite = function(t) {
  12266. b !== t && (e.stencilMask(t),
  12267. b = t)
  12268. }
  12269. ,
  12270. this.setFlipSided = function(t) {
  12271. R !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  12272. R = t)
  12273. }
  12274. ,
  12275. this.setLineWidth = function(t) {
  12276. t !== P && (e.lineWidth(t),
  12277. P = t)
  12278. }
  12279. ,
  12280. this.setPolygonOffset = function(t, i, n) {
  12281. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  12282. !t || O === i && L === n || (e.polygonOffset(i, n),
  12283. O = i,
  12284. L = n)
  12285. }
  12286. ,
  12287. this.getScissorTest = function() {
  12288. return D
  12289. }
  12290. ,
  12291. this.setScissorTest = function(t) {
  12292. D = t,
  12293. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  12294. }
  12295. ,
  12296. this.activeTexture = function(t) {
  12297. void 0 === t && (t = e.TEXTURE0 + N - 1),
  12298. B !== t && (e.activeTexture(t),
  12299. B = t)
  12300. }
  12301. ,
  12302. this.bindTexture = function(t, i) {
  12303. void 0 === B && r.activeTexture();
  12304. var n = F[B];
  12305. void 0 === n && (n = {
  12306. type: void 0,
  12307. texture: void 0
  12308. },
  12309. F[B] = n),
  12310. n.type === t && n.texture === i || (e.bindTexture(t, i),
  12311. n.type = t,
  12312. n.texture = i)
  12313. }
  12314. ,
  12315. this.compressedTexImage2D = function() {
  12316. try {
  12317. e.compressedTexImage2D.apply(e, arguments)
  12318. } catch (e) {
  12319. console.error(e)
  12320. }
  12321. }
  12322. ,
  12323. this.texImage2D = function() {
  12324. try {
  12325. e.texImage2D.apply(e, arguments)
  12326. } catch (e) {
  12327. console.error(e)
  12328. }
  12329. }
  12330. ,
  12331. this.clearColor = function(t, i, n, r) {
  12332. o.set(t, i, n, r),
  12333. V.equals(o) === !1 && (e.clearColor(t, i, n, r),
  12334. V.copy(o))
  12335. }
  12336. ,
  12337. this.clearDepth = function(t) {
  12338. U !== t && (e.clearDepth(t),
  12339. U = t)
  12340. }
  12341. ,
  12342. this.clearStencil = function(t) {
  12343. k !== t && (e.clearStencil(t),
  12344. k = t)
  12345. }
  12346. ,
  12347. this.scissor = function(t) {
  12348. H.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  12349. H.copy(t))
  12350. }
  12351. ,
  12352. this.viewport = function(t) {
  12353. G.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  12354. G.copy(t))
  12355. }
  12356. ,
  12357. this.reset = function() {
  12358. for (var t = 0; t < l.length; t++)
  12359. 1 === l[t] && (e.disableVertexAttribArray(t),
  12360. l[t] = 0);
  12361. h = {},
  12362. u = null,
  12363. B = void 0,
  12364. F = {},
  12365. d = null,
  12366. E = null,
  12367. I = null,
  12368. b = null,
  12369. R = null
  12370. }
  12371. }
  12372. }
  12373. , {
  12374. three: 217
  12375. }],
  12376. 104: [function(e, t, i) {
  12377. (function(i, n) {
  12378. "use strict";
  12379. function r(e) {
  12380. this.urls = e;
  12381. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12382. this.builder = a.loadProto(t),
  12383. this.decoder = this.builder.build("binary_mesh")
  12384. }
  12385. var o = e("three")
  12386. , a = e("protobufjs")
  12387. , s = e("../util/logger")
  12388. , l = (e("../util/common"),
  12389. e("../util/ajax"))
  12390. , c = e("../objects/Chunk")
  12391. , h = new s(n);
  12392. r.prototype = {
  12393. constructor: r,
  12394. load: function(e, t, i, n) {
  12395. return h.time("download"),
  12396. l.get(e, {
  12397. responseType: "arraybuffer"
  12398. }).done(function(r) {
  12399. h.timeEnd("download"),
  12400. this.parse(r, e, t, i, n)
  12401. }
  12402. .bind(this)).fail(n)
  12403. },
  12404. parse: function(e, t, i, n, r) {
  12405. var o = this.readProtobuf(e);
  12406. if (!o)
  12407. return r();
  12408. try {
  12409. h.time("convert to webgl"),
  12410. this.convertProtobufToSceneObject(o, t, i, n, r),
  12411. h.timeEnd("convert to webgl")
  12412. } catch (e) {
  12413. return h.error("failed parsing .dam"),
  12414. h.error(e.message),
  12415. r()
  12416. }
  12417. },
  12418. readProtobuf: function(e) {
  12419. var t;
  12420. try {
  12421. h.time("parse proto"),
  12422. t = this.decoder.decode(e),
  12423. h.timeEnd("parse proto")
  12424. } catch (e) {
  12425. return h.error("failed parsing proto for .dam"),
  12426. h.error(e.message),
  12427. null
  12428. }
  12429. return t
  12430. },
  12431. convertProtobufToSceneObject: function(e, t, i, n, r) {
  12432. function a(e) {
  12433. var i = new o.BufferGeometry;
  12434. return i.addAttribute("position", new o.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12435. e.vertices.uv.length > 0 && i.addAttribute("uv", new o.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12436. i.setIndex(new o.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12437. i.applyMatrix(s),
  12438. i.computeBoundingBox(),
  12439. new c({
  12440. geometry: i,
  12441. textureName: e.material_name,
  12442. name: e.chunk_name,
  12443. meshUrl: t
  12444. })
  12445. }
  12446. if (0 === e.chunk.length)
  12447. return h.warn("No chunks in damfile..."),
  12448. i([]);
  12449. var s = new o.Matrix4;
  12450. s.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12451. var l = e.chunk.map(a);
  12452. return l ? i(l) : (h.error(".dam protobuf came out with no chunks..."),
  12453. r())
  12454. }
  12455. },
  12456. t.exports = r
  12457. }
  12458. ).call(this, e("buffer").Buffer, "/js/loaders/DamLoader.js")
  12459. }
  12460. , {
  12461. "../objects/Chunk": 144,
  12462. "../util/ajax": 181,
  12463. "../util/common": 185,
  12464. "../util/logger": 189,
  12465. buffer: 198,
  12466. protobufjs: 214,
  12467. three: 217
  12468. }],
  12469. 105: [function(e, t, i) {
  12470. (function(i) {
  12471. "use strict";
  12472. var n = (e("three"),
  12473. e("../settings"),
  12474. e("../util/browser"),
  12475. e("./DamLoader"))
  12476. , r = e("../util/logger")
  12477. , o = (e("../ab"),
  12478. new r(i));
  12479. t.exports = {
  12480. getLoaders: function() {
  12481. return [["_50k", ".dam", n], ["", ".dam", n]]
  12482. },
  12483. load: function(e, t, i, n, r, a) {
  12484. var s = this.getLoaders();
  12485. a = a || 0;
  12486. var l = s[a];
  12487. if (!l)
  12488. return void (r && r("No suitable model file found..."));
  12489. var c = l[0]
  12490. , h = l[1]
  12491. , u = new l[2](t)
  12492. , d = t.get(e + c + h);
  12493. d ? (o.debug("Trying " + c + h),
  12494. u.load(d, i, n, function() {
  12495. this.load(e, t, i, n, r, ++a)
  12496. }
  12497. .bind(this))) : (o.debug("Skipping " + h + ", not available"),
  12498. this.load(e, t, i, n, r, ++a))
  12499. }
  12500. }
  12501. }
  12502. ).call(this, "/js/loaders/ModelLoader.js")
  12503. }
  12504. , {
  12505. "../ab": 3,
  12506. "../settings": 166,
  12507. "../util/browser": 182,
  12508. "../util/logger": 189,
  12509. "./DamLoader": 104,
  12510. three: 217
  12511. }],
  12512. 106: [function(e, t, i) {
  12513. (function(i) {
  12514. "use strict";
  12515. var n = e("../util/common")
  12516. , r = e("../util/texture")
  12517. , o = e("../util/browser")
  12518. , a = e("../util/logger")
  12519. , s = e("../settings")
  12520. , l = new a(i);
  12521. t.exports = {
  12522. load: function(e, t) {
  12523. function i(e, i) {
  12524. e || (t.push(i),
  12525. p++,
  12526. d.notify(p, a),
  12527. p === a && d.resolve())
  12528. }
  12529. if (!e.chunks[0] || !e.chunks[0].meshUrl)
  12530. return $.when();
  12531. var a = n.countUnique(e.chunks.map(function(e) {
  12532. return e.textureName
  12533. }))
  12534. , c = e.chunks[0].meshUrl.indexOf("_50k") !== -1 ? "_50k" : ""
  12535. , h = "_50k" === c ? "high" : "low";
  12536. s.minimalMemoryMode && "high" === h && (o.detectSamsungS6() ? (l.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12537. h = "low") : a > s.maxMobileTextures && (l.warn("Model probably too large for mobile, turning down quality."),
  12538. h = "low"));
  12539. var u = e.data.job.uuid + c + "_texture_jpg_" + h + "/"
  12540. , d = $.Deferred()
  12541. , p = 0;
  12542. return e.chunks.forEach(function(t) {
  12543. if (!t.material.map && t.textureName) {
  12544. var n = e.urls.get(u + t.textureName);
  12545. t.setTextureMap(r.load(n, i.bind(this, r.isLoaded(n))))
  12546. }
  12547. }),
  12548. d.promise()
  12549. }
  12550. }
  12551. }
  12552. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12553. }
  12554. , {
  12555. "../settings": 166,
  12556. "../util/browser": 182,
  12557. "../util/common": 185,
  12558. "../util/logger": 189,
  12559. "../util/texture": 194
  12560. }],
  12561. 107: [function(e, t, i) {
  12562. (function(i, n) {
  12563. "use strict";
  12564. function r(e) {
  12565. this.model = e,
  12566. this.modelDataPath = this.model.urls.get("vision.modeldata"),
  12567. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12568. var t = i("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12569. , n = o.loadProto(t);
  12570. this.decoder = n.build("VisionModeldata")
  12571. }
  12572. var o = e("protobufjs")
  12573. , a = e("../util/ajax")
  12574. , s = (e("../util/common"),
  12575. e("../util/math"))
  12576. , l = e("../util/logger")
  12577. , c = new l(n);
  12578. r.prototype.load = function() {
  12579. return this.modelDataPath ? (c.info("Using vision.modeldata"),
  12580. this.loadVisionModelData()) : this.sweepLocationsPath ? (c.warn("Using sweep_locations.csv"),
  12581. this.loadSweepLocationsCSV()) : (c.warn("No sweep file found"),
  12582. $.when([]))
  12583. }
  12584. ,
  12585. r.prototype.loadVisionModelData = function() {
  12586. return a.get(this.modelDataPath, {
  12587. responseType: "arraybuffer"
  12588. }).then(function(e) {
  12589. var t;
  12590. try {
  12591. t = this.decoder.decode(e)
  12592. } catch (e) {
  12593. return c.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12594. this.loadSweepLocationsCSV()
  12595. }
  12596. var i = t.sweepLocations.map(function(e) {
  12597. return {
  12598. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12599. position: {
  12600. x: e.pose.translation.x,
  12601. y: e.pose.translation.y,
  12602. z: e.pose.translation.z
  12603. },
  12604. quaternion: {
  12605. x: e.pose.rotation.x,
  12606. y: e.pose.rotation.y,
  12607. z: e.pose.rotation.z,
  12608. w: e.pose.rotation.w
  12609. },
  12610. puck: {
  12611. x: e.puck.x,
  12612. y: e.puck.y,
  12613. z: e.puck.z
  12614. },
  12615. floor: e.group,
  12616. neighbours: e.visibles,
  12617. alignmentType: e.alignment_type
  12618. }
  12619. }).map(function(e) {
  12620. return e.position = s.convertVisionVector(e.position),
  12621. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  12622. e.puck = s.convertVisionVector(e.puck),
  12623. e
  12624. });
  12625. return i.forEach(function(e) {
  12626. e.neighbours = e.neighbours.map(function(e) {
  12627. return i[e].uuid
  12628. })
  12629. }),
  12630. i
  12631. }
  12632. .bind(this), function() {
  12633. return c.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12634. this.loadSweepLocationsCSV()
  12635. }
  12636. .bind(this))
  12637. }
  12638. ,
  12639. r.prototype.loadSweepLocationsCSV = function() {
  12640. return a.get(this.sweepLocationsPath).then(function(e) {
  12641. var t = e.split("\n").map(function(e) {
  12642. return e.split(", ")
  12643. }).filter(function(e) {
  12644. return e.length > 1
  12645. }).map(function(e) {
  12646. return {
  12647. uuid: e[0],
  12648. position: {
  12649. x: parseFloat(e[1]),
  12650. y: parseFloat(e[2]),
  12651. z: parseFloat(e[3])
  12652. },
  12653. quaternion: {
  12654. x: parseFloat(e[4]),
  12655. y: parseFloat(e[5]),
  12656. z: parseFloat(e[6]),
  12657. w: parseFloat(e[7])
  12658. }
  12659. }
  12660. }).map(function(e) {
  12661. return e.position = s.convertVisionVector(e.position),
  12662. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  12663. e
  12664. });
  12665. return t
  12666. }).fail(function() {
  12667. c.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12668. })
  12669. }
  12670. ,
  12671. t.exports = r
  12672. }
  12673. ).call(this, e("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12674. }
  12675. , {
  12676. "../util/ajax": 181,
  12677. "../util/common": 185,
  12678. "../util/logger": 189,
  12679. "../util/math": 190,
  12680. buffer: 198,
  12681. protobufjs: 214
  12682. }],
  12683. 108: [function(e, t, i) {
  12684. (function(i) {
  12685. "use strict";
  12686. function n() {
  12687. this.locale = null
  12688. }
  12689. var r = e("../settings")
  12690. , o = e("../util/common")
  12691. , a = e("../util/logger")
  12692. , s = e("../enum/Locale")
  12693. , l = new a(i);
  12694. n.prototype.init = function() {
  12695. var t;
  12696. switch (r.languageTag) {
  12697. case null:
  12698. case "en":
  12699. case s.EN_US:
  12700. this.locale = s.EN_US,
  12701. t = e("./strings-en-US");
  12702. break;
  12703. case "es":
  12704. case s.ES_MX:
  12705. this.locale = s.ES_MX,
  12706. t = e("./strings-es-MX");
  12707. break;
  12708. case "fr":
  12709. case s.FR_FR:
  12710. this.locale = s.FR_FR,
  12711. t = e("./strings-fr-FR");
  12712. break;
  12713. case "de":
  12714. case s.DE_DE:
  12715. this.locale = s.DE_DE,
  12716. t = e("./strings-de-DE");
  12717. break;
  12718. case "ru":
  12719. case s.RU_RU:
  12720. this.locale = s.RU_RU,
  12721. t = e("./strings-ru-RU");
  12722. break;
  12723. case "cn":
  12724. case s.CN_CN:
  12725. this.locale = s.CN_CN,
  12726. t = e("./strings-cn-CN");
  12727. break;
  12728. case "jp":
  12729. case s.JP_JP:
  12730. this.locale = s.JP_JP,
  12731. t = e("./strings-jp-JP");
  12732. break;
  12733. default:
  12734. l.info("Unsupported language tag, defaulting to 'en-US'"),
  12735. this.locale = s.EN_US,
  12736. t = e("./strings-en-US")
  12737. }
  12738. l.info("Using locale '" + this.locale + "'"),
  12739. o.extendObject(this, t)
  12740. }
  12741. ,
  12742. n.prototype.localizeGUI = function() {
  12743. var e = document.querySelector("#gui-parent");
  12744. this.localizeTree(e),
  12745. this.localizeLoadingText()
  12746. }
  12747. ,
  12748. n.prototype.localizeLoadingText = function() {
  12749. // var e = document.querySelector("#loader-cont")
  12750. // , t = e.getAttribute("title");
  12751. // e.removeAttribute("title"),
  12752. // e.setAttribute("data-status", t),
  12753. // e.classList.add(this.locale),
  12754. document.querySelector("#help-dialog").classList.add(this.locale),
  12755. document.querySelector("#interaction-modal").classList.add(this.locale),
  12756. document.querySelector("#gui").classList.add(this.locale);
  12757. }
  12758. ,
  12759. n.prototype.localizeTree = function(e) {
  12760. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12761. if (e.nodeType === Node.TEXT_NODE)
  12762. t = e.data.match(n),
  12763. t && (i = t[1],
  12764. e.data = this.localizeText(i) || i);
  12765. else if (e.nodeType === Node.ELEMENT_NODE) {
  12766. var r = e.getAttribute("title");
  12767. r && (t = r.match(n),
  12768. t && (i = t[1],
  12769. e.setAttribute("title", this.localizeText(i) || i)))
  12770. }
  12771. for (e = e.firstChild; e; )
  12772. this.localizeTree(e),
  12773. e = e.nextSibling
  12774. }
  12775. ,
  12776. n.prototype.localizeText = function(t) {
  12777. var i = this[t];
  12778. return i || this.locale === s.EN_US || (l.warn("Localization key '" + t + "' not available for locale '" + this.locale + "', defaulting to English."),
  12779. i = e("./strings-en-US")[t]),
  12780. i || l.warn("Localization key '" + t + "' not available for locale 'en-US'"),
  12781. i
  12782. }
  12783. ,
  12784. t.exports = new n
  12785. }
  12786. ).call(this, "/js/localization/localize.js")
  12787. }
  12788. , {
  12789. "../enum/Locale": 31,
  12790. "../settings": 166,
  12791. "../util/common": 185,
  12792. "../util/logger": 189,
  12793. "./strings-cn-CN": 109,
  12794. "./strings-de-DE": 110,
  12795. "./strings-en-US": 111,
  12796. "./strings-es-MX": 112,
  12797. "./strings-fr-FR": 113,
  12798. "./strings-jp-JP": 114,
  12799. "./strings-ru-RU": 115
  12800. }],
  12801. 109: [function(e, t, i) {
  12802. "use strict";
  12803. t.exports = {
  12804. PAGE_TITLE: "",
  12805. LOADING: "正在加载",
  12806. PRESENTED_BY_CAPS: "呈现者:",
  12807. POWERED_BY: "技术支持:",
  12808. POWERED_BY_CAPS: "技术支持:",
  12809. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12810. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12811. PRESENTED_BY: "呈现者:",
  12812. MORE: "更多 ",
  12813. LESS: "更少 ",
  12814. TAG_CONTENT: "tag™ 内容",
  12815. SHOW: "显示",
  12816. HIDE: "隐藏",
  12817. DOLLHOUSE: "场景屋",
  12818. FLOOR_PLAN: "楼层平面图",
  12819. OPEN_HIGHLIGHTS: "打开精彩片段",
  12820. CLOSE_HIGHLIGHTS: "关闭",
  12821. PREVIOUS: "上一个",
  12822. PLAY: "播放",
  12823. PAUSE: "暂停",
  12824. NEXT: "下一个",
  12825. EXPLORE_3D_SPACE: "探索 3D 空间",
  12826. VIEW_DOLLHOUSE: "观看场景屋",
  12827. SOCIAL_SHARING: "分享这个空间",
  12828. VIEW_IN_VR: "以 VR 观看",
  12829. VIEW_FULLSCREEN: "全屏观看",
  12830. EXIT_FULLSCREEN: " 退出全屏",
  12831. ZOOM_IN: "放大",
  12832. ZOOM_OUT: "缩小",
  12833. FLOOR_NAME: "楼层",
  12834. FLOOR_ALL: "全部",
  12835. TERMS: "条款",
  12836. PORT_TERMS: "port 条款",
  12837. TERMS_OF_USE: "使用条款",
  12838. CLOSE_TERMS: "关闭",
  12839. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12840. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12841. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12842. WEBVR_ENTER_WEBVR: "进入 VR",
  12843. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12844. WEBVR_LEARN_MORE: "了解更多",
  12845. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12846. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12847. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12848. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12849. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12850. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12851. VR_LEARN_MORE_CAPS: "了解更多",
  12852. VR_PREVIOUS_CAPS: "上一个’,",
  12853. VR_NEXT_CAPS: "下一个",
  12854. VR_GOT_IT_CAPS: "明白了",
  12855. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12856. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12857. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12858. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12859. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12860. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12861. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12862. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12863. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12864. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12865. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12866. VR_APP: "port VR 应用程序",
  12867. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12868. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12869. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12870. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12871. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12872. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12873. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12874. VR_ANDROID_DVICES: "Android 设备",
  12875. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12876. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12877. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12878. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12879. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12880. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12881. VR_DOWNLOAD_HERE: "在此下载",
  12882. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12883. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12884. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12885. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12886. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12887. SHARE_TO: "分享到",
  12888. SHARE_LINK: "直接链接",
  12889. SHARE_EXPLORE: "探索",
  12890. SHARE_AT: "在",
  12891. SHARE_WITH: "使用",
  12892. SHARE_3D: "以 3D",
  12893. SHARE_COPIED: "已复制!",
  12894. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12895. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12896. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12897. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12898. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12899. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12900. ERROR_GENERIC_ACTIONS_3: " 或",
  12901. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12902. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12903. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12904. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12905. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12906. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12907. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12908. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12909. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12910. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  12911. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  12912. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  12913. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  12914. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  12915. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  12916. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  12917. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  12918. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  12919. LINK_TO_LOCATION: "地点链接",
  12920. MENU_COPY: "复制",
  12921. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  12922. ROTATE: "旋转",
  12923. MOVE: "移动",
  12924. INSIDE: "内部",
  12925. ZOOM: "缩放",
  12926. HELP: "小帮手",
  12927. HELP_NAVIGATION_TAB: "导航",
  12928. HELP_MORE_HELP_TAB: "更多帮助",
  12929. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  12930. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  12931. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  12932. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  12933. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  12934. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  12935. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  12936. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  12937. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  12938. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  12939. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  12940. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  12941. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  12942. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  12943. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  12944. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  12945. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  12946. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  12947. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  12948. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  12949. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  12950. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  12951. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  12952. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  12953. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  12954. HELP_MORE_HLR_A: "精彩片段集锦",
  12955. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  12956. HELP_MORE_DOLLHOUSE_A: "场景屋",
  12957. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  12958. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  12959. HELP_MORE_FLOORS_A: "楼层选择器",
  12960. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  12961. HELP_MORE_TAG_A: "tag™ 贴文",
  12962. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  12963. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  12964. HELP_MORE_ZOOM_A: "缩放控件",
  12965. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  12966. HELP_MORE_TOUR_A: "导览控件",
  12967. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  12968. HELP_MORE_INSIDE_A: "内部视图",
  12969. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  12970. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  12971. HELP_MORE_VR_A: "VR 模式",
  12972. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  12973. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  12974. HELP_MORE_360_A: "360° 视图",
  12975. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  12976. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  12977. HELP_MORE_FULLSCREEN_A: "全屏",
  12978. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  12979. CLOSE: "关闭"
  12980. }
  12981. }
  12982. , {}],
  12983. 110: [function(e, t, i) {
  12984. "use strict";
  12985. t.exports = {
  12986. PAGE_TITLE: "",
  12987. LOADING: "Lädt",
  12988. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  12989. POWERED_BY: "Angetrieben von",
  12990. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  12991. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12992. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12993. PRESENTED_BY: "Präsentiert von ",
  12994. MORE: "Mehr ",
  12995. LESS: "Weniger ",
  12996. TAG_CONTENT: "tag™ Inhalt",
  12997. SHOW: "Anzeigen",
  12998. HIDE: "Verbergen",
  12999. DOLLHOUSE: "Puppenhaus",
  13000. FLOOR_PLAN: "Grundriss",
  13001. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  13002. CLOSE_HIGHLIGHTS: "Schließen",
  13003. PREVIOUS: "Vorheriges",
  13004. PLAY: "Abspielen",
  13005. PAUSE: "Pausieren",
  13006. NEXT: "Nächstes",
  13007. EXPLORE_3D_SPACE: "Innenraum betreten",
  13008. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  13009. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  13010. VIEW_IN_VR: "In VR ansehen",
  13011. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  13012. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  13013. ZOOM_IN: "Vergrößern",
  13014. ZOOM_OUT: "Verkleinern",
  13015. FLOOR_NAME: "Etage ",
  13016. FLOOR_ALL: "Alle",
  13017. TERMS: "Bedingungen",
  13018. PORT_TERMS: "port Bedingungen",
  13019. TERMS_OF_USE: "Nutzungsbedingungen",
  13020. TERMS_TEXT_FILE: "terms-de-DE.html",
  13021. CLOSE_TERMS: "Schließen",
  13022. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  13023. HELP: "Hilfe",
  13024. HELP_NAVIGATION_TAB: "Navigation",
  13025. HELP_MORE_HELP_TAB: "Hilfe-Details",
  13026. CLOSE: "Schließen",
  13027. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  13028. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  13029. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13030. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  13031. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  13032. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  13033. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  13034. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  13035. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  13036. 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.",
  13037. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13038. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  13039. 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.",
  13040. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  13041. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13042. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  13043. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  13044. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  13045. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  13046. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  13047. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  13048. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  13049. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  13050. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  13051. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  13052. HELP_MORE_HLR_A: "Liste das Highlight",
  13053. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  13054. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  13055. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13056. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13057. HELP_MORE_FLOORS_A: "Etage auswählen",
  13058. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  13059. HELP_MORE_TAG_A: "tag™ Posts",
  13060. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  13061. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  13062. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  13063. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  13064. HELP_MORE_TOUR_A: "Tour Steuerung",
  13065. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  13066. HELP_MORE_INSIDE_A: "Innenansicht",
  13067. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  13068. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  13069. HELP_MORE_VR_A: "VR Modus",
  13070. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  13071. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  13072. HELP_MORE_360_A: "360° Views Ansicht ",
  13073. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13074. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13075. HELP_MORE_FULLSCREEN_A: "Vollbild",
  13076. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  13077. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  13078. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  13079. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  13080. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  13081. WEBVR_LEARN_MORE: "Mehr Infos",
  13082. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13083. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13084. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13085. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  13086. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  13087. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13088. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13089. VR_APP: "port VR App",
  13090. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  13091. 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",
  13092. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  13093. VR_APP_FOR_ANDROID: "port VR app für Android",
  13094. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  13095. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13096. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  13097. VR_PREVIOUS_CAPS: "ZURÜCK",
  13098. VR_NEXT_CAPS: "WEITER",
  13099. VR_GOT_IT_CAPS: "VERSTANDEN",
  13100. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  13101. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  13102. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  13103. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  13104. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  13105. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  13106. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13107. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13108. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13109. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  13110. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  13111. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  13112. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13113. VR_ANDROID_DVICES: "Android Geräte",
  13114. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  13115. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  13116. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  13117. VR_DOWNLOAD_HERE: "Hier runterladen",
  13118. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  13119. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  13120. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  13121. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  13122. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  13123. SHARE_TO: "Teilen auf",
  13124. SHARE_LINK: "Direkter Link",
  13125. SHARE_EXPLORE: "Umsehen",
  13126. SHARE_AT: "auf",
  13127. SHARE_WITH: "mit",
  13128. SHARE_3D: "in 3D",
  13129. SHARE_COPIED: "Kopiert!",
  13130. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  13131. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  13132. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  13133. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  13134. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13135. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  13136. ERROR_GENERIC_ACTIONS_3: " oder ",
  13137. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13138. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  13139. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  13140. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  13141. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  13142. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  13143. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  13144. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  13145. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  13146. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  13147. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  13148. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  13149. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  13150. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  13151. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13152. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13153. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  13154. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  13155. LINK_TO_LOCATION: "Link zu",
  13156. MENU_COPY: "Kopieren",
  13157. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  13158. ROTATE: "Drehen",
  13159. INSIDE: "Drinnen",
  13160. MOVE: "Bewegen",
  13161. ZOOM: "Vergrößern"
  13162. }
  13163. }
  13164. , {}],
  13165. 111: [function(e, t, i) {
  13166. "use strict";
  13167. t.exports = {
  13168. PAGE_TITLE: "",
  13169. LOADING: "Loading",
  13170. PRESENTED_BY_CAPS: "PRESENTED BY",
  13171. POWERED_BY: "powered by ",
  13172. POWERED_BY_CAPS: "POWERED BY",
  13173. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  13174. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  13175. PRESENTED_BY: "Presented by ",
  13176. MORE: "More ",
  13177. LESS: "Less ",
  13178. TAG_CONTENT: "tag™ Content",
  13179. SHOW: "Show",
  13180. HIDE: "Hide",
  13181. DOLLHOUSE: "Dollhouse",
  13182. FLOOR_PLAN: "Floor plan",
  13183. OPEN_HIGHLIGHTS: "Open Highlights",
  13184. CLOSE_HIGHLIGHTS: "Close",
  13185. PREVIOUS: "Previous",
  13186. PLAY: "Play",
  13187. PAUSE: "Pause",
  13188. NEXT: "Next",
  13189. EXPLORE_3D_SPACE: "Explore 3D Space",
  13190. VIEW_DOLLHOUSE: "View dollhouse",
  13191. SOCIAL_SHARING: "Share this Space",
  13192. VIEW_IN_VR: "View in VR",
  13193. VIEW_FULLSCREEN: "全屏",
  13194. EXIT_FULLSCREEN: "退出全屏",
  13195. ZOOM_IN: "Zoom in",
  13196. ZOOM_OUT: "Zoom out",
  13197. FLOOR_NAME: "Floor ",
  13198. FLOOR_ALL: "All",
  13199. TERMS: "Terms",
  13200. PORT_TERMS: "port terms",
  13201. TERMS_OF_USE: "Terms of Use",
  13202. TERMS_TEXT_FILE: "terms-en-US.html",
  13203. CLOSE_TERMS: "Close",
  13204. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13205. HELP: "Help",
  13206. HELP_NAVIGATION_TAB: "Navigation",
  13207. HELP_MORE_HELP_TAB: "More Help",
  13208. CLOSE: "Close",
  13209. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13210. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13211. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13212. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13213. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13214. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13215. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13216. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13217. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13218. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13219. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13220. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13221. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13222. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13223. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13224. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13225. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13226. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13227. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13228. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13229. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13230. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13231. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13232. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13233. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13234. HELP_MORE_HLR_A: "Highlight Reel",
  13235. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13236. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13237. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13238. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13239. HELP_MORE_FLOORS_A: "Floor Selector",
  13240. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13241. HELP_MORE_TAG_A: "tag™ Posts",
  13242. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13243. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13244. HELP_MORE_ZOOM_A: "Zoom Controls",
  13245. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13246. HELP_MORE_TOUR_A: "Tour Controls",
  13247. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13248. HELP_MORE_INSIDE_A: "Inside View",
  13249. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13250. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13251. HELP_MORE_VR_A: "VR Mode",
  13252. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13253. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13254. HELP_MORE_360_A: "360° Views",
  13255. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13256. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13257. HELP_MORE_FULLSCREEN_A: "Full screen",
  13258. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13259. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13260. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13261. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13262. WEBVR_ENTER_WEBVR: "ENTER VR",
  13263. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13264. WEBVR_LEARN_MORE: "Learn more",
  13265. WEBVR_VIEW_SPACE: "View Space in VR",
  13266. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13267. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13268. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13269. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13270. VR_PREVIOUS_CAPS: "PREVIOUS",
  13271. VR_NEXT_CAPS: "NEXT",
  13272. VR_GOT_IT_CAPS: "GOT IT",
  13273. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13274. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13275. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13276. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13277. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13278. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13279. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13280. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13281. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13282. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13283. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13284. VR_APP: "port VR App",
  13285. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13286. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13287. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13288. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13289. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13290. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13291. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13292. VR_ANDROID_DVICES: "Android Devices",
  13293. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13294. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13295. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13296. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13297. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13298. VR_APP_OPEN: "Open with the port VR app instead",
  13299. VR_DOWNLOAD_HERE: "Download here",
  13300. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13301. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13302. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13303. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13304. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13305. SHARE_TO: "Share to",
  13306. SHARE_LINK: "Direct Link",
  13307. SHARE_EXPLORE: "Explore ",
  13308. SHARE_AT: "at",
  13309. SHARE_WITH: "with",
  13310. SHARE_3D: " in 3D",
  13311. SHARE_COPIED: "Copied!",
  13312. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13313. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13314. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13315. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13316. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13317. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13318. ERROR_GENERIC_ACTIONS_3: " or ",
  13319. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13320. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13321. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13322. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13323. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13324. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13325. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13326. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13327. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13328. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13329. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13330. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13331. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13332. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13333. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13334. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13335. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13336. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13337. LINK_TO_LOCATION: "Link to location",
  13338. MENU_COPY: "Copy",
  13339. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13340. ROTATE: "Rotate",
  13341. INSIDE: "Inside",
  13342. MOVE: "Move",
  13343. ZOOM: "Zoom"
  13344. }
  13345. }
  13346. , {}],
  13347. 112: [function(e, t, i) {
  13348. "use strict";
  13349. t.exports = {
  13350. PAGE_TITLE: "",
  13351. LOADING: "Cargando",
  13352. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13353. POWERED_BY: "potenciando por ",
  13354. POWERED_BY_CAPS: "POTENCIADO POR ",
  13355. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13356. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13357. PRESENTED_BY: "Presentado por ",
  13358. MORE: "Más ",
  13359. LESS: "Menos ",
  13360. TAG_CONTENT: "Contenido de tag™",
  13361. SHOW: "Mostrar",
  13362. HIDE: "Ocultar",
  13363. DOLLHOUSE: "Dollhouse",
  13364. FLOOR_PLAN: "Planos",
  13365. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13366. CLOSE_HIGHLIGHTS: "Cerrar",
  13367. PREVIOUS: "Anterior",
  13368. PLAY: "Play",
  13369. PAUSE: "Pausa",
  13370. NEXT: "Siguiente",
  13371. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13372. VIEW_DOLLHOUSE: "Ver dollhouse",
  13373. SOCIAL_SHARING: "Compartir este espacio",
  13374. VIEW_IN_VR: "Ver en realidad virtual",
  13375. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13376. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13377. ZOOM_IN: "Acercar",
  13378. ZOOM_OUT: "Alejar",
  13379. FLOOR_NAME: "Piso ",
  13380. FLOOR_ALL: "Todas",
  13381. TERMS: "Condiciones",
  13382. PORT_TERMS: "port términos de uso",
  13383. TERMS_OF_USE: "Términos de uso",
  13384. TERMS_TEXT_FILE: "terms-es-MX.html",
  13385. CLOSE_TERMS: "Cerrar",
  13386. 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.",
  13387. HELP: "Ayuda",
  13388. HELP_NAVIGATION_TAB: "Navegación",
  13389. HELP_MORE_HELP_TAB: "Más Ayuda",
  13390. CLOSE: "Cerrar",
  13391. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13392. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13393. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13394. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13395. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13396. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13397. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13398. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13399. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13400. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13401. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13402. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13403. 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.",
  13404. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13405. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13406. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13407. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13408. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13409. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13410. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13411. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13412. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13413. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13414. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13415. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13416. HELP_MORE_HLR_A: "Galería destacada",
  13417. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13418. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13419. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13420. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13421. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13422. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13423. HELP_MORE_TAG_A: "tag™ Posts",
  13424. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13425. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13426. HELP_MORE_ZOOM_A: "Controles de zoom",
  13427. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13428. HELP_MORE_TOUR_A: "Controles de recorrido",
  13429. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13430. HELP_MORE_INSIDE_A: "Vista interior",
  13431. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13432. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13433. HELP_MORE_VR_A: "Modo de realidad virtual",
  13434. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13435. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13436. HELP_MORE_360_A: "360° Views",
  13437. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13438. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13439. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13440. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13441. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13442. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13443. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13444. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13445. WEBVR_LEARN_MORE: "Más información",
  13446. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13447. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13448. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13449. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13450. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13451. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13452. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13453. VR_APP: "port VR App",
  13454. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13455. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13456. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13457. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13458. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13459. VR_PREVIOUS_CAPS: "ANTERIOR",
  13460. VR_NEXT_CAPS: "SIGUIENTE",
  13461. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13462. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13463. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13464. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13465. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13466. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13467. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13468. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13469. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13470. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13471. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13472. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13473. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13474. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13475. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13476. VR_ANDROID_DVICES: "Dispositivos Android",
  13477. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13478. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13479. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13480. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13481. VR_DOWNLOAD_HERE: "Descargar aquí",
  13482. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13483. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13484. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13485. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13486. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13487. SHARE_TO: "Compartir en",
  13488. SHARE_LINK: "Enlace directo",
  13489. SHARE_EXPLORE: "Explorar ",
  13490. SHARE_AT: "en",
  13491. SHARE_WITH: "con",
  13492. SHARE_3D: " en 3D",
  13493. SHARE_COPIED: "¡Copiado!",
  13494. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13495. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13496. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13497. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13498. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13499. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13500. ERROR_GENERIC_ACTIONS_3: " o ",
  13501. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13502. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13503. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13504. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13505. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13506. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13507. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13508. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13509. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13510. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13511. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13512. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13513. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13514. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13515. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13516. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13517. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13518. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13519. LINK_TO_LOCATION: "Enlace a la ubicación",
  13520. MENU_COPY: "Copiar",
  13521. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13522. ROTATE: "Girar",
  13523. INSIDE: "Interior",
  13524. MOVE: "Moverse",
  13525. ZOOM: "Acercar o alejar"
  13526. }
  13527. }
  13528. , {}],
  13529. 113: [function(e, t, i) {
  13530. "use strict";
  13531. t.exports = {
  13532. PAGE_TITLE: "",
  13533. LOADING: "Chargement",
  13534. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13535. POWERED_BY: "alimenté par ",
  13536. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13537. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13538. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13539. PRESENTED_BY: "Présenté par ",
  13540. MORE: "Plus ",
  13541. LESS: "Moins ",
  13542. TAG_CONTENT: "Contenu tag™",
  13543. SHOW: "Montrer",
  13544. HIDE: "Cacher",
  13545. DOLLHOUSE: "Dollhouse",
  13546. FLOOR_PLAN: "Plan de sol",
  13547. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13548. CLOSE_HIGHLIGHTS: "Fermer",
  13549. PREVIOUS: "Précédent",
  13550. PLAY: "Lecture",
  13551. PAUSE: "Pause",
  13552. NEXT: "Suivant",
  13553. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13554. VIEW_DOLLHOUSE: "Voir dollhouse",
  13555. SOCIAL_SHARING: "Partager cet espace",
  13556. VIEW_IN_VR: "Voir en VR",
  13557. VIEW_FULLSCREEN: "Plein écran",
  13558. EXIT_FULLSCREEN: "Fermer plein écran",
  13559. ZOOM_IN: "Zoom avant",
  13560. ZOOM_OUT: "Zoom arrière",
  13561. FLOOR_NAME: "Étage ",
  13562. FLOOR_ALL: "Tous",
  13563. TERMS: "Mentions légales",
  13564. PORT_TERMS: "port mentions légales",
  13565. TERMS_OF_USE: "Conditions d'utilisation",
  13566. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13567. CLOSE_TERMS: "Fermer",
  13568. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13569. HELP: "Aide",
  13570. HELP_NAVIGATION_TAB: "Navigation",
  13571. HELP_MORE_HELP_TAB: "Aide",
  13572. CLOSE: "Fermer",
  13573. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13574. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13575. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13576. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13577. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13578. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13579. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13580. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13581. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13582. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13583. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13584. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13585. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13586. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13587. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13588. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13589. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13590. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13591. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13592. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13593. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13594. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13595. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13596. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13597. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13598. HELP_MORE_HLR_A: "Carrousel",
  13599. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13600. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13601. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13602. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13603. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13604. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13605. HELP_MORE_TAG_A: "tag™ Posts",
  13606. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13607. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13608. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13609. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13610. HELP_MORE_TOUR_A: "Commandes de la visite",
  13611. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13612. HELP_MORE_INSIDE_A: "Vue intérieure",
  13613. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13614. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13615. HELP_MORE_VR_A: "Mode RV",
  13616. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13617. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13618. HELP_MORE_360_A: "Vues 360°",
  13619. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13620. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13621. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13622. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13623. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13624. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13625. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13626. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13627. WEBVR_LEARN_MORE: "En savoir plus",
  13628. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13629. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13630. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13631. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13632. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13633. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13634. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13635. VR_NEXT_CAPS: "SUIVANT",
  13636. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13637. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13638. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13639. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13640. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13641. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13642. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13643. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13644. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13645. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13646. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13647. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13648. VR_APP: "port VR App",
  13649. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13650. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13651. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13652. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13653. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13654. 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",
  13655. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13656. VR_ANDROID_DVICES: "Appareils Android",
  13657. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13658. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13659. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13660. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13661. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13662. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13663. VR_DOWNLOAD_HERE: "Télécharger ici",
  13664. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13665. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13666. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13667. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13668. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13669. SHARE_TO: "Partager sur",
  13670. SHARE_LINK: "Lien direct",
  13671. SHARE_EXPLORE: "Explorer ",
  13672. SHARE_AT: "à",
  13673. SHARE_WITH: "avec",
  13674. SHARE_3D: " en 3D",
  13675. SHARE_COPIED: "Copié!",
  13676. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13677. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13678. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13679. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13680. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13681. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13682. ERROR_GENERIC_ACTIONS_3: " ou ",
  13683. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13684. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13685. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13686. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13687. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13688. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13689. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13690. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13691. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13692. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13693. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13694. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13695. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13696. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13697. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13698. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13699. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13700. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13701. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13702. MENU_COPY: "Copie",
  13703. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13704. ROTATE: "Faire pivoter",
  13705. INSIDE: "Intérieure",
  13706. MOVE: "Se déplacer",
  13707. ZOOM: "Zoom"
  13708. }
  13709. }
  13710. , {}],
  13711. 114: [function(e, t, i) {
  13712. "use strict";
  13713. t.exports = {
  13714. PAGE_TITLE: "",
  13715. LOADING: "読み込み中",
  13716. PRESENTED_BY_CAPS: "PRESENTED BY",
  13717. POWERED_BY: "powered by",
  13718. POWERED_BY_CAPS: "POWERED BY",
  13719. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13720. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13721. PRESENTED_BY: "Presented by ",
  13722. MORE: "全て表示 ",
  13723. LESS: "閉じる ",
  13724. TAG_CONTENT: "tag™コンテンツ ",
  13725. SHOW: "表示",
  13726. HIDE: "非表示",
  13727. DOLLHOUSE: "ドールハウス",
  13728. FLOOR_PLAN: "フロアプラン",
  13729. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13730. CLOSE_HIGHLIGHTS: "閉じる",
  13731. PREVIOUS: "前へ",
  13732. PLAY: "再生",
  13733. PAUSE: "一時停止",
  13734. NEXT: "次へ",
  13735. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13736. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13737. SOCIAL_SHARING: "このSpaceを共有する",
  13738. VIEW_IN_VR: "VRで表示",
  13739. VIEW_FULLSCREEN: "フルスクリーン表示",
  13740. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13741. ZOOM_IN: "ズームイン",
  13742. ZOOM_OUT: "ズームアウト",
  13743. FLOOR_NAME: "フロア ",
  13744. FLOOR_ALL: "すべて",
  13745. TERMS: "規約",
  13746. PORT_TERMS: "port規約",
  13747. TERMS_OF_USE: "利用規約",
  13748. CLOSE_TERMS: "閉じる",
  13749. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13750. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13751. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13752. WEBVR_ENTER_WEBVR: "VRに入る",
  13753. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13754. WEBVR_LEARN_MORE: "もっと詳しく",
  13755. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13756. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13757. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13758. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13759. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13760. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13761. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13762. VR_PREVIOUS_CAPS: "前へ",
  13763. VR_NEXT_CAPS: "次へ",
  13764. VR_GOT_IT_CAPS: "了解",
  13765. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13766. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13767. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13768. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13769. VR_WHAT_YOU_NEED: "必要なもの",
  13770. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13771. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13772. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13773. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13774. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13775. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13776. VR_APP: "port VRアプリ",
  13777. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13778. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13779. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13780. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13781. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13782. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13783. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13784. VR_ANDROID_DVICES: "Androidデバイス",
  13785. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13786. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13787. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13788. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13789. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13790. VR_APP_OPEN: "port VRアプリで開く",
  13791. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13792. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13793. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13794. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13795. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13796. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13797. SHARE_TO: "共有先",
  13798. SHARE_LINK: "ダイレクトリンク",
  13799. SHARE_EXPLORE: "探索",
  13800. SHARE_AT: "場所",
  13801. SHARE_WITH: "使用アプリ",
  13802. SHARE_3D: "3Dで",
  13803. SHARE_COPIED: "コピーされました!",
  13804. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13805. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13806. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13807. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13808. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13809. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13810. ERROR_GENERIC_ACTIONS_3: "または",
  13811. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13812. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13813. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13814. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13815. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13816. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13817. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13818. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13819. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13820. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13821. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13822. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13823. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13824. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13825. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13826. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13827. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13828. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13829. LINK_TO_LOCATION: "ロケーションへのリンク",
  13830. MENU_COPY: "コピー",
  13831. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13832. ROTATE: "回転",
  13833. MOVE: "移動",
  13834. INSIDE: "内側",
  13835. ZOOM: "ズーム",
  13836. HELP: "ヘルプ",
  13837. HELP_NAVIGATION_TAB: "ナビゲーション",
  13838. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13839. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13840. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13841. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13842. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13843. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13844. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13845. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13846. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13847. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13848. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13849. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13850. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13851. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13852. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13853. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13854. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13855. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13856. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13857. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13858. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13859. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13860. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13861. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13862. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13863. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13864. HELP_MORE_HLR_A: "ハイライト",
  13865. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13866. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13867. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13868. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13869. HELP_MORE_FLOORS_A: "フロアセレクター",
  13870. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13871. HELP_MORE_TAG_A: "tag™ Posts",
  13872. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13873. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13874. HELP_MORE_ZOOM_A: "ズームコントロール",
  13875. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13876. HELP_MORE_TOUR_A: "ツアーコントロール",
  13877. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13878. HELP_MORE_INSIDE_A: "内側ビュー",
  13879. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13880. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13881. HELP_MORE_VR_A: "VRモード",
  13882. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13883. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13884. HELP_MORE_360_A: "360° Views",
  13885. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13886. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13887. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13888. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13889. CLOSE: "閉じる"
  13890. }
  13891. }
  13892. , {}],
  13893. 115: [function(e, t, i) {
  13894. "use strict";
  13895. t.exports = {
  13896. PAGE_TITLE: "",
  13897. LOADING: "Загрузка",
  13898. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13899. POWERED_BY: "разработано на платформе ",
  13900. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13901. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13902. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13903. PRESENTED_BY: "Представлено ",
  13904. MORE: "Больше ",
  13905. LESS: "Меньше ",
  13906. TAG_CONTENT: "tag™ Контент",
  13907. SHOW: "Показать",
  13908. HIDE: "Скрыть",
  13909. DOLLHOUSE: "Dollhouse",
  13910. FLOOR_PLAN: "Планировка",
  13911. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  13912. CLOSE_HIGHLIGHTS: "Закрыть",
  13913. PREVIOUS: "Предыдущий",
  13914. PLAY: "Воспроизвести",
  13915. PAUSE: "Пауза",
  13916. NEXT: "Следующий",
  13917. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  13918. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  13919. SOCIAL_SHARING: "Поделиться этой моделью",
  13920. VIEW_IN_VR: "Посмотреть в VR",
  13921. VIEW_FULLSCREEN: "Полный экран",
  13922. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  13923. ZOOM_IN: "Увеличить",
  13924. ZOOM_OUT: "Уменьшить",
  13925. FLOOR_NAME: "Этаж ",
  13926. FLOOR_ALL: "Все",
  13927. TERMS: "Условия",
  13928. PORT_TERMS: "Правила пользования",
  13929. TERMS_OF_USE: "Условия использования",
  13930. TERMS_TEXT_FILE: "terms-ru-RU.html",
  13931. CLOSE_TERMS: "Закрыть",
  13932. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  13933. HELP: "Помощь",
  13934. HELP_NAVIGATION_TAB: "Навигация",
  13935. HELP_MORE_HELP_TAB: "Доп. Помощь",
  13936. CLOSE: "Закрыть",
  13937. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  13938. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  13939. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  13940. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  13941. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  13942. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  13943. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13944. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  13945. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  13946. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  13947. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13948. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  13949. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  13950. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  13951. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13952. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  13953. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  13954. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  13955. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  13956. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  13957. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13958. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  13959. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  13960. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  13961. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  13962. HELP_MORE_HLR_A: "Фотоколлаж",
  13963. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  13964. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  13965. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13966. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13967. HELP_MORE_FLOORS_A: "Выбор Этажа",
  13968. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  13969. HELP_MORE_TAG_A: "tag™ Posts",
  13970. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  13971. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  13972. HELP_MORE_ZOOM_A: "Масштаб",
  13973. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  13974. HELP_MORE_TOUR_A: "Управление Туром",
  13975. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  13976. HELP_MORE_INSIDE_A: "Вид Изнутри",
  13977. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13978. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13979. HELP_MORE_VR_A: "Режим VR",
  13980. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13981. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13982. HELP_MORE_360_A: "360° Views",
  13983. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13984. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13985. HELP_MORE_FULLSCREEN_A: "Полный экран",
  13986. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  13987. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  13988. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  13989. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  13990. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  13991. WEBVR_LEARN_MORE: "Узнать больше",
  13992. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  13993. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  13994. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13995. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  13996. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  13997. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13998. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13999. VR_APP: "port VR App",
  14000. VR_APP_OPEN: "Или открыть через приложение port VR",
  14001. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  14002. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  14003. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  14004. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  14005. VR_VIEW_SPACE: "Запустить модель в VR",
  14006. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  14007. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  14008. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  14009. VR_GOT_IT_CAPS: "ЯСНО",
  14010. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  14011. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  14012. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  14013. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  14014. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  14015. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  14016. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14017. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14018. VR_COMPATIBLE_IPHONES_1: "iPhones",
  14019. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  14020. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  14021. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  14022. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  14023. VR_ANDROID_DVICES: "Android устройства",
  14024. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  14025. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  14026. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  14027. VR_DOWNLOAD_HERE: "Скачать здесь",
  14028. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  14029. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  14030. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  14031. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  14032. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  14033. SHARE_TO: "Поделиться",
  14034. SHARE_LINK: "Прямая ссылка",
  14035. SHARE_EXPLORE: "просмотреть",
  14036. SHARE_AT: "на",
  14037. SHARE_WITH: "с",
  14038. SHARE_3D: "в 3D",
  14039. SHARE_COPIED: "Скопировано!",
  14040. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  14041. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  14042. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  14043. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  14044. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  14045. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  14046. ERROR_GENERIC_ACTIONS_3: " или ",
  14047. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  14048. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  14049. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  14050. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  14051. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  14052. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  14053. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  14054. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  14055. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  14056. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  14057. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  14058. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  14059. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  14060. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  14061. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  14062. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  14063. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  14064. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  14065. LINK_TO_LOCATION: "Ссылка на местоположение",
  14066. MENU_COPY: "Копировать",
  14067. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  14068. ROTATE: "Вращать",
  14069. MOVE: "Передвигаться",
  14070. INSIDE: "Вид изнутри",
  14071. ZOOM: "Масштаб"
  14072. }
  14073. }
  14074. , {}],
  14075. 116: [function(e, t, i) {//main.js
  14076. (function(t) {
  14077. "use strict";
  14078. function i() {
  14079. var e = Y.getModelIDFromQueryString();
  14080. if (!e)
  14081. return b(null, "loading-failed");
  14082. var t = Y.parseSidUrl(e)
  14083. , i = l()
  14084. , a = c()
  14085. , s = o()
  14086. , u = V.quickstart.enabled
  14087. , g = null
  14088. , m = null
  14089. , v = null
  14090. , w = null
  14091. , T = null
  14092. , x = null
  14093. , S = null
  14094. , M = null
  14095. , R = null
  14096. , P = null
  14097. , O = null
  14098. , L = null
  14099. , N = new ue;
  14100. r(s);
  14101. /* h({ //MP开头写法
  14102. urlBase: t.urlBase
  14103. }).then...... */
  14104. $.ajax(g_Prefix+"data/"+window.number+"/someData.json",{dataType: "json"}).done( function(e){ //改
  14105. e.files.templates[0] = e.files.templates[0].replace("{{number}}",window.number);
  14106. window.MP_PREFETCHED_MODELDATA = e;
  14107. h({
  14108. urlBase: t.urlBase
  14109. })//xzw someData.js是我整合的 原本在html里 但这样每个场景的html都不一样了
  14110. }).then(function(i) {
  14111. return re.init(),
  14112. d(t, e) //getModel and load
  14113. }).then(function(e) {
  14114. return P = e,
  14115. p(P, V.appConfig.segment_key, V.appConfig.keen_write_key, V.appConfig.keen_project_id, {
  14116. startSource: i,
  14117. autoplay: V.autoplay,
  14118. quickstart: u
  14119. }),
  14120. P.urls.init()
  14121. }).then(function() {
  14122. return P.loadPanos()
  14123. }).then(function() {
  14124. m = X.getStartCameraOptions(P, P.panos),
  14125. S = A(P),
  14126. O = y(u, m.mode),
  14127. v = O.controls,
  14128. w = O.player,
  14129. T = O.director,
  14130. x = O.tagManager,
  14131. M = O.tileDownloader,
  14132. R = O.qualityManager,
  14133. L = O.panoRenderer,
  14134. C(P, S, O, s),
  14135. w.director = T,//xzw add
  14136. P.supportsTiles && M.start(),
  14137. !u || m.mode === D.PANORAMA && m.pano || (de.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14138. u = !1);
  14139. var e = null;
  14140. if (u) {
  14141. de.warn("Quickstart engaged. Hold on to your knickers.");
  14142. var t = v.controls[D.PANORAMA];
  14143. g = new ie(R,S.scene,S.camera,t,s),
  14144. _(S, s, P),
  14145. e = g.load(m).then(function() {
  14146. S.addComponent(g),
  14147. S.once(le.AfterRender, function() {
  14148. de.warn("First render after quickstart load finished.")
  14149. })
  14150. })
  14151. }
  14152. return $.when(e, U.startLoading(P, w, T, V.autoplay, u, N))
  14153. }).then(function() {
  14154. return f(P, U.onProgress, i, !u, a)
  14155. }).then(function() {
  14156. if (m.quickstart = u,
  14157. I(P, S, O, s),
  14158. S.started || _(S, s, P),
  14159. H.modelLoaded(P, w, v, V.autoplay),
  14160. E(w, P, m, V.autoplay).done(function() {
  14161. T.autoTour()
  14162. }),
  14163. !P.supportsTiles) {
  14164. var e = new Z(P,w);
  14165. e.start()
  14166. }
  14167. u && (S.removeComponent(g),
  14168. g.destroy(),
  14169. m.pano.enter()),
  14170. U.init(P, T, w, v, S, m, H.getSessionId()),
  14171. U.endLoading(P, T, x),
  14172. S.once(le.AfterRender, function() {
  14173. N.setAppReadyTime();
  14174. var e = N.calcFullLoadingTime();
  14175. de.warn("Total load time: " + e / 1e3),
  14176. H.loadComplete(e),
  14177. de.warn("First render after model load finished.")
  14178. }),
  14179. S.on(le.MemoryUsageUpdated, n)
  14180. }).fail(b.bind(this, e))
  14181. }
  14182. function n(e) {
  14183. ce.update(e)
  14184. }
  14185. function r(e) {
  14186. de.info("Version", "2.25.6-0-gd87e5b1"),
  14187. q.defaultMaxListeners = 1e3,
  14188. a(e),
  14189. s()
  14190. }
  14191. function o() {
  14192. return document.getElementById("player")
  14193. }
  14194. function a(e) {
  14195. e.addEventListener("dragenter", T, !1),
  14196. e.addEventListener("dragover", T, !1)
  14197. }
  14198. function s() {
  14199. F.valueFromHash("title", !0) || $(document).ready(function() {
  14200. var e = $(".model-title");
  14201. e.hide()
  14202. })
  14203. }
  14204. function l() {
  14205. return F.valueFromHash("play", !1) ? "autoplay" : F.inIframe() ? "click" : "fullpage"
  14206. }
  14207. function c() {
  14208. return {
  14209. panoElementsToLoad: 6,
  14210. modelElementsToLoad: 0,
  14211. totalElementsLoaded: 0,
  14212. totalElementsToLoad: 0,
  14213. totalPercentageLoaded: 0,
  14214. progressCallback: null
  14215. }
  14216. }
  14217. function h(e) {
  14218. return K.loadFeatureFlags(e).done(function(e) {
  14219. K.updateDependentSettings(e, V)
  14220. })
  14221. }
  14222. // function u(e) {
  14223. // return Q.get(e.urlBase + "/api/v1/config/showcase", {
  14224. // responseType: "json",
  14225. // prefetchFrom: "config"
  14226. // }).then(function(e) {
  14227. // return e ? void j.extendObject(V.appConfig, e) : {}
  14228. // }, function(e) {
  14229. // return de.warn("Failed loading runtime config, using defaults."),
  14230. // $.when({})
  14231. // })
  14232. // }
  14233. function d(e, t) {
  14234. var i = B.getModel({
  14235. url: t,
  14236. floors: F.valueFromHash("f", !0),
  14237. autoload: !1
  14238. })
  14239. ;
  14240. return $.when(i, n).then(null, function(e) {
  14241. return this
  14242. })
  14243. }
  14244. function p(e, t, i, n, r) {
  14245. de.info("Model data loaded"),
  14246. de.debug("UUID: " + e.data.job.uuid),
  14247. J.init(K.getFlags()),
  14248. i && H.initKeen({
  14249. token: i,
  14250. appId: n
  14251. }),
  14252. H.initSegment({
  14253. model: e.sid,
  14254. version: "2.25.6-0-gd87e5b1",
  14255. startSource: r.startSource,
  14256. token: t,
  14257. autoplay: r.autoplay,
  14258. quickstart: r.quickstart
  14259. })
  14260. }
  14261. function f(e, t, i, n, r) {
  14262. return r.progressCallback = t,
  14263. H.sessionStart(),
  14264. e.load(n).progress(g.bind(this, r))
  14265. }
  14266. function g(e, t) {
  14267. e.modelElementsToLoad = t[1],
  14268. v(e),
  14269. m(e)
  14270. }
  14271. function m(e) {
  14272. e.totalElementsLoaded++,
  14273. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14274. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14275. }
  14276. function v(e) {
  14277. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14278. }
  14279. function A(e) {
  14280. var t = new x.PerspectiveCamera;
  14281. t.layers.enable(he.PANOMARKERS),
  14282. t.layers.enable(he.RETICULE),
  14283. t.layers.enable(he.TAG);
  14284. var i = new x.Scene
  14285. , n = new x.AmbientLight(16777215);
  14286. i.add(n),
  14287. i.skybox = new W,
  14288. i.add(i.skybox),
  14289. i.plane = new x.Mesh(new x.PlaneBufferGeometry(1e5,1e5),new x.RawShaderMaterial({
  14290. side: x.DoubleSide
  14291. })),
  14292. i.plane.position.y = 0,
  14293. i.plane.rotateX(-Math.PI / 2),
  14294. i.plane.material.visible = !1,
  14295. i.add(i.plane),
  14296. i.updateMatrixWorld(),
  14297. V.showScreenshotLocations && e.data.images.forEach(function(e) {
  14298. if (e.metadata && e.metadata.camera_position) {
  14299. var t = e.metadata.camera_position
  14300. , n = new x.Mesh(new x.BoxGeometry(.3,.3,.3));
  14301. n.position = t.clone(),
  14302. i.add(n);
  14303. var r = e.metadata.camera_quaternion
  14304. , o = new x.Vector3(0,0,-1).applyQuaternion(r);
  14305. i.add(new x.ArrowHelper(o,t.clone(),1,16711680))
  14306. }
  14307. }),
  14308. V.showAxis && (i.add(new x.ArrowHelper(new x.Vector3(0,1,0),new x.Vector3(0,0,0),1,255)),
  14309. i.add(new x.ArrowHelper(new x.Vector3(0,0,1),new x.Vector3(0,0,0),1,16711680)),
  14310. i.add(new x.ArrowHelper(new x.Vector3(1,0,0),new x.Vector3(0,0,0),1,65280)));
  14311. var r = new te(i,t,z);
  14312. return r
  14313. }
  14314. function y(e, t) {
  14315. var i = e ? 1 : 1e3
  14316. , n = J.tilegen || J.imgopt ? 6 : 2;
  14317. n = F.valueFromHash("tileconc", n);
  14318. var r = new ne
  14319. , o = new ae({
  14320. concurrentDownloads: n
  14321. })
  14322. , a = new se
  14323. , s = new P
  14324. , l = new M
  14325. , c = new S(t)
  14326. , h = new R
  14327. , u = new O(i)
  14328. , d = new L
  14329. , p = new oe;
  14330. return {
  14331. qualityManager: r,
  14332. panoRenderer: a,
  14333. tileDownloader: o,
  14334. player: c,
  14335. director: l,
  14336. modelManager: s,
  14337. tagManager: p,
  14338. displayController: u,
  14339. labelDisplayController: d,
  14340. controls: h
  14341. }
  14342. }
  14343. function C(e, t, i, n) {
  14344. var r = i.controls
  14345. , o = i.qualityManager
  14346. , a = i.panoRenderer
  14347. , s = i.tileDownloader
  14348. , l = i.modelManager;
  14349. r.init(n, l),
  14350. ee.init(i.director, r, i.player, l, t),
  14351. o.init(l),
  14352. s.init(o),
  14353. a.init(t, s, o),
  14354. l.init(s, a, o),
  14355. l.addModel(e),
  14356. t.addComponent(G)
  14357. }
  14358. function I(e, t, i, n) {
  14359. var r = i.qualityManager
  14360. , o = i.panoRenderer
  14361. , a = i.tileDownloader
  14362. , s = i.modelManager
  14363. , l = i.player
  14364. , c = i.director
  14365. , h = i.tagManager
  14366. , u = i.displayController
  14367. , d = i.labelDisplayController
  14368. , p = i.controls;
  14369. t.scene.add(e),
  14370. t.qualityManager = r;
  14371. var f = {
  14372. camera: t.camera,
  14373. director: c,
  14374. modelManager: s,
  14375. tileDownloader: a,
  14376. panoRenderer: o,
  14377. qualityManager: r,
  14378. tagManager: h,
  14379. container: n,
  14380. controls: p
  14381. };
  14382. l.init(f),
  14383. l.setScene(t.scene),
  14384. h.init(s, l),
  14385. c.init(l, s),
  14386. u.init(c, l, s, h, n),
  14387. d.init(l, s, n),
  14388. z.bindEvents(l),
  14389. t.addComponent(h),
  14390. t.addComponent(l),
  14391. t.addComponent(o)
  14392. l.sceneRenderer = t; //xzw add 方便resize
  14393. }
  14394. function E(e, t, i, n) {
  14395. return de.info("Starting player in " + i.mode),
  14396. H.report(t.sid, "started-playing", n, i.quickstart),
  14397. e.start(i)
  14398. }
  14399. function b(e, t) {
  14400. de.error(t),
  14401. k.error(t),
  14402. H.report(e, "error-" + t)
  14403. }
  14404. function w(e) {
  14405. var t = F.details();
  14406. t && "Safari" === t.name && t.version > 500 && t.version < 600 ? (k.error("webgl-safari"),
  14407. H.report(e, "error-webgl-safari")) : (k.error("webgl-generic"),
  14408. H.report(e, "error-webgl-generic"))
  14409. }
  14410. function _(e, t, i) {
  14411. try {
  14412. e.start(t)
  14413. } catch (e) {
  14414. throw de.warn(e.message),
  14415. w(i.sid),
  14416. e
  14417. }
  14418. }
  14419. function T(e) {
  14420. e.stopPropagation(),
  14421. e.preventDefault()
  14422. }
  14423. e("./lib/three75-shim"),
  14424. e("./lib/array-polyfill"),
  14425. e("./lib/performance-polyfill"),
  14426. e("./lib/shaders/CopyShader.js"),
  14427. e("./lib/shaders/HorizontalBlurShader.js"),
  14428. e("./lib/shaders/VerticalBlurShader.js"),
  14429. e("./lib/postprocessing/EffectComposer.js"),
  14430. e("./lib/postprocessing/RenderPass.js"),
  14431. e("./lib/postprocessing/MaskPass.js"),
  14432. e("./lib/postprocessing/ShaderPass.js"),
  14433. window.Promise || (window.Promise = e("promise-polyfill"));
  14434. var x = e("three")
  14435. , S = (e("./util/sentry"),
  14436. e("./player"))
  14437. , M = e("./director")
  14438. , R = e("./controls/CameraControls")
  14439. , P = e("./model/ModelManager")
  14440. , O = e("./DisplayController")
  14441. , L = e("./label/LabelDisplayController")
  14442. , D = e("./enum/Viewmode")
  14443. , N = e("./util/logger")
  14444. , B = e("./showcase")
  14445. , F = e("./util/browser")
  14446. , V = e("./settings")
  14447. , U = e("./gui/gui")
  14448. , k = e("./gui/error")
  14449. , H = e("./analytics")
  14450. , G = e("./util/transitions")
  14451. , z = e("./effects")
  14452. , W = e("./objects/Skybox")
  14453. , j = e("./util/common")
  14454. , Y = (e("./util/PanoramaCollection"),
  14455. e("./util/math"),
  14456. e("./util/showcase"))
  14457. , X = e("./util/camera")
  14458. , Z = (e("./objects/Panorama"),
  14459. e("./cameras/PanoramaCamera"),
  14460. e("./preloaders"))
  14461. , q = e("events").EventEmitter
  14462. , K = e("./featureflags")
  14463. , Q = (e("./util/lerp"),
  14464. e("./util/ajax"))
  14465. , J = e("./ab")
  14466. , ee = e("./sdk/automation.js")
  14467. , te = e("./scene/SceneRenderer")
  14468. , ie = e("./scene/QuickstartManager")
  14469. , ne = e("./tile/QualityManager.js")
  14470. , re = e("./localization/localize")
  14471. , oe = e("./tag/tagManager")
  14472. , ae = e("./tile/TileDownloader")
  14473. , se = e("./tile/PanoRenderer")
  14474. , le = (e("./enum/PanoSizeClass"),
  14475. e("./enum/PanoramaEvents"),
  14476. e("./enum/SceneRendererEvents"))
  14477. , ce = e("./gui/memoryUsage")
  14478. , he = e("./enum/RenderLayers")
  14479. , ue = e("./TimingData")
  14480. , de = new N(t);
  14481. N.level = V.logLevel,
  14482. N.consoleEnabled = V.console,
  14483. i()
  14484. }
  14485. ).call(this, "/js/main.js")
  14486. }
  14487. , {
  14488. "./DisplayController": 1,
  14489. "./TimingData": 2,
  14490. "./ab": 3,
  14491. "./analytics": 4,
  14492. "./cameras/PanoramaCamera": 7,
  14493. "./controls/CameraControls": 9,
  14494. "./director": 15,
  14495. "./effects": 16,
  14496. "./enum/PanoSizeClass": 36,
  14497. "./enum/PanoramaEvents": 37,
  14498. "./enum/RenderLayers": 41,
  14499. "./enum/SceneRendererEvents": 43,
  14500. "./enum/Viewmode": 51,
  14501. "./featureflags": 59,
  14502. "./gui/error": 64,
  14503. "./gui/gui": 65,
  14504. "./gui/memoryUsage": 73,
  14505. "./label/LabelDisplayController": 91,
  14506. "./lib/array-polyfill": 92,
  14507. "./lib/performance-polyfill": 95,
  14508. "./lib/postprocessing/EffectComposer.js": 96,
  14509. "./lib/postprocessing/MaskPass.js": 97,
  14510. "./lib/postprocessing/RenderPass.js": 98,
  14511. "./lib/postprocessing/ShaderPass.js": 99,
  14512. "./lib/shaders/CopyShader.js": 100,
  14513. "./lib/shaders/HorizontalBlurShader.js": 101,
  14514. "./lib/shaders/VerticalBlurShader.js": 102,
  14515. "./lib/three75-shim": 103,
  14516. "./localization/localize": 108,
  14517. "./tag/tagManager": 124,
  14518. "./model/ModelManager": 140,
  14519. "./objects/Panorama": 148,
  14520. "./objects/Skybox": 152,
  14521. "./player": 155,
  14522. "./preloaders": 156,
  14523. "./scene/QuickstartManager": 157,
  14524. "./scene/SceneRenderer": 158,
  14525. "./sdk/automation.js": 164,
  14526. "./settings": 166,
  14527. "./showcase": 168,
  14528. "./tile/PanoRenderer": 169,
  14529. "./tile/QualityManager.js": 170,
  14530. "./tile/TileDownloader": 171,
  14531. "./util/PanoramaCollection": 178,
  14532. "./util/ajax": 181,
  14533. "./util/browser": 182,
  14534. "./util/camera": 183,
  14535. "./util/common": 185,
  14536. "./util/lerp": 188,
  14537. "./util/logger": 189,
  14538. "./util/math": 190,
  14539. "./util/sentry": 192,
  14540. "./util/showcase": 193,
  14541. "./util/transitions": 195,
  14542. events: 202,
  14543. "promise-polyfill": 213,
  14544. three: 217
  14545. }],
  14546. 117: [function(e, t, i) {
  14547. "use strict";
  14548. function n(e) {
  14549. e = e || {},
  14550. r.RawShaderMaterial.call(this, a.extendObject({
  14551. fragmentShader: o.cube.fragmentShader,
  14552. vertexShader: o.cube.vertexShader,
  14553. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14554. name: "CubemapMaterial"
  14555. }, e))
  14556. }
  14557. var r = e("three")
  14558. , o = e("../shaders")
  14559. , a = e("../util/common");
  14560. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  14561. n.prototype.constructor = n,
  14562. t.exports = n
  14563. }
  14564. , {
  14565. "../shaders": 167,
  14566. "../util/common": 185,
  14567. three: 217
  14568. }],
  14569. 118: [function(e, t, i) {
  14570. "use strict";
  14571. function n(e) {
  14572. e = e || {},
  14573. r.RawShaderMaterial.call(this, a.extendObject({
  14574. fragmentShader: o.model.fragmentShader,
  14575. vertexShader: o.model.vertexShader,
  14576. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14577. name: "ModelTextureMaterial"
  14578. }, e))
  14579. }
  14580. var r = e("three")
  14581. , o = e("../shaders")
  14582. , a = e("../util/common");
  14583. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  14584. n.prototype.constructor = n,
  14585. n.prototype.setProjectedPanos = function(e, t, i) {
  14586. i && (this.uniforms.progress.value = 0),
  14587. e.ensureSkyboxReadyForRender(),
  14588. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14589. this.uniforms.pano0Position.value.copy(e.position),
  14590. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14591. t.ensureSkyboxReadyForRender(),
  14592. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14593. this.uniforms.pano1Position.value.copy(t.position),
  14594. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14595. }
  14596. ,
  14597. t.exports = n
  14598. }
  14599. , {
  14600. "../shaders": 167,
  14601. "../util/common": 185,
  14602. three: 217
  14603. }],
  14604. 119: [function(e, t, i) {
  14605. (function(i) {
  14606. "use strict";
  14607. function n(e, t, i, n) {
  14608. this.div = null,
  14609. this.body = null,
  14610. this.label = e,
  14611. this.description = t,
  14612. this.parsedDescription = [],
  14613. this.media = i || {
  14614. type: null
  14615. },
  14616. this.loadingSpinner = null,
  14617. this.parser = new r({
  14618. supportLinks: !u.valueFromHash("mls"),
  14619. keepLinkLabels: !0
  14620. }),
  14621. this.state = I.CLOSED,
  14622. this.orientation = "",
  14623. this.initialTransform = "",
  14624. this.hovering = !1,
  14625. this.openTransition = null,
  14626. this.closeTransition = null,
  14627. this.openPromise = null,
  14628. this.closePromise = null,
  14629. this.animationTransition = null,
  14630. this.animationScale = 0
  14631. }
  14632. var r = e("../Parser/DescriptionParser")
  14633. , o = e("../Media/Link")
  14634. , a = e("../Media/Image")
  14635. , s = e("../Media/EmbedlyPlayer")
  14636. , l = e("../Media/EmbedlyEmbed")
  14637. , c = e("../../util/transitions")
  14638. , h = e("../../util/lerp")
  14639. , u = e("../../util/browser")
  14640. , d = e("./BillboardEvent")
  14641. , p = e("../Media/MediaEvent")
  14642. , f = e("../Parser/DescriptionChunkType")
  14643. , g = e("events").EventEmitter
  14644. , m = e("./billboardSettings")
  14645. , v = e("./overlaySettings")
  14646. , A = e("../../util/logger")
  14647. , y = new A(i)
  14648. , C = document.getElementById("tag-billboards");
  14649. C.addEventListener("touchend", function(e) {
  14650. C.style.pointerEvents = "none"
  14651. }),
  14652. C.addEventListener("touchcancel", function(e) {
  14653. C.style.pointerEvents = "none"
  14654. });
  14655. var I = {
  14656. CLOSED: "closed",
  14657. OPENING: "opening",
  14658. OPEN: "open",
  14659. CLOSING: "closing",
  14660. ACTIVE: "active"
  14661. };
  14662. n.prototype = Object.create(g.prototype),
  14663. n.prototype.build = function(e) {
  14664. this.parsedDescription = this.parser.parse(this.description);
  14665. var t = document.createElement("div");
  14666. t.className = "tag-container has-hotzone",
  14667. this.div = t,
  14668. this.body = document.createElement("div"),
  14669. this.body.className = "tag-body";
  14670. var i = document.createElement("div");
  14671. i.classList.add("tag-content");
  14672. var n = document.createElement("div");
  14673. n.classList.add("tag-text-content");
  14674. var r = document.createElement("div");
  14675. r.className = "tag-label",
  14676. r.textContent = this.label,
  14677. n.appendChild(r);
  14678. var o = document.createElement("div");
  14679. o.className = "tag-desc",
  14680. n.appendChild(o),
  14681. i.appendChild(n),
  14682. this.body.appendChild(i),
  14683. this.appendDescriptionElements(this.parsedDescription, o),
  14684. this.appendMedia(),
  14685. t.appendChild(this.body),
  14686. C.appendChild(t),
  14687. this.bindEvents(t, this.body)
  14688. }
  14689. ,
  14690. n.prototype.bindEvents = function(e, t) {
  14691. var i = function(e) {
  14692. return function(t) {
  14693. if (!this.div.classList.contains("overlay")) {
  14694. var i, n = document.getElementById("player");
  14695. try {
  14696. i = new MouseEvent(e,t)
  14697. } catch (n) {
  14698. i = document.createEvent("MouseEvents"),
  14699. 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)
  14700. }
  14701. n.dispatchEvent(i)
  14702. }
  14703. }
  14704. };
  14705. t.addEventListener("mousedown", function(e) {
  14706. e.stopPropagation()
  14707. }),
  14708. t.addEventListener("mouseup", function(e) {
  14709. e.stopPropagation()
  14710. }),
  14711. e.addEventListener("touchstart", function(e) {
  14712. C.style.pointerEvents = "auto"
  14713. }),
  14714. e.addEventListener("mousedown", i("mousedown").bind(this)),
  14715. e.addEventListener("mouseup", i("mouseup").bind(this)),
  14716. t.addEventListener("mouseover", function(t) {
  14717. this.state === I.OPEN && e.classList.remove("has-hotzone")
  14718. }
  14719. .bind(this)),
  14720. e.addEventListener("mouseenter", function(e) {
  14721. this.state !== I.CLOSING && (this.hovering = !0,
  14722. this.emit(d.ENTER))
  14723. }
  14724. .bind(this)),
  14725. e.addEventListener("mouseleave", function(e) {
  14726. this.hovering = !1,
  14727. this.emit(d.LEAVE)
  14728. }
  14729. .bind(this)),
  14730. e.addEventListener("gesturestart", function(e) {
  14731. e.preventDefault()
  14732. });
  14733. var n = e.querySelector(".tag-text-content")
  14734. , r = 0;
  14735. n.addEventListener("touchstart", function(e) {
  14736. r = e.changedTouches[0].clientY
  14737. }),
  14738. n.addEventListener("touchmove", function(t) {
  14739. function i(e) {
  14740. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight === 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  14741. }
  14742. return e.classList.contains("overlay") ? i(this.querySelector(".tag-desc")) : void i(this)
  14743. }),
  14744. e.addEventListener("touchmove", function(e) {
  14745. 0 === (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14746. })
  14747. }
  14748. ,
  14749. n.prototype.appendDescriptionElements = function(e, t) {
  14750. e.length > 0 && this.div.classList.add("has-text"),
  14751. e.forEach(function(e, i) {
  14752. switch (e.type) {
  14753. case f.TEXT:
  14754. t.appendChild(this.createTextElement(e.text));
  14755. break;
  14756. case f.LINK:
  14757. t.appendChild(this.createLinkElement(e.link))
  14758. }
  14759. }
  14760. .bind(this))
  14761. }
  14762. ,
  14763. n.prototype.appendLoadingSpinner = function() {
  14764. this.loadingSpinner = document.createElement("div"),
  14765. this.loadingSpinner.classList.add("loading-spinner");
  14766. var e = document.createElement("div");
  14767. e.classList.add("gui-spinner-icon"),
  14768. this.loadingSpinner.appendChild(e),
  14769. this.body.appendChild(this.loadingSpinner)
  14770. }
  14771. ,
  14772. n.prototype.onMediaLoadFinished = function() {
  14773. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  14774. this.applyOrientation(this.orientation),
  14775. this.loadingSpinner = null)
  14776. }
  14777. ,
  14778. n.prototype.appendMedia = function() {
  14779. if (this.media && this.media.type && "error" !== this.media.type && (!u.valueFromHash("mls", 0) || this.media.type === f.IMAGE)) {
  14780. this.appendLoadingSpinner();
  14781. var e = document.createElement("div");
  14782. e.classList.add("tag-media-content");
  14783. var t = document.createElement("i");
  14784. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  14785. t.classList.add(e)
  14786. }),
  14787. this.body.appendChild(t),
  14788. this.body.appendChild(e),
  14789. this.media.type) {
  14790. case f.IMAGE:
  14791. e.appendChild(this.createImageElement(this.media, this.body));
  14792. break;
  14793. case f.VIDEO:
  14794. e.appendChild(this.createVideoElement(this.media, this.body));
  14795. break;
  14796. case f.RICH:
  14797. e.appendChild(this.createEmbedElement(this.media, this.body))
  14798. }
  14799. }
  14800. }
  14801. ,
  14802. n.prototype.createTextElement = function(e) {
  14803. var t = document.createElement("span");
  14804. return t.textContent = e,
  14805. t
  14806. }
  14807. ;
  14808. n.prototype.createLinkElement = function(e) {
  14809. var t = new o(e);
  14810. return t.on(p.LINK_CLICK, this.emit.bind(this, p.LINK_CLICK)),
  14811. t.createDomElement()
  14812. }
  14813. ,
  14814. n.prototype.createImageElement = function(e, t) {
  14815. function i() {
  14816. function e() {
  14817. m || (r.classList.remove("view-image"),
  14818. c.classList.add("overlay"),
  14819. i(),
  14820. window.addEventListener("resize", b),
  14821. c.addEventListener("click", a),
  14822. g.addEventListener("click", l),
  14823. f.addEventListener("click", s),
  14824. m = !0,
  14825. o.emit(p.IMAGE_OPENED))
  14826. }
  14827. function i() {
  14828. t.classList.add("show-info"),
  14829. h.classList.remove("collapsible"),
  14830. h.style.height = "";
  14831. var e = parseFloat(getComputedStyle(I).lineHeight)
  14832. , i = y + e
  14833. , r = c.clientWidth - 2 * v.boundaryWidth - C
  14834. , a = c.clientHeight - 2 * v.boundaryHeight - C - i
  14835. , s = a
  14836. , l = s * n.aspect;
  14837. l > r && (l = r,
  14838. s = l / n.aspect),
  14839. s > a && (s = a,
  14840. l = s * n.aspect),
  14841. l += C,
  14842. s += C + i,
  14843. t.style.width = l + "px",
  14844. t.style.height = s + "px",
  14845. u.style.paddingTop = e + C + "px",
  14846. o.description.length > 0 && (h.classList.add("collapsible"),
  14847. h.style.height = h.clientHeight + 12 + "px",
  14848. E.style.height = "calc(100% - " + I.clientHeight + "px)")
  14849. }
  14850. function a(e) {
  14851. e.target === c && s()
  14852. }
  14853. function s() {
  14854. m && (m = !1,
  14855. r.classList.add("view-image"),
  14856. c.classList.remove("overlay"),
  14857. h.style.height = "",
  14858. u.style.paddingTop = "",
  14859. t.style.width = "",
  14860. t.style.height = "",
  14861. window.removeEventListener("resize", b),
  14862. c.removeEventListener("click", a),
  14863. g.removeEventListener("click", l),
  14864. f.removeEventListener("click", s),
  14865. o.emit(p.IMAGE_CLOSED),
  14866. o.close(!0))
  14867. }
  14868. function l(e) {
  14869. t.classList.toggle("show-info")
  14870. }
  14871. var c = o.div
  14872. , h = c.getElementsByClassName("tag-content")[0]
  14873. , u = c.getElementsByClassName("tag-media-content")[0]
  14874. , f = t.getElementsByClassName("close")[0]
  14875. , g = h.getElementsByClassName("tag-label")[0];
  14876. c.classList.add("has-image"),
  14877. r.classList.add("view-image"),
  14878. c.classList.add(n.aspect >= 1 ? "image-landscape" : "image-portrait"),
  14879. o.applyOrientation(o.orientation);
  14880. var m = !1
  14881. , A = getComputedStyle(h)
  14882. , y = parseFloat(A.paddingTop) + parseFloat(A.paddingBottom)
  14883. , C = 2 * parseFloat(getComputedStyle(u).paddingLeft)
  14884. , I = h.querySelector(".tag-label")
  14885. , E = h.querySelector(".tag-desc")
  14886. , b = function() {
  14887. var e, t, n = 0;
  14888. return function() {
  14889. clearInterval(e),
  14890. clearTimeout(t),
  14891. e = setInterval(function() {
  14892. var e = c.clientHeight;
  14893. n !== e && (i(),
  14894. n = e)
  14895. }, 100),
  14896. t = setTimeout(clearInterval.bind(this, e), 1e3)
  14897. }
  14898. }();
  14899. n.on(p.IMAGE_OPENING, e),
  14900. o.on(d.ACTIVATE, e),
  14901. o.on(p.IMAGE_CLOSED, n.onClosed.bind(n)),
  14902. o.on(d.CLOSING, s)
  14903. }
  14904. var n = new a
  14905. , r = n.createDomElement();
  14906. this.once(d.OPENED, function() {
  14907. n.load(e.src).then(i).catch(function(t) {
  14908. y.warn("Failed to load image:", e.src),
  14909. y.warn("with error:", t)
  14910. }).then(this.onMediaLoadFinished.bind(this))
  14911. });
  14912. var o = this;
  14913. return r
  14914. }
  14915. ,
  14916. n.prototype.createVideoElement = function(e, t) {
  14917. var i = new s({
  14918. autoPlay: !0,
  14919. autoResume: !0,
  14920. startMuted: !1,
  14921. loop: !1
  14922. })
  14923. , n = i.createDomElement();
  14924. return this.once(d.OPENED, function() {
  14925. i.load(e.src).then(function() {
  14926. this.div.classList.add("has-video"),
  14927. this.state !== I.OPEN && this.state !== I.ACTIVE || (i.show(),
  14928. i.play()),
  14929. this.on(d.OPENING, i.show.bind(i)),
  14930. this.on(d.OPENED, i.play.bind(i)),
  14931. this.on(d.CLOSING, i.pause.bind(i)),
  14932. this.on(d.CLOSED, i.hide.bind(i))
  14933. }
  14934. .bind(this)).catch(function(t) {
  14935. y.warn("Failed to embed video:", e.src),
  14936. y.warn("with error:", t)
  14937. }).then(this.onMediaLoadFinished.bind(this))
  14938. }
  14939. .bind(this)),
  14940. n
  14941. }
  14942. ,
  14943. n.prototype.createEmbedElement = function(e, t) {
  14944. var i = new l
  14945. , n = i.createDomElement();
  14946. return this.once(d.OPENED, function() {
  14947. i.load(e.src).then(function() {
  14948. this.div.classList.add("has-embed"),
  14949. this.state !== I.OPEN && this.state !== I.ACTIVE || i.show(),
  14950. this.applyOrientation(this.orientation),
  14951. this.on(d.OPENING, i.show.bind(i)),
  14952. this.on(d.CLOSED, i.hide.bind(i))
  14953. }
  14954. .bind(this)).catch(function(t) {
  14955. y.warn("Failed to embed:", e.src),
  14956. y.warn("with error:", t)
  14957. }).then(this.onMediaLoadFinished.bind(this))
  14958. }
  14959. .bind(this)),
  14960. n
  14961. }
  14962. ,
  14963. n.prototype.open = function(e) {
  14964. return this.openPromise = $.Deferred(),
  14965. this.state === I.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  14966. this.openTransition ? e && this.setActiveState() : this.openTransition = c.setTimeout(function() {
  14967. this.state !== I.OPEN && (this.emit(d.OPENING),
  14968. e && this.emit(d.ACTIVATING),
  14969. this.state = I.OPENING,
  14970. this.animateOpen(function() {
  14971. e && this.setActiveState(),
  14972. this.openPromise.resolve()
  14973. }
  14974. .bind(this)))
  14975. }
  14976. .bind(this), m.animation.openDelay),
  14977. c.cancel(this.closeTransition),
  14978. this.closePromise && this.closePromise.reject(),
  14979. this.closeTransition = void 0,
  14980. this.openPromise.promise())
  14981. }
  14982. ,
  14983. n.prototype.close = function(e) {
  14984. return this.closePromise = $.Deferred(),
  14985. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = c.setTimeout(function() {
  14986. this.state !== I.CLOSED && (this.emit(d.CLOSING),
  14987. this.state = I.CLOSING,
  14988. this.animateClose())
  14989. }
  14990. .bind(this), m.animation.closeDelay)),
  14991. c.cancel(this.openTransition),
  14992. this.openPromise && this.openPromise.reject(),
  14993. this.openTransition = void 0,
  14994. this.closePromise.resolve(),
  14995. this.closePromise.promise())
  14996. }
  14997. ,
  14998. n.prototype.setActiveState = function() {
  14999. this.state !== I.CLOSED && (this.state = I.ACTIVE,
  15000. this.emit(d.ACTIVATE),
  15001. this.div.classList.remove("has-hotzone"))
  15002. }
  15003. ,
  15004. n.prototype.animateOpen = function(e) {
  15005. if (this.state === I.OPENING) {
  15006. if (c.cancel(this.animationTransition),
  15007. u.detectSamsungNative())
  15008. return this.boardOrientation = null,
  15009. this.div.style.visibility = "visible",
  15010. this.emit(d.OPENED),
  15011. this.state = I.OPEN,
  15012. void (e && e());
  15013. this.div.style.webkitTransform = "scale(0)",
  15014. this.div.style.transform = "scale(0)",
  15015. this.div.style.visibility = "visible",
  15016. this.animationTransition = c.start(h.property(this, "animationScale", 1), m.animation.openDuration, function() {
  15017. this.emit(d.OPENED),
  15018. this.state = I.OPEN,
  15019. e && e()
  15020. }
  15021. .bind(this))
  15022. }
  15023. }
  15024. ,
  15025. n.prototype.animateClose = function(e) {
  15026. this.state === I.CLOSING && (c.cancel(this.animationTransition),
  15027. this.animationTransition = c.start(h.property(this, "animationScale", 0), m.animation.closeDuration, function() {
  15028. this.emit(d.CLOSED),
  15029. this.state = I.CLOSED,
  15030. this.div.style.visibility = "hidden",
  15031. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  15032. e && e()
  15033. }
  15034. .bind(this)))
  15035. }
  15036. ,
  15037. n.prototype.needsUpdate = function() {
  15038. return this.state !== I.CLOSED
  15039. }
  15040. ,
  15041. n.prototype.update = function(e, t) {
  15042. if (this.needsUpdate()) {
  15043. var i = (this.updateOrientation(e),
  15044. this.calcScale(t))
  15045. , n = {
  15046. x: (e.x + 1) * $("#player").width() / 2,
  15047. y: (e.y + 1) * $("#player").height() / 2
  15048. };
  15049. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  15050. this.div.style.webkitTransform = this.div.screenTransform,
  15051. this.div.style.transform = this.div.screenTransform
  15052. }
  15053. }
  15054. ,
  15055. n.prototype.getDimensions = function() {
  15056. return this.div.getBoundingClientRect()
  15057. }
  15058. ,
  15059. n.prototype.calcScale = function(e) {
  15060. return Math.sqrt(e / 40) * m.boardToDiscRatio
  15061. }
  15062. ,
  15063. n.prototype.updateOrientation = function(e) {
  15064. if (this.state !== I.ACTIVE) {
  15065. var t = 1 / 3
  15066. , i = e.y < -t ? 0 : e.y < t ? 1 : 2
  15067. , n = e.x < -t ? 0 : e.x < t ? 1 : 2
  15068. , r = "";
  15069. r += 0 === n ? "right" : 2 === n ? "left" : "",
  15070. r += 0 === i ? "-down" : 2 === i ? "-up" : "",
  15071. 1 === n && (r = 0 === i ? "bottom" : 2 === i ? "top" : "",
  15072. 1 === i && (r = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  15073. 1 === n && 1 === i && r === this.orientation || this.applyOrientation(r)
  15074. }
  15075. }
  15076. ,
  15077. n.prototype.applyOrientation = function(e) {
  15078. this.div.style.transform = this.div.style.webkitTransform = "",
  15079. this.div.classList.remove("tag-container-" + this.orientation),
  15080. this.div.classList.add("tag-container-" + e);
  15081. var t = window.getComputedStyle(this.div);
  15082. this.initialTransform = t.transform || t.webkitTransform,
  15083. "none" === this.initialTransform && (this.initialTransform = "");
  15084. var i = t.transform.slice(7, -1).split(",")
  15085. , n = -i[4]
  15086. , r = -i[5];
  15087. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  15088. this.div.style.transformOrigin = n + "px " + r + "px",
  15089. this.orientation = e
  15090. }
  15091. ,
  15092. t.exports = n
  15093. }
  15094. ).call(this, "/js/tag/Billboard/Billboard.js")
  15095. }
  15096. , {
  15097. "../../util/browser": 182,
  15098. "../../util/lerp": 188,
  15099. "../../util/logger": 189,
  15100. "../../util/transitions": 195,
  15101. "../Media/EmbedlyEmbed": 125,
  15102. "../Media/EmbedlyPlayer": 126,
  15103. "../Media/Image": 128,
  15104. "../Media/Link": 129,
  15105. "../Media/MediaEvent": 131,
  15106. "../Parser/DescriptionChunkType": 133,
  15107. "../Parser/DescriptionParser": 134,
  15108. "./BillboardEvent": 120,
  15109. "./billboardSettings": 121,
  15110. "./overlaySettings": 122,
  15111. events: 202
  15112. }],
  15113. 120: [function(e, t, i) {
  15114. "use strict";
  15115. t.exports = Object.freeze({
  15116. ENTER: "billboard.enter",
  15117. LEAVE: "billboard.leave",
  15118. OPENING: "billboard.opening",
  15119. OPENED: "billboard.open",
  15120. CLOSING: "billboard.closing",
  15121. CLOSED: "billboard.closed",
  15122. ACTIVATING: "billboard.activating",
  15123. ACTIVATE: "billboard.activate"
  15124. })
  15125. }
  15126. , {}],
  15127. 121: [function(e, t, i) {
  15128. "use strict";
  15129. t.exports = Object.freeze({
  15130. animation: Object.freeze({
  15131. hoverOnClosing: !1,
  15132. openDelay: 100,
  15133. closeDelay: 50,
  15134. openDuration: 200,
  15135. closeDuration: 100
  15136. }),
  15137. boardToDiscRatio: 1.2
  15138. })
  15139. }
  15140. , {}],
  15141. 122: [function(e, t, i) {
  15142. "use strict";
  15143. t.exports = Object.freeze({
  15144. boundaryWidth: 30,
  15145. boundaryHeight: 0
  15146. })
  15147. }
  15148. , {}],
  15149. "hot": [function(e, t, i) {//热点
  15150. "use strict";
  15151. function hot(sid,d,model){
  15152. this.sid = sid;
  15153. this.position = this.conversionArray(d.position);
  15154. this.rotation = this.conversionArray(d.rotation);
  15155. this.link = d.link;
  15156. this.model = model;
  15157. this.size = d.size;
  15158. this.build();
  15159. this.randomTime = new Date().getTime();
  15160. }
  15161. var r = e("three")
  15162. , f = e("../shaders")
  15163. , a = e("../settings")
  15164. , s = e("../enum/Viewmode")
  15165. , p = e("../objects/Panorama")
  15166. , te = e("../util/texture")
  15167. var raycaster = new r.Raycaster;
  15168. var geometry = new r.PlaneBufferGeometry( 0.2, 0.2,1,1);
  15169. var shaderMaterial = new r.ShaderMaterial( {
  15170. uniforms: f.hot.uniforms,
  15171. vertexShader: f.hot.vertexShader,
  15172. fragmentShader: f.hot.fragmentShader
  15173. });
  15174. shaderMaterial.transparent = true;
  15175. f.hot.uniforms.texture1.value = te.load(g_HotImage.point);
  15176. f.hot.uniforms.texture2.value = te.load(g_HotImage.point2);
  15177. //czj 判断是否是数组 如果不是将对象转换为数组
  15178. hot.prototype.conversionArray = function(obj){
  15179. if(Object.prototype.toString.call(obj)=='[object Array]') return obj;
  15180. var arr = []
  15181. for (var i in obj) {
  15182. arr.push(obj[i]); //属性
  15183. }
  15184. return arr
  15185. }
  15186. hot.prototype.build = function(){
  15187. var sprite = new r.Mesh( geometry, shaderMaterial );
  15188. sprite.dynamic = true;
  15189. sprite.position.copy(new r.Vector3().fromArray(this.position));
  15190. sprite.rotation.copy(new r.Euler().fromArray(this.rotation));
  15191. this.size && sprite.scale.set(this.size,this.size,this.size);
  15192. sprite.name = this.sid;
  15193. sprite.type = "hotSprite";
  15194. sprite.belongHot = this;
  15195. if(this.link) sprite.hotLink = this.link;
  15196. this.mesh = sprite;
  15197. this.model.add(sprite);
  15198. g_HotMeshes.push(sprite);
  15199. }
  15200. hot.prototype.closestPanoTowardTag = function(e, t) {
  15201. var i = []
  15202. , o = []
  15203. , l = this.mesh.position;
  15204. if (e === s.PANORAMA) {
  15205. var c = .5
  15206. , h = t.position.clone().sub(l).normalize();
  15207. i.push(p.filters.isPanoAligned()),
  15208. i.push(p.filters.inPanoDirection(l, h, c)),
  15209. i.push(p.filters.isNeighbourPanoTo(t)),
  15210. o.push(p.scoreFunctions.direction(l, h))
  15211. }
  15212. var u = new r.Vector3
  15213. , d = function(e) {
  15214. u.copy(l).sub(e.position);
  15215. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  15216. , i = a.tags.navigate.tiltTolerance;
  15217. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  15218. }
  15219. , f = function(e) {
  15220. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  15221. };
  15222. i.push(f, d),
  15223. o.push(p.scoreFunctions.distanceSquared(this.mesh, -2));
  15224. var g = t.model.panos.sortByScore(i, o);
  15225. if (g && a.tags.navigate.lineOfSight) {
  15226. for (var m = 0; m < g.length; m++) {
  15227. var v = g[m].pano
  15228. , A = v.position.distanceTo(l);
  15229. raycaster.set(v.position, l.clone().sub(v.position).normalize());
  15230. var y = raycaster.intersectObjects(t.model.colliders);
  15231. if (0 === y.length || y[0].distance > A)
  15232. return v
  15233. }
  15234. return null
  15235. }
  15236. return g && g.length > 0 && g[0].pano
  15237. },
  15238. hot.prototype.examine = function(e) {
  15239. var hotPop = document.getElementById('popup');
  15240. //获取那个热点的链接
  15241. if(this.link){
  15242. g_currentHot = this;
  15243. hotPop.style.display = "block";
  15244. hotPop.classList.add("wait");
  15245. var myElement = document.createElement("iframe");
  15246. //打开热点的时候把背景音乐关闭了,避免与热点里面的音乐冲突
  15247. g_bgAudio && g_bgAudio.pause();
  15248. //给热点后面加上随机数,让热点确保是最新的
  15249. var hotLink = this.link.substring(this.link.indexOf("html")+4);
  15250. hotLink.indexOf("?") == -1 ? myElement.src = this.link + "?time="+this.randomTime : myElement.src = this.link + "&time="+this.randomTime;
  15251. myElement.id = "id1";
  15252. myElement.allowTransparency = "true";
  15253. myElement.style.width = "100%";
  15254. myElement.style.height = "100%";
  15255. myElement.scrolling = "no";
  15256. var element=document.getElementById("id1"); //判断页面是否有iframe
  15257. if (typeof(element)== "undefined" || element == null){
  15258. document.getElementById("popup").appendChild(myElement);
  15259. }
  15260. //setTimeout(function(){$('#player').on("click",e.closePopup);},20)
  15261. }
  15262. var t = e.mode
  15263. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  15264. , n = this.mesh.position;
  15265. e.flyingToTag = true;
  15266. var o = function() {
  15267. e.flyingToTag = false;
  15268. if(this.link){
  15269. hotPop.classList.remove("wait");
  15270. }
  15271. }.bind(this);
  15272. if (t === s.PANORAMA){
  15273. var l = {
  15274. pano: i,
  15275. lookAtPoint: n,
  15276. duration: null,
  15277. maxDistanceOverride: null,
  15278. skipWarpingCheck: !1
  15279. };
  15280. e.flyToPano(l, o)
  15281. }else {
  15282. var c = {
  15283. pano: i
  15284. };
  15285. if (n) {
  15286. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  15287. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  15288. }
  15289. c.callback = o,
  15290. c.duration = 1500,
  15291. c.mode = s.PANORAMA,
  15292. e.flyToNewMode(c)
  15293. }
  15294. },
  15295. t.exports = hot;
  15296. }
  15297. , {
  15298. three: 217,
  15299. "../shaders":167,
  15300. "../enum/Viewmode":51,
  15301. "../objects/Panorama":148,
  15302. "../util/texture":194,
  15303. "../settings":166
  15304. }],
  15305. 123: [function(e, t, i) {//tag
  15306. (function(i) {
  15307. "use strict";
  15308. function n(e, t, i) {
  15309. var n = i.version || "0";
  15310. "0" !== n && I.info("tag defined using version " + n),
  15311. this.model = e,
  15312. this.sid = t,
  15313. this.color = (new r.Color).set(i.color || l.tagDefault),
  15314. this.hoverColor = l._darken(this.color, .2),
  15315. this.floor = null,
  15316. this.floorIndex = i.floor,
  15317. this.mode = s.PANORAMA,
  15318. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15319. this.obj3d = null,
  15320. this.disc = null,
  15321. this.materials = {
  15322. disc: null,
  15323. pole: null
  15324. },
  15325. this.position = (new r.Vector3).copy(i.position),
  15326. this.discPosition = (new r.Vector3).copy(i.stem.direction),
  15327. this.discWorldPosition = null,
  15328. this.discScale = .05,
  15329. this.poleEnabled = i.stem.enabled,
  15330. this.billboard = new o(i.label,i.description,i.media,this),
  15331. this.visibleTransition = null,
  15332. this.hoveringDisc = !1
  15333. }
  15334. var r = e("three")
  15335. , o = e("./Billboard/Billboard")
  15336. , a = e("../settings")
  15337. , s = e("../enum/Viewmode")
  15338. , l = e("../enum/Colors")
  15339. , c = e("../enum/RenderLayers")
  15340. , h = e("../enum/RenderOrder")
  15341. , u = (e("../util/common"),
  15342. e("../util/math"))
  15343. , d = e("../util/texture")
  15344. , p = e("../objects/Panorama")
  15345. , f = e("../shaders")
  15346. , g = e("../util/transitions")
  15347. , m = e("../util/lerp")
  15348. , v = e("../util/easing")
  15349. , A = e("./Billboard/BillboardEvent")
  15350. , y = e("events").EventEmitter
  15351. , C = e("../util/logger")
  15352. , I = new C(i)
  15353. , 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==")
  15354. , 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")
  15355. , w = new r.PlaneBufferGeometry(1,1);
  15356. n.prototype = Object.create(y.prototype),
  15357. n.raycaster = new r.Raycaster,
  15358. n.prototype.bindEvents = function() {
  15359. this.billboard.on(A.ENTER, this.setHoverState.bind(this)),
  15360. this.billboard.on(A.LEAVE, this.setFreeState.bind(this))
  15361. }
  15362. ,
  15363. n.prototype.build = function() {
  15364. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15365. this.floor && (this.billboard.build(this.model.sid),
  15366. this.obj3d = this.buildObject3D(),
  15367. this.floor.add(this.obj3d)),
  15368. this
  15369. }
  15370. ,
  15371. n.prototype.buildObject3D = function() {
  15372. var e = new r.Object3D;
  15373. e.position.copy(this.position);
  15374. var t = r.UniformsUtils.clone(f.tagDisc.uniforms);
  15375. t.bg.value = b,
  15376. t.mask.value = E,
  15377. t.color.value.copy(this.color),
  15378. this.materials.disc = new r.RawShaderMaterial({
  15379. transparent: !0,
  15380. vertexShader: f.tagDisc.vertexShader,
  15381. fragmentShader: f.tagDisc.fragmentShader,
  15382. uniforms: t
  15383. }),
  15384. this.disc = new r.Mesh(w,this.materials.disc),
  15385. this.disc.layers.set(c.TAG),
  15386. this.disc.position.copy(this.discPosition),
  15387. this.disc.renderOrder = h.tagDisc,
  15388. this.disc.tag = this;
  15389. var i = this.buildPole();
  15390. return i.layers.set(c.TAG),
  15391. i.renderOrder = h.tagStem,
  15392. e.add(i),
  15393. e.layers.set(c.TAG),
  15394. e.add(this.disc)
  15395. }
  15396. ,
  15397. n.prototype.buildPole = function() {
  15398. var e = new r.BufferGeometry
  15399. , t = new Float32Array(6);
  15400. return t[0] = t[1] = t[2] = 0,
  15401. t[3] = this.discPosition.x,
  15402. t[4] = this.discPosition.y,
  15403. t[5] = this.discPosition.z,
  15404. e.addAttribute("position", new r.BufferAttribute(t,3)),
  15405. this.materials.pole = new r.LineBasicMaterial({
  15406. linewidth: a.tags.pole.width,
  15407. color: a.tags.pole.color,
  15408. opacity: 0,
  15409. visible: this.poleEnabled,
  15410. transparent: !0,
  15411. depthWrite: !1
  15412. }),
  15413. new r.Line(e,this.materials.pole)
  15414. }
  15415. ,
  15416. n.prototype.setFreeState = function(e) {
  15417. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15418. this.materials.disc.uniforms.color.value = this.color
  15419. }
  15420. .bind(this))
  15421. }
  15422. ,
  15423. n.prototype.setHoverState = function(e) {
  15424. this.billboard.open(e),
  15425. this.materials.disc.uniforms.color.value = this.hoverColor
  15426. }
  15427. ,
  15428. n.prototype.hide = function(e, t) {
  15429. var i = $.Deferred();
  15430. if (0 === this.materials.disc.uniforms.opacity.value && !g.isRunning(this.visibleTransition))
  15431. return i.resolve().promise();
  15432. e = e || 0,
  15433. t = t || 0,
  15434. g.cancel(this.visibleTransition);
  15435. var n = this.materials.disc.uniforms.opacity.value / a.tags.disc.opacity
  15436. , r = t + e
  15437. , o = t / r;
  15438. return this.visibleTransition = g.start(function(e) {
  15439. var t = m.property(e.materials.disc.uniforms.opacity, "value", 0)
  15440. , i = m.property(e.materials.pole, "opacity", 0);
  15441. return function(n) {
  15442. t(n),
  15443. e.materials.pole && i(n)
  15444. }
  15445. }(this), r * n, function() {
  15446. i.resolve()
  15447. }, o, v[a.warp.blendEasing]),
  15448. i.promise()
  15449. }
  15450. ,
  15451. n.prototype.show = function(e, t) {
  15452. var i = $.Deferred();
  15453. if (this.materials.disc.uniforms.opacity.value === a.tags.disc.opacity && !g.isRunning(this.visibleTransition))
  15454. return i.resolve().promise();
  15455. e = e || 0,
  15456. t = t || 0,
  15457. g.cancel(this.visibleTransition);
  15458. var n = (a.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / a.tags.disc.opacity
  15459. , r = t + e
  15460. , o = t / r;
  15461. return this.visibleTransition = g.start(function(e) {
  15462. var t = m.property(e.materials.disc.uniforms.opacity, "value", a.tags.disc.opacity)
  15463. , i = m.property(e.materials.pole, "opacity", a.tags.pole.opacity);
  15464. return function(n) {
  15465. t(n),
  15466. e.materials.pole && i(n)
  15467. }
  15468. }(this), r * n, function() {
  15469. i.resolve()
  15470. }, o, v[a.warp.blendEasing]),
  15471. i.promise()
  15472. }
  15473. ,
  15474. n.prototype.closestPanoTowardTag = function(e, t) {
  15475. var i = []
  15476. , o = []
  15477. , l = this.disc.getWorldPosition();
  15478. if (e === s.PANORAMA) {
  15479. var c = .5
  15480. , h = t.position.clone().sub(l).normalize();
  15481. i.push(p.filters.isPanoAligned()),
  15482. i.push(p.filters.inPanoDirection(l, h, c)),
  15483. i.push(p.filters.isNeighbourPanoTo(t)),
  15484. o.push(p.scoreFunctions.direction(l, h))
  15485. }
  15486. var u = new r.Vector3
  15487. , d = function(e) {
  15488. u.copy(l).sub(e.position);
  15489. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  15490. , i = a.tags.navigate.tiltTolerance;
  15491. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  15492. }
  15493. , f = function(e) {
  15494. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  15495. };
  15496. i.push(f, d),
  15497. o.push(p.scoreFunctions.distanceSquared(this, -2));
  15498. var g = this.model.panos.sortByScore(i, o);
  15499. if (a.tags.navigate.lineOfSight) {
  15500. for (var m = 0; m < g.length; m++) {
  15501. var v = g[m].pano
  15502. , A = v.position.distanceTo(l);
  15503. if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance)
  15504. return null;
  15505. n.raycaster.set(v.position, l.clone().sub(v.position).normalize());
  15506. var y = n.raycaster.intersectObjects(this.model.colliders);
  15507. if (0 === y.length || y[0].distance > A)
  15508. return v
  15509. }
  15510. return null
  15511. }
  15512. return g.length > 0 && g[0].pano
  15513. }
  15514. ,
  15515. n.prototype.examine = function(e) {
  15516. var t = e.mode
  15517. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  15518. , n = this.disc.getWorldPosition();
  15519. this.billboard.setActiveState();
  15520. var o = function() {
  15521. var t = this.billboard.getDimensions()
  15522. , n = new r.Vector3;
  15523. u.convertScreenPositionToNDC(t.left + t.width / 2, t.top + t.height / 2, n),
  15524. n.unproject(e.camera),
  15525. e.flyToPano({
  15526. pano: i,
  15527. lookAtPoint: n
  15528. })
  15529. }
  15530. .bind(this);
  15531. if (t === s.PANORAMA)
  15532. if (i !== e.currentPano) {
  15533. var l = {
  15534. pano: i,
  15535. lookAtPoint: n,
  15536. duration: null,
  15537. maxDistanceOverride: null,
  15538. skipWarpingCheck: !1
  15539. };
  15540. e.flyToPano(l, o)
  15541. } else
  15542. setTimeout(function() {
  15543. this.billboard.open().then(function() {
  15544. o()
  15545. })
  15546. }
  15547. .bind(this), 0);
  15548. else {
  15549. var c = {
  15550. pano: i
  15551. };
  15552. if (n) {
  15553. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  15554. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  15555. }
  15556. c.callback = o,
  15557. c.duration = 1500,
  15558. c.mode = s.PANORAMA,
  15559. e.flyToNewMode(c)
  15560. }
  15561. }
  15562. ,
  15563. n.prototype.update = function(e, t) {
  15564. var i = new r.Vector3;
  15565. return function(e, t) {
  15566. this.discWorldPosition = this.disc.getWorldPosition(),
  15567. this.updateDisc(e, t),
  15568. this.billboard.needsUpdate() && (i.copy(this.discWorldPosition).project(t),
  15569. i.z < 1 && (i.y *= -1,
  15570. this.billboard.update(i, this.getDiscRadius(i, t))))
  15571. }
  15572. }(),
  15573. n.prototype.updateDisc = function(e, t) {
  15574. var i = new r.Vector3
  15575. , o = new r.Vector3
  15576. , l = new r.Vector3
  15577. , c = new r.Vector3
  15578. , h = new r.Vector3;
  15579. return function(e, t) {
  15580. var u = a.tags.visibility
  15581. , d = a.tags.disc.scale
  15582. , p = e === s.DOLLHOUSE || e === s.FLOORPLAN ? a.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15583. 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)),
  15584. this.obj3d.visible) {
  15585. this.disc.quaternion.copy(t.quaternion);
  15586. var f = d.maxSize - (d.maxSize - d.minSize) * r.Math.smoothstep(p, d.nearBound, d.farBound);
  15587. i.copy(this.discWorldPosition).project(t),
  15588. o.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(i),
  15589. l.set(f / 2, 0, 0).add(o),
  15590. c.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(l),
  15591. h.copy(c).unproject(t);
  15592. var g = h.distanceTo(this.discWorldPosition)
  15593. , m = 1 + a.tags.disc.scale.responsiveness / 100 * (n.viewportScale() - 1);
  15594. this.discScale = g * m,
  15595. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15596. }
  15597. }
  15598. }(),
  15599. n.prototype.getDiscRadius = function(e, t) {
  15600. var i = new r.Vector3;
  15601. return function(e, t) {
  15602. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15603. Math.abs(e.x - i.x) * $("#player").width()
  15604. }
  15605. }(),
  15606. n.prototype.tagVisibleOnCurrentFloor = function(e) {
  15607. return !(e === s.DOLLHOUSE || e === s.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15608. }
  15609. ,
  15610. n.prototype.offScreen = function(e, t) {
  15611. var i = e.getWorldPosition().project(t);
  15612. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15613. }
  15614. ,
  15615. n.viewportScale = function() {
  15616. return n.viewportWidth === $("#player").width() && n.viewportHeight === $("#player").height() || (n.viewportWidth = $("#player").width(),
  15617. n.viewportHeight = $("#player").height(),
  15618. n.currentViewportScale = Math.sqrt(Math.min(n.viewportWidth, n.viewportHeight) / a.tags.disc.scale.baseViewportSize)),
  15619. n.currentViewportScale
  15620. }
  15621. ,
  15622. t.exports = n
  15623. }
  15624. ).call(this, "/js/tag/tag.js")
  15625. }
  15626. , {
  15627. "../enum/Colors": 19,
  15628. "../enum/RenderLayers": 41,
  15629. "../enum/RenderOrder": 42,
  15630. "../enum/Viewmode": 51,
  15631. "../objects/Panorama": 148,
  15632. "../settings": 166,
  15633. "../shaders": 167,
  15634. "../util/common": 185,
  15635. "../util/easing": 186,
  15636. "../util/lerp": 188,
  15637. "../util/logger": 189,
  15638. "../util/math": 190,
  15639. "../util/texture": 194,
  15640. "../util/transitions": 195,
  15641. "./Billboard/Billboard": 119,
  15642. "./Billboard/BillboardEvent": 120,
  15643. events: 202,
  15644. three: 217
  15645. }],
  15646. 124: [function(e, t, i) {
  15647. (function(i) {
  15648. "use strict";
  15649. function n() {
  15650. this.tagState = y.IDLE,
  15651. this.intersectTag = null,
  15652. this.hoveredTag = null,
  15653. this.activeTag = null,
  15654. this.tagDiscs = [],
  15655. this.raycaster = new r.Raycaster,
  15656. this.modelManager = null,
  15657. this.player = null,
  15658. this.totaltags = 0,
  15659. this.navigatingViaTag = !1,
  15660. this.enabled = !1
  15661. }
  15662. var r = e("three")
  15663. , o = e("../util/logger")
  15664. , a = e("../util/common")
  15665. , s = e("../controls/serializer")
  15666. , l = e("../objects/Snapshot")
  15667. , c = e("../settings")
  15668. , h = e("./Billboard/BillboardEvent")
  15669. , u = e("./Media/MediaEvent")
  15670. , d = e("./Media/LinkType")
  15671. , p = e("../enum/Viewmode")
  15672. , f = e("../enum/WarpStyle")
  15673. , g = e("../enum/BlackoutStyle")
  15674. , m = e("../enum/ModelManagerEvents")
  15675. , v = e("../enum/tagEvents")
  15676. , A = e("../enum/PlayerEvents")
  15677. , y = (e("../util/lerp"),
  15678. e("../enum/TagStates"))
  15679. , C = e("events").EventEmitter
  15680. , I = new o(i);
  15681. a.extend(n, C),
  15682. n.prototype.init = function(e, t) {
  15683. this.modelManager = e,
  15684. this.player = t,
  15685. this.updateModel(),
  15686. this.bindEvents()
  15687. }
  15688. ,
  15689. n.prototype.update = function(e) {
  15690. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15691. }
  15692. ,
  15693. n.prototype.updateTags = function(e, t, i, n) {
  15694. for (var r in this.model.tags)
  15695. this.model.tags[r].update(e, t, i, n)
  15696. }
  15697. ,
  15698. n.prototype.updateModel = function() {
  15699. this.model = this.modelManager.getActiveModel(),
  15700. this.gettagsFromModel(),
  15701. this.totaltags = Object.keys(this.model.tags).length
  15702. }
  15703. ,
  15704. n.prototype.gettagsFromModel = function() {
  15705. this.tagDiscs = [];
  15706. for (var e in this.model.tags) {
  15707. var t = this.model.tags[e].disc;
  15708. t && this.tagDiscs.push(t)
  15709. }
  15710. }
  15711. ,
  15712. n.prototype.bindEvents = function() {
  15713. function e() {
  15714. Object.keys(this.model.tags).forEach(function(e) {
  15715. var t = this.model.tags[e];
  15716. t.bindEvents(),
  15717. t.billboard.on(u.LINK_CLICK, function(e) {
  15718. e.type === d.NAVIGATION && this.navigateViaLink(e.url)
  15719. }
  15720. .bind(this)),
  15721. t.billboard.on(u.IMAGE_OPENED, function() {
  15722. this.tagState = y.EXAMINE,
  15723. this.emit(u.IMAGE_OPENED)
  15724. }
  15725. .bind(this)),
  15726. t.billboard.on(h.CLOSING, this.dismissExaminedTag.bind(this))
  15727. }
  15728. .bind(this))
  15729. }
  15730. this.modelManager.on(m.ActiveModelChanged, this.updateModel.bind(this)),
  15731. this.modelManager.on(m.ActiveModelChanged, e.bind(this)),
  15732. this.player.on(A.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15733. this.player.on(A.PanoChosen, this.onPanoChange.bind(this)),
  15734. this.player.on(A.Ready, this.onPlayerReady.bind(this)),
  15735. this.player.on(A.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15736. this.player.on(A.WarpStarted, this.handleWarpStart.bind(this)),
  15737. this.player.on(A.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15738. e.call(this)
  15739. }
  15740. ,
  15741. n.prototype.navigateViaLink = function(e) {
  15742. var t = s.deserialize(e);
  15743. if (t)
  15744. if (t.mode === p.PANORAMA) {
  15745. try {
  15746. this.player.model.panos.get(t.panoId)
  15747. } catch (e) {
  15748. return void I.warn("Unable to find panorama location", t.panoId)
  15749. }
  15750. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, f.BLACK)
  15751. } else {
  15752. var i = {
  15753. cameraMode: t.mode,
  15754. position: t.position,
  15755. quaternion: t.quaternion,
  15756. scanId: t.panoId,
  15757. orthoZoom: t.zoom,
  15758. floorVisibility: t.floorVisibility,
  15759. thumbUrl: null,
  15760. name: null
  15761. };
  15762. this.player.flyToNewMode({
  15763. mode: t.mode,
  15764. duration: c.warp.outsideTime,
  15765. warpDest: new l(i),
  15766. force: !0
  15767. })
  15768. }
  15769. }
  15770. ,
  15771. n.prototype.handleWarpStart = function(e, t, i, n) {
  15772. this.dismissExaminedTag(),
  15773. t === f.BLACK && (null !== n && void 0 !== n || (n = c.warp.teleportTime),
  15774. e && (i = g.END),
  15775. this.hideShowTagsForBlackoutStyle(i, n))
  15776. }
  15777. ,
  15778. n.prototype.handleWarpInterruption = function(e, t, i) {
  15779. null !== i && void 0 !== i || (i = c.warp.teleportTime),
  15780. this.hideShowTagsForBlackoutStyle(t, i)
  15781. }
  15782. ,
  15783. n.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15784. var i = 0
  15785. , n = 0
  15786. , r = t / 2;
  15787. switch (null !== e && void 0 !== e || (e = g.MIDDLE),
  15788. e) {
  15789. case g.END:
  15790. this.hideAlltags(r);
  15791. break;
  15792. case g.BEGINNING:
  15793. this.hideAlltags().done(this.showAlltags.bind(this, r));
  15794. break;
  15795. case g.NONE:
  15796. break;
  15797. case g.MIDDLE:
  15798. i = r,
  15799. n = r,
  15800. this.hideAlltags(n),
  15801. setTimeout(function() {
  15802. this.showAlltags(i)
  15803. }
  15804. .bind(this), n);
  15805. break;
  15806. case g.FADEIN:
  15807. setTimeout(function() {
  15808. this.showAlltags(r)
  15809. }
  15810. .bind(this), r)
  15811. }
  15812. }
  15813. ,
  15814. n.prototype.onPlayerModeChanging = function(e, t) {
  15815. t !== p.PANORAMA && this.dismissExaminedTag(),
  15816. t === p.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = p.OUTDOOR);
  15817. var i = t !== p.OUTDOOR;
  15818. i !== this.model.tagsShown && (i ? this.showAlltags(c.tags.startup.fadeInDuration) : this.hideAlltags(c.tags.startup.fadeInDuration))
  15819. }
  15820. ,
  15821. n.prototype.onPanoChange = function(e, t) {
  15822. var i = this.navigatingViaTag;
  15823. if (this.navigatingViaTag = !1,
  15824. !i) {
  15825. this.dismissExaminedTag();
  15826. var n = e && !e.isAligned() ? p.OUTDOOR : p.PANORAMA
  15827. , r = t && !t.isAligned() ? p.OUTDOOR : p.PANORAMA;
  15828. n !== r && (r === p.PANORAMA ? this.showAlltags(c.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(c.tags.startup.fadeInDuration))
  15829. }
  15830. }
  15831. ,
  15832. n.prototype.onPlayerReady = function(e, t, i) {
  15833. this.startAlltags(e, t ? i : null)
  15834. }
  15835. ,
  15836. n.prototype.onPlayerFlyingEnded = function(e, t) {
  15837. this.updateClosestTags(e)
  15838. }
  15839. ,
  15840. n.prototype.dismissExaminedTag = function() {
  15841. this.activeTag && this.tagState === y.EXAMINE && this.dismissActiveTag(),
  15842. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  15843. this.hoveredTag = null)
  15844. }
  15845. ,
  15846. n.prototype.startAlltags = function(e, t) {
  15847. this.model.shouldShowtags = c.tags.enabled,
  15848. this.enabled = !0,
  15849. e || (this.showAlltags(c.tags.startup.fadeInDuration, c.tags.startup.fadeInDelay),
  15850. t && setTimeout(function() {
  15851. this.activateTag(this.model.getTagBySid(t))
  15852. }
  15853. .bind(this), c.tags.startup.fadeInDuration / 2))
  15854. }
  15855. ,
  15856. n.prototype.showAlltags = function(e, t, i) {
  15857. function n() {
  15858. o++,
  15859. o === this.totaltags && (this.model.tagsShown = !0,
  15860. r.resolve())
  15861. }
  15862. var r = $.Deferred();
  15863. if (!i && this.player.mode === p.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  15864. return r.resolve().promise();
  15865. var o = 0;
  15866. for (var a in this.model.tags) {
  15867. var s = this.model.tags[a];
  15868. s.show(e, t).done(n.bind(this))
  15869. }
  15870. return r.promise()
  15871. }
  15872. ,
  15873. n.prototype.hideAlltags = function(e, t) {
  15874. function i() {
  15875. r++,
  15876. r === this.totaltags && (this.model.tagsShown = !1,
  15877. n.resolve())
  15878. }
  15879. var n = $.Deferred()
  15880. , r = 0;
  15881. for (var o in this.model.tags) {
  15882. var a = this.model.tags[o];
  15883. a.hide(e, t).done(i.bind(this)),
  15884. a === this.activeTag && this.dismissActiveTag()
  15885. }
  15886. return n.promise()
  15887. }
  15888. ,
  15889. n.prototype.enableHovering = function() {
  15890. this.enabled = !0
  15891. }
  15892. ,
  15893. n.prototype.disableHovering = function() {
  15894. this.enabled = !1
  15895. }
  15896. ,
  15897. n.prototype.activateTag = function(e, t) {
  15898. t = t || y.EXAMINE,
  15899. this.activeTag = e,
  15900. this.activeTag.hoveringDisc = !0,
  15901. this.activeTag.setHoverState(t === y.EXAMINE),
  15902. this.tagState = t,
  15903. this.emit(v.TagActivated, e)
  15904. }
  15905. ,
  15906. n.prototype.dismissActiveTag = function() {
  15907. this.activeTag.hoveringDisc = !1,
  15908. this.activeTag.setFreeState(!0);
  15909. var e = this.activeTag;
  15910. this.activeTag = null,
  15911. this.tagState = y.IDLE,
  15912. this.emit(v.TagDismissed, e)
  15913. }
  15914. ,
  15915. n.prototype.clickedOnTag = function(e) {
  15916. var t = function() {
  15917. this.navigatingViaTag = !0,
  15918. this.activeTag.examine(this.player),
  15919. this.emit(v.TagNavigation, this.activeTag)
  15920. }
  15921. .bind(this);
  15922. return this.tagState !== y.EXAMINE ? (this.activateTag(this.intersectTag, y.EXAMINE),
  15923. this.activeTag = this.intersectTag,
  15924. t(),
  15925. !0) : (this.dismissActiveTag(),
  15926. !1)
  15927. }
  15928. ,
  15929. n.prototype.intersecttag = function() {
  15930. var e = new r.Vector3
  15931. , t = new r.Vector3
  15932. , i = new r.Vector3;
  15933. return function(n, r, o) {
  15934. if (!this.enabled)
  15935. return null;
  15936. var a = null
  15937. , s = this.tagDiscs.filter(function(e) {
  15938. return e.parent.visible
  15939. });
  15940. if (s.length > 0) {
  15941. var l = this.model.floors.reduce(function(e, t) {
  15942. return t.hidden ? e : e.concat(t.collider.children)
  15943. }, s);
  15944. e.set(n.x, n.y, -1).unproject(o),
  15945. t.set(n.x, n.y, 1).unproject(o),
  15946. i.copy(t).sub(e).normalize(),
  15947. this.raycaster.set(e, i);
  15948. var c = this.raycaster.intersectObjects(l);
  15949. c.length > 0 && s.indexOf(c[0].object) !== -1 && (a = c[0].object.tag)
  15950. }
  15951. return this.intersectTag = a,
  15952. r && (this.activeTag && a !== this.activeTag && (this.tagState === y.BROWSE || this.tagState === y.EXAMINE && a) && this.dismissActiveTag(),
  15953. a && a !== this.activeTag && (a.listeners(h.ENTER).length < 1 && (a.billboard.on(h.ENTER, function() {
  15954. this.hoveredTag = a
  15955. }
  15956. .bind(this)),
  15957. a.billboard.on(h.LEAVE, function() {
  15958. this.hoveredTag = null
  15959. }
  15960. .bind(this))),
  15961. this.activateTag(a, y.BROWSE))),
  15962. a
  15963. }
  15964. }(),
  15965. n.prototype.rankedtagInDirection = function() {
  15966. var e = []
  15967. , t = []
  15968. , i = new r.Vector3
  15969. , n = new r.Vector3
  15970. , o = new r.Vector3;
  15971. return function(r, a, s, l) {
  15972. var c = 0;
  15973. t.length = 0;
  15974. for (var h = 0; h < this.closesttags.length; h++) {
  15975. var u = this.closesttags[h];
  15976. n.copy(u.position),
  15977. n.add(u.discPosition),
  15978. i.copy(a),
  15979. i.sub(n).negate(),
  15980. i.normalize();
  15981. var d = i.dot(l);
  15982. if (d >= 0) {
  15983. o.copy(n),
  15984. o.project(s);
  15985. var p = this.intersecttag(o, !1, s);
  15986. if (p) {
  15987. if (c >= e.length)
  15988. for (var f = 0; f < 64; f++)
  15989. e.push({
  15990. tag: u,
  15991. dot: d
  15992. });
  15993. var g = e[c];
  15994. g.tag = u,
  15995. g.dot = d,
  15996. g.position = math.projectPositionToCanvas(n, s),
  15997. t.push(g),
  15998. c++
  15999. }
  16000. }
  16001. }
  16002. return t.sort(function(e, t) {
  16003. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  16004. }),
  16005. r < t.length ? t[r].tag : null
  16006. }
  16007. }(),
  16008. n.prototype.updateClosestTags = function() {
  16009. var e = new r.Vector3
  16010. , t = 30;
  16011. return function(i) {
  16012. this.closesttags || (this.closesttags = []),
  16013. this.closesttags.length = 0;
  16014. var n = this.model.tags;
  16015. if (n)
  16016. for (var r in n)
  16017. if (n.hasOwnProperty(r)) {
  16018. var o = n[r]
  16019. , a = o.position;
  16020. e.copy(i),
  16021. e.sub(a).negate();
  16022. var s = e.lengthSq();
  16023. s < t && this.closesttags.push(o)
  16024. }
  16025. }
  16026. }(),
  16027. t.exports = n
  16028. }
  16029. ).call(this, "/js/tag/tagManager.js")
  16030. }
  16031. , {
  16032. "../controls/serializer": 14,
  16033. "../enum/BlackoutStyle": 18,
  16034. "../enum/tagEvents": 32,
  16035. "../enum/ModelManagerEvents": 33,
  16036. "../enum/PlayerEvents": 40,
  16037. "../enum/TagStates": 44,
  16038. "../enum/Viewmode": 51,
  16039. "../enum/WarpStyle": 52,
  16040. "../objects/Snapshot": 153,
  16041. "../settings": 166,
  16042. "../util/common": 185,
  16043. "../util/lerp": 188,
  16044. "../util/logger": 189,
  16045. "./Billboard/BillboardEvent": 120,
  16046. "./Media/LinkType": 130,
  16047. "./Media/MediaEvent": 131,
  16048. events: 202,
  16049. three: 217
  16050. }],
  16051. 125: [function(e, t, i) {
  16052. (function(i) {
  16053. "use strict";
  16054. function n() {
  16055. this.embedWrapper = null,
  16056. this.embedElement = null
  16057. }
  16058. var r = e("../../util/ajax")
  16059. , o = e("./mediaSettings")
  16060. , a = e("../../settings")
  16061. , s = e("../../util/logger")
  16062. , l = new s(i);
  16063. n.prototype.createDomElement = function() {
  16064. return this.embedWrapper = document.createElement("div"),
  16065. this.embedWrapper.classList.add("tag-embed"),
  16066. this.embedWrapper.classList.add("hidden"),
  16067. this.embedWrapper
  16068. }
  16069. ,
  16070. n.prototype.load = function(e) {
  16071. var t = "https://api.embedly.com/1/oembed?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + o.maxEmbedWidth;
  16072. return new Promise(function(e, i) {
  16073. r.get(t).then(function(t) {
  16074. if (t = JSON.parse(t),
  16075. t.html && t.html.indexOf("<script") === -1) {
  16076. this.embedWrapper.innerHTML = t.html;
  16077. var n = Math.min(t.width, o.maxEmbedWidth) || o.maxEmbedWidth;
  16078. if (this.embedWrapper.style.width = n + "px",
  16079. t.height) {
  16080. var r = t.height / t.width;
  16081. this.embedWrapper.style.height = n * r + "px"
  16082. }
  16083. this.embedElement = this.embedWrapper.firstChild;
  16084. var a = [];
  16085. try {
  16086. a = [].slice.call(this.embedElement.querySelectorAll("a"))
  16087. } catch (e) {
  16088. l.debug("Error getting `a` elements for embed; was it an iframe?")
  16089. }
  16090. a.forEach(function(e) {
  16091. e.setAttribute("target", "_blank")
  16092. }),
  16093. this.embedElement.classList.add("hidden"),
  16094. this.embedWrapper.classList.remove("hidden"),
  16095. e()
  16096. } else
  16097. i("Not a valid embed")
  16098. }
  16099. .bind(this), function(e) {
  16100. i(e.response)
  16101. })
  16102. }
  16103. .bind(this))
  16104. }
  16105. ,
  16106. n.prototype.show = function() {
  16107. this.embedElement && this.embedElement.classList.remove("hidden")
  16108. }
  16109. ,
  16110. n.prototype.hide = function() {
  16111. this.embedElement && this.embedElement.classList.add("hidden")
  16112. }
  16113. ,
  16114. t.exports = n
  16115. }
  16116. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  16117. }
  16118. , {
  16119. "../../settings": 166,
  16120. "../../util/ajax": 181,
  16121. "../../util/logger": 189,
  16122. "./mediaSettings": 132
  16123. }],
  16124. 126: [function(e, t, i) {
  16125. (function(i) {
  16126. "use strict";
  16127. function n(e) {
  16128. o.call(this),
  16129. this.options = e,
  16130. this.playerControls = null,
  16131. this.state = s.NOT_READY
  16132. }
  16133. var r = e("../../util/browser")
  16134. , o = e("./EmbedlyEmbed")
  16135. , a = e("../../util/logger")
  16136. , s = (new a(i),
  16137. Object.freeze({
  16138. NOT_READY: "player.not.ready",
  16139. CUED: "player.cued",
  16140. PLAYING: "player.playing",
  16141. PAUSED: "player.paused"
  16142. }));
  16143. n.prototype = Object.create(o.prototype),
  16144. n.prototype.createDomElement = function() {
  16145. return this.embedWrapper = document.createElement("div"),
  16146. this.embedWrapper.classList.add("tag-video"),
  16147. this.embedWrapper.classList.add("hidden"),
  16148. this.embedWrapper
  16149. }
  16150. ,
  16151. n.prototype.load = function(e) {
  16152. var t = function() {
  16153. function e(e) {
  16154. this.playerState = s.CUED,
  16155. this.options.startMuted && this.playerControls.mute()
  16156. }
  16157. function t(e) {
  16158. this.playerState = e
  16159. }
  16160. function i(e) {
  16161. this.playerControls.setCurrentTime(0),
  16162. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  16163. }
  16164. this.playerControls = new playerjs.Player(this.embedElement),
  16165. this.playerControls.on("ready", e.bind(this)),
  16166. this.playerControls.on("play", t.bind(this, s.PLAYING)),
  16167. this.playerControls.on("pause", t.bind(this, s.PAUSED)),
  16168. this.playerControls.on("ended", i.bind(this))
  16169. }
  16170. .bind(this);
  16171. return o.prototype.load.call(this, e).then(t.bind(this))
  16172. }
  16173. ,
  16174. n.prototype.play = function() {
  16175. var e = r.isMobile();
  16176. return function() {
  16177. this.playerState !== s.NOT_READY && this.playerControls && !e && (this.state === s.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  16178. }
  16179. }(),
  16180. n.prototype.pause = function() {
  16181. this.playerState !== s.NOT_READY && this.playerControls && this.playerControls.pause()
  16182. }
  16183. ,
  16184. t.exports = n
  16185. }
  16186. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  16187. }
  16188. , {
  16189. "../../util/browser": 182,
  16190. "../../util/logger": 189,
  16191. "./EmbedlyEmbed": 125
  16192. }],
  16193. 127: [function(e, t, i) {
  16194. (function(i) {
  16195. "use strict";
  16196. function n(e) {
  16197. function t() {
  16198. return a.debug("requesting file from embedly:", e.href),
  16199. r.get(e.href, {
  16200. responseType: e.responseType
  16201. }).then(function(t) {
  16202. return a.debug("requesting file finished:", e.href),
  16203. t
  16204. })
  16205. }
  16206. function i() {}
  16207. return s = new Promise(function(e, n) {
  16208. s.catch(i).then(function() {
  16209. t().then(e, n)
  16210. })
  16211. }
  16212. )
  16213. }
  16214. var r = e("../../util/ajax")
  16215. , o = (e("./mediaSettings"),
  16216. e("../../util/logger"))
  16217. , a = new o(i)
  16218. , s = Promise.resolve();
  16219. t.exports.enqueue = n
  16220. }
  16221. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  16222. }
  16223. , {
  16224. "../../util/ajax": 181,
  16225. "../../util/logger": 189,
  16226. "./mediaSettings": 132
  16227. }],
  16228. 128: [function(e, t, i) {
  16229. (function(i) {
  16230. "use strict";
  16231. function n() {
  16232. this.imageWrapper = null,
  16233. this.width = 0,
  16234. this.height = 0,
  16235. this.aspect = 1
  16236. }
  16237. var r = e("./MediaEvent")
  16238. , o = e("./EmbedlyQueue")
  16239. , a = e("events").EventEmitter
  16240. , s = e("../../util/logger")
  16241. , l = e("../../settings");
  16242. new s(i);
  16243. n.prototype = Object.create(a.prototype),
  16244. n.prototype.createDomElement = function() {
  16245. return this.imageWrapper = document.createElement("div"),
  16246. this.imageWrapper.classList.add("tag-image"),
  16247. this.imageWrapper.classList.add("hidden"),
  16248. this.imageWrapper.addEventListener("click", function(e) {
  16249. e.stopPropagation(),
  16250. this.emit(r.IMAGE_OPENING),
  16251. this.imageWrapper.style.pointerEvents = "none"
  16252. }
  16253. .bind(this)),
  16254. this.imageWrapper
  16255. }
  16256. ,
  16257. n.prototype.onClosed = function() {
  16258. this.imageWrapper.style.pointerEvents = "auto"
  16259. }
  16260. ,
  16261. n.prototype.load = function(e) {
  16262. var t = Math.max(window.screen.height, window.screen.width)
  16263. , i = "https://i.embed.ly/1/display/resize?key=" + l.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  16264. return new Promise(function(e, t) {
  16265. function n(t) {
  16266. var i = t.target;
  16267. this.width = i.naturalWidth,
  16268. this.height = i.naturalHeight,
  16269. this.aspect = this.width / this.height;
  16270. var n = t.target.src;
  16271. this.imageWrapper.style.backgroundImage = 'url("' + n + '")',
  16272. this.imageWrapper.style.width = this.width + "px",
  16273. this.imageWrapper.style.height = this.height + "px",
  16274. this.imageWrapper.classList.remove("hidden"),
  16275. e()
  16276. }
  16277. o.enqueue({
  16278. href: i,
  16279. responseType: "arraybuffer"
  16280. }).then(function(e) {
  16281. var t = new Uint8Array(e)
  16282. , i = new Blob([t])
  16283. , r = new window.Image;
  16284. r.addEventListener("load", n.bind(this));
  16285. var o = URL.createObjectURL(i);
  16286. r.src = o
  16287. }
  16288. .bind(this), t)
  16289. }
  16290. .bind(this))
  16291. }
  16292. ,
  16293. t.exports = n
  16294. }
  16295. ).call(this, "/js/tag/Media/Image.js")
  16296. }
  16297. , {
  16298. "../../settings": 166,
  16299. "../../util/logger": 189,
  16300. "./EmbedlyQueue": 127,
  16301. "./MediaEvent": 131,
  16302. events: 202
  16303. }],
  16304. 129: [function(e, t, i) {
  16305. "use strict";
  16306. function n(e) {
  16307. this.label = e.label,
  16308. this.href = e.url,
  16309. this.type = this.updateLinkForType(),
  16310. this.domElement = null,
  16311. this.id = c++
  16312. }
  16313. var r = e("./LinkType")
  16314. , o = e("./MediaEvent")
  16315. , a = e("../../util/browser")
  16316. , s = e("../../analytics")
  16317. , l = e("events").EventEmitter
  16318. , c = 0;
  16319. n.prototype = Object.create(l.prototype),
  16320. n.prototype.updateLinkForType = function() {
  16321. function e(e) {
  16322. var t = new RegExp("[#&?]start=([^#&?]*)")
  16323. , i = t.exec(e);
  16324. return i[1]
  16325. }
  16326. function t(e) {
  16327. return e + "&play=1"
  16328. }
  16329. var i = a.valueFromHash("m") || a.valueFromHash("model");
  16330. 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),
  16331. r.NAVIGATION) : (this.href = t(this.href),
  16332. r.MODEL) : r.EXT_LINK
  16333. }
  16334. ;
  16335. var h = {};
  16336. n.prototype.createDomElement = function() {
  16337. function e(e) {
  16338. switch (e.stopPropagation(),
  16339. h[this.id] = !0,
  16340. s.trackAlways("click_tag_link", {
  16341. link_type: this.type,
  16342. link_count: c,
  16343. links_clicked: Object.keys(h).length
  16344. }),
  16345. this.type) {
  16346. case r.MODEL:
  16347. window.location.replace(this.href);
  16348. break;
  16349. case r.EXT_LINK:
  16350. window.open(this.href, "_blank")
  16351. }
  16352. this.emit(o.LINK_CLICK, {
  16353. type: this.type,
  16354. url: this.href
  16355. })
  16356. }
  16357. if (this.domElement = document.createElement("a"),
  16358. this.domElement.classList.add("tag-link"),
  16359. this.domElement.textContent = this.label,
  16360. this.type === r.EXT_LINK) {
  16361. this.domElement.textContent += " ";
  16362. var t = document.createElement("i");
  16363. t.classList.add("icon-ext-link"),
  16364. t.title = "Link to external web site",
  16365. this.domElement.appendChild(t)
  16366. }
  16367. return this.domElement.addEventListener("click", e.bind(this)),
  16368. this.domElement
  16369. }
  16370. ,
  16371. t.exports = n
  16372. }
  16373. , {
  16374. "../../analytics": 4,
  16375. "../../util/browser": 182,
  16376. "./LinkType": 130,
  16377. "./MediaEvent": 131,
  16378. events: 202
  16379. }],
  16380. 130: [function(e, t, i) {
  16381. "use strict";
  16382. t.exports = {
  16383. NAVIGATION: "navigation",
  16384. MODEL: "model",
  16385. EXT_LINK: "ext-link"
  16386. }
  16387. }
  16388. , {}],
  16389. 131: [function(e, t, i) {
  16390. "use strict";
  16391. t.exports = Object.freeze({
  16392. LINK_CLICK: "mtmedia.link",
  16393. IMAGE_LOADED: "mtmedia.image.loaded",
  16394. IMAGE_OPENING: "mtmedia.image.opening",
  16395. IMAGE_OPENED: "mtmedia.image.opened",
  16396. IMAGE_CLOSING: "mtmedia.image.closing",
  16397. IMAGE_CLOSED: "mtmedia.image.closed",
  16398. VIDEO_START: "mtmedia.video.start",
  16399. VIDEO_PAUSE: "mtmedia.video.pause",
  16400. VIDEO_ENDED: "mtmedia.video.end"
  16401. })
  16402. }
  16403. , {}],
  16404. 132: [function(e, t, i) {
  16405. "use strict";
  16406. t.exports = Object.freeze({
  16407. maxEmbedWidth: 350,
  16408. defaultAspectRatio: .75
  16409. })
  16410. }
  16411. , {}],
  16412. 133: [function(e, t, i) {
  16413. "use strict";
  16414. t.exports = Object.freeze({
  16415. TEXT: "text",
  16416. LINK: "link",
  16417. IMAGE: "photo",
  16418. VIDEO: "video",
  16419. RICH: "rich"
  16420. })
  16421. }
  16422. , {}],
  16423. 134: [function(e, t, i) {
  16424. "use strict";
  16425. function n(e) {
  16426. this.capabilities = {
  16427. links: {
  16428. enable: e.supportLinks,
  16429. keepLabels: e.keepLinkLabels
  16430. }
  16431. }
  16432. }
  16433. var r = e("./DescriptionChunkType");
  16434. n.prototype.parse = function(e, t) {
  16435. var i = []
  16436. , n = e.split("[").map(function(e, t) {
  16437. return 0 === t ? e : "[" + e
  16438. });
  16439. return n.forEach(function(e) {
  16440. var n = this.findMarkdown(e);
  16441. if (n) {
  16442. if (n.url.indexOf("javascript:") !== -1)
  16443. return;
  16444. this.addLinkChunk(i, n, t),
  16445. this.addTextChunk(i, e.slice(n.markdown.length))
  16446. } else
  16447. this.addTextChunk(i, e)
  16448. }
  16449. .bind(this)),
  16450. i
  16451. }
  16452. ,
  16453. n.prototype.findMarkdown = function(e) {
  16454. var t = /\[([^\]]*)\]\((.*)\)/
  16455. , i = e.match(t);
  16456. if (i) {
  16457. for (var n = i[2], r = 1, o = 0; o < n.length && ("(" === n[o] ? r++ : ")" === n[o] && r--,
  16458. 0 !== r); )
  16459. o++;
  16460. var a = n.length - o;
  16461. return {
  16462. markdown: i[0].substring(0, i[0].length - a),
  16463. label: i[1],
  16464. url: i[2].substring(0, o)
  16465. }
  16466. }
  16467. }
  16468. ,
  16469. n.prototype.addTextChunk = function(e, t) {
  16470. 0 !== t.length && e.push({
  16471. type: r.TEXT,
  16472. text: t
  16473. })
  16474. }
  16475. ,
  16476. n.prototype.addLinkChunk = function(e, t) {
  16477. if (!this.capabilities.links.enable)
  16478. return void (this.capabilities.links.keepLabels && this.addTextChunk(e, t.label));
  16479. var i = {
  16480. label: t.label,
  16481. url: t.url
  16482. };
  16483. i.url.indexOf("://") === -1 && (i.url = "http://" + i.url),
  16484. e.push({
  16485. type: r.LINK,
  16486. link: i
  16487. })
  16488. }
  16489. ,
  16490. t.exports = n
  16491. }
  16492. , {
  16493. "./DescriptionChunkType": 133
  16494. }],
  16495. 135: [function(e, t, i) {
  16496. (function(i) {
  16497. "use strict";
  16498. var n = e("../util/logger")
  16499. , r = new n(i)
  16500. , o = {
  16501. parseIdsFromChunkName: function(e, t) {
  16502. t.floorId = o.parseFloor(e),
  16503. t.roomId = o.parseRoom(e)
  16504. },
  16505. parseFloor: function(e) {
  16506. var t = e.match(/_group([0-9]+)/);
  16507. if (!t)
  16508. return 0;
  16509. try {
  16510. return parseInt(t[1], 10)
  16511. } catch (e) {
  16512. return r.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16513. 0
  16514. }
  16515. },
  16516. parseRoom: function(e) {
  16517. var t = e.match(/_sub([0-9]+)/);
  16518. if (!t)
  16519. return -1;
  16520. try {
  16521. return parseInt(t[1], 10)
  16522. } catch (e) {
  16523. return r.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16524. 0
  16525. }
  16526. }
  16527. };
  16528. t.exports = o
  16529. }
  16530. ).call(this, "/js/model/Chunks.js")
  16531. }
  16532. , {
  16533. "../util/logger": 189
  16534. }],
  16535. 136: [function(e, t, i) {
  16536. (function(i) {
  16537. "use strict";
  16538. function n(e) {
  16539. s.call(this),
  16540. this.model = e,
  16541. this.exploded = !1
  16542. }
  16543. var r = e("../objects/Floor")
  16544. , o = (e("../settings"),
  16545. e("../util/logger"))
  16546. , a = e("../util/transitions")
  16547. , s = e("../util/IndexedCollection")
  16548. , l = e("../util/common")
  16549. , c = e("../util/easing");
  16550. new o(i);
  16551. l.inherit(n, s),
  16552. n.prototype.add = function(e) {
  16553. s.prototype.add.call(this, e),
  16554. this.model.add(e)
  16555. }
  16556. ,
  16557. n.prototype.getIndex = function(e) {
  16558. return e.floorIndex
  16559. }
  16560. ,
  16561. n.prototype.build = function() {
  16562. this.list.forEach(function(e) {
  16563. e.build()
  16564. })
  16565. }
  16566. ,
  16567. n.prototype.size = function() {
  16568. return this.length
  16569. }
  16570. ,
  16571. n.prototype.sort = function() {
  16572. s.prototype.sort.call(this, function(e, t) {
  16573. return e.floorIndex - t.floorIndex
  16574. })
  16575. }
  16576. ,
  16577. n.prototype.nextFloor = function(e, t) {
  16578. return this.index[e.floorIndex + t] || null
  16579. }
  16580. ,
  16581. n.prototype.getFloorAtPoint = function(e) {
  16582. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16583. var r = this.list[n]
  16584. , o = r.distanceToPoint(e);
  16585. (!t || i > o) && (i = o,
  16586. t = r)
  16587. }
  16588. return t
  16589. }
  16590. ,
  16591. n.prototype.getOrMakeFloor = function(e) {
  16592. var t = this.index[e];
  16593. return t || (t = new r(this.model,e),
  16594. this.add(t)),
  16595. t
  16596. }
  16597. ,
  16598. n.prototype.hide = function() {
  16599. this.list.forEach(function(e) {
  16600. e.hide()
  16601. })
  16602. }
  16603. ,
  16604. n.prototype.show = function() {
  16605. this.list.forEach(function(e) {
  16606. e.show()
  16607. })
  16608. }
  16609. ,
  16610. n.prototype.names = function() {
  16611. return this.list.reduce(function(e, t) {
  16612. return e.concat(t.name)
  16613. }, [])
  16614. }
  16615. ,
  16616. n.prototype.toggleExplodeHorizontal = function() {
  16617. function e(e, t) {
  16618. r.copy(e.position),
  16619. e.position.x = i[e.floorIndex] * t,
  16620. e.position.y = 1 * e.floorIndex * t,
  16621. r.sub(e.position).multiplyScalar(-1),
  16622. e.panos.forEach(function(e) {
  16623. e.translate(r)
  16624. })
  16625. }
  16626. var t, i = [], n = 0;
  16627. this.list.forEach(function(e, r, o) {
  16628. t = r > 0 ? Math.max(o[r - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16629. n += t,
  16630. i[r] = n
  16631. }),
  16632. i = i.map(function(e) {
  16633. return e - n / 2
  16634. });
  16635. var r = this.list[0].position.clone();
  16636. this.exploded ? this.list.forEach(function(t) {
  16637. a.start(function(i) {
  16638. e(t, 1 - i)
  16639. }, 1500, null, 0, c.easeOutExpo)
  16640. }) : this.list.forEach(function(t) {
  16641. a.start(function(i) {
  16642. e(t, i)
  16643. }, 1500, null, 0, c.easeOutExpo)
  16644. }),
  16645. this.exploded = !this.exploded
  16646. }
  16647. ,
  16648. n.prototype.toggleExplodeVertical = function() {
  16649. function e(e, i) {
  16650. var n = n.copy(e.position);
  16651. e.position.y = (5 * e.floorIndex - t.y / 2) * i,
  16652. n.sub(e.position).multiplyScalar(-1),
  16653. e.panos.forEach(function(e) {
  16654. e.translate(n)
  16655. })
  16656. }
  16657. var t = this.model.size;
  16658. this.list[0].position.clone();
  16659. this.exploded ? this.list.forEach(function(t) {
  16660. a.start(function(i) {
  16661. e(t, 1 - i)
  16662. }, 1500, null, 0, c.easeOutExpo)
  16663. }) : this.list.forEach(function(t) {
  16664. a.start(function(i) {
  16665. e(t, i)
  16666. }, 1500, null, 0, c.easeOutExpo)
  16667. }),
  16668. this.exploded = !this.exploded
  16669. }
  16670. ,
  16671. t.exports = n
  16672. }
  16673. ).call(this, "/js/model/FloorCollection.js")
  16674. }
  16675. , {
  16676. "../objects/Floor": 146,
  16677. "../settings": 166,
  16678. "../util/IndexedCollection": 175,
  16679. "../util/common": 185,
  16680. "../util/easing": 186,
  16681. "../util/logger": 189,
  16682. "../util/transitions": 195
  16683. }],
  16684. 137: [function(e, t, i) {
  16685. (function(i) {
  16686. "use strict";
  16687. function n() {
  16688. c.call(this)
  16689. }
  16690. var r = e("../settings")
  16691. , o = e("../util/logger")
  16692. , a = e("../enum/Viewmode")
  16693. , s = e("../objects/Snapshot")
  16694. , l = (e("../util/math"),
  16695. e("../util/common"))
  16696. , c = e("../util/IndexedCollection")
  16697. , h = new o(i);
  16698. l.inherit(n, c),
  16699. n.prototype.getImage = function(e) {
  16700. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16701. }
  16702. ,
  16703. n.prototype.filterByModesAndReel = function(e, t) {
  16704. for (var i = [], n = 0; n < t.length; n += 1) {
  16705. var r = t[n]
  16706. , o = this.index[r.sid];
  16707. o && i.push(o)
  16708. }
  16709. var s = e[a.DOLLHOUSE]
  16710. , l = e[a.FLOORPLAN];
  16711. i = i.filter(function(e) {
  16712. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16713. return !0;
  16714. var t;
  16715. try {
  16716. t = a.convertWorkshopModeInt(e.metadata.camera_mode)
  16717. } catch (e) {
  16718. return h.debug(e.message),
  16719. !1
  16720. }
  16721. return t === a.PANORAMA || t === a.FLOORPLAN && l || t === a.DOLLHOUSE && s
  16722. }),
  16723. i.length !== this.list.length && h.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16724. this.list = i,
  16725. this.reIndex()
  16726. }
  16727. ,
  16728. n.prototype.getHeroLocations = function(e) {
  16729. if (0 === this.list.length)
  16730. return [];
  16731. for (var t = [], i = 1; i < this.list.length; ++i) {
  16732. var o = this.list[i]
  16733. , l = o.thumbnail_signed_src
  16734. , c = o.name;
  16735. if (o.metadata && void 0 !== o.metadata.camera_quaternion) {
  16736. if (!r.show360Views.enabled && o.metadata.scan_id) {
  16737. var h = e.get(o.metadata.scan_id);
  16738. if (h && !h.isAligned())
  16739. continue
  16740. }
  16741. var u = a.convertWorkshopModeInt(o.metadata.camera_mode);
  16742. if (u === a.MESH)
  16743. continue;
  16744. var d = {
  16745. cameraMode: u,
  16746. position: o.metadata.camera_position,
  16747. quaternion: o.metadata.camera_quaternion,
  16748. panoId: o.metadata.scan_id,
  16749. orthoZoom: o.metadata.ortho_zoom,
  16750. floorVisibility: void 0 !== o.metadata.floor_visibility ? o.metadata.floor_visibility.slice(0) : [],
  16751. thumbUrl: l,
  16752. name: n.filterImageName(c),
  16753. sid: o.sid //xzw add g_tourAudio要用
  16754. }
  16755. , p = new s(d);
  16756. t.push(p)
  16757. }
  16758. }
  16759. return t
  16760. }
  16761. ,
  16762. n.prototype.getIndex = function(e) {
  16763. return e.sid
  16764. }
  16765. ,
  16766. n.filterImageName = function(e) {
  16767. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16768. }
  16769. ,
  16770. t.exports = n
  16771. }
  16772. ).call(this, "/js/model/ImageCollection.js")
  16773. }
  16774. , {
  16775. "../enum/Viewmode": 51,
  16776. "../objects/Snapshot": 153,
  16777. "../settings": 166,
  16778. "../util/IndexedCollection": 175,
  16779. "../util/common": 185,
  16780. "../util/logger": 189,
  16781. "../util/math": 190
  16782. }],
  16783. 138: [function(e, t, i) {
  16784. (function(i) {
  16785. "use strict";
  16786. function n() {
  16787. u.call(this)
  16788. }
  16789. var r = e("../label/Label")
  16790. , o = e("../settings")
  16791. , a = e("../util/logger")
  16792. , s = e("../util/math")
  16793. , l = e("../util/ajax")
  16794. , c = e("./RoomCollection")
  16795. , h = e("../util/common")
  16796. , u = e("../util/IndexedCollection");
  16797. new a(i);
  16798. h.inherit(n, u),
  16799. n.prototype.getIndex = function(e) {
  16800. return e.labelId
  16801. }
  16802. ,
  16803. n.prototype.associateWithRooms = function(e) {
  16804. this.forEach(function(t) {
  16805. e.forEach(function(e) {
  16806. e.roomId === t.roomId && (t.room = e)
  16807. })
  16808. })
  16809. }
  16810. ,
  16811. n.prototype.createFromLabelData = function(e) {
  16812. e.forEach(function(e) {
  16813. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  16814. t = c.generateRoomId(e.floorId, t);
  16815. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  16816. i.position = s.convertWorkshopVector(i.position),
  16817. this.add(i),
  16818. i.build()
  16819. }
  16820. .bind(this))
  16821. }
  16822. ,
  16823. n.prototype.load = function(e, t) {
  16824. return l.get(e, {
  16825. responseType: "json",
  16826. auth: t ? o.authorizationHeader : null
  16827. }).done(function(e) {
  16828. var t = [];
  16829. for (var i in e) {
  16830. var n = e[i];
  16831. t.push(n)
  16832. }
  16833. this.createFromLabelData(t)
  16834. }
  16835. .bind(this))
  16836. }
  16837. ,
  16838. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  16839. var t = -1;
  16840. if (e) {
  16841. var i = e.split("_");
  16842. t = parseInt(i[0])
  16843. }
  16844. return t
  16845. }
  16846. ,
  16847. t.exports = n
  16848. }
  16849. ).call(this, "/js/model/LabelCollection.js")
  16850. }
  16851. , {
  16852. "../label/Label": 90,
  16853. "../settings": 166,
  16854. "../util/IndexedCollection": 175,
  16855. "../util/ajax": 181,
  16856. "../util/common": 185,
  16857. "../util/logger": 189,
  16858. "../util/math": 190,
  16859. "./RoomCollection": 141
  16860. }],
  16861. 139: [function(e, t, i) {
  16862. (function(i) {
  16863. "use strict";
  16864. function n(e, t) {
  16865. o.Object3D.call(this),
  16866. this.sid = t.sid,
  16867. this.data = t,
  16868. this.options = e,
  16869. this.urls = new s(e.urlFiles),
  16870. this.isPublic = void 0 !== t.is_public && t.is_public,
  16871. this.images = new _(this),
  16872. this.images.extend(t.images),
  16873. this.heroImage = this.images.getImage(t.icon),
  16874. this.heroLocations = [],
  16875. this.outdoorPanoLocations = [],
  16876. this.floors = new d(this),
  16877. this.floorsEnabled = void 0 === e.floors || e.floors,
  16878. this.changingFloor = !1,
  16879. this.chunks = [],
  16880. this.panos = new A,
  16881. this.colliders = [],
  16882. this.loadPanosPromise = null,
  16883. this.loadMeshTexturesPromise = null,
  16884. this.auxDataPromise = null,
  16885. this.meshTexturesLoaded = !1,
  16886. this.meshTextures = [],
  16887. this.tags = {},
  16888. this.tagsShown = !1,
  16889. this.shouldShowtags = !1,
  16890. this.has360Views = !1,
  16891. this.showingLabels = f.labels.enabled && t.player_options.labels,
  16892. this.supportedModes = {},
  16893. this.supportedModes[c.PANORAMA] = !0,
  16894. this.supportedModes[c.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && w.valueFromHash("dh", 1),
  16895. this.supportedModes[c.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && w.valueFromHash("dh", 1),
  16896. this.supportedModes[c.TRANSITIONING] = !0,
  16897. this.supportsTiles = this.configureTiling(),
  16898. this.supportsVR = t.is_vr,
  16899. this.mode = c.DOLLHOUSE,
  16900. this.size = null,
  16901. this.center = null,
  16902. this.boundingBox = new o.Box3,
  16903. this.currentFloor = null,
  16904. this.allFloorsVisible = !0,
  16905. this.projectedPano0 = null,
  16906. this.projectedPano1 = null,
  16907. this.floorsEnabled && t.floors && t.floors.indexOf(",") !== -1 && t.floors.split(",").forEach(function(e, t) {
  16908. this.addFloor(new u(this,t,e.trim()))
  16909. }
  16910. .bind(this)),
  16911. this.waitQueue = [],
  16912. this.on("load", function(e) {
  16913. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  16914. return !e.isLoadedCallback()
  16915. }),
  16916. 0 === this.waitQueue.length && this.emit("waiting-done"))
  16917. }
  16918. .bind(this)),
  16919. this.setupCustomProperties()
  16920. this.hots = {};
  16921. }
  16922. function r() {
  16923. try {
  16924. var e = document.createElement("canvas")
  16925. , t = e.getContext("webgl");
  16926. t || (t = e.getContext("experimental-webgl"));
  16927. var i = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE);
  16928. return i
  16929. } catch (e) {
  16930. return 0
  16931. }
  16932. }
  16933. var o = e("three")
  16934. , a = e("../util/ajax")
  16935. , s = e("../util/ModelUrls")
  16936. , l = e("../objects/BoundingTextureSkybox")
  16937. , c = e("../enum/Viewmode")
  16938. , h = e("../enum/RenderOrder")
  16939. , u = (e("../enum/AlignmentType"),
  16940. e("../objects/Floor"))
  16941. , d = e("./FloorCollection")
  16942. , p = e("../objects/Chunk")
  16943. , f = (e("../objects/Room"),
  16944. e("../objects/Snapshot"),
  16945. e("../label/Label"),
  16946. e("../util/math"),
  16947. e("../settings"))
  16948. ,ss = e("../shaders")
  16949. , g = e("../util/logger")
  16950. , m = e("../tag/tag")
  16951. , v = (e("../tag/tagManager"),
  16952. e("../objects/Panorama"))
  16953. , A = e("../util/PanoramaCollection")
  16954. , y = e("../loaders/ModelLoader")
  16955. , C = e("../loaders/ModelTextureLoader")
  16956. , I = e("../loaders/SweepDataLoader")
  16957. , E = e("../util/transitions")
  16958. , b = (e("../util/easing"),
  16959. e("../util/lerp"),
  16960. e("../util/common"))
  16961. , w = (e("../util/texture"),
  16962. e("./../util/browser"))
  16963. , _ = e("./ImageCollection")
  16964. , T = e("./RoomCollection")
  16965. , x = e("./LabelCollection")
  16966. , S = e("./Chunks")
  16967. , M = e("./../util/showcase")
  16968. , R = e("../exception/BasicException")
  16969. , P = (e("../constants")
  16970. ,e("events").EventEmitter)
  16971. ,Hot = e("hot")
  16972. , O = new g(i);
  16973. n.prototype = Object.create(o.Object3D.prototype),
  16974. b.extend(n, P),
  16975. n.prototype.setupCustomProperties = function() {
  16976. var e = f.modelAlpha;
  16977. Object.defineProperty(this, "alpha", {
  16978. get: function() {
  16979. return e
  16980. },
  16981. set: function(t) {
  16982. e = t,
  16983. this.chunks.forEach(function(t) {
  16984. t.material && t.material.uniforms.modelAlpha && (t.material.uniforms.modelAlpha.value = e)
  16985. })
  16986. }
  16987. })
  16988. }
  16989. ,
  16990. n.prototype.configureTiling = function() {
  16991. var e = r();
  16992. if (e < 2048)
  16993. return !1;
  16994. O.warn("Max cube texture size: " + e);
  16995. for (var t = 0; t < f.tiling.tilingFlagNames.length; t++) {
  16996. var i = f.tiling.tilingFlagNames[t];
  16997. if ("1" === w.valueFromHash(i, null))
  16998. return !0;
  16999. if ("0" === w.valueFromHash(i, null))
  17000. return !1
  17001. }
  17002. //--------------------------------------------许钟文-------------------------------------------
  17003. //return true;
  17004. return !!M.modelDataPromisesTiles(this.data) //免去访问mdoeldata.json的vision_version,不明白这是什么
  17005. //--------------------------------------------e n d -------------------------------------------
  17006. }
  17007. ,
  17008. n.prototype.toggleAlpha = function() {
  17009. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  17010. }
  17011. ,
  17012. n.prototype.load = function(e) {
  17013. var t = function() {
  17014. return $.when(this.loadPanos(), this.loadMesh())
  17015. }
  17016. , i = this.urls.init().then(t.bind(this));
  17017. return e ? i = i.then(this.loadMeshTextures.bind(this)) : i.then(this.loadMeshTextures.bind(this)),
  17018. this.auxDataPromise = $.when( /*this.loadHighlightReel(), this.loadtags() */this.loadhots(), this.loadLabels()),
  17019. $.when(i, this.auxDataPromise).done(this.build.bind(this)) //不要另外使用active_reel文件
  17020. }
  17021. ,
  17022. n.prototype.loadMesh = function() {
  17023. function e(e) {
  17024. O.error(e),
  17025. n.reject("loading-failed")
  17026. }
  17027. function t(e, t) {
  17028. n.notify(e, t)
  17029. }
  17030. function i(e, t) {
  17031. if (0 === e.length) {
  17032. O.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  17033. r.supportedModes[c.DOLLHOUSE] = !1,
  17034. r.supportedModes[c.FLOORPLAN] = !1;
  17035. var i = new p({
  17036. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  17037. });
  17038. i.material.visible = !1,
  17039. i.rotateX(-Math.PI / 2),
  17040. i.geometry.computeBoundingBox(),
  17041. e = [i]
  17042. }
  17043. e.forEach(function(e) {
  17044. var t = r.floorsEnabled ? S.parseFloor(e.name) : 0;
  17045. r.addChunk(t, e)
  17046. }),
  17047. r.floors.sort(),
  17048. n.resolve(r)
  17049. }
  17050. var n = $.Deferred()
  17051. , r = this;
  17052. return y.load(r.data.job.uuid, r.urls, i, t, e),
  17053. n.promise()
  17054. }
  17055. ,
  17056. n.prototype.loadMeshTextures = function() {
  17057. return this.loadTexturesPromise ? this.loadTexturesPromise : (this.loadTexturesPromise = C.load(this, this.meshTextures).then(function() {
  17058. this.meshTexturesLoaded = !0
  17059. }
  17060. .bind(this)),
  17061. this.loadTexturesPromise)
  17062. }
  17063. ,
  17064. /* n.prototype.loadtags = function() {//xzw改
  17065. var e = $.Deferred();
  17066. if (!f.tags.enabled)
  17067. return e.resolve();
  17068. //var t = this.options.urlBase + "/api/v1/jsonstore/model/tags/" + this.sid;
  17069. t = "data/" + this.sid + "/tags.json"
  17070. return a.get(t, {
  17071. responseType: "json",
  17072. auth: this.isPublic ? null : f.authorizationHeader
  17073. }).done(function(t) {
  17074. var i = 0
  17075. , n = 0;
  17076. for (var r in t) {
  17077. var o = t[r];
  17078. o.enabled && (n++,
  17079. (o.label.length || o.description.length) && (this.tags[r] = new m(this,r,o),
  17080. i++))
  17081. }
  17082. i !== n && O.warn("Disallowed " + (n - i) + " tags with no text data"),
  17083. e.resolve()
  17084. }
  17085. .bind(this)).fail(function() {
  17086. O.warn("Getting tags failed, not displaying tags."),
  17087. e.resolve()
  17088. }),
  17089. e
  17090. } */
  17091. n.prototype.shineHots = function(){ //xzw
  17092. E.trigger({
  17093. func: function(e) {
  17094. if(e<=0.5) ss.hot.uniforms.opac.value = 2*e;
  17095. else ss.hot.uniforms.opac.value = -2*e + 2;
  17096. }.bind(this),
  17097. cycling: true,
  17098. duration: 3000,
  17099. //easing: "easeInOutQuad",
  17100. name: "hotShine"
  17101. })
  17102. },
  17103. n.prototype.audioAutoPlay = function(audio){
  17104. if(!audio) return
  17105. //https://www.cnblogs.com/interdrp/p/4211883.html 部分资料
  17106. audio.load(); // iOS 9 还需要额外的 load 一下, 否则直接 play 无效
  17107. var play = function(){
  17108. audio.play();
  17109. console.log('begin play bgm')
  17110. document.removeEventListener("touchstart",play);
  17111. $('#player')[0].removeEventListener("touchstart", play);
  17112. };
  17113. audio.play();
  17114. document.addEventListener("WeixinJSBridgeReady", function () {
  17115. audio.play();
  17116. }, false);
  17117. document.addEventListener("touchstart", play);//ios需要加个事件才能播放 不能自动播放;如果还有浏览器不行,换成别的交互事件
  17118. $('#player')[0].addEventListener("touchstart", play);
  17119. audio.addEventListener('ended', function () {
  17120. audio.play();
  17121. });
  17122. }
  17123. n.prototype.loadhots = function() {//xzw
  17124. var e = $.Deferred();
  17125. var t = "data/" + this.sid + "/data2.js" +'?'+ new Date().getTime();
  17126. return a.get(t, {
  17127. responseType: "json",
  17128. auth: this.isPublic ? null : f.authorizationHeader
  17129. }).done(function(t) {
  17130. g_data2 = t;
  17131. this.hotsCount = 0;
  17132. for(var i in t.hots){
  17133. this.hotsCount ++;
  17134. this.hots[i] = new Hot(i, t.hots[i], this);
  17135. }
  17136. g_Hots = this.hots;
  17137. g_index = w.valueFromHash("m");
  17138. if(t.tourAudio){
  17139. g_tourAudio = new Audio;
  17140. g_tourAudio.loop = false;
  17141. g_tourAudio.addEventListener('ended', function () {
  17142. var ev = document.createEvent("MouseEvent");
  17143. ev.initEvent("tourAudioEnded",true,true);
  17144. window.dispatchEvent(ev);
  17145. });
  17146. }
  17147. if(t.hasBGM){
  17148. g_bgAudio = new Audio;
  17149. g_bgAudio.src = g_Prefix+"audio/"+g_index+"/background.mp3";
  17150. g_bgAudio.loop = true;
  17151. g_bgAudio.autoplay = true;
  17152. g_bgAudio.id = "bgaudio";
  17153. g_playAudio = g_bgAudio;
  17154. this.audioAutoPlay(g_bgAudio)
  17155. }
  17156. /* g_audio=t.audio;
  17157. g_Text=t.texts;
  17158. g_TextShow=t.showText;
  17159. g_weixinTitle=t.weixintitle;
  17160. if("undefined" != typeof(t.roof))
  17161. {
  17162. g_roof=t.roof;
  17163. }
  17164. if("undefined" != typeof(t.dollhouseminDistance))
  17165. {
  17166. I.dollhouseDefault.minDistance=t.dollhouseminDistance;
  17167. } */
  17168. e.resolve()
  17169. }.bind(this)).fail(function() {
  17170. console.log('没有热点')
  17171. e.resolve()
  17172. }),
  17173. e
  17174. }
  17175. ,
  17176. n.prototype.loadPanos = function() {
  17177. if (this.loadPanosPromise)
  17178. return this.loadPanosPromise;
  17179. var e = new I(this);
  17180. return this.loadPanosPromise = e.load().then(function(e) {
  17181. return this.data.sweeps && Object.keys(this.data.sweeps).length > 0 && (e = e.filter(function(e) {
  17182. return this.data.sweeps[e.uuid].enabled
  17183. }
  17184. .bind(this))),
  17185. this.panos.extend(e.map(function(e) {
  17186. return new v(this,e.uuid,e,this.supportsTiles)
  17187. }
  17188. .bind(this))),
  17189. this.panos.forEach(function(e) {
  17190. e.neighbourUUIDs && (e.neighbourUUIDs.forEach(function(t) {
  17191. var i = this.panos.get(t);
  17192. i && this.panos.setNeighbour(e, i, !0)
  17193. }
  17194. .bind(this)),
  17195. e.neighbourPanos = this.panos.getNeighbours(e) || this.panos.setNeighbour(e, e, !0))
  17196. }
  17197. .bind(this)),
  17198. 0 === this.panos.length && (O.warn("Model has no panos, turning off inside mode"),
  17199. this.supportedModes[c.PANORAMA] = !1),
  17200. $.when(this)
  17201. }
  17202. .bind(this)),
  17203. this.loadPanosPromise
  17204. }
  17205. ,
  17206. n.prototype.loadHighlightReel = function() {//xzw
  17207. var e = $.Deferred()
  17208. // , t = this.options.urlBase + "/api/v1/jsonstore/model/highlights/" + this.sid + "/active_reel";
  17209. ,t = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  17210. return a.get(t, {
  17211. responseType: "json",
  17212. auth: this.isPublic ? null : f.authorizationHeader
  17213. }).done(function(t) {
  17214. t.reel ? (O.info("Got highlight reel with " + t.reel.length + " items"),
  17215. this.images.filterByModesAndReel(this.supportedModes, t.reel)) : O.info("No highlight reel found"),
  17216. e.resolve()
  17217. }
  17218. .bind(this)).fail(function() {
  17219. O.warn("Getting highlight reel failed, no highlights available"),
  17220. e.resolve()
  17221. }),
  17222. e
  17223. }
  17224. ,
  17225. n.prototype.waitForLoad = function(e, t) {
  17226. t() || (this.waitQueue.push({
  17227. object: e,
  17228. isLoadedCallback: t
  17229. }),
  17230. 1 === this.waitQueue.length && this.emit("waiting"))
  17231. }
  17232. ,
  17233. n.prototype.hide = function() {
  17234. this.floors.hide()
  17235. }
  17236. ,
  17237. n.prototype.show = function() {
  17238. this.floors.show()
  17239. }
  17240. ,
  17241. n.prototype.floorNames = function() {
  17242. return this.floors.names()
  17243. }
  17244. ,
  17245. n.prototype.warpDestFloors = function(e, t) {
  17246. if (!e || this.floors.length !== e.length)
  17247. return void this.toggleAllFloors(!0);
  17248. var i = e.findIndex(function(e) {
  17249. return e
  17250. }
  17251. .bind(this));
  17252. i !== -1 && this.setFloor(this.floors.list[i], null, t)
  17253. }
  17254. ,
  17255. n.prototype.setFloor = function(e, t, i) {
  17256. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  17257. this.allFloorsVisible = !1,
  17258. this._setFloor(e, t, i)
  17259. }
  17260. ,
  17261. n.prototype.toggleAllFloors = function(e) {
  17262. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  17263. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  17264. this._setFloor(this.currentFloor)
  17265. }
  17266. ,
  17267. n.prototype._setFloor = function(e, t, i) {
  17268. t = t || this.mode,
  17269. this.emit("floor.changed", e, t, this.currentFloor),
  17270. this.currentFloor = e;
  17271. var n;
  17272. if (t === c.PANORAMA) {
  17273. if (this.show(),
  17274. this.shouldShowtags && this.tagsShown)
  17275. for (n in this.tags)
  17276. this.tags[n].show(f.showFloorDuration)
  17277. } else if ((t === c.FLOORPLAN || t === c.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  17278. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  17279. }
  17280. .bind(this)),
  17281. this.shouldShowtags && this.tagsShown))
  17282. for (n in this.tags) {
  17283. var r = this.tags[n];
  17284. this.allFloorsVisible ? r.show(f.showFloorDuration) : r.floor === this.currentFloor ? r.show(f.showFloorDuration, f.showFloorDelay) : r.hide(f.hideFloorDuration, f.hideFloorDelay)
  17285. }
  17286. var o = this
  17287. , a = e;
  17288. E.start(function() {}, f.showFloorDelay, function() {
  17289. o.floors.forEach(function(e) {
  17290. e.chunks.forEach(function(t) {
  17291. t.renderOrder = e === a ? h.visibleFloor : h.ghostFloor
  17292. })
  17293. })
  17294. }
  17295. .bind(this))
  17296. }
  17297. ,
  17298. n.prototype.toggleExplode = function() {
  17299. this.floors.toggleExplodeHorizontal()
  17300. }
  17301. ,
  17302. n.prototype.toggleExplodeUp = function() {
  17303. this.floors.toggleExplodeVertical()
  17304. }
  17305. ,
  17306. n.prototype.nextFloor = function(e) {
  17307. return this.floors.nextFloor(this.currentFloor, e)
  17308. }
  17309. ,
  17310. n.prototype.addFloor = function(e) {
  17311. this.floors.add(e)
  17312. }
  17313. ,
  17314. n.prototype.getFloorAtPoint = function(e) {
  17315. return this.floors.getFloorAtPoint(e)
  17316. }
  17317. ,
  17318. n.prototype.getTagBySid = function(e) {
  17319. return this.tags[e]
  17320. }
  17321. ,
  17322. n.prototype.addChunk = function(e, t) {
  17323. this.floors.getOrMakeFloor(e).addChunk(t),
  17324. this.chunks.push(t)
  17325. }
  17326. ,
  17327. n.prototype.setMode = function(e) {
  17328. if (!this.supportedModes[e])
  17329. throw new R("Mode not supported for this model: " + e);
  17330. this.mode = e,
  17331. this.chunks.forEach(function(t) {
  17332. t.setMode(e)
  17333. })
  17334. }
  17335. ,
  17336. n.prototype.build = function() {
  17337. this.heroLocations = this.images.getHeroLocations(this.panos);
  17338. var e = function() {
  17339. 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()
  17340. }
  17341. .bind(this)();
  17342. this.has360Views = f.show360Views.enabled && this.heroLocations.some(function(e) {
  17343. return e.cameraMode === c.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17344. }
  17345. .bind(this)) || e,
  17346. null === this.heroImage && O.warn("No hero image defined."),
  17347. this.currentFloor = this.floors.last(),
  17348. this.floors.build(),
  17349. this.colliders = this.floors.reduce(function(e, t) {
  17350. return e.concat(t.collider.children)
  17351. }, []),
  17352. this.panos.forEach(function(e) {
  17353. e.build1(),
  17354. e.on("enter", function() {
  17355. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17356. }
  17357. .bind(this))
  17358. }
  17359. .bind(this)),
  17360. this.panos.forEach(function(e) {
  17361. e.build2()
  17362. }),
  17363. this.floors.forEach(function(e) {
  17364. this.boundingBox.union(e.boundingBox)
  17365. }
  17366. .bind(this)),
  17367. this.size = this.boundingBox.size(),
  17368. this.center = this.boundingBox.center(),
  17369. this.floors.forEach(function(e) {
  17370. O.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  17371. }
  17372. .bind(this)),
  17373. this.panos.populate_path_graph(),
  17374. this.skybox = new l(this.boundingBox),
  17375. this.skybox.matrixWorldNeedsUpdate = !0,
  17376. this.add(this.skybox);
  17377. setTimeout(function(){
  17378. this.hotsCount && this.shineHots();
  17379. }.bind(this),1300)//xzw 热点开始闪烁
  17380. for (var t in this.tags)
  17381. this.tags[t].build();
  17382. return O.debug("Done building model"),
  17383. v.raycastsDone > 0 && (O.warn("raycasts: " + v.raycastsDone),
  17384. O.warn("raycasts skipped: " + v.raycastsSkipped)),
  17385. this.buildRooms(),
  17386. this.labels.associateWithRooms(this.rooms),
  17387. $.when(this)
  17388. }
  17389. ,
  17390. n.prototype.loadLabels = function() {//xzw
  17391. this.labels = new x(this);
  17392. var e = $.Deferred();
  17393. if (!this.showingLabels)
  17394. return e.resolve();
  17395. // var t = this.options.urlBase + "/api/v1/jsonstore/model/labels/" + this.sid;
  17396. var t = "data/" + this.sid + "/labels.json";
  17397. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  17398. O.warn("Getting labels failed, not displaying labels."),
  17399. e.resolve()
  17400. }),
  17401. e
  17402. }
  17403. ,
  17404. n.prototype.buildRooms = function() {
  17405. this.rooms = new T(this),
  17406. this.rooms.createFromChunks(this.chunks),
  17407. this.rooms.calcRoomBoundaries()
  17408. }
  17409. ,
  17410. n.prototype.updateProjectedPanos = function() {
  17411. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  17412. }
  17413. ,
  17414. n.prototype.setProjectedPanos = function(e, t, i) {
  17415. void 0 !== i && null !== i || (i = !0),
  17416. i = !!i,
  17417. this.projectedPano0 = e,
  17418. this.projectedPano1 = t,
  17419. this.skybox.material.setProjectedPanos(e, t, i),
  17420. this.chunks.forEach(function(n) {
  17421. n.materialInside.setProjectedPanos(e, t, i)
  17422. })
  17423. }
  17424. ,
  17425. n.prototype.setSide = function(e) {
  17426. this.floors.forEach(function(t) {
  17427. t.collider.material.side = e
  17428. })
  17429. }
  17430. ,
  17431. n.prototype.heroCount = function() {
  17432. return this.heroLocations ? this.heroLocations.length : 0
  17433. }
  17434. ,
  17435. n.prototype.getHeroDescriptorByIndex = function(e) {
  17436. if (e < 0)
  17437. return O.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  17438. null;
  17439. var t = this.heroCount();
  17440. if (t < 1)
  17441. return O.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  17442. null;
  17443. var i = this.heroLocations[e];
  17444. return void 0 === i ? (O.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  17445. null) : i
  17446. }
  17447. ,
  17448. n.prototype.findPanoramicHero = function() {
  17449. for (var e in this.heroLocations)
  17450. if (this.heroLocations[e].cameraMode === c.PANORAMA)
  17451. return this.heroLocations[e];
  17452. return null
  17453. }
  17454. ,
  17455. n.prototype.listImagePanos = function() {
  17456. var e = []
  17457. , t = this;
  17458. return this.images.forEach(function(i) {
  17459. if (i.metadata && i.metadata.scan_id) {
  17460. var n = t.panos.get(i.metadata.scan_id);
  17461. n && (t.supportsTiles || n.isLoaded("high") || e.push(n))
  17462. }
  17463. }),
  17464. e
  17465. }
  17466. ,
  17467. n.prototype.fadePanoMarkers = function(e, t) {
  17468. this.panos.fadeMarkerOpacity(e, t)
  17469. }
  17470. ,
  17471. n.prototype.setSweepVisibility = function(e) {
  17472. this.panos.forEach(function(t) {
  17473. t.marker && (t.marker.visible = e)
  17474. })
  17475. }
  17476. ,
  17477. n.prototype.outsideAllowed = function() {
  17478. return this.supportedModes[c.DOLLHOUSE] && this.supportedModes[c.FLOORPLAN]
  17479. }
  17480. ,
  17481. t.exports = n
  17482. }
  17483. ).call(this, "/js/model/Model.js")
  17484. }
  17485. , {
  17486. "../constants": 8,
  17487. "../enum/AlignmentType": 17,
  17488. "../enum/RenderOrder": 42,
  17489. "../enum/Viewmode": 51,
  17490. "../exception/BasicException": 55,
  17491. "../label/Label": 90,
  17492. "../loaders/ModelLoader": 105,
  17493. "../loaders/ModelTextureLoader": 106,
  17494. "../loaders/SweepDataLoader": 107,
  17495. "../tag/tag": 123,
  17496. "../tag/tagManager": 124,
  17497. "../objects/BoundingTextureSkybox": 143,
  17498. "../objects/Chunk": 144,
  17499. "../objects/Floor": 146,
  17500. "../objects/Panorama": 148,
  17501. "../objects/Room": 150,
  17502. "../objects/Snapshot": 153,
  17503. "../settings": 166,
  17504. "../shaders": 167,
  17505. "../util/ModelUrls": 177,
  17506. "../util/PanoramaCollection": 178,
  17507. "../util/ajax": 181,
  17508. "../util/common": 185,
  17509. "../util/easing": 186,
  17510. "../util/lerp": 188,
  17511. "../util/logger": 189,
  17512. "../util/math": 190,
  17513. "../util/texture": 194,
  17514. "../util/transitions": 195,
  17515. "./../util/browser": 182,
  17516. "./../util/showcase": 193,
  17517. "./Chunks": 135,
  17518. "./FloorCollection": 136,
  17519. "./ImageCollection": 137,
  17520. "./LabelCollection": 138,
  17521. "./RoomCollection": 141,
  17522. events: 202,
  17523. three: 217,
  17524. "hot": "hot"
  17525. }],
  17526. 140: [function(e, t, i) {
  17527. "use strict";
  17528. function n() {
  17529. this.modelMap = {},
  17530. this.activeModel = null,
  17531. this.modelCount = 0,
  17532. this.tileDownloader = null,
  17533. this.panoRenderer = null
  17534. }
  17535. var r = (e("three"),
  17536. e("../util/common"))
  17537. , o = e("../exception/BasicException")
  17538. , a = e("../enum/ModelManagerEvents")
  17539. , s = e("../enum/PanoRendererEvents")
  17540. , l = e("events").EventEmitter;
  17541. n.prototype.init = function(e, t, i) {
  17542. this.tileDownloader = e,
  17543. this.panoRenderer = t,
  17544. this.qualityManager = i,
  17545. this.bindEvents()
  17546. }
  17547. ,
  17548. n.prototype.bindEvents = function() {
  17549. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17550. }
  17551. ,
  17552. n.prototype.onTileRendered = function(e, t, i, n) {}
  17553. ,
  17554. n.prototype.addModel = function(e) {
  17555. this.modelMap[e.sid] = e,
  17556. 0 === this.modelCount && this.activateModel(e.sid),
  17557. this.modelCount++,
  17558. this.emit(a.ModelAdded)
  17559. }
  17560. ,
  17561. n.prototype.getModel = function(e) {
  17562. return this.modelMap[e]
  17563. }
  17564. ,
  17565. n.prototype.activateModel = function(e) {
  17566. var t = this.modelMap[e];
  17567. if (!t)
  17568. throw new o("Tried to activate invalid model!");
  17569. var i = this.activeModel;
  17570. this.activeModel = t,
  17571. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  17572. this.tileDownloader.setUrls(t.urls),
  17573. t.panos.forEach(function(e) {
  17574. e.attachToPanoRenderer(this.panoRenderer),
  17575. e.tileDownloader = this.tileDownloader,
  17576. e.qualityManager = this.qualityManager
  17577. }
  17578. .bind(this)),
  17579. this.emit(a.ActiveModelChanged, {
  17580. oldModel: i,
  17581. model: t
  17582. })
  17583. }
  17584. ,
  17585. n.prototype.getActiveModel = function() {
  17586. return this.activeModel
  17587. }
  17588. ,
  17589. r.extend(n, l),
  17590. t.exports = n
  17591. }
  17592. , {
  17593. "../enum/ModelManagerEvents": 33,
  17594. "../enum/PanoRendererEvents": 35,
  17595. "../exception/BasicException": 55,
  17596. "../util/common": 185,
  17597. events: 202,
  17598. three: 217
  17599. }],
  17600. 141: [function(e, t, i) {
  17601. (function(i) {
  17602. "use strict";
  17603. function n() {
  17604. s.call(this)
  17605. }
  17606. var r = e("../objects/Room")
  17607. , o = (e("../settings"),
  17608. e("../util/logger"))
  17609. , a = (e("../util/transitions"),
  17610. e("../util/easing"),
  17611. e("../util/common"))
  17612. , s = e("../util/IndexedCollection")
  17613. , l = e("./Chunks");
  17614. new o(i);
  17615. a.inherit(n, s),
  17616. n.prototype.getIndex = function(e) {
  17617. return e.roomId
  17618. }
  17619. ,
  17620. n.prototype.calcRoomBoundaries = function() {
  17621. this.forEach(function(e) {
  17622. e.calcBoundaries()
  17623. })
  17624. }
  17625. ,
  17626. n.prototype.createFromChunks = function(e) {
  17627. var t = {
  17628. floorId: -1,
  17629. roomId: -1
  17630. }
  17631. , i = {};
  17632. e.forEach(function(e) {
  17633. l.parseIdsFromChunkName(e.name, t);
  17634. var o = i[t.roomId];
  17635. if (!o) {
  17636. var a = n.generateRoomId(t.floorId, t.roomId);
  17637. o = new r(t.floorId,a),
  17638. this.add(o),
  17639. i[t.roomId] = o
  17640. }
  17641. o.addChunk(e)
  17642. }
  17643. .bind(this)),
  17644. this.calcRoomBoundaries()
  17645. }
  17646. ,
  17647. n.generateRoomId = function(e, t) {
  17648. return e + "_" + t
  17649. }
  17650. ,
  17651. t.exports = n
  17652. }
  17653. ).call(this, "/js/model/RoomCollection.js")
  17654. }
  17655. , {
  17656. "../objects/Room": 150,
  17657. "../settings": 166,
  17658. "../util/IndexedCollection": 175,
  17659. "../util/common": 185,
  17660. "../util/easing": 186,
  17661. "../util/logger": 189,
  17662. "../util/transitions": 195,
  17663. "./Chunks": 135
  17664. }],
  17665. 142: [function(e, t, i) {
  17666. "use strict";
  17667. function n(e, t, i) {
  17668. e = e.clone();
  17669. var n = e.size()
  17670. , o = new r.BoxGeometry(n.x,n.y,n.z);
  17671. o.boundingBox = e,
  17672. r.Mesh.call(this, o, t),
  17673. this.position.copy(e.center()),
  17674. this.frustumCulled = !1,
  17675. i && this.add(new r.WireframeHelper(this))
  17676. }
  17677. var r = e("three");
  17678. n.prototype = Object.create(r.Mesh.prototype),
  17679. n.prototype.constructor = n,
  17680. t.exports = n
  17681. }
  17682. , {
  17683. three: 217
  17684. }],
  17685. 143: [function(e, t, i) {
  17686. (function(i) {
  17687. "use strict";
  17688. function n(e) {
  17689. h.time("Computing a nice bounding cubemap");
  17690. var t = new a({
  17691. side: r.BackSide,
  17692. transparent: !0
  17693. });
  17694. t.uniforms.modelAlpha.value = 0,
  17695. t.uniforms.opacity.value = 1 - s.modelAlpha,
  17696. this.renderOrder = l.boundingSkybox,
  17697. o.call(this, e, t),
  17698. h.timeEnd("Computing a nice bounding cubemap")
  17699. }
  17700. var r = e("three")
  17701. , o = (e("../enum/Viewmode"),
  17702. e("../shaders"),
  17703. e("./BoundingMesh"))
  17704. , a = e("../materials/ModelTextureMaterial")
  17705. , s = e("../settings")
  17706. , l = e("../enum/RenderOrder")
  17707. , c = e("../util/logger")
  17708. , h = new c(i);
  17709. n.prototype = Object.create(o.prototype),
  17710. n.prototype.constructor = n,
  17711. t.exports = n
  17712. }
  17713. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  17714. }
  17715. , {
  17716. "../enum/RenderOrder": 42,
  17717. "../enum/Viewmode": 51,
  17718. "../materials/ModelTextureMaterial": 118,
  17719. "../settings": 166,
  17720. "../shaders": 167,
  17721. "../util/logger": 189,
  17722. "./BoundingMesh": 142,
  17723. three: 217
  17724. }],
  17725. 144: [function(e, t, i) {
  17726. "use strict";
  17727. function n(e) {
  17728. this.materialInside = new s({
  17729. side: r.DoubleSide
  17730. });
  17731. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  17732. this.materialOutside = new r.RawShaderMaterial({
  17733. fragmentShader: o.modelOutside.fragmentShader,
  17734. vertexShader: o.modelOutside.vertexShader,
  17735. uniforms: t,
  17736. side: r.FrontSide,
  17737. name: "chunkOut"
  17738. }),
  17739. r.Mesh.call(this, e.geometry, this.materialInside),
  17740. this.name = e.name || "",
  17741. this.textureName = e.textureName,
  17742. this.meshUrl = e.meshUrl
  17743. }
  17744. var r = e("three")
  17745. , o = e("../shaders")
  17746. , a = e("../enum/Viewmode")
  17747. , s = e("../materials/ModelTextureMaterial");
  17748. n.prototype = Object.create(r.Mesh.prototype),
  17749. n.prototype.setTextureMap = function(e) {
  17750. this.materialInside.uniforms.map.value = e,
  17751. this.materialOutside.uniforms.map.value = e
  17752. }
  17753. ,
  17754. n.prototype.setMode = function(e) {
  17755. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  17756. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  17757. t.transparent = this.material.transparent,
  17758. t.uniforms.opacity.value = this.material.uniforms.opacity.value,
  17759. this.material = t
  17760. }
  17761. ,
  17762. t.exports = n
  17763. }
  17764. , {
  17765. "../enum/Viewmode": 51,
  17766. "../materials/ModelTextureMaterial": 118,
  17767. "../shaders": 167,
  17768. three: 217
  17769. }],
  17770. 145: [function(e, t, i) {
  17771. "use strict";
  17772. function n(e) {
  17773. this.chunksize = e || 10,
  17774. this.chunks = {},
  17775. this.boundingBoxes = {},
  17776. this.children = [],
  17777. this.offset = new r.Vector3(0,.5,0),
  17778. this.material = new r.MeshBasicMaterial({
  17779. color: 16777215 * Math.random(),
  17780. side: r.DoubleSide
  17781. })
  17782. }
  17783. var r = e("three");
  17784. e("../enum/Viewmode");
  17785. n.prototype.add = function(e) {
  17786. var t, i, n, o, a, s, l, c, h, u, d, p, f, g, m = e.attributes;
  17787. m ? (t = m.position.array,
  17788. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  17789. n = e.faces);
  17790. var v = new r.Vector3;
  17791. if (i)
  17792. for (o = 0,
  17793. a = i.length; o < a; o += 3) {
  17794. var A = 3 * i[o]
  17795. , y = 3 * i[o + 1]
  17796. , C = 3 * i[o + 2];
  17797. s = (t[A] + t[y] + t[C]) / 3,
  17798. l = (t[A + 1] + t[y + 1] + t[C + 1]) / 3,
  17799. c = (t[A + 2] + t[y + 2] + t[C + 2]) / 3,
  17800. h = Math.floor(s / this.chunksize),
  17801. u = Math.floor(l / this.chunksize),
  17802. d = Math.floor(c / this.chunksize),
  17803. p = h + "." + u + "." + d,
  17804. p in this.chunks ? (g = this.chunks[p],
  17805. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  17806. f = this.boundingBoxes[p] = new r.Box3),
  17807. 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]),
  17808. f.expandByPoint(v.set(t[A], t[A + 1], t[A + 2])),
  17809. f.expandByPoint(v.set(t[y], t[y + 1], t[y + 2])),
  17810. f.expandByPoint(v.set(t[C], t[C + 1], t[C + 2]))
  17811. }
  17812. else
  17813. for (o = 0,
  17814. a = t.length; o < a; o += 9)
  17815. s = (t[o] + t[o + 3] + t[o + 6]) / 3,
  17816. l = (t[o + 1] + t[o + 4] + t[o + 7]) / 3,
  17817. c = (t[o + 2] + t[o + 5] + t[o + 8]) / 3,
  17818. h = Math.floor(s / this.chunksize),
  17819. u = Math.floor(l / this.chunksize),
  17820. d = Math.floor(c / this.chunksize),
  17821. p = h + "." + u + "." + d,
  17822. p in this.chunks ? (g = this.chunks[p],
  17823. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  17824. f = this.boundingBoxes[p] = new r.Box3),
  17825. 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]),
  17826. f.expandByPoint(v.set(t[o], t[o + 1], t[o + 2])),
  17827. f.expandByPoint(v.set(t[o + 3], t[o + 4], t[o + 5])),
  17828. f.expandByPoint(v.set(t[o + 6], t[o + 7], t[o + 8]))
  17829. }
  17830. ,
  17831. n.prototype.build = function() {
  17832. var e = new r.Object3D;
  17833. e.material = this.material;
  17834. for (var t in this.chunks) {
  17835. var i = this.chunks[t]
  17836. , n = new r.BufferGeometry;
  17837. n.addAttribute("position", new r.BufferAttribute(new Float32Array(i),3)),
  17838. n.boundingBox = this.boundingBoxes[t];
  17839. var o = new r.Mesh(n,this.material);
  17840. o.material.visible = !1,
  17841. e.add(o),
  17842. this.chunks[t] = []
  17843. }
  17844. return e
  17845. }
  17846. ,
  17847. t.exports = n
  17848. }
  17849. , {
  17850. "../enum/Viewmode": 51,
  17851. three: 217
  17852. }],
  17853. 146: [function(e, t, i) {
  17854. "use strict";
  17855. function n(e, t, i) {
  17856. r.Object3D.call(this),
  17857. this.model = e,
  17858. this.floorIndex = t,
  17859. this.name = i || d.FLOOR_NAME + (t + 1),
  17860. this.panos = [],
  17861. this.chunks = [],
  17862. this.colliderBuilder = new l(3),
  17863. this.collider = null,
  17864. this.center = null,
  17865. this.boundingBox = new r.Box3,
  17866. this.size = null,
  17867. this.hidden = !1,
  17868. this.conservativeBoundingBox = new r.Box3,
  17869. this.debugColor = 16777215 * Math.random(),
  17870. this.transition = null
  17871. }
  17872. var r = e("three")
  17873. , o = e("../settings")
  17874. , a = e("../util/common")
  17875. , s = e("../util/lerp")
  17876. , l = e("./ChunkedCollider")
  17877. , c = e("../util/transitions")
  17878. , h = e("../util/easing")
  17879. , u = (e("../objects/Panorama"),
  17880. e("../enum/RenderOrder"))
  17881. , d = e("../localization/localize");
  17882. n.prototype = Object.create(r.Object3D.prototype),
  17883. n.prototype.enter = function(e) {
  17884. this.model.setFloor(this, e)
  17885. }
  17886. ,
  17887. n.prototype.hide = function(e) {
  17888. if (!this.hidden || this.transition) {
  17889. this.chunks.forEach(function(e) {
  17890. e.material.transparent = !0
  17891. }),
  17892. c.cancel(this.transition);
  17893. var t = e ? 0 : o.hideFloorDuration + o.hideFloorDelay
  17894. , i = e ? 0 : o.hideFloorDelay / t;
  17895. this.transition = c.start(s.allUniforms(this.chunks, "opacity", .08), t, function() {
  17896. this.hidden = !0
  17897. }
  17898. .bind(this), i, h.easeInOutQuad)
  17899. }
  17900. }
  17901. ,
  17902. n.prototype.show = function(e) {
  17903. if (this.hidden || this.transition) {
  17904. this.hidden = !1,
  17905. c.cancel(this.transition);
  17906. var t = e ? o.showFloorDuration : o.showFloorDuration + o.showFloorDelay
  17907. , i = e ? 0 : o.showFloorDelay / t;
  17908. this.transition = c.start(s.allUniforms(this.chunks, "opacity", 1), t, function() {
  17909. this.hidden || this.chunks.forEach(function(e) {
  17910. e.material.transparent = !1
  17911. })
  17912. }
  17913. .bind(this), i, h.easeInOutQuad)
  17914. }
  17915. }
  17916. ,
  17917. n.prototype.toggle = function(e, t) {
  17918. e = void 0 === e ? this.hidden : e,
  17919. e ? this.show(t) : this.hide(t)
  17920. }
  17921. ,
  17922. n.prototype.containsPoint = function(e) {
  17923. return this.collider.children.some(function(t) {
  17924. return t.geometry.boundingBox || t.geometry.computeBoundingBox(),
  17925. t.geometry.boundingBox.containsPoint(e)
  17926. })
  17927. }
  17928. ,
  17929. n.prototype.distanceToPoint = function(e) {
  17930. var t = null
  17931. , i = 1 / 0;
  17932. return this.collider.children.forEach(function(n) {
  17933. n.geometry.boundingBox || n.geometry.computeBoundingBox();
  17934. var r = n.geometry.boundingBox.distanceToPoint(e);
  17935. (!t || i > r) && (i = r,
  17936. t = n)
  17937. }),
  17938. i
  17939. }
  17940. ,
  17941. n.prototype.addChunk = function(e) {
  17942. e.renderOrder = u.ghostFloor,
  17943. this.add(e),
  17944. this.chunks.push(e),
  17945. this.boundingBox.union(e.geometry.boundingBox),
  17946. this.size = this.boundingBox.size(),
  17947. this.colliderBuilder.add(e.geometry)
  17948. }
  17949. ,
  17950. n.prototype.addPano = function(e) {
  17951. this.panos.push(e),
  17952. this.add(e.skyboxMesh),
  17953. e.marker && this.add(e.marker);
  17954. var t = new r.Vector3(1,1,1)
  17955. , i = (new r.Box3).setFromCenterAndSize(e.position, t);
  17956. this.boundingBox.union(i)
  17957. }
  17958. ,
  17959. n.prototype.build = function() {
  17960. this.collider = this.colliderBuilder.build(!0),
  17961. this.add(this.collider),
  17962. this.center = this.boundingBox.center(),
  17963. this.conservativeBoundingBox.copy(this.boundingBox),
  17964. this.conservativeBoundingBox.min.y = a.lowerMedian(this.collider.children.map(function(e) {
  17965. return e.geometry.boundingBox.min.y
  17966. }), 5),
  17967. this.conservativeBoundingBox.max.y = a.lowerMedian(this.collider.children.map(function(e) {
  17968. return e.geometry.boundingBox.max.y
  17969. }), 5),
  17970. this.colliderBuilder = null
  17971. }
  17972. ,
  17973. n.prototype.toShortString = function() {
  17974. return a.nth(this.floorIndex + 1)
  17975. }
  17976. ,
  17977. n.prototype.toString = function() {
  17978. return this.name
  17979. }
  17980. ,
  17981. t.exports = n
  17982. }
  17983. , {
  17984. "../enum/RenderOrder": 42,
  17985. "../localization/localize": 108,
  17986. "../objects/Panorama": 148,
  17987. "../settings": 166,
  17988. "../util/common": 185,
  17989. "../util/easing": 186,
  17990. "../util/lerp": 188,
  17991. "../util/transitions": 195,
  17992. "./ChunkedCollider": 145,
  17993. three: 217
  17994. }],
  17995. 147: [function(e, t, i) {
  17996. "use strict";
  17997. function n(e) {
  17998. this.player = e,
  17999. this.obj3d = null,
  18000. this.UP = new r.Vector3(0,1,0)
  18001. }
  18002. var r = e("three")
  18003. , o = e("../settings");
  18004. n.prototype.prefs = {
  18005. linewidth: 3,
  18006. height: .07,
  18007. opacity: .45,
  18008. endScale: .05
  18009. },
  18010. n.prototype.discard = function() {
  18011. if (this.obj3d) {
  18012. var e = this.obj3d.parent;
  18013. e && e.remove(this.obj3d)
  18014. }
  18015. this.obj3d = null
  18016. }
  18017. ,
  18018. n.prototype.draw = function() {
  18019. if (this.discard(),
  18020. o.showNeighbors) {
  18021. var e = this.player.currentPano.floor;
  18022. this.obj3d = new r.Object3D;
  18023. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  18024. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  18025. i.y += this.prefs.height;
  18026. var n = .1525
  18027. , a = .127
  18028. , s = .0127
  18029. , l = .1
  18030. , c = .19
  18031. , h = .2032
  18032. , u = .2286
  18033. , d = .255
  18034. , p = new r.Matrix4;
  18035. for (var f in t)
  18036. if (t[f]) {
  18037. var g = this.player.model.panos.get(f)
  18038. , m = (g.position.clone().sub(this.player.model.position),
  18039. g.position.clone().sub(g.floorPosition))
  18040. , v = g.floorPosition.clone().sub(this.player.model.position);
  18041. v.y += this.prefs.height;
  18042. var A = new r.Geometry;
  18043. 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)),
  18044. 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)),
  18045. p.identity().setPosition(m),
  18046. A.applyMatrix(p),
  18047. A.vertices.push(new r.Vector3(0,-this.prefs.endScale,0)),
  18048. 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)),
  18049. p.lookAt(v, i, this.UP).setPosition(v),
  18050. A.applyMatrix(p),
  18051. A.vertices.push(v, i);
  18052. var y = new r.Line(A,new r.LineBasicMaterial({
  18053. color: g.debugColor.getHex(),
  18054. transparent: !0,
  18055. opacity: this.prefs.opacity,
  18056. depthWrite: !1,
  18057. name: "sLine" + f,
  18058. linewidth: this.prefs.linewidth
  18059. }));
  18060. this.obj3d.add(y)
  18061. }
  18062. e.add(this.obj3d)
  18063. }
  18064. }
  18065. ,
  18066. n.prototype.update = function() {
  18067. o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  18068. }
  18069. ,
  18070. t.exports = n
  18071. }
  18072. , {
  18073. "../settings": 166,
  18074. three: 217
  18075. }],
  18076. 148: [function(e, t, i) {
  18077. (function(i) {
  18078. "use strict";
  18079. function n(e, t, i, n) {
  18080. this.model = e,
  18081. this.id = t,
  18082. this.alignmentType = i.alignmentType || l.ALIGNED,
  18083. this.neighbourUUIDs = i.neighbours || null,
  18084. this.neighbourPanos = null,
  18085. this.floor = null,
  18086. this.floorIndex = i.floor,
  18087. this.failedLoadingAt = 0,
  18088. this.maxLoadRetries = 4,
  18089. this.origin = i.position.clone(),
  18090. this.position = this.alignmentType === l.UNALIGNED ? new r.Vector3(0,-5,0) : i.position.clone(),
  18091. this.quaternion = i.quaternion.clone(),
  18092. this.skyboxMesh = new r.Mesh(E),
  18093. this.skyboxMesh.position.copy(this.position),
  18094. this.skyboxMesh.quaternion.copy(this.quaternion),
  18095. this.skyboxMesh.name = "skybox",
  18096. this.skyboxMesh.visible = !1,
  18097. this.skyboxMesh.updateMatrix(),
  18098. this.skyboxMesh.updateMatrixWorld(),
  18099. this.marker = null,
  18100. this.isAligned() && (this.marker = new r.Mesh(b,new r.MeshBasicMaterial({
  18101. map: w,
  18102. side: r.DoubleSide,
  18103. opacity: 0,
  18104. transparent: !0,
  18105. depthWrite: !1
  18106. })),
  18107. this.marker.renderOrder = s.panoMarker,
  18108. this.marker.name = "marker",
  18109. this.marker.pano = this,
  18110. this.marker.layers.set(v.PANOMARKERS),
  18111. this.marker.updateMatrixWorld(),
  18112. a.colorMarkerOnLoad && this.on("load", function() {
  18113. this.marker.material.color.set(65280)
  18114. })),
  18115. this.debugColor = (new r.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  18116. this.floorPosition = i.puck ? i.puck.clone() : null,
  18117. this.tiled = n,
  18118. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new r.Texture([null, null, null, null, null, null]),
  18119. this.solidSkybox.flipY = !1,
  18120. a.minimalMemoryMode && (this.solidSkybox.minFilter = r.LinearFilter,
  18121. this.solidSkybox.magFilter = r.LinearFilter,
  18122. this.solidSkybox.generateMipmaps = !1)),
  18123. this.zoomed = !1,
  18124. this.panoRenderer = null,
  18125. this.qualityManager = null,
  18126. this.tileDownloader = null,
  18127. this.tiledPanoRenderTarget = null,
  18128. this.minimumTiledPanoLoaded = !1,
  18129. this.highestPartialTileRenderOpCompleted = 0,
  18130. this.highestFullTileRenderOpCompleted = 0,
  18131. this.shouldRedrawOnBaseLoaded = !1,
  18132. this.lockUntilRenderingComplete = !1,
  18133. a.colorMarkerOnLoad && this.on("load", function() {
  18134. this.marker.material.color.set(65280)
  18135. })
  18136. }
  18137. var r = e("three")
  18138. , o = e("../util/logger")
  18139. , a = e("../settings")
  18140. , s = (e("../enum/Viewmode"),
  18141. e("../enum/RenderOrder"))
  18142. , l = e("../enum/AlignmentType")
  18143. , c = (e("../util/common"),
  18144. e("../util/transitions"))
  18145. , h = e("../util/lerp")
  18146. , u = e("../util/ajax")
  18147. , d = e("../util/texture")
  18148. , p = e("../util/panorama")
  18149. , f = (e("../enum/TileDownloaderEvents"),
  18150. e("../enum/PanoramaEvents"))
  18151. , g = e("../enum/PanoRendererEvents")
  18152. , m = e("../enum/PanoSizeClass")
  18153. , v = e("../enum/RenderLayers")
  18154. , A = (e("../scene/SceneRenderer"),
  18155. e("../enum/GLCubeFaces"),
  18156. e("../exception/BasicException"))
  18157. , y = e("../tile/TileUtils")
  18158. , C = e("events").EventEmitter
  18159. , I = new o(i)
  18160. , E = new r.SphereBufferGeometry(.1)
  18161. , b = new r.PlaneBufferGeometry(.4,.4,1,1)
  18162. , w = d.load("./images/marker-256x256.png");
  18163. n.prototype = Object.create(C.prototype),
  18164. n.prototype.enter = function() {
  18165. var e = null;
  18166. return function() {
  18167. this.setZoomed(!1),
  18168. this.emit("enter", {
  18169. oldPano: e,
  18170. newPano: this
  18171. }),
  18172. e = this
  18173. }
  18174. }(),
  18175. n.prototype.exit = function() {
  18176. this.tiled ? (this.clearWaitDeferreds(),
  18177. this.minimumTiledPanoLoaded = !1,
  18178. this.tiledPanoRenderTarget = null,
  18179. this.setZoomed(!1),
  18180. this.panoRenderer.deactivateTiledPano(this),
  18181. this.highestPartialTileRenderOpCompleted = 0,
  18182. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  18183. this.solidSkybox.loaded = !1,
  18184. this.solidSkybox.version = 0),
  18185. this.emit("exit")
  18186. }
  18187. ,
  18188. n.prototype.hoverOn = function(e) {
  18189. this.marker && (c.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  18190. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  18191. }
  18192. ,
  18193. n.prototype.hoverOff = function(e) {
  18194. this.marker && c.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  18195. }
  18196. ,
  18197. n.prototype.build1 = function() {
  18198. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
  18199. this.floor.addPano(this),
  18200. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  18201. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  18202. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  18203. }
  18204. ,
  18205. n.prototype.build2 = function() {
  18206. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  18207. this.height = this.position.distanceTo(this.floorPosition),
  18208. this.placeMarker()
  18209. }
  18210. ,
  18211. n.prototype.interpolateFloorPosition = function() {
  18212. var e = this.model.panos.filter(n.filters.isNeighbourPanoTo(this)).filter(function(e) {
  18213. return !!e.floorPosition
  18214. }).sort(function(e, t) {
  18215. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  18216. }
  18217. .bind(this))
  18218. , t = this.position.clone();
  18219. return e.length >= 2 ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  18220. t
  18221. }
  18222. ,
  18223. n.prototype.raycastFloorPosition = function() {
  18224. I.warn("Performance warning: Raycasting to find floor position");
  18225. var e = new r.Raycaster(this.position,new r.Vector3(0,-1,0))
  18226. , t = e.intersectObjects(this.model.colliders);
  18227. return t.length ? t[0].point : null
  18228. }
  18229. ,
  18230. n.prototype.raycastToFindFloor = function() {
  18231. 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)];
  18232. return function() {
  18233. I.warn("Performance warning: Raycasting to find floor index");
  18234. for (var t = 0; t < e.length; t++) {
  18235. var i = new r.Raycaster(this.position.clone(),e[t].clone())
  18236. , n = i.intersectObjects(this.model.colliders);
  18237. if (n.length)
  18238. return n[0].object.parent.parent
  18239. }
  18240. return null
  18241. }
  18242. }(),
  18243. n.prototype.placeMarker = function() {
  18244. this.marker && (this.marker.position.copy(this.floorPosition),
  18245. this.marker.position.y += .05,
  18246. this.marker.lookAt(new r.Vector3(0,1,0).add(this.marker.position)))
  18247. }
  18248. ,
  18249. n.prototype.translate = function(e) {
  18250. this.position.add(e),
  18251. this.floorPosition.add(e)
  18252. }
  18253. ,
  18254. n.prototype.findClosestMidtpointPanoTo = function(e) {
  18255. (new r.Vector3).addVectors(this.position, e.position).divideScalar(2);
  18256. return this.model.panos.find([n.filters.notIn([this, e])], [n.sortFunctions.distanceToPoint(point)])
  18257. }
  18258. ,
  18259. n.prototype.attachToPanoRenderer = function(e) {
  18260. this.panoRenderer = e,
  18261. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  18262. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  18263. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  18264. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  18265. }
  18266. ;
  18267. var _ = {};
  18268. n.prototype.getWaitDeferred = function(e) {
  18269. var t = _[this.id];
  18270. t || (t = {},
  18271. _[this.id] = t);
  18272. var i = t[e];
  18273. return i || (i = {
  18274. deferred: $.Deferred(),
  18275. active: !1
  18276. },
  18277. t[e] = i),
  18278. i
  18279. }
  18280. ,
  18281. n.prototype.resetWaitDeferred = function(e) {
  18282. var t = this.getWaitDeferred(e);
  18283. t.active = !1,
  18284. t.deferred = $.Deferred()
  18285. }
  18286. ,
  18287. n.prototype.clearWaitDeferreds = function() {
  18288. var e = _[this.id];
  18289. e || (e = {},
  18290. _[this.id] = e);
  18291. for (var t in e)
  18292. if (e.hasOwnProperty(t)) {
  18293. var i = e[t];
  18294. i.active = !1,
  18295. i.deferred = $.Deferred()
  18296. }
  18297. }
  18298. ,
  18299. n.prototype.loadTiledPano = function() {
  18300. var e = (new r.Vector3,
  18301. [])
  18302. , t = [];
  18303. return function(i, n, r, o, a, s) {
  18304. null !== o && void 0 !== o || (o = !0),
  18305. null !== a && void 0 !== a || (a = !0);
  18306. var l = this.getWaitDeferred(i)
  18307. , c = l.deferred
  18308. , h = null
  18309. , u = null;
  18310. if (r && ("number" == typeof r ? h = r : (h = r.hFov,
  18311. u = r.vFov)),
  18312. !this.isLoaded(i)) {
  18313. if (!l.active) {
  18314. if (l.active = !0,
  18315. r) {
  18316. var d = y.matchingTilesInDirection(this, i, n, h, u);
  18317. e[this.id + ":" + i] = {
  18318. tileCount: 0,
  18319. targetTileCount: d
  18320. },
  18321. I.info("Loading partial pano: " + this.id + " with " + d + " tiles")
  18322. }
  18323. t[this.id] || (t[this.id] = !0,
  18324. this.on(f.LoadComplete, function(e, t) {
  18325. var i = this.getWaitDeferred(e).deferred;
  18326. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  18327. this.resetWaitDeferred(e))
  18328. }
  18329. .bind(this)),
  18330. this.on(f.LoadFailed, function(e) {
  18331. var t = this.getWaitDeferred(e).deferred;
  18332. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  18333. this.resetWaitDeferred(e))
  18334. }
  18335. .bind(this)),
  18336. this.on(f.TileLoaded, function(t, i, n) {
  18337. var r = this.getWaitDeferred(t).deferred;
  18338. if (r && "pending" === r.state()) {
  18339. r.notify(t, i, n);
  18340. var o = e[this.id + ":" + t];
  18341. o && (o.tileCount++,
  18342. o.tileCount === o.targetTileCount && (this.onPanoRendered(this.id, t, n, !0),
  18343. r.resolve(t, n),
  18344. this.resetWaitDeferred(t)))
  18345. }
  18346. }
  18347. .bind(this)))
  18348. }
  18349. this.tileDownloader.clearForceQueue(),
  18350. this.tileDownloader.forceQueueTilesForPano(this, i, n, h, u, s),
  18351. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), o),
  18352. this.panoRenderer.renderPanoTiles(this.id, n, a)
  18353. }
  18354. return c.promise()
  18355. }
  18356. }(),
  18357. n.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  18358. if (e === this.id) {
  18359. var n = this.qualityManager.getPanoSize(m.BASE);
  18360. t === n && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  18361. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  18362. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  18363. }
  18364. }
  18365. ,
  18366. n.prototype.onTileRendered = function(e, t, i, n) {
  18367. e === this.id && this.emit(f.TileLoaded, t, i, n)
  18368. }
  18369. ,
  18370. n.prototype.onPanoRendered = function(e, t, i, n) {
  18371. e === this.id && (this.minimumTiledPanoLoaded = !0,
  18372. this.updateSkyboxForZoomLevel(),
  18373. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  18374. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  18375. this.emit("load", t),
  18376. this.model.emit("load", this),
  18377. this.emit(f.LoadComplete, t, i))
  18378. }
  18379. ,
  18380. n.prototype.setZoomed = function(e) {
  18381. this.zoomed = e,
  18382. this.updateSkyboxForZoomLevel()
  18383. }
  18384. ,
  18385. n.prototype.ensureSkyboxReadyForRender = function() {
  18386. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  18387. this.solidSkybox.loaded = !0)
  18388. }
  18389. ,
  18390. n.prototype.updateSkyboxForZoomLevel = function() {
  18391. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  18392. }
  18393. ,
  18394. n.prototype.getSkyboxTexture = function() {
  18395. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  18396. }
  18397. ,
  18398. n.prototype.onTileRenderFail = function(e, t, i) {
  18399. e === this.id && this.emit(f.LoadFailed, t)
  18400. }
  18401. ,
  18402. n.prototype.isLoaded = function(e) {
  18403. if (this.tiled) {
  18404. if (e && "string" == typeof e)
  18405. throw new A("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  18406. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  18407. }
  18408. if (e && "number" == typeof e)
  18409. throw new A("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  18410. return !!this.solidSkybox.high || e in this.solidSkybox
  18411. }
  18412. ,
  18413. n.prototype.loadCube = function(e) {
  18414. if (this.isLoaded(e))
  18415. return I.info("Skipping load of pano, already loaded"),
  18416. $.when();
  18417. this.emit("loading", e),
  18418. this.model.emit("loading", this);
  18419. var t = p.getCubemapUrls(this.model.urls, this.id, e)
  18420. , i = t.filter(function(e) {
  18421. return !e
  18422. });
  18423. "low" === e && i.length > 0 && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  18424. e = "high",
  18425. t = p.getCubemapUrls(this.model.urls, this.id, e));
  18426. var n = 0
  18427. , r = [0, 1, 2, 3, 4, 5].map(function(e, i, n) {
  18428. return u.getImage(t[i])
  18429. }
  18430. .bind(this));
  18431. return $.when(r[0], r[1], r[2], r[3], r[4], r[5]).then(function(t, i, n, r, o, a) {
  18432. return this.solidSkybox[e] = [t, i, n, r, o, a],
  18433. "high" !== e && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[e],
  18434. this.solidSkybox.low = null),
  18435. this.solidSkybox.needsUpdate = !0,
  18436. this.emit("load", e),
  18437. this.model.emit("load", this),
  18438. this
  18439. }
  18440. .bind(this), function() {
  18441. I.error("Downloading cubemap for pano", this.id, "failed"),
  18442. this.failedLoadingAt = Date.now()
  18443. }
  18444. .bind(this), function() {
  18445. return $.when(++n, 6)
  18446. })
  18447. }
  18448. ,
  18449. n.raycastsSkipped = 0,
  18450. n.raycastsDone = 0,
  18451. n.prototype.findNeighourPanos = function() {
  18452. return this.model.panos.setNeighbour(this.id, this.id, !1),
  18453. this.model.panos.forEach(function(e) {
  18454. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  18455. var t = this.position.distanceTo(e.position);
  18456. if (t > a.panoramaNeighbourMaxDistance)
  18457. return this.model.panos.setNeighbour(this, e, !1),
  18458. void n.raycastsSkipped++;
  18459. var i = e.position.clone().sub(this.position).normalize()
  18460. , o = new r.Raycaster(this.position,i.clone(),0,t)
  18461. , s = o.intersectObjects(this.model.colliders);
  18462. n.raycastsDone++,
  18463. this.model.panos.setNeighbour(this, e, 0 === s.length),
  18464. 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)))
  18465. }
  18466. }
  18467. .bind(this)),
  18468. this.model.panos.neighbourMap[this.id]
  18469. }
  18470. ,
  18471. n.prototype.worldPosition = function() {
  18472. return this.position
  18473. }
  18474. ,
  18475. n.prototype.addTextSprite = function(e, t) {
  18476. this.removeTextSprite();
  18477. var i = document.createElement("canvas")
  18478. , n = i.getContext("2d");
  18479. i.width = 256,
  18480. i.height = 256;
  18481. var o = "Arial"
  18482. , a = 60;
  18483. n.font = "bold " + a + "px " + o,
  18484. n.fillStyle = "white";
  18485. var s = n.measureText(e).width;
  18486. n.fillText(e, (i.width - s) / 2, (i.height + a) / 2);
  18487. var l = new r.Texture(i);
  18488. l.needsUpdate = !0;
  18489. var c = new r.SpriteMaterial({
  18490. map: l,
  18491. color: t || 16428055
  18492. });
  18493. this.text3d = new r.Sprite(c),
  18494. this.text3d.position.copy(this.skyboxMesh.position),
  18495. this.floor.add(this.text3d)
  18496. }
  18497. ,
  18498. n.prototype.removeTextSprite = function() {
  18499. this.text3d && (this.floor.remove(this.text3d),
  18500. this.text3d = null)
  18501. }
  18502. ,
  18503. n.prototype.isAligned = function() {
  18504. return this.alignmentType === l.ALIGNED
  18505. }
  18506. ,
  18507. n.filters = {
  18508. inDirection: function(e, t, i) {
  18509. return function(n) {
  18510. var r = n.position.clone().sub(e).normalize();
  18511. return r.dot(t) > i
  18512. }
  18513. },
  18514. inFloorDirection: function(e, t, i) {
  18515. return function(n) {
  18516. var r = n.floorPosition.clone().sub(e).normalize();
  18517. return r.dot(t) > i
  18518. }
  18519. },
  18520. inPanoDirection: function(e, t, i) {
  18521. return i = a.navigation.panoScores ? a.navigation.filterStrictness : i,
  18522. function(n) {
  18523. var r = n.floorPosition.clone().sub(e).normalize()
  18524. , o = n.position.clone().sub(e).normalize();
  18525. return r.dot(t) > i || o.dot(t) > i
  18526. }
  18527. },
  18528. atFloor: function(e) {
  18529. return function(t) {
  18530. return !e || t.floor === e
  18531. }
  18532. },
  18533. not: function(e) {
  18534. return function(t) {
  18535. return t !== e
  18536. }
  18537. },
  18538. notIn: function(e) {
  18539. return function(t) {
  18540. return e.indexOf(t) === -1
  18541. }
  18542. },
  18543. isLoaded: function() {
  18544. return function(e) {
  18545. return e.isLoaded()
  18546. }
  18547. },
  18548. isNotLoaded: function() {
  18549. return function(e) {
  18550. return !e.isLoaded()
  18551. }
  18552. },
  18553. isCloseEnoughTo: function(e, t) {
  18554. return function(i) {
  18555. return e.distanceTo(i.floorPosition) < t
  18556. }
  18557. },
  18558. hasMinimumHeightDifferenceTo: function(e, t) {
  18559. return function(i) {
  18560. return Math.abs(i.position.y - e.y) > t
  18561. }
  18562. },
  18563. isNotBehindNormal: function(e, t) {
  18564. var i = new r.Vector3;
  18565. return t = t.clone(),
  18566. function(n) {
  18567. var r = i.copy(n.position).sub(e).normalize();
  18568. return r.dot(t) > 0
  18569. }
  18570. },
  18571. isNeighbourPanoTo: function(e) {
  18572. return function(t) {
  18573. return !e || !e.neighbourPanos || !!e.neighbourPanos[t.id]
  18574. }
  18575. },
  18576. isNeighbourOfNeighbourTo: function(e) {
  18577. return function(t) {
  18578. return !!e.neighbourPanos[t.id] || e.neighbourUUIDs.some(function(i) {
  18579. var n = e.model.panos.get(i);
  18580. return !!n && n.neighbourPanos[t.id]
  18581. })
  18582. }
  18583. },
  18584. isNotRecentlyFailed: function(e) {
  18585. return function(t) {
  18586. return Date.now() - t.failedLoadingAt > e
  18587. }
  18588. },
  18589. isOnVisibleFloor: function() {
  18590. return function(e) {
  18591. return !e.floor.hidden
  18592. }
  18593. },
  18594. isPanoAligned: function() {
  18595. return function(e) {
  18596. return e.isAligned()
  18597. }
  18598. }
  18599. },
  18600. n.sortFunctions = {
  18601. distanceToPoint: function(e) {
  18602. return function(t, i) {
  18603. return t.position.distanceTo(e) - i.position.distanceTo(e)
  18604. }
  18605. },
  18606. floorDistanceToPoint: function(e) {
  18607. return function(t, i) {
  18608. return t.floorPosition.distanceTo(e) - i.floorPosition.distanceTo(e)
  18609. }
  18610. },
  18611. choose: function(e) {
  18612. return function(t, i) {
  18613. return e.id === t.id ? -1 : e.id === i.id ? 1 : 0
  18614. }
  18615. }
  18616. },
  18617. n.scoreFunctions = {
  18618. distance: function(e, t) {
  18619. return t = t || a.navigation.distanceFactor,
  18620. function(i) {
  18621. return e ? e.position.distanceTo(i.position) * t : 0
  18622. }
  18623. },
  18624. distanceSquared: function(e, t) {
  18625. return t = t || a.navigation.distanceFactor,
  18626. function(i) {
  18627. return e ? e.position.distanceToSquared(i.position) * t : 0
  18628. }
  18629. },
  18630. direction: function(e, t) {
  18631. return function(i) {
  18632. var n = i.position.clone().sub(e).normalize();
  18633. return n.dot(t) * a.navigation.directionFactor
  18634. }
  18635. },
  18636. angle: function(e, t) {
  18637. return function(i) {
  18638. var n = i.position.clone().sub(e).normalize();
  18639. return n.angleTo(t) * a.navigation.angleFactor
  18640. }
  18641. },
  18642. inFieldOfView: function(e, t) {
  18643. return function(i) {
  18644. var n = i.position.clone().sub(e).normalize();
  18645. return n.dot(t) > .75 ? 10 : -1
  18646. }
  18647. },
  18648. optionality: function(e) {
  18649. return function(t) {
  18650. var i = t.neighbourUUIDs.filter(function(t) {
  18651. return !(t in e.neighbourUUIDs) && t !== e.id
  18652. });
  18653. return i.length * a.navigation.optionalityFactor
  18654. }
  18655. },
  18656. penalizeHeightDifferenceUnder: function(e, t) {
  18657. return function(i) {
  18658. return e.y - i.position.y < t ? -20 : 0
  18659. }
  18660. }
  18661. },
  18662. t.exports = n
  18663. }
  18664. ).call(this, "/js/objects/Panorama.js")
  18665. }
  18666. , {
  18667. "../enum/AlignmentType": 17,
  18668. "../enum/GLCubeFaces": 25,
  18669. "../enum/PanoRendererEvents": 35,
  18670. "../enum/PanoSizeClass": 36,
  18671. "../enum/PanoramaEvents": 37,
  18672. "../enum/RenderLayers": 41,
  18673. "../enum/RenderOrder": 42,
  18674. "../enum/TileDownloaderEvents": 45,
  18675. "../enum/Viewmode": 51,
  18676. "../exception/BasicException": 55,
  18677. "../scene/SceneRenderer": 158,
  18678. "../settings": 166,
  18679. "../tile/TileUtils": 174,
  18680. "../util/ajax": 181,
  18681. "../util/common": 185,
  18682. "../util/lerp": 188,
  18683. "../util/logger": 189,
  18684. "../util/panorama": 191,
  18685. "../util/texture": 194,
  18686. "../util/transitions": 195,
  18687. events: 202,
  18688. three: 217
  18689. }],
  18690. 149: [function(e, t, i) {
  18691. "use strict";
  18692. function n(e) {
  18693. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  18694. t.map.value = d,
  18695. t.opacity.value = 0,
  18696. t.color.value.set(o.reticuleColor),
  18697. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  18698. side: r.DoubleSide,
  18699. depthWrite: !1,
  18700. depthTest: !1,
  18701. transparent: !0,
  18702. vertexShader: c.waypoint.vertexShader,
  18703. fragmentShader: c.waypoint.fragmentShader,
  18704. uniforms: t,
  18705. name: "waypoint",
  18706. opacity: 0
  18707. })),
  18708. this.layers.set(h.RETICULE),
  18709. this.renderOrder = u.reticule,
  18710. this.player = e,
  18711. this.direction = new r.Vector3,
  18712. this.hidden = !0,
  18713. this.mouseLastMoveTime = Date.now()
  18714. }
  18715. var r = e("three")
  18716. , o = e("../settings")
  18717. , a = e("../util/transitions")
  18718. , s = e("../util/texture")
  18719. , l = e("../util/lerp")
  18720. , c = e("../shaders")
  18721. , h = e("../enum/RenderLayers")
  18722. , u = e("../enum/RenderOrder")
  18723. , d = s.load("./images/reticule-256x256.png");
  18724. n.prototype = Object.create(r.Mesh.prototype),
  18725. n.prototype.move = function(e, t, i) {
  18726. this.hidden = i,
  18727. this.mouseLastMoveTime = Date.now()
  18728. }
  18729. ,
  18730. n.prototype.hide = function() {
  18731. this.hidden || (this.hidden = !0,
  18732. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  18733. }
  18734. ,
  18735. n.prototype.show = function() {
  18736. this.hidden = !1,
  18737. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  18738. }
  18739. ,
  18740. n.prototype.update = function() {
  18741. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  18742. }
  18743. ,
  18744. n.prototype.updatePosition = function(e, t) {
  18745. if (!this.hidden) {
  18746. if (!t)
  18747. return this.hide();
  18748. var i = t.point
  18749. , n = e.distanceTo(i)
  18750. , r = 1 + .01 * n;
  18751. n < 1 && (r -= 1 - n),
  18752. this.show(),
  18753. this.scale.set(r, r, r),
  18754. this.direction = this.direction.multiplyScalar(.8),
  18755. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  18756. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  18757. this.lookAt(this.position.clone().add(this.direction))
  18758. }
  18759. }
  18760. ,
  18761. n.prototype.writeAstag = function() {
  18762. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  18763. , t = new Date;
  18764. this.tagCount = "undefined" == typeof this.tagCount ? 1 : this.tagCount + 1;
  18765. var i = {
  18766. enabled: !0,
  18767. version: "0",
  18768. created: t.toISOString(),
  18769. created_by: "APITest",
  18770. position: this.position.clone(),
  18771. stem: {
  18772. enabled: o.tags.pole.enabled,
  18773. direction: this.direction.multiplyScalar(o.tags.pole.height)
  18774. },
  18775. label: "tag " + this.tagCount,
  18776. description: "Description " + e,
  18777. floor: function(e) {
  18778. if (e.currentFloor) {
  18779. var t = e.floors.indexOf(e.currentFloor);
  18780. return t > -1 ? t : void 0
  18781. }
  18782. }(this.player.model),
  18783. type: "info",
  18784. metadata: {
  18785. preferred_camera: {
  18786. mode: this.player.mode
  18787. }
  18788. }
  18789. };
  18790. console.log("--------------------------"),
  18791. console.log(JSON.stringify(i));
  18792. var n = this.player.model.addtag(e, i).build();
  18793. n && (n.disc && this.player.tagDiscs.push(n.disc),
  18794. n.visible || n.show(o.tags.startup.fadeInDuration))
  18795. }
  18796. ,
  18797. t.exports = n
  18798. }
  18799. , {
  18800. "../enum/RenderLayers": 41,
  18801. "../enum/RenderOrder": 42,
  18802. "../settings": 166,
  18803. "../shaders": 167,
  18804. "../util/lerp": 188,
  18805. "../util/texture": 194,
  18806. "../util/transitions": 195,
  18807. three: 217
  18808. }],
  18809. 150: [function(e, t, i) {
  18810. "use strict";
  18811. function n(e, t) {
  18812. this.chunks = [],
  18813. this.floorId = e,
  18814. this.roomId = t,
  18815. this.position = new r.Vector3
  18816. }
  18817. var r = e("three");
  18818. n.prototype.addChunk = function(e) {
  18819. this.chunks.push(e)
  18820. }
  18821. ,
  18822. n.prototype.calcBoundaries = function() {
  18823. 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++) {
  18824. var s = this.chunks[a]
  18825. , l = s.geometry.attributes.position;
  18826. if (l)
  18827. for (var c = 0; c < l.array.length; c += 3)
  18828. e.set(l.array[c], l.array[c + 1], l.array[c + 2]),
  18829. t.add(e),
  18830. 0 === c ? (i.copy(e),
  18831. n.copy(e)) : (i.max(e),
  18832. n.min(e)),
  18833. o++
  18834. }
  18835. o > 0 ? (t.multiplyScalar(1 / o),
  18836. this.average = t) : this.average = null,
  18837. this.boundsMax = i,
  18838. this.boundsMin = n,
  18839. this.center = new r.Vector3,
  18840. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  18841. }
  18842. ,
  18843. t.exports = n
  18844. }
  18845. , {
  18846. three: 217
  18847. }],
  18848. 151: [function(e, t, i) {
  18849. (function(i) {
  18850. "use strict";
  18851. function n(e, t, i) {
  18852. this.obj3d = null,
  18853. this.nodes = [],
  18854. this.colorHull = [],
  18855. this.shortPaths = {},
  18856. this.floorHull = null,
  18857. this.cameraHull = null,
  18858. this.floorPathDistance = 0,
  18859. this.floorCurvePoints = null,
  18860. this.floorCurveColors = null,
  18861. this.camCurvePoints = null,
  18862. this.warpDestHeroLoc = null,
  18863. this.warpDestPano = null,
  18864. this.warpPathPoints = null,
  18865. this.warpPathLengths = [0],
  18866. this.warpLength = 0,
  18867. this.closeWarpDistance = 4,
  18868. this.UP = A.UP.clone(),
  18869. this.longestStep = 0,
  18870. this.upcomingTransType = null,
  18871. this.burnsDir = 1,
  18872. this.prevNextDist = 0,
  18873. this.nextI = 0,
  18874. this.activeTransType = null,
  18875. this.lastTransType = null,
  18876. this.bunnyObj = null,
  18877. this.director = e,
  18878. this.player = t,
  18879. this.playerControls = i,
  18880. this.modelManager = t.modelManager,
  18881. this.updateModel(),
  18882. this.updateDefaultsFromModelData(),
  18883. this.bindEvents(),
  18884. this.warping = !1,
  18885. this.waitingToWarp = !1,
  18886. this.warpInterrupted = !1,
  18887. this.warpInterruptionBlackoutStyle = null,
  18888. this.warpInterruptionTravelTime = null
  18889. }
  18890. var r = e("three")
  18891. , o = e("../util/logger")
  18892. , a = e("../enum/Viewmode")
  18893. , s = e("../enum/RenderOrder")
  18894. , l = e("../enum/WarpStyle")
  18895. , c = e("../settings")
  18896. , h = e("../util/math")
  18897. , u = e("../util/lerp")
  18898. , d = e("../util/easing")
  18899. , p = e("../util/transitions")
  18900. , f = e("../objects/Snapshot")
  18901. , g = e("../effects")
  18902. , m = e("../shaders")
  18903. , v = (e("../gui/gui"),
  18904. e("../util/texture"))
  18905. , A = e("../enum/Vectors")
  18906. , y = (e("../model/ModelManager"),
  18907. new o(i))
  18908. , C = e("../enum/PlayerEvents")
  18909. , I = e("../enum/BlackoutStyle")
  18910. , E = e("../enum/ModelManagerEvents")
  18911. , b = e("../constants")
  18912. , w = {
  18913. 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"),
  18914. pathEnd: v.load("./images/End.png"),
  18915. 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==")
  18916. };
  18917. n.prototype.setScene = function(e) {
  18918. this.createCpm(e),
  18919. this.createBunnyObj(e)
  18920. }
  18921. ,
  18922. n.prototype.updateModel = function() {
  18923. this.model = this.modelManager.getActiveModel()
  18924. }
  18925. ,
  18926. n.prototype.bindEvents = function() {
  18927. this.modelManager.on(E.ActiveModelChanged, this.updateModel.bind(this))
  18928. }
  18929. ,
  18930. n.prototype.updateDefaultsFromModelData = function() {
  18931. this.model.data
  18932. }
  18933. ,
  18934. n.prototype.pointPathDistance = function(e) {
  18935. for (var t = 0, i = 1; i < e.length; i += 1)
  18936. t += e[i - 1].distanceTo(e[i]);
  18937. return t
  18938. }
  18939. ,
  18940. n.prototype.pointPathLengths = function(e) {
  18941. for (var t = [0], i = 1; i < e.length; i += 1)
  18942. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  18943. return t
  18944. }
  18945. ,
  18946. n.prototype.interpAlongPath = function(e, t, i) {
  18947. var n, o = new r.Vector3, a = t[t.length - 1];
  18948. if (i < 1) {
  18949. n = i * a;
  18950. for (var s = 1; s < t.length; s += 1)
  18951. if (t[s] > n) {
  18952. var l = (n - t[s - 1]) / (t[s] - t[s - 1]);
  18953. return o.copy(e[s]),
  18954. o.sub(e[s - 1]),
  18955. o.multiplyScalar(l),
  18956. o.add(e[s - 1]),
  18957. o
  18958. }
  18959. } else
  18960. o.copy(e[e.length - 1]);
  18961. return o
  18962. }
  18963. ,
  18964. n.prototype.pathHeight = function() {
  18965. return this.player.mode !== a.FLOORPLAN ? c.path.height : c.path.outsideHeight
  18966. }
  18967. ,
  18968. n.prototype.createBunnyObj = function(e) {
  18969. this.bunnyObj || (this.bunnyObj = new r.AxisHelper(.1),
  18970. this.bunnyObj.visible = c.warp.showBunny),
  18971. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  18972. e.add(this.bunnyObj)
  18973. }
  18974. ,
  18975. n.prototype.createCpm = function(e) {
  18976. if (!this.currentPanoMarker) {
  18977. var t = this.makeWaypointObj(w.pathEnd, "Current");
  18978. t.material.uniforms.opacity.value = 0,
  18979. this.currentPanoMarker = {
  18980. mesh: t,
  18981. placed: !1
  18982. }
  18983. }
  18984. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18985. this.placeCpm(),
  18986. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  18987. }
  18988. ,
  18989. n.prototype.placeCpm = function() {
  18990. if (c.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  18991. var e = this.player.currentPano.floor;
  18992. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18993. e.add(this.currentPanoMarker.mesh)),
  18994. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  18995. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  18996. this.currentPanoMarker.placed = !0
  18997. } else
  18998. this.popOutCpm()
  18999. }
  19000. ,
  19001. n.prototype.fadeInCpm = function(e) {
  19002. 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)
  19003. }
  19004. ,
  19005. n.prototype.fadeOutCpm = function(e) {
  19006. p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  19007. }
  19008. ,
  19009. n.prototype.popInCpm = function() {
  19010. c.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  19011. }
  19012. ,
  19013. n.prototype.popOutCpm = function() {
  19014. this.fadeOutCpm(2)
  19015. }
  19016. ,
  19017. n.prototype.brushPrefs = {
  19018. linewidth: 7,
  19019. strokeWidth: 15,
  19020. cvSegments: 48,
  19021. paveStep: .1,
  19022. paveWidth: .2,
  19023. lookBlendDist: 3,
  19024. maxTurn: r.Math.degToRad(2)
  19025. },
  19026. n.prototype.panoPathDistance = function(e) {
  19027. var t = this.model.panos;
  19028. if (!e || e.length < 2)
  19029. return 0;
  19030. for (var i = [], n = 0; n < e.length; n += 1)
  19031. i.push(t.get(e[n]).floorPosition);
  19032. return this.pointPathDistance(i)
  19033. }
  19034. ,
  19035. n.prototype.loadTileTexture = function(e) {
  19036. var t = v.load(e, function(t) {
  19037. t.wrapS = r.RepeatWrapping,
  19038. t.wrapT = r.RepeatWrapping,
  19039. t.needsUpdate = !0,
  19040. y.debug('path texture "' + e + '" is ready')
  19041. }, function() {
  19042. y.error('path texture "' + e + '" failed')
  19043. });
  19044. return t.mapping = r.UVMapping,
  19045. t
  19046. }
  19047. ,
  19048. n.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  19049. var a = {
  19050. cameraMode: n,
  19051. position: e,
  19052. quaternion: t,
  19053. panoId: i,
  19054. orthoZoom: o,
  19055. floorVisibility: r,
  19056. thumbUrl: null,
  19057. name: null
  19058. };
  19059. return new f(a)
  19060. }
  19061. ,
  19062. n.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  19063. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  19064. }
  19065. ,
  19066. n.prototype.setWarpDestination = function(e) {
  19067. this.warpDestHeroLoc = e
  19068. }
  19069. ,
  19070. n.prototype.setWarpDestinationByHeroIndex = function(e) {
  19071. var t = this.getHeroDescriptorByHeroIndex(e);
  19072. return null !== t && (this.setWarpDestination(t),
  19073. !0)
  19074. }
  19075. ,
  19076. n.prototype.setWarpDestinationByPano = function(e, t) {
  19077. var i = this.model.panos.get(e.id);
  19078. return !!i && this.setWarpDestinationByPanoId(e.id, t)
  19079. }
  19080. ,
  19081. n.prototype.setWarpDestinationByPanoId = function(e, t) {
  19082. var i = this.model.panos.get(e);
  19083. if (i) {
  19084. t = t || new r.Quaternion;
  19085. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  19086. return this.setWarpDestination(n),
  19087. !0
  19088. }
  19089. return !1
  19090. }
  19091. ,
  19092. n.prototype.getHeroDescriptorByHeroIndex = function(e) {
  19093. var t = this.model.heroCount();
  19094. if (null !== this.warpDestHeroLoc && t < 2)
  19095. return y.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  19096. this.model.getHeroDescriptorByIndex(0);
  19097. var i = this.model.getHeroDescriptorByIndex(e);
  19098. if (i) {
  19099. var n = i.isPano() ? i.panoId : i.cameraMode;
  19100. y.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  19101. }
  19102. return i
  19103. }
  19104. ,
  19105. n.prototype.getHeroDescriptorByPano = function(e) {
  19106. var t = this.model.panos.get(e.id);
  19107. return t ? this.getHeroDescriptorByPanoId(e.id) : null
  19108. }
  19109. ,
  19110. n.prototype.getHeroDescriptorByPanoId = function(e) {
  19111. var t = this.getHeroIndexFromPanoId(e);
  19112. return this.getHeroDescriptorByHeroIndex(t)
  19113. }
  19114. ,
  19115. n.prototype.getHeroIndexFromPanoId = function(e) {
  19116. for (var t = 0; t < this.model.heroLocations.length; t++) {
  19117. var i = this.model.heroLocations[t]
  19118. , n = this.getHeroId(i);
  19119. if (n && n === e)
  19120. return t
  19121. }
  19122. return -1
  19123. }
  19124. ,
  19125. n.prototype.getHeroPano = function(e) {
  19126. if (null === e)
  19127. return y.warn("getHeroPano(): no destination"),
  19128. null;
  19129. var t = this.getHeroId(e)
  19130. , i = this.model.panos.get(t);
  19131. return void 0 === i && (i = null,
  19132. "" !== t && y.debug('unable to find pano "' + t + '"')),
  19133. i
  19134. }
  19135. ,
  19136. n.prototype.getHeroId = function(e) {
  19137. return e.panoId
  19138. }
  19139. ,
  19140. n.prototype.setWarpDestPano = function() {
  19141. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  19142. this.warpDestPano
  19143. }
  19144. ,
  19145. n.prototype.brushToWarpPano = function(e, t) {
  19146. if (this.discardPathObject(),
  19147. !this.setWarpDestPano())
  19148. return !1;
  19149. if (this.warpDestHeroLoc.cameraMode !== a.PANORAMA && y.warn("Can only brush from pano to pano"),
  19150. !this.warpDestPano)
  19151. return y.info("No brush"),
  19152. !1;
  19153. if (!this.player.currentPano)
  19154. return y.debug("No current pano, visibility undefined"),
  19155. !1;
  19156. if (!this.warpDestPano)
  19157. return y.info("No wPano, visibility undefined"),
  19158. !1;
  19159. if (!this.warpDestPano.isAligned())
  19160. return y.debug("Cannot brush to unaligned pano"),
  19161. !1;
  19162. var i = (e === l.STD || e === l.WALK) && c.path.mapGuides
  19163. , n = !0;
  19164. if (this.player.currentPano.id === this.warpDestPano.id)
  19165. y.debug("Already at destination pano");
  19166. else {
  19167. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19168. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  19169. this.obj3d = new r.Object3D,
  19170. y.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  19171. n ? (y.info('No "walkable" route, using fall-back warp style transition'),
  19172. e = t) : (this.setPathHulls(this.nodes),
  19173. this.setFloorCurves(),
  19174. 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)))),
  19175. this.player.currentPano.floor.add(this.obj3d);
  19176. var o = this.player.mode === a.DOLLHOUSE || this.player.mode === a.FLOORPLAN
  19177. , s = e === l.STD;
  19178. if (!n && (i || s)) {
  19179. if (o) {
  19180. var h = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  19181. this.obj3d.add(h)
  19182. }
  19183. var u = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  19184. this.obj3d.add(u)
  19185. }
  19186. this.appearSlow()
  19187. }
  19188. return this.upcomingTransType = e,
  19189. !n
  19190. }
  19191. ,
  19192. n.prototype.findShortestPath = function(e, t) {
  19193. if (!e || !t)
  19194. return null;
  19195. var i = c.warp.walkExtraPanosDistance
  19196. , n = e.id + ":" + t.id + ":" + i;
  19197. if (this.shortPaths.hasOwnProperty(n))
  19198. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  19199. var r = t.id + ":" + e.id + ":" + i;
  19200. if (this.shortPaths.hasOwnProperty(r))
  19201. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  19202. var o = this.model.panos.aStarSearch(e, t);
  19203. return this.model.panos.includeNodesNearPath(o, i),
  19204. this.shortPaths[n] = o ? o.slice() : null,
  19205. o
  19206. }
  19207. ,
  19208. n.prototype.makePathHulls = function(e) {
  19209. var t, i, n, r, o, a = 0, s = [], l = [], h = [], u = this.model.panos;
  19210. t = u.get(e[0]),
  19211. r = t.floor.floorIndex;
  19212. for (var d = 0; d < e.length; d += 1)
  19213. t = u.get(e[d]),
  19214. i = t.floorPosition.clone().sub(this.model.position),
  19215. i.y += this.pathHeight(),
  19216. s.push(i),
  19217. l.push(t.position.clone()),
  19218. n = t.floor.floorIndex,
  19219. h.push(n > r ? c.path.colorUp : n < r ? c.path.colorDown : c.path.color),
  19220. d > 0 && (o = l[d].distanceTo(l[d - 1]),
  19221. o > a && (a = o));
  19222. return a > this.longestStep && (this.longestStep = a,
  19223. y.debug("path contains " + a + " meter segment")),
  19224. {
  19225. floor: s,
  19226. camera: l,
  19227. color: h
  19228. }
  19229. }
  19230. ,
  19231. n.prototype.makeFloorCurves = function(e, t, i) {
  19232. var n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  19233. , o = this.pointPathDistance(e) - 2 * n
  19234. , s = e.slice(0)
  19235. , l = s[1].clone().sub(s[0]);
  19236. l.y = 0,
  19237. l.normalize().multiplyScalar(n),
  19238. s[0] = (new r.Vector3).copy(s[0]).add(l),
  19239. l = s[s.length - 2].clone().sub(s[s.length - 1]),
  19240. l.y = 0,
  19241. l.normalize().multiplyScalar(n),
  19242. s[s.length - 1] = (new r.Vector3).copy(s[s.length - 1]).add(l);
  19243. var h = new r.CatmullRomCurve3(s)
  19244. , u = Math.floor(o / i);
  19245. u = 4 * Math.floor(u / 4),
  19246. u = Math.max(4, u);
  19247. for (var d, p, f, g = h.getSpacedPoints(u), m = [], v = new r.Vector3, A = 0; A < g.length; A += 1) {
  19248. f = 0,
  19249. d = g[A].distanceTo(e[0]);
  19250. for (var y = 1; y < e.length; y += 1)
  19251. v.copy(g[A]).sub(e[y]),
  19252. v.y *= 4,
  19253. p = v.length(),
  19254. p < d && (f = y);
  19255. m.push(t[f])
  19256. }
  19257. return {
  19258. distance: o,
  19259. points: g,
  19260. colors: m
  19261. }
  19262. }
  19263. ,
  19264. n.prototype.makeCameraCurvePoints = function(e, t) {
  19265. var i = this.pointPathDistance(e)
  19266. , n = new r.CatmullRomCurve3(e);
  19267. return n.getSpacedPoints(Math.max(2, Math.floor(i / t)))
  19268. }
  19269. ,
  19270. n.prototype.makeCameraCurveTangents = function(e, t) {
  19271. var i = this.pointPathDistance(e)
  19272. , n = new r.CatmullRomCurve3(e)
  19273. , o = Math.max(2, Math.floor(i / t));
  19274. o || (o = 5);
  19275. for (var a = [], s = 0; s <= o; s++)
  19276. a.push(n.getTangentAt(s / o));
  19277. return a
  19278. }
  19279. ,
  19280. n.prototype.setPathHulls = function(e) {
  19281. var t = this.makePathHulls(e);
  19282. this.floorHull = t.floor,
  19283. this.cameraHull = t.camera,
  19284. this.colorHull = t.color
  19285. }
  19286. ,
  19287. n.prototype.setFloorCurves = function() {
  19288. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  19289. this.floorPathDistance = e.distance,
  19290. this.floorCurvePoints = e.points,
  19291. this.floorCurveColors = e.colors
  19292. }
  19293. ,
  19294. n.prototype.setCameraCurvePoints = function() {
  19295. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, c.warp.stepFactor * this.brushPrefs.paveStep)
  19296. }
  19297. ,
  19298. n.prototype.chooseWarpPath = function(e) {
  19299. var t, i, n, o = this.playerControls.cameras[a.PANORAMA];
  19300. if (this.player.currentPano === this.warpDestPano || !e)
  19301. return this.warpPathPoints = null,
  19302. this.warpLength = 0,
  19303. !1;
  19304. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19305. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (y.debug("warp path to unreachable node"),
  19306. t = this.warpDestPano.position.clone().sub(o.position),
  19307. i = t.clone().negate(),
  19308. t.multiplyScalar(.15).add(o.position),
  19309. i.multiplyScalar(.15).add(this.warpDestPano.position),
  19310. t.y = o.position.y,
  19311. i.y = this.warpDestPano.position.y,
  19312. n = new r.CubicBezierCurve3(o.position.clone(),t,i,this.warpDestPano.position.clone()),
  19313. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (y.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  19314. this.setCameraCurvePoints(),
  19315. this.warpPathPoints = this.camCurvePoints.slice(0)),
  19316. this.warpLength = 0,
  19317. this.warpPathLengths = [0];
  19318. 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) {
  19319. s.copy(this.warpPathPoints[d - 1]).sub(this.warpPathPoints[d]);
  19320. var p = s.length();
  19321. s.y *= c.warp.climbEffort;
  19322. var f = s.length() / p;
  19323. if (d > 1) {
  19324. s.setY(0).normalize(),
  19325. l.copy(this.warpPathPoints[d - 2]).sub(this.warpPathPoints[d - 1]).setY(0).normalize();
  19326. var g = Math.min(1, s.dot(l))
  19327. , m = 1 + (c.warp.brakeStrength - 1) * (1 - r.Math.smoothstep(g, u, h));
  19328. f = Math.max(m, f)
  19329. }
  19330. this.warpLength += p * f,
  19331. this.warpPathLengths[d] = this.warpLength
  19332. }
  19333. return !0
  19334. }
  19335. ,
  19336. n.prototype.drawPathRibbon = function(e, t) {
  19337. this.bunnyObj.visible = c.warp.showBunny;
  19338. 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) {
  19339. h.copy(e[u]),
  19340. 0 === u ? h.sub(e[u + 1]) : h.sub(e[u - 1]).negate(),
  19341. h.normalize(),
  19342. n.crossVectors(h, A.UP),
  19343. n.multiplyScalar(i);
  19344. var d = (new r.Vector3).copy(e[u]).add(o);
  19345. d.sub(n),
  19346. l.vertices.push(d),
  19347. d = (new r.Vector3).copy(e[u]).add(o),
  19348. d.add(n),
  19349. l.vertices.push(d)
  19350. }
  19351. var p, f = 0;
  19352. for (u = 0; u < e.length - 1; u += 1) {
  19353. var g = 2 * u
  19354. , v = f;
  19355. f += e[u + 1].distanceTo(e[u]);
  19356. var y = f
  19357. , C = t[u]
  19358. , I = t[u + 1];
  19359. p = new r.Face3(g,g + 1,g + 2),
  19360. p.vertexColors = [new r.Color(C), new r.Color(C), new r.Color(I)],
  19361. l.faces.push(p),
  19362. l.faceVertexUvs[0].push([new r.Vector2(0,v), new r.Vector2(1,v), new r.Vector2(0,y)]),
  19363. p = new r.Face3(g + 2,g + 1,g + 3),
  19364. p.vertexColors = [new r.Color(I), new r.Color(C), new r.Color(I)],
  19365. l.faces.push(p),
  19366. l.faceVertexUvs[0].push([new r.Vector2(0,y), new r.Vector2(1,v), new r.Vector2(1,y)])
  19367. }
  19368. l.computeFaceNormals(),
  19369. l.computeVertexNormals();
  19370. var E, b;
  19371. this.player.mode === a.PANORAMA ? (b = r.UniformsUtils.clone(m.ribbon.uniforms),
  19372. b.map.value = w.path,
  19373. b.opacity.value = 0,
  19374. b.color.value.set(c.path.color),
  19375. E = new r.RawShaderMaterial({
  19376. side: r.DoubleSide,
  19377. depthWrite: !1,
  19378. transparent: !0,
  19379. vertexShader: m.ribbon.vertexShader,
  19380. fragmentShader: m.ribbon.fragmentShader,
  19381. uniforms: b,
  19382. name: "ribbonT",
  19383. opacity: 0
  19384. })) : E = new r.MeshBasicMaterial({
  19385. color: 16777215,
  19386. side: r.DoubleSide,
  19387. name: "ribbonOut",
  19388. vertexColors: r.VertexColors
  19389. });
  19390. var _ = new r.Mesh(l,E);
  19391. return _.name = "ribbon",
  19392. this.player.mode === a.PANORAMA && (_.renderOrder = s.ribbon),
  19393. _
  19394. }
  19395. ,
  19396. n.prototype.drawPathPavement = function(e) {
  19397. for (var t, i = .25, n = new r.Vector3, o = new r.Geometry, s = new r.Vector3, l = 0; l < e.length; l += 1)
  19398. s.copy(e[l]),
  19399. 0 === l ? s.sub(e[l + 1]).negate() : s.sub(e[l - 1]),
  19400. s.normalize(),
  19401. n.crossVectors(s, A.UP),
  19402. n.multiplyScalar(this.brushPrefs.paveWidth),
  19403. t = (new r.Vector3).copy(e[l]),
  19404. t.sub(n),
  19405. o.vertices.push(t),
  19406. o.vertices.push((new r.Vector3).copy(e[l])),
  19407. t = (new r.Vector3).copy(e[l]),
  19408. t.add(n),
  19409. o.vertices.push(t);
  19410. var h, u, d;
  19411. for (l = 0; l < e.length - 1; l += 1)
  19412. h = 3 * l + 1,
  19413. u = l * i,
  19414. d = u + i,
  19415. o.faces.push(new r.Face3(h - 1,h,h + 3)),
  19416. o.faceVertexUvs[0].push([new r.Vector2(0,u), new r.Vector2(.5,u), new r.Vector2(.5,d)]),
  19417. o.faces.push(new r.Face3(h + 3,h + 2,h - 1)),
  19418. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(0,d), new r.Vector2(0,u)]),
  19419. o.faces.push(new r.Face3(h + 3,h,h + 1)),
  19420. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(.5,u), new r.Vector2(1,u)]),
  19421. o.faces.push(new r.Face3(h + 3,h + 1,h + 4)),
  19422. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(1,u), new r.Vector2(1,d)]);
  19423. var p = this.player.mode === a.PANORAMA ? new r.MeshBasicMaterial({
  19424. color: c.path.color,
  19425. side: r.DoubleSide,
  19426. transparent: !0,
  19427. depthWrite: !1,
  19428. opacity: 0,
  19429. name: "paveT",
  19430. map: w.path
  19431. }) : new r.MeshBasicMaterial({
  19432. color: c.path.color,
  19433. side: r.DoubleSide,
  19434. transparent: !0,
  19435. depthWrite: !1,
  19436. opacity: 1,
  19437. name: "paveO",
  19438. map: w.path
  19439. });
  19440. return new r.Mesh(o,p)
  19441. }
  19442. ,
  19443. n.prototype.hintPrefs = {
  19444. rad: .18,
  19445. width: .0125,
  19446. depth: .0625,
  19447. setBack: -.04,
  19448. markRad: .25,
  19449. markInnerRad: .16
  19450. },
  19451. n.prototype.makeWaypointObj = function(e, t) {
  19452. var i = new r.Geometry
  19453. , n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  19454. , o = this.pathHeight();
  19455. 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)),
  19456. i.faces.push(new r.Face3(0,1,2), new r.Face3(2,3,0)),
  19457. i.faceVertexUvs[0].push([new r.Vector2(0,0), new r.Vector2(1,0), new r.Vector2(1,1)]),
  19458. i.faceVertexUvs[0].push([new r.Vector2(1,1), new r.Vector2(0,1), new r.Vector2(0,0)]);
  19459. var s = r.UniformsUtils.clone(m.waypoint.uniforms);
  19460. s.map.value = e,
  19461. s.opacity.value = 0,
  19462. s.color.value.set(c.path.color);
  19463. var l = {
  19464. side: r.DoubleSide,
  19465. depthWrite: !1,
  19466. transparent: !0,
  19467. vertexShader: m.waypoint.vertexShader,
  19468. fragmentShader: m.waypoint.fragmentShader,
  19469. uniforms: s,
  19470. name: "waypoint",
  19471. opacity: 0
  19472. };
  19473. this.player.mode !== a.PANORAMA && (l.depthTest = !1,
  19474. l.name = "wayPtOut");
  19475. var h = new r.RawShaderMaterial(l)
  19476. , u = new r.Mesh(i,h);
  19477. return u.name = t,
  19478. u
  19479. }
  19480. ,
  19481. n.prototype.makeStartMarker = function(e, t) {
  19482. var i = (new r.Vector3).copy(t[1]).sub(t[0]);
  19483. i.y = 0,
  19484. i.normalize();
  19485. var n = Math.acos(i.x)
  19486. , o = this.makeWaypointObj(w.pathStart, "Start");
  19487. return o.rotateOnAxis(new r.Vector3(0,1,0), n),
  19488. o.position.copy(e),
  19489. o
  19490. }
  19491. ,
  19492. n.prototype.makeEndMarker = function(e) {
  19493. var t = this.makeWaypointObj(w.pathEnd, "End")
  19494. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  19495. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  19496. return i < n ? t.material.uniforms.color.value.set(c.path.colorUp) : i > n && t.material.uniforms.color.value.set(c.path.colorDown),
  19497. t.position.copy(e),
  19498. t
  19499. }
  19500. ,
  19501. n.prototype.pathClean = function(e) {
  19502. if (e) {
  19503. for (var t in e.children)
  19504. this.pathClean(e.children[t]);
  19505. e.geometry && e.geometry.dispose(),
  19506. e.material && e.material.dispose()
  19507. }
  19508. }
  19509. ,
  19510. n.prototype.discardPathObject = function() {
  19511. if (this.obj3d) {
  19512. var e = this.obj3d.parent;
  19513. e && e.remove(this.obj3d),
  19514. this.pathClean(this.obj3d)
  19515. }
  19516. this.obj3d = null,
  19517. this.popInCpm()
  19518. }
  19519. ,
  19520. n.prototype.discardSlow = function() {
  19521. if (this.obj3d) {
  19522. if (this.player.mode !== a.PANORAMA)
  19523. return void this.discardPathObject();
  19524. for (var e, t = this, i = 0, n = function() {
  19525. this.discardPathObject()
  19526. }
  19527. .bind(this), r = 0; r < t.obj3d.children.length; r += 1)
  19528. e = t.obj3d.children[r],
  19529. 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]),
  19530. i += 1,
  19531. n = null);
  19532. 0 === i && this.discardPathObject(),
  19533. this.player.mode !== a.PANORAMA && this.fadeInCpm(c.path.fadeInTime - 3)
  19534. }
  19535. }
  19536. ,
  19537. n.prototype.appearSlow = function() {
  19538. var e, t = this;
  19539. this.fadeOutCpm(c.path.fadeInTime);
  19540. for (var i = this.player.mode === a.PANORAMA ? c.path.opacity : 1, n = 0; n < t.obj3d.children.length; n += 1)
  19541. e = t.obj3d.children[n],
  19542. 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]))
  19543. }
  19544. ,
  19545. n.prototype.update = function() {
  19546. this.obj3d && this.obj3d.updateMatrixWorld()
  19547. }
  19548. ,
  19549. n.prototype.calcBurnsAmount = function(e) {
  19550. var t = r.Math.degToRad(c.warp.burnsAngle);
  19551. if (this.player.mode === a.PANORAMA) {
  19552. var i = this.burnsDir * t;
  19553. if (this.upcomingTransType === l.BLACK)
  19554. return i;
  19555. var n = e;
  19556. if (null === n)
  19557. return y.warn("Transition request for non-highlight"),
  19558. i;
  19559. var o = this.getHeroDescriptorByHeroIndex(n);
  19560. if (null === o)
  19561. return i;
  19562. if (!o.isPano())
  19563. return i;
  19564. var s = this.getHeroPano(o)
  19565. , h = this.playerControls.cameras[a.PANORAMA]
  19566. , u = A.FORWARD.clone().applyQuaternion(h.quaternion).setY(0).normalize()
  19567. , d = Math.min(r.Math.degToRad(c.warp.minBurnsAngle), t)
  19568. , p = function(e) {
  19569. var i = Math.acos(Math.min(1, e.dot(u)))
  19570. , n = (new r.Vector3).crossVectors(u, e);
  19571. return Math.max(d, Math.min(Math.abs(i), t)) * Math.sign(n.y)
  19572. };
  19573. if (s === this.player.currentPano)
  19574. return i = p(A.FORWARD.clone().applyQuaternion(o.quaternion).setY(0).normalize());
  19575. var f = this.findShortestPath(this.player.currentPano, s);
  19576. if (void 0 === f || null === f || f.length < 1)
  19577. return y.debug("Empty path ahead..."),
  19578. i;
  19579. var g = this.makePathHulls(f)
  19580. , m = new r.CatmullRomCurve3(g.camera)
  19581. , v = Math.min(.1, c.warp.lookAheadDist / m.getLength());
  19582. return i = p(m.getPointAt(v).clone().sub(h.position).setY(0).normalize())
  19583. }
  19584. return this.player.mode === a.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir
  19585. }
  19586. ,
  19587. n.prototype.waitNextStep = function(e, t, time) {//xzw 改时间
  19588. var i = (time==void 0)? c.warp.tourStepDelay : time; //
  19589. i || (i = this.lastTransType === l.BLACK ? b.tourStepDelaySlideShow : b.tourStepDelayDefault);
  19590. var n = new r.Euler
  19591. , o = new r.Vector3;
  19592. y.debug("Starting wait: " + (void 0 !== t));
  19593. var s = this.calcBurnsAmount(e)
  19594. , h = function() {
  19595. this.endWarpState(),
  19596. this.player.mode === a.DOLLHOUSE && (this.playerControls.cameras[a.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  19597. t && t()
  19598. }
  19599. .bind(this)
  19600. , u = function(e, t) {
  19601. if (this.warpInterrupted)
  19602. return h(),
  19603. !0;
  19604. var r = t || 1e3 / 60;
  19605. if (c.warp.doBurns)
  19606. if (this.player.mode === a.PANORAMA) {
  19607. var l = this.playerControls.cameras[a.PANORAMA];
  19608. n.setFromQuaternion(l.quaternion, c.warp.eOrder);
  19609. var u = r * s / i;
  19610. n.y += u,
  19611. o.set(0, 0, -1),
  19612. o.applyEuler(n),
  19613. o.add(l.position),
  19614. l.controls.lookAt(o),
  19615. l.controls.lookVector.copy(o),
  19616. l.lookAt(o)
  19617. } else
  19618. this.player.mode === a.DOLLHOUSE ? this.playerControls.controls[a.DOLLHOUSE].rotationAcceleration.x = s : this.playerControls.controls[a.FLOORPLAN].absoluteScale *= .9996
  19619. }
  19620. .bind(this);
  19621. this.startWarpState(),
  19622. p.start(u, i, h, 0, d.easeInOutQuad, "wait")
  19623. }
  19624. ,
  19625. n.prototype.warpToNonPano = function(e) {
  19626. if (this.discardPathObject(),
  19627. this.warpDestHeroLoc.cameraMode === a.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === a.FLOORPLAN) {
  19628. var t = function() {
  19629. e && e()
  19630. }
  19631. .bind(this);
  19632. this.player.flyToNewMode({
  19633. mode: this.warpDestHeroLoc.cameraMode,
  19634. duration: c.warp.outsideTime,
  19635. warpDest: this.warpDestHeroLoc,
  19636. callback: t,
  19637. force: !0
  19638. })
  19639. } else
  19640. y.warn("no warp destination!!!"),
  19641. e && e()
  19642. }
  19643. ,
  19644. n.prototype._resetWarpShaderParams = function(e) {
  19645. this.player.mode === a.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  19646. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  19647. }
  19648. ,
  19649. n.prototype._clearWarpShading = function() {
  19650. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  19651. this._resetWarpShaderParams(e[t]),
  19652. e[t].visible = !0;
  19653. this._resetWarpShaderParams(this.model.skybox)
  19654. }
  19655. ,
  19656. n.prototype._warpStopFlying = function() {
  19657. this.activeTransType = null,
  19658. this.placeCpm()
  19659. }
  19660. ,
  19661. n.prototype._wrapupTravelOnlyBits = function() {
  19662. this._warpStopFlying(),
  19663. this.warpPathPoints && (this.player.currentPano.exit(),
  19664. this.warpDestPano.enter(),
  19665. this.player.currentPano = this.warpDestPano),
  19666. this.player.spider.draw(),
  19667. this.placeCpm()
  19668. }
  19669. ,
  19670. n.prototype._wrapupTravel = function(e) {
  19671. this._wrapupTravelOnlyBits(),
  19672. this.warpCameraAim(e)
  19673. }
  19674. ,
  19675. n.prototype._wrapupWarpShading = function(e) {
  19676. this._clearWarpShading(),
  19677. this._wrapupTravel(e)
  19678. }
  19679. ,
  19680. n.prototype.wrapupWarpShadingOnly = function(e, t) {
  19681. t !== I.END && this._clearWarpShading(),
  19682. this._wrapupTravelOnlyBits(),
  19683. this.upcomingTransType = null,
  19684. e && e()
  19685. }
  19686. ,
  19687. n.prototype._warpCameraAim = function(e, t) {
  19688. var i = this.warpDestHeroLoc.quaternion
  19689. , n = this.playerControls.cameras[a.PANORAMA]
  19690. , o = new r.Vector3(0,0,1).applyQuaternion(i).normalize()
  19691. , s = new r.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize()
  19692. , l = s.dot(o)
  19693. , u = r.Math.radToDeg(Math.acos(l))
  19694. , f = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(i, c.warp.eOrder)
  19695. , g = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  19696. , m = new r.Euler(f.x - g.x,f.y - g.y,f.z - g.z,c.warp.eOrder);
  19697. m.y = h.constrainedTurn(m.y),
  19698. this.burnsDir = Math.sign(m.y);
  19699. var v = new r.Euler(0,0,0,c.warp.eOrder)
  19700. , A = new r.Vector3
  19701. , C = function(e, t) {
  19702. return !!this.warpInterrupted || (v.x = g.x + e * m.x,
  19703. v.y = g.y + e * m.y,
  19704. v.z = g.z + e * m.z,
  19705. A.set(0, 0, -1),
  19706. A.applyEuler(v),
  19707. A.add(n.position),
  19708. n.controls.lookAt(A),
  19709. n.controls.lookVector.copy(A),
  19710. void n.lookAt(A))
  19711. }
  19712. .bind(this);
  19713. return u > c.warp.minRotation ? p.start(C, e, t, 0, d[c.warp.movementEasing]) : (y.debug("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim"),
  19714. void (t && t()))
  19715. }
  19716. ,
  19717. n.prototype._warpBendAim = function(e, t, i, n) {
  19718. var o = n || 0
  19719. , s = this.playerControls.cameras[a.PANORAMA]
  19720. , l = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  19721. , u = (new r.Euler).setFromQuaternion(s.quaternion, c.warp.eOrder)
  19722. , f = new r.Euler(l.x - u.x,l.y - u.y,l.z - u.z,c.warp.eOrder);
  19723. f.y = h.constrainedTurn(f.y);
  19724. var g = Math.min(r.Math.degToRad(c.warp.softBendTilt), Math.abs(f.x));
  19725. f.x = g * Math.sign(f.x),
  19726. g = Math.min(r.Math.degToRad(Math.max(0, c.warp.softBendAngle)), g),
  19727. this.burnsDir = Math.sign(f.y),
  19728. g *= Math.sign(f.y),
  19729. f.y = g;
  19730. var m = new r.Euler(0,0,0,c.warp.eOrder)
  19731. , v = new r.Vector3
  19732. , A = function(e, t) {
  19733. if (e < .5)
  19734. m.x = u.x + e * f.x,
  19735. m.y = u.y + e * f.y,
  19736. m.z = u.z + e * f.z;
  19737. else {
  19738. var i = (1 - e) * c.warp.softBendEnd;
  19739. m.x = l.x - i * f.x,
  19740. m.y = l.y - i * f.y,
  19741. m.z = l.z - i * f.z
  19742. }
  19743. v.set(0, 0, -1),
  19744. v.applyEuler(m),
  19745. v.add(s.position),
  19746. s.controls.lookAt(v),
  19747. s.controls.lookVector.copy(v),
  19748. s.lookAt(v)
  19749. }
  19750. .bind(this);
  19751. return p.start(A, t, i, o, d[c.warp.movementEasing])
  19752. }
  19753. ,
  19754. n.prototype._warpStepCameraAim = function(e, t, i) {
  19755. var n = this.playerControls.cameras[a.PANORAMA]
  19756. , o = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  19757. , s = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  19758. , l = new r.Euler(o.x - s.x,o.y - s.y,o.z - s.z,c.warp.eOrder);
  19759. l.y = h.constrainedTurn(l.y),
  19760. this.burnsDir = Math.sign(l.y);
  19761. var u = new r.Euler(0,0,0,c.warp.eOrder)
  19762. , f = new r.Vector3
  19763. , g = function(e, t) {
  19764. e < .5 ? u.copy(s) : u.copy(o),
  19765. f.set(0, 0, -1),
  19766. f.applyEuler(u),
  19767. f.add(n.position),
  19768. n.controls.lookAt(f),
  19769. n.controls.lookVector.copy(f),
  19770. n.lookAt(f)
  19771. }
  19772. .bind(this);
  19773. return p.start(g, t, i, 0, d[c.warp.movementEasing])
  19774. }
  19775. ,
  19776. n.prototype.setBurnsDir = function() {
  19777. var e = this.playerControls.cameras[a.PANORAMA]
  19778. , t = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  19779. , i = (new r.Euler).setFromQuaternion(e.quaternion, c.warp.eOrder)
  19780. , n = new r.Euler(t.x - i.x,t.y - i.y,t.z - i.z,c.warp.eOrder);
  19781. n.y = h.constrainedTurn(n.y),
  19782. this.burnsDir = Math.sign(n.y)
  19783. }
  19784. ,
  19785. n.prototype.stepWarpPath = function(e, t) {
  19786. var i = this.playerControls.cameras[a.PANORAMA];
  19787. if (!this.warpPathPoints)
  19788. return i.position.copy(this.warpDestPano.position),
  19789. !0;
  19790. var n = this.warpPathPoints[0]
  19791. , o = this.warpDestPano.position;
  19792. if (null !== this.nodes && this.cameraHull.length > 1) {
  19793. var s = new r.Vector3;
  19794. 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),
  19795. i.position.copy(s)
  19796. } else
  19797. e < .5 ? i.position.copy(n) : i.position.copy(o)
  19798. }
  19799. ,
  19800. n.prototype.interruptAndFastForward = function(e, t) {
  19801. this.warping && (this.warpInterrupted = !0,
  19802. this.warpInterruptionBlackoutStyle = e,
  19803. this.warpInterruptionTravelTime = t,
  19804. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = I.MIDDLE),
  19805. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = c.minWarpTime))
  19806. }
  19807. ,
  19808. n.prototype.warpCameraAim = function(e) {
  19809. var t = c.warp.minWarpTime;
  19810. if (this.upcomingTransType === l.BLACK)
  19811. t = c.warp.teleportTime;
  19812. else {
  19813. var i = this.playerControls.cameras[a.PANORAMA]
  19814. , n = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  19815. , o = (new r.Euler).setFromQuaternion(i.quaternion, c.warp.eOrder)
  19816. , s = new r.Euler(n.x - o.x,n.y - o.y,n.z - o.z,c.warp.eOrder);
  19817. s.y = h.constrainedTurn(s.y);
  19818. var u = 1e3 * Math.abs(s.y) / r.Math.degToRad(c.warp.maxAimPerSec);
  19819. t = Math.max(t, u)
  19820. }
  19821. var d = function() {
  19822. this._warpStopFlying(),
  19823. this.discardSlow(),
  19824. e && e()
  19825. }
  19826. .bind(this);
  19827. this._warpCameraAim(t, d)
  19828. }
  19829. ,
  19830. n.prototype.warpCommonParameters = function(e, t, i, n) {
  19831. this.model.skybox.material.uniforms.blackout.value = n;
  19832. var r = u.uniform(this.model.skybox, "progress", 1)
  19833. , o = u.allUniforms(this.model.chunks, "progress", 1)
  19834. , a = !1
  19835. , s = function() {
  19836. if (this.warpInterrupted)
  19837. return a = !0,
  19838. !0
  19839. }
  19840. .bind(this)
  19841. , l = function(e, t) {
  19842. return i && a ? (this.model.skybox.material.uniforms.progress.value = 0,
  19843. !0) : void r(e, t)
  19844. }
  19845. .bind(this)
  19846. , h = function(e, t) {
  19847. return i && a ? (o(0),
  19848. !0) : void o(e, t)
  19849. }
  19850. .bind(this);
  19851. p.start(s, e, null, t, null, "safeHaltWatch"),
  19852. p.start(l, e, null, t, d[c.warp.blendEasing], "skyboxProgress"),
  19853. p.start(h, e, null, t, d[c.warp.blendEasing], "chunkProgress")
  19854. }
  19855. ,
  19856. n.prototype.warpTravel_STD = function(e) {
  19857. 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),
  19858. 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;
  19859. w += this.warpLength * c.warp.timePerMeter,
  19860. c.warp.flySpeed > .01 && (w = 1e3 * this.warpLength / c.warp.flySpeed);
  19861. var _ = !1
  19862. , T = this.warpDestHeroLoc.quaternion
  19863. , x = new r.Vector3(0,0,-1).applyQuaternion(T).normalize()
  19864. , S = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  19865. , M = S.dot(x)
  19866. , R = r.Math.radToDeg(Math.acos(M))
  19867. , P = function(e) {
  19868. var t = o
  19869. , i = r.Math.smoothstep(e, 0, t) * (1 - r.Math.smoothstep(e, 1 - t, 1));
  19870. return i
  19871. }
  19872. , O = function() {
  19873. return E.lookAt(C, t, A.UP),
  19874. s.setFromRotationMatrix(E, c.warp.eOrder),
  19875. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  19876. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  19877. h.constrainedTurn(b.y)
  19878. }
  19879. .bind(this)
  19880. , L = function(e, t) {
  19881. if (this.warpInterrupted)
  19882. return _ = !0,
  19883. !0
  19884. }
  19885. .bind(this)
  19886. , D = function(e, t) {
  19887. return _ || !this.warpPathPoints ? (g.blur(0),
  19888. !0) : void g.blur(e)
  19889. }
  19890. .bind(this)
  19891. , N = u.allUniforms(this.model.chunks, "modelAlpha", 1)
  19892. , B = function(e, t) {
  19893. return _ || !this.warpPathPoints ? (N(0),
  19894. !0) : void N(e, t)
  19895. }
  19896. .bind(this)
  19897. , F = function(e, t) {
  19898. if (!this.warpPathPoints)
  19899. return n.position.copy(this.warpDestPano.position),
  19900. !0;
  19901. if (_)
  19902. return !0;
  19903. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  19904. n.position.copy(i),
  19905. C = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  19906. }
  19907. .bind(this)
  19908. , V = function(e, n) {
  19909. return this.warpPathPoints ? !!_ || void (t = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + i, 1))) : (y.debug("Lost bunny."),
  19910. !0)
  19911. }
  19912. .bind(this)
  19913. , U = function(e, o) {
  19914. if (_)
  19915. return y.debug(">>>> Walkthrough interupted at t=" + e),
  19916. !0;
  19917. if (!this.warpPathPoints)
  19918. return !0;
  19919. var a = this.warpLength * e
  19920. , l = r.Math.smoothstep(a, 0, this.brushPrefs.lookBlendDist)
  19921. , u = r.Math.smoothstep(a, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  19922. c.warp.matchCam && (l *= 1 - u),
  19923. E.lookAt(C, t, A.UP),
  19924. s.setFromRotationMatrix(E, c.warp.eOrder),
  19925. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  19926. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  19927. b.y = h.constrainedTurn(b.y),
  19928. s.x = m.x + l * b.x,
  19929. s.y = m.y + l * b.y,
  19930. s.z = m.z + l * b.z,
  19931. b.set(s.x - v.x, s.y - v.y, s.z - v.z, c.warp.eOrder),
  19932. b.y = h.constrainedTurn(b.y);
  19933. var d = r.Math.degToRad(c.warp.maxTurnPerSec) * o / 1e3;
  19934. b.y = Math.sign(b.y) * Math.min(d, Math.abs(b.y)),
  19935. v.x = v.x + b.x * c.warp.turnFriction,
  19936. v.y = v.y + b.y * c.warp.turnFriction,
  19937. v.z = v.z + b.z * c.warp.turnFriction,
  19938. v.x = Math.max(r.Math.degToRad(c.warp.minDownAngle), v.x);
  19939. var p = t.clone().sub(C).normalize();
  19940. if (R < c.warp.maxAimRotation && u > 0) {
  19941. var g = 1 - u;
  19942. p.x = p.x * g + u * S.x,
  19943. p.y = p.y * g + u * S.y,
  19944. p.z = p.z * g + u * S.z,
  19945. p.normalize()
  19946. }
  19947. this.bunnyObj.position.copy(n.position).add(p),
  19948. f.set(0, 0, -1).applyEuler(v).normalize(),
  19949. f.multiplyScalar(8),
  19950. f.add(n.position),
  19951. e > 1 - i && c.warp.matchCam || (n.controls.lookAt(f),
  19952. n.controls.lookVector.copy(f),
  19953. n.lookAt(f))
  19954. }
  19955. .bind(this)
  19956. , k = function() {
  19957. _ ? (this.discardSlow(),
  19958. this.upcomingTransType = l.BLACK,
  19959. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, I.BEGINNING, e)) : this._wrapupWarpShading(e)
  19960. }
  19961. .bind(this);
  19962. V(0);
  19963. var H = c.warp.motionLeadTime + 1e3 * Math.abs(O()) / r.Math.degToRad(c.warp.maxTurnPerSec);
  19964. w += H;
  19965. var G = H / w;
  19966. this.warpCommonParameters(w, G, !0, I.NONE),
  19967. p.start(L, w, null, 0, null, "_haltWatcher"),
  19968. c.warp.blur > 0 && (g.blurStrength = c.warp.blur,
  19969. p.start(D, w, null, G, P, "blurring")),
  19970. p.start(B, w, null, G, P, "modelAlpha"),
  19971. p.start(F, w, null, G, d[c.warp.blendEasing], "followPath"),
  19972. p.start(V, w, null, G, d[c.warp.blendEasing], "goBunny"),
  19973. p.start(U, w, k, 0, d[c.warp.blendEasing], "lookAtBunny")
  19974. }
  19975. ,
  19976. n.prototype.warpTravel_BLACK = function(e, t, i, n) {
  19977. var r = e || 0;
  19978. void 0 !== t && null !== t || (t = c.warp.teleportTime),
  19979. this.warpCommonParameters(t, r, !1, i),
  19980. this.model.chunks.forEach(function(e) {
  19981. e.material.uniforms.blackout.value = i
  19982. }),
  19983. this._warpBendAim(null, t, null, r);
  19984. var o = function() {
  19985. this.wrapupWarpShadingOnly(n, i)
  19986. }
  19987. .bind(this);
  19988. p.start(this.stepWarpPath.bind(this), t, o, r, d[c.warp.blendEasing], "stepMotion")
  19989. }
  19990. ,
  19991. n.prototype.flightStepWalk = function(e, t, i) {
  19992. var n = .001
  19993. , o = 1
  19994. , a = 1.2
  19995. , s = new r.Vector3
  19996. , h = new r.Vector3
  19997. , u = function(e, t) {
  19998. var i = Math.min(this.player.position.distanceTo(e.position), c.transition.flytimeMaxDistanceThreshold)
  19999. , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
  20000. h.copy(A.FORWARD),
  20001. this.player.getDirection(h),
  20002. s.copy(t).sub(e.position).normalize();
  20003. var l = s.dot(h)
  20004. , u = Math.acos(l)
  20005. , d = u / r;
  20006. return d > n && (r *= d / n,
  20007. u < o && (r *= a)),
  20008. r
  20009. };
  20010. return function(e, t, i) {
  20011. if (this.warpInterrupted)
  20012. i && i();
  20013. else if (this.activeTransType !== l.WALK)
  20014. this._clearWarpShading(),
  20015. this._warpStopFlying(),
  20016. this.player.spider.draw(),
  20017. this.placeCpm(),
  20018. i && i();
  20019. else if (this.player.currentPano !== e) {
  20020. var n = {
  20021. pano: e,
  20022. lookAtPoint: t,
  20023. duration: null,
  20024. maxDistanceOverride: c.warp.walkMaxDist,
  20025. skipWarpingCheck: !1,
  20026. constantMoveSpeed: !0
  20027. };
  20028. n.duration = u.call(this, e, t),
  20029. this.player.nonInterruptingFlyToPano(n, i)
  20030. } else
  20031. i && i()
  20032. }
  20033. }(),
  20034. n.prototype.makeWalkFlightFunc = function(e, t, i) {
  20035. return this.flightStepWalk.bind(this, e, t, i)
  20036. }
  20037. ,
  20038. n.prototype.warpTravel_WALK = function() {
  20039. var e = [];
  20040. return function(t) {
  20041. var i = this.player.model.panos;
  20042. e.length = 0;
  20043. for (var n = null, o = !1, a = 0; a < this.nodes.length; a++) {
  20044. var s = this.nodes[a]
  20045. , l = i.get(s);
  20046. a === this.nodes.length - 1;
  20047. o = n && l.position.distanceTo(n.position) < c.warp.walkMinDist,
  20048. n && o || (e.push(s),
  20049. n = l)
  20050. }
  20051. o && this.nodes.length > 1 && (e[e.length - 1] = this.nodes[this.nodes.length - 1]);
  20052. var h = e.length
  20053. , u = i.get(e[h - 1])
  20054. , d = new Array(h + 1);
  20055. d[d.length - 1] = function() {
  20056. t && t()
  20057. }
  20058. .bind(this);
  20059. for (var p = h - 1, f = d.length - 1; f > 0; f -= 1) {
  20060. var g = e[p];
  20061. u = i.get(g);
  20062. var m = new r.Vector3;
  20063. this.getLookAtForWalkingTourNode(e, p, m),
  20064. d[f - 1] = this.makeWalkFlightFunc(u, m, d[f]),
  20065. p--
  20066. }
  20067. d[0]()
  20068. }
  20069. }(),
  20070. n.prototype.getLookAtForWalkingTourNode = function() {
  20071. var e = new r.Vector3
  20072. , t = new r.Vector3
  20073. , i = new r.Vector3
  20074. , n = new r.Vector3
  20075. , o = new r.Vector3
  20076. , a = .65
  20077. , s = .75
  20078. , l = .2
  20079. , c = .4
  20080. , h = .2
  20081. , u = 3;
  20082. return function(r, d, p) {
  20083. var f = r.length;
  20084. if (d >= f)
  20085. return !1;
  20086. var g = 1
  20087. , m = 1;
  20088. t.set(0, 0, 0),
  20089. o.set(0, 0, 0);
  20090. for (var v = null, A = d; A < d + u && !(A >= f); A++) {
  20091. if (v = this.player.model.panos.get(r[A]),
  20092. this.getOrientationForWalkingTourNode(r, A, i),
  20093. A === d && e.copy(i),
  20094. n.copy(i),
  20095. A > d) {
  20096. var y = n.dot(e) < a;
  20097. g *= y ? l : s,
  20098. m *= y ? h : c
  20099. }
  20100. i.multiplyScalar(g),
  20101. t.add(i),
  20102. o.lerp(v.position, m)
  20103. }
  20104. return t.normalize(),
  20105. p.copy(o),
  20106. p.add(t),
  20107. !0
  20108. }
  20109. }(),
  20110. n.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  20111. var n = e.length;
  20112. if (t >= n)
  20113. return !1;
  20114. if (t === n - 1)
  20115. i.copy(A.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  20116. else {
  20117. var r = this.player.model.panos.get(e[t])
  20118. , o = this.player.model.panos.get(e[t + 1]);
  20119. i.copy(o.position).sub(r.position)
  20120. }
  20121. return i.normalize(),
  20122. !0
  20123. }
  20124. ,
  20125. n.prototype.warpCameraTravel = function(e, t, i, n) {
  20126. if (this.activeTransType = this.upcomingTransType,
  20127. this.lastTransType = this.activeTransType,
  20128. this.upcomingTransType = null,
  20129. !e) {
  20130. var r = function() {
  20131. this._wrapupTravel(n)
  20132. }
  20133. .bind(this)
  20134. , o = {
  20135. pano: this.warpDestPano,
  20136. lookAtPoint: null,
  20137. duration: null,
  20138. maxDistanceOverride: null,
  20139. skipWarpingCheck: !1
  20140. };
  20141. return void this.player.flyToPano(o, r)
  20142. }
  20143. this.activeTransType === l.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === l.WALK ? this.warpTravel_WALK(function() {
  20144. this._clearWarpShading(),
  20145. this._warpStopFlying(),
  20146. this.player.spider.draw(),
  20147. this.placeCpm(),
  20148. n && n()
  20149. }
  20150. .bind(this)) : this.warpTravel_STD(n)
  20151. }
  20152. ,
  20153. n.prototype.startWarpState = function() {
  20154. this.warping = !0,
  20155. this.warpInterrupted = !1,
  20156. this.warpInterruptionBlackoutStyle = null,
  20157. this.warpInterruptionTravelTime = null
  20158. }
  20159. ,
  20160. n.prototype.endWarpState = function() {
  20161. this.warping = !1
  20162. }
  20163. ,
  20164. n.prototype.warpToPano = function(e, t, i, n) {
  20165. if (this.warping)
  20166. return void y.warn("Cannot warp when already warping");
  20167. if (this.upcomingTransType = e,
  20168. this.activeTransType = null,
  20169. !this.setWarpDestPano())
  20170. return this.upcomingTransType = null,
  20171. void this.warpToNonPano(n);
  20172. if (this.player.mode !== a.PANORAMA)
  20173. return this.upcomingTransType = null,
  20174. this.discardSlow(),
  20175. void this.player.flyToNewMode({
  20176. mode: a.PANORAMA,
  20177. pano: this.warpDestPano,
  20178. duration: c.warp.outsideTime,
  20179. warpDest: this.warpDestHeroLoc,
  20180. callback: n,
  20181. force: !0
  20182. });
  20183. if (!this.warpDestPano)
  20184. return y.warn("no warp destination, callback dropped"),
  20185. void (this.upcomingTransType = null);
  20186. 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)
  20187. , o = this.chooseWarpPath(r);
  20188. if (o && this.upcomingTransType !== l.WALK) {
  20189. var s = function() {
  20190. this.waitingToWarp = !1,
  20191. this.warpToPano(e, t, i, n)
  20192. }
  20193. .bind(this);
  20194. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, s))
  20195. return void (this.waitingToWarp = !0)
  20196. }
  20197. this.player.currentPano || (y.warn("Arrived at a very strange spot!"),
  20198. this.player.currentPano = this.warpDestPano,
  20199. this.placeCpm(),
  20200. this.fadeOutCpm(c.path.fadeOutTime),
  20201. this.player.spider.draw()),
  20202. y.debug("Warping to pano ", this.warpDestPano.position),
  20203. this.upcomingTransType !== l.WALK && this.player.emit(C.PanoChosen, this.player.currentPano, this.warpDestPano),
  20204. this.startWarpState();
  20205. var h = function() {
  20206. this.endWarpState(),
  20207. n && n()
  20208. }
  20209. .bind(this);
  20210. o ? this.warpCameraTravel(r, t, i, h) : this.warpCameraAim(h),
  20211. this.player.smoothZoomToDefault(c.zoom.restoreTime)
  20212. }
  20213. ,
  20214. t.exports = n
  20215. }
  20216. ).call(this, "/js/objects/ShowPath.js")
  20217. }
  20218. , {
  20219. "../constants": 8,
  20220. "../effects": 16,
  20221. "../enum/BlackoutStyle": 18,
  20222. "../enum/ModelManagerEvents": 33,
  20223. "../enum/PlayerEvents": 40,
  20224. "../enum/RenderOrder": 42,
  20225. "../enum/Vectors": 50,
  20226. "../enum/Viewmode": 51,
  20227. "../enum/WarpStyle": 52,
  20228. "../gui/gui": 65,
  20229. "../model/ModelManager": 140,
  20230. "../objects/Snapshot": 153,
  20231. "../settings": 166,
  20232. "../shaders": 167,
  20233. "../util/easing": 186,
  20234. "../util/lerp": 188,
  20235. "../util/logger": 189,
  20236. "../util/math": 190,
  20237. "../util/texture": 194,
  20238. "../util/transitions": 195,
  20239. three: 217
  20240. }],
  20241. 152: [function(e, t, i) {
  20242. "use strict";
  20243. function n() {
  20244. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  20245. , t = new r.RawShaderMaterial({
  20246. fragmentShader: o.skysphere.fragmentShader,
  20247. vertexShader: o.skysphere.vertexShader,
  20248. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  20249. side: r.BackSide,
  20250. name: "skysphere"
  20251. });
  20252. t.uniforms.radius.value = e.parameters.radius,
  20253. r.Mesh.call(this, e, t)
  20254. }
  20255. var r = e("three")
  20256. , o = e("../shaders")
  20257. , a = e("../settings");
  20258. n.prototype = Object.create(r.Mesh.prototype),
  20259. n.prototype.constructor = n,
  20260. t.exports = n
  20261. }
  20262. , {
  20263. "../settings": 166,
  20264. "../shaders": 167,
  20265. three: 217
  20266. }],
  20267. 153: [function(e, t, i) {
  20268. (function(i) {
  20269. "use strict";
  20270. function n(e) {
  20271. o.call(this, e),
  20272. this.sid = e.sid,//xzw add
  20273. this.panoId = e.panoId,
  20274. this.orthoZoom = e.orthoZoom,
  20275. this.floorVisibility = e.floorVisibility,
  20276. this.thumbUrl = e.thumbUrl,
  20277. this.name = e.name
  20278. }
  20279. var r = (e("three"),
  20280. e("../util/logger"))
  20281. , o = (e("../settings"),
  20282. e("../enum/Viewmode"),
  20283. e("../util/common"),
  20284. e("../util/transitions"),
  20285. e("../util/lerp"),
  20286. e("../util/ajax"),
  20287. e("../util/texture"),
  20288. e("./View"));
  20289. e("events").EventEmitter,
  20290. new r(i);
  20291. n.prototype = Object.create(o.prototype),
  20292. n.prototype.isPano = function() {
  20293. return this.panoId && "" !== this.panoId
  20294. }
  20295. ,
  20296. t.exports = n
  20297. }
  20298. ).call(this, "/js/objects/Snapshot.js")
  20299. }
  20300. , {
  20301. "../enum/Viewmode": 51,
  20302. "../settings": 166,
  20303. "../util/ajax": 181,
  20304. "../util/common": 185,
  20305. "../util/lerp": 188,
  20306. "../util/logger": 189,
  20307. "../util/texture": 194,
  20308. "../util/transitions": 195,
  20309. "./View": 154,
  20310. events: 202,
  20311. three: 217
  20312. }],
  20313. 154: [function(e, t, i) {
  20314. (function(i) {
  20315. "use strict";
  20316. function n(e) {
  20317. e = e || {},
  20318. this.position = new r.Vector3,
  20319. this.quaternion = new r.Quaternion,
  20320. this.update(e)
  20321. }
  20322. var r = e("three")
  20323. , o = e("../util/logger")
  20324. , a = (e("../settings"),
  20325. e("../enum/Viewmode"),
  20326. e("../util/common"),
  20327. e("../util/transitions"),
  20328. e("../util/lerp"),
  20329. e("../util/ajax"),
  20330. e("../util/texture"),
  20331. e("events").EventEmitter);
  20332. new o(i);
  20333. n.prototype = Object.create(a.prototype),
  20334. n.prototype.isValid = function() {
  20335. return !!this.cameraMode
  20336. }
  20337. ,
  20338. n.prototype.update = function(e) {
  20339. return this.cameraMode = e.cameraMode || this.cameraMode,
  20340. this.pano = e.pano || this.pano,
  20341. e.position && this.position.copy(e.position),
  20342. e.quaternion && this.quaternion.copy(e.quaternion),
  20343. this
  20344. }
  20345. ,
  20346. t.exports = n
  20347. }
  20348. ).call(this, "/js/objects/View.js")
  20349. }
  20350. , {
  20351. "../enum/Viewmode": 51,
  20352. "../settings": 166,
  20353. "../util/ajax": 181,
  20354. "../util/common": 185,
  20355. "../util/lerp": 188,
  20356. "../util/logger": 189,
  20357. "../util/texture": 194,
  20358. "../util/transitions": 195,
  20359. events: 202,
  20360. three: 217
  20361. }],
  20362. 155: [function(e, t, i) {//player.js
  20363. (function(i) {
  20364. "use strict";
  20365. function n(e) {
  20366. this.currentPano = null,
  20367. this.nextPano = null,
  20368. this.camera = null,
  20369. this.paused = !1,
  20370. this.flying = !1,
  20371. this.sceneIntersectionPlane = null,
  20372. this.target = new r.Vector3,
  20373. this.mouse = new r.Vector3(1.1,1.1,.5),
  20374. this.mouseAtMouseDown = new r.Vector2,
  20375. this.mouseCouldBeClickToMove = !1,
  20376. this.mouseLastMoveTime = Date.now(),
  20377. this.mouseDown = !1,
  20378. this.mouseDownTimer = null,
  20379. this.couldBeLongTap = !1,
  20380. this.containsMouse = !0,
  20381. this.isTouchEvent = !1,
  20382. this.isPanoHover = !1,
  20383. this.reticule = new a(this),
  20384. this.panoMarkers = [],
  20385. this.spider = new h(this),
  20386. this.quaternion = new r.Quaternion,
  20387. this.position = new r.Vector3(15,10,15),
  20388. this.previousState = null,
  20389. this.lastInsideView = new c,
  20390. this.last360View = new c,
  20391. this.raycaster = new r.Raycaster,
  20392. this.intersect = null,
  20393. this.lastChangeTime = Date.now(),
  20394. this.history = new I,
  20395. this.cameraControls = null,
  20396. this.path = null,
  20397. this.model = null,
  20398. this.domElement = null,
  20399. this.cachedPanoCandidates = null,
  20400. this.basePanoSize = 0,
  20401. this.standardPanoSize = 0,
  20402. this.highPanoSize = 0,
  20403. this.ultraHighPanoSize = 0,
  20404. this.zoomLevel = 1,
  20405. this.zooming = 0,
  20406. this.zoomSpeed = .5,
  20407. this.scrollZoomSpeed = .06,
  20408. this.zoomSpeedAdjust = .05,
  20409. this.defaultZoomIncrement = .2,
  20410. this.baseFov = f.insideFOV,
  20411. this.zoomFov = this.baseFov,
  20412. this.zoomEnabled = !0,
  20413. this.preRenderingEnabled = !1,
  20414. this.setupCustomProperties(e),
  20415. this.zoomStats = new L
  20416. }
  20417. var r = e("three")
  20418. , o = e("./util/logger")
  20419. , a = e("./objects/Reticule")
  20420. , s = e("./objects/Panorama")
  20421. , l = e("./objects/ShowPath")
  20422. , c = e("./objects/View")
  20423. , h = (e("./objects/Snapshot"),
  20424. e("./objects/NSpider"))
  20425. , u = e("./enum/Viewmode")
  20426. , d = (e("./enum/TagStates"),
  20427. e("./enum/Vectors"))
  20428. , p = e("./enum/Keys")
  20429. , f = (e("./enum/AlignmentType"),
  20430. e("./settings"))
  20431. , g = e("./util/common")
  20432. , m = (e("./util/browser"),
  20433. e("./util/math"))
  20434. , v = e("./util/lerp")
  20435. , A = e("./util/easing")
  20436. , y = e("./util/transitions")
  20437. , C = e("events").EventEmitter
  20438. , I = (e("./shaders"),
  20439. e("./util/history"))
  20440. , E = (e("./util/camera"),
  20441. e("./model/ModelManager"),
  20442. e("./enum/PathDiscardMode"))
  20443. , b = e("./enum/PathDisplayMode")
  20444. , w = e("./enum/PlayerEvents")
  20445. , _ = e("./enum/ControlEvents")
  20446. , T = e("./enum/ModelManagerEvents")
  20447. , x = e("./enum/WarpStyle")
  20448. , S = e("./enum/BlackoutStyle")
  20449. , M = e("./exception/BasicException")
  20450. , R = e("./enum/PanoSizeClass")
  20451. , P = (e("./tile/TileDownloader"),
  20452. e("./tile/TilePrioritizer"))
  20453. , O = (e("./enum/PanoramaEvents"),
  20454. e("./enum/ZoomEvents"))
  20455. , L = e("./util/ZoomStats")
  20456. , D = e("./constants")
  20457. , N = e("./util/common")
  20458. , B = e("./util/cameraLight")
  20459. , Hot = e('hot')
  20460. , F = new o(i)
  20461. , V = Object.freeze({
  20462. FlyToPano: y.getUniqueId(),
  20463. FlyToNewMode: y.getUniqueId(),
  20464. FlyToSameMode: y.getUniqueId(),
  20465. FlyToViewFloor: y.getUniqueId(),
  20466. LookTransition: y.getUniqueId(),
  20467. ZoomTransition: y.getUniqueId()
  20468. });
  20469. n.prototype = Object.create(C.prototype),
  20470. n.prototype.init = function(e) {
  20471. this.modelManager = e.modelManager,
  20472. this.tileDownloader = e.tileDownloader,
  20473. this.panoRenderer = e.panoRenderer,
  20474. this.qualityManager = e.qualityManager,
  20475. this.domElement = e.container,
  20476. this.camera = e.camera,
  20477. this.tagManager = e.tagManager,
  20478. this.cameraControls = e.controls,
  20479. this.path = new l(e.director,this,e.controls),
  20480. this.basePanoSize = this.qualityManager.getPanoSize(R.BASE),
  20481. this.standardPanoSize = this.qualityManager.getPanoSize(R.STANDARD),
  20482. this.highPanoSize = this.qualityManager.getPanoSize(R.HIGH),
  20483. this.ultraHighPanoSize = this.qualityManager.getPanoSize(R.ULTRAHIGH),
  20484. this.tileDownloader.processPriorityQueue = !1,
  20485. this.tileDownloader.tilePrioritizer = new P(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  20486. this.bindEvents(e.container),
  20487. this.updateModel()
  20488. }
  20489. //xzw add: 截图
  20490. function dataURLtoBlob(dataurl) {
  20491. var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
  20492. bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
  20493. while(n--){
  20494. u8arr[n] = bstr.charCodeAt(n);
  20495. }
  20496. return new Blob([u8arr], {type:mime});
  20497. }
  20498. n.prototype.screenShot = function(o){
  20499. if(this.flying || this.flyingToTag) return;
  20500. var R = this.sceneRenderer;
  20501. R.updateScreenSize(o);
  20502. for(var i in this.model.panos.index){
  20503. this.model.panos.index[i].marker.forceHide = this.model.panos.index[i].marker.visible;
  20504. this.model.panos.index[i].marker.visible = false;
  20505. }
  20506. for(var i in this.model.hots){
  20507. this.model.hots[i].mesh.visible = false;
  20508. }
  20509. this.reticule.visible = false;
  20510. this.reticule.forceUnvisible = true;
  20511. this.path.currentPanoMarker.mesh.visible = false;
  20512. setTimeout(function(){//因resize效用没办法立即生效(原因未知),故而延后
  20513. R.renderer.clear(true,true,true);
  20514. R.renderer.render(R.scene, R.camera);
  20515. var imgData = R.renderer.domElement.toDataURL(o.type,0.9);
  20516. o.f && o.f(imgData)
  20517. R.updateScreenSize({resize:true});
  20518. this.reticule.visible = true;
  20519. for(var i in this.model.hots){
  20520. this.model.hots[i].mesh.visible = true;
  20521. }
  20522. for(var i in this.model.panos.index){
  20523. this.model.panos.index[i].marker.visible = this.model.panos.index[i].marker.forceHide;
  20524. }
  20525. this.path.currentPanoMarker.mesh.visible = true;
  20526. R.renderer.render(R.scene, R.camera);
  20527. }.bind(this),30) //这个数字不能太小
  20528. }
  20529. var scaleImg = e("scaleImg");
  20530. var ResizeImg = function(img, option){
  20531. var img2; //不能直接改img 否则可能触发第二次img.onload
  20532. var compress = function(ratio,type){
  20533. var image = img2 || img;
  20534. var c = document.createElement('canvas');
  20535. c.width = image.width; c.height = image.height;
  20536. var ctx = c.getContext('2d');
  20537. ctx.drawImage(image,0,0,image.width,image.height);
  20538. img2 = scaleImg(ratio/* option.maxSize/oldSize */, c, type/* option.type||"png" */);//最大不能超过0.8M
  20539. }
  20540. var reCom = function(){ //如果有了img2 就只需要img2 否则创造新的img2
  20541. var image = img2 || img;
  20542. var blob = dataURLtoBlob(image.src);
  20543. if(option.maxWeight && blob.size > option.maxWeight){
  20544. compress(option.maxWeight/blob.size, "jpeg")
  20545. blob = dataURLtoBlob(image.src);
  20546. }
  20547. if(!img2){
  20548. img2 = new Image();
  20549. }
  20550. img2.base64Src = image.src;
  20551. img2.src = window.URL.createObjectURL(blob);
  20552. }
  20553. var oldSize = Math.max(img.width, img.height);
  20554. if(option.toType != "png"){//不是非要png的话
  20555. if(option.oldType == "jpeg"){//jpeg先判断尺寸,然后是尺寸
  20556. if(oldSize > option.maxSize){
  20557. compress(option.maxSize/oldSize, "jpeg");
  20558. }
  20559. reCom();
  20560. }else if(option.oldType == "png"){//png先判断数据量 如果数据量达标,就无视大小(有可能超出大小)
  20561. if(option.maxWeight && option.weight > option.maxWeight){//如果一开始大小不大就不压缩 还是png
  20562. compress(oldSize>option.maxSize ? option.maxSize/oldSize : 1, "jpeg");
  20563. reCom();
  20564. }
  20565. }
  20566. }else{
  20567. //?貌似png会越压缩越大?
  20568. }
  20569. return img2 || img;
  20570. }
  20571. var _fixType=function(type) {
  20572. type = type.toLowerCase().replace(/jpg/i, 'jpeg');
  20573. var r = type.match(/png|jpeg|bmp|gif/)[0];
  20574. return 'image/' + r;
  20575. };
  20576. var saveFile=function(data, filename){
  20577. var save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
  20578. save_link.href = data;
  20579. save_link.download = filename;
  20580. var event = document.createEvent('MouseEvents');
  20581. event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  20582. save_link.dispatchEvent(event);
  20583. };
  20584. n.prototype.getWrapShot = function(){ //获取导览点截图和信息
  20585. var str = ',{\r\t'+this.getSnapAngleInfo();
  20586. this.screenShot({ width:g_snapShotWidth*4, height:g_snapShotHeight*4, type:"image/jpeg", f:function(imgData){
  20587. var img = new Image();
  20588. img.src = imgData;
  20589. img.onload = function(){
  20590. var img2 = ResizeImg(this,{maxSize: g_snapShotWidth, oldType:"jpeg"}); //暂定缩略图大小
  20591. img2.src.replace(_fixType("image/jpeg"),'image/octet-stream');
  20592. var filename = "snap" + (new Date()).getTime();
  20593. saveFile(img2.src,filename + ".jpg");
  20594. str +=(',\r\t"thumbnail_signed_src":"'+filename+'.jpg",');
  20595. str +=('\r\t"sid":"'+filename+'",');
  20596. str +=('\r\t"name":"'+filename+'"\r}');
  20597. logData(str)
  20598. }
  20599. }});
  20600. }
  20601. ,
  20602. n.prototype.getSnapAngleInfo = function(){
  20603. var info = {};
  20604. var str = '"metadata":{';
  20605. var q = this.camera.quaternion.clone();
  20606. switch (this.mode) {
  20607. case "panorama":
  20608. info.scan_id = this.currentPano.id;
  20609. str += ('"scan_id":"'+this.currentPano.id+'",');
  20610. break;
  20611. case "floorplan":
  20612. info.camera_mode = 1;
  20613. q = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  20614. q.multiply(this.camera.quaternion);
  20615. str += ('"camera_mode":1,');
  20616. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  20617. str += ('"ortho_zoom":'+ m.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  20618. break;
  20619. case "dollhouse":
  20620. info.camera_mode = 2;
  20621. str += ('"camera_mode":2,');
  20622. break;
  20623. }
  20624. info.camera_position = m.toPrecision(this.camera.position.toArray(),4);
  20625. info.camera_quaternion = m.toPrecision(q.toArray(),4);
  20626. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  20627. return str;
  20628. }
  20629. //------end
  20630. n.prototype.closePopup = function() {//xzw 关闭热点页面
  20631. if(!g_currentHot) return;
  20632. g_currentHot = null;
  20633. var hotPop = document.getElementById('popup');
  20634. hotPop.style.display = "none";
  20635. hotPop.removeChild(document.getElementById("id1"));
  20636. $("#popup iframe:last").remove();
  20637. var _bgaudio = document.getElementById("bgaudio");
  20638. //判断音乐是否暂停或者是否存在
  20639. if(g_bgAudio && g_bgAudio.paused && g_bgAudio.readyState != 0)
  20640. {
  20641. g_bgAudio.play();
  20642. }
  20643. //$('#player').off("click",this.closePopup);
  20644. return false
  20645. }
  20646. n.prototype.setupCustomProperties = function(e) {
  20647. var t = e || u.PANORAMA;
  20648. Object.defineProperty(this, "mode", {
  20649. get: function() {
  20650. return t
  20651. },
  20652. set: function(e) {
  20653. var i = t;
  20654. t = e,
  20655. this.onModeUpdated(i, t)
  20656. }
  20657. })
  20658. }
  20659. ,
  20660. n.prototype.isInMode = function() {
  20661. for (var e = 0; e < arguments.length; e++)
  20662. if (this.mode === arguments[e])
  20663. return !0;
  20664. return !1
  20665. }
  20666. ,
  20667. n.prototype.isOutsideMode = function(e) {
  20668. return e = e || this.mode,
  20669. e === u.DOLLHOUSE || e === u.FLOORPLAN
  20670. }
  20671. ,
  20672. n.prototype.is360View = function(e, t) {
  20673. return e === u.PANORAMA && t && !t.isAligned()
  20674. }
  20675. ,
  20676. n.prototype.setScene = function(e) {
  20677. this.sceneIntersectionPlane = e.plane,
  20678. this.path.setScene(e),
  20679. this.moveReticuleToScene(e)
  20680. }
  20681. ,
  20682. n.prototype.moveReticuleToScene = function(e) {
  20683. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  20684. e.add(this.reticule)
  20685. }
  20686. ,
  20687. n.prototype.updateModel = function() {
  20688. function e(e, t, n) {
  20689. this.mode === u.DOLLHOUSE && e !== n && i.call(this, e.center.y)
  20690. }
  20691. function t(e, t) {
  20692. if (this.mode === u.DOLLHOUSE) {
  20693. var n = e ? this.model.center.y : n = t.center.y;
  20694. i.call(this, n)
  20695. }
  20696. }
  20697. function i(e) {
  20698. var t = this.cameraControls.cameras[u.DOLLHOUSE]
  20699. , i = this.cameraControls.controls[u.DOLLHOUSE]
  20700. , n = t.position.y + (e - i.target.y)
  20701. , r = f.showFloorDuration + f.showFloorDelay;
  20702. y.start(v.property(i.target, "y", e), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor),
  20703. y.start(v.property(t.position, "y", n), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor)
  20704. }
  20705. this.model = this.modelManager.getActiveModel(),
  20706. this.model.on("floor.changed", e.bind(this)),
  20707. this.model.on("allfloors.toggled", t.bind(this)),
  20708. this.on(w.PanoChosen, this.model.setProjectedPanos.bind(this.model))
  20709. }
  20710. ,
  20711. n.prototype.updateModelDependentData = function() {
  20712. this.cameraControls.setModelForControls(this.model),
  20713. this.getPanoMarkersFromModel(this.model)
  20714. }
  20715. ,
  20716. n.prototype.onModelChanged = function() {
  20717. this.updateModel(),
  20718. this.updateModelDependentData()
  20719. }
  20720. ,
  20721. n.prototype.getPanoMarkersFromModel = function(e) {
  20722. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  20723. return t.marker ? e.concat(t.marker) : e
  20724. }, [])
  20725. }
  20726. ,
  20727. n.prototype.handleControlMove = function(e) {
  20728. this.emit(w.Move, e)
  20729. }
  20730. ,
  20731. n.prototype.handleControlInputStart = function(e) {
  20732. this.emit(w.InputStart, e)
  20733. }
  20734. ,
  20735. n.prototype.onModeUpdated = function(e, t) {
  20736. this.cameraControls.activateControls(t),
  20737. this.emit(w.ModeChanged, e, t)
  20738. }
  20739. ,
  20740. n.prototype.isWarping = function() {
  20741. return this.path.warping
  20742. }
  20743. ,
  20744. n.prototype.isWaitingToWarp = function() {
  20745. return this.path.waitingToWarp
  20746. }
  20747. ,
  20748. n.prototype.getLabelScaleFactor = function() {
  20749. if (this.isOutsideMode()) {
  20750. var e = 10
  20751. , t = Math.sqrt(this.cameraControls.controls[u.FLOORPLAN].currentScale / e);
  20752. return t
  20753. }
  20754. return .5
  20755. }
  20756. ,
  20757. n.prototype.changeMusic = function() {//xzw add
  20758. if(!this.director.tourIsPlaying && g_play && g_bgAudio){
  20759. g_playAudio = g_bgAudio;
  20760. g_bgAudio.play();
  20761. }else{
  20762. if(!g_play){
  20763. g_playAudio = g_bgAudio;
  20764. }else{//防止再次播放时重播一遍
  20765. g_playAudio = null;
  20766. }
  20767. }
  20768. }
  20769. ,
  20770. n.prototype.bindEvents = function(e) {
  20771. e !== document && e.setAttribute("tabindex", -1),
  20772. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  20773. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  20774. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  20775. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  20776. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  20777. this.modelManager.on(T.ActiveModelChanged, this.onModelChanged.bind(this)),
  20778. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  20779. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  20780. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  20781. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  20782. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  20783. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  20784. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  20785. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  20786. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  20787. this.cameraControls.on(_.Move, this.handleControlMove.bind(this)),
  20788. this.cameraControls.on(_.InputStart, this.handleControlInputStart.bind(this)),
  20789. this.cameraControls.on(_.Pinch, this.handleControlPinch.bind(this)),
  20790. this.cameraControls.on(_.Scroll, this.handleControlScroll.bind(this)),
  20791. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this))//xzw add
  20792. window.addEventListener("tourAudioEnded", this.changeMusic.bind(this))//xzw add
  20793. console.log('---->', getSeft)
  20794. window.getSeft && getSeft(this);
  20795. //判断是否是移动端,如果是给关闭按钮添加touchstart事件
  20796. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  20797. $('#closepop').on("touchstart",this.closePopup.bind(this));
  20798. }else{
  20799. $('#closepop').on("click",this.closePopup.bind(this));
  20800. }
  20801. }
  20802. ,
  20803. n.prototype.onMouseDown = function(e) {
  20804. e.currentTarget !== document && e.currentTarget.focus(),
  20805. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  20806. this.updateIntersect())
  20807. }
  20808. ,
  20809. n.prototype.onMouseMove = function(e) {
  20810. this.isTouchEvent = !1,
  20811. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  20812. }
  20813. ,
  20814. n.prototype.onMouseOver = function(e) {
  20815. this.containsMouse = !0,
  20816. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  20817. }
  20818. ,
  20819. n.prototype.onMouseOut = function(e) {
  20820. this.containsMouse = !1
  20821. }
  20822. ,
  20823. n.prototype.onMouseUp = function(e) {
  20824. this.handleInputEnd.call(this, e.clientX, e.clientY, !1);
  20825. }
  20826. ,
  20827. n.prototype.onTouchStart = function(e) {
  20828. if (e.currentTarget !== document && e.currentTarget.focus(),
  20829. !this.mouseDown) {
  20830. this.couldBeLongTap = !0;
  20831. var t = g.average(e.changedTouches, "clientX")
  20832. , i = g.average(e.changedTouches, "clientY");
  20833. this.handleInputStart.call(this, t, i, !0),
  20834. this.mouseDownTimer = setTimeout(function() {
  20835. this.updateIntersect(),
  20836. this.handleInputEnd.call(this, t, i, !0)
  20837. }
  20838. .bind(this), f.input.longTapThreshold)
  20839. }
  20840. }
  20841. ,
  20842. n.prototype.onTouchMove = function(e) {
  20843. var t = g.average(e.changedTouches, "clientX")
  20844. , i = g.average(e.changedTouches, "clientY");
  20845. this.handleInputMove.call(this, t, i, !0)
  20846. }
  20847. ,
  20848. n.prototype.onTouchEnd = function(e) {
  20849. if (clearTimeout(this.mouseDownTimer),
  20850. this.mouseDown) {
  20851. this.couldBeLongTap = !1,
  20852. this.updateIntersect();
  20853. var t = g.average(e.changedTouches, "clientX")
  20854. , i = g.average(e.changedTouches, "clientY");
  20855. this.handleInputEnd.call(this, t, i, !0)
  20856. }
  20857. }
  20858. ,
  20859. n.prototype.onPointerDown = function(e) {
  20860. return e.currentTarget !== document && e.currentTarget.focus(),
  20861. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  20862. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  20863. void (this.mouseDownTimer = setTimeout(function() {
  20864. this.updateIntersect(),
  20865. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  20866. }
  20867. .bind(this), f.input.longTapThreshold)))
  20868. }
  20869. ,
  20870. n.prototype.onPointerMove = function(e) {
  20871. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  20872. }
  20873. ,
  20874. n.prototype.onPointerUp = function(e) {
  20875. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  20876. this.couldBeLongTap = !1,
  20877. this.updateIntersect(),
  20878. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  20879. }
  20880. ,
  20881. n.prototype.onPointerOut = function(e) {
  20882. this.mouseDown = !1
  20883. }
  20884. ,
  20885. n.prototype.onPointerCancel = function(e) {
  20886. this.mouseDown = !1
  20887. }
  20888. ,
  20889. n.prototype.onKeyDown = function(e) {
  20890. var t = function() {
  20891. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, "key")
  20892. }
  20893. .bind(this)
  20894. , i = e.which;
  20895. switch (i) {
  20896. case p.F:
  20897. t(),
  20898. this.changeFloor(-1);
  20899. break;
  20900. case p.R:
  20901. t(),
  20902. this.changeFloor(1)
  20903. }
  20904. if (this.mode === u.PANORAMA)
  20905. switch (i) {
  20906. case p.UPARROW:
  20907. case p.W:
  20908. this.flyLocalDirection(d.FORWARD.clone());
  20909. break;
  20910. case p.DOWNARROW:
  20911. case p.S:
  20912. this.flyLocalDirection(d.BACK.clone());
  20913. break;
  20914. case p.A:
  20915. this.flyLocalDirection(d.LEFT.clone());
  20916. break;
  20917. case p.D:
  20918. this.flyLocalDirection(d.RIGHT.clone())
  20919. }
  20920. }
  20921. ,
  20922. n.prototype.handleScrollPinchZoom = function() {
  20923. return function(e) {
  20924. var t = e
  20925. , i = this.zoomLevel;
  20926. this.zoomBy(t),
  20927. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  20928. }
  20929. }(),
  20930. n.prototype.handleControlPinch = function(e) {
  20931. f.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new r.Vector3(0,0,e).normalize())
  20932. }
  20933. ,
  20934. n.prototype.handleControlScroll = function(e) {
  20935. f.zoom.enabled ? (e > 0 ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  20936. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new r.Vector3(0,0,-e).normalize())
  20937. }
  20938. ,
  20939. n.prototype.handleInputStart = function(e, t, i) {
  20940. this.isTouchEvent = i,
  20941. m.convertScreenPositionToNDC(e, t, this.mouse),
  20942. m.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  20943. this.mouseCouldBeClickToMove = !0,
  20944. this.mouseDown = !0;
  20945. if (this.mouseCouldBeClickToMove) {
  20946. new DownInterface().state(this,Hot);
  20947. }
  20948. }
  20949. ,
  20950. n.prototype.handleInputMove = function(e, t, i) {
  20951. this.isTouchEvent = i,
  20952. m.convertScreenPositionToNDC(e, t, this.mouse),
  20953. this.mouseAtMouseDown.distanceTo(this.mouse) > f.input.moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  20954. this.couldBeLongTap = !1,
  20955. clearTimeout(this.mouseDownTimer)),
  20956. this.mouseLastMoveTime = Date.now(),
  20957. this.reticule.move(e, t, i)
  20958. }
  20959. ,
  20960. n.prototype.handleInputEnd = function(e, t, i) {//xzw
  20961. if (this.isTouchEvent = i,
  20962. this.mouseDown = !1,
  20963. this.cameraControls.controls[u.PANORAMA].emit("interaction.direct"),
  20964. !i && this.couldBeLongTap)
  20965. return !0;
  20966. if (this.handleLongTap())
  20967. return !0;
  20968. if (this.mouseCouldBeClickToMove) {
  20969. if (this.flying)
  20970. return this.path.activeTransType === x.WALK && this.emit(w.WarpInterruptedWithFlyTo, this.path.activeTransType),
  20971. !0;
  20972. if(this.checkHotClick())//add
  20973. return !0;
  20974. // if(g_HotStatus == "add"){//添加热点 add
  20975. // var position = this.reticule.position.toArray();
  20976. // var rotation = this.reticule.rotation.toArray().slice(0,3);
  20977. // var sid = "hot"+(this.model.hotsCount+g_newHot.length);
  20978. // while(this.model.hots[sid]){sid+="_1"}//防重名
  20979. // var hot = new Hot(sid, {position:position, rotation:rotation, size:2}, this.model);
  20980. // g_newHot.push(hot);
  20981. // this.model.hots[sid] = hot;
  20982. // $('#addHot textarea')[0].value+=('添加热点:\r"'+sid + '":{ "position":['+position+'], "rotation":['+rotation+']},\r');
  20983. // logData('添加热点:\r"'+sid + '":{ "position":['+position+'], "rotation":['+rotation+']},\r')
  20984. // g_HotStatus = false;
  20985. // $("#player").css("cursor","");
  20986. // return !0;
  20987. // }
  20988. //if (this.checktagClick())
  20989. // return !0;
  20990. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, this.isTouchEvent ? "touch" : "mouse"),
  20991. this.history.invalidate(),
  20992. this.intersect)
  20993. return this.flyToPanoClosestToMouse();
  20994. if (this.mode === u.PANORAMA) {
  20995. var n = this.closestPanoInDirection(this.getMouseDirection());
  20996. return n ? this.flyToPano({
  20997. pano: n
  20998. }) : this.bump(this.getMouseDirection())
  20999. }
  21000. }
  21001. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  21002. }
  21003. ,
  21004. n.prototype.handleLongTap = function() {
  21005. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== u.PANORAMA))
  21006. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.LongTap, "touch"),
  21007. !0
  21008. }
  21009. ,
  21010. n.prototype.checktagClick = function() {
  21011. if (this.tagManager.intersectTag) {
  21012. var e = this.isTouchEvent
  21013. , t = this.tagManager.clickedOnTag(e, this);
  21014. return e || t || y.cancelById(V.LookTransition),
  21015. !0
  21016. }
  21017. if (this.tagManager.activeTag)
  21018. return this.tagManager.dismissActiveTag(),
  21019. !1
  21020. }
  21021. ,
  21022. n.prototype.rankedtagInDirection = function(e, t) {
  21023. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  21024. }
  21025. ,
  21026. n.prototype.start = function(e) {
  21027. var t = e.mode
  21028. , i = e.pano
  21029. , n = e.position
  21030. , r = e.quaternion
  21031. , o = e.tag
  21032. , a = e.quickstart
  21033. , s = $.Deferred();
  21034. this.updateModelDependentData(),
  21035. this.updateFromControls(),
  21036. this.findDefaultViews();
  21037. var l = this.is360View(t, i);
  21038. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  21039. s.done(function(e) {
  21040. this.emit(w.Ready, l, e, o)
  21041. }
  21042. .bind(this)),
  21043. s.promise()
  21044. }
  21045. ,
  21046. n.prototype.startOutside = function(e, t) {
  21047. var i = e.mode
  21048. , n = e.pano
  21049. , r = e.position
  21050. , o = e.quaternion
  21051. , a = e.zoom
  21052. , s = e.floorVisibility
  21053. , l = e.tag;
  21054. this.emit(w.StartOutside, f[i].transitionTime),
  21055. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  21056. y.cancelById(V.FlyToViewFloor),
  21057. i === u.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  21058. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  21059. }
  21060. ,
  21061. n.prototype.startInside = function(e, t, i, n, r) {
  21062. r = r || $.Deferred(),
  21063. this.currentPano = e;
  21064. var o = e && !e.isAligned();
  21065. if (t = o ? e.position : t || e.position,
  21066. i = i || e.quaternion,
  21067. e) {
  21068. var a = this.startInside.bind(this, e, t, i, n, r);
  21069. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  21070. return
  21071. }
  21072. return this.mode = u.PANORAMA,
  21073. e.floor.enter(this.mode),
  21074. this.emit(w.PanoChosen, this.currentPano, this.currentPano),
  21075. this.switchCameraMode(this.mode, i),
  21076. this.emit(w.StartInside, o),
  21077. r.resolve(!0),
  21078. r
  21079. }
  21080. ,
  21081. n.prototype.startInsideWithFlyin = function(e, t, i, n, r) {
  21082. if (r = r || $.Deferred(),
  21083. this.dollhouseMode(),
  21084. !e)
  21085. return F.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  21086. r.resolve(!1),
  21087. r;
  21088. t = t || e.position;
  21089. var o = i || this.cameraControls.activeControl.camera.quaternion
  21090. , a = e.position;
  21091. return this.fitDollhouse(a, t, o),
  21092. setTimeout(function(t) {
  21093. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = t);
  21094. var n = {
  21095. mode: u.PANORAMA,
  21096. pano: e,
  21097. quaternion: i,
  21098. callback: function() {
  21099. this.emit(w.FlyinFinished),
  21100. r.resolve(!0)
  21101. }
  21102. .bind(this)
  21103. };
  21104. this.flyToNewMode(n)
  21105. }.bind(this, this.cameraControls.activeControl.maxDistance), f.startupFlyinDelay),
  21106. r
  21107. }
  21108. ,
  21109. n.prototype.checkAndWaitForPanoLoad = function() {
  21110. var e = {}
  21111. , t = {}
  21112. , i = 5e3
  21113. , n = function() {
  21114. for (var n in e)
  21115. if (e.hasOwnProperty(n) && e[n]) {
  21116. var r = performance.now() - t[n];
  21117. if (r < i)
  21118. return !0
  21119. }
  21120. return !1
  21121. };
  21122. return function(r, o, a, s, l, c, h, u, d, p) {
  21123. if (n())
  21124. return !0;
  21125. var f = function(t, i, n) {
  21126. N.delayOneFrame(function() {
  21127. e[t] = !1,
  21128. l && l(i, n)
  21129. }
  21130. .bind(this))
  21131. }
  21132. .bind(this, r.id)
  21133. , g = function(t, i) {
  21134. N.delayOneFrame(function() {
  21135. e[t] = !1,
  21136. c && c(i)
  21137. }
  21138. .bind(this))
  21139. }
  21140. .bind(this, r.id);
  21141. try {
  21142. return null !== u && void 0 !== u || (u = !0),
  21143. 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),
  21144. e[r.id] && (t[r.id] = performance.now()),
  21145. e[r.id]
  21146. } catch (n) {
  21147. throw e[r.id] = !1,
  21148. t[r.id] = performance.now() - i,
  21149. n
  21150. }
  21151. }
  21152. }(),
  21153. n.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  21154. if (!e)
  21155. throw new M("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  21156. return r && this.model.waitForLoad(e, function() {
  21157. return e.isLoaded(i)
  21158. }),
  21159. !e.isLoaded(t) && (e.loadCube(t).done(n),
  21160. !0)
  21161. }
  21162. ,
  21163. n.prototype.checkAndWaitForTiledPanoLoad = function() {
  21164. var e = new r.Vector3;
  21165. return function(t, i, n, r, o, a, s, l) {
  21166. if (!t)
  21167. throw new M("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  21168. return e.copy(d.FORWARD),
  21169. this.getDirection(e),
  21170. !t.isLoaded(i) && (a && this.model.waitForLoad(t, function() {
  21171. return t.isLoaded(i)
  21172. }),
  21173. t.loadTiledPano(i, e, null, s, l).done(function(e, t) {
  21174. n && n(e, t)
  21175. }
  21176. .bind(this)).fail(function(e) {
  21177. r && r(e)
  21178. }
  21179. .bind(this)).progress(function(e, t, i) {
  21180. o && o(e, t, i)
  21181. }
  21182. .bind(this)),
  21183. !0)
  21184. }
  21185. }(),
  21186. n.prototype.switchCameraMode = function(e, t) {
  21187. var i = this.cameraControls.controls[e]
  21188. , n = i.camera;
  21189. switch (e) {
  21190. case u.PANORAMA:
  21191. n.position.copy(this.currentPano.position);
  21192. var o = t ? d.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  21193. i.lookAt(o.add(n.position));
  21194. break;
  21195. case u.DOLLHOUSE:
  21196. var a = this.position.clone();
  21197. 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),
  21198. n.position.copy(a),
  21199. i.target.copy(this.target.clone().setY(this.model.center.y));
  21200. break;
  21201. case u.FLOORPLAN:
  21202. n.position.copy(this.model.center).setY(f.floorplan.cameraHeight),
  21203. i.target.copy(this.model.center).setY(0),
  21204. i.zoomToContain(this.model.size),
  21205. i.rotateToView(this.model.size, this.getDirection())
  21206. }
  21207. i.update(0)
  21208. }
  21209. ,
  21210. n.prototype.update = function() {
  21211. var e = (new r.Vector3,
  21212. {})
  21213. , t = [];
  21214. return function(i) {
  21215. this.updatePersistentZooming(i),
  21216. this.updateFromControls(i),
  21217. this.getCurrentNodePanos(t),
  21218. this.hasChanged(e) && (this.lastChangeTime = Date.now(),
  21219. !this.mouseDown && this.containsMouse && this.updateIntersect(),
  21220. this.emit(w.ViewChanged)),
  21221. this.model.supportsTiles && (this.updateTileDownloader(t),
  21222. this.updatePanoRenderer(t)),
  21223. this.updatePreRendering(t),
  21224. this.reticule.update(),
  21225. this.path.update(),
  21226. this.spider.update(),
  21227. this.cachedPanoCandidates && f.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  21228. this.updateControlLocks(),
  21229. this.model.supportsTiles && this.updateZoomPano()
  21230. }
  21231. }(),
  21232. n.prototype.updatePersistentZooming = function(e) {
  21233. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : this.zooming === -1 && this.zoomBy(1 - this.zoomSpeed * e)
  21234. }
  21235. ,
  21236. n.prototype.updateControlLocks = function() {
  21237. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[u.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  21238. }
  21239. ,
  21240. n.prototype.updatePanoRenderer = function() {
  21241. var e = new r.Vector3;
  21242. return function(t) {
  21243. var i = this.nextPano || this.currentPano;
  21244. this.panoRenderer.hasQueuedTiles() && i && (e.copy(d.FORWARD),
  21245. this.getDirection(e),
  21246. this.panoRenderer.updateDirection(e))
  21247. }
  21248. }(),
  21249. n.prototype.cleanupInactivePanos = function() {
  21250. var e = []
  21251. , t = [];
  21252. return function() {
  21253. e.length = 0,
  21254. e.push(this.currentPano),
  21255. this.nextPano && e.push(this.nextPano),
  21256. t.length = 0;
  21257. for (var i = 0; i < this.panoRenderer.activePanos.length; i++)
  21258. t.push(this.panoRenderer.activePanos[i]);
  21259. for (var n = 0; n < t.length; n++) {
  21260. for (var r = t[n], o = !0, a = 0; a < e.length; a++)
  21261. r.id === e[a].id && (o = !1);
  21262. o && r.exit()
  21263. }
  21264. }
  21265. }(),
  21266. n.prototype.updatePreRendering = function() {
  21267. var e = {};
  21268. return function(t) {
  21269. if (1 === f.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  21270. var i = this.nextPano || this.currentPano;
  21271. if (i && t && t.length > 1) {
  21272. var n = t.findIndex(function(e) {
  21273. if (e.id === i.id)
  21274. return !0
  21275. });
  21276. if (n >= 0 && n + 1 < t.length) {
  21277. var r = t[n + 1];
  21278. r.isLoaded(this.basePanoSize) || e[r.id] || (window.setTimeout(function(t) {
  21279. this.checkAndWaitForPanoLoad(t, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  21280. window.setTimeout(function(t) {
  21281. e[t.id] = !1
  21282. }
  21283. .bind(this, t), f.tiling.panoPreRenderRepeatDelay)
  21284. }
  21285. .bind(this, r), f.tiling.panoPreRenderDelay),
  21286. e[r.id] = !0)
  21287. }
  21288. }
  21289. }
  21290. }
  21291. }(),
  21292. n.prototype.enablePreRendering = function() {
  21293. this.preRenderingEnabled = !0
  21294. }
  21295. ,
  21296. n.prototype.disablePreRendering = function() {
  21297. this.preRenderingEnabled = !1,
  21298. this.cleanupInactivePanos()
  21299. }
  21300. ,
  21301. n.prototype.updateTileDownloader = function() {
  21302. var e = new r.Vector3;
  21303. return function(t) {
  21304. var i = this.nextPano || this.currentPano;
  21305. i && (e.copy(d.FORWARD),
  21306. this.getDirection(e),
  21307. this.tileDownloader.tilePrioritizer.updateCriteria(i, this.position, e, t.length > 0 ? t : null),
  21308. this.tileDownloader.processPriorityQueue = !0)
  21309. }
  21310. }(),
  21311. n.prototype.updateFromControls = function(e) {
  21312. null !== e && void 0 !== e || (e = 0),
  21313. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  21314. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  21315. this.position.copy(this.cameraControls.activeControl.camera.position),
  21316. this.target.copy(this.cameraControls.activeControl.target),
  21317. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  21318. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  21319. this.camera.position.copy(this.position),
  21320. this.camera.quaternion.copy(this.quaternion),
  21321. this.camera.updateMatrix(),
  21322. this.camera.updateMatrixWorld()
  21323. }
  21324. ,
  21325. n.prototype.hasChanged = function(e) {
  21326. if (!this.previousState)
  21327. return this.previousState = {
  21328. allFloorsVisible: this.model.allFloorsVisible,
  21329. position: this.position.clone(),
  21330. quaternion: this.quaternion.clone(),
  21331. mouse: this.mouse.clone(),
  21332. labelScaleFactor: this.getLabelScaleFactor(),
  21333. currentFloor: this.model.currentFloor,
  21334. projectionMatrix: this.camera.projectionMatrix.clone(),
  21335. worldMatrix: this.camera.matrixWorld.clone(),
  21336. mode: this.mode,
  21337. modelPosition: this.model.position.clone(),
  21338. modelCenter: this.model.center.clone(),
  21339. zoomLevel: this.zoomLevel
  21340. },
  21341. !0;
  21342. 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;
  21343. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  21344. e.moved = !this.position.equals(this.previousState.position),
  21345. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  21346. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  21347. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  21348. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  21349. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  21350. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  21351. e.modeChanged = this.mode !== this.previousState.mode,
  21352. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  21353. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  21354. e.nextPanoActive = null !== this.nextPano,
  21355. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  21356. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  21357. this.previousState.position.copy(this.position),
  21358. this.previousState.quaternion.copy(this.quaternion),
  21359. this.previousState.mouse.copy(this.mouse),
  21360. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  21361. this.previousState.currentFloor = this.model.currentFloor,
  21362. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  21363. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  21364. this.previousState.mode = this.mode,
  21365. this.previousState.modelPosition.copy(this.model.position),
  21366. this.previousState.modelCenter.copy(this.model.center),
  21367. this.previousState.zoomLevel = this.zoomLevel,
  21368. !t
  21369. }
  21370. ,
  21371. n.prototype.updateIntersect = function() {
  21372. var e = this.flying || this.isWarping()
  21373. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  21374. , i = y.getById(V.LookTransition)
  21375. , n = !(e || t || this.isTouchEvent || i.length && i[0].running);
  21376. //this.tagManager.intersecttag(this.mouse, n, this.camera) || (this.intersect = this.getMouseIntersect(),//--MP
  21377. this.intersect = this.getMouseIntersect(); //xzw change
  21378. this.intersect && this.updateClosestPano(this.intersect),
  21379. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  21380. f.navigation.panoScores && !f.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  21381. }
  21382. ,
  21383. n.prototype.checkHotClick = function() {
  21384. if(this.intersectHot){
  21385. this.intersectHot.examine(this);
  21386. /* g_touraudio.pause();
  21387. g_bgaudio = false;
  21388. document.getElementById("bgaudio").pause();
  21389. var sWidth = document.body.scrollWidth;
  21390. var sHeight = document.body.scrollHeight;
  21391. var pop1 = document.getElementById('popup');
  21392. pop1.style.display = "block";
  21393. var myElement = document.createElement("iframe");
  21394. myElement.src = g_HotMeshes[i].hotLink;
  21395. myElement.id = "id1";
  21396. myElement.allowTransparency = "true";
  21397. myElement.style.width = "100%";
  21398. myElement.style.height = "100%";
  21399. myElement.scrolling = "no";
  21400. var element=document.getElementById("id1");
  21401. if (typeof(element)== "undefined" || element == null){
  21402. document.getElementById("popup").appendChild(myElement);
  21403. }
  21404. var oClose = document.getElementById("closepop");
  21405. oClose.onclick = function() {
  21406. pop1.style.display = "none";
  21407. document.getElementById("popup").removeChild(document.getElementById("id1"));
  21408. $("#popup iframe:last").remove();
  21409. document.getElementById("bgaudio").play();
  21410. } */
  21411. return true;
  21412. }
  21413. },
  21414. n.prototype.getMouseDirection = function(e) {
  21415. e = e || this.mouse;
  21416. var t = new r.Vector3(e.x,e.y,-1).unproject(this.camera)
  21417. , i = new r.Vector3(e.x,e.y,1).unproject(this.camera);
  21418. return i.sub(t).normalize()
  21419. }
  21420. ,
  21421. n.prototype.getMouseIntersect = function(e, t) {//xzw change
  21422. e = e || this.mouse.clone(),
  21423. t = t || this.model.floors.reduce(function(e, t) {
  21424. return t.hidden ? e : e.concat(t.collider.children)
  21425. }, this.mode === u.PANORAMA ? this.panoMarkers : []);
  21426. for(var i in this.model.hots){
  21427. t.push(this.model.hots[i].mesh);
  21428. }
  21429. var i = new r.Vector3(e.x,e.y,-1).unproject(this.camera);
  21430. this.raycaster.set(i, this.getMouseDirection(e));
  21431. var n = this.raycaster.intersectObjects(t);
  21432. if (0 === n.length){
  21433. this.intersectHot = null; //add
  21434. if(g_HotStatus!="add") $("#player").css("cursor","");
  21435. return null;
  21436. }
  21437. var o = n[0];
  21438. if(o.object.type == "hotSprite"){ //add
  21439. this.intersectHot = o.object.belongHot;
  21440. $("#player").css("cursor","pointer");
  21441. return;
  21442. }
  21443. this.intersectHot = null;
  21444. if(g_HotStatus!="add") $("#player").css("cursor","");
  21445. if (o.face) {
  21446. o.normal = o.face.normal.applyQuaternion(o.object.quaternion);
  21447. var a = this.position.clone().sub(o.point);
  21448. a.dot(o.normal) < 0 && o.normal.negate(),
  21449. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  21450. o.horizontal = o.normal.y > .8
  21451. }
  21452. return o
  21453. }
  21454. ,
  21455. n.prototype.updateClosestPano = function(e) {
  21456. var t = [s.filters.isPanoAligned()];
  21457. if (this.mode === u.PANORAMA) {
  21458. if (!this.currentPano)
  21459. return;
  21460. t.push(s.filters.not(this.currentPano)),
  21461. t.push(s.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  21462. t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  21463. t.push(s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)),
  21464. t.push(s.filters.isNotBehindNormal(e.point, e.normal))
  21465. } else
  21466. t.push(s.filters.isOnVisibleFloor()),
  21467. this.mode !== u.FLOORPLAN && t.push(s.filters.inDirection(this.position, this.getDirection(), .25));
  21468. var i = this.model.panos.find(t, [s.sortFunctions.floorDistanceToPoint(e.point)]);
  21469. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  21470. this.emit(w.ClosestPanoChanging, this.closestPano, i, this.mode),
  21471. this.closestPano = i) : this.isPanoHover = !1
  21472. }
  21473. ,
  21474. n.prototype.dollhouseMode = function(e, t) {
  21475. this.emit(w.ModeChanging, this.mode, u.DOLLHOUSE),
  21476. this.mode = u.DOLLHOUSE,
  21477. this.cameraControls.controls[u.DOLLHOUSE].reset();
  21478. var i = new r.Vector3(this.model.center.x,0,this.model.center.z)
  21479. , n = new r.Vector3(15,10,15);
  21480. if (e && t) {
  21481. var o = d.FORWARD.clone().applyQuaternion(t)
  21482. , a = this.model.center.clone().sub(e)
  21483. , s = a.dot(o);
  21484. s > 0 ? (i = o.clone().multiplyScalar(s).add(e),
  21485. n.copy(e)) : F.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  21486. }
  21487. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0, !0),
  21488. this.cameraControls.controls[u.DOLLHOUSE].target.copy(i),
  21489. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(n),
  21490. this.updateFromControls(),
  21491. this.model.alpha = 1,
  21492. this.model.skybox.material.uniforms.opacity.value = 0
  21493. }
  21494. ,
  21495. n.prototype.insideMode = function(e, t) {
  21496. var i = $.Deferred()
  21497. , n = t || null;
  21498. if (this.mode !== u.PANORAMA && this.mode !== u.TRANSITIONING) {
  21499. var r = [s.filters.isPanoAligned()];
  21500. this.model.currentFloor && r.push(s.filters.atFloor(this.model.currentFloor)),
  21501. e = e || this.currentPano || this.model.panos.find(r, [s.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  21502. this.flyToNewMode({
  21503. mode: u.PANORAMA,
  21504. pano: e,
  21505. callback: n
  21506. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  21507. } else {
  21508. var o = this.mode === u.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  21509. i.reject(o)
  21510. }
  21511. return i.promise()
  21512. }
  21513. ,
  21514. n.prototype.fitDollhouse = function(e, t, i) {
  21515. var n = d.FORWARD.clone().applyQuaternion(i);
  21516. this.cameraControls.activeControl.target.copy(n).add(e);
  21517. var o = d.RIGHT.clone().applyQuaternion(i)
  21518. , a = d.UP.clone()
  21519. , s = o.clone().applyAxisAngle(a, Math.PI / 2)
  21520. , l = this.model.boundingBox.max.clone()
  21521. , c = this.model.boundingBox.min.clone()
  21522. , 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)]
  21523. , u = 0
  21524. , p = 0
  21525. , g = 0;
  21526. h.forEach(function(e, t, i) {
  21527. var n = Math.abs(e.dot(o))
  21528. , r = e.dot(s);
  21529. n > u && (u = n,
  21530. p = r),
  21531. r > g && (g = r)
  21532. });
  21533. 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)))
  21534. , v = s.clone().multiplyScalar(p).add(t)
  21535. , A = s.clone().multiplyScalar(g).add(t);
  21536. p = u / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * this.cameraControls.activeControl.camera.aspect * (Math.PI / 180)),
  21537. g = m / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * (Math.PI / 180)),
  21538. p = Math.max(p, 10),
  21539. g = Math.max(g, 10);
  21540. var y = n.clone().multiplyScalar(-p).add(v).sub(t).length()
  21541. , C = n.clone().multiplyScalar(-g).add(v).sub(t).length();
  21542. this.cameraControls.activeControl.maxDistance = f.skyboxRadius - 1,
  21543. y >= C ? this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(v).add(n.multiplyScalar(1.1 * -p)) : this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(A).add(n.multiplyScalar(1.1 * -g))
  21544. }
  21545. ,
  21546. n.prototype.floorplanMode = function(e, t, i) {
  21547. this.mode = u.FLOORPLAN;
  21548. var n = this.cameraControls.controls[u.FLOORPLAN];
  21549. n.reset();
  21550. var r = e ? e : this.model.center;
  21551. if (n.target.copy(r).setY(0),
  21552. n.camera.position.copy(r).setY(f.floorplan.cameraHeight),
  21553. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  21554. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  21555. t) {
  21556. var o = d.LEFT.clone().applyQuaternion(t);
  21557. n.rotateLeft(-Math.atan2(o.x, o.z))
  21558. } else
  21559. n.rotateToView(this.model.size, this.getDirection());
  21560. n.update(0)
  21561. }
  21562. ,
  21563. n.prototype.nonInterruptingFlyToPano = function(e, t) {
  21564. return e.skipWarpingCheck = !0,
  21565. this.flyToPano(e, t)
  21566. }
  21567. ,
  21568. n.prototype.flyToPano = function(e, t) {
  21569. var i = e.pano
  21570. , n = e.lookAtPoint
  21571. , o = e.duration
  21572. , a = e.aimDuration
  21573. , s = e.maxDistanceOverride
  21574. , l = e.skipWarpingCheck
  21575. , c = e.constantMoveSpeed
  21576. , h = null
  21577. , p = null;
  21578. if (this.isWarping() && !l && (this.path.activeTransType === x.BLACK || this.path.activeTransType === x.STD))
  21579. return F.warn("Player.flyToPano() -> Cannot fly when warping"),
  21580. t && t(),
  21581. !1;
  21582. if (this.updateLastView(),
  21583. this.mode !== u.PANORAMA) {
  21584. var m;
  21585. return n && (m = (new r.Quaternion).setFromUnitVectors(d.FORWARD, n.sub(i.position).normalize())),
  21586. void this.flyToNewMode({
  21587. mode: u.PANORAMA,
  21588. pano: i,
  21589. duration: o,
  21590. quaternion: m,
  21591. callback: t
  21592. })
  21593. }
  21594. if (!i || (h = g.deepExtend(e),
  21595. p = function() {
  21596. N.delayOneFrame(function() {
  21597. this.flyToPano(h, t)
  21598. }
  21599. .bind(this))
  21600. }
  21601. .bind(this),
  21602. !this.checkAndWaitForPanoLoad(i, "high", "low", this.basePanoSize, p))) {
  21603. var C = function(e) {
  21604. t && t(e)
  21605. }
  21606. .bind(this);
  21607. this.currentPano || (this.currentPano = i,
  21608. this.path.placeCpm(),
  21609. this.path.fadeOutCpm(f.path.fadeOutTime),
  21610. this.spider.draw());
  21611. var I = o;
  21612. if ("number" != typeof o) {
  21613. var E = s || f.transition.flytimeMaxDistanceThreshold;
  21614. I = Math.min(this.currentPano.position.distanceTo(i.position), E) * f.transition.flytimeDistanceMultiplier + f.transition.flyTime
  21615. }
  21616. if (f.transition.flySpeed > .01 && (I = 1e3 * this.currentPano.position.distanceTo(i.position) / f.transition.flySpeed),
  21617. 1 !== this.zoomLevel)
  21618. switch (f.zoom.transitionStyle) {
  21619. case 1:
  21620. this.smoothZoomToDefault(I / 2);
  21621. break;
  21622. case 2:
  21623. return h = g.deepExtend(e),
  21624. p = this.flyToPano.bind(this, h, t),
  21625. void this.smoothZoomToDefault(f.zoom.restoreTime * (this.zoomLevel - 1), p)
  21626. }
  21627. if (n) {
  21628. y.cancelById(V.LookTransition),
  21629. I *= f.transition.aimSlowFactor;
  21630. var b = this.cameraControls.activeControl.camera.quaternion.clone()
  21631. , _ = (new r.Matrix4).lookAt(i.position, n, d.UP)
  21632. , T = (new r.Quaternion).setFromRotationMatrix(_)
  21633. , S = b.clone()
  21634. , M = new r.Vector3;
  21635. if (i === this.currentPano) {
  21636. var R = d.FORWARD.clone().applyQuaternion(b)
  21637. , P = d.FORWARD.clone().applyQuaternion(T)
  21638. , O = R.angleTo(P);
  21639. return void 0 !== a && null !== a || (a = 1 * Math.sqrt(O) / f.tags.navigate.rotateSpeedFactor * 1e3),
  21640. void y.start(function(e) {
  21641. S.copy(b),
  21642. v.quaternion(S, T)(e),
  21643. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  21644. this.cameraControls.activeControl.lookAt(M)
  21645. }
  21646. .bind(this), a, C, 0, A[f.transition.movementEasing], null, V.LookTransition)
  21647. }
  21648. }
  21649. if (i === this.currentPano || this.flying)
  21650. return void C();
  21651. this.flying = !0;
  21652. var L = this.position.clone()
  21653. , D = this.currentPano;
  21654. F.debug("Flying to pano ", i.position),
  21655. this.emit(w.PanoChosen, this.currentPano, i),
  21656. this.emit(w.FlyingStarted, i.position, L, i, D),
  21657. n && y.start(function(e) {
  21658. S.copy(b),
  21659. v.quaternion(S, T)(e),
  21660. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  21661. this.cameraControls.activeControl.lookAt(M)
  21662. }
  21663. .bind(this), I, null, 0, A[f.transition.movementEasing], null, V.LookTransition);
  21664. var B = c ? null : A[f.transition.movementEasing];
  21665. this.nextPano = i,
  21666. y.start(v.uniform(this.model.skybox, "progress", 1), I, null, 0, A[f.transition.blendEasing], "skyFly", V.FlyToPano),
  21667. y.start(v.allUniforms(this.model.chunks, "progress", 1), I, null, 0, A[f.transition.blendEasing], "chunkFly", V.FlyToPano),
  21668. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, i.position), I, function(e) {
  21669. this.flying = !1,
  21670. this.currentPano !== i && this.currentPano.exit(),
  21671. i.enter(),
  21672. this.currentPano = i,
  21673. this.nextPano = null,
  21674. this.path.placeCpm(),
  21675. this.path.fadeOutCpm(f.path.fadeOutTime),
  21676. this.spider.draw(),
  21677. this.emit(w.FlyingEnded, i.position, L, i, D),
  21678. C(e)
  21679. }
  21680. .bind(this), 0, B, "camFly", V.FlyToPano)
  21681. }
  21682. }
  21683. ,
  21684. n.prototype.fastForwardActivePanoFlight = function(e) {
  21685. e = e || f.transition.fastForwardFactor / 10 * 4 + 1,
  21686. y.adjustSpeed(V.FlyToPano, e),
  21687. y.adjustSpeed(V.LookTransition, e)
  21688. }
  21689. ,
  21690. n.prototype.flyToPanoClosestToMouse = function() {
  21691. if (Date.now() - this.mouseLastMoveTime > 50 && (this.intersect = this.getMouseIntersect(),
  21692. this.intersect && this.updateClosestPano(this.intersect)),
  21693. this.closestPano)
  21694. return this.flyToPano({
  21695. pano: this.closestPano
  21696. });
  21697. var e = this.getMouseDirection();
  21698. this.flyDirection(e) || this.flyToPano({
  21699. pano: this.currentPano
  21700. })
  21701. }
  21702. ,
  21703. n.prototype.flyLocalDirection = function(e) {
  21704. var t = this.getDirection(e)
  21705. , i = 1 === e.z ? .4 : .75
  21706. , n = 1 === Math.abs(e.x);
  21707. return this.flyDirection(t, i, n)
  21708. }
  21709. ,
  21710. n.prototype.flyDirection = function(e, t, i) {
  21711. this.closePopup();//xzw add
  21712. var n = $.Deferred();
  21713. this.history.invalidate();
  21714. var r = this.closestPanoInDirection(e, t, i);
  21715. return r ? this.flyToPano({
  21716. pano: r
  21717. }, n.resolve.bind(n, !0)) : (this.bump(e),
  21718. n.resolve(!1)),
  21719. n.promise()
  21720. }
  21721. ,
  21722. n.prototype.closestPanoInDirection = function(e, t, i) {
  21723. return this.rankedPanoInDirection(0, e, t, i)
  21724. }
  21725. ,
  21726. n.prototype.rankedPanoInDirection = function() {
  21727. var e = {
  21728. pano: null,
  21729. candidates: []
  21730. };
  21731. return function(t, i, n, r) {
  21732. t || (t = 0),
  21733. n = void 0 !== n ? n : .75;
  21734. var o = r ? "angle" : "direction";
  21735. 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),
  21736. this.cachedPanoCandidates = e.candidates,
  21737. e.pano
  21738. }
  21739. }(),
  21740. n.prototype.bump = function(e) {
  21741. if (this.mode === u.PANORAMA && !this.flying && !this.isWarping()) {
  21742. 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;
  21743. if (s)
  21744. t = function() {
  21745. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", a > 0 ? 1.04 : .96), o, i, 0, A.easeInOutSine, "bumpZStart")
  21746. }
  21747. .bind(this),
  21748. i = function() {
  21749. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", 1), 5 * o, n, 0, A.easeInOutSine, "bumpZRelax")
  21750. }
  21751. .bind(this);
  21752. else {
  21753. var l = this.camera.position.clone()
  21754. , c = e.clone();
  21755. this.raycaster.set(l, c);
  21756. var h = this.model.floors.reduce(function(e, t) {
  21757. return e.concat(t.collider.children)
  21758. }, [])
  21759. , d = this.raycaster.intersectObjects(h)
  21760. , p = d.length > 0 ? d[0].distance / 25 : .04
  21761. , g = l.clone().add(c.multiplyScalar(p));
  21762. t = function() {
  21763. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, g), o, i, 0, A.easeInOutSine, "bumpTStart")
  21764. }
  21765. .bind(this),
  21766. i = function() {
  21767. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, l), 5 * o, n, 0, A.easeInOutSine, "bumpTRelax")
  21768. }
  21769. .bind(this)
  21770. }
  21771. n = function() {
  21772. this.flying = !1
  21773. }
  21774. .bind(this),
  21775. this.flying = !0,
  21776. t()
  21777. }
  21778. }
  21779. ,
  21780. n.prototype.changeFloor = function(e) {
  21781. if (!this.is360View(this.mode, this.currentPano))
  21782. if (this.mode === u.PANORAMA) {
  21783. var t = this.history.reversePano(e);
  21784. t && t.isAligned() ? this.flyToPano({
  21785. pano: t
  21786. }) : this.changeFloorByScore(e)
  21787. } else
  21788. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  21789. }
  21790. ,
  21791. n.prototype.changeFloorByScore = function() {
  21792. var e = {
  21793. pano: null,
  21794. candidates: []
  21795. };
  21796. return function(t) {
  21797. var i = this.model.nextFloor(t);
  21798. 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),
  21799. void (e.pano ? (this.cachedPanoCandidates = e.candidates,
  21800. this.history.push(t, this.currentPano),
  21801. this.flyToPano({
  21802. pano: e.pano
  21803. })) : F.warn("No pano found on selected floor, not moving there."))) : void F.debug("player.changeFloor(" + t + "): no such floor")
  21804. }
  21805. }(),
  21806. n.prototype.gotoFloor = function(e) {
  21807. var t = e - this.model.currentFloor.floorIndex;
  21808. this.changeFloor(t)
  21809. }
  21810. ,
  21811. n.prototype.getDirection = function(e) {
  21812. return e = e ? e : (new r.Vector3).copy(d.FORWARD),
  21813. e.applyQuaternion(this.camera.quaternion)
  21814. }
  21815. ,
  21816. n.prototype.flyToSameMode = function(e, t, i, n, o) {
  21817. if (o = o || $.Deferred(),
  21818. this.mode === u.TRANSITIONING)
  21819. return F.warn("should not be transitioning here"),
  21820. n && n(!1),
  21821. o.reject().promise();
  21822. var a = i || !1
  21823. , s = i ? i.position : this.position
  21824. , l = this.position.clone()
  21825. , c = this.currentPano;
  21826. if (F.debug("New pose in mode " + this.mode),
  21827. !e || (retryCallback = function() {
  21828. N.delayOneFrame(function() {
  21829. this.flyToSameMode(e, t, i, n, o)
  21830. }
  21831. .bind(this))
  21832. }
  21833. .bind(this),
  21834. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  21835. var h = function() {
  21836. this.emit(w.FlyingEnded, s, l, e, c),
  21837. n && n(!0)
  21838. }
  21839. .bind(this)
  21840. , d = f[this.mode]
  21841. , p = void 0 !== t ? t : d.transitionTime
  21842. , g = new r.Vector3
  21843. , C = new r.Vector3;
  21844. if (this.emit(w.FlyingStarted, s, l, e, c),
  21845. this.mode === u.PANORAMA)
  21846. F.warn("we should not be here for panorama views");
  21847. else if (this.mode === u.DOLLHOUSE)
  21848. if (a) {
  21849. var I = new r.Vector3(0,1,0);
  21850. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  21851. this.model.warpDestFloors(i.floorVisibility),
  21852. C.copy(i.position);
  21853. var E = new r.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  21854. , b = new r.Raycaster(C.clone(),E.clone(),0,1 / 0)
  21855. , _ = b.intersectObjects(this.model.colliders)
  21856. , T = 3;
  21857. _.length ? (g.copy(_[0].point),
  21858. T = .75 * C.distanceTo(g)) : (g.copy(E).multiplyScalar(3).add(C),
  21859. F.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  21860. var x = (new r.Matrix4).lookAt(C, g, I)
  21861. , S = (new r.Euler).setFromRotationMatrix(x, f.warp.eOrder)
  21862. , M = g.distanceTo(C)
  21863. , R = (new r.Matrix4).lookAt(this.cameraControls.cameras[u.DOLLHOUSE].position, this.cameraControls.controls[u.DOLLHOUSE].target, I)
  21864. , P = (new r.Euler).setFromRotationMatrix(R, f.warp.eOrder)
  21865. , O = this.cameraControls.cameras[u.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[u.DOLLHOUSE].target);
  21866. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(Math.min(O, T), !0);
  21867. var L = new r.Euler(S.x - P.x,S.y - P.y,S.z - P.z,f.warp.eOrder);
  21868. L.y = L.y > Math.PI ? L.y -= 2 * Math.PI : L.y < -Math.PI ? L.y += 2 * Math.PI : L.y,
  21869. this.path.burnsDir = Math.sign(L.y);
  21870. var D = new r.Euler(0,0,0,f.warp.eOrder)
  21871. , B = new r.Vector3;
  21872. y.start(v.vector(this.cameraControls.controls[u.DOLLHOUSE].target, g), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  21873. y.start(function(e, t) {
  21874. D.x = P.x + e * L.x,
  21875. D.y = P.y + e * L.y,
  21876. D.z = P.z + e * L.z;
  21877. var i = O + e * (M - O);
  21878. B.set(0, 0, i).applyEuler(D).add(this.cameraControls.controls[u.DOLLHOUSE].target),
  21879. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(B).add(this.model.position)
  21880. }
  21881. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  21882. y.start(function(e, t) {
  21883. this.cameraControls.controls[u.DOLLHOUSE].update(),
  21884. this.quaternion.copy(this.cameraControls.cameras[u.DOLLHOUSE].quaternion),
  21885. this.position.copy(this.cameraControls.cameras[u.DOLLHOUSE].position)
  21886. }
  21887. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  21888. } else
  21889. F.warn("invalid warp destination in flyToSameMode()? ignore it then");
  21890. else if (this.path.placeCpm(),
  21891. this.path.fadeInCpm(f.path.fadeInTime),
  21892. i) {
  21893. this.model.warpDestFloors(i.floorVisibility);
  21894. var U = this.cameraControls.cameras[u.FLOORPLAN]
  21895. , k = this.cameraControls.controls[u.FLOORPLAN]
  21896. , H = k.target.clone()
  21897. , G = i.position.clone().sub(H)
  21898. , z = U.position.clone().sub(k.target)
  21899. , W = z.length()
  21900. , j = new r.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  21901. , Y = Math.atan2(k.offset.x, k.offset.z)
  21902. , X = Math.atan2(j.x, j.z)
  21903. , Z = k.absoluteScale
  21904. , q = m.convertWorkshopOrthoZoom(i.orthoZoom);
  21905. y.start(function(e, t) {
  21906. k.target.copy(G).multiplyScalar(e).add(H);
  21907. var i = Y + (X - Y) * e;
  21908. k.offset.x = W * Math.sin(i),
  21909. k.offset.z = W * Math.cos(i),
  21910. U.position.copy(k.target).add(k.offset),
  21911. k.absoluteScale = Z + e * (q - Z),
  21912. k.update(),
  21913. this.quaternion.copy(U.quaternion),
  21914. this.position.copy(U.position),
  21915. this.target.copy(k.target),
  21916. this.camera.projectionMatrix.copy(U.projectionMatrix)
  21917. }
  21918. .bind(this), p, null, 0, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  21919. } else
  21920. F.info("flyToSameMode() funny floorplan view? skipping");
  21921. return y.setTimeout(function(e) {
  21922. this.mode = e,
  21923. h(),
  21924. o.resolve(!0)
  21925. }
  21926. .bind(this, this.mode), p, V.FlyToSameMode),
  21927. this.mode = u.TRANSITIONING,
  21928. o.promise()
  21929. }
  21930. }
  21931. ,
  21932. n.prototype.flyToNewMode = function(e, t) {
  21933. e = e || {};
  21934. var i = e.mode
  21935. , n = e.pano
  21936. , o = e.duration
  21937. , a = e.warpDest
  21938. , s = e.callback
  21939. , l = e.force
  21940. , c = e.quaternion;
  21941. if (t = t || $.Deferred(),
  21942. this.isWarping())
  21943. return F.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  21944. s && s(!1),
  21945. t.reject("Cannot change mode during tour transition").promise();
  21946. if (this.mode === u.TRANSITIONING)
  21947. return s && s(!1),
  21948. t.reject("Cannot change mode during mode transition").promise();
  21949. if (i === this.mode)
  21950. return l ? (this.flyToSameMode(n, o, a, s).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  21951. t.promise()) : (s && s(!1),
  21952. t.reject("Already in " + i + " mode").promise());
  21953. var h = a || !1;
  21954. F.debug("Switching mode to " + i);
  21955. var d = function() {
  21956. N.delayOneFrame(function() {
  21957. this.flyToNewMode(e, t)
  21958. }
  21959. .bind(this))
  21960. }
  21961. .bind(this);
  21962. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, d))
  21963. return t.promise();
  21964. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  21965. return F.info("Waiting for model textures to be loaded before going out to dollhouse"),
  21966. this.model.waitForLoad(this.model, function() {
  21967. return this.model.meshTexturesLoaded;
  21968. }
  21969. .bind(this)),
  21970. this.model.loadMeshTextures().done(d),
  21971. t.promise();
  21972. this.history.invalidate(),
  21973. this.updateLastView();
  21974. var p = this.mode
  21975. , C = this.cameraControls.cameras[i];
  21976. e = g.deepExtend({}, f[i], f[p + "-" + i]);
  21977. var I = void 0 !== o ? o : e.transitionTime;
  21978. this.emit(w.ModeChanging, p, i, n),
  21979. n && (this.currentPano = n),
  21980. this.switchCameraMode(i, c),
  21981. y.cancelById(V.LookTransition);
  21982. var _ = (new r.Vector3).copy(this.position);
  21983. if (i === u.PANORAMA)
  21984. this.emit(w.PanoChosen, n, n),
  21985. setTimeout(function() {
  21986. n.floor.enter(i)
  21987. }
  21988. .bind(this), I / 2),
  21989. this.path.fadeOutCpm(f.path.fadeOutTime);
  21990. else if (i === u.DOLLHOUSE) {
  21991. if (h && (this.model.stayPut = !0),
  21992. a ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  21993. this.model.warpDestFloors(a.floorVisibility)) : this.model.toggleAllFloors(!0),
  21994. this.path.placeCpm(),
  21995. this.path.fadeInCpm(f.path.fadeInTime),
  21996. h) {
  21997. var T = new r.Vector3(this.model.center.x,0,this.model.center.z);
  21998. _.set(15, 10, 15);
  21999. var M = new r.Vector3(0,0,-1).applyQuaternion(a.quaternion)
  22000. , R = new r.Raycaster(a.position.clone(),M.clone(),0,1 / 0)
  22001. , P = R.intersectObjects([this.sceneIntersectionPlane]);
  22002. P.length ? (T.copy(P[0].point),
  22003. _.copy(a.position),
  22004. 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),
  22005. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(3, !0)),
  22006. this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
  22007. _.add(this.model.position),
  22008. C.position.copy(_),
  22009. this.cameraControls.controls[u.DOLLHOUSE].update()
  22010. }
  22011. } else if (this.path.placeCpm(),
  22012. this.path.fadeInCpm(f.path.fadeInTime),
  22013. a) {
  22014. this.model.warpDestFloors(a.floorVisibility);
  22015. var O = this.cameraControls.cameras[u.FLOORPLAN]
  22016. , L = this.cameraControls.controls[u.FLOORPLAN]
  22017. , D = O.position.clone().sub(L.target)
  22018. , B = new r.Vector3(-1,0,0).applyQuaternion(a.quaternion).normalize()
  22019. , U = Math.atan2(B.x, B.z);
  22020. L.target.copy(a.position);
  22021. var k = D.length();
  22022. L.offset.x = k * Math.sin(U),
  22023. L.offset.y = 0,
  22024. L.offset.z = k * Math.cos(U),
  22025. O.position.copy(L.target).add(L.offset);
  22026. L.target.clone().sub(C.position);
  22027. C.quaternion.copy(a.quaternion),
  22028. L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom),
  22029. L.absoluteScale = L.currentScale,
  22030. L.update()
  22031. } else
  22032. this.model.currentFloor.enter(i);
  22033. var H = this.currentPano
  22034. , G = this.position.clone();
  22035. return this.emit(w.FlyingStarted, _, G, n, this.currentPano),
  22036. this.flying = !0,
  22037. this.isOutsideMode(i) && this.is360View(p, H) ? (h || i !== u.DOLLHOUSE || (C.position.set(15, 10, 15),
  22038. C.controls.target.set(this.model.center.x, 0, this.model.center.z),
  22039. C.controls.update()),
  22040. e.blackoutStyle = S.FADEIN,
  22041. I = f.show360Views.transitionTime,
  22042. this.fade360View(I, C, e)) : this.isOutsideMode(p) && this.is360View(i, n) ? (h && this.switchCameraMode(i, h.quaternion),
  22043. this.mode = i,
  22044. this.path && this.path.popOutCpm(),
  22045. e.blackoutStyle = S.END,
  22046. I = f.show360Views.transitionTime,
  22047. this.fade360View(I, C, e)) : (y.start(v.property(this.model, "alpha", e.modelAlpha, null), I * e.modelAlphaLength, null, e.modelAlphaDelay, null, V.FlyToNewMode),
  22048. y.start(v.vector(this.position, C.position), I, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToNewMode),
  22049. y.start(v.quaternion(this.quaternion, C.quaternion), I * e.rotationDuration, null, e.rotationDelay, A[f.flydown.rotationEasing], null, V.FlyToNewMode),
  22050. y.start(v.matrix4(this.camera.projectionMatrix, C.projectionMatrix), I * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, V.FlyToNewMode),
  22051. y.start(v.uniform(this.model.skybox, "opacity", e.skyboxOpacity), I * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, V.FlyToNewMode),
  22052. y.start(v.property(this.reticule.material.uniforms.opacity, "value", 0), I, null, V.FlyToNewMode)),
  22053. y.setTimeout(function() {
  22054. this.flying = !1,
  22055. p === u.PANORAMA && i !== u.PANORAMA ? this.currentPano.exit() : p !== u.PANORAMA && i === u.PANORAMA && (this.currentPano !== H && H.exit(),
  22056. this.currentPano.enter(),
  22057. this.path.placeCpm(),
  22058. this.path.fadeOutCpm(f.path.fadeOutTime),
  22059. this.spider.draw()),
  22060. p === u.DOLLHOUSE && this.cameraControls.controls[u.DOLLHOUSE].resetRanges(),
  22061. this.mode = i,
  22062. this.emit(w.FlyingEnded, _, G, this.currentPano, H),
  22063. h && p !== u.PANORAMA && i === u.PANORAMA ? this.startWarp(b.Retain, E.Retain, x.BLACK, null, null, s) : (s && s(),
  22064. t.resolve())
  22065. }
  22066. .bind(this), I, V.FlyToNewMode),
  22067. this.mode = u.TRANSITIONING,
  22068. t.promise()
  22069. }
  22070. ,
  22071. n.prototype.fade360View = function(e, t, i) {
  22072. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  22073. $(this.domElement).fadeOut(.5 * e, function() {
  22074. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  22075. this.model.alpha = i.modelAlpha,
  22076. this.position.copy(t.position),
  22077. this.quaternion.copy(t.quaternion),
  22078. this.camera.projectionMatrix.copy(t.projectionMatrix),
  22079. $(this.domElement).fadeIn(.5 * e)
  22080. }
  22081. .bind(this))
  22082. }
  22083. ,
  22084. n.prototype.findDefaultViews = function() {
  22085. this.findDefaultView(this.lastInsideView, !0),
  22086. this.findDefaultView(this.last360View, !1)
  22087. }
  22088. ,
  22089. n.prototype.findDefaultView = function(e, t) {
  22090. var i, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  22091. if (e.cameraMode !== u.PANORAMA)
  22092. return !1;
  22093. var i = r.get(e.panoId);
  22094. return i && i.isAligned() === t
  22095. });
  22096. o >= 0 ? (i = r.get(n[o].panoId),
  22097. e.update({
  22098. cameraMode: u.PANORAMA,
  22099. pano: i,
  22100. position: n[o].position,
  22101. quaternion: n[o].quaternion
  22102. })) : (o = r.list.findIndex(function(e) {
  22103. return e.isAligned() === t
  22104. }),
  22105. o >= 0 ? (i = r.list[o],
  22106. e.update({
  22107. cameraMode: u.PANORAMA,
  22108. pano: i,
  22109. position: i.position
  22110. })) : F.warn("There are no", t ? "inside" : "360º", "views in this model"))
  22111. }
  22112. ,
  22113. n.prototype.updateLastView = function() {
  22114. if (this.mode === u.PANORAMA) {
  22115. var e = this.currentPano.isAligned() ? this.lastInsideView : this.last360View;
  22116. e.update({
  22117. pano: this.currentPano,
  22118. position: this.position,
  22119. quaternion: this.quaternion
  22120. })
  22121. }
  22122. }
  22123. ,
  22124. n.prototype.goToLastView = function(e, t) {
  22125. var i = $.Deferred()
  22126. , n = i.resolve.bind(i)
  22127. , r = i.reject.bind(i)
  22128. , o = e ? this.lastInsideView : this.last360View;
  22129. return this.isInMode(u.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  22130. this.isInMode(u.PANORAMA) ? (this.path && this.path.popOutCpm(),
  22131. this.fadeToView(e, o, f.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  22132. mode: o.cameraMode,
  22133. pano: o.pano,
  22134. quaternion: o.quaternion,
  22135. callback: t
  22136. }).done(n).fail(r),
  22137. i.promise()
  22138. }
  22139. ,
  22140. n.prototype.fadeToView = function(e, t, i, n) {
  22141. var r = $.Deferred()
  22142. , o = r.resolve.bind(r)
  22143. , a = r.reject.bind(r);
  22144. if (!t.isValid() || t.cameraMode === u.PANORAMA && !t.pano)
  22145. return F.warn("Tried to fade to an illegal view", t.cameraMode),
  22146. a("Cannot go to illegal view"),
  22147. r.promise();
  22148. var s = (f[t.cameraMode],
  22149. function() {
  22150. $(this.domElement).fadeIn(.5 * i),
  22151. n && n(),
  22152. o()
  22153. }
  22154. .bind(this))
  22155. , l = e ? S.FADEIN : S.END;
  22156. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  22157. $(this.domElement).fadeOut(.5 * i, function() {
  22158. this.model.fadePanoMarkers(e ? f.panorama.markerOpacity : 0),
  22159. t.cameraMode === u.PANORAMA ? this.flyToPano({
  22160. pano: t.pano,
  22161. lookAtPoint: d.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  22162. duration: 0
  22163. }, s) : this.flyToNewMode({
  22164. mode: t.cameraMode,
  22165. quaternion: t.quaternion,
  22166. duration: 0,
  22167. callback: s
  22168. })
  22169. }
  22170. .bind(this)),
  22171. r.promise()
  22172. }
  22173. ,
  22174. n.prototype.startWarp = function(e, t, i, n, r, o) {
  22175. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  22176. this.flying)
  22177. return F.warn("Player.startWarp() -> Cannot warp when flying"),
  22178. o && o(),
  22179. !1;
  22180. null !== e && void 0 !== e || (e = b.Show),
  22181. this.history.invalidate(),
  22182. e !== b.Retain ? this.path.brushToWarpPano(i, x.BLACK) || (i = x.BLACK) : i = this.path.upcomingTransType;
  22183. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  22184. return this.emit(w.WarpStarted, a, i, n, r),
  22185. n = n || S.MIDDLE,
  22186. this.path.warpToPano(i, n, r, function() {
  22187. t === E.Slow ? this.path.discardSlow() : t === E.Standard && this.path.discardPathObject(),
  22188. this.emit(w.WarpEnded, i),
  22189. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  22190. o && o()
  22191. }
  22192. .bind(this)),
  22193. e === b.Hide && this.path.discardPathObject(),
  22194. !0
  22195. }
  22196. ,
  22197. n.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  22198. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (F.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  22199. s && s(),
  22200. !1)
  22201. }
  22202. ,
  22203. n.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  22204. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (F.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22205. a && a(),
  22206. !1)
  22207. }
  22208. ,
  22209. n.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  22210. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  22211. }
  22212. ,
  22213. n.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  22214. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  22215. !0) : (F.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22216. t && t(),
  22217. !1)
  22218. }
  22219. ,
  22220. n.prototype.aimTourCamera = function(e, t, i, n) {
  22221. return F.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  22222. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  22223. }
  22224. ,
  22225. n.prototype.showPathToHeroLocation = function(e) {
  22226. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(x.STD, x.BLACK)
  22227. }
  22228. ,
  22229. n.prototype.tourInterlude = function(e, t) {
  22230. this.history.invalidate();
  22231. this.path.discardSlow();
  22232. //xzw:
  22233. var a = g_data2.tourAudio && g_data2.tourAudio[this.model.heroLocations[this.director.currentItem].sid];
  22234. var rotTime = a && a.time;
  22235. this.path.waitNextStep(e, function() {
  22236. t && t()
  22237. }.bind(this), rotTime)
  22238. }
  22239. ,
  22240. n.prototype.stopInterlude = function() {
  22241. this.interruptAndFastForward(null, 0)
  22242. }
  22243. ,
  22244. n.prototype.interruptAndFastForward = function(e, t) {
  22245. this.isWarping() && this.emit(w.WarpInterrupted, this.path.activeTransType, e, t),
  22246. this.flying && this.emit(w.FlyingInterrupted),
  22247. this.path.interruptAndFastForward(e, t)
  22248. }
  22249. ,
  22250. n.prototype.setSize = function(e, t) {
  22251. var i = e / t;
  22252. this.baseFov = B.clampVFOV(f.insideFOV, f.insideFOVMax, e, t);
  22253. var n = B.getHFOVFromVFOV(f.insideFOV, e, t);
  22254. n > f.insideFOVMax ? this.baseFov = B.getVFOVFromHFOV(f.insideFOVMax, e, t) : this.baseFov = f.insideFOV;
  22255. for (var r in this.cameraControls.cameras) {
  22256. var o = this.cameraControls.cameras[r];
  22257. o.fov = this.baseFov * (1 / this.zoomLevel),
  22258. o.updateAspect(i)
  22259. }
  22260. }
  22261. ,
  22262. n.prototype.toJSON = function() {
  22263. var e = {};
  22264. return this.cameraControls.activeControl ? (e = this.cameraControls.activeControl.toJSON(),
  22265. e.camera_mode = u.toInt(this.mode),
  22266. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  22267. return e.hidden ? 0 : 1
  22268. }) : u.PANORAMA && (e.scan_id = this.currentPano.id),
  22269. e) : e
  22270. }
  22271. ,
  22272. n.prototype.getCurrentNodePanos = function(e) {
  22273. this.model.panos.map;
  22274. if (e.length = 0,
  22275. this.path.nodes)
  22276. for (var t = 0; t < this.path.nodes.length; t++) {
  22277. var i = this.path.nodes[t];
  22278. e.push(this.model.panos.get(i))
  22279. }
  22280. }
  22281. ,
  22282. n.prototype.zoomIncrementally = function(e) {
  22283. var t = this.zoomLevel;
  22284. this.zoomTo(this.zoomLevel + e),
  22285. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  22286. }
  22287. ,
  22288. n.prototype.zoomInIncrementally = function(e) {
  22289. e = e || this.defaultZoomIncrement,
  22290. this.zoomIncrementally(e)
  22291. }
  22292. ,
  22293. n.prototype.zoomOutIncrementally = function(e) {
  22294. e = e || -this.defaultZoomIncrement,
  22295. this.zoomIncrementally(e)
  22296. }
  22297. ,
  22298. n.prototype.zoomBy = function(e) {
  22299. this.zoomTo(this.zoomLevel * e)
  22300. }
  22301. ,
  22302. n.prototype.zoomIn = function() {
  22303. this.zoomBy(1 + this.zoomSpeed)
  22304. }
  22305. ,
  22306. n.prototype.zoomOut = function() {
  22307. this.zoomBy(1 - this.zoomSpeed)
  22308. }
  22309. ,
  22310. n.prototype.zoomTo = function(e, t) {
  22311. if (t || f.zoom.enabled && this.mode === u.PANORAMA && this.zoomEnabled) {
  22312. if (e < f.zoom.min && (e = f.zoom.min),
  22313. e > f.zoom.max && (e = f.zoom.max),
  22314. e > this.zoomLevel ? (this.emit(O.ZoomIn),
  22315. e === f.zoom.max && this.emit(O.ZoomMax)) : e < this.zoomLevel && (this.emit(O.ZoomOut),
  22316. e === f.zoom.min && this.emit(O.ZoomMin)),
  22317. this.cameraControls.activeControl) {
  22318. var i = this.cameraControls.activeControl.camera;
  22319. this.zoomLevel = e,
  22320. i.fov = this.baseFov * (1 / this.zoomLevel),
  22321. i.updateProjectionMatrix(),
  22322. this.zoomFov = i.fov
  22323. }
  22324. }
  22325. }
  22326. ,
  22327. n.prototype.increaseZoomSpeed = function() {
  22328. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  22329. }
  22330. ,
  22331. n.prototype.decreaseZoomSpeed = function() {
  22332. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  22333. }
  22334. ,
  22335. n.prototype.clampZoomSpeed = function(e) {
  22336. return e < 0 ? 0 : e
  22337. }
  22338. ,
  22339. n.prototype.activatePersistentZooming = function(e) {
  22340. this.zooming = e ? 1 : -1
  22341. }
  22342. ,
  22343. n.prototype.deactivatePersistentZooming = function() {
  22344. this.zooming = 0
  22345. }
  22346. ,
  22347. n.prototype.zoomDefault = function() {
  22348. this.zoomTo(1, !0)
  22349. }
  22350. ,
  22351. n.prototype.smoothZoomToDefault = function(e, t) {
  22352. var i, n = this.zoomLevel, r = function(e) {
  22353. e > 1 && (e = 1),
  22354. i = n * (1 - e) + e,
  22355. this.zoomTo(i, !0)
  22356. }
  22357. .bind(this), o = function() {
  22358. this.zoomDefault(),
  22359. t && window.setTimeout(t, 50)
  22360. }
  22361. .bind(this);
  22362. y.start(r, e, o, null, 0, A[f.transition.blendEasing])
  22363. }
  22364. ,
  22365. n.prototype.updateZoomPano = function() {
  22366. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === u.PANORAMA) {
  22367. var e = this.currentPano;
  22368. if (e) {
  22369. var t = this.zoomLevel > f.zoom.activationThreshold
  22370. , i = this.flying && this.nextPano && this.nextPano !== this.currentPano
  22371. , n = !i && !this.isWarping()
  22372. , r = t && n;
  22373. this.tileDownloader.tilePrioritizer.setZoomingActive(r),
  22374. this.panoRenderer.setZoomingActive(r, e, !0);
  22375. var o = function(e, t) {
  22376. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  22377. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  22378. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  22379. e.setZoomed(t)
  22380. }
  22381. .bind(this);
  22382. r && !e.zoomed ? (o(e, !0),
  22383. this.panoRenderer.enableUltraHighQualityMode(function() {
  22384. this.qualityManager.useUltraHighResolutionPanos && !f.zoom.overridemax && (f.zoom.max = D.ultraHighQualityMaxZoom),
  22385. r && o(e, !0)
  22386. }
  22387. .bind(this))) : !t && e.zoomed && o(e, !1)
  22388. }
  22389. }
  22390. }
  22391. ,
  22392. t.exports = n
  22393. }
  22394. ).call(this, "/js/player.js")
  22395. }
  22396. , {
  22397. "./constants": 8,
  22398. "./enum/AlignmentType": 17,
  22399. "./enum/BlackoutStyle": 18,
  22400. "./enum/ControlEvents": 21,
  22401. "./enum/Keys": 30,
  22402. "./enum/ModelManagerEvents": 33,
  22403. "./enum/PanoSizeClass": 36,
  22404. "./enum/PanoramaEvents": 37,
  22405. "./enum/PathDiscardMode": 38,
  22406. "./enum/PathDisplayMode": 39,
  22407. "./enum/PlayerEvents": 40,
  22408. "./enum/TagStates": 44,
  22409. "./enum/Vectors": 50,
  22410. "./enum/Viewmode": 51,
  22411. "./enum/WarpStyle": 52,
  22412. "./enum/ZoomEvents": 53,
  22413. "./exception/BasicException": 55,
  22414. "./model/ModelManager": 140,
  22415. "./objects/NSpider": 147,
  22416. "./objects/Panorama": 148,
  22417. "./objects/Reticule": 149,
  22418. "./objects/ShowPath": 151,
  22419. "./objects/Snapshot": 153,
  22420. "./objects/View": 154,
  22421. "./settings": 166,
  22422. "./shaders": 167,
  22423. "./tile/TileDownloader": 171,
  22424. "./tile/TilePrioritizer": 172,
  22425. "./util/ZoomStats": 179,
  22426. "./util/browser": 182,
  22427. "./util/camera": 183,
  22428. "./util/cameraLight": 184,
  22429. "./util/common": 185,
  22430. "./util/easing": 186,
  22431. "./util/history": 187,
  22432. "./util/lerp": 188,
  22433. "./util/logger": 189,
  22434. "./util/math": 190,
  22435. "./util/transitions": 195,
  22436. "hot":"hot",
  22437. "scaleImg":"scaleImg",
  22438. events: 202,
  22439. three: 217
  22440. }],
  22441. "scaleImg":[function(t, e){// xzw
  22442. var OUTPUT = e;
  22443. (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")}
  22444. function n(t){if(t){var e,a=G.getImageData(0,0,s,f),i=a.data;for(e=0;at>e;e+=4)
  22445. 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}
  22446. return G.getImageData(0,0,s,f)}
  22447. 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}
  22448. a||(a=t.input,i=t.output,r=t.inputRemovable,t.scale&&(t=t.scale));var u,d;if(a.src)
  22449. if(u=document.createElement("canvas"),null!=a.naturalWidth)
  22450. 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}
  22451. else
  22452. 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)
  22453. 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)
  22454. for(h(),J=n(),K=J.data,x=0;f>x;x++)
  22455. 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)
  22456. 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)
  22457. W=new Float32Array(at);else
  22458. for(W=[],et=0;at>et;++et)
  22459. W[et]=0;for(b=0;w>b;b++)
  22460. 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)
  22461. 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;}
  22462. delete p,h(),J=n(W)}
  22463. 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}
  22464. if("png-src"===i||"jpeg-src"===i)
  22465. return B.toDataURL("image/"+i.split("-")[0],0.85)}
  22466. return B}
  22467. var e=this;"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=t),exports.scale=t):c=t}).call(this);
  22468. OUTPUT.exports = c;
  22469. }, {}
  22470. ],
  22471. 156: [function(e, t, i) {
  22472. (function(i) {
  22473. "use strict";
  22474. function n(e, t) {
  22475. this.model = e,
  22476. this.panos = e.panos,
  22477. this.player = t,
  22478. this.imagePanos = this.listImagePanos(),
  22479. this.retryMinimumTime = 1e4
  22480. }
  22481. var r = (e("three"),
  22482. e("./enum/Viewmode"))
  22483. , o = (e("./settings"),
  22484. e("./objects/Panorama"))
  22485. , a = e("./util/logger")
  22486. , s = new a(i);
  22487. n.prototype.start = function() {
  22488. this.loadNextPano(function(e) {
  22489. e ? this.start() : (s.debug("No suitable pano loaded, waiting a little while before looking again"),
  22490. setTimeout(function() {
  22491. this.start()
  22492. }
  22493. .bind(this), 1e3))
  22494. }
  22495. .bind(this))
  22496. }
  22497. ,
  22498. n.prototype.validLoadTarget = function(e) {
  22499. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  22500. }
  22501. ,
  22502. n.prototype.listImagePanos = function() {
  22503. var e = []
  22504. , t = this;
  22505. return this.model.images.forEach(function(i) {
  22506. if (i.metadata && i.metadata.scan_id) {
  22507. var n = t.model.panos.get(i.metadata.scan_id);
  22508. n && !n.isLoaded("high") && e.push(n)
  22509. }
  22510. }),
  22511. e
  22512. }
  22513. ,
  22514. n.prototype.nextNotLoadedImage = function() {
  22515. for (; this.imagePanos.length > 0; ) {
  22516. var e = this.imagePanos[0];
  22517. if (!e.isLoaded("high"))
  22518. return e;
  22519. this.imagePanos.shift()
  22520. }
  22521. return null
  22522. }
  22523. ,
  22524. n.prototype.loadNextPano = function(e) {
  22525. var t, i, n = this.model.waitQueue.filter(function(e) {
  22526. return e.object instanceof o
  22527. });
  22528. n.length > 0 ? (t = n[0].object,
  22529. s.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  22530. s.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  22531. s.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  22532. t = this.imagePanos[0],
  22533. 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())]),
  22534. t && s.debug("Normal pano selection: neighbor " + t.id)),
  22535. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  22536. s.debug("Preloading " + i + "-res pano " + t.id),
  22537. t.loadCube(i).done(e).fail(function() {
  22538. s.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  22539. e()
  22540. })) : e && e(null)
  22541. }
  22542. ,
  22543. t.exports = n
  22544. }
  22545. ).call(this, "/js/preloaders.js")
  22546. }
  22547. , {
  22548. "./enum/Viewmode": 51,
  22549. "./objects/Panorama": 148,
  22550. "./settings": 166,
  22551. "./util/logger": 189,
  22552. three: 217
  22553. }],
  22554. 157: [function(e, t, i) {
  22555. (function(i) {
  22556. "use strict";
  22557. function n(e, t, i, n, r) {
  22558. this.qualityManager = e,
  22559. this.scene = t,
  22560. this.camera = i,
  22561. this.container = r,
  22562. this.controls = n,
  22563. this.controls.enabled = !0,
  22564. this.controls.locked = !0,
  22565. this.quickstartCamera = n.camera,
  22566. this.quickstartCamera.fov = h.clampVFOV(a.insideFOV, a.insideFOVMax, $("#player").width(), $("#player").height()),
  22567. this.skybox = null
  22568. }
  22569. var r = e("three")
  22570. , o = e("../util/logger")
  22571. , a = e("../constants")
  22572. , s = (e("../util/transitions"),
  22573. e("../util/lerp"),
  22574. e("../util/easing"),
  22575. e("../enum/Vectors"))
  22576. , l = e("../enum/PanoSizeClass")
  22577. , c = (e("../materials/ModelTextureMaterial"),
  22578. e("../materials/CubemapMaterial"))
  22579. , h = (e("../cameras/PanoramaCamera"),
  22580. e("../controls/PanoramaControls"),
  22581. e("../tile/TileUtils"),
  22582. e("../util/camera"),
  22583. e("../util/cameraLight"))
  22584. , u = (e("../util/browser"),
  22585. e("../settings"),
  22586. e("../gui/helpManager"),
  22587. new o(i));
  22588. n.prototype.load = function(e) {
  22589. e.pano.shouldRedrawOnBaseLoaded = !0;
  22590. var t, i, n = this, r = s.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  22591. this.controls.lookAt(r.add(this.quickstartCamera.position));
  22592. var a = this.qualityManager.getPanoSize(l.BASE)
  22593. , c = this.qualityManager.getPanoSize(l.STANDARD);
  22594. if (e.pano.tiled) {
  22595. u.warn("Loading startPano, TILED", e.pano.id);
  22596. var d = h.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  22597. , p = this.quickstartCamera.fov;
  22598. u.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + d + ", vertical FOV: " + p + "]"),
  22599. t = e.pano.loadTiledPano(c, r, {
  22600. hFov: d,
  22601. vFov: p
  22602. }, !1, !1, !0),
  22603. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  22604. } else
  22605. u.warn("Loading startPano", e.pano.id),
  22606. t = e.pano.loadCube("high");
  22607. return $.when(t).then(function() {
  22608. n.init(e.pano, e.quaternion),
  22609. e.pano.tiled ? i.done(function() {
  22610. e.pano.lockUntilRenderingComplete = !1,
  22611. this.controls.locked = !1
  22612. }
  22613. .bind(this)) : this.controls.locked = !1
  22614. }
  22615. .bind(this))
  22616. }
  22617. ,
  22618. n.prototype.init = function(e, t) {
  22619. u.info("Quickstart done loading, adding scene objects"),
  22620. e.lockUntilRenderingComplete = !0,
  22621. this.skybox = new r.Mesh(new r.CubeGeometry(1,1,1),new c({
  22622. side: r.BackSide
  22623. })),
  22624. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  22625. this.skybox.quaternion.copy(e.quaternion),
  22626. this.scene.add(this.skybox),
  22627. $(this.container).show()
  22628. }
  22629. ,
  22630. n.prototype.update = function(e) {
  22631. this.controls.update(e),
  22632. this.camera.copy(this.quickstartCamera)
  22633. }
  22634. ,
  22635. n.prototype.setSize = function(e, t) {
  22636. this.quickstartCamera.updateAspect(e / t)
  22637. }
  22638. ,
  22639. n.prototype.destroy = function() {
  22640. this.scene.remove(this.skybox)
  22641. }
  22642. ,
  22643. t.exports = n
  22644. }
  22645. ).call(this, "/js/scene/QuickstartManager.js")
  22646. }
  22647. , {
  22648. "../cameras/PanoramaCamera": 7,
  22649. "../constants": 8,
  22650. "../controls/PanoramaControls": 13,
  22651. "../enum/PanoSizeClass": 36,
  22652. "../enum/Vectors": 50,
  22653. "../gui/helpManager": 68,
  22654. "../materials/CubemapMaterial": 117,
  22655. "../materials/ModelTextureMaterial": 118,
  22656. "../settings": 166,
  22657. "../tile/TileUtils": 174,
  22658. "../util/browser": 182,
  22659. "../util/camera": 183,
  22660. "../util/cameraLight": 184,
  22661. "../util/easing": 186,
  22662. "../util/lerp": 188,
  22663. "../util/logger": 189,
  22664. "../util/transitions": 195,
  22665. three: 217
  22666. }],
  22667. 158: [function(e, t, i) {
  22668. "use strict";
  22669. function n(e, t, i) {
  22670. this.scene = e,
  22671. this.camera = t,
  22672. this.renderer = null,
  22673. this.effects = i,
  22674. this.animateCallback = null,
  22675. this.composer = null,
  22676. this.qualityManager = null,
  22677. e.renderWidth = 0,
  22678. e.renderHeight = 0,
  22679. this.updateClock = new r.Clock,
  22680. this.components = [],
  22681. this.updateListeners = [],
  22682. this.resizeListeners = [],
  22683. this.forceUpdateSize = !1,
  22684. this.started = !1,
  22685. this.textures = {},
  22686. this.suspendedObjects = []
  22687. }
  22688. var r = e("three")
  22689. , o = e("../shaders")
  22690. , a = e("../enum/SceneRendererEvents")
  22691. , s = e("../enum/GLTextureType")
  22692. , l = e("../enum/GLCubeFaces")
  22693. , c = e("../exception/BasicException")
  22694. , h = e("../exception/RendererCreationException")
  22695. , u = e("../settings")
  22696. , d = e("events").EventEmitter;
  22697. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  22698. n.prototype = Object.create(d.prototype),
  22699. n.prototype.addComponent = function(e) {
  22700. this.components.push(e),
  22701. e.update && this.updateListeners.push(e),
  22702. e.setSize && (this.resizeListeners.push(e),
  22703. this.forceUpdateSize = !0)
  22704. }
  22705. ,
  22706. n.prototype.removeComponent = function(e) {
  22707. var t = function(t) {
  22708. return t !== e
  22709. };
  22710. this.components = this.components.filter(t),
  22711. this.updateListeners = this.updateListeners.filter(t),
  22712. this.resizeListeners = this.resizeListeners.filter(t)
  22713. }
  22714. ,
  22715. n.prototype.start = function(e) {
  22716. if (this.started)
  22717. throw new c("Can't start SceneRenderer, already started");
  22718. this.createContext(e),
  22719. this.initComposer(),
  22720. this.started = !0,
  22721. (p = p.bind(this))()
  22722. }
  22723. ,
  22724. n.prototype.createContext = function(e) {
  22725. try {
  22726. this.renderer = new r.WebGLRenderer,
  22727. this.renderer.autoClear = !0,
  22728. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  22729. this.renderer.setSize($("#player").width(), $("#player").height(), false), //改
  22730. this.emit(a.ContextCreated)
  22731. } catch (e) {
  22732. throw new h("Unable to create a WebGL rendering context")
  22733. }
  22734. u.profiling.enabled && this.overrideTextures(),
  22735. e.appendChild(this.renderer.domElement)
  22736. }
  22737. ,
  22738. n.prototype.overrideTextures = function() {
  22739. var e = this.renderer.context
  22740. , t = 0
  22741. , i = e.createTexture;
  22742. e.createTexture = function() {
  22743. var n = i.call(e);
  22744. return n.id = t++,
  22745. this.textures[n.id] = n,
  22746. n
  22747. }
  22748. .bind(this);
  22749. var n = e.texImage2D;
  22750. e.texImage2D = function(t, i, r, o, a, l, c, h, u) {
  22751. var d, p = this.getTextureTypeFromTarget(e, t);
  22752. d = p === s.TextureCube ? e.getParameter(e.TEXTURE_BINDING_CUBE_MAP) : e.getParameter(e.TEXTURE_BINDING_2D),
  22753. void 0 !== c ? n.call(e, t, i, r, o, a, l, c, h, u) : (c = o,
  22754. h = a,
  22755. u = l,
  22756. o = u.naturalWidth,
  22757. a = u.naturalHeight,
  22758. n.call(e, t, i, r, c, h, u));
  22759. var f = this.textures[d.id];
  22760. f.width = p === s.TextureCube ? 6 * o : o,
  22761. f.height = a
  22762. }
  22763. .bind(this);
  22764. var r = e.deleteTexture;
  22765. e.deleteTexture = function(t) {
  22766. delete this.textures[t.id],
  22767. r.call(e, t)
  22768. }
  22769. .bind(this)
  22770. }
  22771. ,
  22772. n.prototype.updateTextureMemory = function() {
  22773. var e = null;
  22774. return function() {
  22775. var t = 0;
  22776. for (var i in this.textures) {
  22777. var n = this.textures[i];
  22778. n.width && n.height && (t += n.width * n.height * 4)
  22779. }
  22780. t !== e && this.emit(a.MemoryUsageUpdated, t),
  22781. e = t
  22782. }
  22783. }(),
  22784. n.prototype.getTextureTypeFromTarget = function(e, t) {
  22785. switch (t) {
  22786. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  22787. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  22788. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  22789. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  22790. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  22791. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  22792. return s.TextureCube;
  22793. case e.TEXTURE_2D:
  22794. return s.Texture2D;
  22795. default:
  22796. return null
  22797. }
  22798. }
  22799. ,
  22800. n.prototype.initComposer = function() {
  22801. this.composer = new r.EffectComposer(this.renderer),
  22802. this.composer.addPass(new r.RenderPass(this.scene,this.camera)),
  22803. this.composer.addPass(this.effects.hblurPass),
  22804. this.composer.addPass(this.effects.vblurPass)
  22805. }
  22806. ,
  22807. n.prototype.setSize = function(e, t, devicePixelRatio) {
  22808. this.renderWidth = e,
  22809. this.renderHeight = t,
  22810. this.effects.aspect = e / t,
  22811. /* this.renderer.setSize(e, t), -----MP */
  22812. this.renderer.setSize(e, t, false, devicePixelRatio), //改 为了防止给canvas设置宽高
  22813. this.composer.setSize(e, t);
  22814. for (var i = 0; i < this.resizeListeners.length; i++)
  22815. this.resizeListeners[i].setSize(e, t)
  22816. }
  22817. ,
  22818. n.prototype.render = function() {
  22819. this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  22820. }
  22821. ,
  22822. /* n.prototype.updateScreenSize = function() {----MP
  22823. ($("#player").width() !== this.renderWidth || $("#player").height() !== this.renderHeight || this.forceUpdateSize) && (this.setSize($("#player").width(), $("#player").height()),
  22824. this.forceUpdateSize = !1)
  22825. } */
  22826. n.prototype.updateScreenSize = function() {//xzw 改 为了截屏 要改canvas大小 以及缩放时不模糊
  22827. var W,H;//当截屏时有setTimeout 期间不能恢复大小,所以要用W,H记录正常大小
  22828. return function(o){
  22829. var render = false;
  22830. var ratio;
  22831. var w, h; //记录应当render的大小
  22832. if(o && !o.resize && o.width!= void 0 && o.height!= void 0){
  22833. w = o.width, h = o.height, render = true, ratio=1;
  22834. }else{
  22835. w = $('#player').width();
  22836. h = $('#player').height();
  22837. o && o.resize && (W = this.renderWidth, H = this.renderHeight);
  22838. (w !== W || h !== H || this.forceUpdateSize) &&
  22839. (W = w, H = h, render = true, ratio = window.devicePixelRatio);
  22840. }
  22841. if(render){
  22842. this.setSize(w, h, ratio);
  22843. this.forceUpdateSize = !1
  22844. }
  22845. }
  22846. }()
  22847. ,
  22848. n.prototype.updateComponents = function() {
  22849. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  22850. this.updateListeners[t].update(e)
  22851. }
  22852. ,
  22853. n.prototype.suspend = function() {
  22854. this.started = !1,
  22855. this.suspendedObjects = this.scene.children.map(function(e) {
  22856. return this.scene.remove(e),
  22857. e
  22858. }
  22859. .bind(this)),
  22860. this.render()
  22861. }
  22862. ,
  22863. n.prototype.resume = function() {
  22864. this.suspendedObjects.forEach(function(e) {
  22865. this.scene.add(e)
  22866. }
  22867. .bind(this)),
  22868. this.suspendedObjects = [],
  22869. this.started = !0,
  22870. p()
  22871. }
  22872. ;
  22873. var p = function() {
  22874. this.started && (window.requestAnimationFrame(p),
  22875. this.updateScreenSize(),
  22876. this.updateComponents(),
  22877. this.updateTextureMemory(),
  22878. this.render(),
  22879. this.emit(a.AfterRender))
  22880. };
  22881. n.prototype.getImageData = function() {
  22882. var e = document.createElement("canvas")
  22883. , t = e.getContext("2d");
  22884. return function(i, n, r) {
  22885. return e.width === n && e.height === r || (e.width = n,
  22886. e.height = r),
  22887. t.drawImage(i, 0, 0, n, r),
  22888. t.getImageData(0, 0, n, r)
  22889. }
  22890. }(),
  22891. n.prototype.initSizedTexture2D = function(e, t, i) {
  22892. var n = this.renderer
  22893. , o = n.context
  22894. , a = n.state
  22895. , s = new r.Texture(null);
  22896. s.flipY = !1,
  22897. i !== !0 && (i = !1),
  22898. s.generateMipmaps = i;
  22899. var l = n.paramThreeToGL(s.format)
  22900. , c = n.paramThreeToGL(s.type)
  22901. , h = n.properties.get(s)
  22902. , u = o.createTexture();
  22903. a.bindTexture(o.TEXTURE_2D, u),
  22904. o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, s.flipY),
  22905. o.texImage2D(o.TEXTURE_2D, 0, l, e, e, 0, l, c, null),
  22906. s.wrapS = t,
  22907. s.wrapT = t;
  22908. var d = n.paramThreeToGL(t);
  22909. return o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, d),
  22910. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, d),
  22911. i ? (s.magFilter = r.LinearFilter,
  22912. s.minFilter = r.LinearMipMapLinearFilter,
  22913. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  22914. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR_MIPMAP_NEAREST),
  22915. o.generateMipmap(o.TEXTURE_2D)) : (s.magFilter = r.LinearFilter,
  22916. s.minFilter = r.LinearFilter,
  22917. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  22918. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR)),
  22919. a.bindTexture(o.TEXTURE_2D, null),
  22920. h.__webglTexture = u,
  22921. s
  22922. }
  22923. ,
  22924. n.prototype.initSizedCubeMap = function(e, t) {
  22925. var i = this.renderer
  22926. , n = i.context
  22927. , o = i.state
  22928. , a = new r.CubeTexture([null, null, null, null, null, null]);
  22929. a.flipY = !1,
  22930. a.generateMipmaps = t;
  22931. var s = i.paramThreeToGL(a.format)
  22932. , l = i.paramThreeToGL(a.type)
  22933. , c = i.properties.get(a)
  22934. , h = n.createTexture();
  22935. o.bindTexture(n.TEXTURE_CUBE_MAP, h),
  22936. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, a.flipY);
  22937. for (var u = 0; u < 6; u++)
  22938. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + u, 0, s, e, e, 0, s, l, null);
  22939. return t ? (a.magFilter = r.LinearFilter,
  22940. a.minFilter = r.LinearMipMapLinearFilter,
  22941. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  22942. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  22943. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  22944. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (a.magFilter = r.LinearFilter,
  22945. a.minFilter = r.LinearFilter,
  22946. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  22947. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  22948. o.bindTexture(n.TEXTURE_CUBE_MAP, null),
  22949. c.__image__webglTextureCube = h,
  22950. a
  22951. }
  22952. ,
  22953. n.prototype.deallocateCubeTexture = function(e) {
  22954. var t = this.renderer
  22955. , i = t.context
  22956. , n = t.properties.get(e);
  22957. i.deleteTexture(n.__image__webglTextureCube)
  22958. }
  22959. ,
  22960. n.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  22961. var a = this.renderer
  22962. , s = a.context
  22963. , l = a.state
  22964. , c = a.properties.get(t);
  22965. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  22966. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  22967. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  22968. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  22969. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  22970. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  22971. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  22972. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  22973. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  22974. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  22975. l.bindTexture(s.TEXTURE_2D, null)
  22976. }
  22977. ,
  22978. n.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  22979. var s = this.renderer
  22980. , l = s.context
  22981. , c = s.state
  22982. , h = s.properties.get(t);
  22983. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  22984. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  22985. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  22986. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  22987. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  22988. }
  22989. ,
  22990. n.prototype.rebuildMipMaps2D = function(e) {
  22991. var t = this.renderer
  22992. , i = t.context
  22993. , n = t.state;
  22994. t.properties.get(e);
  22995. i.generateMipmap(i.TEXTURE_2D),
  22996. n.bindTexture(i.TEXTURE_2D, null)
  22997. }
  22998. ,
  22999. n.prototype.rebuildMipMaps3D = function(e) {
  23000. var t = this.renderer
  23001. , i = t.context
  23002. , n = t.state
  23003. , r = t.properties.get(e);
  23004. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  23005. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  23006. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  23007. }
  23008. ,
  23009. n.prototype.renderToCubeMap = function() {
  23010. var e = !1
  23011. , t = null
  23012. , i = null
  23013. , n = null
  23014. , a = null
  23015. , s = null
  23016. , l = 1;
  23017. return function(c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w) {
  23018. var _ = this.renderer;
  23019. _.context;
  23020. e || (i = new r.OrthographicCamera(l / -2,l / 2,l / 2,l / -2,-200,200),
  23021. i.position.z = 150,
  23022. t = new r.Scene,
  23023. t.add(i),
  23024. n = new r.ShaderMaterial({
  23025. uniforms: {
  23026. tDiffuse: {
  23027. type: "t",
  23028. value: null
  23029. },
  23030. alpha: {
  23031. type: "f",
  23032. value: 1
  23033. }
  23034. },
  23035. vertexShader: o.basicTextured.vertexShader,
  23036. fragmentShader: o.basicTextured.fragmentShader,
  23037. depthWrite: !1,
  23038. depthTest: !1,
  23039. side: r.DoubleSide
  23040. }),
  23041. a = new r.PlaneBufferGeometry(l,l),
  23042. s = new r.Mesh(a,n),
  23043. s.position.z = 0,
  23044. t.add(s),
  23045. e = !0);
  23046. var T = a.getAttribute("uv");
  23047. T.setDynamic(!0),
  23048. T.needsUpdate = !0;
  23049. var x = T.array
  23050. , S = p / u
  23051. , M = f / d
  23052. , R = g / u
  23053. , P = m / d;
  23054. x[0] = S,
  23055. x[1] = M + P,
  23056. x[2] = S + R,
  23057. x[3] = M + P,
  23058. x[4] = S,
  23059. x[5] = M,
  23060. x[6] = S + R,
  23061. x[7] = M;
  23062. var O = a.getAttribute("position");
  23063. O.setDynamic(!0),
  23064. O.needsUpdate = !0;
  23065. var L = O.array
  23066. , D = v / h.width - l / 2
  23067. , N = A / h.height - l / 2
  23068. , B = y / h.width
  23069. , F = C / h.height;
  23070. L[0] = D,
  23071. L[1] = N + F,
  23072. L[3] = D + B,
  23073. L[4] = N + F,
  23074. L[6] = D,
  23075. L[7] = N,
  23076. L[9] = D + B,
  23077. L[10] = N;
  23078. this.renderer.properties.get(c);
  23079. n.uniforms.tDiffuse.value = c,
  23080. n.blending = E || r.NoBlending,
  23081. n.transparent = !!b,
  23082. void 0 !== w && null !== w || (w = 1),
  23083. n.uniforms.alpha.value = w,
  23084. n.needUpdate = !0,
  23085. h.activeCubeFace = I,
  23086. h.viewport.set(0, 0, h.width, h.height);
  23087. var V = this.renderer.autoClear;
  23088. this.renderer.autoClear = !1,
  23089. this.renderer.render(t, i, h, !1),
  23090. this.renderer.autoClear = V
  23091. }
  23092. }(),
  23093. n.prototype.copyCubeMap = function() {
  23094. var e = !1
  23095. , t = null
  23096. , i = null
  23097. , a = null
  23098. , s = null
  23099. , l = null
  23100. , c = new r.Euler;
  23101. new r.Vector3;
  23102. return function(h, u, d, p, f, g, m, v, A) {
  23103. this.renderer;
  23104. if (!e) {
  23105. var y = 2;
  23106. i = new r.OrthographicCamera(y / -2,y / 2,y / 2,y / -2,0,200),
  23107. i.position.set(0, 0, 0),
  23108. t = new r.Scene,
  23109. t.add(i),
  23110. a = new r.ShaderMaterial({
  23111. uniforms: {
  23112. tDiffuse: {
  23113. type: "t",
  23114. value: null
  23115. },
  23116. alpha: {
  23117. type: "f",
  23118. value: 1
  23119. }
  23120. },
  23121. vertexShader: o.copyCubeMap.vertexShader,
  23122. fragmentShader: o.copyCubeMap.fragmentShader,
  23123. depthWrite: !1,
  23124. depthTest: !1,
  23125. side: r.DoubleSide
  23126. }),
  23127. s = new r.BoxGeometry(y,y,y),
  23128. l = new r.Mesh(s,a),
  23129. t.add(l),
  23130. e = !0
  23131. }
  23132. for (var C = 0; C < 6; C++)
  23133. n.getCubeOrientationForCubeFace(C, c),
  23134. l.rotation.copy(c),
  23135. l.matrixWorldNeedsUpdate = !0,
  23136. l.updateMatrixWorld(),
  23137. a.uniforms.tDiffuse.value = h,
  23138. a.blending = m || r.NoBlending,
  23139. a.transparent = !!v,
  23140. void 0 !== A && null !== A || (A = 1),
  23141. a.uniforms.alpha.value = A,
  23142. a.needUpdate = !0,
  23143. u.activeCubeFace = C,
  23144. u.viewport.set(0, 0, f, g),
  23145. this.renderer.render(t, i, u, !1)
  23146. }
  23147. }(),
  23148. n.getLookAtForCubeFace = function(e, t) {
  23149. switch (e) {
  23150. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23151. t.set(1, 0, 0);
  23152. break;
  23153. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23154. t.set(-1, 0, 0);
  23155. break;
  23156. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23157. t.set(0, 1, 0);
  23158. break;
  23159. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23160. t.set(0, -1, 0);
  23161. break;
  23162. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23163. t.set(0, 0, 1);
  23164. break;
  23165. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23166. t.set(0, 0, -1)
  23167. }
  23168. }
  23169. ,
  23170. n.getCubeOrientationForCubeFace = function(e, t) {
  23171. switch (e) {
  23172. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23173. t.set(0, -Math.PI / 2, 0);
  23174. break;
  23175. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23176. t.set(0, Math.PI / 2, 0);
  23177. break;
  23178. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23179. t.set(Math.PI / 2, Math.PI, 0);
  23180. break;
  23181. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23182. t.set(-Math.PI / 2, Math.PI, 0);
  23183. break;
  23184. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23185. t.set(0, -Math.PI, 0);
  23186. break;
  23187. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23188. t.set(0, 0, 0)
  23189. }
  23190. }
  23191. ,
  23192. t.exports = n
  23193. }
  23194. , {
  23195. "../enum/GLCubeFaces": 25,
  23196. "../enum/GLTextureType": 26,
  23197. "../enum/SceneRendererEvents": 43,
  23198. "../exception/BasicException": 55,
  23199. "../exception/RendererCreationException": 57,
  23200. "../settings": 166,
  23201. "../shaders": 167,
  23202. events: 202,
  23203. three: 217
  23204. }],
  23205. 159: [function(e, t, i) {
  23206. "use strict";
  23207. function n(e) {
  23208. this.messenger = new a(e),
  23209. this.clientKey = null
  23210. }
  23211. var r = e("../util/ajax")
  23212. , o = e("./PostMessageType")
  23213. , a = e("./postmessage")
  23214. , s = e("./VersionInfo")
  23215. , l = e("events").EventEmitter
  23216. , c = window.location.origin + "/api/v1/user/";
  23217. n.prototype = Object.create(l.prototype),
  23218. n.prototype.bindEvents = function() {
  23219. this.messenger.on(o.ACTION, this.onMessageReceived.bind(this))
  23220. }
  23221. ,
  23222. n.prototype.waitForConnection = function() {
  23223. var e = new Promise(function(e, t) {
  23224. this.messenger.on(o.CONNECT, function(i) {
  23225. this.onConnectionReceived(i).then(e.bind(this, i.sdkVersion), t.bind())
  23226. }
  23227. .bind(this))
  23228. }
  23229. .bind(this));
  23230. return e
  23231. }
  23232. ,
  23233. n.prototype.onConnectionReceived = function(e) {
  23234. return this.messenger.setTarget(e.source, e.origin),
  23235. this.verifyConnection(e).then(function(t, i) {
  23236. this.messenger.send({
  23237. type: o.ACCEPT,
  23238. toId: e.fromId,
  23239. warning: i
  23240. }),
  23241. this.clientKey = t,
  23242. this.messenger.removeAllListeners(o.CONNECT),
  23243. this.bindEvents()
  23244. }
  23245. .bind(this), function(t) {
  23246. this.messenger.send({
  23247. type: o.REJECT,
  23248. toId: e.fromId,
  23249. reason: t
  23250. }),
  23251. this.messenger.setTarget()
  23252. }
  23253. .bind(this))
  23254. }
  23255. ,
  23256. n.prototype.verifyConnection = function(e) {
  23257. return new Promise(function(t, i) {
  23258. var n;
  23259. if (s.isDeprecated(e.sdkVersion))
  23260. n = "This version of the SDK is being deprecated. Please see http://www.port.com for more info";
  23261. else if (!s.isSupported(e.sdkVersion))
  23262. return i("This version of the SDK isn't supported. Get the latest version here: http://www.port.com");
  23263. var o = {
  23264. cache: !1,
  23265. headers: {
  23266. "X-port-Application-Key": e.applicationKey,
  23267. "X-port-Referrer": e.origin
  23268. }
  23269. };
  23270. r.get(c, o).done(t.bind(this, e.applicationKey, n)).fail(i.bind(this, "key/referrer mismatch"))
  23271. }
  23272. )
  23273. }
  23274. ,
  23275. n.prototype.onMessageReceived = function(e) {
  23276. if (this.validateClientApplicationKey(e.applicationKey)) {
  23277. var t = this;
  23278. e.onDone = function(i) {
  23279. i.toId = e.fromId,
  23280. i.uid = e.uid,
  23281. i.type = o.RESPONSE,
  23282. t.messenger.send(i)
  23283. }
  23284. ,
  23285. this.emit(o.ACTION, e)
  23286. }
  23287. }
  23288. ,
  23289. n.prototype.validateClientApplicationKey = function(e) {
  23290. return this.clientKey === e
  23291. }
  23292. ,
  23293. n.prototype.sendEvent = function(e, t) {
  23294. this.messenger.send({
  23295. type: o.EVENT,
  23296. eventType: e,
  23297. eventData: t
  23298. })
  23299. }
  23300. ,
  23301. t.exports = n
  23302. }
  23303. , {
  23304. "../util/ajax": 181,
  23305. "./PostMessageType": 160,
  23306. "./VersionInfo": 163,
  23307. "./postmessage": 165,
  23308. events: 202
  23309. }],
  23310. 160: [function(e, t, i) {
  23311. "use strict";
  23312. t.exports = Object.freeze({
  23313. CONNECT: "postmessage.connect",
  23314. ACCEPT: "postmessage.accept",
  23315. REJECT: "postmessage.reject",
  23316. ACTION: "postmessage.action",
  23317. RESPONSE: "postmessage.response",
  23318. EVENT: "postmessage.event"
  23319. })
  23320. }
  23321. , {}],
  23322. 161: [function(e, t, i) {
  23323. "use strict";
  23324. t.exports = Object.freeze({
  23325. MOVE: "sdk.move",
  23326. ENTER_PANO: "sdk.enterpano",
  23327. MODEL_LOADED: "sdk.modelloaded"
  23328. })
  23329. }
  23330. , {}],
  23331. 162: [function(e, t, i) {
  23332. "use strict";
  23333. t.exports = Object.freeze({
  23334. FLY: "transition.fly",
  23335. FADEOUT: "transition.fade",
  23336. INSTANT: "transition.instant"
  23337. })
  23338. }
  23339. , {}],
  23340. 163: [function(e, t, i) {
  23341. "use strict";
  23342. t.exports = {
  23343. current: "1.0",
  23344. supported: ["1.0"],
  23345. deprecated: [],
  23346. isSupported: function(e) {
  23347. return this.supported.indexOf(e) !== -1
  23348. },
  23349. isDeprecated: function(e) {
  23350. return this.deprecated.indexOf(e) !== -1
  23351. },
  23352. isValid: function(e) {
  23353. return this.isSupported(e) || this.isDeprecated(e)
  23354. }
  23355. }
  23356. }
  23357. , {}],
  23358. 164: [function(e, t, i) {
  23359. (function(i) {
  23360. "use strict";
  23361. function n(e, t, i) {
  23362. e && (e = e.toLowerCase().trim());
  23363. var n = new I.UP.clone
  23364. , r = Math.PI / 3
  23365. , o = Math.PI / 2;
  23366. switch (e) {
  23367. case "left":
  23368. i.copy(t),
  23369. i.applyAxisAngle(n, o);
  23370. break;
  23371. case "right":
  23372. i.copy(t),
  23373. i.applyAxisAngle(n, -o);
  23374. break;
  23375. case "forwardleft":
  23376. i.copy(t),
  23377. i.applyAxisAngle(n, r);
  23378. break;
  23379. case "forwardright":
  23380. i.copy(t),
  23381. i.applyAxisAngle(n, -r);
  23382. break;
  23383. case "forward":
  23384. default:
  23385. i.copy(t)
  23386. }
  23387. return i
  23388. }
  23389. function r(e, t) {
  23390. if (e) {
  23391. var i = {
  23392. pano: e,
  23393. lookAtPoint: null,
  23394. duration: null,
  23395. maxDistanceOverride: null,
  23396. skipWarpingCheck: !1
  23397. };
  23398. this.player.flyToPano(i, function() {
  23399. t && t({
  23400. success: !0,
  23401. message: "Transition complete."
  23402. })
  23403. })
  23404. } else
  23405. R.warn("Showcase -> clickPanoObject: Unable to find pano."),
  23406. t && t({
  23407. success: !1,
  23408. error: "Unable to find pano."
  23409. })
  23410. }
  23411. function o(e, t) {
  23412. var i = this.findRankedPano(e, t);
  23413. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  23414. null)
  23415. }
  23416. function a(e, t) {
  23417. var i = this.findRankedtag(e, t);
  23418. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  23419. null)
  23420. }
  23421. function s(e, t) {
  23422. t.copy(I.FORWARD),
  23423. e.getDirection(t)
  23424. }
  23425. function l(e) {
  23426. function t(e) {
  23427. var t = (new c.Euler).setFromQuaternion(e.quaternion, "YXZ");
  23428. return {
  23429. x: c.Math.radToDeg(t._x),
  23430. y: c.Math.radToDeg(t._y),
  23431. z: c.Math.radToDeg(t._z)
  23432. }
  23433. }
  23434. var i = function(e) {
  23435. return e.alignmentType !== m.ALIGNED ? null : {
  23436. x: e.position.x,
  23437. y: e.position.y,
  23438. z: e.position.z
  23439. }
  23440. };
  23441. return {
  23442. panos: e.panos.list.map(function(n) {
  23443. var r = y.getCubemapUrls(e.urls, n.id, "high")[C.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  23444. return {
  23445. uuid: n.id,
  23446. aligned: n.alignmentType === m.ALIGNED,
  23447. neighbourUUIDs: n.neighbourUUIDs.slice(),
  23448. position: i(n),
  23449. rotation: t(n),
  23450. thumbnail: r
  23451. }
  23452. })
  23453. }
  23454. }
  23455. var c = e("three")
  23456. , h = e("./ApiHost")
  23457. , u = e("../util/logger")
  23458. , d = e("../util/common")
  23459. , p = e("../util/math")
  23460. , f = e("../enum/ModelManagerEvents")
  23461. , g = e("./PostMessageType")
  23462. , m = e("../enum/AlignmentType")
  23463. , v = e("../enum/Direction")
  23464. , A = e("./TransitionStyles")
  23465. , y = e("../util/panorama")
  23466. , C = e("../enum/GLCubeFaces")
  23467. , I = e("../enum/Vectors")
  23468. , E = e("../enum/Viewmode")
  23469. , b = e("../enum/WarpStyle")
  23470. , w = (e("../enum/Keys"),
  23471. e("../enum/PlayerEvents"))
  23472. , _ = e("../sdk/SdkEvents")
  23473. , I = e("../enum/Vectors")
  23474. , T = e("../enum/ControlEvents")
  23475. , x = e("../enum/RenderLayers")
  23476. , S = (e("../constants"),
  23477. e("../settings"))
  23478. , M = e("../lib/jpeg_encoder")
  23479. , R = new u(i)
  23480. , P = function() {
  23481. var e = function e() {
  23482. e.playerDirection.copy(e.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  23483. e.player.getDirection(e.playerDirection),
  23484. e.projectVectors();
  23485. var t = e.playerDirection.angleTo(e.lastFacingDirection);
  23486. if (e.angleTravelled += Math.abs(t),
  23487. e.angleTravelled >= Math.abs(e.angle)) {
  23488. if (e.active = !1,
  23489. e.onDone) {
  23490. var i = e.onDone;
  23491. i()
  23492. }
  23493. } else
  23494. e.lastFacingDirection.copy(e.playerDirection),
  23495. window.setTimeout(e, 4)
  23496. };
  23497. return e.active = !1,
  23498. e.angle = 0,
  23499. e.angleTravelled = 0,
  23500. e.playerDirection = new c.Vector3,
  23501. e.lastFacingDirection = new c.Vector3,
  23502. e.onDone = null,
  23503. e.player = null,
  23504. e.start = function(t, i, n, r) {
  23505. e.active = !0,
  23506. t && i && (i = 0),
  23507. e.angle = t || i,
  23508. e.xAngle = t,
  23509. e.yAngle = i,
  23510. e.angleTravelled = 0,
  23511. e.playerDirection.copy(n.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  23512. n.getDirection(e.playerDirection),
  23513. e.lastFacingDirection.copy(e.playerDirection),
  23514. e.projectVectors(),
  23515. e.onDone = r,
  23516. e.player = n,
  23517. e()
  23518. }
  23519. ,
  23520. e.projectVectors = function() {
  23521. e.xAngle && (e.playerDirection.projectOnPlane(I.UP),
  23522. e.lastFacingDirection.projectOnPlane(I.UP))
  23523. }
  23524. ,
  23525. e
  23526. }()
  23527. , O = function() {
  23528. var e = new c.Vector3;
  23529. return function(t) {
  23530. t ? (e.copy(t.position),
  23531. e.add(t.discPosition),
  23532. p.projectPositionToCanvas(e, this.player.camera, e),
  23533. this.click(e.x, e.y)) : R.warn("Showcase -> clicktagObject: Unable to find tag.")
  23534. }
  23535. }()
  23536. , L = function() {
  23537. return this.player.mode === E.PANORAMA ? S.insideLookLimitUp : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.minPolarAngle) : null
  23538. }
  23539. , D = function() {
  23540. return this.player.mode === E.PANORAMA ? S.insideLookLimitDown : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.maxPolarAngle) : null
  23541. }
  23542. , N = function(e) {
  23543. var t = new c.Vector3;
  23544. return function(e) {
  23545. var i = this.player.getDirection();
  23546. t.copy(i);
  23547. var n = t.y;
  23548. t.y = 0,
  23549. t.normalize();
  23550. var r = c.Math.radToDeg(t.angleTo(i)) * (n < 0 ? -1 : 1);
  23551. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.PANORAMA)
  23552. return 0 !== e && R.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  23553. 0;
  23554. this.player.mode === E.DOLLHOUSE && (r = -r);
  23555. var o = L.call(this) - .1
  23556. , a = D.call(this) + .1
  23557. , s = r + e;
  23558. s > o ? s = o : s < a && (s = a);
  23559. var l = s - r;
  23560. return e > 0 && l < .01 && (l = 0),
  23561. e < 0 && l > -.01 && (l = 0),
  23562. l
  23563. }
  23564. }()
  23565. , B = function() {
  23566. var e = new c.Euler;
  23567. return function(t) {
  23568. return e.setFromQuaternion(t.quaternion, "YXZ"),
  23569. {
  23570. position: {
  23571. x: t.position.x,
  23572. y: t.position.y,
  23573. z: t.position.z
  23574. },
  23575. rotation: {
  23576. x: c.Math.radToDeg(e.x),
  23577. y: c.Math.radToDeg(e.y),
  23578. z: 0
  23579. },
  23580. pano: t.currentPano ? t.currentPano.id : null,
  23581. mode: t.mode
  23582. }
  23583. }
  23584. }()
  23585. , F = null;
  23586. t.exports = {
  23587. init: function(e, t, i, n, r) {
  23588. V.init(e, t, i, r),
  23589. F = new Promise(function(e, t) {
  23590. i.on(w.Ready, function() {
  23591. e()
  23592. })
  23593. }
  23594. .bind(this));
  23595. var o = new h(window)
  23596. , a = o.waitForConnection();
  23597. a.then(function(e) {
  23598. o.on(g.ACTION, V.onMessageReceive.bind(V))
  23599. });
  23600. var s = function() {
  23601. var e = Date.now();
  23602. return function() {
  23603. if (!(Date.now() - e < 100)) {
  23604. var t = B(i);
  23605. o.sendEvent(_.MOVE, {
  23606. state: t
  23607. }),
  23608. e = Date.now()
  23609. }
  23610. }
  23611. }();
  23612. i.on(w.Move, s),
  23613. i.on(w.ViewChanged, s),
  23614. n.on(f.ActiveModelChanged, function(e) {
  23615. function t(e) {
  23616. var t, i = e.newPano.id;
  23617. e.oldPano && (t = e.oldPano.id),
  23618. i !== t && o.sendEvent(_.ENTER_PANO, {
  23619. oldPano: t,
  23620. newPano: i
  23621. })
  23622. }
  23623. var i = e.model
  23624. , n = e.oldModel;
  23625. V.model = i,
  23626. a.then(function() {
  23627. o.sendEvent(_.MODEL_LOADED, {
  23628. metadata: l(i)
  23629. })
  23630. }),
  23631. n && n.panos.forEach(function(e) {
  23632. e.removeEventListener("enter", t)
  23633. }),
  23634. i.panos.forEach(function(e) {
  23635. e.on("enter", t)
  23636. })
  23637. })
  23638. }
  23639. };
  23640. var V = {
  23641. director: null,
  23642. player: null,
  23643. controls: null,
  23644. sceneRenderer: null,
  23645. model: null,
  23646. init: function(e, t, i, n) {
  23647. this.director = e,
  23648. this.player = i,
  23649. this.controls = t,
  23650. this.sceneRenderer = n
  23651. },
  23652. handleToObject: {},
  23653. objectToHandle: {},
  23654. handleCount: 0,
  23655. onMessageReceive: function(e) {
  23656. if (e) {
  23657. var t = e.targetFunction
  23658. , i = e.params
  23659. , n = e.onDone;
  23660. t && this[t] && this[t](i, n)
  23661. }
  23662. },
  23663. waitForInit: function(e, t) {
  23664. F.then(t.bind({
  23665. success: !0,
  23666. message: "Init complete."
  23667. }))
  23668. },
  23669. moveToPano: function(e, t) {
  23670. var i = new c.Euler(0,0,0,"YXZ")
  23671. , n = new c.Quaternion;
  23672. return function(e, t) {
  23673. var r = e.pano
  23674. , o = e.rotation
  23675. , a = e.transition;
  23676. if (!this.model)
  23677. return t({
  23678. success: !1,
  23679. error: "The model has not been loaded yet"
  23680. });
  23681. var s = this.model.panos.get(r);
  23682. if (!s)
  23683. return t({
  23684. success: !1,
  23685. error: r + " does not exist in this model"
  23686. });
  23687. if (!o)
  23688. return t({
  23689. sucess: !1,
  23690. erorr: o + " is not a valid rotation"
  23691. });
  23692. i.set(c.Math.degToRad(o.x || 0), c.Math.degToRad(o.y || 0), c.Math.degToRad(o.z || 0), "YXZ"),
  23693. console.log(o.z);
  23694. var l = {
  23695. success: !0,
  23696. message: r
  23697. };
  23698. if (a === A.FADEOUT)
  23699. n.setFromEuler(i),
  23700. this.player.warpToPano(s, n, null, null, b.BLACK, null, null, t.bind(this, l));
  23701. else {
  23702. var h, u;
  23703. a === A.INSTANT && (h = 0,
  23704. u = 0);
  23705. var d = I.FORWARD.clone().applyEuler(i).add(s.position);
  23706. this.player.flyToPano({
  23707. pano: s,
  23708. lookAtPoint: d,
  23709. duration: h,
  23710. aimDuration: u
  23711. }, t.bind(this, l))
  23712. }
  23713. }
  23714. }(),
  23715. moveInDirection: function(e, t) {
  23716. var i = e.direction;
  23717. return "undefined" == typeof v[i] ? (R.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  23718. void (t && t({
  23719. success: !1,
  23720. error: "Invalid direction."
  23721. }))) : void this.player.flyLocalDirection(I[i].clone()).then(function(e) {
  23722. t(e ? {
  23723. success: !0,
  23724. message: "moved " + i
  23725. } : {
  23726. success: !1,
  23727. error: "Cannot move in direction: " + i
  23728. })
  23729. })
  23730. },
  23731. getPose: function(e, t) {
  23732. this.player.camera.position,
  23733. (new c.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ");
  23734. return t({
  23735. success: !0,
  23736. message: B(this.player)
  23737. })
  23738. },
  23739. takeScreenShot: function() {
  23740. var e = new c.PerspectiveCamera
  23741. , t = new c.WebGLRenderTarget;
  23742. return function(i, n) {
  23743. if (!i.resolution)
  23744. return n({
  23745. success: !1,
  23746. error: "An invalid resolution was specified"
  23747. });
  23748. if (i.resolution.width === -1 || i.resolution.height === -1) {
  23749. var r = this.sceneRenderer.renderer.getSize();
  23750. i.resolution.width = r.width,
  23751. i.resolution.height = r.height
  23752. }
  23753. e.layers.set(x.DEFAULT),
  23754. i.visibleObjects && (i.visibleObjects.showtags && e.layers.enable(x.TAG),
  23755. i.visibleObjects.showPucks && e.layers.enable(x.PANOMARKERS),
  23756. i.visibleObjects.showReticule && e.layers.enable(x.RETICULE));
  23757. var o = i.resolution.width
  23758. , a = i.resolution.height
  23759. , s = o / a;
  23760. e.position.copy(this.sceneRenderer.camera.position),
  23761. e.quaternion.copy(this.sceneRenderer.camera.quaternion),
  23762. e.projectionMatrix.copy(this.player.camera.projectionMatrix),
  23763. e.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / s,
  23764. t.setSize(o, a),
  23765. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, e, t);
  23766. var l = new Uint8Array(o * a * 4);
  23767. this.sceneRenderer.renderer.readRenderTargetPixels(t, 0, 0, o, a, l);
  23768. var c = M.encode({
  23769. data: l,
  23770. width: o,
  23771. height: a,
  23772. heading: 180,
  23773. pitch: 0
  23774. }, {
  23775. quality: 75,
  23776. flipY: !0
  23777. })
  23778. , h = "data:image/jpg;base64," + d.uint8ToBase64(c.data);
  23779. n({
  23780. success: !0,
  23781. message: h
  23782. })
  23783. }
  23784. }(),
  23785. findRankedPano: function(e, t) {
  23786. var i = new c.Vector3
  23787. , r = new c.Vector3;
  23788. return function(e, t) {
  23789. s(this.player, r),
  23790. n(t, r, i);
  23791. var o = this.player.rankedPanoInDirection(e, i);
  23792. if (o) {
  23793. var a = this.objectToHandle[o.id];
  23794. return a || (this.objectToHandle[o.id] = a = this.handleCount++,
  23795. this.handleToObject[a] = o),
  23796. a
  23797. }
  23798. return R.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  23799. -1
  23800. }
  23801. }(),
  23802. findRankedtag: function(e, t) {
  23803. var i = new c.Vector3
  23804. , r = new c.Vector3;
  23805. return function(e, t) {
  23806. s(this.player, r),
  23807. n(t, r, i);
  23808. var o = this.player.rankedtagInDirection(e, i);
  23809. if (o) {
  23810. var a = this.objectToHandle[o.sid];
  23811. return a || (this.objectToHandle[o.sid] = a = this.handleCount++,
  23812. this.handleToObject[a] = o),
  23813. a
  23814. }
  23815. return R.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  23816. -1
  23817. }
  23818. }(),
  23819. clickNearesttag: function(e) {
  23820. this.clickRankedtag(0, e)
  23821. },
  23822. clickRankedtag: function(e, t) {
  23823. var i = a.call(this, e, t);
  23824. i && O.call(this, i)
  23825. },
  23826. clickNearestPano: function(e, t) {
  23827. this.clickRankedPano(0, e, t)
  23828. },
  23829. clickRankedPano: function(e, t, i) {
  23830. var n = o.call(this, e, t);
  23831. n ? r.call(this, n, i) : i(null)
  23832. },
  23833. clickPano: function(e, t) {
  23834. var i = this.handleTable[e];
  23835. i ? r.call(this, i, t) : t(null)
  23836. },
  23837. rotateDirection: function() {
  23838. return function(e, t) {
  23839. var i = e.direction
  23840. , n = e.angle;
  23841. if (!P.active) {
  23842. var r = 0
  23843. , o = 0
  23844. , a = 0
  23845. , s = 0;
  23846. if (!n || isNaN(n))
  23847. return R.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  23848. void (t && t({
  23849. success: !1,
  23850. error: "Invalid rotation angle."
  23851. }));
  23852. if (this.player.mode === E.TRANSITIONING)
  23853. return R.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  23854. void (t && t({
  23855. success: !1,
  23856. error: "Cannot rotate while transitioning"
  23857. }));
  23858. if (i === v.RIGHT || i === v.LEFT)
  23859. i === v.RIGHT && (n = -n),
  23860. r = n > 0 ? -1 : 1,
  23861. a = n;
  23862. else {
  23863. if (i !== v.UP && i !== v.DOWN)
  23864. return R.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  23865. void (t && t({
  23866. success: !1,
  23867. error: "Invalid direction for rotation."
  23868. }));
  23869. if (this.player.mode === E.FLOORPLAN)
  23870. return R.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  23871. void (t && t({
  23872. success: !1,
  23873. error: "Cannot rotate " + i + " in floorplan mode"
  23874. }));
  23875. if (i === v.DOWN && (n = -n),
  23876. n = N.call(this, n),
  23877. 0 === n)
  23878. return R.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  23879. void (t && t({
  23880. success: !1,
  23881. error: "Already at maximum rotation in direction: " + i
  23882. }));
  23883. o = n > 0 ? 1 : -1,
  23884. s = n
  23885. }
  23886. var l = n;
  23887. n = c.Math.degToRad(n),
  23888. a = c.Math.degToRad(a),
  23889. s = c.Math.degToRad(s);
  23890. var h = this.controls.activeControl
  23891. , u = function() {
  23892. h.stopRotating(!0),
  23893. t && t({
  23894. success: !0,
  23895. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  23896. })
  23897. };
  23898. h.startRotating(r, o),
  23899. P.start(a, s, this.player, u)
  23900. }
  23901. }
  23902. }(),
  23903. rotate: function() {
  23904. var e = new c.Vector3
  23905. , t = new c.Vector3;
  23906. return function(i, n) {
  23907. var r = i.xAngle
  23908. , o = i.yAngle;
  23909. if (!P.active) {
  23910. if (r = r || 0,
  23911. o = o || 0,
  23912. isNaN(r) || isNaN(o))
  23913. return R.warn("Showcase -> rotate: Invalid rotation angle."),
  23914. void (n && n({
  23915. success: !1,
  23916. error: "Invalid rotation angle."
  23917. }));
  23918. if (this.player.mode === E.TRANSITIONING)
  23919. return R.warn("Automation -> rotate: Cannot rotate while transitioning"),
  23920. void (n && n({
  23921. success: !1,
  23922. error: "Cannot rotate while transitioning"
  23923. }));
  23924. Math.abs(r) < .01 && (r = 0),
  23925. Math.abs(o) < .01 && (o = 0);
  23926. var a = o;
  23927. o = N.call(this, o),
  23928. r = -r;
  23929. var s = a > 0 ? "UP" : "DOWN";
  23930. if (!r && a && !o)
  23931. return R.warn("Showcase -> rotate: Already at maximum rotation in direction: " + s),
  23932. void (n && n({
  23933. success: !1,
  23934. error: "Already at maximum rotation in direction: " + s
  23935. }));
  23936. a > o && R.warn("Showcase -> rotate: Reached maximum rotation in direction: " + s);
  23937. var l = o;
  23938. o = c.Math.degToRad(o),
  23939. r = c.Math.degToRad(r),
  23940. e.copy(this.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  23941. this.player.getDirection(e),
  23942. t.copy(e).applyAxisAngle(I.UP, r),
  23943. t.applyAxisAngle(I.RIGHT, o);
  23944. var h = (e.angleTo(t),
  23945. r > 0 ? -1 : r < 0 ? 1 : 0)
  23946. , u = o > 0 ? 1 : o < 0 ? -1 : 0;
  23947. Math.abs(r) > Math.abs(o) ? u *= Math.abs(o / r) : Math.abs(o) > Math.abs(r) && (h *= Math.abs(r / o));
  23948. var d = this.controls.activeControl
  23949. , p = function() {
  23950. d.stopRotating(!0),
  23951. n && n({
  23952. success: !0,
  23953. message: "Rotated " + i.xAngle.toFixed(2) + "° horizontally, " + l.toFixed(2) + "° vertically"
  23954. })
  23955. };
  23956. d.startRotating(h, u),
  23957. P.start(r, o, this.player, p)
  23958. }
  23959. }
  23960. }(),
  23961. panCamera: function(e, t) {
  23962. function i(e) {
  23963. switch (r.removeAllListeners(T.AutoPanComplete),
  23964. r.removeAllListeners(T.AutoPanInterrupt),
  23965. r.removeAllListeners(T.AutoPanClamped),
  23966. e) {
  23967. case T.AutoPanInterrupt:
  23968. t({
  23969. success: !0,
  23970. message: "Camera panning interrupted."
  23971. });
  23972. break;
  23973. case T.AutoPanClamped:
  23974. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  23975. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  23976. return void t({
  23977. success: !1,
  23978. error: "Already at edge of current model bounds."
  23979. });
  23980. var i = "The view point is outside the bounds for the current model. ";
  23981. i += "The view point was clamped to " + o(r.target.x, r.target.z),
  23982. console.warn(i)
  23983. }
  23984. case T.AutoPanComplete:
  23985. t({
  23986. success: !0,
  23987. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  23988. })
  23989. }
  23990. }
  23991. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.FLOORPLAN)
  23992. return t({
  23993. success: !1,
  23994. error: "Camera panning is not available in the current mode: " + this.player.mode
  23995. });
  23996. var n = e.position
  23997. , r = this.player.control;
  23998. r.setAutoPanPosition(n.x, n.z),
  23999. r.autoPan = !0;
  24000. var o = function(e, t) {
  24001. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  24002. };
  24003. r.on(T.AutoPanComplete, i.bind(this, T.AutoPanComplete)),
  24004. r.on(T.AutoPanInterrupt, i.bind(this, T.AutoPanInterrupt)),
  24005. r.on(T.AutoPanClamped, i.bind(this, T.AutoPanClamped))
  24006. },
  24007. click: function(e, t) {
  24008. var i = e.x
  24009. , n = e.y
  24010. , r = e.percentage;
  24011. r === !0 && (i = i / 100 * $("#player").width(),
  24012. n = n / 100 * $("#player").height()),
  24013. this.player.handleInputStart(i, n),
  24014. this.player.updateIntersect(),
  24015. this.player.handleInputEnd(i, n)
  24016. },
  24017. mouseOver: function(e, t) {
  24018. var i = e.x
  24019. , n = e.y
  24020. , r = e.percentage;
  24021. r === !0 && (i = i / 100 * $("#player").width(),
  24022. n = n / 100 * $("#player").height()),
  24023. this.player.handleInputMove(i, n),
  24024. this.player.updateIntersect()
  24025. },
  24026. moveToMode: function(e, t) {
  24027. function i(e) {
  24028. t(e ? {
  24029. success: !1,
  24030. error: "Failed to load new mode: " + e
  24031. } : {
  24032. success: !0,
  24033. message: "Moved to new mode: " + n
  24034. })
  24035. }
  24036. var n = e.mode;
  24037. n === E.PANORAMA || n === E.DOLLHOUSE || n === E.FLOORPLAN ? this.director.changeMode(n).then(function() {
  24038. i()
  24039. }, function(e) {
  24040. i(e)
  24041. }) : t({
  24042. success: !1,
  24043. error: "Invalid mode selection"
  24044. })
  24045. }
  24046. }
  24047. }
  24048. ).call(this, "/js/sdk/automation.js")
  24049. }
  24050. , {
  24051. "../constants": 8,
  24052. "../enum/AlignmentType": 17,
  24053. "../enum/ControlEvents": 21,
  24054. "../enum/Direction": 22,
  24055. "../enum/GLCubeFaces": 25,
  24056. "../enum/Keys": 30,
  24057. "../enum/ModelManagerEvents": 33,
  24058. "../enum/PlayerEvents": 40,
  24059. "../enum/RenderLayers": 41,
  24060. "../enum/Vectors": 50,
  24061. "../enum/Viewmode": 51,
  24062. "../enum/WarpStyle": 52,
  24063. "../lib/jpeg_encoder": 94,
  24064. "../sdk/SdkEvents": 161,
  24065. "../settings": 166,
  24066. "../util/common": 185,
  24067. "../util/logger": 189,
  24068. "../util/math": 190,
  24069. "../util/panorama": 191,
  24070. "./ApiHost": 159,
  24071. "./PostMessageType": 160,
  24072. "./TransitionStyles": 162,
  24073. three: 217
  24074. }],
  24075. 165: [function(e, t, i) {
  24076. "use strict";
  24077. function n(e) {
  24078. this.sourceWindow = e,
  24079. this.targetWindow = null,
  24080. this.targetOrigin = null,
  24081. this.id = Math.floor(1e5 * Math.random()),
  24082. this.bindEvents()
  24083. }
  24084. var r = e("./PostMessageType")
  24085. , o = e("events").EventEmitter;
  24086. n.prototype = Object.create(o.prototype),
  24087. n.prototype.bindEvents = function() {
  24088. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  24089. }
  24090. ,
  24091. n.prototype.setTarget = function(e, t) {
  24092. this.targetWindow = e,
  24093. this.targetOrigin = t
  24094. }
  24095. ,
  24096. n.prototype.onPostmessageReceived = function(e) {
  24097. var t = e.origin || e.originalEvent.origin
  24098. , i = e.source;
  24099. switch (e.data.type) {
  24100. case r.CONNECT:
  24101. break;
  24102. case r.RESPONSE:
  24103. if (this.id !== e.data.toId)
  24104. return;
  24105. default:
  24106. if (!this.validateMessageOrigin(t))
  24107. return
  24108. }
  24109. var n = e.data;
  24110. n.source = i,
  24111. n.origin = t,
  24112. n.timestamp = Date.now(),
  24113. this.emit(e.data.type, n)
  24114. }
  24115. ,
  24116. n.prototype.validateMessageOrigin = function(e) {
  24117. return "*" === this.targetOrigin || e === this.targetOrigin
  24118. }
  24119. ,
  24120. n.prototype.send = function(e) {
  24121. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  24122. this.targetWindow.postMessage(e, this.targetOrigin))
  24123. }
  24124. ,
  24125. t.exports = n
  24126. }
  24127. , {
  24128. "./PostMessageType": 160,
  24129. events: 202
  24130. }],
  24131. 166: [function(e, t, i) {
  24132. "use strict";
  24133. var n = e("three")
  24134. , r = e("./util/browser")
  24135. , o = e("./enum/Viewmode")
  24136. , a = e("./enum/VROption")
  24137. , s = e("./enum/Colors")
  24138. , l = e("./enum/WarpStyle")
  24139. , c = e("./util/easing")
  24140. , h = e("./util/common")
  24141. , u = e("./util/showcase")
  24142. , d = e("./constants")
  24143. , p = {
  24144. debug: !1,
  24145. version: "2.25.6-0-gd87e5b1",
  24146. languageTag: r.valueFromHash("lang", null),
  24147. pageTitle: "四维虚拟漫游",
  24148. authorizationHeader: u.getAuthorizationHeader(),
  24149. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  24150. logLevel: r.valueFromHash("log", 2),
  24151. skyboxRadius: 2500,
  24152. modelBoundsPadding: 5,
  24153. showNeighbors: !1,
  24154. brand: r.valueFromHash("brand", !0),
  24155. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  24156. startHighlights: r.valueFromHash("hl", -1),
  24157. specialEdition: r.valueFromHash("bn", 0),
  24158. useWheel: r.valueFromHash("wh", !0),
  24159. crossOrigin: "anonymous",
  24160. fancierTransition: !1,
  24161. wireframe: !1,
  24162. skyboxWireframe: !1,
  24163. modelAlpha: 1,
  24164. highlightPanoSelection: !1,
  24165. showSweeps: !0,
  24166. showSkyboxes: !1,
  24167. showMesh: !0,
  24168. showFloors: !1,
  24169. showFloorDuration: 300,
  24170. showFloorDelay: 300,
  24171. hideFloorDuration: 300,
  24172. hideFloorDelay: 0,
  24173. reticuleOpacityTransitionTime: 250,
  24174. reticuleColor: s.newBlue,
  24175. markerOpacityTransitionTime: 500,
  24176. guiAnimationSpeed: 250,
  24177. highlightAnimationDuration: 500,
  24178. modelComponentLoadSpinnerDelay: 150,
  24179. captureErrors: !1,
  24180. maxMobileTextures: 6,
  24181. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  24182. startupFlyinDelay: 3e3,
  24183. dollhouseDefault: {
  24184. minDistance: 15,
  24185. maxDistance: 50,
  24186. minPolarAngle: n.Math.degToRad(10),
  24187. maxPolarAngle: n.Math.degToRad(90)
  24188. },
  24189. hideReticuleTimeout: 1e3,
  24190. analytics: {
  24191. inactivityThreshold: 30,
  24192. sessionTrackingRate: .15,
  24193. maxTrackedErrors: 20,
  24194. sessionDurationPingFrequency: 10,
  24195. sessionDurationTimeout: 15
  24196. },
  24197. flydown: {
  24198. movementEasing: "easeInOutQuad",
  24199. movementDelay: .001,
  24200. rotationEasing: "easeInOutQuad",
  24201. rotationDelay: .5,
  24202. modelTextureDelay: .75,
  24203. skyboxDelay: .75
  24204. },
  24205. transition: {
  24206. flySpeed: .01,
  24207. flyTime: 750,
  24208. flytimeMaxDistanceThreshold: 5,
  24209. flytimeDistanceMultiplier: 150,
  24210. aimTime: 1500,
  24211. aimSlowFactor: 1.5,
  24212. blur: .8,
  24213. movementEasing: "easeInOutQuad",
  24214. blendEasing: "easeInOutQuad",
  24215. fastForwardFactor: r.valueFromHash("mfis", 3)
  24216. },
  24217. show360Views: {
  24218. enabled: !0,
  24219. transitionTime: 1e3
  24220. },
  24221. quickstart: {
  24222. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  24223. animation: 1400,
  24224. showTextDelay: 500,
  24225. fadeOutDelay: 3e3,
  24226. fovChange: 10
  24227. },
  24228. appConfig: {
  24229. webvr_version: null,
  24230. segment_key: null,
  24231. embedly_key: null,
  24232. branch_key: null,
  24233. keen_write_key: null,
  24234. keen_project_id: null
  24235. },
  24236. vr: {
  24237. enabled: !0,
  24238. allowWebVR: !1,
  24239. option: r.valueFromHash("vr", a.CONTEXTUAL)
  24240. },
  24241. share: {
  24242. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  24243. },
  24244. input: {
  24245. longTapThreshold: 200,
  24246. moveToleranceNDC: .08,
  24247. touchMoveThreshold: 25
  24248. },
  24249. help: {
  24250. modalStayDuration: 600
  24251. },
  24252. immersive: {
  24253. timeToShowAgain: 1250,
  24254. uiStayDuration: 600
  24255. },
  24256. tourInteraction: {
  24257. disabled: "0" === r.valueFromHash("tourcta", null),
  24258. showPauseButton: 1e3,
  24259. showModal: 1500,
  24260. allowNextClick: 200,
  24261. largeModal: "1" === r.valueFromHash("tourcta", null),
  24262. smallModal: "2" === r.valueFromHash("tourcta", null)
  24263. },
  24264. labels: {
  24265. enabled: !1,
  24266. hideUntilStart: !0,
  24267. fadeInDuration: 250,
  24268. fadeInDelay: 250,
  24269. fadeOutDuration: 250,
  24270. fadeOutDelay: 0,
  24271. zoomHideThreshhold: {
  24272. mobile: r.isSmallScreen() ? .45 : .6,
  24273. desktop: 2
  24274. },
  24275. zoomTruncateThreshhold: {
  24276. mobile: r.isSmallScreen() ? .35 : .45,
  24277. desktop: .85
  24278. },
  24279. minLengthForTruncate: 16,
  24280. truncateLength: 12,
  24281. truncateSuffix: "..."
  24282. },
  24283. tags: {
  24284. enabled: r.valueFromHash("mt", 1),
  24285. startup: {
  24286. hideUntilStart: !0,
  24287. fadeInDuration: 500,
  24288. fadeInDelay: 100
  24289. },
  24290. visibility: {
  24291. anyDistance: !0,
  24292. visibleDistance: 8,
  24293. cameraClearance: .1,
  24294. alphaTestLevel: .05,
  24295. hideViaFloor: !0,
  24296. hideOffScreenDisc: !1,
  24297. hideOffScreenObject: !1
  24298. },
  24299. disc: {
  24300. opacity: 1,
  24301. disabledOpacity: .5,
  24302. scale: {
  24303. nearBound: 1.5,
  24304. farBound: 4.8,
  24305. linkFarBound: !1,
  24306. linkPercent: 40,
  24307. maxSize: 80,
  24308. minSize: 40,
  24309. baseViewportSize: 800,
  24310. responsiveness: 100
  24311. }
  24312. },
  24313. pole: {
  24314. enabled: !0,
  24315. height: .5,
  24316. width: 2,
  24317. opacity: .5,
  24318. color: "white"
  24319. },
  24320. navigate: {
  24321. nearestPano: !0,
  24322. lineOfSight: !0,
  24323. reactivate: !0,
  24324. aimAt: "disc",
  24325. tiltTolerance: 25,
  24326. rotateSpeedFactor: .6
  24327. }
  24328. },
  24329. path: {
  24330. color: s.newBlue,
  24331. colorUp: s._desat(s.newBlue, .5),
  24332. colorDown: s._darken(s.newBlue, .35),
  24333. opacity: .5,
  24334. style: "ribbon",
  24335. height: .025,
  24336. ribbonWidth: .24,
  24337. outsideHeight: .5,
  24338. waypointRadius: .5,
  24339. waypointIndoorRadius: .24,
  24340. waypointPulse: 1e3,
  24341. typ: l.BLACK,
  24342. meshFree: r.valueFromHash("mf", 1),
  24343. mapGuides: r.valueFromHash("guides", !0),
  24344. fadeInTime: 400,
  24345. fadeOutTime: 300
  24346. },
  24347. warp: {
  24348. nearPanoDist: .1,
  24349. matchCam: !1,
  24350. blur: .33,
  24351. fastTime: 1500,
  24352. teleportTime: 1500,
  24353. outsideTime: 2e3,
  24354. lookAheadMax: .3,
  24355. lookAheadDist: 2.5,
  24356. softPushDist: .37,
  24357. softPushEnd: .3,
  24358. softBendAngle: 8,
  24359. softBendTilt: 4,
  24360. softBendEnd: .3,
  24361. doBurns: r.valueFromHash("kb", !0),
  24362. burnsAngle: 35,
  24363. minBurnsAngle: 35,
  24364. minDownAngle: -35,
  24365. maxTurnPerSec: 280,
  24366. maxAimPerSec: 35,
  24367. minRotation: 12,
  24368. maxAimRotation: 33.2,
  24369. turnFriction: .2,
  24370. flySpeed: .01,
  24371. minWarpTime: 1200,
  24372. warpInterruptionRedirectTime: 500,
  24373. tourStepDelay: r.valueFromHash("st", 0),
  24374. walkDelay: 0,
  24375. walkMaxDist: 50,
  24376. walkMinDist: .8,
  24377. walkSlideShowThreshhold: 3e3,
  24378. walkExtraPanosDistance: .4,
  24379. timePerMeter: 800,
  24380. motionLeadTime: 500,
  24381. movementEasing: "easeInOutQuad",
  24382. blendEasing: "easeInOutQuad",
  24383. showBunny: !1,
  24384. loop: r.valueFromHash("lp", !1),
  24385. auto: r.valueFromHash("ts", -1),
  24386. eOrder: "YXZ",
  24387. stepFactor: .25,
  24388. brakeStrength: 2,
  24389. minBrakeAngle: .1,
  24390. maxBrakeAngle: 1.8,
  24391. climbEffort: 4
  24392. },
  24393. rotationFriction: .05,
  24394. rotationAccelerationInside: 4.5,
  24395. rotationAccelerationOutside: .15,
  24396. rotationAfterMoveMultiplier: 40,
  24397. rotationAfterMoveHistoryCount: 5,
  24398. panFriction: .09,
  24399. panAccelerationOutside: 60,
  24400. onload: r.valueFromHash("onload", o.PANORAMA),
  24401. zoomNearLimit: .1,
  24402. zoomFarLimit: 10,
  24403. navigation: {
  24404. panoScores: !1,
  24405. mouseDirection: !0,
  24406. filterStrictness: .75,
  24407. angleFactor: -30,
  24408. directionFactor: 10,
  24409. distanceFactor: -1,
  24410. optionalityFactor: 3
  24411. },
  24412. sdkInit: !1,
  24413. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  24414. console: r.valueFromHash("console", !1),
  24415. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  24416. panoramaNeighbourMaxDistance: 5,
  24417. panoFloorClickRadius: .35,
  24418. showScreenshotLocations: !1,
  24419. showAxis: !1,
  24420. showNeighbourRaycasts: !1,
  24421. colorMarkerOnLoad: !1,
  24422. colorMarkerByFloor: !1,
  24423. tiling: {
  24424. panoPreRenderRepeatDelay: 2500,
  24425. panoPreRenderDelay: 500,
  24426. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  24427. tilingFlagNames: ["usetiles", "tiles"],
  24428. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  24429. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  24430. overlayStyle: r.valueFromHash("tileoverlay", 0),
  24431. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  24432. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  24433. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  24434. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  24435. customCompression: r.valueFromHash("tilecustcomp", 0),
  24436. mobileHighQualityOverride: !1,
  24437. allowUltraHighResolution: !1
  24438. },
  24439. zoom: {
  24440. enabled: !1,
  24441. forceOff: r.valueFromHash("nozoom", 0),
  24442. overridemax: r.valueFromHash("maxzoom", null),
  24443. overridemin: r.valueFromHash("minzoom", null),
  24444. max: d.highQualityMaxZoom,
  24445. min: 1,
  24446. transitionStyle: r.valueFromHash("zoomtrans", 1),
  24447. activationThreshold: 1.1,
  24448. restoreTime: 500
  24449. },
  24450. profiling: {
  24451. enabled: r.valueFromHash("mem", !1)
  24452. }
  24453. };
  24454. p = h.deepExtend(p, d, {
  24455. insideFOV: r.valueFromHash("fov", d.insideFOV),
  24456. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  24457. panorama: {
  24458. transitionTime: 1e3,
  24459. modelAlpha: 0,
  24460. modelAlphaDelay: p.flydown.modelTextureDelay,
  24461. modelAlphaLength: 1,
  24462. skyboxOpacity: 1,
  24463. skyboxOpacityDelay: p.flydown.skyboxDelay,
  24464. skyboxOpacityLength: .9,
  24465. fovLength: 1,
  24466. fovDelay: 0,
  24467. cameraMatrixDuration: .8,
  24468. cameraMatrixDelay: 0,
  24469. cameraMatrixEase: c.easeInCubic,
  24470. reticuleOpacity: 1,
  24471. markerOpacity: .3,
  24472. markerOpacityOnHover: 1
  24473. },
  24474. dollhouse: {
  24475. transitionTime: 1e3,
  24476. modelAlpha: 1,
  24477. modelAlphaDelay: 0,
  24478. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24479. skyboxOpacity: 0,
  24480. skyboxOpacityDelay: 0,
  24481. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24482. fovLength: 1,
  24483. fovDelay: 0,
  24484. cameraMatrixDuration: .8,
  24485. cameraMatrixDelay: .3,
  24486. cameraMatrixEase: c.easeInCubic,
  24487. reticuleOpacity: 1,
  24488. markerOpacity: 0,
  24489. markerOpacityOnHover: 0
  24490. },
  24491. floorplan: {
  24492. transitionTime: 1e3,
  24493. modelAlpha: 1,
  24494. modelAlphaDelay: 0,
  24495. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24496. skyboxOpacity: 0,
  24497. skyboxOpacityDelay: 0,
  24498. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24499. fovLength: 1,
  24500. fovDelay: 0,
  24501. cameraMatrixDuration: .5,
  24502. cameraMatrixDelay: 0,
  24503. cameraMatrixEase: c.easeOutCubic,
  24504. reticuleOpacity: 1,
  24505. markerOpacity: 0,
  24506. markerOpacityOnHover: 0,
  24507. cameraHeight: 50
  24508. },
  24509. transitioning: {
  24510. reticuleOpacity: 0,
  24511. markerOpacity: .3,
  24512. markerOpacityOnHover: 1
  24513. },
  24514. "floorplan-dollhouse": {
  24515. rotationDelay: 0,
  24516. rotationDuration: 1
  24517. },
  24518. "floorplan-panorama": {
  24519. rotationDelay: .5,
  24520. rotationDuration: 1
  24521. },
  24522. "dollhouse-panorama": {
  24523. rotationDelay: .5,
  24524. rotationDuration: 1
  24525. },
  24526. "dollhouse-floorplan": {
  24527. rotationDelay: 0,
  24528. rotationDuration: 1,
  24529. cameraMatrixDuration: 1.05,
  24530. cameraMatrixDelay: .5
  24531. },
  24532. "panorama-dollhouse": {
  24533. rotationDelay: 0,
  24534. rotationDuration: .5
  24535. },
  24536. "panorama-floorplan": {
  24537. transitionTime: 1500,
  24538. rotationDelay: 0,
  24539. rotationDuration: .5
  24540. }
  24541. }),
  24542. p.path.meshFree && (p.path.typ = l.WALK),
  24543. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  24544. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  24545. t.exports = p
  24546. }
  24547. , {
  24548. "./constants": 8,
  24549. "./enum/Colors": 19,
  24550. "./enum/VROption": 47,
  24551. "./enum/Viewmode": 51,
  24552. "./enum/WarpStyle": 52,
  24553. "./util/browser": 182,
  24554. "./util/common": 185,
  24555. "./util/easing": 186,
  24556. "./util/showcase": 193,
  24557. three: 217
  24558. }],
  24559. 167: [function(e, t, i) {
  24560. "use strict";
  24561. var n = e("three")
  24562. , r = e("./settings")
  24563. , 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"
  24564. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  24565. t.exports = {
  24566. basicTextured: {
  24567. uniforms: {
  24568. tDiffuse: {
  24569. type: "t",
  24570. value: null
  24571. },
  24572. alpha: {
  24573. type: "f",
  24574. value: 1
  24575. }
  24576. },
  24577. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24578. 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}"
  24579. },
  24580. copyCubeMap: {
  24581. uniforms: {
  24582. tDiffuse: {
  24583. type: "t",
  24584. value: null
  24585. },
  24586. alpha: {
  24587. type: "f",
  24588. value: 1
  24589. }
  24590. },
  24591. 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}",
  24592. 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}"
  24593. },
  24594. cube: {
  24595. uniforms: {
  24596. map: {
  24597. type: "t",
  24598. value: null
  24599. },
  24600. opacity: {
  24601. type: "f",
  24602. value: 1
  24603. }
  24604. },
  24605. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  24606. 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"
  24607. },
  24608. model: {
  24609. uniforms: {
  24610. map: {
  24611. type: "t",
  24612. value: null
  24613. },
  24614. modelAlpha: {
  24615. type: "f",
  24616. value: r.modelAlpha
  24617. },
  24618. opacity: {
  24619. type: "f",
  24620. value: 1
  24621. },
  24622. progress: {
  24623. type: "f",
  24624. value: 0
  24625. },
  24626. blackout: {
  24627. type: "i",
  24628. value: 0
  24629. },
  24630. pano0Map: {
  24631. type: "t",
  24632. value: null
  24633. },
  24634. pano0Position: {
  24635. type: "v3",
  24636. value: new n.Vector3
  24637. },
  24638. pano0Matrix: {
  24639. type: "m4",
  24640. value: new n.Matrix4
  24641. },
  24642. pano1Map: {
  24643. type: "t",
  24644. value: null
  24645. },
  24646. pano1Position: {
  24647. type: "v3",
  24648. value: new n.Vector3
  24649. },
  24650. pano1Matrix: {
  24651. type: "m4",
  24652. value: new n.Matrix4
  24653. }
  24654. },
  24655. 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",
  24656. 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"
  24657. },
  24658. hot:{
  24659. uniforms:{
  24660. color:{
  24661. type: "c",
  24662. value: new n.Color( 0xff2200 )
  24663. },
  24664. opac:{
  24665. type: "f",
  24666. value: 0
  24667. },
  24668. texture1:{
  24669. type: "t",
  24670. value: null
  24671. },
  24672. texture2:{
  24673. type: "t",
  24674. value: null
  24675. }
  24676. },
  24677. vertexShader:"varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24678. 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 = tcolor1+ vec4(opac)*tcolor2;}\n"
  24679. },
  24680. modelOutside: {
  24681. uniforms: {
  24682. map: {
  24683. type: "t",
  24684. value: null
  24685. },
  24686. opacity: {
  24687. type: "f",
  24688. value: 1
  24689. }
  24690. },
  24691. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24692. 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"
  24693. },
  24694. ribbon: {
  24695. uniforms: {
  24696. map: {
  24697. type: "t",
  24698. value: null
  24699. },
  24700. opacity: {
  24701. type: "f",
  24702. value: 1
  24703. },
  24704. color: {
  24705. type: "c",
  24706. value: new n.Color(r.path.color)
  24707. }
  24708. },
  24709. 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",
  24710. 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"
  24711. },
  24712. waypoint: {
  24713. uniforms: {
  24714. map: {
  24715. type: "t",
  24716. value: null
  24717. },
  24718. opacity: {
  24719. type: "f",
  24720. value: 1
  24721. },
  24722. pulse: {
  24723. type: "f",
  24724. value: 1
  24725. },
  24726. nearFade: {
  24727. type: "v2",
  24728. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  24729. },
  24730. color: {
  24731. type: "c",
  24732. value: new n.Color(r.reticuleColor)
  24733. }
  24734. },
  24735. 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",
  24736. 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"
  24737. },
  24738. modelDebug: {
  24739. uniforms: {
  24740. map: {
  24741. type: "t",
  24742. value: null
  24743. },
  24744. modelAlpha: {
  24745. type: "f",
  24746. value: r.modelAlpha
  24747. },
  24748. depthmapRatio: {
  24749. type: "f",
  24750. value: 0
  24751. },
  24752. opacity: {
  24753. type: "f",
  24754. value: 1
  24755. },
  24756. progress: {
  24757. type: "f",
  24758. value: 0
  24759. },
  24760. considerOcclusion: {
  24761. type: "i",
  24762. value: r.fancierTransition
  24763. },
  24764. highlightPanoSelection: {
  24765. type: "i",
  24766. value: 0
  24767. },
  24768. useThirdPano: {
  24769. type: "i",
  24770. value: r.useThirdPano
  24771. },
  24772. pano0Map: {
  24773. type: "t",
  24774. value: null
  24775. },
  24776. pano0Depth: {
  24777. type: "t",
  24778. value: null
  24779. },
  24780. pano0Position: {
  24781. type: "v3",
  24782. value: new n.Vector3
  24783. },
  24784. pano0Matrix: {
  24785. type: "m4",
  24786. value: new n.Matrix4
  24787. },
  24788. pano0Weight: {
  24789. type: "f",
  24790. value: r.transition.pano0Weight
  24791. },
  24792. pano1Map: {
  24793. type: "t",
  24794. value: null
  24795. },
  24796. pano1Depth: {
  24797. type: "t",
  24798. value: null
  24799. },
  24800. pano1Position: {
  24801. type: "v3",
  24802. value: new n.Vector3
  24803. },
  24804. pano1Matrix: {
  24805. type: "m4",
  24806. value: new n.Matrix4
  24807. },
  24808. pano1Weight: {
  24809. type: "f",
  24810. value: r.transition.pano1Weight
  24811. },
  24812. pano2Map: {
  24813. type: "t",
  24814. value: null
  24815. },
  24816. pano2Depth: {
  24817. type: "t",
  24818. value: null
  24819. },
  24820. pano2Position: {
  24821. type: "v3",
  24822. value: new n.Vector3
  24823. },
  24824. pano2Matrix: {
  24825. type: "m4",
  24826. value: new n.Matrix4
  24827. },
  24828. pano2Weight: {
  24829. type: "f",
  24830. value: r.transition.pano2Weight
  24831. }
  24832. },
  24833. 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",
  24834. 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"
  24835. },
  24836. customDepth: {
  24837. uniforms: {
  24838. panoPosition: {
  24839. type: "v3",
  24840. value: new n.Vector3
  24841. }
  24842. },
  24843. 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",
  24844. 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"
  24845. },
  24846. skysphere: {
  24847. uniforms: {
  24848. radius: {
  24849. type: "f",
  24850. value: 0
  24851. }
  24852. },
  24853. 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",
  24854. 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"
  24855. },
  24856. tagDisc: {
  24857. uniforms: {
  24858. opacity: {
  24859. type: "f",
  24860. value: 0
  24861. },
  24862. color: {
  24863. type: "c",
  24864. value: new n.Color
  24865. },
  24866. bg: {
  24867. type: "t",
  24868. value: null
  24869. },
  24870. mask: {
  24871. type: "t",
  24872. value: null
  24873. }
  24874. },
  24875. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24876. 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"
  24877. }
  24878. }
  24879. }
  24880. , {
  24881. "./settings": 166,
  24882. three: 217
  24883. }],
  24884. 168: [function(e, t, i) {
  24885. (function(i) {
  24886. "use strict";
  24887. var n = e("three")
  24888. , r = (e("url"),
  24889. e("./util/ajax"))
  24890. , o = e("./settings")
  24891. , a = e("./util/logger")
  24892. , s = e("./util/math")
  24893. , l = e("./util/showcase")
  24894. , c = e("./objects/Panorama")
  24895. , h = new a(i)
  24896. , u = e("./model/Model")
  24897. , d = e("./shaders")
  24898. , p = e("./util/transitions")
  24899. , f = e("./objects/Chunk")
  24900. , g = e("./objects/Reticule")
  24901. , m = e("./objects/Skybox")
  24902. , v = e("./objects/Floor")
  24903. , A = e("./cameras/DollhouseCamera")
  24904. , y = e("./cameras/FloorplanCamera")
  24905. , C = e("./cameras/PanoramaCamera")
  24906. , I = e("./controls/DollhouseControls")
  24907. , E = e("./controls/FloorplanControls")
  24908. , b = e("./controls/PanoramaControls");
  24909. n.ImageUtils.crossOrigin = o.crossOrigin,
  24910. t.exports = {
  24911. shaders: d,
  24912. transitions: p,
  24913. Model: u,
  24914. Chunk: f,
  24915. Floor: v,
  24916. Skybox: m,
  24917. Reticule: g,
  24918. Panorama: c,
  24919. DollhouseCamera: A,
  24920. FloorplanCamera: y,
  24921. PanoramaCamera: C,
  24922. DollhouseControls: I,
  24923. FloorplanControls: E,
  24924. PanoramaControls: b,
  24925. getModel: function(e) {
  24926. if (!e.url)
  24927. throw 'getModel(): missing parameter "url"';
  24928. e.autoload = void 0 === e.autoload || e.autoload;
  24929. var t = l.parseSidUrl(e.url);
  24930. e.urlBase = t.urlBase,
  24931. e.urlModel = t.urlModel,
  24932. e.urlFiles = t.urlFiles;
  24933. var i = this._getPlatformError();
  24934. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  24935. this._loadModel().then(this._buildModel.bind(this)))
  24936. },
  24937. _getPlatformError: function() {
  24938. 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"
  24939. },
  24940. _loadModel: function() {
  24941. return r.get(this.options.urlModel, {
  24942. responseType: "json",
  24943. prefetchFrom: "model",
  24944. auth: l.getAuthorizationHeader()
  24945. }).then(null, function() {
  24946. return h.warn("Model loading failed at initial metadata load"),
  24947. "loading-failed"
  24948. })
  24949. },
  24950. _buildModel: function(e) {
  24951. e = l.normalizeModeldata(e, s);
  24952. var t = new u(this.options,e);
  24953. return this.options.autoload ? t.load(!0) : $.when(t)
  24954. }
  24955. }
  24956. }
  24957. ).call(this, "/js/showcase.js")
  24958. }
  24959. , {
  24960. "./cameras/DollhouseCamera": 5,
  24961. "./cameras/FloorplanCamera": 6,
  24962. "./cameras/PanoramaCamera": 7,
  24963. "./controls/DollhouseControls": 10,
  24964. "./controls/FloorplanControls": 11,
  24965. "./controls/PanoramaControls": 13,
  24966. "./model/Model": 139,
  24967. "./objects/Chunk": 144,
  24968. "./objects/Floor": 146,
  24969. "./objects/Panorama": 148,
  24970. "./objects/Reticule": 149,
  24971. "./objects/Skybox": 152,
  24972. "./settings": 166,
  24973. "./shaders": 167,
  24974. "./util/ajax": 181,
  24975. "./util/logger": 189,
  24976. "./util/math": 190,
  24977. "./util/showcase": 193,
  24978. "./util/transitions": 195,
  24979. three: 217,
  24980. url: 208
  24981. }],
  24982. 169: [function(e, t, i) {
  24983. "use strict";
  24984. function n() {
  24985. var e = {
  24986. renderTarget: null,
  24987. inUse: !1,
  24988. size: -1,
  24989. pano: null
  24990. };
  24991. return e
  24992. }
  24993. function r(e) {
  24994. M.push(e)
  24995. }
  24996. function o(e) {
  24997. var t = n();
  24998. return t.inUse = !0,
  24999. t.size = e,
  25000. r(t),
  25001. t
  25002. }
  25003. function a(e) {
  25004. for (var t = 0; t < M.length; t++) {
  25005. var i = M[t];
  25006. if (!i.inUse && i.size === e)
  25007. return i.inUse = !0,
  25008. i
  25009. }
  25010. return null
  25011. }
  25012. function s(e) {
  25013. for (var t = 0; t < M.length; t++) {
  25014. var i = M[t];
  25015. if (i.renderTarget === e)
  25016. return i.inUse = !1,
  25017. !0
  25018. }
  25019. return !1
  25020. }
  25021. function l() {
  25022. this.tileDirectory = {},
  25023. this.activeRenderTargetDescriptors = {},
  25024. this.activePanos = [],
  25025. this.panoLODDescriptors = {},
  25026. this.panoDescriptors = {},
  25027. this.tileTrees = {},
  25028. this.sceneRenderer = null,
  25029. this.tileDownloader = null,
  25030. this.forceQueue = [],
  25031. this.uploadQueues = {},
  25032. this.uploadInterval = null,
  25033. this.uploadIntervalCancelled = !1,
  25034. this.usingTileOverlay = !1,
  25035. this.overlayTilesLoaded = !1,
  25036. this.overlayTileBase = null,
  25037. this.overlayTilesBasic = {},
  25038. this.overlayTilesEnhanced = {},
  25039. this.zoomRenderTarget = null,
  25040. this.zoomPano = null,
  25041. this.zoomingActive = !1,
  25042. this.zoomPanoId = null,
  25043. this.zoomPanoRenderingDisabled = !1,
  25044. this.direction = new h.Vector3,
  25045. this.initTime = -1,
  25046. this.maxBaseUploadsPerFrame = x,
  25047. this.maxNonBaseUploadsPerFrame = T
  25048. }
  25049. function c() {
  25050. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  25051. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25052. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  25053. }
  25054. var h = e("three")
  25055. , u = e("../exception/BasicException")
  25056. , d = e("../settings")
  25057. , p = e("../enum/PanoSizeClass")
  25058. , f = (e("../objects/Panorama"),
  25059. e("../enum/PanoRendererEvents"))
  25060. , g = e("../enum/SceneRendererEvents")
  25061. , m = e("../enum/TileDownloaderEvents")
  25062. , v = e("../enum/Vectors")
  25063. , A = (e("../enum/GLCubeFaces"),
  25064. e("../objects/Panorama"),
  25065. e("./TileTree"))
  25066. , y = (e("./TileDownloader"),
  25067. e("./TilePrioritizer"))
  25068. , C = e("./TileUtils")
  25069. , p = e("../enum/PanoSizeClass")
  25070. , I = (e("../util/browser"),
  25071. e("../util/panorama"))
  25072. , E = e("events").EventEmitter
  25073. , b = !1
  25074. , w = d.tiling.uploadIntervalDelay
  25075. , _ = d.tiling.initialIntervalDelay
  25076. , T = d.tiling.maxNonBaseUploadsPerFrame
  25077. , x = d.tiling.maxBaseUploadsPerFrame
  25078. , S = {
  25079. Base: 0,
  25080. Remaining: 1
  25081. }
  25082. , M = [];
  25083. l.prototype = Object.create(E.prototype),
  25084. l.prototype.init = function(e, t, i) {
  25085. this.sceneRenderer = e,
  25086. this.tileDownloader = t,
  25087. this.qualityManager = i,
  25088. this.bindEvents(),
  25089. this.sceneRenderer.on(g.ContextCreated, this.loadOverlayTiles.bind(this)),
  25090. this.initTime = performance.now()
  25091. }
  25092. ,
  25093. l.prototype.getActivePanoTextures = function(e) {
  25094. e = e || [];
  25095. for (var t = 0; t < M.length; t++) {
  25096. var i = M[t];
  25097. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  25098. }
  25099. }
  25100. ,
  25101. l.prototype.hasQueuedTiles = function() {
  25102. var e = this.peekNextFromUploadQueue();
  25103. return null !== e && void 0 !== e
  25104. }
  25105. ,
  25106. l.prototype.getActiveRenderTargetDescriptor = function(e) {
  25107. return this.activeRenderTargetDescriptors[e]
  25108. }
  25109. ,
  25110. l.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  25111. this.activeRenderTargetDescriptors[e] = t
  25112. }
  25113. ,
  25114. l.prototype.loadOverlayTiles = function() {
  25115. if (0 !== d.tiling.overlayStyle) {
  25116. var e = 0
  25117. , t = function(t, n, r) {
  25118. t = n ? t[n] = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping),
  25119. this.sceneRenderer.uploadTexture2D(r, t, 0, 0, C.TILE_SIZE, C.TILE_SIZE),
  25120. e++,
  25121. e === i.length && (this.overlayTilesLoaded = !0)
  25122. }
  25123. .bind(this)
  25124. , 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)]];
  25125. i.forEach(function(e) {
  25126. this.tileDownloader.loadImage(e[0], 0, e[1])
  25127. }
  25128. .bind(this)),
  25129. this.usingTileOverlay = !0
  25130. } else
  25131. this.usingTileOverlay = !1
  25132. }
  25133. ,
  25134. l.prototype.bindEvents = function() {
  25135. this.tileDownloader.on(m.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  25136. }
  25137. ,
  25138. l.prototype.setupZoomRenderTarget = function() {
  25139. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  25140. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  25141. return;
  25142. var e = this.zoomRenderTarget;
  25143. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  25144. e) {
  25145. var t = e.width
  25146. , i = this.zoomRenderTarget.width;
  25147. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  25148. e.texture.dispose(),
  25149. e.texture.loaded = !1,
  25150. e.texture.version = 0,
  25151. this.sceneRenderer.deallocateCubeTexture(e.texture),
  25152. e.texture = null
  25153. }
  25154. this.zoomPanoRenderingDisabled = !1
  25155. } else
  25156. this.zoomPanoRenderingDisabled = !0
  25157. }
  25158. ,
  25159. l.prototype.enableUltraHighQualityMode = function(e) {
  25160. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  25161. var t = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  25162. this.tileDownloader.testDownload(t, C.TILE_SIZE, function(t) {
  25163. t && (this.qualityManager.enableUltraHighQualityMode(),
  25164. this.setupZoomRenderTarget(),
  25165. e())
  25166. }
  25167. .bind(this))
  25168. }
  25169. }
  25170. ,
  25171. l.prototype.activateTiledPano = function(e, t, i) {
  25172. i && this.clearAllQueuedUploads();
  25173. for (var n = 0; n < C.FACES_PER_PANO; n++)
  25174. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  25175. this.linkAllTilesAndNodes(e);
  25176. var r = this.getActiveRenderTargetDescriptor(e.id)
  25177. , l = t;
  25178. if (l > this.qualityManager.getMaxNavPanoSize() && (l = this.qualityManager.getMaxNavPanoSize()),
  25179. !r || l !== r.size) {
  25180. if (r && s(r.renderTarget),
  25181. r = a(l),
  25182. !r) {
  25183. var c = this.initTiledPano(l, !1);
  25184. r = o(c.width),
  25185. r.renderTarget = c
  25186. }
  25187. r.pano = e,
  25188. this.resetPanoDescriptor(e.id),
  25189. this.resetPanoLODDescriptors(e.id),
  25190. this.resetRenderStatus(e.id, !0, !0)
  25191. }
  25192. this.setActiveRenderTargetDescriptor(e.id, r);
  25193. var h = i ? 0 : 1;
  25194. return this.updateActivePanos(e, h),
  25195. r.renderTarget
  25196. }
  25197. ,
  25198. l.prototype.deactivateTiledPano = function(e) {
  25199. var t = this.getActiveRenderTargetDescriptor(e.id);
  25200. this.isRenderTargetDescriptorValid(t) && s(t.renderTarget),
  25201. this.setActiveRenderTargetDescriptor(e.id, null);
  25202. var i = this.getUploadQueueForPano(e.id);
  25203. this.clearUploadQueue(i),
  25204. this.updateActivePanos()
  25205. }
  25206. ,
  25207. l.prototype.updateActivePanos = function() {
  25208. var e = [];
  25209. return function(t, i) {
  25210. e.length = 0;
  25211. for (var n = 0; n < this.activePanos.length; n++) {
  25212. t && e.length === i && e.push(t);
  25213. var r = this.activePanos[n]
  25214. , o = this.getActiveRenderTargetDescriptor(r.id);
  25215. t && r.id === t.id || !this.isRenderTargetDescriptorValid(o) || e.push(r)
  25216. }
  25217. t && i >= e.length && e.push(t),
  25218. this.activePanos.length = 0,
  25219. this.activePanos.push.apply(this.activePanos, e)
  25220. }
  25221. }(),
  25222. l.prototype.getActivePanoCount = function() {
  25223. return this.activePanos.length
  25224. }
  25225. ,
  25226. l.prototype.resetRenderStatus = function(e, t, i, n) {
  25227. var r = null;
  25228. n && (r = A.getLevelCountForSize(C.TILE_SIZE, n) + 1);
  25229. for (var o = function(e, n, r, o) {
  25230. i && (n.tile.zoomUploaded = !1),
  25231. t && (n.tile.uploaded = !1)
  25232. }, a = 0; a < C.FACES_PER_PANO; a++) {
  25233. var s = this.getTileTree(e, a);
  25234. s.breadthFirst({
  25235. callback: o.bind(this, a),
  25236. minLevel: r
  25237. })
  25238. }
  25239. }
  25240. ,
  25241. l.prototype.copyBaseRenderStatusToZoomed = function(e) {
  25242. for (var t = A.getLevelCountForSize(C.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  25243. t.tile.zoomUploaded = t.tile.uploaded,
  25244. t.zoomCovered = t.covered
  25245. }, n = 0; n < C.FACES_PER_PANO; n++) {
  25246. var r = this.getTileTree(e, n);
  25247. r.breadthFirst({
  25248. callback: i.bind(this, n),
  25249. maxLevel: t
  25250. })
  25251. }
  25252. }
  25253. ,
  25254. l.prototype.renderPanoTiles = function() {
  25255. var e = [];
  25256. return function(t, i, n, r) {
  25257. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  25258. i = i || this.direction || v.FORWARD;
  25259. var o = this.getActiveRenderTargetDescriptor(t);
  25260. if (!this.isRenderTargetDescriptorValid(o))
  25261. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  25262. for (var a = 0; a < C.FACES_PER_PANO; a++) {
  25263. var s = this.getTileTree(t, a);
  25264. e.length = 0,
  25265. s.breadthFirst({
  25266. saveVisited: e
  25267. });
  25268. for (var l = 0; l < e.length; l++) {
  25269. var c = e[l];
  25270. this.queueTileUpload(c.tile, !1, r || 0 === l && n)
  25271. }
  25272. }
  25273. this.updateDirection(i)
  25274. }
  25275. }(),
  25276. l.prototype.isRenderTargetDescriptorValid = function(e) {
  25277. return e && e.renderTarget
  25278. }
  25279. ,
  25280. l.prototype.isPanoActive = function(e) {
  25281. var t = this.getActiveRenderTargetDescriptor(e);
  25282. return this.isRenderTargetDescriptorValid(t)
  25283. }
  25284. ,
  25285. l.prototype.isPanoZoomed = function(e) {
  25286. return this.zoomingActive && this.zoomPanoId === e
  25287. }
  25288. ,
  25289. l.prototype.initTileTree = function(e, t, i) {
  25290. var n = this.tileTrees[e];
  25291. n || (n = [],
  25292. this.tileTrees[e] = n);
  25293. var r = n[t];
  25294. if (!r) {
  25295. var o = A.getLevelCountForSize(C.TILE_SIZE, i);
  25296. r = new A(C.TILE_SIZE,o),
  25297. n[t] = r
  25298. }
  25299. }
  25300. ,
  25301. l.prototype.getTileTree = function(e, t) {
  25302. var i = this.tileTrees[e];
  25303. if (!i)
  25304. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  25305. var n = i[t];
  25306. if (!n)
  25307. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  25308. return n
  25309. }
  25310. ,
  25311. l.prototype.initTiledPano = function(e, t) {
  25312. var i = this.sceneRenderer.renderer
  25313. , n = (i.context,
  25314. new h.WebGLRenderTargetCube(e,e,{
  25315. stencilBuffer: !1
  25316. }))
  25317. , r = new h.CubeTexture([]);
  25318. n.texture = r,
  25319. r.image = [null, null, null, null, null, null],
  25320. r.flipY = !0,
  25321. t ? (r.generateMipmaps = !0,
  25322. r.magFilter = h.LinearFilter,
  25323. r.minFilter = h.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  25324. r.magFilter = h.LinearFilter,
  25325. r.minFilter = h.LinearFilter),
  25326. r.format = h.RGBAFormat,
  25327. i.setRenderTarget(n),
  25328. i.setRenderTarget(null);
  25329. var o = i.properties.get(r);
  25330. return o.__image__webglTextureCube = o.__webglTexture,
  25331. n
  25332. }
  25333. ,
  25334. l.prototype.getUploadQueueForPano = function(e) {
  25335. var t = this.uploadQueues[e];
  25336. return t || (t = [],
  25337. this.uploadQueues[e] = t),
  25338. t
  25339. }
  25340. ,
  25341. l.prototype.isTileUploaded = function(e) {
  25342. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  25343. }
  25344. ,
  25345. l.prototype.setUploaded = function(e, t) {
  25346. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  25347. }
  25348. ,
  25349. l.prototype.queueTileUpload = function(e, t, i) {
  25350. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  25351. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  25352. var r = this.getUploadQueueForPano(e.panoId);
  25353. 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),
  25354. e.uploadQueued = !0,
  25355. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  25356. }
  25357. }
  25358. ,
  25359. l.prototype.shoulPushToFrontOfQueue = function(e) {
  25360. return 0 === A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  25361. }
  25362. ,
  25363. l.prototype.getTopUploadQueue = function() {
  25364. for (var e = null, t = null, i = S.Base; i <= S.Remaining; i++)
  25365. for (var n = 0; n < this.activePanos.length; n++)
  25366. if (e = this.activePanos[n],
  25367. t = this.getUploadQueueForPano(e.id),
  25368. t.length > 0)
  25369. switch (i) {
  25370. case S.Base:
  25371. if (0 === t[0].level)
  25372. return t;
  25373. break;
  25374. case S.Remaining:
  25375. return t
  25376. }
  25377. return null
  25378. }
  25379. ,
  25380. l.prototype.getNextFromUploadQueue = function() {
  25381. var e = function(e) {
  25382. var t = e.shift();
  25383. return t.uploadQueued = !1,
  25384. t
  25385. };
  25386. return function() {
  25387. if (this.forceQueue.length > 0)
  25388. return e(this.forceQueue);
  25389. var t = this.getTopUploadQueue();
  25390. return t && t.length > 0 ? e(t) : null
  25391. }
  25392. }(),
  25393. l.prototype.peekNextFromUploadQueue = function() {
  25394. if (this.forceQueue.length > 0)
  25395. return this.forceQueue[0];
  25396. var e = this.getTopUploadQueue();
  25397. return e && e.length > 0 ? e[0] : null
  25398. }
  25399. ,
  25400. l.prototype.clearAllQueuedUploads = function() {
  25401. this.clearAllUploadQueues(null, 0)
  25402. }
  25403. ,
  25404. l.prototype.clearAllQueuedUploadsForPano = function(e) {
  25405. this.clearAllUploadQueues(e, 0)
  25406. }
  25407. ,
  25408. l.prototype.clearAllUploadQueues = function(e, t) {
  25409. if (e)
  25410. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  25411. this.clearUploadQueue(this.forceQueue, t, e);
  25412. else {
  25413. for (var i = 0; i < this.activePanos.length; i++) {
  25414. var n = this.activePanos[i];
  25415. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  25416. }
  25417. this.clearUploadQueue(this.forceQueue, t)
  25418. }
  25419. }
  25420. ,
  25421. l.prototype.clearUploadQueue = function(e, t, i) {
  25422. void 0 !== t && null !== t || (t = 0);
  25423. for (var n = 0; n < e.length; ) {
  25424. var r = e[n];
  25425. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  25426. e.splice(n, 1)) : n++
  25427. }
  25428. }
  25429. ,
  25430. l.prototype.refreshUploadInterval = function() {
  25431. var e = null;
  25432. return function(t) {
  25433. this.uploadIntervalCancelled || (e || (e = c.bind(this)),
  25434. null !== t && void 0 !== t || (t = w),
  25435. b || (t = _),
  25436. this.uploadInterval = window.setTimeout(e, t),
  25437. this.uploadIntervalDelay = t)
  25438. }
  25439. }(),
  25440. l.prototype.update = function() {
  25441. var e = performance.now()
  25442. , t = 0;
  25443. return function() {
  25444. this.uploadIntervalCancelled = !0,
  25445. window.clearTimeout(this.uploadInterval),
  25446. this.uploadInterval = null;
  25447. var i = performance.now() - e;
  25448. !(i > w || 0 === t) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25449. e = performance.now()),
  25450. t++
  25451. }
  25452. }(),
  25453. l.prototype.updateUploadQueue = function(e, t) {
  25454. e || (e = 1);
  25455. for (var i = 0, n = 0; ; ) {
  25456. if (n >= t || i >= e)
  25457. break;
  25458. var r = this.getNextFromUploadQueue();
  25459. if (!r)
  25460. break;
  25461. if (0 !== r.level ? i++ : n++,
  25462. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  25463. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  25464. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  25465. }
  25466. }
  25467. }
  25468. ,
  25469. l.prototype.updateDirection = function(e) {
  25470. if (e = e || this.direction) {
  25471. this.direction = e;
  25472. for (var t = 0; t < this.activePanos.length; t++) {
  25473. var i = this.activePanos[t]
  25474. , n = this.getUploadQueueForPano(i.id);
  25475. y.sortPanoTiles(n, i, this.direction)
  25476. }
  25477. }
  25478. }
  25479. ,
  25480. l.prototype.uploadTile = function() {
  25481. var e = {}
  25482. , t = (new h.Vector4,
  25483. d.tiling.overlayStyle);
  25484. return function(i, n) {
  25485. var r = i.panoId
  25486. , o = i.image
  25487. , a = i.tileSize
  25488. , s = i.panoSize
  25489. , l = i.tileIndex
  25490. , c = (i.faceTileIndex,
  25491. i.totalTiles)
  25492. , u = (i.face,
  25493. i.tileX)
  25494. , d = i.tileY
  25495. , p = !0
  25496. , g = !1
  25497. , m = (this.getPanoDescriptor(r),
  25498. this.getPanoLODDescriptor(r, s))
  25499. , v = this.getActiveRenderTargetDescriptor(r)
  25500. , A = v.renderTarget
  25501. , y = v.size;
  25502. if (this.isPanoZoomed(r) && (A = this.zoomRenderTarget,
  25503. y = this.qualityManager.getMaxZoomPanoSize()),
  25504. this.isRenderTargetDescriptorValid(v) || (p = !1,
  25505. g = !1),
  25506. n || (this.anyUploaded(i.node) && (p = !1,
  25507. g = !0),
  25508. this.isTileUploaded(i) && (p = !1,
  25509. g = !1)),
  25510. p) {
  25511. var C = u * a
  25512. , I = d * a
  25513. , E = a / s * y
  25514. , b = C / s * y
  25515. , w = I / s * y;
  25516. e[a] || (e[a] = this.sceneRenderer.initSizedTexture2D(a, h.ClampToEdgeWrapping));
  25517. var _ = e[a];
  25518. if (this.sceneRenderer.uploadTexture2D(o, _, 0, 0, a, a),
  25519. 1 === t || 2 === t) {
  25520. var T = 1 === t ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  25521. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace),
  25522. this.sceneRenderer.renderToCubeMap(T[s], A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace, h.NormalBlending, !0, .5)
  25523. } else
  25524. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace);
  25525. m.uploadCount++,
  25526. this.emit(f.TileRenderSuccess, r, s, l, c),
  25527. m.uploadCount === c && this.emit(f.PanoRenderComplete, r, s, c),
  25528. this.setUploaded(i, !0),
  25529. this.addCoverageForNode(i.node)
  25530. } else
  25531. this.setUploaded(i, !1);
  25532. return i.uploadAttempted || (m.uploadAttempts++,
  25533. this.emit(f.TileUploadAttempted, r, s, l, c)),
  25534. i.uploadAttempted = !0,
  25535. m.uploadAttempts === c && this.emit(f.UploadAttemptedForAllTiles, r, s, c),
  25536. g
  25537. }
  25538. }(),
  25539. l.prototype.linkTileAndNode = function(e, t) {
  25540. t.tile = e,
  25541. e.node = t
  25542. }
  25543. ,
  25544. l.prototype.linkAllTilesAndNodes = function(e) {
  25545. for (var t = function(t, i, n, r, o) {
  25546. var a = this.getTileDirectoryEntry(e.id, i, r, o);
  25547. this.linkTileAndNode(a, n)
  25548. }, i = 0; i < C.FACES_PER_PANO; i++) {
  25549. var n = this.getTileTree(e.id, i);
  25550. n.breadthFirst({
  25551. callback: t.bind(this, n, i)
  25552. })
  25553. }
  25554. }
  25555. ,
  25556. l.prototype.anyUploaded = function(e) {
  25557. if (!e)
  25558. return !1;
  25559. if (e.tile && this.isTileUploaded(e.tile))
  25560. return !0;
  25561. if (e.children)
  25562. for (var t = 0; t < e.children.length; t++) {
  25563. var i = e.children[t];
  25564. if (this.anyUploaded(i))
  25565. return !0
  25566. }
  25567. return !1
  25568. }
  25569. ,
  25570. l.prototype.setNodeCovered = function(e, t) {
  25571. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  25572. }
  25573. ,
  25574. l.prototype.isNodeCovered = function(e) {
  25575. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  25576. }
  25577. ,
  25578. l.prototype.addCoverageForNode = function(e) {
  25579. if (this.setNodeCovered(e, !0),
  25580. e.parent && e.covered) {
  25581. var t = e.parent;
  25582. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  25583. }
  25584. }
  25585. ,
  25586. l.prototype.calcFullCoverage = function(e) {
  25587. var t = !1;
  25588. if (e.children)
  25589. for (var i = 0; i < e.children.length; i++) {
  25590. var n = e.children[i];
  25591. t = t || this.calcFullCoverage(n)
  25592. }
  25593. e.covered = e.tile.uploaded || t
  25594. }
  25595. ,
  25596. l.prototype.nodeSubcovered = function(e) {
  25597. if (!e.children)
  25598. return !1;
  25599. for (var t = 0; t < e.children.length; t++)
  25600. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  25601. return !1;
  25602. return !0
  25603. }
  25604. ,
  25605. l.prototype.resetPanoDescriptor = function(e) {
  25606. this.getPanoDescriptor(e)
  25607. }
  25608. ,
  25609. l.prototype.getPanoDescriptor = function(e) {
  25610. var t = this.panoDescriptors[e];
  25611. return t || (t = {},
  25612. this.panoDescriptors[e] = t),
  25613. t
  25614. }
  25615. ,
  25616. l.prototype.resetPanoLODDescriptors = function(e) {
  25617. var t = this.getPanoLODDescriptors(e);
  25618. for (var i in t)
  25619. if (t.hasOwnProperty(i)) {
  25620. var n = t[i];
  25621. n.uploadCount = 0,
  25622. n.uploadAttempts = 0
  25623. }
  25624. }
  25625. ,
  25626. l.prototype.getPanoLODDescriptor = function(e, t) {
  25627. var i = this.getPanoLODDescriptors(e)
  25628. , n = i[t];
  25629. return n || (n = {
  25630. uploadCount: 0,
  25631. uploadAttempts: 0
  25632. },
  25633. i[t] = n),
  25634. n
  25635. }
  25636. ,
  25637. l.prototype.getPanoLODDescriptors = function(e) {
  25638. var t = this.panoLODDescriptors[e];
  25639. return t || (t = {},
  25640. this.panoLODDescriptors[e] = t),
  25641. t
  25642. }
  25643. ,
  25644. l.prototype.onTileDownloaded = function(e) {
  25645. var t = A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  25646. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  25647. if (i.downloaded = !0,
  25648. i.image = e.image,
  25649. i.panoSize = e.panoSize,
  25650. i.tileX = e.tileX,
  25651. i.tileY = e.tileY,
  25652. i.totalTiles = e.totalTiles,
  25653. i.tileIndex = e.tileIndex,
  25654. i.faceTileIndex = e.faceTileIndex,
  25655. i.face = e.face,
  25656. i.cubeFace = I.mapFaceToCubemapFace(e.face),
  25657. i.panoId = e.panoId,
  25658. i.tileSize = e.tileSize,
  25659. i.direction = (new h.Vector3).copy(e.direction),
  25660. i.node = null,
  25661. i.level = A.getLevelCountForSize(C.TILE_SIZE, i.panoSize),
  25662. this.isPanoActive(i.panoId)) {
  25663. var n = this.getTileTree(i.panoId, i.face)
  25664. , r = n.getSubNode(i.panoSize, i.tileX, i.tileY);
  25665. this.linkTileAndNode(i, r),
  25666. this.queueTileUpload(i, !0)
  25667. }
  25668. }
  25669. ,
  25670. l.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  25671. var r = this.tileDirectory[e];
  25672. r || (r = {},
  25673. this.tileDirectory[e] = r);
  25674. var o = 16384 * t + 1024 * i + n
  25675. , a = r[o];
  25676. return a || (a = {
  25677. downloaded: !1,
  25678. uploaded: !1,
  25679. zoomUploaded: !1
  25680. },
  25681. r[o] = a),
  25682. a._key = e + ":" + t + ":" + i + ":" + n,
  25683. a._tileKey = o,
  25684. a
  25685. }
  25686. ,
  25687. l.prototype.setZoomingActive = function(e, t, i) {
  25688. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  25689. this.zoomPanoId = t.id,
  25690. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  25691. }
  25692. ,
  25693. l.prototype.updateZoomedPanoFromBase = function(e) {
  25694. if (!this.zoomPanoRenderingDisabled) {
  25695. var t = this.getActiveRenderTargetDescriptor(e.id);
  25696. if (t && t.renderTarget) {
  25697. var i = this.qualityManager.getMaxZoomPanoSize()
  25698. , n = t.renderTarget
  25699. , r = t.size;
  25700. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  25701. this.copyBaseRenderStatusToZoomed(e.id)
  25702. }
  25703. }
  25704. }
  25705. ,
  25706. t.exports = l
  25707. }
  25708. , {
  25709. "../enum/GLCubeFaces": 25,
  25710. "../enum/PanoRendererEvents": 35,
  25711. "../enum/PanoSizeClass": 36,
  25712. "../enum/SceneRendererEvents": 43,
  25713. "../enum/TileDownloaderEvents": 45,
  25714. "../enum/Vectors": 50,
  25715. "../exception/BasicException": 55,
  25716. "../objects/Panorama": 148,
  25717. "../settings": 166,
  25718. "../util/browser": 182,
  25719. "../util/panorama": 191,
  25720. "./TileDownloader": 171,
  25721. "./TilePrioritizer": 172,
  25722. "./TileTree": 173,
  25723. "./TileUtils": 174,
  25724. events: 202,
  25725. three: 217
  25726. }],
  25727. 170: [function(e, t, i) {
  25728. "use strict";
  25729. function n(e, t, i) {
  25730. this.maxNavPanoSize = -1,
  25731. this.maxZoomPanoSize = -1,
  25732. this.devicePixelDensity = e,
  25733. this.deviceScreenSize = t,
  25734. this.clientBandwidth = i,
  25735. this.panoSizeClassMap = {},
  25736. this.useHighResolutionPanos = !0,
  25737. this.useUltraHighResolutionPanos = !1,
  25738. this.modelHasUltraHighPanos = !1
  25739. }
  25740. var r = e("../enum/PanoSizeClass")
  25741. , o = e("../settings")
  25742. , a = e("../util/browser")
  25743. , s = e("../constants")
  25744. , l = e("../util/showcase")
  25745. , c = e("../enum/ModelManagerEvents");
  25746. n.prototype.init = function(e) {
  25747. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  25748. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  25749. this.highSize = this.getPanoSize(r.HIGH),
  25750. this.standardSize = this.getPanoSize(r.STANDARD),
  25751. this.baseSize = this.getPanoSize(r.BASE),
  25752. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  25753. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  25754. this.updateMaximums(),
  25755. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  25756. }
  25757. ,
  25758. n.prototype.updateFromModel = function(e) {
  25759. this.updateHighResolutionSettings(e),
  25760. this.updateUltraHighResolutionSettings(e)
  25761. }
  25762. ,
  25763. n.prototype.updateHighResolutionSettings = function(e) {
  25764. //---------------------许钟文---------原始的会判断modeldata里version,以致useHighResolutionPanos为false,所以我直接变为true啦----------------------------------
  25765. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  25766. //this.useHighResolutionPanos = !0;
  25767. //----------------------e n d -----------------------------------------------------------------
  25768. this.updateMaximums()
  25769. }
  25770. ,
  25771. n.prototype.updateUltraHighResolutionSettings = function(e) {
  25772. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  25773. this.updateMaximums()
  25774. }
  25775. ,
  25776. n.prototype.enableUltraHighQualityMode = function() {
  25777. this.modelHasUltraHighPanos = !0,
  25778. this.updateUltraHighResolutionSettings(null)
  25779. }
  25780. ,
  25781. n.prototype.ultraHighQualityModeEnabled = function() {
  25782. return this.modelHasUltraHighPanos
  25783. }
  25784. ,
  25785. n.prototype.onModelChanged = function(e) {
  25786. this.updateFromModel(e.model),
  25787. this.updateMaximums()
  25788. }
  25789. ,
  25790. n.prototype.updateMaximums = function() {
  25791. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  25792. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  25793. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  25794. }
  25795. ,
  25796. n.prototype.buildPanoSizeClassMap = function() {
  25797. this.panoSizeClassMap[r.BASE] = 512,
  25798. this.panoSizeClassMap[r.STANDARD] = 1024,
  25799. this.panoSizeClassMap[r.HIGH] = 2048,
  25800. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  25801. }
  25802. ,
  25803. n.prototype.getPanoSize = function(e) {
  25804. return this.panoSizeClassMap[e]
  25805. }
  25806. ,
  25807. n.prototype.getMaxPossiblePanoSize = function() {
  25808. return this.getPanoSize(r.ULTRAHIGH)
  25809. }
  25810. ,
  25811. n.prototype.getMaxPanoSize = function() {
  25812. return this.maxZoomPanoSize
  25813. }
  25814. ,
  25815. n.prototype.getMaxNavPanoSize = function() {
  25816. return this.maxNavPanoSize
  25817. }
  25818. ,
  25819. n.prototype.getMaxZoomPanoSize = function() {
  25820. return this.maxZoomPanoSize
  25821. }
  25822. ,
  25823. n.prototype.detectMaxNavPanoSizeClass = function() {
  25824. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  25825. }
  25826. ,
  25827. n.prototype.detectMaxNavPanoSize = function() {
  25828. var e = this.detectMaxNavPanoSizeClass();
  25829. return this.getPanoSize(e)
  25830. }
  25831. ,
  25832. n.prototype.detectMaxZoomPanoSize = function() {
  25833. 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)
  25834. }
  25835. ,
  25836. t.exports = n
  25837. }
  25838. , {
  25839. "../constants": 8,
  25840. "../enum/ModelManagerEvents": 33,
  25841. "../enum/PanoSizeClass": 36,
  25842. "../settings": 166,
  25843. "../util/browser": 182,
  25844. "../util/showcase": 193
  25845. }],
  25846. 171: [function(e, t, i) {
  25847. (function(i) {
  25848. "use strict";
  25849. function n(e) {
  25850. this.panos = null,
  25851. this.retryMinimumTime = 1e4,
  25852. this.urls = null,
  25853. this.panoLoadCallbacks = {},
  25854. this.downloadDescriptors = {},
  25855. this.priorityQueue = [],
  25856. this.forceQueue = [],
  25857. this.activeDownloads = [],
  25858. this.qualityManager = null,
  25859. this.tilePrioritizer = null,
  25860. this.refreshInterval = null,
  25861. this.processPriorityQueue = !1,
  25862. this.concurrentDownloads = e.concurrentDownloads || 1,
  25863. this.downloadTestResults = {}
  25864. }
  25865. var r = e("three")
  25866. , o = (e("../enum/Viewmode"),
  25867. e("../settings"))
  25868. , a = (e("../objects/Panorama"),
  25869. e("../util/logger"))
  25870. , s = (e("../enum/Vectors"),
  25871. e("../enum/PanoSizeClass"),
  25872. e("../enum/TileDownloaderEvents"))
  25873. , l = e("./TilePrioritizer")
  25874. , c = e("./TileUtils")
  25875. , h = (e("../enum/GLCubeFaces"),
  25876. e("../enum/DownloadStatus"))
  25877. , u = e("../util/panorama")
  25878. , d = e("../util/ajax")
  25879. , p = e("../ab")
  25880. , f = e("events").EventEmitter
  25881. , g = (new a(i),
  25882. Object.freeze({
  25883. Testing: 1,
  25884. Success: 2,
  25885. Fail: 3
  25886. }));
  25887. n.prototype = Object.create(f.prototype),
  25888. n.IDLE_REFRESH_DELAY = 500,
  25889. n.ACTIVE_REFRESH_DELAY = 16,
  25890. n.DOWNLOAD_RETRIES = 4,
  25891. n.prototype.init = function(e) {
  25892. this.qualityManager = e
  25893. }
  25894. ,
  25895. n.prototype.setUrls = function(e) {
  25896. this.urls = e
  25897. }
  25898. ,
  25899. n.prototype.setPanoData = function(e, t, i) {
  25900. this.panos = e,
  25901. this.imagePanos = t,
  25902. this.panoGroupId = i
  25903. }
  25904. ,
  25905. n.prototype.start = function() {
  25906. this.refreshUpdateInterval(0)
  25907. }
  25908. ,
  25909. n.prototype.stop = function() {
  25910. window.cancel(this.refreshInterval)
  25911. }
  25912. ,
  25913. n.prototype.refreshUpdateInterval = function(e) {
  25914. e || (e = 0),
  25915. this.refreshInterval = window.setTimeout(function() {
  25916. var e = this.update();
  25917. e ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY)
  25918. }
  25919. .bind(this), e)
  25920. }
  25921. ,
  25922. n.prototype.update = function() {
  25923. var e = this.forceQueue.length > 0;
  25924. return this.processQueueForDownloading(this.forceQueue),
  25925. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  25926. this.priorityQueue.length > 0 && (e = !0),
  25927. this.processQueueForDownloading(this.priorityQueue)),
  25928. e
  25929. }
  25930. ,
  25931. n.prototype.forceQueueTilesForPano = function() {
  25932. var e = []
  25933. , t = [];
  25934. return function(i, n, r, o, a, s) {
  25935. e.length = 0;
  25936. for (var u = this.getTileDownloadDescriptors(i, n), d = 0; d < u.length; d++) {
  25937. var p = u[d];
  25938. p.status !== h.None && p.status !== h.Queued || e.push(p)
  25939. }
  25940. if (r && e.length > 0) {
  25941. l.sortPanoTiles(e, i, r),
  25942. t.length = 0,
  25943. c.matchingTilesInDirection(i, n, r, o, a, t);
  25944. for (var f = 0, g = function(e) {
  25945. return e.face === m.face && e.faceTileIndex === m.faceTileIndex
  25946. }; f < e.length; ) {
  25947. var m = e[f]
  25948. , v = t.findIndex(g);
  25949. v < 0 ? e.splice(f, 1) : f++
  25950. }
  25951. }
  25952. for (var A = 0; A < e.length; A++)
  25953. this.forceQueue.push(e[A]);
  25954. this.setStatusForAllDescriptors(this.forceQueue, h.ForceQueued),
  25955. this.clearFromQueue(this.priorityQueue, h.ForceQueued, !1),
  25956. s && this.processQueueForDownloading(this.forceQueue, !0)
  25957. }
  25958. }(),
  25959. n.prototype.clearForceQueue = function() {
  25960. this.clearQueue(this.forceQueue)
  25961. }
  25962. ,
  25963. n.prototype.queuePrioritizedTilesForPanos = function(e) {
  25964. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  25965. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  25966. this.clearFromQueue(this.priorityQueue, h.None, !0),
  25967. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, h.Queued))
  25968. }
  25969. ,
  25970. n.prototype.clearQueue = function(e) {
  25971. this.setStatusForAllDescriptors(e, h.None),
  25972. e.length = 0
  25973. }
  25974. ,
  25975. n.prototype.clearFromQueue = function(e, t, i) {
  25976. for (var n = 0; n < e.length; n++) {
  25977. var r = e[n];
  25978. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  25979. }
  25980. }
  25981. ,
  25982. n.prototype.setStatusForAllDescriptors = function(e, t) {
  25983. for (var i = 0; i < e.length; i++) {
  25984. var n = e[i];
  25985. n && (n.status = t)
  25986. }
  25987. }
  25988. ,
  25989. n.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  25990. for (var i = 0; i < e.length; i++) {
  25991. var n = e[i];
  25992. n && (n.status !== t ? n.status = t : e[i] = null)
  25993. }
  25994. }
  25995. ,
  25996. n.prototype.getTileDownloadDescriptors = function(e, t) {
  25997. var i = this.getAllTileDownloadDescriptorsForPano(e)
  25998. , n = i[t];
  25999. return n || (n = this.buildDownloadDescriptorArray(t),
  26000. i[t] = n,
  26001. this.initTileDownloadDescriptors(n, e, t)),
  26002. n
  26003. }
  26004. ,
  26005. n.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  26006. var t = this.downloadDescriptors[e.id];
  26007. return t || (t = {},
  26008. this.downloadDescriptors[e.id] = t),
  26009. t
  26010. }
  26011. ,
  26012. n.prototype.processQueueForDownloading = function(e, t) {
  26013. if (this.cleanupActiveDownloads(),
  26014. this.activeDownloads.length < this.concurrentDownloads || t)
  26015. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0, r = 0; n < i && e.length > 0; r++) {
  26016. var o = e.shift();
  26017. o && (this.startDownload(o),
  26018. n++)
  26019. }
  26020. }
  26021. ,
  26022. n.prototype.testDownload = function(e, t, i) {
  26023. var n = this.downloadTestResults[e];
  26024. if (n)
  26025. return void (n === g.Success ? i(!0) : n === g.Fail && i(!1));
  26026. this.downloadTestResults[e] = g.Testing;
  26027. var r = this.panos.list[0]
  26028. , o = this.getTileUrl(r.id, e, t, 0)
  26029. , a = function(t) {
  26030. this.downloadTestResults[e] = g.Success,
  26031. i(!0)
  26032. }
  26033. .bind(this)
  26034. , s = function() {
  26035. this.downloadTestResults[e] = g.Fail,
  26036. i(!1)
  26037. }
  26038. .bind(this);
  26039. this.loadImage(o, 0, a, s)
  26040. }
  26041. ,
  26042. n.prototype.startDownload = function(e) {
  26043. e.status = h.Downloading;
  26044. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  26045. this.activeDownloads.push(e),
  26046. this.loadImage(t, n.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  26047. }
  26048. ,
  26049. n.prototype.downloadFailed = function(e, t) {}
  26050. ,
  26051. n.prototype.downloadComplete = function(e, t) {
  26052. if (e.panoGroupId === this.panoGroupId) {
  26053. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  26054. e.status = h.Downloaded,
  26055. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  26056. var n = {
  26057. panoId: e.pano.id,
  26058. image: t,
  26059. tileSize: e.tileSize,
  26060. panoSize: e.panoSize,
  26061. tileIndex: e.tileIndex,
  26062. faceTileIndex: e.faceTileIndex,
  26063. totalTiles: e.totalTiles,
  26064. face: e.face,
  26065. tileX: e.tileX,
  26066. tileY: e.tileY,
  26067. direction: e.direction
  26068. };
  26069. e.image = t,
  26070. this.emit(s.TileDownloadSuccess, n),
  26071. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  26072. panoId: e.pano.id,
  26073. tileSize: e.tileSize,
  26074. panoSize: e.panoSize
  26075. },
  26076. this.emit(s.PanoDownloadComplete, n),
  26077. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  26078. }
  26079. }
  26080. ,
  26081. n.prototype.cleanupActiveDownloads = function() {
  26082. var e = [];
  26083. return function() {
  26084. e.length = 0;
  26085. for (var t = 0; t < this.activeDownloads.length; t++) {
  26086. var i = this.activeDownloads[t];
  26087. i.status !== h.Downloaded && i.status !== h.Failed && e.push(i)
  26088. }
  26089. this.activeDownloads.length = 0,
  26090. this.activeDownloads.push.apply(this.activeDownloads, e)
  26091. }
  26092. }(),
  26093. n.prototype.isPanoDownloaded = function(e, t) {
  26094. var i = this.getTileDownloadDescriptors(e, t);
  26095. if (i.length <= 0)
  26096. return !1;
  26097. for (var n = 0; n < i.length; n++) {
  26098. var r = i[n];
  26099. if (r.status !== h.Downloaded)
  26100. return !1
  26101. }
  26102. return !0
  26103. }
  26104. ,
  26105. n.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  26106. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  26107. this.panoLoadCallbacks[o] = {
  26108. onLoad: i,
  26109. onFail: n,
  26110. onProgress: r
  26111. }
  26112. }
  26113. ,
  26114. n.prototype.getPanoLoadCallbacks = function(e, t) {
  26115. var i = e.id + ":" + t;
  26116. return this.panoLoadCallbacks[i]
  26117. }
  26118. ,
  26119. n.prototype.buildDownloadDescriptorArray = function(e) {
  26120. for (var t = c.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  26121. var r = this.buildDownloadDescriptor();
  26122. i.push(r)
  26123. }
  26124. return i
  26125. }
  26126. ,
  26127. n.prototype.buildDownloadDescriptor = function() {
  26128. var e = {
  26129. panoGroupId: null,
  26130. pano: null,
  26131. panoSize: -1,
  26132. tileSize: -1,
  26133. tileIndex: -1,
  26134. totalTiles: -1,
  26135. faceTileIndex: -1,
  26136. status: h.None,
  26137. url: null,
  26138. image: null,
  26139. direction: new r.Vector3,
  26140. face: -1,
  26141. cubeFace: -1,
  26142. tileX: -1,
  26143. tileY: -1
  26144. };
  26145. return e
  26146. }
  26147. ,
  26148. n.prototype.initTileDownloadDescriptors = function(e, t, i) {
  26149. for (var n = 0; n < e.length; n++) {
  26150. var r = e[n];
  26151. this.initTileDownloadDescriptor(r, t, i, n)
  26152. }
  26153. }
  26154. ,
  26155. n.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  26156. var r = i >= c.TILE_SIZE ? c.TILE_SIZE : i;
  26157. e.face = c.getFaceForTile(i, n),
  26158. e.cubeFace = u.mapFaceToCubemapFace(e.face),
  26159. e.panoGroupId = this.panoGroupId,
  26160. e.pano = t,
  26161. e.panoSize = i,
  26162. e.tileSize = r,
  26163. e.tileIndex = n,
  26164. e.totalTiles = c.getTileCountForSize(i),
  26165. e.status = h.None,
  26166. e.image = null,
  26167. c.getTileLocation(e.panoSize, e.tileIndex, e),
  26168. c.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, c.LocationOnTile.Center, 0, e.direction)
  26169. }
  26170. ,
  26171. n.prototype.getTileUrl = function() {
  26172. var e = {
  26173. 256: "256",
  26174. 512: "512",
  26175. 1024: "1k",
  26176. 2048: "2k",
  26177. 4096: "4k"
  26178. }
  26179. , t = {
  26180. face: -1,
  26181. faceTileIndex: -1,
  26182. tileX: -1,
  26183. tileY: -1
  26184. };
  26185. return function(i, n, r, a) {
  26186. c.getTileLocation(n, a, t);
  26187. var s = Math.floor(n / r)
  26188. , l = s * s
  26189. , h = Math.floor(a / l)
  26190. , u = "";
  26191. 1 === o.tiling.customCompression && (u = "_" + o.tiling["q" + e[n]]);
  26192. var d = this.urls.get("tiles/" + i + "/" + e[n] + u + "_face" + h + "_" + t.tileX + "_" + t.tileY + ".jpg");
  26193. return d = p.changeIfTileGenerating(d)
  26194. }
  26195. }(),
  26196. n.prototype.loadImage = function(e, t, i, n) {
  26197. d.getImage(e, t).then(function(e) {
  26198. i(e)
  26199. }).fail(n)
  26200. }
  26201. ,
  26202. t.exports = n
  26203. }
  26204. ).call(this, "/js/tile/TileDownloader.js")
  26205. }
  26206. , {
  26207. "../ab": 3,
  26208. "../enum/DownloadStatus": 24,
  26209. "../enum/GLCubeFaces": 25,
  26210. "../enum/PanoSizeClass": 36,
  26211. "../enum/TileDownloaderEvents": 45,
  26212. "../enum/Vectors": 50,
  26213. "../enum/Viewmode": 51,
  26214. "../objects/Panorama": 148,
  26215. "../settings": 166,
  26216. "../util/ajax": 181,
  26217. "../util/logger": 189,
  26218. "../util/panorama": 191,
  26219. "./TilePrioritizer": 172,
  26220. "./TileUtils": 174,
  26221. events: 202,
  26222. three: 217
  26223. }],
  26224. 172: [function(e, t, i) {
  26225. (function(i) {
  26226. "use strict";
  26227. function n(e, t, i, o, a) {
  26228. this.qualityManager = e,
  26229. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26230. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  26231. this.baseSize = t,
  26232. this.standardSize = i,
  26233. this.highSize = o,
  26234. this.ultraHighSize = a,
  26235. this.priorityCriteria = new n.PriorityCriteria(null,new r.Vector3(0,0,0),new r.Vector3(0,0,-1),new r.Vector3(0,0,-1))
  26236. }
  26237. var r = e("three")
  26238. , o = (e("../enum/Viewmode"),
  26239. e("../settings"),
  26240. e("../settings"),
  26241. e("../objects/Panorama"))
  26242. , a = e("../util/logger")
  26243. , s = (e("../enum/Vectors"),
  26244. e("../enum/PanoSizeClass"),
  26245. e("../enum/ModelManagerEvents"),
  26246. e("../enum/GLCubeFaces"),
  26247. e("../enum/DownloadStatus"))
  26248. , l = (e("../util/browser"),
  26249. e("./TileUtils"))
  26250. , c = e("../util/math")
  26251. , h = (e("events").EventEmitter,
  26252. new a(i),
  26253. Object.freeze({
  26254. None: 0,
  26255. DirectionalFOV: 1
  26256. }));
  26257. n.PriorityCriteria = function(e, t, i, n, o) {
  26258. this.pano = e,
  26259. this.cameraPosition = (new r.Vector3).copy(t),
  26260. this.cameraDir = (new r.Vector3).copy(i),
  26261. this.panoSpaceDir = (new r.Vector3).copy(n),
  26262. this.upcomingPanos = o,
  26263. this.copy = function(e) {
  26264. this.pano = e.pano,
  26265. this.cameraPosition.copy(e.cameraPosition),
  26266. this.cameraDir.copy(e.cameraDir),
  26267. this.panoSpaceDir.copy(e.panoSpaceDir),
  26268. this.upcomingPanos = o
  26269. }
  26270. ,
  26271. this.zoomingActive = !1
  26272. }
  26273. ,
  26274. n.DIRECTIONAL_FOV = 180,
  26275. n.DIRECTIONAL_FOV_NARROW = 120,
  26276. n.MAX_SCORED_PANOS_TOCONSIDER = 6,
  26277. n.MAX_SCORED_PANOS_TOADD = 2,
  26278. n.MAX_UPCOMING_PANOS_TOADD = 3,
  26279. n.DIRECTION_SCORE_STRICTNESS = .75,
  26280. n.appendQueue = function(e, t) {
  26281. if (e && t)
  26282. for (var i = 0; i < t.length; i++)
  26283. e.push(t[i])
  26284. }
  26285. ,
  26286. n.prototype.updateCriteria = function(e, t, i, n) {
  26287. this.priorityCriteria.pano = e,
  26288. this.priorityCriteria.cameraPosition.copy(t),
  26289. this.priorityCriteria.cameraDir.copy(i),
  26290. this.priorityCriteria.upcomingPanos = n,
  26291. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26292. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  26293. }
  26294. ,
  26295. n.prototype.filterAndPrioritize = function() {
  26296. var e = []
  26297. , t = []
  26298. , i = [];
  26299. return function(r, o, a) {
  26300. this.populateNeighborPanos(this.priorityCriteria.pano, o, e),
  26301. this.populateScoredPanos(this.priorityCriteria.pano, o, t, this.priorityCriteria.cameraDir, n.MAX_SCORED_PANOS_TOCONSIDER);
  26302. var s = this.baseSize
  26303. , l = this.standardSize
  26304. , c = this.highSize
  26305. , h = this.ultraHighSize;
  26306. this.queueTilesForPano(r, a, this.priorityCriteria.pano, s),
  26307. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, s, n.MAX_UPCOMING_PANOS_TOADD),
  26308. i.length = 0,
  26309. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  26310. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26311. n.appendQueue(r, i),
  26312. this.queueTilesForPanos(r, t, a, s, n.MAX_SCORED_PANOS_TOADD),
  26313. i.length = 0,
  26314. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  26315. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  26316. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26317. n.appendQueue(r, i),
  26318. i.length = 0,
  26319. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  26320. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  26321. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  26322. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26323. n.appendQueue(r, i),
  26324. this.queueTilesForPanos(r, e, a, s)
  26325. }
  26326. }(),
  26327. n.prototype.canDownloadSize = function(e) {
  26328. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  26329. }
  26330. ,
  26331. n.prototype.populateNeighborPanos = function(e, t, i) {
  26332. i = i || [],
  26333. i.length = 0;
  26334. var n = t.getNeighbours(e);
  26335. for (var r in n)
  26336. if (n.hasOwnProperty(r)) {
  26337. var o = t.get(r);
  26338. i.push(o)
  26339. }
  26340. return i
  26341. }
  26342. ,
  26343. n.prototype.populateScoredPanos = function(e, t, i, r, a) {
  26344. i = i || [],
  26345. i.length = 0;
  26346. var s = [o.filters.inPanoDirection(e.position, r, n.DIRECTION_SCORE_STRICTNESS), o.filters.not(e)]
  26347. , l = [o.scoreFunctions.distanceSquared(e), o.scoreFunctions.direction(e.position, r)]
  26348. , c = t.sortByScore(s, l);
  26349. if (c)
  26350. for (var h = 0; h < c.length && h < a; h++) {
  26351. var u = c[h].pano;
  26352. i.push(u)
  26353. }
  26354. return i
  26355. }
  26356. ,
  26357. n.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  26358. for (var o = 0, a = 0; a < t.length; a++) {
  26359. var s = t[a]
  26360. , l = this.queueTilesForPano(e, i, s, n);
  26361. if (o += l > 0 ? 1 : 0,
  26362. r && o >= r)
  26363. break
  26364. }
  26365. return o
  26366. }
  26367. ,
  26368. n.prototype.queueTilesForPano = function() {
  26369. var e = {
  26370. filter: h.None
  26371. };
  26372. return function(t, i, n, r) {
  26373. return this.filterAndQueueTileDownloadDescriptors(t, i, n, r, e)
  26374. }
  26375. }(),
  26376. n.prototype.queueTilesForPanosInDirection = function() {
  26377. var e = new r.Vector3;
  26378. return function(t, i, n, r, o, a, s, l) {
  26379. for (var h = 0, u = 0; u < n.length; u++) {
  26380. var d = n[u];
  26381. e.copy(d.position),
  26382. e.sub(o),
  26383. e.normalize();
  26384. var p = Math.max(Math.min(a.dot(e), 1), -1)
  26385. , f = c.getFOVDotThreshold(s);
  26386. if (p >= f) {
  26387. var g = this.queueTilesInDirectionForPano(t, i, d, r, o, a, s);
  26388. if (h += g > 0 ? 1 : 0,
  26389. l && h >= l)
  26390. break
  26391. }
  26392. }
  26393. return h
  26394. }
  26395. }(),
  26396. n.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  26397. for (var l = 0, c = 0; c < i.length; c++) {
  26398. var h = i[c]
  26399. , u = this.queueTilesInDirectionForPano(e, t, h, n, o, a);
  26400. if (l += u > 0 ? 1 : 0,
  26401. s && l >= s)
  26402. break
  26403. }
  26404. return l
  26405. }
  26406. ,
  26407. n.prototype.queueTilesInDirectionForPano = function() {
  26408. var e = {
  26409. filter: h.DirectionalFOV,
  26410. direction: new r.Vector3,
  26411. fov: 60
  26412. }
  26413. , t = new r.Vector3;
  26414. return function(i, n, r, o, a, s, c) {
  26415. return t.copy(s),
  26416. l.getRelativeDirection(r.quaternion, t),
  26417. e.direction.copy(t),
  26418. e.fov = c,
  26419. this.filterAndQueueTileDownloadDescriptors(i, n, r, o, e)
  26420. }
  26421. }(),
  26422. n.prototype.filterAndQueueTileDownloadDescriptors = function() {
  26423. var e = [];
  26424. return function(t, i, n, r, o) {
  26425. var a = i.getTileDownloadDescriptors(n, r);
  26426. e.length = 0,
  26427. this.filterTileDownloadDescriptors(n, a, e, o);
  26428. for (var s = 0, l = 0; l < e.length; l++) {
  26429. var c = e[l];
  26430. c && (t.push(c),
  26431. s++)
  26432. }
  26433. return s
  26434. }
  26435. }(),
  26436. n.prototype.filterTileDownloadDescriptors = function() {
  26437. new r.Vector3;
  26438. return function(e, t, i, n) {
  26439. var r, o;
  26440. switch (n.filter) {
  26441. case h.DirectionalFOV:
  26442. for (r = 0; r < t.length; r++)
  26443. o = t[r],
  26444. l.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  26445. break;
  26446. default:
  26447. for (r = 0; r < t.length; r++)
  26448. o = t[r],
  26449. i.push(o)
  26450. }
  26451. for (r = 0; r < i.length; r++)
  26452. o = i[r],
  26453. this.canIncludeDescriptor(o) || (i[r] = null)
  26454. }
  26455. }(),
  26456. n.prototype.canIncludeDescriptor = function(e) {
  26457. return e.status !== s.Downloading && e.status !== s.Downloaded
  26458. }
  26459. ,
  26460. n.prototype.canIncludePano = function(e, t) {
  26461. return !e.isLoaded(t)
  26462. }
  26463. ,
  26464. n.getFOVDotThreshold = function(e) {
  26465. return Math.cos(r.Math.degToRad(e / 2))
  26466. }
  26467. ;
  26468. var u = function() {
  26469. var e = function e(t, i) {
  26470. var n = e._panoSpaceDir
  26471. , r = e._fovThreshold
  26472. , o = e._fovThresholdNarrow
  26473. , a = Math.max(Math.min(n.dot(t.direction), 1), -1)
  26474. , s = Math.max(Math.min(n.dot(i.direction), 1), -1);
  26475. return t._dot = a,
  26476. i._dot = s,
  26477. 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)
  26478. };
  26479. return e._panoSpaceDir = new r.Vector3,
  26480. e._fovThreshold = -1,
  26481. e._fovThresholdNarrow = -1,
  26482. e
  26483. }();
  26484. n.sortPanoTiles = function(e, t, i) {
  26485. u._panoSpaceDir.copy(i),
  26486. l.getRelativeDirection(t.quaternion, u._panoSpaceDir),
  26487. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  26488. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV),
  26489. e.sort(u)
  26490. }
  26491. ,
  26492. n.insertSortedPanoTile = function(e, t, i, r) {
  26493. u._panoSpaceDir.copy(r),
  26494. l.getRelativeDirection(i.quaternion, u._panoSpaceDir),
  26495. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  26496. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV);
  26497. for (var o = -1, a = 0; a < e.length; a++) {
  26498. var s = u(t, e[a]);
  26499. if (s <= 0) {
  26500. o = a;
  26501. break
  26502. }
  26503. }
  26504. if (o === -1)
  26505. e[e.length] = t;
  26506. else {
  26507. for (var h = e.length; h > o; h--)
  26508. e[h] = e[h - 1];
  26509. e[o] = t
  26510. }
  26511. }
  26512. ,
  26513. n.prototype.setZoomingActive = function(e) {
  26514. e !== this.zoomingActive && (this.zoomingActive = e)
  26515. }
  26516. ,
  26517. t.exports = n
  26518. }
  26519. ).call(this, "/js/tile/TilePrioritizer.js")
  26520. }
  26521. , {
  26522. "../enum/DownloadStatus": 24,
  26523. "../enum/GLCubeFaces": 25,
  26524. "../enum/ModelManagerEvents": 33,
  26525. "../enum/PanoSizeClass": 36,
  26526. "../enum/Vectors": 50,
  26527. "../enum/Viewmode": 51,
  26528. "../objects/Panorama": 148,
  26529. "../settings": 166,
  26530. "../util/browser": 182,
  26531. "../util/logger": 189,
  26532. "../util/math": 190,
  26533. "./TileUtils": 174,
  26534. events: 202,
  26535. three: 217
  26536. }],
  26537. 173: [function(e, t, i) {
  26538. "use strict";
  26539. function n(e, t) {
  26540. this.levels = t,
  26541. this.tileSize = e,
  26542. this.root = null,
  26543. this.allNodes = [],
  26544. a(this)
  26545. }
  26546. function r(e, t) {
  26547. this.tree = e,
  26548. this.parent = t,
  26549. this.children = [],
  26550. this.id = ++u
  26551. }
  26552. function o(e, t, i, r, a, s, l, h) {
  26553. if (e) {
  26554. l = l || n.TraversalType.PreOrder;
  26555. var u = r * c + i;
  26556. if (l === n.TraversalType.PreOrder && (a && a(e, t, u, i, r),
  26557. s && s.push(e)),
  26558. e.children && 0 !== e.children.length) {
  26559. for (var d = r * c, p = i * c, f = 0; f < c; f++)
  26560. for (var g = 0; g < c; g++)
  26561. o(e.children[g * c + f], t + 1, p + f, d + g, a, s, l, h);
  26562. l === n.TraversalType.PostOrder && (a && a(e, t, u, i, r),
  26563. s && s.push(e))
  26564. }
  26565. }
  26566. }
  26567. function a(e) {
  26568. e.root = s(e, null, 0)
  26569. }
  26570. function s(e, t, i) {
  26571. if (i > e.levels)
  26572. return null;
  26573. var n = new r(e,t);
  26574. e.allNodes.push(n);
  26575. for (var o = 0; o < h; o++)
  26576. n.children[o] = s(e, n, i + 1);
  26577. return n
  26578. }
  26579. function l(e, t, i, n, r) {
  26580. if (!e)
  26581. return null;
  26582. if (0 === i)
  26583. return e;
  26584. if (!e.children || 0 === e.children.length)
  26585. return null;
  26586. var o = Math.pow(c, i)
  26587. , a = o / c
  26588. , s = n % a
  26589. , h = r % a
  26590. , u = Math.floor(r / a)
  26591. , d = Math.floor(n / a)
  26592. , p = u * c + d
  26593. , f = e.children[p];
  26594. return l(f, t + 1, i - 1, s, h)
  26595. }
  26596. var c = (e("three"),
  26597. e("./TileUtils"),
  26598. e("../objects/Panorama"),
  26599. e("../util/panorama"),
  26600. e("events").EventEmitter,
  26601. 2)
  26602. , h = c * c;
  26603. n.TraversalType = Object.freeze({
  26604. PreOrder: 0,
  26605. PostOrder: 1
  26606. });
  26607. var u = 0;
  26608. n.getLevelCountForSize = function(e, t) {
  26609. var i = 0;
  26610. for (t < e && (t = e); ; ) {
  26611. if (t /= c,
  26612. t < e)
  26613. break;
  26614. i++
  26615. }
  26616. return i
  26617. }
  26618. ,
  26619. n.getSizeForLevel = function(e, t) {
  26620. return Math.pow(c, t) * e
  26621. }
  26622. ,
  26623. n.prototype.getSubNode = function(e, t, i) {
  26624. (!t || e < this.tileSize) && (t = 0),
  26625. (!i || e < this.tileSize) && (i = 0),
  26626. e < this.tileSize && (e = this.tileSize);
  26627. var r = n.getLevelCountForSize(this.tileSize, e)
  26628. , o = l(this.root, 0, r, t, i);
  26629. return o
  26630. }
  26631. ,
  26632. n.prototype.breadthFirst = function(e) {
  26633. e = e || {};
  26634. var t = !!e.nullLevelEnd
  26635. , i = e.maxLevel
  26636. , n = e.minLevel
  26637. , r = e.callback
  26638. , o = e.saveVisited
  26639. , a = []
  26640. , s = {}
  26641. , l = 0
  26642. , c = 0;
  26643. for (a.push(this.root),
  26644. a.push(s); a.length > 0 && !(i && l > i); ) {
  26645. var h = a.shift();
  26646. if (h === s)
  26647. (!n || l >= n) && (r && t && r(null),
  26648. o && t && o.push(null)),
  26649. a.length > 0 && a.push(s),
  26650. l++,
  26651. c = 0;
  26652. else {
  26653. if (h.children)
  26654. for (var u = 0; u < h.children.length; u++) {
  26655. var d = h.children[u];
  26656. d && a.push(h.children[u])
  26657. }
  26658. var p = this.getFaceIndexFromNode(h);
  26659. (!n || l >= n) && (r && r(h, l, p),
  26660. o && o.push(h)),
  26661. c++
  26662. }
  26663. }
  26664. }
  26665. ,
  26666. n.prototype.getFaceIndexFromNode = function(e) {
  26667. if (!e)
  26668. return -1;
  26669. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  26670. var o = i.parent;
  26671. if (!o)
  26672. break;
  26673. for (var a = -1, s = 0; s < o.children.length; s++)
  26674. o.children[s] === i && (a = s);
  26675. var l = a % c
  26676. , h = Math.floor(a / c);
  26677. n = l * t + n,
  26678. r = h * t + r,
  26679. t *= c,
  26680. i = o
  26681. }
  26682. return r * t + n
  26683. }
  26684. ,
  26685. n.prototype.depthFirst = function(e, t, i) {
  26686. o(this.root, 0, 0, 0, e, t, i, this.tileSize)
  26687. }
  26688. ,
  26689. t.exports = n
  26690. }
  26691. , {
  26692. "../objects/Panorama": 148,
  26693. "../util/panorama": 191,
  26694. "./TileUtils": 174,
  26695. events: 202,
  26696. three: 217
  26697. }],
  26698. 174: [function(e, t, i) {
  26699. "use strict";
  26700. var n = e("../enum/GLCubeFaces")
  26701. , r = e("../util/MathLight")
  26702. , o = {};
  26703. o.TILE_SIZE = 512,
  26704. o.FACES_PER_PANO = 6,
  26705. o.LocationOnTile = {
  26706. Center: 0,
  26707. UpperLeft: 1,
  26708. UpperRight: 2,
  26709. LowerRight: 3,
  26710. LowerLeft: 4
  26711. },
  26712. o.getTileVector = function() {
  26713. return function(e, t, i, a, s, l, c, h) {
  26714. l = l || o.LocationOnTile.Center;
  26715. var u = e / t
  26716. , d = a / u;
  26717. s = -s + (u - 1);
  26718. var p = s / u
  26719. , f = t / e
  26720. , g = 2 * f
  26721. , m = g / 2
  26722. , v = 2 * d - 1 + m
  26723. , A = 2 * p - 1 + m;
  26724. switch (l) {
  26725. case o.LocationOnTile.UpperLeft:
  26726. v -= m,
  26727. A += m,
  26728. v += c * g;
  26729. break;
  26730. case o.LocationOnTile.UpperRight:
  26731. v += m,
  26732. A += m,
  26733. A -= c * g;
  26734. break;
  26735. case o.LocationOnTile.LowerRight:
  26736. v += m,
  26737. A -= m,
  26738. v -= c * g;
  26739. break;
  26740. case o.LocationOnTile.LowerLeft:
  26741. v -= m,
  26742. A -= m,
  26743. A += c * g;
  26744. break;
  26745. case o.LocationOnTile.Center:
  26746. }
  26747. switch (i) {
  26748. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  26749. r.setVector(h, -1, A, -v);
  26750. break;
  26751. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  26752. r.setVector(h, 1, A, v);
  26753. break;
  26754. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  26755. r.setVector(h, -v, 1, -A);
  26756. break;
  26757. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  26758. r.setVector(h, -v, -1, A);
  26759. break;
  26760. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  26761. r.setVector(h, -v, A, 1);
  26762. break;
  26763. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  26764. r.setVector(h, v, A, -1)
  26765. }
  26766. r.normalize(h)
  26767. }
  26768. }(),
  26769. o.getFaceForTile = function(e, t) {
  26770. var i = o.TILE_SIZE;
  26771. e < o.TILE_SIZE && (i = e);
  26772. var n = Math.floor(e / i)
  26773. , r = n * n;
  26774. return Math.floor(t / r)
  26775. }
  26776. ,
  26777. o.getTileLocation = function(e, t, i) {
  26778. var n = o.TILE_SIZE;
  26779. e < o.TILE_SIZE && (n = e);
  26780. var r = o.getFaceForTile(e, t)
  26781. , a = Math.floor(e / n)
  26782. , s = a * a
  26783. , l = t - r * s;
  26784. i.tileX = l % a,
  26785. i.tileY = Math.floor(l / a),
  26786. i.face = r,
  26787. i.faceTileIndex = l
  26788. }
  26789. ,
  26790. o.getTileCountForSize = function(e) {
  26791. if (e <= o.TILE_SIZE)
  26792. return o.FACES_PER_PANO;
  26793. var t = Math.floor(e / o.TILE_SIZE)
  26794. , i = t * t
  26795. , n = i * o.FACES_PER_PANO;
  26796. return n
  26797. }
  26798. ,
  26799. o.getRelativeDirection = function() {
  26800. var e = new r.Matrix4
  26801. , t = new r.Quaternion;
  26802. return function(i, n) {
  26803. t.copy(i),
  26804. t.inverse(),
  26805. e.makeRotationFromQuaternion(t),
  26806. e.applyToVector3(n),
  26807. r.normalize(n)
  26808. }
  26809. }(),
  26810. o.matchingTilesInDirection = function() {
  26811. var e = new r.Vector3
  26812. , t = new r.Vector3(0,0,-1)
  26813. , i = new r.Quaternion
  26814. , n = function(e, t) {
  26815. e.push({
  26816. face: t.face,
  26817. faceTileIndex: t.faceTileIndex,
  26818. tileX: t.tileX,
  26819. tileY: t.tileY
  26820. })
  26821. }
  26822. , a = function() {
  26823. var e = {
  26824. face: -1,
  26825. faceTileIndex: -1,
  26826. tileX: -1,
  26827. tileY: -1
  26828. };
  26829. return function(t, i, r) {
  26830. for (var a = o.getTileCountForSize(t), s = 0, l = 0; l < a; l++)
  26831. o.getTileLocation(t, l, e),
  26832. i && !i(e) || (s++,
  26833. r && n(r, e));
  26834. return s
  26835. }
  26836. }();
  26837. return function(n, s, l, c, h, u) {
  26838. var d = s < o.TILE_SIZE ? s : o.TILE_SIZE;
  26839. o.getTileCountForSize(s);
  26840. if (!c && !h)
  26841. return a(s, null, u);
  26842. var p = !!h;
  26843. if (h = h || c,
  26844. h = Math.max(0, Math.min(h, 360)),
  26845. c = Math.max(0, Math.min(c, 360)),
  26846. r.copyVector(l, e),
  26847. o.getRelativeDirection(n.quaternion, e),
  26848. p) {
  26849. i.setFromUnitVectors(e, t);
  26850. var f = function(e) {
  26851. return o.isTileWithinFrustum(s, d, e.face, e.tileX, e.tileY, i, c, h)
  26852. };
  26853. return a(s, f, u)
  26854. }
  26855. var g = function(t) {
  26856. return o.isTileWithinFOV(s, d, t.face, t.tileX, t.tileY, e, c)
  26857. };
  26858. return a(s, g, u)
  26859. }
  26860. }(),
  26861. o.isTileWithinFrustum = function() {
  26862. var e = new r.Vector3
  26863. , t = 1e-5;
  26864. return function(i, n, a, s, l, c, h, u) {
  26865. 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++)
  26866. if (o.getTileVector(i, n, m, s, l, b, 0, e),
  26867. r.applyQuaternionToVector(c, e),
  26868. e.z >= -t)
  26869. I++;
  26870. else {
  26871. var w = -1 / e.z
  26872. , _ = e.x * w
  26873. , T = e.y * w;
  26874. T > d ? v++ : T < p && A++,
  26875. _ > f ? y++ : _ < g && C++,
  26876. E++
  26877. }
  26878. return A !== E && v !== E && y !== E && C !== E
  26879. }
  26880. }(),
  26881. o.isTileWithinFOV = function() {
  26882. var e = new r.Vector3
  26883. , t = new r.Vector3(0,1,0)
  26884. , i = new r.Vector3(1,0,0);
  26885. return function(n, a, s, l, c, h, u) {
  26886. var d = o.mapFaceToCubemapFace(s);
  26887. if (r.cross(h, t, i),
  26888. o.getTileVector(n, a, d, l, c, o.LocationOnTile.Center, 0, e),
  26889. o.isWithinFOV(e, h, u, null))
  26890. return !0;
  26891. for (var p = u / 360, f = Math.floor(1 / p), g = 0, m = 0; m < f; m++) {
  26892. for (var v = o.LocationOnTile.UpperLeft; v <= o.LocationOnTile.LowerLeft; v++)
  26893. if (o.getTileVector(n, a, d, l, c, v, g, e),
  26894. o.isWithinFOV(e, h, u, null))
  26895. return !0;
  26896. g += p
  26897. }
  26898. return !1
  26899. }
  26900. }(),
  26901. o.isWithinFOV = function() {
  26902. var e = new r.Vector3
  26903. , t = new r.Vector3;
  26904. return function(i, n, o, a) {
  26905. if (r.copyVector(i, t),
  26906. a) {
  26907. r.copyVector(a, e),
  26908. r.normalize(e);
  26909. var s = r.dot(e, i);
  26910. e.x *= s,
  26911. e.y *= s,
  26912. e.z *= s,
  26913. r.subVector(t, e)
  26914. }
  26915. var l = o / 2 * r.RADIANS_PER_DEGREE
  26916. , c = Math.cos(l)
  26917. , h = r.dot(t, n);
  26918. return h >= c
  26919. }
  26920. }(),
  26921. o.mapFaceToCubemapFace = function() {
  26922. var e = {
  26923. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  26924. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  26925. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  26926. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  26927. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  26928. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  26929. };
  26930. return function(t) {
  26931. return e[t]
  26932. }
  26933. }(),
  26934. t.exports = o
  26935. }
  26936. , {
  26937. "../enum/GLCubeFaces": 25,
  26938. "../util/MathLight": 176
  26939. }],
  26940. 175: [function(e, t, i) {
  26941. (function(i) {
  26942. "use strict";
  26943. function n() {
  26944. this.list = [],
  26945. this.index = {},
  26946. Object.defineProperty(this, "length", {
  26947. get: function() {
  26948. return this.list.length
  26949. }
  26950. })
  26951. }
  26952. var r = (e("./common"),
  26953. e("./logger"));
  26954. new r(i);
  26955. n.prototype.forEach = function(e) {
  26956. this.list.forEach(e)
  26957. }
  26958. ,
  26959. n.prototype.add = function(e) {
  26960. this.list.push(e),
  26961. this.index[this.getIndex(e)] = e
  26962. }
  26963. ,
  26964. n.prototype.getIndex = function(e) {
  26965. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  26966. }
  26967. ,
  26968. n.prototype.extend = function(e) {
  26969. for (var t = 0; t < e.length; t++)
  26970. this.add(e[t])
  26971. }
  26972. ,
  26973. n.prototype.get = function(e) {
  26974. return this.index[e]
  26975. }
  26976. ,
  26977. n.prototype.first = function() {
  26978. return this.list[0]
  26979. }
  26980. ,
  26981. n.prototype.last = function() {
  26982. return this.list[this.list.length - 1]
  26983. }
  26984. ,
  26985. n.prototype.reIndex = function() {
  26986. this.index = {};
  26987. var e = this;
  26988. this.forEach(function(t) {
  26989. e.index[e.getIndex(t)] = t
  26990. })
  26991. }
  26992. ,
  26993. n.prototype.filter = function(e) {
  26994. var t = this.list.filter(e);
  26995. return this.reIndex(),
  26996. t
  26997. }
  26998. ,
  26999. n.prototype.reduce = function(e, t) {
  27000. return this.list.reduce(e, t)
  27001. }
  27002. ,
  27003. n.prototype.sort = function(e) {
  27004. return this.list.sort(e)
  27005. }
  27006. ,
  27007. n.prototype.indexOf = function(e) {
  27008. for (var t = 0; t < this.list.length; ++t)
  27009. if (this.list[t] === e)
  27010. return t;
  27011. return -1
  27012. }
  27013. ,
  27014. t.exports = n
  27015. }
  27016. ).call(this, "/js/util/IndexedCollection.js")
  27017. }
  27018. , {
  27019. "./common": 185,
  27020. "./logger": 189
  27021. }],
  27022. 176: [function(e, t, i) {
  27023. "use strict";
  27024. var n = e("../constants")
  27025. , r = {};
  27026. r.RADIANS_PER_DEGREE = Math.PI / 180,
  27027. r.DEGREES_PER_RADIAN = 180 / Math.PI,
  27028. r.Vector3 = function(e, t, i) {
  27029. this.x = e || 0,
  27030. this.y = t || 0,
  27031. this.z = i || 0
  27032. }
  27033. ,
  27034. r.Matrix4 = function() {
  27035. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  27036. arguments.length > 0 && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  27037. }
  27038. ,
  27039. r.Matrix4.prototype = {
  27040. identity: function() {
  27041. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  27042. this
  27043. },
  27044. copy: function(e) {
  27045. return this.elements.set(e.elements),
  27046. this
  27047. },
  27048. applyToVector3: function(e) {
  27049. var t = e.x
  27050. , i = e.y
  27051. , n = e.z
  27052. , r = this.elements;
  27053. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  27054. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  27055. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  27056. this
  27057. },
  27058. getInverse: function(e, t) {
  27059. var i = this.elements
  27060. , n = e.elements
  27061. , r = n[0]
  27062. , o = n[1]
  27063. , a = n[2]
  27064. , s = n[3]
  27065. , l = n[4]
  27066. , c = n[5]
  27067. , h = n[6]
  27068. , u = n[7]
  27069. , d = n[8]
  27070. , p = n[9]
  27071. , f = n[10]
  27072. , g = n[11]
  27073. , m = n[12]
  27074. , v = n[13]
  27075. , A = n[14]
  27076. , y = n[15]
  27077. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  27078. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  27079. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  27080. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  27081. , w = r * C + o * I + a * E + s * b;
  27082. if (0 === w) {
  27083. var _ = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  27084. if (t)
  27085. throw new Error(_);
  27086. return console.warn(_),
  27087. this.identity()
  27088. }
  27089. var T = 1 / w;
  27090. return i[0] = C * T,
  27091. i[1] = (v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y) * T,
  27092. i[2] = (c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y) * T,
  27093. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  27094. i[4] = I * T,
  27095. i[5] = (d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y) * T,
  27096. i[6] = (m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y) * T,
  27097. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  27098. i[8] = E * T,
  27099. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y) * T,
  27100. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y) * T,
  27101. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  27102. i[12] = b * T,
  27103. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A) * T,
  27104. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A) * T,
  27105. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  27106. this
  27107. },
  27108. makeRotationFromQuaternion: function(e) {
  27109. var t = this.elements
  27110. , i = e.x
  27111. , n = e.y
  27112. , r = e.z
  27113. , o = e.w
  27114. , a = i + i
  27115. , s = n + n
  27116. , l = r + r
  27117. , c = i * a
  27118. , h = i * s
  27119. , u = i * l
  27120. , d = n * s
  27121. , p = n * l
  27122. , f = r * l
  27123. , g = o * a
  27124. , m = o * s
  27125. , v = o * l;
  27126. return t[0] = 1 - (d + f),
  27127. t[4] = h - v,
  27128. t[8] = u + m,
  27129. t[1] = h + v,
  27130. t[5] = 1 - (c + f),
  27131. t[9] = p - g,
  27132. t[2] = u - m,
  27133. t[6] = p + g,
  27134. t[10] = 1 - (c + d),
  27135. t[3] = 0,
  27136. t[7] = 0,
  27137. t[11] = 0,
  27138. t[12] = 0,
  27139. t[13] = 0,
  27140. t[14] = 0,
  27141. t[15] = 1,
  27142. this
  27143. }
  27144. },
  27145. r.Quaternion = function(e, t, i, n) {
  27146. this._x = e || 0,
  27147. this._y = t || 0,
  27148. this._z = i || 0,
  27149. this._w = void 0 !== n ? n : 1
  27150. }
  27151. ,
  27152. r.Quaternion.prototype = {
  27153. get x() {
  27154. return this._x
  27155. },
  27156. set x(e) {
  27157. this._x = e
  27158. },
  27159. get y() {
  27160. return this._y
  27161. },
  27162. set y(e) {
  27163. this._y = e
  27164. },
  27165. get z() {
  27166. return this._z
  27167. },
  27168. set z(e) {
  27169. this._z = e
  27170. },
  27171. get w() {
  27172. return this._w
  27173. },
  27174. set w(e) {
  27175. this._w = e
  27176. },
  27177. copy: function(e) {
  27178. this._x = e.x,
  27179. this._y = e.y,
  27180. this._z = e.z,
  27181. this._w = e.w
  27182. },
  27183. inverse: function() {
  27184. return this.conjugate().normalize()
  27185. },
  27186. conjugate: function() {
  27187. return this._x *= -1,
  27188. this._y *= -1,
  27189. this._z *= -1,
  27190. this
  27191. },
  27192. length: function() {
  27193. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  27194. },
  27195. normalize: function() {
  27196. var e = this.length();
  27197. return 0 === e ? (this._x = 0,
  27198. this._y = 0,
  27199. this._z = 0,
  27200. this._w = 1) : (e = 1 / e,
  27201. this._x = this._x * e,
  27202. this._y = this._y * e,
  27203. this._z = this._z * e,
  27204. this._w = this._w * e),
  27205. this
  27206. },
  27207. setFromAxisAngle: function(e, t) {
  27208. var i = t / 2
  27209. , n = Math.sin(i);
  27210. return this._x = e.x * n,
  27211. this._y = e.y * n,
  27212. this._z = e.z * n,
  27213. this._w = Math.cos(i),
  27214. this
  27215. },
  27216. setFromUnitVectors: function() {
  27217. var e, t, i = 1e-6;
  27218. return function(n, o) {
  27219. return void 0 === e && (e = new r.Vector3),
  27220. t = r.dot(n, o) + 1,
  27221. t < i ? (t = 0,
  27222. 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),
  27223. this._x = e.x,
  27224. this._y = e.y,
  27225. this._z = e.z,
  27226. this._w = t,
  27227. this.normalize()
  27228. }
  27229. }(),
  27230. multiply: function(e) {
  27231. return this.multiplyQuaternions(this, e)
  27232. },
  27233. premultiply: function(e) {
  27234. return this.multiplyQuaternions(e, this)
  27235. },
  27236. multiplyQuaternions: function(e, t) {
  27237. var i = e._x
  27238. , n = e._y
  27239. , r = e._z
  27240. , o = e._w
  27241. , a = t._x
  27242. , s = t._y
  27243. , l = t._z
  27244. , c = t._w;
  27245. return this._x = i * c + o * a + n * l - r * s,
  27246. this._y = n * c + o * s + r * a - i * l,
  27247. this._z = r * c + o * l + i * s - n * a,
  27248. this._w = o * c - i * a - n * s - r * l,
  27249. this
  27250. }
  27251. },
  27252. r.convertWorkshopVector = function(e) {
  27253. return new r.Vector3(-e.x,e.y,e.z)
  27254. }
  27255. ,
  27256. r.convertWorkshopQuaternion = function(e) {
  27257. 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))
  27258. }
  27259. ;
  27260. r.convertWorkshopOrthoZoom = function(e) {//xzw
  27261. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / n.workshopApsect
  27262. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  27263. }
  27264. ,
  27265. r.convertWorkshopPanoramaQuaternion = function(e) {
  27266. 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))
  27267. }
  27268. ,
  27269. r.normalize = function(e) {
  27270. var t = e.x * e.x + e.y * e.y + e.z * e.z
  27271. , i = Math.sqrt(t);
  27272. e.x /= i,
  27273. e.y /= i,
  27274. e.z /= i
  27275. }
  27276. ,
  27277. r.dot = function(e, t) {
  27278. return e.x * t.x + e.y * t.y + e.z * t.z
  27279. }
  27280. ,
  27281. r.cross = function(e, t, i) {
  27282. var n = e.x
  27283. , r = e.y
  27284. , o = e.z;
  27285. i.x = r * t.z - o * t.y,
  27286. i.y = o * t.x - n * t.z,
  27287. i.z = n * t.y - r * t.x
  27288. }
  27289. ,
  27290. r.setVector = function(e, t, i, n) {
  27291. e.x = t,
  27292. e.y = i,
  27293. e.z = n
  27294. }
  27295. ,
  27296. r.copyVector = function(e, t) {
  27297. t.x = e.x,
  27298. t.y = e.y,
  27299. t.z = e.z
  27300. }
  27301. ,
  27302. r.addVector = function(e, t) {
  27303. e.x += t.x,
  27304. e.y += t.y,
  27305. e.z += t.z
  27306. }
  27307. ,
  27308. r.subVector = function(e, t) {
  27309. e.x -= t.x,
  27310. e.y -= t.y,
  27311. e.z -= t.z
  27312. }
  27313. ,
  27314. r.applyQuaternionToVector = function(e, t) {
  27315. var i = t.x
  27316. , n = t.y
  27317. , r = t.z
  27318. , o = e.x
  27319. , a = e.y
  27320. , s = e.z
  27321. , l = e.w
  27322. , c = l * i + a * r - s * n
  27323. , h = l * n + s * i - o * r
  27324. , u = l * r + o * n - a * i
  27325. , d = -o * i - a * n - s * r;
  27326. t.x = c * l + d * -o + h * -s - u * -a,
  27327. t.y = h * l + d * -a + u * -o - c * -s,
  27328. t.z = u * l + d * -s + c * -a - h * -o
  27329. }
  27330. ,
  27331. r.angleBetweenVectors = function(e, t) {
  27332. return Math.acos(r.dot(e, t))
  27333. }
  27334. ,
  27335. t.exports = r
  27336. }
  27337. , {
  27338. "../constants": 8
  27339. }],
  27340. 177: [function(e, t, i) {
  27341. (function(i) {
  27342. "use strict";
  27343. function n(e) {
  27344. this.cache = null,
  27345. this.expires = 0
  27346. }
  27347. function r() {
  27348. this.baseUrl = null,
  27349. this.cache = null,
  27350. this.expires = 0
  27351. }
  27352. function o() {
  27353. this.baseUrl = null,
  27354. this.expires = 0
  27355. }
  27356. function a(e) {
  27357. this.initialLoadingPromise = null,
  27358. this.endpoint = e + "?type=3",
  27359. this.urlContainer = null,
  27360. this.authorizationHeader = h.getAuthorizationHeader(),
  27361. this.containerClasses = [o, r, n]
  27362. }
  27363. var s = e("./ajax")
  27364. , l = e("./logger")
  27365. , c = e("../constants")
  27366. , h = e("./showcase")
  27367. , u = (e("../ab"),
  27368. new l(i));
  27369. n.prototype = {
  27370. version: 1,
  27371. validate: function(e) {
  27372. return "catalog.json"in e && Object.keys(e).length > 0
  27373. },
  27374. update: function(e) {
  27375. return this.cache = e,
  27376. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  27377. $.when()
  27378. },
  27379. get: function(e) {
  27380. return this.cache[e]
  27381. }
  27382. },
  27383. r.prototype = {
  27384. version: 2,
  27385. validate: function(e) {
  27386. return "catalog.json"in e && "base.url"in e && Object.keys(e).length > 1
  27387. },
  27388. update: function(e) {
  27389. return this.baseUrl = e["base.url"],
  27390. this.cache = e,
  27391. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  27392. $.when()
  27393. },
  27394. get: function(e) {
  27395. var t = this.cache[e];
  27396. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  27397. }
  27398. },
  27399. o.prototype = {
  27400. version: 3,
  27401. validate: function(e) {
  27402. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  27403. },
  27404. update: function(e) {
  27405. return this.baseUrl = e.templates[0],
  27406. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  27407. $.when()
  27408. },
  27409. get: function(e) {
  27410. return this.baseUrl.replace("{{filename}}", e)
  27411. }
  27412. },
  27413. a.prototype = {
  27414. init: function() {
  27415. return this.initialLoadingPromise ? this.initialLoadingPromise : (setInterval(function() {
  27416. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  27417. Date.now() + c.signedUrlRefreshBuffer > e && (u.debug("Refreshing urls..."),
  27418. this.refresh().done(function() {
  27419. u.debug("Refreshed")
  27420. }).fail(function() {
  27421. u.error("Failed url refresh, urls might go stale soon")
  27422. }))
  27423. }
  27424. .bind(this), c.signedUrlCheckInterval),
  27425. this.initialLoadingPromise = this.refresh(),
  27426. this.initialLoadingPromise)
  27427. },
  27428. refresh: function(e) { //已经在someData.js里加载过了 不用再加载file了吧
  27429. e = e || {};
  27430. /*var t = void 0 === e.cache || e.cache;
  27431. return s.get( this.endpoint , { //file
  27432. responseType: "json",
  27433. prefetchFrom: t ? "files" : null,
  27434. cache: t,
  27435. auth: this.authorizationHeader
  27436. }).then(function(e) {
  27437. if (this.urlContainer && this.urlContainer.validate(e))
  27438. return this.urlContainer.update(e);
  27439. for (var i = 0; i < this.containerClasses.length; i++) {
  27440. var n = this.containerClasses[i]
  27441. , r = new n;
  27442. if (r.validate(e))
  27443. return u.info("Using urls version " + r.version),
  27444. this.urlContainer = r,
  27445. this.urlContainer.update(e)
  27446. }
  27447. return t ? this.refresh({
  27448. cache: !1
  27449. }) : $.Deferred().reject("missing-urls")
  27450. }
  27451. .bind(this), function(e) {
  27452. return "loading-failed"
  27453. }) */
  27454. return $.Deferred().resolve();
  27455. },
  27456. get: function(e) {
  27457. //return this.urlContainer.get(e)
  27458. return window.MP_PREFETCHED_MODELDATA.files.templates[0].replace("{{filename}}", e)
  27459. }
  27460. },
  27461. t.exports = a
  27462. }
  27463. ).call(this, "/js/util/ModelUrls.js")
  27464. }
  27465. , {
  27466. "../ab": 3,
  27467. "../constants": 8,
  27468. "./ajax": 181,
  27469. "./logger": 189,
  27470. "./showcase": 193
  27471. }],
  27472. 178: [function(e, t, i) {
  27473. (function(i) {
  27474. "use strict";
  27475. function n() {
  27476. u.call(this),
  27477. this.neighbourMap = {},
  27478. this.map = null
  27479. }
  27480. var r = e("three")
  27481. , o = e("./common")
  27482. , a = e("../settings")
  27483. , s = e("../objects/Panorama")
  27484. , a = e("../settings")
  27485. , l = e("./aStar")
  27486. , c = e("./logger")
  27487. , h = new c(i)
  27488. , u = e("./IndexedCollection")
  27489. , d = e("./transitions");
  27490. o.inherit(n, u),
  27491. n.prototype.getIndex = function(e) {
  27492. return e.id
  27493. }
  27494. ,
  27495. n.prototype.find = function(e, t) {
  27496. var i = o.filterAll(this.list, e);
  27497. return 0 === i.length ? null : (t && t.forEach(function(e) {
  27498. i = o.stableSort(i, e)
  27499. }),
  27500. i[0])
  27501. }
  27502. ,
  27503. n.prototype.sortByScore = function(e, t) {
  27504. var i = o.filterAll(this.list, e);
  27505. return 0 === i.length ? null : i = i.map(function(e) {
  27506. return {
  27507. pano: e,
  27508. score: t.reduce(function(t, i) {
  27509. return t + i(e)
  27510. }, 0)
  27511. }
  27512. }).sort(function(e, t) {
  27513. return t.score - e.score;
  27514. })
  27515. }
  27516. ,
  27517. n.prototype.lowestByScore = function(e, t, i) {
  27518. return this.findRankedByScore(0, e, t, i)
  27519. }
  27520. ,
  27521. n.prototype.findRankedByScore = function(e, t, i, n) {
  27522. n && (n.candidates = null,
  27523. n.pano = null),
  27524. e || (e = 0);
  27525. var r = this.sortByScore(t, i);
  27526. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  27527. n.pano = r[e].pano),
  27528. r[e].pano)
  27529. }
  27530. ,
  27531. n.prototype.showPanoScores = function(e) {
  27532. this.list.forEach(function(e) {
  27533. e.removeTextSprite()
  27534. });
  27535. var t = 6344768;
  27536. e.forEach(function(e) {
  27537. e.pano.addTextSprite(e.score.toFixed(2), t),
  27538. t = 16428055
  27539. })
  27540. }
  27541. ,
  27542. n.prototype.isNeighbour = function(e, t) {
  27543. return this.neighbourMap[e.id][t.id]
  27544. }
  27545. ,
  27546. n.prototype.getNeighbours = function(e) {
  27547. return this.neighbourMap[e.id]
  27548. }
  27549. ,
  27550. n.prototype.setNeighbour = function(e, t, i) {
  27551. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  27552. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  27553. this.neighbourMap[e.id][e.id] = !0,
  27554. this.neighbourMap[t.id][t.id] = !0,
  27555. this.neighbourMap[e.id][t.id] = i,
  27556. this.neighbourMap[t.id][e.id] = i,
  27557. this.neighbourMap[e.id]
  27558. }
  27559. ,
  27560. n.prototype.findClosest = function(e, t) {
  27561. var i = [s.filters.isPanoAligned()];
  27562. return t && i.push(s.filters.inDirection(e, t, .75)),
  27563. this.find(i, [s.sortFunctions.distanceToPoint(e)])
  27564. }
  27565. ,
  27566. n.prototype.dualNeighbors = function(e, t) {
  27567. var i, n = [];
  27568. for (i in this.neighbourMap[e.id])
  27569. this.neighbourMap[t.id][i] && n.push(i);
  27570. return n
  27571. }
  27572. ,
  27573. n.prototype.populate_path_graph = function() {
  27574. 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;
  27575. for (e = 0; e < this.list.length; e += 1) {
  27576. o = this.list[e],
  27577. s = {},
  27578. l = !1,
  27579. i = o.neighbourPanos || o.findNeighourPanos();
  27580. for (t in i)
  27581. if (i[t]) {
  27582. a = this.index[t],
  27583. p.copy(o.floorPosition),
  27584. p.sub(a.floorPosition);
  27585. var m = Math.sqrt(p.x * p.x + p.z * p.z)
  27586. , v = (Math.abs(p.y) / Math.max(m, .01),
  27587. Math.max(0, Math.abs(p.y) - .2));
  27588. v > 0 ? (f += 1,
  27589. v = Math.pow(4 * v, 2),
  27590. m = Math.pow(m, 2),
  27591. n = Math.sqrt(v * v + m * m)) : (g += 1,
  27592. n = p.length()),
  27593. s[a.id] = n,
  27594. l = !0
  27595. }
  27596. l ? u[o.id] = s : d += 1
  27597. }
  27598. this.map = u,
  27599. h.info("graph ready in " + (Date.now() - c) + "ms, " + d + " had no neighbors")
  27600. }
  27601. ,
  27602. n.prototype.aStarSearch = function(e, t) {
  27603. var i = Date.now()
  27604. , n = new l({
  27605. start: e,
  27606. isEnd: function(e) {
  27607. return e === t
  27608. },
  27609. neighbor: function(e) {
  27610. var t = e.neighbourPanos || e.findNeighourPanos()
  27611. , i = [];
  27612. for (var n in t)
  27613. i.push(this.index[n]);
  27614. return i
  27615. }
  27616. .bind(this),
  27617. distance: function(e, t) {
  27618. var i = this.map[e.id]
  27619. , n = i[t.id];
  27620. return n
  27621. }
  27622. .bind(this),
  27623. heuristic: function(e, t) {
  27624. return 1
  27625. }
  27626. .bind(this),
  27627. hash: function(e) {
  27628. return e.id
  27629. },
  27630. timeout: 5e3
  27631. });
  27632. if (h.debug("A* search in " + (Date.now() - i) + "ms"),
  27633. "success" !== n.status)
  27634. return h.debug("Did not find A* path from " + e + " to " + t),
  27635. null;
  27636. h.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  27637. var r = [];
  27638. return n.path.forEach(function(e) {
  27639. r.push(e.id)
  27640. }),
  27641. r
  27642. }
  27643. ,
  27644. n.prototype.includeNodesNearPath = function() {
  27645. var e = new r.Vector3
  27646. , t = new r.Vector3
  27647. , i = new r.Vector3
  27648. , n = new r.Vector3
  27649. , o = new r.Vector3
  27650. , a = new r.Vector3
  27651. , s = new r.Vector3
  27652. , l = new r.Vector3
  27653. , c = []
  27654. , h = new r.Vector3
  27655. , u = new r.Vector3;
  27656. return function(r, d) {
  27657. if (r)
  27658. for (var p = function(e, t, i) {
  27659. return o.copy(t).sub(e),
  27660. o.dot(i)
  27661. }, f = function(e, t) {
  27662. return p(h, e.position, i) - p(h, t.position, i)
  27663. }, g = 0; g < r.length - 1; ) {
  27664. var m = r[g]
  27665. , v = r[g + 1]
  27666. , A = this.index[m]
  27667. , y = this.index[v];
  27668. h.copy(A.position),
  27669. u.copy(y.position),
  27670. c.length = 0,
  27671. e.copy(u).sub(h),
  27672. i.copy(e).normalize();
  27673. for (var C = 0; C < this.list.length; C++) {
  27674. var I = this.list[C];
  27675. o.copy(I.position).sub(h);
  27676. var E = o.dot(i);
  27677. if (E > 0) {
  27678. s.copy(i),
  27679. s.multiplyScalar(E),
  27680. a.copy(o),
  27681. a.sub(s);
  27682. var b = a.length();
  27683. if (b < d) {
  27684. t.copy(e).negate(),
  27685. n.copy(t).normalize(),
  27686. l.copy(I.position).sub(u);
  27687. var w = l.dot(n);
  27688. w > 0 && c.push(I)
  27689. }
  27690. }
  27691. }
  27692. if (c.length > 0) {
  27693. c.sort(f);
  27694. for (var _ = r.length + c.length - 1; _ >= g + c.length; _--)
  27695. r[_] = r[_ - c.length];
  27696. for (var T = 0; T < c.length; T++)
  27697. r[T + g + 1] = c[T].id
  27698. }
  27699. g += c.length + 1
  27700. }
  27701. }
  27702. }(),
  27703. n.prototype.fadeMarkerOpacity = function(e, t) {
  27704. var i = void 0 === e ? a.panorama.markerOpacity : e
  27705. , n = this.list.findIndex(function(e) {
  27706. return e.marker
  27707. });
  27708. if (!(n < 0)) {
  27709. var r = this.list[n].marker.material.opacity;
  27710. if (r !== e) {
  27711. var o = i - r;
  27712. d.trigger({
  27713. func: function(e, t) {
  27714. var i = r + e * o;
  27715. this.forEach(function(e) {
  27716. e.marker && (e.marker.material.opacity = i)
  27717. })
  27718. }
  27719. .bind(this),
  27720. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  27721. name: "_fpm"
  27722. })
  27723. }
  27724. }
  27725. }
  27726. ,
  27727. t.exports = n
  27728. }
  27729. ).call(this, "/js/util/PanoramaCollection.js")
  27730. }
  27731. , {
  27732. "../objects/Panorama": 148,
  27733. "../settings": 166,
  27734. "./IndexedCollection": 175,
  27735. "./aStar": 180,
  27736. "./common": 185,
  27737. "./logger": 189,
  27738. "./transitions": 195,
  27739. three: 217
  27740. }],
  27741. 179: [function(e, t, i) {
  27742. "use strict";
  27743. function n() {
  27744. this.actionSequence = [],
  27745. this.actionSequenceInProgress = !1
  27746. }
  27747. function r(e, t, i, n) {
  27748. s.trackAlways("zoom_" + e, {
  27749. from: t,
  27750. to: i,
  27751. pano: n
  27752. })
  27753. }
  27754. function o(e, t) {
  27755. r("initial", 1, e, t)
  27756. }
  27757. function a(e, t, i) {
  27758. r("followup", e, t, i)
  27759. }
  27760. var s = e("../analytics");
  27761. n.prototype.reset = function(e) {
  27762. this.actionSequenceInProgress = !1,
  27763. this.actionSequence.length = 0
  27764. }
  27765. ,
  27766. n.prototype.addZoomAction = function() {
  27767. var e = null
  27768. , t = null
  27769. , i = !1
  27770. , n = function() {
  27771. if (e = null,
  27772. this.actionSequence.length > 0) {
  27773. var i = this.actionSequence[0].start
  27774. , n = this.actionSequence[this.actionSequence.length - 1].end;
  27775. 1 === i ? o(n, t) : a(i, n, t)
  27776. }
  27777. this.reset()
  27778. };
  27779. return function(r, o, a) {
  27780. if (r !== o) {
  27781. i || (n = n.bind(this),
  27782. i = !0),
  27783. e && (window.clearTimeout(e),
  27784. e = null),
  27785. a === t && this.actionSequenceInProgress || (this.reset(),
  27786. t = a),
  27787. this.actionSequenceInProgress = !0;
  27788. var s = {
  27789. start: r,
  27790. end: o
  27791. };
  27792. this.actionSequence.push(s),
  27793. e = window.setTimeout(n, 150)
  27794. }
  27795. }
  27796. }(),
  27797. t.exports = n
  27798. }
  27799. , {
  27800. "../analytics": 4
  27801. }],
  27802. 180: [function(e, t, i) {
  27803. "use strict";
  27804. function n(e) {
  27805. void 0 === e.timeout && (e.timeout = 1 / 0);
  27806. var t = e.hash || o
  27807. , i = {
  27808. data: e.start,
  27809. g: 0,
  27810. h: e.heuristic(e.start)
  27811. }
  27812. , n = i;
  27813. i.f = i.h;
  27814. var h = new s
  27815. , u = new l(a)
  27816. , d = c();
  27817. u.push(i),
  27818. d.set(t(i.data), i);
  27819. for (var p = new Date; u.size(); ) {
  27820. if (new Date - p > e.timeout)
  27821. return {
  27822. status: "timeout",
  27823. cost: n.g,
  27824. path: r(n)
  27825. };
  27826. var f = u.pop();
  27827. if (d.delete(t(f.data)),
  27828. e.isEnd(f.data))
  27829. return {
  27830. status: "success",
  27831. cost: f.g,
  27832. path: r(f)
  27833. };
  27834. h.add(t(f.data));
  27835. for (var g = e.neighbor(f.data), m = 0; m < g.length; m++) {
  27836. var v = g[m];
  27837. if (!h.contains(t(v))) {
  27838. var A = f.g + e.distance(f.data, v)
  27839. , y = d.get(t(v))
  27840. , C = !1;
  27841. if (void 0 === y)
  27842. y = {
  27843. data: v
  27844. },
  27845. d.set(t(v), y);
  27846. else {
  27847. if (y.g < A)
  27848. continue;
  27849. C = !0
  27850. }
  27851. y.parent = f,
  27852. y.g = A,
  27853. y.h = e.heuristic(v),
  27854. y.f = A + y.h,
  27855. y.h < n.h && (n = y),
  27856. C ? u.heapify() : u.push(y)
  27857. }
  27858. }
  27859. }
  27860. return {
  27861. status: "noPath",
  27862. cost: n.g,
  27863. path: r(n)
  27864. }
  27865. }
  27866. function r(e) {
  27867. if (void 0 !== e.parent) {
  27868. var t = r(e.parent);
  27869. return t.push(e.data),
  27870. t
  27871. }
  27872. return [e.data]
  27873. }
  27874. function o(e) {
  27875. return e.toString()
  27876. }
  27877. function a(e, t) {
  27878. return e.f - t.f
  27879. }
  27880. var s = e("Set")
  27881. , l = e("heap")
  27882. , c = e("dict");
  27883. t.exports = n
  27884. }
  27885. , {
  27886. Set: 196,
  27887. dict: 210,
  27888. heap: 211
  27889. }],
  27890. 181: [function(e, t, i) {
  27891. (function(i) {
  27892. "use strict";
  27893. function n(e, t, i) {
  27894. var n = new XMLHttpRequest;
  27895. if (i && "withCredentials"in n)
  27896. n.open(e, t, i);
  27897. else if ("undefined" != typeof XDomainRequest)
  27898. n = new XDomainRequest,
  27899. n.open(e, t);
  27900. else {
  27901. if (i)
  27902. throw "Browser does not support CORS!";
  27903. n.open(e, t)
  27904. }
  27905. return n
  27906. }
  27907. function r(e, t, i) {
  27908. function o() {
  27909. u.warn("Retrying ", t),
  27910. r(e, t, i).done(c.resolve.bind(c)).progress(c.notify.bind(c)).fail(c.reject.bind(c))
  27911. }
  27912. function a(e, t) {
  27913. var i = e.response;
  27914. if ("json" === t && "object" != typeof i)
  27915. try {
  27916. i = JSON.parse(e.responseText)
  27917. } catch (e) {
  27918. return void c.reject({
  27919. error: "Failed parsing JSON"
  27920. })
  27921. }
  27922. else if ("image/jpeg" === t) {
  27923. var n = new Uint8Array(e.response)
  27924. , r = new Blob([n],{
  27925. type: "image/jpeg"
  27926. })
  27927. , o = URL.createObjectURL(r);
  27928. i = new Image,
  27929. i.src = o,
  27930. i.crossOrigin = "Anonymous",
  27931. i.onload = function() {
  27932. URL.revokeObjectURL(o)
  27933. }
  27934. }
  27935. return i
  27936. }
  27937. var s = n(e, t, !1);
  27938. if (i = i || {},
  27939. i.retries = void 0 !== i.retries ? i.retries : 0,
  27940. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  27941. i.responseType)
  27942. if (["arraybuffer", "text", "json"].indexOf(i.responseType) > -1)
  27943. s.responseType = i.responseType;
  27944. else {
  27945. if ("image/jpeg" !== i.responseType)
  27946. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  27947. s.responseType = "arraybuffer"
  27948. }
  27949. if ("json" === i.responseType && s.setRequestHeader("Accept", "application/json"),
  27950. i.auth && s.setRequestHeader("Authorization", i.auth),
  27951. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  27952. s.setRequestHeader("Content-Type", "application/json")),
  27953. "object" == typeof i.headers)
  27954. for (var l in i.headers)
  27955. s.setRequestHeader(l, i.headers[l]);
  27956. var c = $.Deferred();
  27957. return s.onreadystatechange = function(e) {
  27958. if (4 === this.readyState)
  27959. if (this.status >= 500 && this.status <= 600 && i.retry && i.retries < 3)
  27960. i.retries++,
  27961. setTimeout(o, 1e3);
  27962. else if (200 === this.status) {
  27963. var t = a(this, i.responseType);
  27964. c.resolve(t)
  27965. } else
  27966. c.reject(this)
  27967. }
  27968. ,
  27969. s.onprogress = function(e) {
  27970. c.notify(e)
  27971. }
  27972. ,
  27973. s.send(i.data),
  27974. c.promise()
  27975. }
  27976. function o(e) {
  27977. return Object.keys(e).sort().map(function(t) {
  27978. return {
  27979. key: t,
  27980. value: e[t]
  27981. }
  27982. })
  27983. }
  27984. function a(e, t) {
  27985. var i = t.responseType || null
  27986. , n = t.auth || null
  27987. , r = t.prefetchFrom || null
  27988. , a = e + "__" + i + "__" + n + "__" + r;
  27989. return t.headers && o(t.headers).forEach(function(e) {
  27990. a += "__" + e.key + ":" + e.value
  27991. }),
  27992. a
  27993. }
  27994. function s(e, t) {
  27995. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[a(e, t)] : null
  27996. }
  27997. function l(e, t, i) {
  27998. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[a(e, t)] = i)
  27999. }
  28000. var c = e("./logger")
  28001. , h = e("../ab")
  28002. , u = new c(i);
  28003. window.URL = window.URL || window.webkitURL,
  28004. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  28005. window.MP_PREFETCHED_MODELDATA = window.MP_PREFETCHED_MODELDATA || {}
  28006. /* setTimeout(function() {//MP-- xzw delete
  28007. window.MP_REQUEST_CACHE = null,
  28008. window.MP_PREFETCHED_MODELDATA = {}
  28009. }, 6e4),
  28010. window.onpageshow = function(e) {
  28011. e.persisted && (window.MP_REQUEST_CACHE = null,
  28012. window.MP_PREFETCHED_MODELDATA = {})
  28013. } */
  28014. ,
  28015. t.exports = {
  28016. get: function(e, t) {
  28017. t = t || {};
  28018. var i = void 0 === t.cache || t.cache;
  28019. if (i) {
  28020. var n = s(e, t);
  28021. if (n)
  28022. return n
  28023. }
  28024. var o;
  28025. return o = t.prefetchFrom && window.MP_PREFETCHED_MODELDATA[t.prefetchFrom] ? $.when(window.MP_PREFETCHED_MODELDATA[t.prefetchFrom]) : r("GET", e, t),
  28026. i && l(e, t, o),
  28027. o
  28028. },
  28029. post: function(e, t) {
  28030. return r("POST", e, t)
  28031. },
  28032. patch: function(e, t) {
  28033. return r("PATCH", e, t)
  28034. },
  28035. getImage: function(e, t) {
  28036. function i() {
  28037. u.warn("Retrying ", e),
  28038. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  28039. }
  28040. var n = $.Deferred()
  28041. , r = new Image
  28042. , o = this;
  28043. return e = h.changeIfImageOptimzing(e),
  28044. null !== t && void 0 !== t || (t = 3),
  28045. r.onerror = function() {
  28046. t > 0 ? setTimeout(i, 1e3) : n.reject()
  28047. }
  28048. ,
  28049. r.onload = function() {
  28050. n.resolve(r)
  28051. }
  28052. ,
  28053. r.crossOrigin = "anonymous",
  28054. r.src = e,
  28055. n
  28056. }
  28057. }
  28058. }
  28059. ).call(this, "/js/util/ajax.js")
  28060. }
  28061. , {
  28062. "../ab": 3,
  28063. "./logger": 189
  28064. }],
  28065. 182: [function(e, t, i) {
  28066. "use strict";
  28067. function n(e, t) {
  28068. var i = window.navigator.userAgent
  28069. , n = i.match(e);
  28070. return n = n ? n[1].split(t) : [],
  28071. {
  28072. major: parseInt(n[0]) || 0,
  28073. minor: parseInt(n[1]) || 0,
  28074. patch: parseInt(n[2]) || 0
  28075. }
  28076. }
  28077. var r = e("../exception/DeviceMismatchException");
  28078. t.exports = {
  28079. isFullscreen: function() {
  28080. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  28081. },
  28082. supportsFullscreen: function() {
  28083. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  28084. },
  28085. isPointerLocked: function() {
  28086. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  28087. },
  28088. requestFullscreen: function(e, t) {
  28089. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  28090. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  28091. },
  28092. requestPointerLock: function() {
  28093. var e;
  28094. if (document.fullscreenElement)
  28095. e = document.fullscreenElement();
  28096. else if (document.mozFullscreenElement)
  28097. e = document.mozFullscreenElement();
  28098. else if (document.mozFullScreenElement)
  28099. e = document.mozFullScreenElement();
  28100. else {
  28101. if (!document.webkitFullscreenElement)
  28102. return;
  28103. e = document.webkitFullscreenElement()
  28104. }
  28105. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  28106. e.requestPointerLock(),
  28107. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  28108. },
  28109. exitPointerLock: function() {
  28110. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  28111. document.exitPointerLock()
  28112. },
  28113. exitFullscreen: function() {
  28114. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  28115. },
  28116. details: function() {
  28117. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  28118. return e ? {
  28119. name: e[1],
  28120. version: parseInt(e[2]),
  28121. platform: navigator.platform
  28122. } : {}
  28123. },
  28124. is: function(e) {
  28125. return this.details() && this.details().name === e
  28126. },
  28127. inIframe: function() {
  28128. return window.parent !== window
  28129. },
  28130. aspectRatio: function() {
  28131. var e = $("#player").width() / $("#player").height();
  28132. return isFinite(e) ? e : 0
  28133. },
  28134. userAgent: function() {
  28135. return window.navigator.userAgent
  28136. },
  28137. isMobile: function() {
  28138. var e = navigator.userAgent || navigator.vendor || window.opera;
  28139. 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))
  28140. },
  28141. isLandscape: function() {
  28142. return this.isMobile && this.aspectRatio() > 1
  28143. },
  28144. isSmallScreen: function() {
  28145. var e = screen.width / window.devicePixelRatio;
  28146. return e < 240
  28147. },
  28148. detectIE: function() {
  28149. var e = window.navigator.userAgent
  28150. , t = e.indexOf("MSIE ");
  28151. return t !== -1 || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  28152. },
  28153. detectSafari: function() {
  28154. var e = window.navigator.userAgent
  28155. , t = e.indexOf("Safari");
  28156. return t !== -1 && !this.detectChrome()
  28157. },
  28158. detectFirefox: function() {
  28159. var e = window.navigator.userAgent;
  28160. return e.indexOf("Firefox") !== -1
  28161. },
  28162. detectChrome: function() {
  28163. var e = window.navigator.userAgent;
  28164. return e.indexOf("Chrome") !== -1 && !this.detectOpera()
  28165. },
  28166. detectOpera: function() {
  28167. var e = window.navigator.userAgent;
  28168. return e.indexOf("OPR") !== -1
  28169. },
  28170. detectIOS: function() {
  28171. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  28172. },
  28173. detectIPad: function() {
  28174. var e = window.navigator.userAgent
  28175. , t = /iPad/;
  28176. return t.test(e)
  28177. },
  28178. detectIPod: function() {
  28179. var e = window.navigator.userAgent
  28180. , t = /iPod/;
  28181. return t.test(e)
  28182. },
  28183. detectIPhone: function() {
  28184. var e = window.navigator.userAgent
  28185. , t = /iPhone/;
  28186. return t.test(e)
  28187. },
  28188. detectAndroid: function() {
  28189. var e = window.navigator.userAgent;
  28190. return e.indexOf("Android") !== -1
  28191. },
  28192. detectAndroidMobile: function() {
  28193. var e = window.navigator.userAgent;
  28194. return this.detectAndroid() && e.indexOf("Mobile") !== -1
  28195. },
  28196. detectSamsungNative: function() {
  28197. var e = window.navigator.userAgent;
  28198. return e.indexOf("SM-G900H") !== -1 || e.indexOf("GT-I9500") !== -1 || e.indexOf("SM-N900") !== -1
  28199. },
  28200. detectSamsungS6: function() {
  28201. var e = window.navigator.userAgent;
  28202. return e.indexOf("SM-G92") !== -1
  28203. },
  28204. detectWebVR: function() {
  28205. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  28206. },
  28207. getVRDisplay: function() {
  28208. var e = $.Deferred();
  28209. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(t) {
  28210. t.length >= 1 && e.resolve(t[0]),
  28211. e.reject(null)
  28212. }),
  28213. e) : e.reject(null)
  28214. },
  28215. iosVersion: function() {
  28216. if (!this.detectIOS())
  28217. throw new r("Did not detect an iDevice");
  28218. var e = /((?:\d+\_?){1,3}) like Mac OS/
  28219. , t = "_";
  28220. return n(e, t)
  28221. },
  28222. androidVersion: function() {
  28223. if (!this.detectAndroid())
  28224. throw new r("Did not detect an Android based device");
  28225. var e = /Android ((?:\d+\.?){1,3})/
  28226. , t = ".";
  28227. return n(e, t)
  28228. },
  28229. valueFromCookie: function(e, t) {
  28230. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  28231. if (!i)
  28232. return t;
  28233. var n = i[1];
  28234. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  28235. },
  28236. valueFromHash: function(e, t) {
  28237. var i = new RegExp("[#&?]" + e + "=([^#&?]*)")
  28238. , n = i.exec(window.location.href);
  28239. if (!n)
  28240. return t;
  28241. var r = n[1];
  28242. return "boolean" == typeof t ? "true" === r || "1" === r : "number" == typeof t ? parseFloat(r) : window.decodeURIComponent(r)
  28243. }
  28244. }
  28245. }
  28246. , {
  28247. "../exception/DeviceMismatchException": 56
  28248. }],
  28249. 183: [function(e, t, i) {
  28250. (function(i) {
  28251. "use strict";
  28252. function n(e, t) {
  28253. var i = r(t);
  28254. if (Object.keys(i).length > 0)
  28255. return i;
  28256. if (e.heroImage)
  28257. i = o(e, t);
  28258. else if (e.data.camera_start) {
  28259. var n = e.data.camera_start;
  28260. try {
  28261. Object.keys(n).length > 0 && !l.isEmptyQuaternion(n.camera.quaternion) && (i.mode = h.convertWorkshopModeInt(n.mode),
  28262. i.position = n.camera.position,
  28263. //i.quaternion = n.camera.quaternion,
  28264. i.quaternion = new th.Quaternion().fromArray(n.camera.quaternion),//xzw
  28265. i.zoom = l.convertWorkshopOrthoZoom(n.camera.zoom),
  28266. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  28267. d.debug("Using camera_start"),
  28268. d.debug("Modeldata pano: ", i.pano.quaternion),
  28269. d.debug("Camera start pano: ", n.pano.quaternion)),
  28270. i.mode !== h.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility))
  28271. } catch (e) {
  28272. d.warn(e.message)
  28273. }
  28274. }
  28275. if (e.outsideAllowed() || i.mode === h.PANORAMA || (i = {}),
  28276. i.mode === h.MESH && i.position && (i.mode = h.PANORAMA,
  28277. i.pano = t.findClosest(i.position),
  28278. i.quaternion = i.pano.quaternion),
  28279. 0 === Object.keys(i).length) {
  28280. var a = t.list[0];
  28281. a && (i.mode = h.PANORAMA,
  28282. i.pano = a,
  28283. i.position = a.position,
  28284. i.quaternion = a.quaternion,
  28285. d.info("Starting at 1st pano " + a.id))
  28286. }
  28287. return i.mode = i.mode || h.DOLLHOUSE,
  28288. i
  28289. }
  28290. function r(e) {
  28291. var t = c.valueFromHash("start", "")
  28292. , i = {};
  28293. if ("" !== t) {
  28294. d.debug("Start override found in parameters, trying to parse..."),
  28295. i = a(t) || {};
  28296. var n = c.valueFromHash("tag", null);
  28297. n && (i.tag = n),
  28298. i.panoId && (i.pano = e.get(i.panoId))
  28299. }
  28300. return i
  28301. }
  28302. function o(e, t) {
  28303. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  28304. return {};
  28305. var i = {}
  28306. , n = e.heroImage.metadata;
  28307. d.debug("Using start position from thumbnail image"),
  28308. i.position = n.camera_position,
  28309. i.quaternion = n.camera_quaternion;
  28310. try {
  28311. i.mode = h.convertWorkshopModeInt(n.camera_mode),
  28312. i.mode === h.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  28313. } catch (e) {
  28314. d.debug(e.message)
  28315. }
  28316. return i
  28317. }
  28318. function a(e) {
  28319. return s.deserialize(e)
  28320. }
  28321. var s = e("../controls/serializer")
  28322. , l = e("../util/math")
  28323. , c = e("./browser")
  28324. , h = e("../enum/Viewmode")
  28325. , u = e("../util/logger")
  28326. , th = e("three")//xzw
  28327. , d = new u(i);
  28328. t.exports = {
  28329. getStartCameraOptions: n
  28330. }
  28331. }
  28332. ).call(this, "/js/util/camera.js")
  28333. }
  28334. , {
  28335. "../controls/serializer": 14,
  28336. "../enum/Viewmode": 51,
  28337. "../util/logger": 189,
  28338. "../util/math": 190,
  28339. "./browser": 182,
  28340. "three": 217
  28341. }],
  28342. 184: [function(e, t, i) {
  28343. "use strict";
  28344. function n(e, t, i) {
  28345. return o(e.fov, t, i)
  28346. }
  28347. var r = e("./MathLight")
  28348. , o = function(e, t, i) {
  28349. var n = t
  28350. , o = i
  28351. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (n / o)) * r.DEGREES_PER_RADIAN;
  28352. return a
  28353. }
  28354. , a = function(e, t, i) {
  28355. var n = t
  28356. , o = i
  28357. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (o / n)) * r.DEGREES_PER_RADIAN;
  28358. return a
  28359. }
  28360. , s = function(e, t, i, n) {
  28361. var r = o(e, i, n);
  28362. return r > t ? a(t, i, n) : e
  28363. };
  28364. t.exports = {
  28365. clampVFOV: s,
  28366. getHFOVForCamera: n,
  28367. getHFOVFromVFOV: o,
  28368. getVFOVFromHFOV: a
  28369. }
  28370. }
  28371. , {
  28372. "./MathLight": 176
  28373. }],
  28374. 185: [function(e, t, i) {
  28375. "use strict";
  28376. var n = e("three");
  28377. t.exports = {
  28378. delayOneFrame: function(e) {
  28379. window.setTimeout(e, 1)
  28380. },
  28381. normalizeUrl: function(e) {
  28382. return e.replace("https://", "http://")
  28383. },
  28384. domainFromUrl: function(e) {
  28385. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  28386. return t ? t[3] : e
  28387. },
  28388. average: function(e, t) {
  28389. if (0 === e.length)
  28390. return null;
  28391. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  28392. var o = t ? e[r][t] : e[r];
  28393. i += o,
  28394. n++
  28395. }
  28396. return i / n
  28397. },
  28398. countUnique: function(e) {
  28399. for (var t = {}, i = 0; i < e.length; i++)
  28400. t[e[i]] = 1 + (t[e[i]] || 0);
  28401. return Object.keys(t).length
  28402. },
  28403. averageVectors: function(e, t) {
  28404. var i = new n.Vector3;
  28405. if (0 === e.length)
  28406. return i;
  28407. for (var r = 0, o = 0; o < e.length; o++) {
  28408. var a = t ? e[o][t] : e[o];
  28409. i.add(a),
  28410. r++
  28411. }
  28412. return i.divideScalar(r)
  28413. },
  28414. equalLists: function(e, t) {
  28415. if (e.length !== t.length)
  28416. return !1;
  28417. for (var i = 0; i < e.length; i++)
  28418. if (e[i] !== t[i])
  28419. return !1;
  28420. return !0
  28421. },
  28422. lowerMedian: function(e, t) {
  28423. if (0 === e.length)
  28424. return null;
  28425. t = t || 2,
  28426. e.sort(function(e, t) {
  28427. return e - t
  28428. });
  28429. var i = Math.floor(e.length / t);
  28430. return e[i]
  28431. },
  28432. stableSort: function(e, t) {
  28433. return e.map(function(e, t) {
  28434. return {
  28435. value: e,
  28436. index: t
  28437. }
  28438. }).sort(function(e, i) {
  28439. var n = t(e.value, i.value);
  28440. return 0 !== n ? n : e.index - i.index
  28441. }).map(function(e) {
  28442. return e.value
  28443. })
  28444. },
  28445. filterAll: function(e, t) {
  28446. return e.filter(function(e) {
  28447. return t.every(function(t) {
  28448. return t(e)
  28449. })
  28450. })
  28451. },
  28452. formatDate: function(e) {
  28453. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  28454. },
  28455. formatDatetime: function(e) {
  28456. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  28457. },
  28458. randomString: function(e) {
  28459. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  28460. t += i.charAt(Math.floor(Math.random() * i.length));
  28461. return t
  28462. },
  28463. uint8ToBase64: function(e, t) {
  28464. t && "number" == typeof t || (t = 8192);
  28465. for (var i = [], n = 0; n < e.length; n += t)
  28466. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  28467. return btoa(i.join(""))
  28468. },
  28469. uuid4: function e(t) {
  28470. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  28471. },
  28472. nth: function(e) {
  28473. return e %= 10,
  28474. 1 === e ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  28475. },
  28476. extendObject: function(e, t) {
  28477. return Object.keys(t).forEach(function(i) {
  28478. e[i] = t[i]
  28479. }),
  28480. e
  28481. },
  28482. deepExtend: function e(t) {
  28483. t = t || {};
  28484. for (var i = 1; i < arguments.length; i++) {
  28485. var n = arguments[i];
  28486. if (n)
  28487. for (var r in n)
  28488. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  28489. }
  28490. return t
  28491. },
  28492. inherit: function(e, t) {
  28493. e.prototype = Object.create(t.prototype),
  28494. e.prototype.constructor = e
  28495. },
  28496. extend: function(e, t) {
  28497. for (var i in t.prototype)
  28498. e.prototype[i] = t.prototype[i]
  28499. }
  28500. },
  28501. Math.sign = function(e) {
  28502. return e < 0 ? -1 : 1
  28503. }
  28504. }
  28505. , {
  28506. three: 217
  28507. }],
  28508. 186: [function(e, t, i) {
  28509. "use strict";
  28510. var n = {};
  28511. n.linearTween = function(e, t, i, n) {
  28512. return i * e / n + t
  28513. }
  28514. ,
  28515. n.easeInQuad = function(e, t, i, n) {
  28516. return e /= n,
  28517. i * e * e + t
  28518. }
  28519. ,
  28520. n.easeOutQuad = function(e, t, i, n) {
  28521. return e /= n,
  28522. -i * e * (e - 2) + t
  28523. }
  28524. ,
  28525. n.easeInOutQuad = function(e, t, i, n) {
  28526. return e /= n / 2,
  28527. e < 1 ? i / 2 * e * e + t : (e--,
  28528. -i / 2 * (e * (e - 2) - 1) + t)
  28529. }
  28530. ,
  28531. n.easeInCubic = function(e, t, i, n) {
  28532. return e /= n,
  28533. i * e * e * e + t
  28534. }
  28535. ,
  28536. n.easeOutCubic = function(e, t, i, n) {
  28537. return e /= n,
  28538. e--,
  28539. i * (e * e * e + 1) + t
  28540. }
  28541. ,
  28542. n.easeInOutCubic = function(e, t, i, n) {
  28543. return e /= n / 2,
  28544. e < 1 ? i / 2 * e * e * e + t : (e -= 2,
  28545. i / 2 * (e * e * e + 2) + t)
  28546. }
  28547. ,
  28548. n.easeInQuart = function(e, t, i, n) {
  28549. return e /= n,
  28550. i * e * e * e * e + t
  28551. }
  28552. ,
  28553. n.easeOutQuart = function(e, t, i, n) {
  28554. return e /= n,
  28555. e--,
  28556. -i * (e * e * e * e - 1) + t
  28557. }
  28558. ,
  28559. n.easeInOutQuart = function(e, t, i, n) {
  28560. return e /= n / 2,
  28561. e < 1 ? i / 2 * e * e * e * e + t : (e -= 2,
  28562. -i / 2 * (e * e * e * e - 2) + t)
  28563. }
  28564. ,
  28565. n.easeInQuint = function(e, t, i, n) {
  28566. return e /= n,
  28567. i * e * e * e * e * e + t
  28568. }
  28569. ,
  28570. n.easeOutQuint = function(e, t, i, n) {
  28571. return e /= n,
  28572. e--,
  28573. i * (e * e * e * e * e + 1) + t
  28574. }
  28575. ,
  28576. n.easeInOutQuint = function(e, t, i, n) {
  28577. return e /= n / 2,
  28578. e < 1 ? i / 2 * e * e * e * e * e + t : (e -= 2,
  28579. i / 2 * (e * e * e * e * e + 2) + t)
  28580. }
  28581. ,
  28582. n.easeInSine = function(e, t, i, n) {
  28583. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  28584. }
  28585. ,
  28586. n.easeOutSine = function(e, t, i, n) {
  28587. return i * Math.sin(e / n * (Math.PI / 2)) + t
  28588. }
  28589. ,
  28590. n.easeInOutSine = function(e, t, i, n) {
  28591. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  28592. }
  28593. ,
  28594. n.easeInExpo = function(e, t, i, n) {
  28595. return i * Math.pow(2, 10 * (e / n - 1)) + t
  28596. }
  28597. ,
  28598. n.easeOutExpo = function(e, t, i, n) {
  28599. return i * (-Math.pow(2, -10 * e / n) + 1) + t
  28600. }
  28601. ,
  28602. n.easeInOutExpo = function(e, t, i, n) {
  28603. return e /= n / 2,
  28604. e < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  28605. i / 2 * (-Math.pow(2, -10 * e) + 2) + t)
  28606. }
  28607. ,
  28608. n.easeInCirc = function(e, t, i, n) {
  28609. return e /= n,
  28610. -i * (Math.sqrt(1 - e * e) - 1) + t
  28611. }
  28612. ,
  28613. n.easeOutCirc = function(e, t, i, n) {
  28614. return e /= n,
  28615. e--,
  28616. i * Math.sqrt(1 - e * e) + t
  28617. }
  28618. ,
  28619. n.easeInOutCirc = function(e, t, i, n) {
  28620. return e /= n / 2,
  28621. e < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  28622. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  28623. }
  28624. ,
  28625. n.easeInElastic = function(e, t, i, n) {
  28626. var r = 1.70158
  28627. , o = 0
  28628. , a = i;
  28629. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  28630. a < Math.abs(i) ? (a = i,
  28631. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  28632. -(a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t)
  28633. }
  28634. ,
  28635. n.easeOutElastic = function(e, t, i, n) {
  28636. var r = 1.70158
  28637. , o = 0
  28638. , a = i;
  28639. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  28640. a < Math.abs(i) ? (a = i,
  28641. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  28642. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  28643. }
  28644. ,
  28645. n.easeInOutElastic = function(e, t, i, n) {
  28646. var r = 1.70158
  28647. , o = 0
  28648. , a = i;
  28649. return 0 === e ? t : 2 === (e /= n / 2) ? t + i : (o || (o = n * (.3 * 1.5)),
  28650. a < Math.abs(i) ? (a = i,
  28651. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  28652. 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)
  28653. }
  28654. ,
  28655. n.easeInBack = function(e, t, i, n, r) {
  28656. return void 0 === r && (r = 1.70158),
  28657. i * (e /= n) * e * ((r + 1) * e - r) + t
  28658. }
  28659. ,
  28660. n.easeOutBack = function(e, t, i, n, r) {
  28661. return void 0 === r && (r = 1.70158),
  28662. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  28663. }
  28664. ,
  28665. n.easeInOutBack = function(e, t, i, n, r) {
  28666. return void 0 === r && (r = 1.70158),
  28667. (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
  28668. }
  28669. ,
  28670. n.easeOutBounce = function(e, t, i, n) {
  28671. 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
  28672. }
  28673. ,
  28674. n.easeInBounce = function(e, t, i, r) {
  28675. return i - n.easeOutBounce(r - e, 0, i, r) + t
  28676. }
  28677. ,
  28678. n.easeInOutBounce = function(e, t, i, r) {
  28679. 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
  28680. }
  28681. ,
  28682. t.exports = n
  28683. }
  28684. , {}],
  28685. 187: [function(e, t, i) {
  28686. "use strict";
  28687. function n() {
  28688. this.events = [],
  28689. this.valid = !1
  28690. }
  28691. var r = e("../enum/Joystick");
  28692. n.prototype.push = function(e, t) {
  28693. this.events.push({
  28694. direction: e,
  28695. pano: t
  28696. }),
  28697. this.valid = !0
  28698. }
  28699. ,
  28700. n.prototype.pop = function(e) {
  28701. var t = this.events.pop();
  28702. return this.events.length < 1 && (this.valid = !1),
  28703. t
  28704. }
  28705. ,
  28706. n.prototype.peek = function() {
  28707. return this.events.length ? this.events[this.events.length - 1] : {
  28708. direction: null,
  28709. pano: null
  28710. }
  28711. }
  28712. ,
  28713. n.prototype.invalidate = function() {
  28714. this.events = [],
  28715. this.valid = !1
  28716. }
  28717. ,
  28718. n.prototype.reversePano = function(e) {
  28719. if (!this.valid)
  28720. return null;
  28721. var t = this.peek();
  28722. return r.opposite(e) === t.direction ? (this.pop(),
  28723. t.pano) : null
  28724. }
  28725. ,
  28726. t.exports = n
  28727. }
  28728. , {
  28729. "../enum/Joystick": 29
  28730. }],
  28731. 188: [function(e, t, i) {
  28732. "use strict";
  28733. t.exports = {
  28734. vector: function(e, t) {
  28735. var i = e.clone();
  28736. return t = t.clone(),
  28737. function(n) {
  28738. e.set(i.x * (1 - n) + t.x * n, i.y * (1 - n) + t.y * n, i.z * (1 - n) + t.z * n)
  28739. }
  28740. },
  28741. quaternion: function(e, t) {
  28742. var i = e.clone();
  28743. return function(n) {
  28744. e.copy(i).slerp(t, n)
  28745. }
  28746. },
  28747. property: function(e, t, i, n) {
  28748. var r = e[t];
  28749. return function(o) {
  28750. e[t] = r * (1 - o) + i * o,
  28751. n && n(e[t])
  28752. }
  28753. },
  28754. uniform: function(e, t, i) {
  28755. var n = e.material.uniforms[t].value;
  28756. return function(r) {
  28757. e.material.uniforms[t] && (e.material.uniforms[t].value = n * (1 - r) + i * r)
  28758. }
  28759. },
  28760. matrix4: function(e, t) {
  28761. var i = e.clone();
  28762. return function(n) {
  28763. for (var r = e.elements, o = i.elements, a = t.elements, s = 0; s < 16; s++)
  28764. r[s] = o[s] * (1 - n) + a[s] * n
  28765. }
  28766. },
  28767. allUniforms: function(e, t, i) {
  28768. var n = e.map(function(e) {
  28769. return this.uniform(e, t, i)
  28770. }
  28771. .bind(this));
  28772. return function(e) {
  28773. n.forEach(function(t) {
  28774. t(e)
  28775. })
  28776. }
  28777. }
  28778. }
  28779. }
  28780. , {}],
  28781. 189: [function(e, t, i) {
  28782. "use strict";
  28783. function n(e) {
  28784. var t, i, o, a, s = e.split("/"), l = "[" + s[s.length - 1].replace(".js", "") + "]", c = {};
  28785. if (n.consoleEnabled) {
  28786. var h = function(e) {
  28787. $("#debug-console").append("<p>" + e + "</p>"),
  28788. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  28789. };
  28790. t = function(e) {
  28791. h(Array.prototype.slice.call(arguments).join(" "))
  28792. }
  28793. ,
  28794. i = function(e) {
  28795. h(Array.prototype.slice.call(arguments).join(" "))
  28796. }
  28797. ,
  28798. o = function(e) {
  28799. h("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  28800. }
  28801. ,
  28802. a = function(e) {
  28803. h("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  28804. }
  28805. } else
  28806. console.log ? (t = console.log,
  28807. i = console.info ? console.info : console.log,
  28808. o = console.warn ? console.warn : console.log,
  28809. a = console.error ? console.error : console.log) : t = i = o = a = function() {}
  28810. ;
  28811. var u = function(e) {
  28812. return [l, n.timestamp()].concat(Array.prototype.slice.call(e))
  28813. }
  28814. , d = function(t, i) {
  28815. if (r) {
  28816. var o = Array.prototype.slice.call(t).join(" ");
  28817. r.captureMessage(o, {
  28818. level: i,
  28819. path: e,
  28820. timestamp: n.timestamp()
  28821. })
  28822. }
  28823. }
  28824. , p = function(t, i) {
  28825. if (r) {
  28826. var o = Array.prototype.slice.call(t).join(" ");
  28827. r.captureException(new Error(o), {
  28828. level: i,
  28829. path: e,
  28830. timestamp: n.timestamp()
  28831. })
  28832. }
  28833. };
  28834. return {
  28835. debug: function() {
  28836. n.level >= n.levels.debug && t.apply(console, u(arguments))
  28837. },
  28838. info: function() {
  28839. n.level >= n.levels.info && i.apply(console, u(arguments))
  28840. },
  28841. warn: function() {
  28842. d(arguments, "warn"),
  28843. n.level >= n.levels.warn && o.apply(console, u(arguments))
  28844. },
  28845. error: function() {
  28846. p(arguments, "error"),
  28847. n.level >= n.levels.error && a.apply(console, u(arguments))
  28848. },
  28849. v3str: function(e, t) {
  28850. var i = void 0 === t ? 2 : t;
  28851. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  28852. },
  28853. eulstr: function(e, t) {
  28854. var i = void 0 === t ? 2 : t;
  28855. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  28856. },
  28857. time: function(e) {
  28858. n.level >= n.levels.debug && (c[e] = Date.now())
  28859. },
  28860. timeEnd: function(e) {
  28861. if (n.level >= n.levels.debug) {
  28862. var t = c[e];
  28863. if (!t)
  28864. return;
  28865. var i = (Date.now() - t) / 1e3;
  28866. this.debug(e, i + "s")
  28867. }
  28868. }
  28869. }
  28870. }
  28871. var r = window.Raven;
  28872. n.timestamp = function() {
  28873. return (Date.now() - window.navigationStart) / 1e3 + "s"
  28874. }
  28875. ,
  28876. n.levels = {
  28877. debug: 3,
  28878. info: 2,
  28879. warn: 1,
  28880. error: 0
  28881. },
  28882. n.level = n.levels.info,
  28883. t.exports = n
  28884. }
  28885. , {}],
  28886. 190: [function(e, t, i) {
  28887. "use strict";
  28888. var n = e("three")
  28889. , r = e("../enum/GLCubeFaces")
  28890. , o = e("../constants");
  28891. t.exports = {
  28892. convertVisionVector: function(e) {
  28893. return new n.Vector3(e.x,e.z,-e.y)
  28894. },
  28895. convertVisionQuaternion: function(e) {
  28896. 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)))
  28897. },
  28898. convertWorkshopVector: function(e) {
  28899. return new n.Vector3(-e.x,e.y,e.z)
  28900. },
  28901. convertWorkshopQuaternion: function(e) {
  28902. 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))
  28903. },
  28904. convertWorkshopPanoramaQuaternion: function(e) {
  28905. 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)))
  28906. },
  28907. convertWorkshopOrthoZoom: function(e) {// xzw
  28908. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / o.workshopApsect
  28909. //return e;
  28910. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  28911. },
  28912. toPrecision: function(e, t) {//xzw change
  28913. var f = function(e, t){
  28914. var i = Math.pow(10, t);
  28915. return Math.round(e * i) / i
  28916. }
  28917. if(e instanceof Array){
  28918. for(var s=0; s<e.length; s++){
  28919. e[s] = f(e[s],t);
  28920. }
  28921. return e;
  28922. }
  28923. else return f(e,t)
  28924. },
  28925. isEmptyQuaternion: function(e) {
  28926. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  28927. },
  28928. projectPositionToCanvas: function(e, t, i) {
  28929. i = i || new n.Vector3,
  28930. i.copy(e);
  28931. var r = .5 * $("#player").width()
  28932. , o = .5 * $("#player").height();
  28933. return i.project(t),
  28934. i.x = i.x * r + r,
  28935. i.y = -(i.y * o) + o,
  28936. i
  28937. },
  28938. convertScreenPositionToNDC: function(e, t, i) {
  28939. return i = i || new n.Vector2,
  28940. i.x = e / $("#player").width() * 2 - 1,
  28941. i.y = 2 * -(t / $("#player").height()) + 1,
  28942. i
  28943. },
  28944. constrainedTurn: function(e) {
  28945. var t = e % (2 * Math.PI);
  28946. return t = t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  28947. },
  28948. getFOVDotThreshold: function(e) {
  28949. return Math.cos(n.Math.degToRad(e / 2))
  28950. },
  28951. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  28952. switch (e) {
  28953. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28954. i.set(1, t.y, t.x);
  28955. break;
  28956. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28957. i.set(-1, t.y, -t.x);
  28958. break;
  28959. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28960. i.set(-t.x, 1, -t.y);
  28961. break;
  28962. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28963. i.set(-t.x, -1, t.y);
  28964. break;
  28965. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28966. i.set(-t.x, t.y, 1);
  28967. break;
  28968. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28969. i.set(t.x, t.y, -1)
  28970. }
  28971. n && i.normalize()
  28972. }
  28973. }
  28974. }
  28975. , {
  28976. "../constants": 8,
  28977. "../enum/GLCubeFaces": 25,
  28978. three: 217
  28979. }],
  28980. 191: [function(e, t, i) {
  28981. "use strict";
  28982. function n(e, t, i) {
  28983. return a.map(function(n, o) {
  28984. return e.get("pan/" + i + "/" + t + "_skybox" + r(n) + ".jpg")
  28985. }
  28986. .bind(this))
  28987. }
  28988. function r(e) {
  28989. return s[e]
  28990. }
  28991. var o = e("../enum/GLCubeFaces")
  28992. , a = [0, 1, 2, 3, 4, 5]
  28993. , s = {
  28994. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  28995. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  28996. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  28997. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  28998. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  28999. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  29000. };
  29001. t.exports = {
  29002. mapFaceToCubemapFace: r,
  29003. getCubemapUrls: n
  29004. }
  29005. }
  29006. , {
  29007. "../enum/GLCubeFaces": 25
  29008. }],
  29009. 192: [function(e, t, i) {
  29010. "use strict";
  29011. t.exports = {
  29012. captureErrors: function(e, t, i) {
  29013. if ("Raven"in window) {
  29014. Raven.config(e, t).install(),
  29015. i && Raven.setTagsContext(i);
  29016. var n = console.warn
  29017. , r = console.error;
  29018. console.warn = function() {
  29019. var e = Array.prototype.slice.call(arguments);
  29020. Raven.captureMessage(e.join(" "), {
  29021. level: "warning"
  29022. }),
  29023. n.apply(console, e)
  29024. }
  29025. ,
  29026. console.error = function() {
  29027. var e = Array.prototype.slice.call(arguments);
  29028. Raven.captureException(new Error(e.join(" ")), {
  29029. level: "error"
  29030. }),
  29031. r.apply(console, e)
  29032. }
  29033. } else
  29034. console.error("Raven not found, not capturing errors.")
  29035. }
  29036. }
  29037. }
  29038. , {}],
  29039. 193: [function(e, t, i) {
  29040. (function(i) {
  29041. "use strict";
  29042. var n = e("./browser")
  29043. , r = e("../constants")
  29044. , o = e("url")
  29045. , a = e("./logger")
  29046. , ss = e('three')
  29047. , s = new a(i)
  29048. , l = {
  29049. getAuthorizationHeader: function() {
  29050. var e = n.valueFromHash("auth");
  29051. if (e)
  29052. return e.replace(",", " ");
  29053. var t = n.valueFromCookie("token");
  29054. return t ? "Token " + t : null
  29055. },
  29056. parseSidUrl: function(e) {
  29057. var t, i;
  29058. if (e = e || "",
  29059. e.match(/^https?/)) {
  29060. var n = o.parse(e);
  29061. t = n.protocol + "//" + n.host,
  29062. i = e
  29063. } else //xzw 原先的不能用
  29064. //t = window.location.protocol + "//" + window.location.host, //MP
  29065. t = ""
  29066. //i = t + "/api/player/models/" + e; //MP
  29067. i = t + "data/" + e;
  29068. return {
  29069. urlBase: t,
  29070. urlModel: i,
  29071. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  29072. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  29073. }
  29074. },
  29075. getModelIDFromQueryString: function() {
  29076. return n.valueFromHash("model") || n.valueFromHash("m")
  29077. },
  29078. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  29079. e = JSON.parse(JSON.stringify(e));
  29080. var i = null;
  29081. if (e.images.forEach(function(n) {
  29082. if(!n.metadata) return;
  29083. if ("string" == typeof n.metadata)
  29084. try {
  29085. n.metadata = JSON.parse(n.metadata)
  29086. } catch (e) {
  29087. s.warn("Unable to parse image metadata"),
  29088. n.metadata = null
  29089. }
  29090. else{
  29091. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  29092. }
  29093. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  29094. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  29095. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  29096. }else{
  29097. n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  29098. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position))
  29099. }
  29100. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  29101. }),
  29102. //icon初始视角的:
  29103. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  29104. var n = {};
  29105. n.pano = {
  29106. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  29107. position: t.convertWorkshopVector(i.scan_position),
  29108. uuid: i.scan_id
  29109. },
  29110. n.camera = {
  29111. quaternion: i.camera_quaternion,
  29112. position: i.camera_position
  29113. },
  29114. e.startPano = n
  29115. }
  29116. return e
  29117. },
  29118. visionVersionToInt: function() {
  29119. var e = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join(""));
  29120. return function(t) {
  29121. if (!t)
  29122. throw new Error("Vision version is required");
  29123. var i = e.exec(t);
  29124. if (null === i)
  29125. throw new Error("String is not a vision version: " + t);
  29126. return parseInt(i[1])
  29127. }
  29128. }(),
  29129. modelDataPromisesTiles: function(e) {
  29130. if (e.vision_version)
  29131. try {
  29132. return l.visionVersionToInt(e.vision_version) >= l.visionVersionToInt(r.visionTilingStartVersion)
  29133. } catch (t) {
  29134. s.warn("Invalid vision version: " + e.vision_version)
  29135. }
  29136. var t = e.created ? new Date(e.created) : null;
  29137. return t && t >= r.visionTilingStartDate
  29138. }
  29139. };
  29140. t.exports = l
  29141. }
  29142. ).call(this, "/js/util/showcase.js")
  29143. }
  29144. , {
  29145. "../constants": 8,
  29146. "./browser": 182,
  29147. "./logger": 189,
  29148. three:217,
  29149. url: 208
  29150. }],
  29151. 194: [function(e, t, i) {
  29152. "use strict";
  29153. var n = e("../util/ajax")
  29154. , r = e("three")
  29155. , o = e("../settings")
  29156. , a = {};
  29157. t.exports = {
  29158. load: function(e, t, i) {
  29159. var s = a[e];
  29160. return s ? (t && setTimeout(function() {
  29161. t(s)
  29162. }, 1),
  29163. s) : (s = new r.Texture,
  29164. o.minimalMemoryMode && (s.minFilter = r.LinearFilter,
  29165. s.magFilter = r.LinearFilter,
  29166. s.generateMipmaps = !1),
  29167. s.sourceFile = e,
  29168. a[e] = s,
  29169. n.getImage(e).then(function(e) {
  29170. s.image = e,
  29171. s.needsUpdate = !0,
  29172. t && t(s)
  29173. }).fail(i),
  29174. s)
  29175. },
  29176. loadBase64: function(e, t) {
  29177. t = t || "png";
  29178. var i = new r.Texture;
  29179. return i.image = document.createElement("img"),
  29180. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  29181. o.minimalMemoryMode && (i.minFilter = r.LinearFilter,
  29182. i.magFilter = r.LinearFilter,
  29183. i.generateMipmaps = !1),
  29184. i.needsUpdate = !0,
  29185. i
  29186. },
  29187. isLoaded: function(e) {
  29188. return !!a[e]
  29189. }
  29190. }
  29191. }
  29192. , {
  29193. "../settings": 166,
  29194. "../util/ajax": 181,
  29195. three: 217
  29196. }],
  29197. 195: [function(e, t, i) {
  29198. "use strict";
  29199. var n = e("./easing");
  29200. t.exports = {
  29201. globalDone: null,
  29202. funcs: [],
  29203. counter: 0,
  29204. uniqueID: 0,
  29205. start: function(e, t, i, r, o, a, s) {
  29206. return r = r || 0,
  29207. this.funcs.push({
  29208. func: e,
  29209. current: -r * Math.abs(t),
  29210. duration: (1 - Math.max(r, 0)) * Math.abs(t),
  29211. done: i,
  29212. easing: o || n.linearTween,
  29213. cycling: t < 0,
  29214. running: !0,
  29215. debug: r < 0,
  29216. name: a || "T" + this.counter,
  29217. id: void 0 === s ? this.counter : s,
  29218. paused: !1
  29219. }),
  29220. e(0, 16),
  29221. this.counter += 1,
  29222. e
  29223. },
  29224. trigger: function(e) {
  29225. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  29226. , i = e.func || function() {}
  29227. , r = void 0 === e.duration ? 0 : e.duration;
  29228. void 0 !== e.cycling && e.cycling && (r = -Math.abs(r));
  29229. var o = e.done || null
  29230. , a = e.easing || n.linearTween
  29231. , s = e.name || "R" + this.counter
  29232. , l = void 0 === e.id ? this.counter : e.id;
  29233. return this.start(i, r, o, t, a, s, l)
  29234. },
  29235. setTimeout: function(e, t, i) {
  29236. var n = void 0 === i ? this.counter : i;
  29237. return this.trigger({
  29238. done: e,
  29239. duration: void 0 === t ? 0 : t,
  29240. name: "O" + this.counter,
  29241. id: n
  29242. })
  29243. },
  29244. pause: function() {
  29245. this.paused = !0
  29246. },
  29247. resume: function() {
  29248. this.paused = !1
  29249. },
  29250. update: function(e) {
  29251. this.funcs.forEach(function(t) {
  29252. if (!(t.paused || (t.current += 1e3 * e,
  29253. t.current < 0)))
  29254. if (t.current >= t.duration && !t.cycling) {
  29255. var i = t.easing(1, 0, 1, 1);
  29256. t.func(i, 1e3 * e),
  29257. t.done && t.done(),
  29258. t.running = !1
  29259. } else {
  29260. var n = t.easing(t.current % t.duration / t.duration, 0, 1, 1)
  29261. , r = t.func(n, 1e3 * e) || !1;
  29262. r && (t.done && t.done(),
  29263. t.running = !1)
  29264. }
  29265. });
  29266. var t = this.funcs.length;
  29267. this.funcs = this.funcs.filter(function(e) {
  29268. return e.running
  29269. });
  29270. var i = this.funcs.length;
  29271. if (t > 0 && 0 === i && this.globalDone) {
  29272. var n = this.globalDone;
  29273. this.globalDone = null,
  29274. n()
  29275. }
  29276. },
  29277. adjustSpeed: function(e, t) {
  29278. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  29279. var r = i[n];
  29280. r.duration /= t,
  29281. r.current /= t
  29282. }
  29283. },
  29284. getById: function(e) {
  29285. return this.funcs.filter(function(t) {
  29286. return e === t.id
  29287. })
  29288. },
  29289. get: function(e) {
  29290. for (var t = 0; t < this.funcs.length; t += 1)
  29291. if (this.funcs[t].func === e)
  29292. return this.funcs[t];
  29293. return null
  29294. },
  29295. isRunning: function(e) {
  29296. var t = this.get(e);
  29297. return null !== t && t.running
  29298. },
  29299. countActive: function() {
  29300. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  29301. e += this.funcs[t].running;
  29302. return e
  29303. },
  29304. listActive: function() {
  29305. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  29306. this.funcs[t].running && e.push(this.funcs[t].name);
  29307. return e
  29308. },
  29309. done: function(e) {
  29310. this.globalDone = e
  29311. },
  29312. cancelById: function(e) {
  29313. var t = void 0 === e ? 0 : e;
  29314. this.funcs = this.funcs.filter(function(e) {
  29315. return e.id !== t
  29316. })
  29317. },
  29318. cancel: function(e) {
  29319. this.funcs = this.funcs.filter(function(t) {
  29320. return t.func !== e
  29321. })
  29322. },
  29323. getUniqueId: function() {
  29324. return this.uniqueID -= 1,
  29325. this.uniqueID
  29326. }
  29327. }
  29328. }
  29329. , {
  29330. "./easing": 186
  29331. }],
  29332. 196: [function(e, t, i) {
  29333. function n(e) {
  29334. if (this.set = {},
  29335. this.infContains = function() {
  29336. return !0
  29337. }
  29338. ,
  29339. "object" == typeof e)
  29340. if (e instanceof Array)
  29341. for (var t = 0; t < e.length; t++)
  29342. this.set[e[t]] = !0;
  29343. else
  29344. this.set = e;
  29345. else if ("function" == typeof e)
  29346. this.infContains = e;
  29347. else if ("undefined" != typeof e)
  29348. throw new Error("set must be either an array or an object.")
  29349. }
  29350. t.exports = n,
  29351. n.prototype.contains = function(e) {
  29352. return !!this.set[e]
  29353. }
  29354. ,
  29355. n.prototype.has = n.prototype.contains,
  29356. n.prototype.add = function(e) {
  29357. if (1 == arguments.length)
  29358. this.set[e] = !0;
  29359. else
  29360. for (var t = 0; t < arguments.length; t++)
  29361. this.set[arguments[t]] = !0
  29362. }
  29363. ,
  29364. n.prototype.addAll = function(e) {
  29365. if ("object" != typeof e && !(e instanceof Array))
  29366. throw new Error("arr must be an array.");
  29367. for (var t = 0; t < e.length; t++)
  29368. this.add(e[t])
  29369. }
  29370. ,
  29371. n.prototype.remove = function(e) {
  29372. if (1 == arguments.length)
  29373. delete this.set[e];
  29374. else
  29375. for (var t = 0; t < arguments.length; t++)
  29376. delete this.set[arguments[t]]
  29377. }
  29378. ,
  29379. n.prototype.delete = n.prototype.remove,
  29380. n.prototype.clear = function() {
  29381. this.set = {}
  29382. }
  29383. ,
  29384. n.prototype.size = function() {
  29385. return Object.keys(this.set).length
  29386. }
  29387. ,
  29388. n.prototype.toString = function() {
  29389. return "{" + Object.keys(this.set).toString() + "}"
  29390. }
  29391. ,
  29392. n.prototype.toArray = function() {
  29393. return "undefined" == typeof this.set ? [] : Object.keys(this.set)
  29394. }
  29395. ,
  29396. n.prototype["*values"] = n.prototype.toArray
  29397. }
  29398. , {}],
  29399. 197: [function(e, t, i) {}
  29400. , {}],
  29401. 198: [function(e, t, i) {
  29402. (function(t) {
  29403. "use strict";
  29404. function n() {
  29405. try {
  29406. var e = new Uint8Array(1);
  29407. return e.__proto__ = {
  29408. __proto__: Uint8Array.prototype,
  29409. foo: function() {
  29410. return 42
  29411. }
  29412. },
  29413. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  29414. } catch (e) {
  29415. return !1
  29416. }
  29417. }
  29418. function r() {
  29419. return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  29420. }
  29421. function o(e, t) {
  29422. if (r() < t)
  29423. throw new RangeError("Invalid typed array length");
  29424. return a.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t),
  29425. e.__proto__ = a.prototype) : (null === e && (e = new a(t)),
  29426. e.length = t),
  29427. e
  29428. }
  29429. function a(e, t, i) {
  29430. if (!(a.TYPED_ARRAY_SUPPORT || this instanceof a))
  29431. return new a(e,t,i);
  29432. if ("number" == typeof e) {
  29433. if ("string" == typeof t)
  29434. throw new Error("If encoding is specified then the first argument must be a string");
  29435. return h(this, e)
  29436. }
  29437. return s(this, e, t, i)
  29438. }
  29439. function s(e, t, i, n) {
  29440. if ("number" == typeof t)
  29441. throw new TypeError('"value" argument must not be a number');
  29442. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? p(e, t, i, n) : "string" == typeof t ? u(e, t, i) : f(e, t)
  29443. }
  29444. function l(e) {
  29445. if ("number" != typeof e)
  29446. throw new TypeError('"size" argument must be a number');
  29447. if (e < 0)
  29448. throw new RangeError('"size" argument must not be negative')
  29449. }
  29450. function c(e, t, i, n) {
  29451. return l(t),
  29452. 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)
  29453. }
  29454. function h(e, t) {
  29455. if (l(t),
  29456. e = o(e, t < 0 ? 0 : 0 | g(t)),
  29457. !a.TYPED_ARRAY_SUPPORT)
  29458. for (var i = 0; i < t; ++i)
  29459. e[i] = 0;
  29460. return e
  29461. }
  29462. function u(e, t, i) {
  29463. if ("string" == typeof i && "" !== i || (i = "utf8"),
  29464. !a.isEncoding(i))
  29465. throw new TypeError('"encoding" must be a valid string encoding');
  29466. var n = 0 | v(t, i);
  29467. e = o(e, n);
  29468. var r = e.write(t, i);
  29469. return r !== n && (e = e.slice(0, r)),
  29470. e
  29471. }
  29472. function d(e, t) {
  29473. var i = t.length < 0 ? 0 : 0 | g(t.length);
  29474. e = o(e, i);
  29475. for (var n = 0; n < i; n += 1)
  29476. e[n] = 255 & t[n];
  29477. return e
  29478. }
  29479. function p(e, t, i, n) {
  29480. if (t.byteLength,
  29481. i < 0 || t.byteLength < i)
  29482. throw new RangeError("'offset' is out of bounds");
  29483. if (t.byteLength < i + (n || 0))
  29484. throw new RangeError("'length' is out of bounds");
  29485. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  29486. a.TYPED_ARRAY_SUPPORT ? (e = t,
  29487. e.__proto__ = a.prototype) : e = d(e, t),
  29488. e
  29489. }
  29490. function f(e, t) {
  29491. if (a.isBuffer(t)) {
  29492. var i = 0 | g(t.length);
  29493. return e = o(e, i),
  29494. 0 === e.length ? e : (t.copy(e, 0, 0, i),
  29495. e)
  29496. }
  29497. if (t) {
  29498. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  29499. return "number" != typeof t.length || K(t.length) ? o(e, 0) : d(e, t);
  29500. if ("Buffer" === t.type && $(t.data))
  29501. return d(e, t.data)
  29502. }
  29503. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  29504. }
  29505. function g(e) {
  29506. if (e >= r())
  29507. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + r().toString(16) + " bytes");
  29508. return 0 | e
  29509. }
  29510. function m(e) {
  29511. return +e != e && (e = 0),
  29512. a.alloc(+e)
  29513. }
  29514. function v(e, t) {
  29515. if (a.isBuffer(e))
  29516. return e.length;
  29517. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  29518. return e.byteLength;
  29519. "string" != typeof e && (e = "" + e);
  29520. var i = e.length;
  29521. if (0 === i)
  29522. return 0;
  29523. for (var n = !1; ; )
  29524. switch (t) {
  29525. case "ascii":
  29526. case "latin1":
  29527. case "binary":
  29528. return i;
  29529. case "utf8":
  29530. case "utf-8":
  29531. case void 0:
  29532. return j(e).length;
  29533. case "ucs2":
  29534. case "ucs-2":
  29535. case "utf16le":
  29536. case "utf-16le":
  29537. return 2 * i;
  29538. case "hex":
  29539. return i >>> 1;
  29540. case "base64":
  29541. return Z(e).length;
  29542. default:
  29543. if (n)
  29544. return j(e).length;
  29545. t = ("" + t).toLowerCase(),
  29546. n = !0
  29547. }
  29548. }
  29549. function A(e, t, i) {
  29550. var n = !1;
  29551. if ((void 0 === t || t < 0) && (t = 0),
  29552. t > this.length)
  29553. return "";
  29554. if ((void 0 === i || i > this.length) && (i = this.length),
  29555. i <= 0)
  29556. return "";
  29557. if (i >>>= 0,
  29558. t >>>= 0,
  29559. i <= t)
  29560. return "";
  29561. for (e || (e = "utf8"); ; )
  29562. switch (e) {
  29563. case "hex":
  29564. return L(this, t, i);
  29565. case "utf8":
  29566. case "utf-8":
  29567. return M(this, t, i);
  29568. case "ascii":
  29569. return P(this, t, i);
  29570. case "latin1":
  29571. case "binary":
  29572. return O(this, t, i);
  29573. case "base64":
  29574. return S(this, t, i);
  29575. case "ucs2":
  29576. case "ucs-2":
  29577. case "utf16le":
  29578. case "utf-16le":
  29579. return D(this, t, i);
  29580. default:
  29581. if (n)
  29582. throw new TypeError("Unknown encoding: " + e);
  29583. e = (e + "").toLowerCase(),
  29584. n = !0
  29585. }
  29586. }
  29587. function y(e, t, i) {
  29588. var n = e[t];
  29589. e[t] = e[i],
  29590. e[i] = n
  29591. }
  29592. function C(e, t, i, n, r) {
  29593. if (0 === e.length)
  29594. return -1;
  29595. if ("string" == typeof i ? (n = i,
  29596. i = 0) : i > 2147483647 ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  29597. i = +i,
  29598. isNaN(i) && (i = r ? 0 : e.length - 1),
  29599. i < 0 && (i = e.length + i),
  29600. i >= e.length) {
  29601. if (r)
  29602. return -1;
  29603. i = e.length - 1
  29604. } else if (i < 0) {
  29605. if (!r)
  29606. return -1;
  29607. i = 0
  29608. }
  29609. if ("string" == typeof t && (t = a.from(t, n)),
  29610. a.isBuffer(t))
  29611. return 0 === t.length ? -1 : I(e, t, i, n, r);
  29612. if ("number" == typeof t)
  29613. return t &= 255,
  29614. 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);
  29615. throw new TypeError("val must be string, number or Buffer")
  29616. }
  29617. function I(e, t, i, n, r) {
  29618. function o(e, t) {
  29619. return 1 === a ? e[t] : e.readUInt16BE(t * a)
  29620. }
  29621. var a = 1
  29622. , s = e.length
  29623. , l = t.length;
  29624. if (void 0 !== n && (n = String(n).toLowerCase(),
  29625. "ucs2" === n || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  29626. if (e.length < 2 || t.length < 2)
  29627. return -1;
  29628. a = 2,
  29629. s /= 2,
  29630. l /= 2,
  29631. i /= 2
  29632. }
  29633. var c;
  29634. if (r) {
  29635. var h = -1;
  29636. for (c = i; c < s; c++)
  29637. if (o(e, c) === o(t, h === -1 ? 0 : c - h)) {
  29638. if (h === -1 && (h = c),
  29639. c - h + 1 === l)
  29640. return h * a
  29641. } else
  29642. h !== -1 && (c -= c - h),
  29643. h = -1
  29644. } else
  29645. for (i + l > s && (i = s - l),
  29646. c = i; c >= 0; c--) {
  29647. for (var u = !0, d = 0; d < l; d++)
  29648. if (o(e, c + d) !== o(t, d)) {
  29649. u = !1;
  29650. break
  29651. }
  29652. if (u)
  29653. return c
  29654. }
  29655. return -1
  29656. }
  29657. function E(e, t, i, n) {
  29658. i = Number(i) || 0;
  29659. var r = e.length - i;
  29660. n ? (n = Number(n),
  29661. n > r && (n = r)) : n = r;
  29662. var o = t.length;
  29663. if (o % 2 !== 0)
  29664. throw new TypeError("Invalid hex string");
  29665. n > o / 2 && (n = o / 2);
  29666. for (var a = 0; a < n; ++a) {
  29667. var s = parseInt(t.substr(2 * a, 2), 16);
  29668. if (isNaN(s))
  29669. return a;
  29670. e[i + a] = s
  29671. }
  29672. return a
  29673. }
  29674. function b(e, t, i, n) {
  29675. return q(j(t, e.length - i), e, i, n)
  29676. }
  29677. function w(e, t, i, n) {
  29678. return q(Y(t), e, i, n)
  29679. }
  29680. function _(e, t, i, n) {
  29681. return w(e, t, i, n)
  29682. }
  29683. function T(e, t, i, n) {
  29684. return q(Z(t), e, i, n)
  29685. }
  29686. function x(e, t, i, n) {
  29687. return q(X(t, e.length - i), e, i, n)
  29688. }
  29689. function S(e, t, i) {
  29690. return 0 === t && i === e.length ? Q.fromByteArray(e) : Q.fromByteArray(e.slice(t, i))
  29691. }
  29692. function M(e, t, i) {
  29693. i = Math.min(e.length, i);
  29694. for (var n = [], r = t; r < i; ) {
  29695. var o = e[r]
  29696. , a = null
  29697. , s = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
  29698. if (r + s <= i) {
  29699. var l, c, h, u;
  29700. switch (s) {
  29701. case 1:
  29702. o < 128 && (a = o);
  29703. break;
  29704. case 2:
  29705. l = e[r + 1],
  29706. 128 === (192 & l) && (u = (31 & o) << 6 | 63 & l,
  29707. u > 127 && (a = u));
  29708. break;
  29709. case 3:
  29710. l = e[r + 1],
  29711. c = e[r + 2],
  29712. 128 === (192 & l) && 128 === (192 & c) && (u = (15 & o) << 12 | (63 & l) << 6 | 63 & c,
  29713. u > 2047 && (u < 55296 || u > 57343) && (a = u));
  29714. break;
  29715. case 4:
  29716. l = e[r + 1],
  29717. c = e[r + 2],
  29718. h = e[r + 3],
  29719. 128 === (192 & l) && 128 === (192 & c) && 128 === (192 & h) && (u = (15 & o) << 18 | (63 & l) << 12 | (63 & c) << 6 | 63 & h,
  29720. u > 65535 && u < 1114112 && (a = u))
  29721. }
  29722. }
  29723. null === a ? (a = 65533,
  29724. s = 1) : a > 65535 && (a -= 65536,
  29725. n.push(a >>> 10 & 1023 | 55296),
  29726. a = 56320 | 1023 & a),
  29727. n.push(a),
  29728. r += s
  29729. }
  29730. return R(n)
  29731. }
  29732. function R(e) {
  29733. var t = e.length;
  29734. if (t <= ee)
  29735. return String.fromCharCode.apply(String, e);
  29736. for (var i = "", n = 0; n < t; )
  29737. i += String.fromCharCode.apply(String, e.slice(n, n += ee));
  29738. return i
  29739. }
  29740. function P(e, t, i) {
  29741. var n = "";
  29742. i = Math.min(e.length, i);
  29743. for (var r = t; r < i; ++r)
  29744. n += String.fromCharCode(127 & e[r]);
  29745. return n
  29746. }
  29747. function O(e, t, i) {
  29748. var n = "";
  29749. i = Math.min(e.length, i);
  29750. for (var r = t; r < i; ++r)
  29751. n += String.fromCharCode(e[r]);
  29752. return n
  29753. }
  29754. function L(e, t, i) {
  29755. var n = e.length;
  29756. (!t || t < 0) && (t = 0),
  29757. (!i || i < 0 || i > n) && (i = n);
  29758. for (var r = "", o = t; o < i; ++o)
  29759. r += W(e[o]);
  29760. return r
  29761. }
  29762. function D(e, t, i) {
  29763. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  29764. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  29765. return r
  29766. }
  29767. function N(e, t, i) {
  29768. if (e % 1 !== 0 || e < 0)
  29769. throw new RangeError("offset is not uint");
  29770. if (e + t > i)
  29771. throw new RangeError("Trying to access beyond buffer length")
  29772. }
  29773. function B(e, t, i, n, r, o) {
  29774. if (!a.isBuffer(e))
  29775. throw new TypeError('"buffer" argument must be a Buffer instance');
  29776. if (t > r || t < o)
  29777. throw new RangeError('"value" argument is out of bounds');
  29778. if (i + n > e.length)
  29779. throw new RangeError("Index out of range")
  29780. }
  29781. function F(e, t, i, n) {
  29782. t < 0 && (t = 65535 + t + 1);
  29783. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  29784. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  29785. }
  29786. function V(e, t, i, n) {
  29787. t < 0 && (t = 4294967295 + t + 1);
  29788. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  29789. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  29790. }
  29791. function U(e, t, i, n, r, o) {
  29792. if (i + n > e.length)
  29793. throw new RangeError("Index out of range");
  29794. if (i < 0)
  29795. throw new RangeError("Index out of range")
  29796. }
  29797. function k(e, t, i, n, r) {
  29798. return r || U(e, t, i, 4, 3.4028234663852886e38, -3.4028234663852886e38),
  29799. J.write(e, t, i, n, 23, 4),
  29800. i + 4
  29801. }
  29802. function H(e, t, i, n, r) {
  29803. return r || U(e, t, i, 8, 1.7976931348623157e308, -1.7976931348623157e308),
  29804. J.write(e, t, i, n, 52, 8),
  29805. i + 8
  29806. }
  29807. function G(e) {
  29808. if (e = z(e).replace(te, ""),
  29809. e.length < 2)
  29810. return "";
  29811. for (; e.length % 4 !== 0; )
  29812. e += "=";
  29813. return e
  29814. }
  29815. function z(e) {
  29816. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  29817. }
  29818. function W(e) {
  29819. return e < 16 ? "0" + e.toString(16) : e.toString(16)
  29820. }
  29821. function j(e, t) {
  29822. t = t || 1 / 0;
  29823. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  29824. if (i = e.charCodeAt(a),
  29825. i > 55295 && i < 57344) {
  29826. if (!r) {
  29827. if (i > 56319) {
  29828. (t -= 3) > -1 && o.push(239, 191, 189);
  29829. continue
  29830. }
  29831. if (a + 1 === n) {
  29832. (t -= 3) > -1 && o.push(239, 191, 189);
  29833. continue
  29834. }
  29835. r = i;
  29836. continue
  29837. }
  29838. if (i < 56320) {
  29839. (t -= 3) > -1 && o.push(239, 191, 189),
  29840. r = i;
  29841. continue
  29842. }
  29843. i = (r - 55296 << 10 | i - 56320) + 65536
  29844. } else
  29845. r && (t -= 3) > -1 && o.push(239, 191, 189);
  29846. if (r = null,
  29847. i < 128) {
  29848. if ((t -= 1) < 0)
  29849. break;
  29850. o.push(i)
  29851. } else if (i < 2048) {
  29852. if ((t -= 2) < 0)
  29853. break;
  29854. o.push(i >> 6 | 192, 63 & i | 128)
  29855. } else if (i < 65536) {
  29856. if ((t -= 3) < 0)
  29857. break;
  29858. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  29859. } else {
  29860. if (!(i < 1114112))
  29861. throw new Error("Invalid code point");
  29862. if ((t -= 4) < 0)
  29863. break;
  29864. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  29865. }
  29866. }
  29867. return o
  29868. }
  29869. function Y(e) {
  29870. for (var t = [], i = 0; i < e.length; ++i)
  29871. t.push(255 & e.charCodeAt(i));
  29872. return t
  29873. }
  29874. function X(e, t) {
  29875. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  29876. i = e.charCodeAt(a),
  29877. n = i >> 8,
  29878. r = i % 256,
  29879. o.push(r),
  29880. o.push(n);
  29881. return o
  29882. }
  29883. function Z(e) {
  29884. return Q.toByteArray(G(e))
  29885. }
  29886. function q(e, t, i, n) {
  29887. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  29888. t[r + i] = e[r];
  29889. return r
  29890. }
  29891. function K(e) {
  29892. return e !== e
  29893. }
  29894. var Q = e("base64-js")
  29895. , J = e("ieee754")
  29896. , $ = e("isarray");
  29897. i.Buffer = a,
  29898. i.SlowBuffer = m,
  29899. i.INSPECT_MAX_BYTES = 50,
  29900. a.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : n(),
  29901. i.kMaxLength = r(),
  29902. a.poolSize = 8192,
  29903. a._augment = function(e) {
  29904. return e.__proto__ = a.prototype,
  29905. e
  29906. }
  29907. ,
  29908. a.from = function(e, t, i) {
  29909. return s(null, e, t, i)
  29910. }
  29911. ,
  29912. a.TYPED_ARRAY_SUPPORT && (a.prototype.__proto__ = Uint8Array.prototype,
  29913. a.__proto__ = Uint8Array,
  29914. "undefined" != typeof Symbol && Symbol.species && a[Symbol.species] === a && Object.defineProperty(a, Symbol.species, {
  29915. value: null,
  29916. configurable: !0
  29917. })),
  29918. a.alloc = function(e, t, i) {
  29919. return c(null, e, t, i)
  29920. }
  29921. ,
  29922. a.allocUnsafe = function(e) {
  29923. return h(null, e)
  29924. }
  29925. ,
  29926. a.allocUnsafeSlow = function(e) {
  29927. return h(null, e)
  29928. }
  29929. ,
  29930. a.isBuffer = function(e) {
  29931. return !(null == e || !e._isBuffer)
  29932. }
  29933. ,
  29934. a.compare = function(e, t) {
  29935. if (!a.isBuffer(e) || !a.isBuffer(t))
  29936. throw new TypeError("Arguments must be Buffers");
  29937. if (e === t)
  29938. return 0;
  29939. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  29940. if (e[r] !== t[r]) {
  29941. i = e[r],
  29942. n = t[r];
  29943. break
  29944. }
  29945. return i < n ? -1 : n < i ? 1 : 0
  29946. }
  29947. ,
  29948. a.isEncoding = function(e) {
  29949. switch (String(e).toLowerCase()) {
  29950. case "hex":
  29951. case "utf8":
  29952. case "utf-8":
  29953. case "ascii":
  29954. case "latin1":
  29955. case "binary":
  29956. case "base64":
  29957. case "ucs2":
  29958. case "ucs-2":
  29959. case "utf16le":
  29960. case "utf-16le":
  29961. return !0;
  29962. default:
  29963. return !1
  29964. }
  29965. }
  29966. ,
  29967. a.concat = function(e, t) {
  29968. if (!$(e))
  29969. throw new TypeError('"list" argument must be an Array of Buffers');
  29970. if (0 === e.length)
  29971. return a.alloc(0);
  29972. var i;
  29973. if (void 0 === t)
  29974. for (t = 0,
  29975. i = 0; i < e.length; ++i)
  29976. t += e[i].length;
  29977. var n = a.allocUnsafe(t)
  29978. , r = 0;
  29979. for (i = 0; i < e.length; ++i) {
  29980. var o = e[i];
  29981. if (!a.isBuffer(o))
  29982. throw new TypeError('"list" argument must be an Array of Buffers');
  29983. o.copy(n, r),
  29984. r += o.length
  29985. }
  29986. return n
  29987. }
  29988. ,
  29989. a.byteLength = v,
  29990. a.prototype._isBuffer = !0,
  29991. a.prototype.swap16 = function() {
  29992. var e = this.length;
  29993. if (e % 2 !== 0)
  29994. throw new RangeError("Buffer size must be a multiple of 16-bits");
  29995. for (var t = 0; t < e; t += 2)
  29996. y(this, t, t + 1);
  29997. return this
  29998. }
  29999. ,
  30000. a.prototype.swap32 = function() {
  30001. var e = this.length;
  30002. if (e % 4 !== 0)
  30003. throw new RangeError("Buffer size must be a multiple of 32-bits");
  30004. for (var t = 0; t < e; t += 4)
  30005. y(this, t, t + 3),
  30006. y(this, t + 1, t + 2);
  30007. return this
  30008. }
  30009. ,
  30010. a.prototype.swap64 = function() {
  30011. var e = this.length;
  30012. if (e % 8 !== 0)
  30013. throw new RangeError("Buffer size must be a multiple of 64-bits");
  30014. for (var t = 0; t < e; t += 8)
  30015. y(this, t, t + 7),
  30016. y(this, t + 1, t + 6),
  30017. y(this, t + 2, t + 5),
  30018. y(this, t + 3, t + 4);
  30019. return this
  30020. }
  30021. ,
  30022. a.prototype.toString = function() {
  30023. var e = 0 | this.length;
  30024. return 0 === e ? "" : 0 === arguments.length ? M(this, 0, e) : A.apply(this, arguments)
  30025. }
  30026. ,
  30027. a.prototype.equals = function(e) {
  30028. if (!a.isBuffer(e))
  30029. throw new TypeError("Argument must be a Buffer");
  30030. return this === e || 0 === a.compare(this, e)
  30031. }
  30032. ,
  30033. a.prototype.inspect = function() {
  30034. var e = ""
  30035. , t = i.INSPECT_MAX_BYTES;
  30036. return this.length > 0 && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  30037. this.length > t && (e += " ... ")),
  30038. "<Buffer " + e + ">"
  30039. }
  30040. ,
  30041. a.prototype.compare = function(e, t, i, n, r) {
  30042. if (!a.isBuffer(e))
  30043. throw new TypeError("Argument must be a Buffer");
  30044. if (void 0 === t && (t = 0),
  30045. void 0 === i && (i = e ? e.length : 0),
  30046. void 0 === n && (n = 0),
  30047. void 0 === r && (r = this.length),
  30048. t < 0 || i > e.length || n < 0 || r > this.length)
  30049. throw new RangeError("out of range index");
  30050. if (n >= r && t >= i)
  30051. return 0;
  30052. if (n >= r)
  30053. return -1;
  30054. if (t >= i)
  30055. return 1;
  30056. if (t >>>= 0,
  30057. i >>>= 0,
  30058. n >>>= 0,
  30059. r >>>= 0,
  30060. this === e)
  30061. return 0;
  30062. 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)
  30063. if (c[u] !== h[u]) {
  30064. o = c[u],
  30065. s = h[u];
  30066. break
  30067. }
  30068. return o < s ? -1 : s < o ? 1 : 0
  30069. }
  30070. ,
  30071. a.prototype.includes = function(e, t, i) {
  30072. return this.indexOf(e, t, i) !== -1
  30073. }
  30074. ,
  30075. a.prototype.indexOf = function(e, t, i) {
  30076. return C(this, e, t, i, !0)
  30077. }
  30078. ,
  30079. a.prototype.lastIndexOf = function(e, t, i) {
  30080. return C(this, e, t, i, !1)
  30081. }
  30082. ,
  30083. a.prototype.write = function(e, t, i, n) {
  30084. if (void 0 === t)
  30085. n = "utf8",
  30086. i = this.length,
  30087. t = 0;
  30088. else if (void 0 === i && "string" == typeof t)
  30089. n = t,
  30090. i = this.length,
  30091. t = 0;
  30092. else {
  30093. if (!isFinite(t))
  30094. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  30095. t |= 0,
  30096. isFinite(i) ? (i |= 0,
  30097. void 0 === n && (n = "utf8")) : (n = i,
  30098. i = void 0)
  30099. }
  30100. var r = this.length - t;
  30101. if ((void 0 === i || i > r) && (i = r),
  30102. e.length > 0 && (i < 0 || t < 0) || t > this.length)
  30103. throw new RangeError("Attempt to write outside buffer bounds");
  30104. n || (n = "utf8");
  30105. for (var o = !1; ; )
  30106. switch (n) {
  30107. case "hex":
  30108. return E(this, e, t, i);
  30109. case "utf8":
  30110. case "utf-8":
  30111. return b(this, e, t, i);
  30112. case "ascii":
  30113. return w(this, e, t, i);
  30114. case "latin1":
  30115. case "binary":
  30116. return _(this, e, t, i);
  30117. case "base64":
  30118. return T(this, e, t, i);
  30119. case "ucs2":
  30120. case "ucs-2":
  30121. case "utf16le":
  30122. case "utf-16le":
  30123. return x(this, e, t, i);
  30124. default:
  30125. if (o)
  30126. throw new TypeError("Unknown encoding: " + n);
  30127. n = ("" + n).toLowerCase(),
  30128. o = !0
  30129. }
  30130. }
  30131. ,
  30132. a.prototype.toJSON = function() {
  30133. return {
  30134. type: "Buffer",
  30135. data: Array.prototype.slice.call(this._arr || this, 0)
  30136. }
  30137. }
  30138. ;
  30139. var ee = 4096;
  30140. a.prototype.slice = function(e, t) {
  30141. var i = this.length;
  30142. e = ~~e,
  30143. t = void 0 === t ? i : ~~t,
  30144. e < 0 ? (e += i,
  30145. e < 0 && (e = 0)) : e > i && (e = i),
  30146. t < 0 ? (t += i,
  30147. t < 0 && (t = 0)) : t > i && (t = i),
  30148. t < e && (t = e);
  30149. var n;
  30150. if (a.TYPED_ARRAY_SUPPORT)
  30151. n = this.subarray(e, t),
  30152. n.__proto__ = a.prototype;
  30153. else {
  30154. var r = t - e;
  30155. n = new a(r,void 0);
  30156. for (var o = 0; o < r; ++o)
  30157. n[o] = this[o + e]
  30158. }
  30159. return n
  30160. }
  30161. ,
  30162. a.prototype.readUIntLE = function(e, t, i) {
  30163. e |= 0,
  30164. t |= 0,
  30165. i || N(e, t, this.length);
  30166. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30167. n += this[e + o] * r;
  30168. return n
  30169. }
  30170. ,
  30171. a.prototype.readUIntBE = function(e, t, i) {
  30172. e |= 0,
  30173. t |= 0,
  30174. i || N(e, t, this.length);
  30175. for (var n = this[e + --t], r = 1; t > 0 && (r *= 256); )
  30176. n += this[e + --t] * r;
  30177. return n
  30178. }
  30179. ,
  30180. a.prototype.readUInt8 = function(e, t) {
  30181. return t || N(e, 1, this.length),
  30182. this[e]
  30183. }
  30184. ,
  30185. a.prototype.readUInt16LE = function(e, t) {
  30186. return t || N(e, 2, this.length),
  30187. this[e] | this[e + 1] << 8
  30188. }
  30189. ,
  30190. a.prototype.readUInt16BE = function(e, t) {
  30191. return t || N(e, 2, this.length),
  30192. this[e] << 8 | this[e + 1]
  30193. }
  30194. ,
  30195. a.prototype.readUInt32LE = function(e, t) {
  30196. return t || N(e, 4, this.length),
  30197. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  30198. }
  30199. ,
  30200. a.prototype.readUInt32BE = function(e, t) {
  30201. return t || N(e, 4, this.length),
  30202. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  30203. }
  30204. ,
  30205. a.prototype.readIntLE = function(e, t, i) {
  30206. e |= 0,
  30207. t |= 0,
  30208. i || N(e, t, this.length);
  30209. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30210. n += this[e + o] * r;
  30211. return r *= 128,
  30212. n >= r && (n -= Math.pow(2, 8 * t)),
  30213. n
  30214. }
  30215. ,
  30216. a.prototype.readIntBE = function(e, t, i) {
  30217. e |= 0,
  30218. t |= 0,
  30219. i || N(e, t, this.length);
  30220. for (var n = t, r = 1, o = this[e + --n]; n > 0 && (r *= 256); )
  30221. o += this[e + --n] * r;
  30222. return r *= 128,
  30223. o >= r && (o -= Math.pow(2, 8 * t)),
  30224. o
  30225. }
  30226. ,
  30227. a.prototype.readInt8 = function(e, t) {
  30228. return t || N(e, 1, this.length),
  30229. 128 & this[e] ? (255 - this[e] + 1) * -1 : this[e]
  30230. }
  30231. ,
  30232. a.prototype.readInt16LE = function(e, t) {
  30233. t || N(e, 2, this.length);
  30234. var i = this[e] | this[e + 1] << 8;
  30235. return 32768 & i ? 4294901760 | i : i
  30236. }
  30237. ,
  30238. a.prototype.readInt16BE = function(e, t) {
  30239. t || N(e, 2, this.length);
  30240. var i = this[e + 1] | this[e] << 8;
  30241. return 32768 & i ? 4294901760 | i : i
  30242. }
  30243. ,
  30244. a.prototype.readInt32LE = function(e, t) {
  30245. return t || N(e, 4, this.length),
  30246. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  30247. }
  30248. ,
  30249. a.prototype.readInt32BE = function(e, t) {
  30250. return t || N(e, 4, this.length),
  30251. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  30252. }
  30253. ,
  30254. a.prototype.readFloatLE = function(e, t) {
  30255. return t || N(e, 4, this.length),
  30256. J.read(this, e, !0, 23, 4)
  30257. }
  30258. ,
  30259. a.prototype.readFloatBE = function(e, t) {
  30260. return t || N(e, 4, this.length),
  30261. J.read(this, e, !1, 23, 4)
  30262. }
  30263. ,
  30264. a.prototype.readDoubleLE = function(e, t) {
  30265. return t || N(e, 8, this.length),
  30266. J.read(this, e, !0, 52, 8)
  30267. }
  30268. ,
  30269. a.prototype.readDoubleBE = function(e, t) {
  30270. return t || N(e, 8, this.length),
  30271. J.read(this, e, !1, 52, 8)
  30272. }
  30273. ,
  30274. a.prototype.writeUIntLE = function(e, t, i, n) {
  30275. if (e = +e,
  30276. t |= 0,
  30277. i |= 0,
  30278. !n) {
  30279. var r = Math.pow(2, 8 * i) - 1;
  30280. B(this, e, t, i, r, 0)
  30281. }
  30282. var o = 1
  30283. , a = 0;
  30284. for (this[t] = 255 & e; ++a < i && (o *= 256); )
  30285. this[t + a] = e / o & 255;
  30286. return t + i
  30287. }
  30288. ,
  30289. a.prototype.writeUIntBE = function(e, t, i, n) {
  30290. if (e = +e,
  30291. t |= 0,
  30292. i |= 0,
  30293. !n) {
  30294. var r = Math.pow(2, 8 * i) - 1;
  30295. B(this, e, t, i, r, 0)
  30296. }
  30297. var o = i - 1
  30298. , a = 1;
  30299. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  30300. this[t + o] = e / a & 255;
  30301. return t + i
  30302. }
  30303. ,
  30304. a.prototype.writeUInt8 = function(e, t, i) {
  30305. return e = +e,
  30306. t |= 0,
  30307. i || B(this, e, t, 1, 255, 0),
  30308. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30309. this[t] = 255 & e,
  30310. t + 1
  30311. }
  30312. ,
  30313. a.prototype.writeUInt16LE = function(e, t, i) {
  30314. return e = +e,
  30315. t |= 0,
  30316. i || B(this, e, t, 2, 65535, 0),
  30317. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30318. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  30319. t + 2
  30320. }
  30321. ,
  30322. a.prototype.writeUInt16BE = function(e, t, i) {
  30323. return e = +e,
  30324. t |= 0,
  30325. i || B(this, e, t, 2, 65535, 0),
  30326. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30327. this[t + 1] = 255 & e) : F(this, e, t, !1),
  30328. t + 2
  30329. }
  30330. ,
  30331. a.prototype.writeUInt32LE = function(e, t, i) {
  30332. return e = +e,
  30333. t |= 0,
  30334. i || B(this, e, t, 4, 4294967295, 0),
  30335. a.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  30336. this[t + 2] = e >>> 16,
  30337. this[t + 1] = e >>> 8,
  30338. this[t] = 255 & e) : V(this, e, t, !0),
  30339. t + 4
  30340. }
  30341. ,
  30342. a.prototype.writeUInt32BE = function(e, t, i) {
  30343. return e = +e,
  30344. t |= 0,
  30345. i || B(this, e, t, 4, 4294967295, 0),
  30346. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30347. this[t + 1] = e >>> 16,
  30348. this[t + 2] = e >>> 8,
  30349. this[t + 3] = 255 & e) : V(this, e, t, !1),
  30350. t + 4
  30351. }
  30352. ,
  30353. a.prototype.writeIntLE = function(e, t, i, n) {
  30354. if (e = +e,
  30355. t |= 0,
  30356. !n) {
  30357. var r = Math.pow(2, 8 * i - 1);
  30358. B(this, e, t, i, r - 1, -r)
  30359. }
  30360. var o = 0
  30361. , a = 1
  30362. , s = 0;
  30363. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  30364. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  30365. this[t + o] = (e / a >> 0) - s & 255;
  30366. return t + i
  30367. }
  30368. ,
  30369. a.prototype.writeIntBE = function(e, t, i, n) {
  30370. if (e = +e,
  30371. t |= 0,
  30372. !n) {
  30373. var r = Math.pow(2, 8 * i - 1);
  30374. B(this, e, t, i, r - 1, -r)
  30375. }
  30376. var o = i - 1
  30377. , a = 1
  30378. , s = 0;
  30379. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  30380. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  30381. this[t + o] = (e / a >> 0) - s & 255;
  30382. return t + i
  30383. }
  30384. ,
  30385. a.prototype.writeInt8 = function(e, t, i) {
  30386. return e = +e,
  30387. t |= 0,
  30388. i || B(this, e, t, 1, 127, -128),
  30389. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30390. e < 0 && (e = 255 + e + 1),
  30391. this[t] = 255 & e,
  30392. t + 1
  30393. }
  30394. ,
  30395. a.prototype.writeInt16LE = function(e, t, i) {
  30396. return e = +e,
  30397. t |= 0,
  30398. i || B(this, e, t, 2, 32767, -32768),
  30399. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30400. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  30401. t + 2
  30402. }
  30403. ,
  30404. a.prototype.writeInt16BE = function(e, t, i) {
  30405. return e = +e,
  30406. t |= 0,
  30407. i || B(this, e, t, 2, 32767, -32768),
  30408. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30409. this[t + 1] = 255 & e) : F(this, e, t, !1),
  30410. t + 2
  30411. }
  30412. ,
  30413. a.prototype.writeInt32LE = function(e, t, i) {
  30414. return e = +e,
  30415. t |= 0,
  30416. i || B(this, e, t, 4, 2147483647, -2147483648),
  30417. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30418. this[t + 1] = e >>> 8,
  30419. this[t + 2] = e >>> 16,
  30420. this[t + 3] = e >>> 24) : V(this, e, t, !0),
  30421. t + 4
  30422. }
  30423. ,
  30424. a.prototype.writeInt32BE = function(e, t, i) {
  30425. return e = +e,
  30426. t |= 0,
  30427. i || B(this, e, t, 4, 2147483647, -2147483648),
  30428. e < 0 && (e = 4294967295 + e + 1),
  30429. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30430. this[t + 1] = e >>> 16,
  30431. this[t + 2] = e >>> 8,
  30432. this[t + 3] = 255 & e) : V(this, e, t, !1),
  30433. t + 4
  30434. }
  30435. ,
  30436. a.prototype.writeFloatLE = function(e, t, i) {
  30437. return k(this, e, t, !0, i)
  30438. }
  30439. ,
  30440. a.prototype.writeFloatBE = function(e, t, i) {
  30441. return k(this, e, t, !1, i)
  30442. }
  30443. ,
  30444. a.prototype.writeDoubleLE = function(e, t, i) {
  30445. return H(this, e, t, !0, i)
  30446. }
  30447. ,
  30448. a.prototype.writeDoubleBE = function(e, t, i) {
  30449. return H(this, e, t, !1, i)
  30450. }
  30451. ,
  30452. a.prototype.copy = function(e, t, i, n) {
  30453. if (i || (i = 0),
  30454. n || 0 === n || (n = this.length),
  30455. t >= e.length && (t = e.length),
  30456. t || (t = 0),
  30457. n > 0 && n < i && (n = i),
  30458. n === i)
  30459. return 0;
  30460. if (0 === e.length || 0 === this.length)
  30461. return 0;
  30462. if (t < 0)
  30463. throw new RangeError("targetStart out of bounds");
  30464. if (i < 0 || i >= this.length)
  30465. throw new RangeError("sourceStart out of bounds");
  30466. if (n < 0)
  30467. throw new RangeError("sourceEnd out of bounds");
  30468. n > this.length && (n = this.length),
  30469. e.length - t < n - i && (n = e.length - t + i);
  30470. var r, o = n - i;
  30471. if (this === e && i < t && t < n)
  30472. for (r = o - 1; r >= 0; --r)
  30473. e[r + t] = this[r + i];
  30474. else if (o < 1e3 || !a.TYPED_ARRAY_SUPPORT)
  30475. for (r = 0; r < o; ++r)
  30476. e[r + t] = this[r + i];
  30477. else
  30478. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  30479. return o
  30480. }
  30481. ,
  30482. a.prototype.fill = function(e, t, i, n) {
  30483. if ("string" == typeof e) {
  30484. if ("string" == typeof t ? (n = t,
  30485. t = 0,
  30486. i = this.length) : "string" == typeof i && (n = i,
  30487. i = this.length),
  30488. 1 === e.length) {
  30489. var r = e.charCodeAt(0);
  30490. r < 256 && (e = r)
  30491. }
  30492. if (void 0 !== n && "string" != typeof n)
  30493. throw new TypeError("encoding must be a string");
  30494. if ("string" == typeof n && !a.isEncoding(n))
  30495. throw new TypeError("Unknown encoding: " + n)
  30496. } else
  30497. "number" == typeof e && (e &= 255);
  30498. if (t < 0 || this.length < t || this.length < i)
  30499. throw new RangeError("Out of range index");
  30500. if (i <= t)
  30501. return this;
  30502. t >>>= 0,
  30503. i = void 0 === i ? this.length : i >>> 0,
  30504. e || (e = 0);
  30505. var o;
  30506. if ("number" == typeof e)
  30507. for (o = t; o < i; ++o)
  30508. this[o] = e;
  30509. else {
  30510. var s = a.isBuffer(e) ? e : j(new a(e,n).toString())
  30511. , l = s.length;
  30512. for (o = 0; o < i - t; ++o)
  30513. this[o + t] = s[o % l]
  30514. }
  30515. return this
  30516. }
  30517. ;
  30518. var te = /[^+\/0-9A-Za-z-_]/g
  30519. }
  30520. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30521. }
  30522. , {
  30523. "base64-js": 199,
  30524. ieee754: 200,
  30525. isarray: 201
  30526. }],
  30527. 199: [function(e, t, i) {
  30528. "use strict";
  30529. function n(e) {
  30530. var t = e.length;
  30531. if (t % 4 > 0)
  30532. throw new Error("Invalid string. Length must be a multiple of 4");
  30533. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  30534. }
  30535. function r(e) {
  30536. return 3 * e.length / 4 - n(e)
  30537. }
  30538. function o(e) {
  30539. var t, i, r, o, a, s, l = e.length;
  30540. a = n(e),
  30541. s = new u(3 * l / 4 - a),
  30542. r = a > 0 ? l - 4 : l;
  30543. var c = 0;
  30544. for (t = 0,
  30545. i = 0; t < r; t += 4,
  30546. i += 3)
  30547. o = h[e.charCodeAt(t)] << 18 | h[e.charCodeAt(t + 1)] << 12 | h[e.charCodeAt(t + 2)] << 6 | h[e.charCodeAt(t + 3)],
  30548. s[c++] = o >> 16 & 255,
  30549. s[c++] = o >> 8 & 255,
  30550. s[c++] = 255 & o;
  30551. return 2 === a ? (o = h[e.charCodeAt(t)] << 2 | h[e.charCodeAt(t + 1)] >> 4,
  30552. s[c++] = 255 & o) : 1 === a && (o = h[e.charCodeAt(t)] << 10 | h[e.charCodeAt(t + 1)] << 4 | h[e.charCodeAt(t + 2)] >> 2,
  30553. s[c++] = o >> 8 & 255,
  30554. s[c++] = 255 & o),
  30555. s
  30556. }
  30557. function a(e) {
  30558. return c[e >> 18 & 63] + c[e >> 12 & 63] + c[e >> 6 & 63] + c[63 & e]
  30559. }
  30560. function s(e, t, i) {
  30561. for (var n, r = [], o = t; o < i; o += 3)
  30562. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  30563. r.push(a(n));
  30564. return r.join("")
  30565. }
  30566. function l(e) {
  30567. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 16383, l = 0, h = i - n; l < h; l += a)
  30568. o.push(s(e, l, l + a > h ? h : l + a));
  30569. return 1 === n ? (t = e[i - 1],
  30570. r += c[t >> 2],
  30571. r += c[t << 4 & 63],
  30572. r += "==") : 2 === n && (t = (e[i - 2] << 8) + e[i - 1],
  30573. r += c[t >> 10],
  30574. r += c[t >> 4 & 63],
  30575. r += c[t << 2 & 63],
  30576. r += "="),
  30577. o.push(r),
  30578. o.join("")
  30579. }
  30580. i.byteLength = r,
  30581. i.toByteArray = o,
  30582. i.fromByteArray = l;
  30583. for (var c = [], h = [], u = "undefined" != typeof Uint8Array ? Uint8Array : Array, d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", p = 0, f = d.length; p < f; ++p)
  30584. c[p] = d[p],
  30585. h[d.charCodeAt(p)] = p;
  30586. h["-".charCodeAt(0)] = 62,
  30587. h["_".charCodeAt(0)] = 63
  30588. }
  30589. , {}],
  30590. 200: [function(e, t, i) {
  30591. i.read = function(e, t, i, n, r) {
  30592. 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];
  30593. for (u += d,
  30594. o = p & (1 << -h) - 1,
  30595. p >>= -h,
  30596. h += s; h > 0; o = 256 * o + e[t + u],
  30597. u += d,
  30598. h -= 8)
  30599. ;
  30600. for (a = o & (1 << -h) - 1,
  30601. o >>= -h,
  30602. h += n; h > 0; a = 256 * a + e[t + u],
  30603. u += d,
  30604. h -= 8)
  30605. ;
  30606. if (0 === o)
  30607. o = 1 - c;
  30608. else {
  30609. if (o === l)
  30610. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  30611. a += Math.pow(2, n),
  30612. o -= c
  30613. }
  30614. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  30615. }
  30616. ,
  30617. i.write = function(e, t, i, n, r, o) {
  30618. 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;
  30619. for (t = Math.abs(t),
  30620. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  30621. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  30622. t * (l = Math.pow(2, -a)) < 1 && (a--,
  30623. l *= 2),
  30624. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  30625. t * l >= 2 && (a++,
  30626. l /= 2),
  30627. a + u >= h ? (s = 0,
  30628. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  30629. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  30630. a = 0)); r >= 8; e[i + p] = 255 & s,
  30631. p += f,
  30632. s /= 256,
  30633. r -= 8)
  30634. ;
  30635. for (a = a << r | s,
  30636. c += r; c > 0; e[i + p] = 255 & a,
  30637. p += f,
  30638. a /= 256,
  30639. c -= 8)
  30640. ;
  30641. e[i + p - f] |= 128 * g
  30642. }
  30643. }
  30644. , {}],
  30645. 201: [function(e, t, i) {
  30646. var n = {}.toString;
  30647. t.exports = Array.isArray || function(e) {
  30648. return "[object Array]" == n.call(e)
  30649. }
  30650. }
  30651. , {}],
  30652. 202: [function(e, t, i) {
  30653. function n() {
  30654. this._events = this._events || {},
  30655. this._maxListeners = this._maxListeners || void 0
  30656. }
  30657. function r(e) {
  30658. return "function" == typeof e
  30659. }
  30660. function o(e) {
  30661. return "number" == typeof e
  30662. }
  30663. function a(e) {
  30664. return "object" == typeof e && null !== e
  30665. }
  30666. function s(e) {
  30667. return void 0 === e
  30668. }
  30669. t.exports = n,
  30670. n.EventEmitter = n,
  30671. n.prototype._events = void 0,
  30672. n.prototype._maxListeners = void 0,
  30673. n.defaultMaxListeners = 10,
  30674. n.prototype.setMaxListeners = function(e) {
  30675. if (!o(e) || e < 0 || isNaN(e))
  30676. throw TypeError("n must be a positive number");
  30677. return this._maxListeners = e,
  30678. this
  30679. }
  30680. ,
  30681. n.prototype.emit = function(e) {
  30682. var t, i, n, o, l, c;
  30683. if (this._events || (this._events = {}),
  30684. "error" === e && (!this._events.error || a(this._events.error) && !this._events.error.length)) {
  30685. if (t = arguments[1],
  30686. t instanceof Error)
  30687. throw t;
  30688. var h = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  30689. throw h.context = t,
  30690. h
  30691. }
  30692. if (i = this._events[e],
  30693. s(i))
  30694. return !1;
  30695. if (r(i))
  30696. switch (arguments.length) {
  30697. case 1:
  30698. i.call(this);
  30699. break;
  30700. case 2:
  30701. i.call(this, arguments[1]);
  30702. break;
  30703. case 3:
  30704. i.call(this, arguments[1], arguments[2]);
  30705. break;
  30706. default:
  30707. o = Array.prototype.slice.call(arguments, 1),
  30708. i.apply(this, o)
  30709. }
  30710. else if (a(i))
  30711. for (o = Array.prototype.slice.call(arguments, 1),
  30712. c = i.slice(),
  30713. n = c.length,
  30714. l = 0; l < n; l++)
  30715. c[l].apply(this, o);
  30716. return !0
  30717. }
  30718. ,
  30719. n.prototype.addListener = function(e, t) {
  30720. var i;
  30721. if (!r(t))
  30722. throw TypeError("listener must be a function");
  30723. return this._events || (this._events = {}),
  30724. this._events.newListener && this.emit("newListener", e, r(t.listener) ? t.listener : t),
  30725. this._events[e] ? a(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  30726. a(this._events[e]) && !this._events[e].warned && (i = s(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners,
  30727. i && i > 0 && this._events[e].length > i && (this._events[e].warned = !0,
  30728. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  30729. "function" == typeof console.trace && console.trace())),
  30730. this
  30731. }
  30732. ,
  30733. n.prototype.on = n.prototype.addListener,
  30734. n.prototype.once = function(e, t) {
  30735. function i() {
  30736. this.removeListener(e, i),
  30737. n || (n = !0,
  30738. t.apply(this, arguments))
  30739. }
  30740. if (!r(t))
  30741. throw TypeError("listener must be a function");
  30742. var n = !1;
  30743. return i.listener = t,
  30744. this.on(e, i),
  30745. this
  30746. }
  30747. ,
  30748. n.prototype.removeListener = function(e, t) {
  30749. var i, n, o, s;
  30750. if (!r(t))
  30751. throw TypeError("listener must be a function");
  30752. if (!this._events || !this._events[e])
  30753. return this;
  30754. if (i = this._events[e],
  30755. o = i.length,
  30756. n = -1,
  30757. i === t || r(i.listener) && i.listener === t)
  30758. delete this._events[e],
  30759. this._events.removeListener && this.emit("removeListener", e, t);
  30760. else if (a(i)) {
  30761. for (s = o; s-- > 0; )
  30762. if (i[s] === t || i[s].listener && i[s].listener === t) {
  30763. n = s;
  30764. break
  30765. }
  30766. if (n < 0)
  30767. return this;
  30768. 1 === i.length ? (i.length = 0,
  30769. delete this._events[e]) : i.splice(n, 1),
  30770. this._events.removeListener && this.emit("removeListener", e, t)
  30771. }
  30772. return this
  30773. }
  30774. ,
  30775. n.prototype.removeAllListeners = function(e) {
  30776. var t, i;
  30777. if (!this._events)
  30778. return this;
  30779. if (!this._events.removeListener)
  30780. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  30781. this;
  30782. if (0 === arguments.length) {
  30783. for (t in this._events)
  30784. "removeListener" !== t && this.removeAllListeners(t);
  30785. return this.removeAllListeners("removeListener"),
  30786. this._events = {},
  30787. this
  30788. }
  30789. if (i = this._events[e],
  30790. r(i))
  30791. this.removeListener(e, i);
  30792. else if (i)
  30793. for (; i.length; )
  30794. this.removeListener(e, i[i.length - 1]);
  30795. return delete this._events[e],
  30796. this
  30797. }
  30798. ,
  30799. n.prototype.listeners = function(e) {
  30800. var t;
  30801. return t = this._events && this._events[e] ? r(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  30802. }
  30803. ,
  30804. n.prototype.listenerCount = function(e) {
  30805. if (this._events) {
  30806. var t = this._events[e];
  30807. if (r(t))
  30808. return 1;
  30809. if (t)
  30810. return t.length
  30811. }
  30812. return 0
  30813. }
  30814. ,
  30815. n.listenerCount = function(e, t) {
  30816. return e.listenerCount(t)
  30817. }
  30818. }
  30819. , {}],
  30820. 203: [function(e, t, i) {
  30821. function n() {
  30822. throw new Error("setTimeout has not been defined")
  30823. }
  30824. function r() {
  30825. throw new Error("clearTimeout has not been defined")
  30826. }
  30827. function o(e) {
  30828. if (u === setTimeout)
  30829. return setTimeout(e, 0);
  30830. if ((u === n || !u) && setTimeout)
  30831. return u = setTimeout,
  30832. setTimeout(e, 0);
  30833. try {
  30834. return u(e, 0)
  30835. } catch (t) {
  30836. try {
  30837. return u.call(null, e, 0)
  30838. } catch (t) {
  30839. return u.call(this, e, 0)
  30840. }
  30841. }
  30842. }
  30843. function a(e) {
  30844. if (d === clearTimeout)
  30845. return clearTimeout(e);
  30846. if ((d === r || !d) && clearTimeout)
  30847. return d = clearTimeout,
  30848. clearTimeout(e);
  30849. try {
  30850. return d(e)
  30851. } catch (t) {
  30852. try {
  30853. return d.call(null, e)
  30854. } catch (t) {
  30855. return d.call(this, e)
  30856. }
  30857. }
  30858. }
  30859. function s() {
  30860. m && f && (m = !1,
  30861. f.length ? g = f.concat(g) : v = -1,
  30862. g.length && l())
  30863. }
  30864. function l() {
  30865. if (!m) {
  30866. var e = o(s);
  30867. m = !0;
  30868. for (var t = g.length; t; ) {
  30869. for (f = g,
  30870. g = []; ++v < t; )
  30871. f && f[v].run();
  30872. v = -1,
  30873. t = g.length
  30874. }
  30875. f = null,
  30876. m = !1,
  30877. a(e)
  30878. }
  30879. }
  30880. function c(e, t) {
  30881. this.fun = e,
  30882. this.array = t
  30883. }
  30884. function h() {}
  30885. var u, d, p = t.exports = {};
  30886. !function() {
  30887. try {
  30888. u = "function" == typeof setTimeout ? setTimeout : n
  30889. } catch (e) {
  30890. u = n
  30891. }
  30892. try {
  30893. d = "function" == typeof clearTimeout ? clearTimeout : r
  30894. } catch (e) {
  30895. d = r
  30896. }
  30897. }();
  30898. var f, g = [], m = !1, v = -1;
  30899. p.nextTick = function(e) {
  30900. var t = new Array(arguments.length - 1);
  30901. if (arguments.length > 1)
  30902. for (var i = 1; i < arguments.length; i++)
  30903. t[i - 1] = arguments[i];
  30904. g.push(new c(e,t)),
  30905. 1 !== g.length || m || o(l)
  30906. }
  30907. ,
  30908. c.prototype.run = function() {
  30909. this.fun.apply(null, this.array)
  30910. }
  30911. ,
  30912. p.title = "browser",
  30913. p.browser = !0,
  30914. p.env = {},
  30915. p.argv = [],
  30916. p.version = "",
  30917. p.versions = {},
  30918. p.on = h,
  30919. p.addListener = h,
  30920. p.once = h,
  30921. p.off = h,
  30922. p.removeListener = h,
  30923. p.removeAllListeners = h,
  30924. p.emit = h,
  30925. p.binding = function(e) {
  30926. throw new Error("process.binding is not supported")
  30927. }
  30928. ,
  30929. p.cwd = function() {
  30930. return "/"
  30931. }
  30932. ,
  30933. p.chdir = function(e) {
  30934. throw new Error("process.chdir is not supported")
  30935. }
  30936. ,
  30937. p.umask = function() {
  30938. return 0
  30939. }
  30940. }
  30941. , {}],
  30942. 204: [function(e, t, i) {
  30943. (function(e) {
  30944. !function(n) {
  30945. function r(e) {
  30946. throw new RangeError(L[e])
  30947. }
  30948. function o(e, t) {
  30949. for (var i = e.length, n = []; i--; )
  30950. n[i] = t(e[i]);
  30951. return n
  30952. }
  30953. function a(e, t) {
  30954. var i = e.split("@")
  30955. , n = "";
  30956. i.length > 1 && (n = i[0] + "@",
  30957. e = i[1]),
  30958. e = e.replace(O, ".");
  30959. var r = e.split(".")
  30960. , a = o(r, t).join(".");
  30961. return n + a
  30962. }
  30963. function s(e) {
  30964. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  30965. t = e.charCodeAt(r++),
  30966. t >= 55296 && t <= 56319 && r < o ? (i = e.charCodeAt(r++),
  30967. 56320 == (64512 & i) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t),
  30968. r--)) : n.push(t);
  30969. return n
  30970. }
  30971. function l(e) {
  30972. return o(e, function(e) {
  30973. var t = "";
  30974. return e > 65535 && (e -= 65536,
  30975. t += B(e >>> 10 & 1023 | 55296),
  30976. e = 56320 | 1023 & e),
  30977. t += B(e)
  30978. }).join("")
  30979. }
  30980. function c(e) {
  30981. return e - 48 < 10 ? e - 22 : e - 65 < 26 ? e - 65 : e - 97 < 26 ? e - 97 : E
  30982. }
  30983. function h(e, t) {
  30984. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  30985. }
  30986. function u(e, t, i) {
  30987. var n = 0;
  30988. for (e = i ? N(e / T) : e >> 1,
  30989. e += N(e / t); e > D * w >> 1; n += E)
  30990. e = N(e / D);
  30991. return N(n + (D + 1) * e / (e + _))
  30992. }
  30993. function d(e) {
  30994. var t, i, n, o, a, s, h, d, p, f, g = [], m = e.length, v = 0, A = S, y = x;
  30995. for (i = e.lastIndexOf(M),
  30996. i < 0 && (i = 0),
  30997. n = 0; n < i; ++n)
  30998. e.charCodeAt(n) >= 128 && r("not-basic"),
  30999. g.push(e.charCodeAt(n));
  31000. for (o = i > 0 ? i + 1 : 0; o < m; ) {
  31001. for (a = v,
  31002. s = 1,
  31003. h = E; o >= m && r("invalid-input"),
  31004. d = c(e.charCodeAt(o++)),
  31005. (d >= E || d > N((I - v) / s)) && r("overflow"),
  31006. v += d * s,
  31007. p = h <= y ? b : h >= y + w ? w : h - y,
  31008. !(d < p); h += E)
  31009. f = E - p,
  31010. s > N(I / f) && r("overflow"),
  31011. s *= f;
  31012. t = g.length + 1,
  31013. y = u(v - a, t, 0 == a),
  31014. N(v / t) > I - A && r("overflow"),
  31015. A += N(v / t),
  31016. v %= t,
  31017. g.splice(v++, 0, A)
  31018. }
  31019. return l(g)
  31020. }
  31021. function p(e) {
  31022. var t, i, n, o, a, l, c, d, p, f, g, m, v, A, y, C = [];
  31023. for (e = s(e),
  31024. m = e.length,
  31025. t = S,
  31026. i = 0,
  31027. a = x,
  31028. l = 0; l < m; ++l)
  31029. g = e[l],
  31030. g < 128 && C.push(B(g));
  31031. for (n = o = C.length,
  31032. o && C.push(M); n < m; ) {
  31033. for (c = I,
  31034. l = 0; l < m; ++l)
  31035. g = e[l],
  31036. g >= t && g < c && (c = g);
  31037. for (v = n + 1,
  31038. c - t > N((I - i) / v) && r("overflow"),
  31039. i += (c - t) * v,
  31040. t = c,
  31041. l = 0; l < m; ++l)
  31042. if (g = e[l],
  31043. g < t && ++i > I && r("overflow"),
  31044. g == t) {
  31045. for (d = i,
  31046. p = E; f = p <= a ? b : p >= a + w ? w : p - a,
  31047. !(d < f); p += E)
  31048. y = d - f,
  31049. A = E - f,
  31050. C.push(B(h(f + y % A, 0))),
  31051. d = N(y / A);
  31052. C.push(B(h(d, 0))),
  31053. a = u(i, v, n == o),
  31054. i = 0,
  31055. ++n
  31056. }
  31057. ++i,
  31058. ++t
  31059. }
  31060. return C.join("")
  31061. }
  31062. function f(e) {
  31063. return a(e, function(e) {
  31064. return R.test(e) ? d(e.slice(4).toLowerCase()) : e
  31065. })
  31066. }
  31067. function g(e) {
  31068. return a(e, function(e) {
  31069. return P.test(e) ? "xn--" + p(e) : e
  31070. })
  31071. }
  31072. var m = "object" == typeof i && i && !i.nodeType && i
  31073. , v = "object" == typeof t && t && !t.nodeType && t
  31074. , A = "object" == typeof e && e;
  31075. A.global !== A && A.window !== A && A.self !== A || (n = A);
  31076. 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 = {
  31077. overflow: "Overflow: input needs wider integers to process",
  31078. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  31079. "invalid-input": "Invalid input"
  31080. }, D = E - b, N = Math.floor, B = String.fromCharCode;
  31081. if (y = {
  31082. version: "1.4.1",
  31083. ucs2: {
  31084. decode: s,
  31085. encode: l
  31086. },
  31087. decode: d,
  31088. encode: p,
  31089. toASCII: g,
  31090. toUnicode: f
  31091. },
  31092. "function" == typeof define && "object" == typeof define.amd && define.amd)
  31093. define("punycode", function() {
  31094. return y
  31095. });
  31096. else if (m && v)
  31097. if (t.exports == m)
  31098. v.exports = y;
  31099. else
  31100. for (C in y)
  31101. y.hasOwnProperty(C) && (m[C] = y[C]);
  31102. else
  31103. n.punycode = y
  31104. }(this)
  31105. }
  31106. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  31107. }
  31108. , {}],
  31109. 205: [function(e, t, i) {
  31110. "use strict";
  31111. function n(e, t) {
  31112. return Object.prototype.hasOwnProperty.call(e, t)
  31113. }
  31114. t.exports = function(e, t, i, o) {
  31115. t = t || "&",
  31116. i = i || "=";
  31117. var a = {};
  31118. if ("string" != typeof e || 0 === e.length)
  31119. return a;
  31120. var s = /\+/g;
  31121. e = e.split(t);
  31122. var l = 1e3;
  31123. o && "number" == typeof o.maxKeys && (l = o.maxKeys);
  31124. var c = e.length;
  31125. l > 0 && c > l && (c = l);
  31126. for (var h = 0; h < c; ++h) {
  31127. var u, d, p, f, g = e[h].replace(s, "%20"), m = g.indexOf(i);
  31128. m >= 0 ? (u = g.substr(0, m),
  31129. d = g.substr(m + 1)) : (u = g,
  31130. d = ""),
  31131. p = decodeURIComponent(u),
  31132. f = decodeURIComponent(d),
  31133. n(a, p) ? r(a[p]) ? a[p].push(f) : a[p] = [a[p], f] : a[p] = f
  31134. }
  31135. return a
  31136. }
  31137. ;
  31138. var r = Array.isArray || function(e) {
  31139. return "[object Array]" === Object.prototype.toString.call(e)
  31140. }
  31141. }
  31142. , {}],
  31143. 206: [function(e, t, i) {
  31144. "use strict";
  31145. function n(e, t) {
  31146. if (e.map)
  31147. return e.map(t);
  31148. for (var i = [], n = 0; n < e.length; n++)
  31149. i.push(t(e[n], n));
  31150. return i
  31151. }
  31152. var r = function(e) {
  31153. switch (typeof e) {
  31154. case "string":
  31155. return e;
  31156. case "boolean":
  31157. return e ? "true" : "false";
  31158. case "number":
  31159. return isFinite(e) ? e : "";
  31160. default:
  31161. return ""
  31162. }
  31163. };
  31164. t.exports = function(e, t, i, s) {
  31165. return t = t || "&",
  31166. i = i || "=",
  31167. null === e && (e = void 0),
  31168. "object" == typeof e ? n(a(e), function(a) {
  31169. var s = encodeURIComponent(r(a)) + i;
  31170. return o(e[a]) ? n(e[a], function(e) {
  31171. return s + encodeURIComponent(r(e))
  31172. }).join(t) : s + encodeURIComponent(r(e[a]))
  31173. }).join(t) : s ? encodeURIComponent(r(s)) + i + encodeURIComponent(r(e)) : ""
  31174. }
  31175. ;
  31176. var o = Array.isArray || function(e) {
  31177. return "[object Array]" === Object.prototype.toString.call(e)
  31178. }
  31179. , a = Object.keys || function(e) {
  31180. var t = [];
  31181. for (var i in e)
  31182. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  31183. return t
  31184. }
  31185. }
  31186. , {}],
  31187. 207: [function(e, t, i) {
  31188. "use strict";
  31189. i.decode = i.parse = e("./decode"),
  31190. i.encode = i.stringify = e("./encode")
  31191. }
  31192. , {
  31193. "./decode": 205,
  31194. "./encode": 206
  31195. }],
  31196. 208: [function(e, t, i) {
  31197. "use strict";
  31198. function n() {
  31199. this.protocol = null,
  31200. this.slashes = null,
  31201. this.auth = null,
  31202. this.host = null,
  31203. this.port = null,
  31204. this.hostname = null,
  31205. this.hash = null,
  31206. this.search = null,
  31207. this.query = null,
  31208. this.pathname = null,
  31209. this.path = null,
  31210. this.href = null
  31211. }
  31212. function r(e, t, i) {
  31213. if (e && c.isObject(e) && e instanceof n)
  31214. return e;
  31215. var r = new n;
  31216. return r.parse(e, t, i),
  31217. r
  31218. }
  31219. function o(e) {
  31220. return c.isString(e) && (e = r(e)),
  31221. e instanceof n ? e.format() : n.prototype.format.call(e)
  31222. }
  31223. function a(e, t) {
  31224. return r(e, !1, !0).resolve(t)
  31225. }
  31226. function s(e, t) {
  31227. return e ? r(e, !1, !0).resolveObject(t) : t
  31228. }
  31229. var l = e("punycode")
  31230. , c = e("./util");
  31231. i.parse = r,
  31232. i.resolve = a,
  31233. i.resolveObject = s,
  31234. i.format = o,
  31235. i.Url = n;
  31236. var h = /^([a-z0-9.+-]+:)/i
  31237. , u = /:[0-9]*$/
  31238. , d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  31239. , p = ["<", ">", '"', "`", " ", "\r", "\n", "\t"]
  31240. , f = ["{", "}", "|", "\\", "^", "`"].concat(p)
  31241. , g = ["'"].concat(f)
  31242. , m = ["%", "/", "?", ";", "#"].concat(g)
  31243. , v = ["/", "?", "#"]
  31244. , A = 255
  31245. , y = /^[+a-z0-9A-Z_-]{0,63}$/
  31246. , C = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  31247. , I = {
  31248. javascript: !0,
  31249. "javascript:": !0
  31250. }
  31251. , E = {
  31252. javascript: !0,
  31253. "javascript:": !0
  31254. }
  31255. , b = {
  31256. http: !0,
  31257. https: !0,
  31258. ftp: !0,
  31259. gopher: !0,
  31260. file: !0,
  31261. "http:": !0,
  31262. "https:": !0,
  31263. "ftp:": !0,
  31264. "gopher:": !0,
  31265. "file:": !0
  31266. }
  31267. , w = e("querystring");
  31268. n.prototype.parse = function(e, t, i) {
  31269. if (!c.isString(e))
  31270. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  31271. var n = e.indexOf("?")
  31272. , r = n !== -1 && n < e.indexOf("#") ? "?" : "#"
  31273. , o = e.split(r)
  31274. , a = /\\/g;
  31275. o[0] = o[0].replace(a, "/"),
  31276. e = o.join(r);
  31277. var s = e;
  31278. if (s = s.trim(),
  31279. !i && 1 === e.split("#").length) {
  31280. var u = d.exec(s);
  31281. if (u)
  31282. return this.path = s,
  31283. this.href = s,
  31284. this.pathname = u[1],
  31285. u[2] ? (this.search = u[2],
  31286. t ? this.query = w.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : t && (this.search = "",
  31287. this.query = {}),
  31288. this
  31289. }
  31290. var p = h.exec(s);
  31291. if (p) {
  31292. p = p[0];
  31293. var f = p.toLowerCase();
  31294. this.protocol = f,
  31295. s = s.substr(p.length)
  31296. }
  31297. if (i || p || s.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  31298. var _ = "//" === s.substr(0, 2);
  31299. !_ || p && E[p] || (s = s.substr(2),
  31300. this.slashes = !0)
  31301. }
  31302. if (!E[p] && (_ || p && !b[p])) {
  31303. for (var T = -1, x = 0; x < v.length; x++) {
  31304. var S = s.indexOf(v[x]);
  31305. S !== -1 && (T === -1 || S < T) && (T = S)
  31306. }
  31307. var M, R;
  31308. R = T === -1 ? s.lastIndexOf("@") : s.lastIndexOf("@", T),
  31309. R !== -1 && (M = s.slice(0, R),
  31310. s = s.slice(R + 1),
  31311. this.auth = decodeURIComponent(M)),
  31312. T = -1;
  31313. for (var x = 0; x < m.length; x++) {
  31314. var S = s.indexOf(m[x]);
  31315. S !== -1 && (T === -1 || S < T) && (T = S)
  31316. }
  31317. T === -1 && (T = s.length),
  31318. this.host = s.slice(0, T),
  31319. s = s.slice(T),
  31320. this.parseHost(),
  31321. this.hostname = this.hostname || "";
  31322. var P = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  31323. if (!P)
  31324. for (var O = this.hostname.split(/\./), x = 0, L = O.length; x < L; x++) {
  31325. var D = O[x];
  31326. if (D && !D.match(y)) {
  31327. for (var N = "", B = 0, F = D.length; B < F; B++)
  31328. N += D.charCodeAt(B) > 127 ? "x" : D[B];
  31329. if (!N.match(y)) {
  31330. var V = O.slice(0, x)
  31331. , U = O.slice(x + 1)
  31332. , k = D.match(C);
  31333. k && (V.push(k[1]),
  31334. U.unshift(k[2])),
  31335. U.length && (s = "/" + U.join(".") + s),
  31336. this.hostname = V.join(".");
  31337. break
  31338. }
  31339. }
  31340. }
  31341. this.hostname.length > A ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  31342. P || (this.hostname = l.toASCII(this.hostname));
  31343. var H = this.port ? ":" + this.port : ""
  31344. , G = this.hostname || "";
  31345. this.host = G + H,
  31346. this.href += this.host,
  31347. P && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  31348. "/" !== s[0] && (s = "/" + s))
  31349. }
  31350. if (!I[f])
  31351. for (var x = 0, L = g.length; x < L; x++) {
  31352. var z = g[x];
  31353. if (s.indexOf(z) !== -1) {
  31354. var W = encodeURIComponent(z);
  31355. W === z && (W = escape(z)),
  31356. s = s.split(z).join(W)
  31357. }
  31358. }
  31359. var j = s.indexOf("#");
  31360. j !== -1 && (this.hash = s.substr(j),
  31361. s = s.slice(0, j));
  31362. var Y = s.indexOf("?");
  31363. if (Y !== -1 ? (this.search = s.substr(Y),
  31364. this.query = s.substr(Y + 1),
  31365. t && (this.query = w.parse(this.query)),
  31366. s = s.slice(0, Y)) : t && (this.search = "",
  31367. this.query = {}),
  31368. s && (this.pathname = s),
  31369. b[f] && this.hostname && !this.pathname && (this.pathname = "/"),
  31370. this.pathname || this.search) {
  31371. var H = this.pathname || ""
  31372. , X = this.search || "";
  31373. this.path = H + X
  31374. }
  31375. return this.href = this.format(),
  31376. this
  31377. }
  31378. ,
  31379. n.prototype.format = function() {
  31380. var e = this.auth || "";
  31381. e && (e = encodeURIComponent(e),
  31382. e = e.replace(/%3A/i, ":"),
  31383. e += "@");
  31384. var t = this.protocol || ""
  31385. , i = this.pathname || ""
  31386. , n = this.hash || ""
  31387. , r = !1
  31388. , o = "";
  31389. this.host ? r = e + this.host : this.hostname && (r = e + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"),
  31390. this.port && (r += ":" + this.port)),
  31391. this.query && c.isObject(this.query) && Object.keys(this.query).length && (o = w.stringify(this.query));
  31392. var a = this.search || o && "?" + o || "";
  31393. return t && ":" !== t.substr(-1) && (t += ":"),
  31394. this.slashes || (!t || b[t]) && r !== !1 ? (r = "//" + (r || ""),
  31395. i && "/" !== i.charAt(0) && (i = "/" + i)) : r || (r = ""),
  31396. n && "#" !== n.charAt(0) && (n = "#" + n),
  31397. a && "?" !== a.charAt(0) && (a = "?" + a),
  31398. i = i.replace(/[?#]/g, function(e) {
  31399. return encodeURIComponent(e)
  31400. }),
  31401. a = a.replace("#", "%23"),
  31402. t + r + i + a + n
  31403. }
  31404. ,
  31405. n.prototype.resolve = function(e) {
  31406. return this.resolveObject(r(e, !1, !0)).format()
  31407. }
  31408. ,
  31409. n.prototype.resolveObject = function(e) {
  31410. if (c.isString(e)) {
  31411. var t = new n;
  31412. t.parse(e, !1, !0),
  31413. e = t
  31414. }
  31415. for (var i = new n, r = Object.keys(this), o = 0; o < r.length; o++) {
  31416. var a = r[o];
  31417. i[a] = this[a]
  31418. }
  31419. if (i.hash = e.hash,
  31420. "" === e.href)
  31421. return i.href = i.format(),
  31422. i;
  31423. if (e.slashes && !e.protocol) {
  31424. for (var s = Object.keys(e), l = 0; l < s.length; l++) {
  31425. var h = s[l];
  31426. "protocol" !== h && (i[h] = e[h])
  31427. }
  31428. return b[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  31429. i.href = i.format(),
  31430. i
  31431. }
  31432. if (e.protocol && e.protocol !== i.protocol) {
  31433. if (!b[e.protocol]) {
  31434. for (var u = Object.keys(e), d = 0; d < u.length; d++) {
  31435. var p = u[d];
  31436. i[p] = e[p]
  31437. }
  31438. return i.href = i.format(),
  31439. i
  31440. }
  31441. if (i.protocol = e.protocol,
  31442. e.host || E[e.protocol])
  31443. i.pathname = e.pathname;
  31444. else {
  31445. for (var f = (e.pathname || "").split("/"); f.length && !(e.host = f.shift()); )
  31446. ;
  31447. e.host || (e.host = ""),
  31448. e.hostname || (e.hostname = ""),
  31449. "" !== f[0] && f.unshift(""),
  31450. f.length < 2 && f.unshift(""),
  31451. i.pathname = f.join("/")
  31452. }
  31453. if (i.search = e.search,
  31454. i.query = e.query,
  31455. i.host = e.host || "",
  31456. i.auth = e.auth,
  31457. i.hostname = e.hostname || e.host,
  31458. i.port = e.port,
  31459. i.pathname || i.search) {
  31460. var g = i.pathname || ""
  31461. , m = i.search || "";
  31462. i.path = g + m
  31463. }
  31464. return i.slashes = i.slashes || e.slashes,
  31465. i.href = i.format(),
  31466. i
  31467. }
  31468. var v = i.pathname && "/" === i.pathname.charAt(0)
  31469. , A = e.host || e.pathname && "/" === e.pathname.charAt(0)
  31470. , y = A || v || i.host && e.pathname
  31471. , C = y
  31472. , I = i.pathname && i.pathname.split("/") || []
  31473. , f = e.pathname && e.pathname.split("/") || []
  31474. , w = i.protocol && !b[i.protocol];
  31475. if (w && (i.hostname = "",
  31476. i.port = null,
  31477. i.host && ("" === I[0] ? I[0] = i.host : I.unshift(i.host)),
  31478. i.host = "",
  31479. e.protocol && (e.hostname = null,
  31480. e.port = null,
  31481. e.host && ("" === f[0] ? f[0] = e.host : f.unshift(e.host)),
  31482. e.host = null),
  31483. y = y && ("" === f[0] || "" === I[0])),
  31484. A)
  31485. i.host = e.host || "" === e.host ? e.host : i.host,
  31486. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  31487. i.search = e.search,
  31488. i.query = e.query,
  31489. I = f;
  31490. else if (f.length)
  31491. I || (I = []),
  31492. I.pop(),
  31493. I = I.concat(f),
  31494. i.search = e.search,
  31495. i.query = e.query;
  31496. else if (!c.isNullOrUndefined(e.search)) {
  31497. if (w) {
  31498. i.hostname = i.host = I.shift();
  31499. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  31500. _ && (i.auth = _.shift(),
  31501. i.host = i.hostname = _.shift())
  31502. }
  31503. return i.search = e.search,
  31504. i.query = e.query,
  31505. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31506. i.href = i.format(),
  31507. i
  31508. }
  31509. if (!I.length)
  31510. return i.pathname = null,
  31511. i.search ? i.path = "/" + i.search : i.path = null,
  31512. i.href = i.format(),
  31513. i;
  31514. 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--)
  31515. T = I[M],
  31516. "." === T ? I.splice(M, 1) : ".." === T ? (I.splice(M, 1),
  31517. S++) : S && (I.splice(M, 1),
  31518. S--);
  31519. if (!y && !C)
  31520. for (; S--; S)
  31521. I.unshift("..");
  31522. !y || "" === I[0] || I[0] && "/" === I[0].charAt(0) || I.unshift(""),
  31523. x && "/" !== I.join("/").substr(-1) && I.push("");
  31524. var R = "" === I[0] || I[0] && "/" === I[0].charAt(0);
  31525. if (w) {
  31526. i.hostname = i.host = R ? "" : I.length ? I.shift() : "";
  31527. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  31528. _ && (i.auth = _.shift(),
  31529. i.host = i.hostname = _.shift())
  31530. }
  31531. return y = y || i.host && I.length,
  31532. y && !R && I.unshift(""),
  31533. I.length ? i.pathname = I.join("/") : (i.pathname = null,
  31534. i.path = null),
  31535. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31536. i.auth = e.auth || i.auth,
  31537. i.slashes = i.slashes || e.slashes,
  31538. i.href = i.format(),
  31539. i
  31540. }
  31541. ,
  31542. n.prototype.parseHost = function() {
  31543. var e = this.host
  31544. , t = u.exec(e);
  31545. t && (t = t[0],
  31546. ":" !== t && (this.port = t.substr(1)),
  31547. e = e.substr(0, e.length - t.length)),
  31548. e && (this.hostname = e)
  31549. }
  31550. }
  31551. , {
  31552. "./util": 209,
  31553. punycode: 204,
  31554. querystring: 207
  31555. }],
  31556. 209: [function(e, t, i) {
  31557. "use strict";
  31558. t.exports = {
  31559. isString: function(e) {
  31560. return "string" == typeof e
  31561. },
  31562. isObject: function(e) {
  31563. return "object" == typeof e && null !== e
  31564. },
  31565. isNull: function(e) {
  31566. return null === e
  31567. },
  31568. isNullOrUndefined: function(e) {
  31569. return null == e
  31570. }
  31571. }
  31572. }
  31573. , {}],
  31574. 210: [function(e, t, i) {
  31575. "use strict";
  31576. function n(e) {
  31577. return l + e
  31578. }
  31579. function r(e) {
  31580. return e.substring(l.length)
  31581. }
  31582. function o(e, t) {
  31583. for (var i in t)
  31584. Object.defineProperty(e, i, {
  31585. value: t[i],
  31586. configurable: !0,
  31587. writable: !0
  31588. })
  31589. }
  31590. function a(e) {
  31591. if ("string" != typeof e)
  31592. throw new TypeError("key must be a string.")
  31593. }
  31594. var s = Object.prototype.hasOwnProperty
  31595. , l = "~";
  31596. t.exports = function(e) {
  31597. var t = Object.create(null)
  31598. , i = 0
  31599. , l = {};
  31600. return o(l, {
  31601. get: function(e, i) {
  31602. a(e);
  31603. var r = n(e);
  31604. return r in t ? t[r] : i
  31605. },
  31606. set: function(e, r) {
  31607. a(e);
  31608. var o = n(e);
  31609. return o in t || ++i,
  31610. t[o] = r
  31611. },
  31612. has: function(e) {
  31613. return a(e),
  31614. n(e)in t
  31615. },
  31616. delete: function(e) {
  31617. a(e);
  31618. var r = n(e);
  31619. return r in t && (--i,
  31620. delete t[r],
  31621. !0)
  31622. },
  31623. clear: function() {
  31624. t = Object.create(null),
  31625. i = 0
  31626. },
  31627. forEach: function(e, i) {
  31628. if ("function" != typeof e)
  31629. throw new TypeError("`callback` must be a function");
  31630. for (var n in t)
  31631. if (s.call(t, n)) {
  31632. var o = r(n)
  31633. , a = t[n];
  31634. e.call(i, a, o, l)
  31635. }
  31636. }
  31637. }),
  31638. Object.defineProperty(l, "size", {
  31639. get: function() {
  31640. return i
  31641. },
  31642. configurable: !0
  31643. }),
  31644. "object" == typeof e && null !== e && Object.keys(e).forEach(function(t) {
  31645. l.set(t, e[t])
  31646. }),
  31647. l
  31648. }
  31649. }
  31650. , {}],
  31651. 211: [function(e, t, i) {
  31652. t.exports = e("./lib/heap")
  31653. }
  31654. , {
  31655. "./lib/heap": 212
  31656. }],
  31657. 212: [function(e, t, i) {
  31658. (function() {
  31659. var e, n, r, o, a, s, l, c, h, u, d, p, f, g, m;
  31660. r = Math.floor,
  31661. u = Math.min,
  31662. n = function(e, t) {
  31663. return e < t ? -1 : e > t ? 1 : 0
  31664. }
  31665. ,
  31666. h = function(e, t, i, o, a) {
  31667. var s;
  31668. if (null == i && (i = 0),
  31669. null == a && (a = n),
  31670. i < 0)
  31671. throw new Error("lo must be non-negative");
  31672. for (null == o && (o = e.length); i < o; )
  31673. s = r((i + o) / 2),
  31674. a(t, e[s]) < 0 ? o = s : i = s + 1;
  31675. return [].splice.apply(e, [i, i - i].concat(t)),
  31676. t
  31677. }
  31678. ,
  31679. s = function(e, t, i) {
  31680. return null == i && (i = n),
  31681. e.push(t),
  31682. g(e, 0, e.length - 1, i)
  31683. }
  31684. ,
  31685. a = function(e, t) {
  31686. var i, r;
  31687. return null == t && (t = n),
  31688. i = e.pop(),
  31689. e.length ? (r = e[0],
  31690. e[0] = i,
  31691. m(e, 0, t)) : r = i,
  31692. r
  31693. }
  31694. ,
  31695. c = function(e, t, i) {
  31696. var r;
  31697. return null == i && (i = n),
  31698. r = e[0],
  31699. e[0] = t,
  31700. m(e, 0, i),
  31701. r
  31702. }
  31703. ,
  31704. l = function(e, t, i) {
  31705. var r;
  31706. return null == i && (i = n),
  31707. e.length && i(e[0], t) < 0 && (r = [e[0], t],
  31708. t = r[0],
  31709. e[0] = r[1],
  31710. m(e, 0, i)),
  31711. t
  31712. }
  31713. ,
  31714. o = function(e, t) {
  31715. var i, o, a, s, l, c;
  31716. for (null == t && (t = n),
  31717. s = function() {
  31718. c = [];
  31719. for (var t = 0, i = r(e.length / 2); 0 <= i ? t < i : t > i; 0 <= i ? t++ : t--)
  31720. c.push(t);
  31721. return c
  31722. }
  31723. .apply(this).reverse(),
  31724. l = [],
  31725. o = 0,
  31726. a = s.length; o < a; o++)
  31727. i = s[o],
  31728. l.push(m(e, i, t));
  31729. return l
  31730. }
  31731. ,
  31732. f = function(e, t, i) {
  31733. var r;
  31734. if (null == i && (i = n),
  31735. r = e.indexOf(t),
  31736. r !== -1)
  31737. return g(e, 0, r, i),
  31738. m(e, r, i)
  31739. }
  31740. ,
  31741. d = function(e, t, i) {
  31742. var r, a, s, c, h;
  31743. if (null == i && (i = n),
  31744. a = e.slice(0, t),
  31745. !a.length)
  31746. return a;
  31747. for (o(a, i),
  31748. h = e.slice(t),
  31749. s = 0,
  31750. c = h.length; s < c; s++)
  31751. r = h[s],
  31752. l(a, r, i);
  31753. return a.sort(i).reverse()
  31754. }
  31755. ,
  31756. p = function(e, t, i) {
  31757. var r, s, l, c, d, p, f, g, m, v;
  31758. if (null == i && (i = n),
  31759. 10 * t <= e.length) {
  31760. if (c = e.slice(0, t).sort(i),
  31761. !c.length)
  31762. return c;
  31763. for (l = c[c.length - 1],
  31764. g = e.slice(t),
  31765. d = 0,
  31766. f = g.length; d < f; d++)
  31767. r = g[d],
  31768. i(r, l) < 0 && (h(c, r, 0, null, i),
  31769. c.pop(),
  31770. l = c[c.length - 1]);
  31771. return c
  31772. }
  31773. for (o(e, i),
  31774. v = [],
  31775. s = p = 0,
  31776. m = u(t, e.length); 0 <= m ? p < m : p > m; s = 0 <= m ? ++p : --p)
  31777. v.push(a(e, i));
  31778. return v
  31779. }
  31780. ,
  31781. g = function(e, t, i, r) {
  31782. var o, a, s;
  31783. for (null == r && (r = n),
  31784. o = e[i]; i > t && (s = i - 1 >> 1,
  31785. a = e[s],
  31786. r(o, a) < 0); )
  31787. e[i] = a,
  31788. i = s;
  31789. return e[i] = o
  31790. }
  31791. ,
  31792. m = function(e, t, i) {
  31793. var r, o, a, s, l;
  31794. for (null == i && (i = n),
  31795. o = e.length,
  31796. l = t,
  31797. a = e[t],
  31798. r = 2 * t + 1; r < o; )
  31799. s = r + 1,
  31800. s < o && !(i(e[r], e[s]) < 0) && (r = s),
  31801. e[t] = e[r],
  31802. t = r,
  31803. r = 2 * t + 1;
  31804. return e[t] = a,
  31805. g(e, l, t, i)
  31806. }
  31807. ,
  31808. e = function() {
  31809. function e(e) {
  31810. this.cmp = null != e ? e : n,
  31811. this.nodes = []
  31812. }
  31813. return e.push = s,
  31814. e.pop = a,
  31815. e.replace = c,
  31816. e.pushpop = l,
  31817. e.heapify = o,
  31818. e.updateItem = f,
  31819. e.nlargest = d,
  31820. e.nsmallest = p,
  31821. e.prototype.push = function(e) {
  31822. return s(this.nodes, e, this.cmp)
  31823. }
  31824. ,
  31825. e.prototype.pop = function() {
  31826. return a(this.nodes, this.cmp)
  31827. }
  31828. ,
  31829. e.prototype.peek = function() {
  31830. return this.nodes[0]
  31831. }
  31832. ,
  31833. e.prototype.contains = function(e) {
  31834. return this.nodes.indexOf(e) !== -1
  31835. }
  31836. ,
  31837. e.prototype.replace = function(e) {
  31838. return c(this.nodes, e, this.cmp)
  31839. }
  31840. ,
  31841. e.prototype.pushpop = function(e) {
  31842. return l(this.nodes, e, this.cmp)
  31843. }
  31844. ,
  31845. e.prototype.heapify = function() {
  31846. return o(this.nodes, this.cmp)
  31847. }
  31848. ,
  31849. e.prototype.updateItem = function(e) {
  31850. return f(this.nodes, e, this.cmp)
  31851. }
  31852. ,
  31853. e.prototype.clear = function() {
  31854. return this.nodes = []
  31855. }
  31856. ,
  31857. e.prototype.empty = function() {
  31858. return 0 === this.nodes.length
  31859. }
  31860. ,
  31861. e.prototype.size = function() {
  31862. return this.nodes.length
  31863. }
  31864. ,
  31865. e.prototype.clone = function() {
  31866. var t;
  31867. return t = new e,
  31868. t.nodes = this.nodes.slice(0),
  31869. t
  31870. }
  31871. ,
  31872. e.prototype.toArray = function() {
  31873. return this.nodes.slice(0)
  31874. }
  31875. ,
  31876. e.prototype.insert = e.prototype.push,
  31877. e.prototype.top = e.prototype.peek,
  31878. e.prototype.front = e.prototype.peek,
  31879. e.prototype.has = e.prototype.contains,
  31880. e.prototype.copy = e.prototype.clone,
  31881. e
  31882. }(),
  31883. function(e, n) {
  31884. return "function" == typeof define && define.amd ? define([], n) : "object" == typeof i ? t.exports = n() : e.Heap = n()
  31885. }(this, function() {
  31886. return e
  31887. })
  31888. }
  31889. ).call(this)
  31890. }
  31891. , {}],
  31892. 213: [function(e, t, i) {
  31893. !function(e) {
  31894. function i() {}
  31895. function n(e, t) {
  31896. return function() {
  31897. e.apply(t, arguments)
  31898. }
  31899. }
  31900. function r(e) {
  31901. if ("object" != typeof this)
  31902. throw new TypeError("Promises must be constructed via new");
  31903. if ("function" != typeof e)
  31904. throw new TypeError("not a function");
  31905. this._state = 0,
  31906. this._handled = !1,
  31907. this._value = void 0,
  31908. this._deferreds = [],
  31909. h(e, this)
  31910. }
  31911. function o(e, t) {
  31912. for (; 3 === e._state; )
  31913. e = e._value;
  31914. return 0 === e._state ? void e._deferreds.push(t) : (e._handled = !0,
  31915. void r._immediateFn(function() {
  31916. var i = 1 === e._state ? t.onFulfilled : t.onRejected;
  31917. if (null === i)
  31918. return void (1 === e._state ? a : s)(t.promise, e._value);
  31919. var n;
  31920. try {
  31921. n = i(e._value)
  31922. } catch (e) {
  31923. return void s(t.promise, e)
  31924. }
  31925. a(t.promise, n)
  31926. }))
  31927. }
  31928. function a(e, t) {
  31929. try {
  31930. if (t === e)
  31931. throw new TypeError("A promise cannot be resolved with itself.");
  31932. if (t && ("object" == typeof t || "function" == typeof t)) {
  31933. var i = t.then;
  31934. if (t instanceof r)
  31935. return e._state = 3,
  31936. e._value = t,
  31937. void l(e);
  31938. if ("function" == typeof i)
  31939. return void h(n(i, t), e)
  31940. }
  31941. e._state = 1,
  31942. e._value = t,
  31943. l(e)
  31944. } catch (t) {
  31945. s(e, t)
  31946. }
  31947. }
  31948. function s(e, t) {
  31949. e._state = 2,
  31950. e._value = t,
  31951. l(e)
  31952. }
  31953. function l(e) {
  31954. 2 === e._state && 0 === e._deferreds.length && r._immediateFn(function() {
  31955. e._handled || r._unhandledRejectionFn(e._value)
  31956. });
  31957. for (var t = 0, i = e._deferreds.length; t < i; t++)
  31958. o(e, e._deferreds[t]);
  31959. e._deferreds = null
  31960. }
  31961. function c(e, t, i) {
  31962. this.onFulfilled = "function" == typeof e ? e : null,
  31963. this.onRejected = "function" == typeof t ? t : null,
  31964. this.promise = i
  31965. }
  31966. function h(e, t) {
  31967. var i = !1;
  31968. try {
  31969. e(function(e) {
  31970. i || (i = !0,
  31971. a(t, e))
  31972. }, function(e) {
  31973. i || (i = !0,
  31974. s(t, e))
  31975. })
  31976. } catch (e) {
  31977. if (i)
  31978. return;
  31979. i = !0,
  31980. s(t, e)
  31981. }
  31982. }
  31983. var u = setTimeout;
  31984. r.prototype.catch = function(e) {
  31985. return this.then(null, e)
  31986. }
  31987. ,
  31988. r.prototype.then = function(e, t) {
  31989. var n = new this.constructor(i);
  31990. return o(this, new c(e,t,n)),
  31991. n
  31992. }
  31993. ,
  31994. r.all = function(e) {
  31995. var t = Array.prototype.slice.call(e);
  31996. return new r(function(e, i) {
  31997. function n(o, a) {
  31998. try {
  31999. if (a && ("object" == typeof a || "function" == typeof a)) {
  32000. var s = a.then;
  32001. if ("function" == typeof s)
  32002. return void s.call(a, function(e) {
  32003. n(o, e)
  32004. }, i)
  32005. }
  32006. t[o] = a,
  32007. 0 === --r && e(t)
  32008. } catch (e) {
  32009. i(e)
  32010. }
  32011. }
  32012. if (0 === t.length)
  32013. return e([]);
  32014. for (var r = t.length, o = 0; o < t.length; o++)
  32015. n(o, t[o])
  32016. }
  32017. )
  32018. }
  32019. ,
  32020. r.resolve = function(e) {
  32021. return e && "object" == typeof e && e.constructor === r ? e : new r(function(t) {
  32022. t(e)
  32023. }
  32024. )
  32025. }
  32026. ,
  32027. r.reject = function(e) {
  32028. return new r(function(t, i) {
  32029. i(e)
  32030. }
  32031. )
  32032. }
  32033. ,
  32034. r.race = function(e) {
  32035. return new r(function(t, i) {
  32036. for (var n = 0, r = e.length; n < r; n++)
  32037. e[n].then(t, i)
  32038. }
  32039. )
  32040. }
  32041. ,
  32042. r._immediateFn = "function" == typeof setImmediate && function(e) {
  32043. setImmediate(e)
  32044. }
  32045. || function(e) {
  32046. u(e, 0)
  32047. }
  32048. ,
  32049. r._unhandledRejectionFn = function(e) {
  32050. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  32051. }
  32052. ,
  32053. r._setImmediateFn = function(e) {
  32054. r._immediateFn = e
  32055. }
  32056. ,
  32057. r._setUnhandledRejectionFn = function(e) {
  32058. r._unhandledRejectionFn = e
  32059. }
  32060. ,
  32061. "undefined" != typeof t && t.exports ? t.exports = r : e.Promise || (e.Promise = r)
  32062. }(this)
  32063. }
  32064. , {}],
  32065. 214: [function(e, t, i) {
  32066. (function(i) {
  32067. !function(i, n) {
  32068. "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)
  32069. }(this, function(t, n) {
  32070. "use strict";
  32071. var r = {};
  32072. return r.ByteBuffer = t,
  32073. r.Long = t.Long || null,
  32074. r.VERSION = "5.0.1",
  32075. r.WIRE_TYPES = {},
  32076. r.WIRE_TYPES.VARINT = 0,
  32077. r.WIRE_TYPES.BITS64 = 1,
  32078. r.WIRE_TYPES.LDELIM = 2,
  32079. r.WIRE_TYPES.STARTGROUP = 3,
  32080. r.WIRE_TYPES.ENDGROUP = 4,
  32081. r.WIRE_TYPES.BITS32 = 5,
  32082. r.PACKABLE_WIRE_TYPES = [r.WIRE_TYPES.VARINT, r.WIRE_TYPES.BITS64, r.WIRE_TYPES.BITS32],
  32083. r.TYPES = {
  32084. int32: {
  32085. name: "int32",
  32086. wireType: r.WIRE_TYPES.VARINT,
  32087. defaultValue: 0
  32088. },
  32089. uint32: {
  32090. name: "uint32",
  32091. wireType: r.WIRE_TYPES.VARINT,
  32092. defaultValue: 0
  32093. },
  32094. sint32: {
  32095. name: "sint32",
  32096. wireType: r.WIRE_TYPES.VARINT,
  32097. defaultValue: 0
  32098. },
  32099. int64: {
  32100. name: "int64",
  32101. wireType: r.WIRE_TYPES.VARINT,
  32102. defaultValue: r.Long ? r.Long.ZERO : void 0
  32103. },
  32104. uint64: {
  32105. name: "uint64",
  32106. wireType: r.WIRE_TYPES.VARINT,
  32107. defaultValue: r.Long ? r.Long.UZERO : void 0
  32108. },
  32109. sint64: {
  32110. name: "sint64",
  32111. wireType: r.WIRE_TYPES.VARINT,
  32112. defaultValue: r.Long ? r.Long.ZERO : void 0
  32113. },
  32114. bool: {
  32115. name: "bool",
  32116. wireType: r.WIRE_TYPES.VARINT,
  32117. defaultValue: !1
  32118. },
  32119. double: {
  32120. name: "double",
  32121. wireType: r.WIRE_TYPES.BITS64,
  32122. defaultValue: 0
  32123. },
  32124. string: {
  32125. name: "string",
  32126. wireType: r.WIRE_TYPES.LDELIM,
  32127. defaultValue: ""
  32128. },
  32129. bytes: {
  32130. name: "bytes",
  32131. wireType: r.WIRE_TYPES.LDELIM,
  32132. defaultValue: null
  32133. },
  32134. fixed32: {
  32135. name: "fixed32",
  32136. wireType: r.WIRE_TYPES.BITS32,
  32137. defaultValue: 0
  32138. },
  32139. sfixed32: {
  32140. name: "sfixed32",
  32141. wireType: r.WIRE_TYPES.BITS32,
  32142. defaultValue: 0
  32143. },
  32144. fixed64: {
  32145. name: "fixed64",
  32146. wireType: r.WIRE_TYPES.BITS64,
  32147. defaultValue: r.Long ? r.Long.UZERO : void 0
  32148. },
  32149. sfixed64: {
  32150. name: "sfixed64",
  32151. wireType: r.WIRE_TYPES.BITS64,
  32152. defaultValue: r.Long ? r.Long.ZERO : void 0
  32153. },
  32154. float: {
  32155. name: "float",
  32156. wireType: r.WIRE_TYPES.BITS32,
  32157. defaultValue: 0
  32158. },
  32159. enum: {
  32160. name: "enum",
  32161. wireType: r.WIRE_TYPES.VARINT,
  32162. defaultValue: 0
  32163. },
  32164. message: {
  32165. name: "message",
  32166. wireType: r.WIRE_TYPES.LDELIM,
  32167. defaultValue: null
  32168. },
  32169. group: {
  32170. name: "group",
  32171. wireType: r.WIRE_TYPES.STARTGROUP,
  32172. defaultValue: null
  32173. }
  32174. },
  32175. 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],
  32176. r.ID_MIN = 1,
  32177. r.ID_MAX = 536870911,
  32178. r.convertFieldsToCamelCase = !1,
  32179. r.populateAccessors = !0,
  32180. r.populateDefaults = !0,
  32181. r.Util = function() {
  32182. var t = {};
  32183. return t.IS_NODE = !("object" != typeof i || i + "" != "[object process]" || i.browser),
  32184. t.XHR = function() {
  32185. for (var e = [function() {
  32186. return new XMLHttpRequest
  32187. }
  32188. , function() {
  32189. return new ActiveXObject("Msxml2.XMLHTTP")
  32190. }
  32191. , function() {
  32192. return new ActiveXObject("Msxml3.XMLHTTP")
  32193. }
  32194. , function() {
  32195. return new ActiveXObject("Microsoft.XMLHTTP")
  32196. }
  32197. ], t = null, i = 0; i < e.length; i++) {
  32198. try {
  32199. t = e[i]()
  32200. } catch (e) {
  32201. continue
  32202. }
  32203. break
  32204. }
  32205. if (!t)
  32206. throw Error("XMLHttpRequest is not supported");
  32207. return t
  32208. }
  32209. ,
  32210. t.fetch = function(i, n) {
  32211. if (n && "function" != typeof n && (n = null),
  32212. t.IS_NODE) {
  32213. var r = e("fs");
  32214. if (n)
  32215. r.readFile(i, function(e, t) {
  32216. n(e ? null : "" + t)
  32217. });
  32218. else
  32219. try {
  32220. return r.readFileSync(i)
  32221. } catch (e) {
  32222. return null
  32223. }
  32224. } else {
  32225. var o = t.XHR();
  32226. if (o.open("GET", i, !!n),
  32227. o.setRequestHeader("Accept", "text/plain"),
  32228. "function" == typeof o.overrideMimeType && o.overrideMimeType("text/plain"),
  32229. !n)
  32230. return o.send(null),
  32231. 200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null;
  32232. if (o.onreadystatechange = function() {
  32233. 4 == o.readyState && n(200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null)
  32234. }
  32235. ,
  32236. 4 == o.readyState)
  32237. return;
  32238. o.send(null)
  32239. }
  32240. }
  32241. ,
  32242. t.toCamelCase = function(e) {
  32243. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  32244. return t.toUpperCase()
  32245. })
  32246. }
  32247. ,
  32248. t
  32249. }(),
  32250. r.Lang = {
  32251. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  32252. RULE: /^(?:required|optional|repeated|map)$/,
  32253. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  32254. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  32255. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  32256. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  32257. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  32258. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  32259. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  32260. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  32261. NUMBER_OCT: /^0[0-7]+$/,
  32262. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  32263. BOOL: /^(?:true|false)$/i,
  32264. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32265. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32266. WHITESPACE: /\s/,
  32267. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  32268. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  32269. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  32270. },
  32271. r.DotProto = function(e, t) {
  32272. function i(e, i) {
  32273. var n = -1
  32274. , r = 1;
  32275. if ("-" == e.charAt(0) && (r = -1,
  32276. e = e.substring(1)),
  32277. t.NUMBER_DEC.test(e))
  32278. n = parseInt(e);
  32279. else if (t.NUMBER_HEX.test(e))
  32280. n = parseInt(e.substring(2), 16);
  32281. else {
  32282. if (!t.NUMBER_OCT.test(e))
  32283. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  32284. n = parseInt(e.substring(1), 8)
  32285. }
  32286. if (n = r * n | 0,
  32287. !i && n < 0)
  32288. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  32289. return n
  32290. }
  32291. function n(e) {
  32292. var i = 1;
  32293. if ("-" == e.charAt(0) && (i = -1,
  32294. e = e.substring(1)),
  32295. t.NUMBER_DEC.test(e))
  32296. return i * parseInt(e, 10);
  32297. if (t.NUMBER_HEX.test(e))
  32298. return i * parseInt(e.substring(2), 16);
  32299. if (t.NUMBER_OCT.test(e))
  32300. return i * parseInt(e.substring(1), 8);
  32301. if ("inf" === e)
  32302. return i * (1 / 0);
  32303. if ("nan" === e)
  32304. return NaN;
  32305. if (t.NUMBER_FLT.test(e))
  32306. return i * parseFloat(e);
  32307. throw Error("illegal number value: " + (i < 0 ? "-" : "") + e)
  32308. }
  32309. function r(e, t, i) {
  32310. "undefined" == typeof e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  32311. e[t].push(i))
  32312. }
  32313. var o = {}
  32314. , a = function(e) {
  32315. this.source = e + "",
  32316. this.index = 0,
  32317. this.line = 1,
  32318. this.stack = [],
  32319. this._stringOpen = null
  32320. }
  32321. , s = a.prototype;
  32322. s._readString = function() {
  32323. var e = '"' === this._stringOpen ? t.STRING_DQ : t.STRING_SQ;
  32324. e.lastIndex = this.index - 1;
  32325. var i = e.exec(this.source);
  32326. if (!i)
  32327. throw Error("unterminated string");
  32328. return this.index = e.lastIndex,
  32329. this.stack.push(this._stringOpen),
  32330. this._stringOpen = null,
  32331. i[1]
  32332. }
  32333. ,
  32334. s.next = function() {
  32335. if (this.stack.length > 0)
  32336. return this.stack.shift();
  32337. if (this.index >= this.source.length)
  32338. return null;
  32339. if (null !== this._stringOpen)
  32340. return this._readString();
  32341. var e, i, n;
  32342. do {
  32343. for (e = !1; t.WHITESPACE.test(n = this.source.charAt(this.index)); )
  32344. if ("\n" === n && ++this.line,
  32345. ++this.index === this.source.length)
  32346. return null;
  32347. if ("/" === this.source.charAt(this.index))
  32348. if (++this.index,
  32349. "/" === this.source.charAt(this.index)) {
  32350. for (; "\n" !== this.source.charAt(++this.index); )
  32351. if (this.index == this.source.length)
  32352. return null;
  32353. ++this.index,
  32354. ++this.line,
  32355. e = !0
  32356. } else {
  32357. if ("*" !== (n = this.source.charAt(this.index)))
  32358. return "/";
  32359. do {
  32360. if ("\n" === n && ++this.line,
  32361. ++this.index === this.source.length)
  32362. return null;
  32363. i = n,
  32364. n = this.source.charAt(this.index)
  32365. } while ("*" !== i || "/" !== n);++this.index,
  32366. e = !0
  32367. }
  32368. } while (e);if (this.index === this.source.length)
  32369. return null;
  32370. var r = this.index;
  32371. t.DELIM.lastIndex = 0;
  32372. var o = t.DELIM.test(this.source.charAt(r++));
  32373. if (!o)
  32374. for (; r < this.source.length && !t.DELIM.test(this.source.charAt(r)); )
  32375. ++r;
  32376. var a = this.source.substring(this.index, this.index = r);
  32377. return '"' !== a && "'" !== a || (this._stringOpen = a),
  32378. a
  32379. }
  32380. ,
  32381. s.peek = function() {
  32382. if (0 === this.stack.length) {
  32383. var e = this.next();
  32384. if (null === e)
  32385. return null;
  32386. this.stack.push(e)
  32387. }
  32388. return this.stack[0]
  32389. }
  32390. ,
  32391. s.skip = function(e) {
  32392. var t = this.next();
  32393. if (t !== e)
  32394. throw Error("illegal '" + t + "', '" + e + "' expected")
  32395. }
  32396. ,
  32397. s.omit = function(e) {
  32398. return this.peek() === e && (this.next(),
  32399. !0)
  32400. }
  32401. ,
  32402. s.toString = function() {
  32403. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  32404. }
  32405. ,
  32406. o.Tokenizer = a;
  32407. var l = function(e) {
  32408. this.tn = new a(e),
  32409. this.proto3 = !1
  32410. }
  32411. , c = l.prototype;
  32412. return c.parse = function() {
  32413. var e, i, n = {
  32414. name: "[ROOT]",
  32415. package: null,
  32416. messages: [],
  32417. enums: [],
  32418. imports: [],
  32419. options: {},
  32420. services: []
  32421. }, r = !0;
  32422. try {
  32423. for (; e = this.tn.next(); )
  32424. switch (e) {
  32425. case "package":
  32426. if (!r || null !== n.package)
  32427. throw Error("unexpected 'package'");
  32428. if (e = this.tn.next(),
  32429. !t.TYPEREF.test(e))
  32430. throw Error("illegal package name: " + e);
  32431. this.tn.skip(";"),
  32432. n.package = e;
  32433. break;
  32434. case "import":
  32435. if (!r)
  32436. throw Error("unexpected 'import'");
  32437. e = this.tn.peek(),
  32438. ("public" === e || (i = "weak" === e)) && this.tn.next(),
  32439. e = this._readString(),
  32440. this.tn.skip(";"),
  32441. i || n.imports.push(e);
  32442. break;
  32443. case "syntax":
  32444. if (!r)
  32445. throw Error("unexpected 'syntax'");
  32446. this.tn.skip("="),
  32447. "proto3" === (n.syntax = this._readString()) && (this.proto3 = !0),
  32448. this.tn.skip(";");
  32449. break;
  32450. case "message":
  32451. this._parseMessage(n, null),
  32452. r = !1;
  32453. break;
  32454. case "enum":
  32455. this._parseEnum(n),
  32456. r = !1;
  32457. break;
  32458. case "option":
  32459. this._parseOption(n);
  32460. break;
  32461. case "service":
  32462. this._parseService(n);
  32463. break;
  32464. case "extend":
  32465. this._parseExtend(n);
  32466. break;
  32467. default:
  32468. throw Error("unexpected '" + e + "'")
  32469. }
  32470. } catch (e) {
  32471. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  32472. e
  32473. }
  32474. return delete n.name,
  32475. n
  32476. }
  32477. ,
  32478. l.parse = function(e) {
  32479. return new l(e).parse()
  32480. }
  32481. ,
  32482. c._readString = function() {
  32483. var e, t, i = "";
  32484. do {
  32485. if (t = this.tn.next(),
  32486. "'" !== t && '"' !== t)
  32487. throw Error("illegal string delimiter: " + t);
  32488. i += this.tn.next(),
  32489. this.tn.skip(t),
  32490. e = this.tn.peek()
  32491. } while ('"' === e || '"' === e);return i
  32492. }
  32493. ,
  32494. c._readValue = function(e) {
  32495. var i = this.tn.peek();
  32496. if ('"' === i || "'" === i)
  32497. return this._readString();
  32498. if (this.tn.next(),
  32499. t.NUMBER.test(i))
  32500. return n(i);
  32501. if (t.BOOL.test(i))
  32502. return "true" === i.toLowerCase();
  32503. if (e && t.TYPEREF.test(i))
  32504. return i;
  32505. throw Error("illegal value: " + i)
  32506. }
  32507. ,
  32508. c._parseOption = function(e, i) {
  32509. var n = this.tn.next()
  32510. , r = !1;
  32511. if ("(" === n && (r = !0,
  32512. n = this.tn.next()),
  32513. !t.TYPEREF.test(n))
  32514. throw Error("illegal option name: " + n);
  32515. var o = n;
  32516. r && (this.tn.skip(")"),
  32517. o = "(" + o + ")",
  32518. n = this.tn.peek(),
  32519. t.FQTYPEREF.test(n) && (o += n,
  32520. this.tn.next())),
  32521. this.tn.skip("="),
  32522. this._parseOptionValue(e, o),
  32523. i || this.tn.skip(";")
  32524. }
  32525. ,
  32526. c._parseOptionValue = function(e, i) {
  32527. var n = this.tn.peek();
  32528. if ("{" !== n)
  32529. r(e.options, i, this._readValue(!0));
  32530. else
  32531. for (this.tn.skip("{"); "}" !== (n = this.tn.next()); ) {
  32532. if (!t.NAME.test(n))
  32533. throw Error("illegal option name: " + i + "." + n);
  32534. this.tn.omit(":") ? r(e.options, i + "." + n, this._readValue(!0)) : this._parseOptionValue(e, i + "." + n)
  32535. }
  32536. }
  32537. ,
  32538. c._parseService = function(e) {
  32539. var i = this.tn.next();
  32540. if (!t.NAME.test(i))
  32541. throw Error("illegal service name at line " + this.tn.line + ": " + i);
  32542. var n = i
  32543. , r = {
  32544. name: n,
  32545. rpc: {},
  32546. options: {}
  32547. };
  32548. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32549. if ("option" === i)
  32550. this._parseOption(r);
  32551. else {
  32552. if ("rpc" !== i)
  32553. throw Error("illegal service token: " + i);
  32554. this._parseServiceRPC(r)
  32555. }
  32556. this.tn.omit(";"),
  32557. e.services.push(r)
  32558. }
  32559. ,
  32560. c._parseServiceRPC = function(e) {
  32561. var i = "rpc"
  32562. , n = this.tn.next();
  32563. if (!t.NAME.test(n))
  32564. throw Error("illegal rpc service method name: " + n);
  32565. var r = n
  32566. , o = {
  32567. request: null,
  32568. response: null,
  32569. request_stream: !1,
  32570. response_stream: !1,
  32571. options: {}
  32572. };
  32573. if (this.tn.skip("("),
  32574. n = this.tn.next(),
  32575. "stream" === n.toLowerCase() && (o.request_stream = !0,
  32576. n = this.tn.next()),
  32577. !t.TYPEREF.test(n))
  32578. throw Error("illegal rpc service request type: " + n);
  32579. if (o.request = n,
  32580. this.tn.skip(")"),
  32581. n = this.tn.next(),
  32582. "returns" !== n.toLowerCase())
  32583. throw Error("illegal rpc service request type delimiter: " + n);
  32584. if (this.tn.skip("("),
  32585. n = this.tn.next(),
  32586. "stream" === n.toLowerCase() && (o.response_stream = !0,
  32587. n = this.tn.next()),
  32588. o.response = n,
  32589. this.tn.skip(")"),
  32590. n = this.tn.peek(),
  32591. "{" === n) {
  32592. for (this.tn.next(); "}" !== (n = this.tn.next()); ) {
  32593. if ("option" !== n)
  32594. throw Error("illegal rpc service token: " + n);
  32595. this._parseOption(o)
  32596. }
  32597. this.tn.omit(";")
  32598. } else
  32599. this.tn.skip(";");
  32600. "undefined" == typeof e[i] && (e[i] = {}),
  32601. e[i][r] = o
  32602. }
  32603. ,
  32604. c._parseMessage = function(e, n) {
  32605. var r = !!n
  32606. , o = this.tn.next()
  32607. , a = {
  32608. name: "",
  32609. fields: [],
  32610. enums: [],
  32611. messages: [],
  32612. options: {},
  32613. services: [],
  32614. oneofs: {}
  32615. };
  32616. if (!t.NAME.test(o))
  32617. throw Error("illegal " + (r ? "group" : "message") + " name: " + o);
  32618. for (a.name = o,
  32619. r && (this.tn.skip("="),
  32620. n.id = i(this.tn.next()),
  32621. a.isGroup = !0),
  32622. o = this.tn.peek(),
  32623. "[" === o && n && this._parseFieldOptions(n),
  32624. this.tn.skip("{"); "}" !== (o = this.tn.next()); )
  32625. if (t.RULE.test(o))
  32626. this._parseMessageField(a, o);
  32627. else if ("oneof" === o)
  32628. this._parseMessageOneOf(a);
  32629. else if ("enum" === o)
  32630. this._parseEnum(a);
  32631. else if ("message" === o)
  32632. this._parseMessage(a);
  32633. else if ("option" === o)
  32634. this._parseOption(a);
  32635. else if ("service" === o)
  32636. this._parseService(a);
  32637. else if ("extensions" === o)
  32638. a.extensions = this._parseExtensionRanges();
  32639. else if ("reserved" === o)
  32640. this._parseIgnored();
  32641. else if ("extend" === o)
  32642. this._parseExtend(a);
  32643. else {
  32644. if (!t.TYPEREF.test(o))
  32645. throw Error("illegal message token: " + o);
  32646. if (!this.proto3)
  32647. throw Error("illegal field rule: " + o);
  32648. this._parseMessageField(a, "optional", o)
  32649. }
  32650. return this.tn.omit(";"),
  32651. e.messages.push(a),
  32652. a
  32653. }
  32654. ,
  32655. c._parseIgnored = function() {
  32656. for (; ";" !== this.tn.peek(); )
  32657. this.tn.next();
  32658. this.tn.skip(";")
  32659. }
  32660. ,
  32661. c._parseMessageField = function(e, n, r) {
  32662. if (!t.RULE.test(n))
  32663. throw Error("illegal message field rule: " + n);
  32664. var o, a = {
  32665. rule: n,
  32666. type: "",
  32667. name: "",
  32668. options: {},
  32669. id: 0
  32670. };
  32671. if ("map" === n) {
  32672. if (r)
  32673. throw Error("illegal type: " + r);
  32674. if (this.tn.skip("<"),
  32675. o = this.tn.next(),
  32676. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  32677. throw Error("illegal message field type: " + o);
  32678. if (a.keytype = o,
  32679. this.tn.skip(","),
  32680. o = this.tn.next(),
  32681. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  32682. throw Error("illegal message field: " + o);
  32683. if (a.type = o,
  32684. this.tn.skip(">"),
  32685. o = this.tn.next(),
  32686. !t.NAME.test(o))
  32687. throw Error("illegal message field name: " + o);
  32688. a.name = o,
  32689. this.tn.skip("="),
  32690. a.id = i(this.tn.next()),
  32691. o = this.tn.peek(),
  32692. "[" === o && this._parseFieldOptions(a),
  32693. this.tn.skip(";")
  32694. } else if (r = "undefined" != typeof r ? r : this.tn.next(),
  32695. "group" === r) {
  32696. var s = this._parseMessage(e, a);
  32697. if (!/^[A-Z]/.test(s.name))
  32698. throw Error("illegal group name: " + s.name);
  32699. a.type = s.name,
  32700. a.name = s.name.toLowerCase(),
  32701. this.tn.omit(";")
  32702. } else {
  32703. if (!t.TYPE.test(r) && !t.TYPEREF.test(r))
  32704. throw Error("illegal message field type: " + r);
  32705. if (a.type = r,
  32706. o = this.tn.next(),
  32707. !t.NAME.test(o))
  32708. throw Error("illegal message field name: " + o);
  32709. a.name = o,
  32710. this.tn.skip("="),
  32711. a.id = i(this.tn.next()),
  32712. o = this.tn.peek(),
  32713. "[" === o && this._parseFieldOptions(a),
  32714. this.tn.skip(";")
  32715. }
  32716. return e.fields.push(a),
  32717. a
  32718. }
  32719. ,
  32720. c._parseMessageOneOf = function(e) {
  32721. var i = this.tn.next();
  32722. if (!t.NAME.test(i))
  32723. throw Error("illegal oneof name: " + i);
  32724. var n, r = i, o = [];
  32725. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32726. n = this._parseMessageField(e, "optional", i),
  32727. n.oneof = r,
  32728. o.push(n.id);
  32729. this.tn.omit(";"),
  32730. e.oneofs[r] = o
  32731. }
  32732. ,
  32733. c._parseFieldOptions = function(e) {
  32734. this.tn.skip("[");
  32735. for (var t, i = !0; "]" !== (t = this.tn.peek()); )
  32736. i || this.tn.skip(","),
  32737. this._parseOption(e, !0),
  32738. i = !1;
  32739. this.tn.next()
  32740. }
  32741. ,
  32742. c._parseEnum = function(e) {
  32743. var n = {
  32744. name: "",
  32745. values: [],
  32746. options: {}
  32747. }
  32748. , r = this.tn.next();
  32749. if (!t.NAME.test(r))
  32750. throw Error("illegal name: " + r);
  32751. for (n.name = r,
  32752. this.tn.skip("{"); "}" !== (r = this.tn.next()); )
  32753. if ("option" === r)
  32754. this._parseOption(n);
  32755. else {
  32756. if (!t.NAME.test(r))
  32757. throw Error("illegal name: " + r);
  32758. this.tn.skip("=");
  32759. var o = {
  32760. name: r,
  32761. id: i(this.tn.next(), !0)
  32762. };
  32763. r = this.tn.peek(),
  32764. "[" === r && this._parseFieldOptions({
  32765. options: {}
  32766. }),
  32767. this.tn.skip(";"),
  32768. n.values.push(o)
  32769. }
  32770. this.tn.omit(";"),
  32771. e.enums.push(n)
  32772. }
  32773. ,
  32774. c._parseExtensionRanges = function() {
  32775. var t, i, r, o = [];
  32776. do {
  32777. for (i = []; ; ) {
  32778. switch (t = this.tn.next()) {
  32779. case "min":
  32780. r = e.ID_MIN;
  32781. break;
  32782. case "max":
  32783. r = e.ID_MAX;
  32784. break;
  32785. default:
  32786. r = n(t)
  32787. }
  32788. if (i.push(r),
  32789. 2 === i.length)
  32790. break;
  32791. if ("to" !== this.tn.peek()) {
  32792. i.push(r);
  32793. break
  32794. }
  32795. this.tn.next()
  32796. }
  32797. o.push(i)
  32798. } while (this.tn.omit(","));return this.tn.skip(";"),
  32799. o
  32800. }
  32801. ,
  32802. c._parseExtend = function(e) {
  32803. var i = this.tn.next();
  32804. if (!t.TYPEREF.test(i))
  32805. throw Error("illegal extend reference: " + i);
  32806. var n = {
  32807. ref: i,
  32808. fields: []
  32809. };
  32810. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32811. if (t.RULE.test(i))
  32812. this._parseMessageField(n, i);
  32813. else {
  32814. if (!t.TYPEREF.test(i))
  32815. throw Error("illegal extend token: " + i);
  32816. if (!this.proto3)
  32817. throw Error("illegal field rule: " + i);
  32818. this._parseMessageField(n, "optional", i)
  32819. }
  32820. return this.tn.omit(";"),
  32821. e.messages.push(n),
  32822. n
  32823. }
  32824. ,
  32825. c.toString = function() {
  32826. return "Parser at line " + this.tn.line
  32827. }
  32828. ,
  32829. o.Parser = l,
  32830. o
  32831. }(r, r.Lang),
  32832. r.Reflect = function(e) {
  32833. function i(i) {
  32834. if ("string" == typeof i && (i = e.TYPES[i]),
  32835. "undefined" == typeof i.defaultValue)
  32836. throw Error("default value for type " + i.name + " is not supported");
  32837. return i == e.TYPES.bytes ? new t(0) : i.defaultValue
  32838. }
  32839. function n(t, i) {
  32840. if (t && "number" == typeof t.low && "number" == typeof t.high && "boolean" == typeof t.unsigned && t.low === t.low && t.high === t.high)
  32841. return new e.Long(t.low,t.high,"undefined" == typeof i ? t.unsigned : i);
  32842. if ("string" == typeof t)
  32843. return e.Long.fromString(t, i || !1, 10);
  32844. if ("number" == typeof t)
  32845. return e.Long.fromNumber(t, i || !1);
  32846. throw Error("not convertible to Long")
  32847. }
  32848. function r(t, i) {
  32849. var n = i.readVarint32()
  32850. , o = 7 & n
  32851. , a = n >>> 3;
  32852. switch (o) {
  32853. case e.WIRE_TYPES.VARINT:
  32854. do
  32855. n = i.readUint8();
  32856. while (128 === (128 & n));break;
  32857. case e.WIRE_TYPES.BITS64:
  32858. i.offset += 8;
  32859. break;
  32860. case e.WIRE_TYPES.LDELIM:
  32861. n = i.readVarint32(),
  32862. i.offset += n;
  32863. break;
  32864. case e.WIRE_TYPES.STARTGROUP:
  32865. r(a, i);
  32866. break;
  32867. case e.WIRE_TYPES.ENDGROUP:
  32868. if (a === t)
  32869. return !1;
  32870. throw Error("Illegal GROUPEND after unknown group: " + a + " (" + t + " expected)");
  32871. case e.WIRE_TYPES.BITS32:
  32872. i.offset += 4;
  32873. break;
  32874. default:
  32875. throw Error("Illegal wire type in unknown group " + t + ": " + o)
  32876. }
  32877. return !0
  32878. }
  32879. var o = {}
  32880. , a = function(e, t, i) {
  32881. this.builder = e,
  32882. this.parent = t,
  32883. this.name = i,
  32884. this.className
  32885. }
  32886. , s = a.prototype;
  32887. s.fqn = function() {
  32888. for (var e = this.name, t = this; ; ) {
  32889. if (t = t.parent,
  32890. null == t)
  32891. break;
  32892. e = t.name + "." + e
  32893. }
  32894. return e
  32895. }
  32896. ,
  32897. s.toString = function(e) {
  32898. return (e ? this.className + " " : "") + this.fqn()
  32899. }
  32900. ,
  32901. s.build = function() {
  32902. throw Error(this.toString(!0) + " cannot be built directly")
  32903. }
  32904. ,
  32905. o.T = a;
  32906. var l = function(e, t, i, n, r) {
  32907. a.call(this, e, t, i),
  32908. this.className = "Namespace",
  32909. this.children = [],
  32910. this.options = n || {},
  32911. this.syntax = r || "proto2"
  32912. }
  32913. , c = l.prototype = Object.create(a.prototype);
  32914. c.getChildren = function(e) {
  32915. if (e = e || null,
  32916. null == e)
  32917. return this.children.slice();
  32918. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  32919. this.children[i]instanceof e && t.push(this.children[i]);
  32920. return t
  32921. }
  32922. ,
  32923. c.addChild = function(e) {
  32924. var t;
  32925. if (t = this.getChild(e.name))
  32926. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  32927. t.name = t.originalName;
  32928. else {
  32929. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  32930. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  32931. e.name = e.originalName
  32932. }
  32933. this.children.push(e)
  32934. }
  32935. ,
  32936. c.getChild = function(e) {
  32937. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  32938. if (this.children[i][t] === e)
  32939. return this.children[i];
  32940. return null
  32941. }
  32942. ,
  32943. c.resolve = function(e, t) {
  32944. var i = "string" == typeof e ? e.split(".") : e
  32945. , n = this
  32946. , r = 0;
  32947. if ("" === i[r]) {
  32948. for (; null !== n.parent; )
  32949. n = n.parent;
  32950. r++
  32951. }
  32952. var a;
  32953. do {
  32954. do {
  32955. if (!(n instanceof o.Namespace)) {
  32956. n = null;
  32957. break
  32958. }
  32959. if (a = n.getChild(i[r]),
  32960. !a || !(a instanceof o.T) || t && !(a instanceof o.Namespace)) {
  32961. n = null;
  32962. break
  32963. }
  32964. n = a,
  32965. r++
  32966. } while (r < i.length);if (null != n)
  32967. break;
  32968. if (null !== this.parent)
  32969. return this.parent.resolve(e, t)
  32970. } while (null != n);return n
  32971. }
  32972. ,
  32973. c.qn = function(e) {
  32974. var t = []
  32975. , i = e;
  32976. do
  32977. t.unshift(i.name),
  32978. i = i.parent;
  32979. while (null !== i);for (var n = 1; n <= t.length; n++) {
  32980. var r = t.slice(t.length - n);
  32981. if (e === this.resolve(r, e instanceof o.Namespace))
  32982. return r.join(".")
  32983. }
  32984. return e.fqn()
  32985. }
  32986. ,
  32987. c.build = function() {
  32988. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  32989. e = i[n],
  32990. e instanceof l && (t[e.name] = e.build());
  32991. return Object.defineProperty && Object.defineProperty(t, "$options", {
  32992. value: this.buildOpt()
  32993. }),
  32994. t
  32995. }
  32996. ,
  32997. c.buildOpt = function() {
  32998. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  32999. var r = t[i]
  33000. , o = this.options[t[i]];
  33001. e[r] = o
  33002. }
  33003. return e
  33004. }
  33005. ,
  33006. c.getOption = function(e) {
  33007. return "undefined" == typeof e ? this.options : "undefined" != typeof this.options[e] ? this.options[e] : null
  33008. }
  33009. ,
  33010. o.Namespace = l;
  33011. var h = function(t, i, n, r) {
  33012. if (this.type = t,
  33013. this.resolvedType = i,
  33014. this.isMapKey = n,
  33015. this.syntax = r,
  33016. n && e.MAP_KEY_TYPES.indexOf(t) < 0)
  33017. throw Error("Invalid map key type: " + t.name)
  33018. }
  33019. , u = h.prototype;
  33020. h.defaultFieldValue = i,
  33021. u.verifyValue = function(i) {
  33022. function r(e, t) {
  33023. throw Error("Illegal value for " + o.toString(!0) + " of type " + o.type.name + ": " + e + " (" + t + ")")
  33024. }
  33025. var o = this;
  33026. switch (this.type) {
  33027. case e.TYPES.int32:
  33028. case e.TYPES.sint32:
  33029. case e.TYPES.sfixed32:
  33030. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  33031. i > 4294967295 ? 0 | i : i;
  33032. case e.TYPES.uint32:
  33033. case e.TYPES.fixed32:
  33034. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  33035. i < 0 ? i >>> 0 : i;
  33036. case e.TYPES.int64:
  33037. case e.TYPES.sint64:
  33038. case e.TYPES.sfixed64:
  33039. if (e.Long)
  33040. try {
  33041. return n(i, !1)
  33042. } catch (e) {
  33043. r(typeof i, e.message)
  33044. }
  33045. else
  33046. r(typeof i, "requires Long.js");
  33047. case e.TYPES.uint64:
  33048. case e.TYPES.fixed64:
  33049. if (e.Long)
  33050. try {
  33051. return n(i, !0)
  33052. } catch (e) {
  33053. r(typeof i, e.message)
  33054. }
  33055. else
  33056. r(typeof i, "requires Long.js");
  33057. case e.TYPES.bool:
  33058. return "boolean" != typeof i && r(typeof i, "not a boolean"),
  33059. i;
  33060. case e.TYPES.float:
  33061. case e.TYPES.double:
  33062. return "number" != typeof i && r(typeof i, "not a number"),
  33063. i;
  33064. case e.TYPES.string:
  33065. return "string" == typeof i || i && i instanceof String || r(typeof i, "not a string"),
  33066. "" + i;
  33067. case e.TYPES.bytes:
  33068. return t.isByteBuffer(i) ? i : t.wrap(i, "base64");
  33069. case e.TYPES.enum:
  33070. var a = this.resolvedType.getChildren(e.Reflect.Enum.Value);
  33071. for (l = 0; l < a.length; l++) {
  33072. if (a[l].name == i)
  33073. return a[l].id;
  33074. if (a[l].id == i)
  33075. return a[l].id
  33076. }
  33077. if ("proto3" === this.syntax)
  33078. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  33079. (i > 4294967295 || i < 0) && r(typeof i, "not in range for uint32"),
  33080. i;
  33081. r(i, "not a valid enum value");
  33082. case e.TYPES.group:
  33083. case e.TYPES.message:
  33084. if (i && "object" == typeof i || r(typeof i, "object expected"),
  33085. i instanceof this.resolvedType.clazz)
  33086. return i;
  33087. if (i instanceof e.Builder.Message) {
  33088. var s = {};
  33089. for (var l in i)
  33090. i.hasOwnProperty(l) && (s[l] = i[l]);
  33091. i = s
  33092. }
  33093. return new this.resolvedType.clazz(i)
  33094. }
  33095. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + i + " (undefined type " + this.type + ")")
  33096. }
  33097. ,
  33098. u.calculateLength = function(i, n) {
  33099. if (null === n)
  33100. return 0;
  33101. var r;
  33102. switch (this.type) {
  33103. case e.TYPES.int32:
  33104. return n < 0 ? t.calculateVarint64(n) : t.calculateVarint32(n);
  33105. case e.TYPES.uint32:
  33106. return t.calculateVarint32(n);
  33107. case e.TYPES.sint32:
  33108. return t.calculateVarint32(t.zigZagEncode32(n));
  33109. case e.TYPES.fixed32:
  33110. case e.TYPES.sfixed32:
  33111. case e.TYPES.float:
  33112. return 4;
  33113. case e.TYPES.int64:
  33114. case e.TYPES.uint64:
  33115. return t.calculateVarint64(n);
  33116. case e.TYPES.sint64:
  33117. return t.calculateVarint64(t.zigZagEncode64(n));
  33118. case e.TYPES.fixed64:
  33119. case e.TYPES.sfixed64:
  33120. return 8;
  33121. case e.TYPES.bool:
  33122. return 1;
  33123. case e.TYPES.enum:
  33124. return t.calculateVarint32(n);
  33125. case e.TYPES.double:
  33126. return 8;
  33127. case e.TYPES.string:
  33128. return r = t.calculateUTF8Bytes(n),
  33129. t.calculateVarint32(r) + r;
  33130. case e.TYPES.bytes:
  33131. if (n.remaining() < 0)
  33132. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  33133. return t.calculateVarint32(n.remaining()) + n.remaining();
  33134. case e.TYPES.message:
  33135. return r = this.resolvedType.calculate(n),
  33136. t.calculateVarint32(r) + r;
  33137. case e.TYPES.group:
  33138. return r = this.resolvedType.calculate(n),
  33139. r + t.calculateVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP)
  33140. }
  33141. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  33142. }
  33143. ,
  33144. u.encodeValue = function(i, n, r) {
  33145. if (null === n)
  33146. return r;
  33147. switch (this.type) {
  33148. case e.TYPES.int32:
  33149. n < 0 ? r.writeVarint64(n) : r.writeVarint32(n);
  33150. break;
  33151. case e.TYPES.uint32:
  33152. r.writeVarint32(n);
  33153. break;
  33154. case e.TYPES.sint32:
  33155. r.writeVarint32ZigZag(n);
  33156. break;
  33157. case e.TYPES.fixed32:
  33158. r.writeUint32(n);
  33159. break;
  33160. case e.TYPES.sfixed32:
  33161. r.writeInt32(n);
  33162. break;
  33163. case e.TYPES.int64:
  33164. case e.TYPES.uint64:
  33165. r.writeVarint64(n);
  33166. break;
  33167. case e.TYPES.sint64:
  33168. r.writeVarint64ZigZag(n);
  33169. break;
  33170. case e.TYPES.fixed64:
  33171. r.writeUint64(n);
  33172. break;
  33173. case e.TYPES.sfixed64:
  33174. r.writeInt64(n);
  33175. break;
  33176. case e.TYPES.bool:
  33177. "string" == typeof n ? r.writeVarint32("false" === n.toLowerCase() ? 0 : !!n) : r.writeVarint32(n ? 1 : 0);
  33178. break;
  33179. case e.TYPES.enum:
  33180. r.writeVarint32(n);
  33181. break;
  33182. case e.TYPES.float:
  33183. r.writeFloat32(n);
  33184. break;
  33185. case e.TYPES.double:
  33186. r.writeFloat64(n);
  33187. break;
  33188. case e.TYPES.string:
  33189. r.writeVString(n);
  33190. break;
  33191. case e.TYPES.bytes:
  33192. if (n.remaining() < 0)
  33193. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  33194. var o = n.offset;
  33195. r.writeVarint32(n.remaining()),
  33196. r.append(n),
  33197. n.offset = o;
  33198. break;
  33199. case e.TYPES.message:
  33200. var a = (new t).LE();
  33201. this.resolvedType.encode(n, a),
  33202. r.writeVarint32(a.offset),
  33203. r.append(a.flip());
  33204. break;
  33205. case e.TYPES.group:
  33206. this.resolvedType.encode(n, r),
  33207. r.writeVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP);
  33208. break;
  33209. default:
  33210. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  33211. }
  33212. return r
  33213. }
  33214. ,
  33215. u.decode = function(t, i, n) {
  33216. if (i != this.type.wireType)
  33217. throw Error("Unexpected wire type for element");
  33218. var r, o;
  33219. switch (this.type) {
  33220. case e.TYPES.int32:
  33221. return 0 | t.readVarint32();
  33222. case e.TYPES.uint32:
  33223. return t.readVarint32() >>> 0;
  33224. case e.TYPES.sint32:
  33225. return 0 | t.readVarint32ZigZag();
  33226. case e.TYPES.fixed32:
  33227. return t.readUint32() >>> 0;
  33228. case e.TYPES.sfixed32:
  33229. return 0 | t.readInt32();
  33230. case e.TYPES.int64:
  33231. return t.readVarint64();
  33232. case e.TYPES.uint64:
  33233. return t.readVarint64().toUnsigned();
  33234. case e.TYPES.sint64:
  33235. return t.readVarint64ZigZag();
  33236. case e.TYPES.fixed64:
  33237. return t.readUint64();
  33238. case e.TYPES.sfixed64:
  33239. return t.readInt64();
  33240. case e.TYPES.bool:
  33241. return !!t.readVarint32();
  33242. case e.TYPES.enum:
  33243. return t.readVarint32();
  33244. case e.TYPES.float:
  33245. return t.readFloat();
  33246. case e.TYPES.double:
  33247. return t.readDouble();
  33248. case e.TYPES.string:
  33249. return t.readVString();
  33250. case e.TYPES.bytes:
  33251. if (o = t.readVarint32(),
  33252. t.remaining() < o)
  33253. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + t.remaining());
  33254. return r = t.clone(),
  33255. r.limit = r.offset + o,
  33256. t.offset += o,
  33257. r;
  33258. case e.TYPES.message:
  33259. return o = t.readVarint32(),
  33260. this.resolvedType.decode(t, o);
  33261. case e.TYPES.group:
  33262. return this.resolvedType.decode(t, -1, n)
  33263. }
  33264. throw Error("[INTERNAL] Illegal decode type")
  33265. }
  33266. ,
  33267. u.valueFromString = function(i) {
  33268. if (!this.isMapKey)
  33269. throw Error("valueFromString() called on non-map-key element");
  33270. switch (this.type) {
  33271. case e.TYPES.int32:
  33272. case e.TYPES.sint32:
  33273. case e.TYPES.sfixed32:
  33274. case e.TYPES.uint32:
  33275. case e.TYPES.fixed32:
  33276. return this.verifyValue(parseInt(i));
  33277. case e.TYPES.int64:
  33278. case e.TYPES.sint64:
  33279. case e.TYPES.sfixed64:
  33280. case e.TYPES.uint64:
  33281. case e.TYPES.fixed64:
  33282. return this.verifyValue(i);
  33283. case e.TYPES.bool:
  33284. return "true" === i;
  33285. case e.TYPES.string:
  33286. return this.verifyValue(i);
  33287. case e.TYPES.bytes:
  33288. return t.fromBinary(i)
  33289. }
  33290. }
  33291. ,
  33292. u.valueToString = function(t) {
  33293. if (!this.isMapKey)
  33294. throw Error("valueToString() called on non-map-key element");
  33295. return this.type === e.TYPES.bytes ? t.toString("binary") : t.toString()
  33296. }
  33297. ,
  33298. o.Element = h;
  33299. var d = function(e, t, i, n, r, o) {
  33300. l.call(this, e, t, i, n, o),
  33301. this.className = "Message",
  33302. this.extensions = void 0,
  33303. this.clazz = null,
  33304. this.isGroup = !!r,
  33305. this._fields = null,
  33306. this._fieldsById = null,
  33307. this._fieldsByName = null
  33308. }
  33309. , p = d.prototype = Object.create(l.prototype);
  33310. p.build = function(i) {
  33311. if (this.clazz && !i)
  33312. return this.clazz;
  33313. var n = function(e, i) {
  33314. function n(i, r, o, a) {
  33315. if (null === i || "object" != typeof i) {
  33316. if (a && a instanceof e.Reflect.Enum) {
  33317. var s = e.Reflect.Enum.getName(a.object, i);
  33318. if (null !== s)
  33319. return s
  33320. }
  33321. return i
  33322. }
  33323. if (t.isByteBuffer(i))
  33324. return r ? i.toBase64() : i.toBuffer();
  33325. if (e.Long.isLong(i))
  33326. return o ? i.toString() : e.Long.fromValue(i);
  33327. var l;
  33328. if (Array.isArray(i))
  33329. return l = [],
  33330. i.forEach(function(e, t) {
  33331. l[t] = n(e, r, o, a)
  33332. }),
  33333. l;
  33334. if (l = {},
  33335. i instanceof e.Map) {
  33336. for (var c = i.entries(), h = c.next(); !h.done; h = c.next())
  33337. l[i.keyElem.valueToString(h.value[0])] = n(h.value[1], r, o, i.valueElem.resolvedType);
  33338. return l
  33339. }
  33340. var u = i.$type
  33341. , d = void 0;
  33342. for (var p in i)
  33343. i.hasOwnProperty(p) && (u && (d = u.getChild(p)) ? l[p] = n(i[p], r, o, d.resolvedType) : l[p] = n(i[p], r, o));
  33344. return l
  33345. }
  33346. var r = i.getChildren(e.Reflect.Message.Field)
  33347. , o = i.getChildren(e.Reflect.Message.OneOf)
  33348. , a = function(n, s) {
  33349. e.Builder.Message.call(this);
  33350. for (var l = 0, c = o.length; l < c; ++l)
  33351. this[o[l].name] = null;
  33352. for (l = 0,
  33353. c = r.length; l < c; ++l) {
  33354. var h = r[l];
  33355. this[h.name] = h.repeated ? [] : h.map ? new e.Map(h) : null,
  33356. !h.required && "proto3" !== i.syntax || null === h.defaultValue || (this[h.name] = h.defaultValue)
  33357. }
  33358. if (arguments.length > 0) {
  33359. var u;
  33360. 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)
  33361. for (l = 0,
  33362. c = arguments.length; l < c; ++l)
  33363. "undefined" != typeof (u = arguments[l]) && this.$set(r[l].name, u);
  33364. else
  33365. this.$set(n)
  33366. }
  33367. }
  33368. , s = a.prototype = Object.create(e.Builder.Message.prototype);
  33369. s.add = function(t, n, r) {
  33370. var o = i._fieldsByName[t];
  33371. if (!r) {
  33372. if (!o)
  33373. throw Error(this + "#" + t + " is undefined");
  33374. if (!(o instanceof e.Reflect.Message.Field))
  33375. throw Error(this + "#" + t + " is not a field: " + o.toString(!0));
  33376. if (!o.repeated)
  33377. throw Error(this + "#" + t + " is not a repeated field");
  33378. n = o.verifyValue(n, !0)
  33379. }
  33380. return null === this[t] && (this[t] = []),
  33381. this[t].push(n),
  33382. this
  33383. }
  33384. ,
  33385. s.$add = s.add,
  33386. s.set = function(t, n, r) {
  33387. if (t && "object" == typeof t) {
  33388. r = n;
  33389. for (var o in t)
  33390. t.hasOwnProperty(o) && "undefined" != typeof (n = t[o]) && this.$set(o, n, r);
  33391. return this
  33392. }
  33393. var a = i._fieldsByName[t];
  33394. if (r)
  33395. this[t] = n;
  33396. else {
  33397. if (!a)
  33398. throw Error(this + "#" + t + " is not a field: undefined");
  33399. if (!(a instanceof e.Reflect.Message.Field))
  33400. throw Error(this + "#" + t + " is not a field: " + a.toString(!0));
  33401. this[a.name] = n = a.verifyValue(n)
  33402. }
  33403. if (a && a.oneof) {
  33404. var s = this[a.oneof.name];
  33405. null !== n ? (null !== s && s !== a.name && (this[s] = null),
  33406. this[a.oneof.name] = a.name) : s === t && (this[a.oneof.name] = null)
  33407. }
  33408. return this
  33409. }
  33410. ,
  33411. s.$set = s.set,
  33412. s.get = function(t, n) {
  33413. if (n)
  33414. return this[t];
  33415. var r = i._fieldsByName[t];
  33416. if (!(r && r instanceof e.Reflect.Message.Field))
  33417. throw Error(this + "#" + t + " is not a field: undefined");
  33418. if (!(r instanceof e.Reflect.Message.Field))
  33419. throw Error(this + "#" + t + " is not a field: " + r.toString(!0));
  33420. return this[r.name]
  33421. }
  33422. ,
  33423. s.$get = s.get;
  33424. for (var l = 0; l < r.length; l++) {
  33425. var c = r[l];
  33426. c instanceof e.Reflect.Message.ExtensionField || i.builder.options.populateAccessors && function(e) {
  33427. var t = e.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  33428. return e.toUpperCase().replace("_", "")
  33429. });
  33430. t = t.substring(0, 1).toUpperCase() + t.substring(1);
  33431. var n = e.originalName.replace(/([A-Z])/g, function(e) {
  33432. return "_" + e
  33433. })
  33434. , r = function(t, i) {
  33435. return this[e.name] = i ? t : e.verifyValue(t),
  33436. this
  33437. }
  33438. , o = function() {
  33439. return this[e.name]
  33440. };
  33441. null === i.getChild("set" + t) && (s["set" + t] = r),
  33442. null === i.getChild("set_" + n) && (s["set_" + n] = r),
  33443. null === i.getChild("get" + t) && (s["get" + t] = o),
  33444. null === i.getChild("get_" + n) && (s["get_" + n] = o)
  33445. }(c)
  33446. }
  33447. s.encode = function(e, n) {
  33448. "boolean" == typeof e && (n = e,
  33449. e = void 0);
  33450. var r = !1;
  33451. e || (e = new t,
  33452. r = !0);
  33453. var o = e.littleEndian;
  33454. try {
  33455. return i.encode(this, e.LE(), n),
  33456. (r ? e.flip() : e).LE(o)
  33457. } catch (t) {
  33458. throw e.LE(o),
  33459. t
  33460. }
  33461. }
  33462. ,
  33463. a.encode = function(e, t, i) {
  33464. return new a(e).encode(t, i)
  33465. }
  33466. ,
  33467. s.calculate = function() {
  33468. return i.calculate(this)
  33469. }
  33470. ,
  33471. s.encodeDelimited = function(e, n) {
  33472. var r = !1;
  33473. e || (e = new t,
  33474. r = !0);
  33475. var o = (new t).LE();
  33476. return i.encode(this, o, n).flip(),
  33477. e.writeVarint32(o.remaining()),
  33478. e.append(o),
  33479. r ? e.flip() : e
  33480. }
  33481. ,
  33482. s.encodeAB = function() {
  33483. try {
  33484. return this.encode().toArrayBuffer()
  33485. } catch (e) {
  33486. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  33487. e
  33488. }
  33489. }
  33490. ,
  33491. s.toArrayBuffer = s.encodeAB,
  33492. s.encodeNB = function() {
  33493. try {
  33494. return this.encode().toBuffer()
  33495. } catch (e) {
  33496. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  33497. e
  33498. }
  33499. }
  33500. ,
  33501. s.toBuffer = s.encodeNB,
  33502. s.encode64 = function() {
  33503. try {
  33504. return this.encode().toBase64()
  33505. } catch (e) {
  33506. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  33507. e
  33508. }
  33509. }
  33510. ,
  33511. s.toBase64 = s.encode64,
  33512. s.encodeHex = function() {
  33513. try {
  33514. return this.encode().toHex()
  33515. } catch (e) {
  33516. throw e.encoded && (e.encoded = e.encoded.toHex()),
  33517. e
  33518. }
  33519. }
  33520. ,
  33521. s.toHex = s.encodeHex,
  33522. s.toRaw = function(e, t) {
  33523. return n(this, !!e, !!t, this.$type)
  33524. }
  33525. ,
  33526. s.encodeJSON = function() {
  33527. return JSON.stringify(n(this, !0, !0, this.$type))
  33528. }
  33529. ,
  33530. a.decode = function(e, n, r) {
  33531. "string" == typeof n && (r = n,
  33532. n = -1),
  33533. "string" == typeof e && (e = t.wrap(e, r ? r : "base64")),
  33534. e = t.isByteBuffer(e) ? e : t.wrap(e);
  33535. var o = e.littleEndian;
  33536. try {
  33537. var a = i.decode(e.LE());
  33538. return e.LE(o),
  33539. a
  33540. } catch (t) {
  33541. throw e.LE(o),
  33542. t
  33543. }
  33544. }
  33545. ,
  33546. a.decodeDelimited = function(e, n) {
  33547. if ("string" == typeof e && (e = t.wrap(e, n ? n : "base64")),
  33548. e = t.isByteBuffer(e) ? e : t.wrap(e),
  33549. e.remaining() < 1)
  33550. return null;
  33551. var r = e.offset
  33552. , o = e.readVarint32();
  33553. if (e.remaining() < o)
  33554. return e.offset = r,
  33555. null;
  33556. try {
  33557. var a = i.decode(e.slice(e.offset, e.offset + o).LE());
  33558. return e.offset += o,
  33559. a
  33560. } catch (t) {
  33561. throw e.offset += o,
  33562. t
  33563. }
  33564. }
  33565. ,
  33566. a.decode64 = function(e) {
  33567. return a.decode(e, "base64")
  33568. }
  33569. ,
  33570. a.decodeHex = function(e) {
  33571. return a.decode(e, "hex")
  33572. }
  33573. ,
  33574. a.decodeJSON = function(e) {
  33575. return new a(JSON.parse(e))
  33576. }
  33577. ,
  33578. s.toString = function() {
  33579. return i.toString()
  33580. }
  33581. ;
  33582. return Object.defineProperty && (Object.defineProperty(a, "$options", {
  33583. value: i.buildOpt()
  33584. }),
  33585. Object.defineProperty(s, "$options", {
  33586. value: a.$options
  33587. }),
  33588. Object.defineProperty(a, "$type", {
  33589. value: i
  33590. }),
  33591. Object.defineProperty(s, "$type", {
  33592. value: i
  33593. })),
  33594. a
  33595. }(e, this);
  33596. this._fields = [],
  33597. this._fieldsById = {},
  33598. this._fieldsByName = {};
  33599. for (var r, o = 0, a = this.children.length; o < a; o++)
  33600. if (r = this.children[o],
  33601. r instanceof A || r instanceof d || r instanceof E) {
  33602. if (n.hasOwnProperty(r.name))
  33603. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + r.toString(!0) + " cannot override static property '" + r.name + "'");
  33604. n[r.name] = r.build()
  33605. } else if (r instanceof d.Field)
  33606. r.build(),
  33607. this._fields.push(r),
  33608. this._fieldsById[r.id] = r,
  33609. this._fieldsByName[r.name] = r;
  33610. else if (!(r instanceof d.OneOf || r instanceof I))
  33611. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[o].toString(!0));
  33612. return this.clazz = n
  33613. }
  33614. ,
  33615. p.encode = function(e, t, i) {
  33616. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  33617. n = this._fields[a],
  33618. r = e[n.name],
  33619. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  33620. if (null !== o) {
  33621. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  33622. throw l.encoded = t,
  33623. l
  33624. }
  33625. return t
  33626. }
  33627. ,
  33628. p.calculate = function(e) {
  33629. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  33630. if (t = this._fields[r],
  33631. i = e[t.name],
  33632. t.required && null === i)
  33633. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  33634. n += t.calculate(i, e)
  33635. }
  33636. return n
  33637. }
  33638. ,
  33639. p.decode = function(t, i, n) {
  33640. i = "number" == typeof i ? i : -1;
  33641. for (var o, a, s, l, c = t.offset, h = new this.clazz; t.offset < c + i || i === -1 && t.remaining() > 0; ) {
  33642. if (o = t.readVarint32(),
  33643. a = 7 & o,
  33644. s = o >>> 3,
  33645. a === e.WIRE_TYPES.ENDGROUP) {
  33646. if (s !== n)
  33647. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + s + " (" + (n ? n + " expected" : "not a group") + ")");
  33648. break
  33649. }
  33650. if (l = this._fieldsById[s]) {
  33651. if (l.repeated && !l.options.packed)
  33652. h[l.name].push(l.decode(a, t));
  33653. else if (l.map) {
  33654. var u = l.decode(a, t);
  33655. h[l.name].set(u[0], u[1])
  33656. } else if (h[l.name] = l.decode(a, t),
  33657. l.oneof) {
  33658. var d = h[l.oneof.name];
  33659. null !== d && d !== l.name && (h[d] = null),
  33660. h[l.oneof.name] = l.name
  33661. }
  33662. } else
  33663. switch (a) {
  33664. case e.WIRE_TYPES.VARINT:
  33665. t.readVarint32();
  33666. break;
  33667. case e.WIRE_TYPES.BITS32:
  33668. t.offset += 4;
  33669. break;
  33670. case e.WIRE_TYPES.BITS64:
  33671. t.offset += 8;
  33672. break;
  33673. case e.WIRE_TYPES.LDELIM:
  33674. var p = t.readVarint32();
  33675. t.offset += p;
  33676. break;
  33677. case e.WIRE_TYPES.STARTGROUP:
  33678. for (; r(s, t); )
  33679. ;
  33680. break;
  33681. default:
  33682. throw Error("Illegal wire type for unknown field " + s + " in " + this.toString(!0) + "#decode: " + a)
  33683. }
  33684. }
  33685. for (var f = 0, g = this._fields.length; f < g; ++f)
  33686. if (l = this._fields[f],
  33687. null === h[l.name])
  33688. if ("proto3" === this.syntax)
  33689. h[l.name] = l.defaultValue;
  33690. else {
  33691. if (l.required) {
  33692. var m = Error("Missing at least one required field for " + this.toString(!0) + ": " + l.name);
  33693. throw m.decoded = h,
  33694. m
  33695. }
  33696. e.populateDefaults && null !== l.defaultValue && (h[l.name] = l.defaultValue)
  33697. }
  33698. return h
  33699. }
  33700. ,
  33701. o.Message = d;
  33702. var f = function(t, i, n, r, o, s, l, c, h, u) {
  33703. a.call(this, t, i, s),
  33704. this.className = "Message.Field",
  33705. this.required = "required" === n,
  33706. this.repeated = "repeated" === n,
  33707. this.map = "map" === n,
  33708. this.keyType = r || null,
  33709. this.type = o,
  33710. this.resolvedType = null,
  33711. this.id = l,
  33712. this.options = c || {},
  33713. this.defaultValue = null,
  33714. this.oneof = h || null,
  33715. this.syntax = u || "proto2",
  33716. this.originalName = this.name,
  33717. this.element = null,
  33718. this.keyElement = null,
  33719. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = e.Util.toCamelCase(this.name))
  33720. }
  33721. , g = f.prototype = Object.create(a.prototype);
  33722. g.build = function() {
  33723. this.element = new h(this.type,this.resolvedType,!1,this.syntax),
  33724. this.map && (this.keyElement = new h(this.keyType,void 0,!0,this.syntax)),
  33725. "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)
  33726. }
  33727. ,
  33728. g.verifyValue = function(t, i) {
  33729. function n(e, t) {
  33730. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  33731. }
  33732. i = i || !1;
  33733. var r = this;
  33734. if (null === t)
  33735. return this.required && n(typeof t, "required"),
  33736. "proto3" === this.syntax && this.type !== e.TYPES.message && n(typeof t, "proto3 field without field presence cannot be null"),
  33737. null;
  33738. var o;
  33739. if (this.repeated && !i) {
  33740. Array.isArray(t) || (t = [t]);
  33741. var a = [];
  33742. for (o = 0; o < t.length; o++)
  33743. a.push(this.element.verifyValue(t[o]));
  33744. return a
  33745. }
  33746. return this.map && !i ? t instanceof e.Map ? t : (t instanceof Object || n(typeof t, "expected ProtoBuf.Map or raw object for map field"),
  33747. new e.Map(this,t)) : (!this.repeated && Array.isArray(t) && n(typeof t, "no array expected"),
  33748. this.element.verifyValue(t))
  33749. }
  33750. ,
  33751. g.hasWirePresence = function(t, i) {
  33752. if ("proto3" !== this.syntax)
  33753. return null !== t;
  33754. if (this.oneof && i[this.oneof.name] === this.name)
  33755. return !0;
  33756. switch (this.type) {
  33757. case e.TYPES.int32:
  33758. case e.TYPES.sint32:
  33759. case e.TYPES.sfixed32:
  33760. case e.TYPES.uint32:
  33761. case e.TYPES.fixed32:
  33762. return 0 !== t;
  33763. case e.TYPES.int64:
  33764. case e.TYPES.sint64:
  33765. case e.TYPES.sfixed64:
  33766. case e.TYPES.uint64:
  33767. case e.TYPES.fixed64:
  33768. return 0 !== t.low || 0 !== t.high;
  33769. case e.TYPES.bool:
  33770. return t;
  33771. case e.TYPES.float:
  33772. case e.TYPES.double:
  33773. return 0 !== t;
  33774. case e.TYPES.string:
  33775. return t.length > 0;
  33776. case e.TYPES.bytes:
  33777. return t.remaining() > 0;
  33778. case e.TYPES.enum:
  33779. return 0 !== t;
  33780. case e.TYPES.message:
  33781. return null !== t;
  33782. default:
  33783. return !0
  33784. }
  33785. }
  33786. ,
  33787. g.encode = function(i, n, r) {
  33788. if (null === this.type || "object" != typeof this.type)
  33789. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33790. if (null === i || this.repeated && 0 == i.length)
  33791. return n;
  33792. try {
  33793. if (this.repeated) {
  33794. var o;
  33795. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  33796. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  33797. n.ensureCapacity(n.offset += 1);
  33798. var a = n.offset;
  33799. for (o = 0; o < i.length; o++)
  33800. this.element.encodeValue(this.id, i[o], n);
  33801. var s = n.offset - a
  33802. , l = t.calculateVarint32(s);
  33803. if (l > 1) {
  33804. var c = n.slice(a, n.offset);
  33805. a += l - 1,
  33806. n.offset = a,
  33807. n.append(c)
  33808. }
  33809. n.writeVarint32(s, a - l)
  33810. } else
  33811. for (o = 0; o < i.length; o++)
  33812. n.writeVarint32(this.id << 3 | this.type.wireType),
  33813. this.element.encodeValue(this.id, i[o], n)
  33814. } else
  33815. this.map ? i.forEach(function(i, r, o) {
  33816. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, r) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  33817. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  33818. n.writeVarint32(a),
  33819. n.writeVarint32(8 | this.keyType.wireType),
  33820. this.keyElement.encodeValue(1, r, n),
  33821. n.writeVarint32(16 | this.type.wireType),
  33822. this.element.encodeValue(2, i, n)
  33823. }, this) : this.hasWirePresence(i, r) && (n.writeVarint32(this.id << 3 | this.type.wireType),
  33824. this.element.encodeValue(this.id, i, n))
  33825. } catch (e) {
  33826. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  33827. }
  33828. return n
  33829. }
  33830. ,
  33831. g.calculate = function(i, n) {
  33832. if (i = this.verifyValue(i),
  33833. null === this.type || "object" != typeof this.type)
  33834. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33835. if (null === i || this.repeated && 0 == i.length)
  33836. return 0;
  33837. var r = 0;
  33838. try {
  33839. if (this.repeated) {
  33840. var o, a;
  33841. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  33842. for (r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  33843. a = 0,
  33844. o = 0; o < i.length; o++)
  33845. a += this.element.calculateLength(this.id, i[o]);
  33846. r += t.calculateVarint32(a),
  33847. r += a
  33848. } else
  33849. for (o = 0; o < i.length; o++)
  33850. r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  33851. r += this.element.calculateLength(this.id, i[o])
  33852. } else
  33853. this.map ? i.forEach(function(i, n, o) {
  33854. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, n) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  33855. r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  33856. r += t.calculateVarint32(a),
  33857. r += a
  33858. }, this) : this.hasWirePresence(i, n) && (r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  33859. r += this.element.calculateLength(this.id, i))
  33860. } catch (e) {
  33861. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  33862. }
  33863. return r
  33864. }
  33865. ,
  33866. g.decode = function(t, i, n) {
  33867. 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;
  33868. if (!a)
  33869. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + t + " (" + this.type.wireType + " expected)");
  33870. if (t == e.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 && !n) {
  33871. o = i.readVarint32(),
  33872. o = i.offset + o;
  33873. for (var s = []; i.offset < o; )
  33874. s.push(this.decode(this.type.wireType, i, !0));
  33875. return s
  33876. }
  33877. if (this.map) {
  33878. var l = h.defaultFieldValue(this.keyType);
  33879. if (r = h.defaultFieldValue(this.type),
  33880. o = i.readVarint32(),
  33881. i.remaining() < o)
  33882. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + i.remaining());
  33883. var c = i.clone();
  33884. for (c.limit = c.offset + o,
  33885. i.offset += o; c.remaining() > 0; ) {
  33886. var u = c.readVarint32();
  33887. t = 7 & u;
  33888. var d = u >>> 3;
  33889. if (1 === d)
  33890. l = this.keyElement.decode(c, t, d);
  33891. else {
  33892. if (2 !== d)
  33893. throw Error("Unexpected tag in map field key/value submessage");
  33894. r = this.element.decode(c, t, d)
  33895. }
  33896. }
  33897. return [l, r]
  33898. }
  33899. return this.element.decode(i, t, this.id)
  33900. }
  33901. ,
  33902. o.Message.Field = f;
  33903. var m = function(e, t, i, n, r, o, a) {
  33904. f.call(this, e, t, i, null, n, r, o, a),
  33905. this.extension
  33906. };
  33907. m.prototype = Object.create(f.prototype),
  33908. o.Message.ExtensionField = m;
  33909. var v = function(e, t, i) {
  33910. a.call(this, e, t, i),
  33911. this.fields = []
  33912. };
  33913. o.Message.OneOf = v;
  33914. var A = function(e, t, i, n, r) {
  33915. l.call(this, e, t, i, n, r),
  33916. this.className = "Enum",
  33917. this.object = null
  33918. };
  33919. A.getName = function(e, t) {
  33920. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  33921. if (e[i = n[r]] === t)
  33922. return i;
  33923. return null
  33924. }
  33925. ;
  33926. var y = A.prototype = Object.create(l.prototype);
  33927. y.build = function(t) {
  33928. if (this.object && !t)
  33929. return this.object;
  33930. for (var i = new e.Builder.Enum, n = this.getChildren(A.Value), r = 0, o = n.length; r < o; ++r)
  33931. i[n[r].name] = n[r].id;
  33932. return Object.defineProperty && Object.defineProperty(i, "$options", {
  33933. value: this.buildOpt(),
  33934. enumerable: !1
  33935. }),
  33936. this.object = i
  33937. }
  33938. ,
  33939. o.Enum = A;
  33940. var C = function(e, t, i, n) {
  33941. a.call(this, e, t, i),
  33942. this.className = "Enum.Value",
  33943. this.id = n
  33944. };
  33945. C.prototype = Object.create(a.prototype),
  33946. o.Enum.Value = C;
  33947. var I = function(e, t, i, n) {
  33948. a.call(this, e, t, i),
  33949. this.field = n
  33950. };
  33951. I.prototype = Object.create(a.prototype),
  33952. o.Extension = I;
  33953. var E = function(e, t, i, n) {
  33954. l.call(this, e, t, i, n),
  33955. this.className = "Service",
  33956. this.clazz = null
  33957. }
  33958. , b = E.prototype = Object.create(l.prototype);
  33959. b.build = function(i) {
  33960. return this.clazz && !i ? this.clazz : this.clazz = function(e, i) {
  33961. for (var n = function(t) {
  33962. e.Builder.Service.call(this),
  33963. this.rpcImpl = t || function(e, t, i) {
  33964. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  33965. }
  33966. }, r = n.prototype = Object.create(e.Builder.Service.prototype), o = i.getChildren(e.Reflect.Service.RPCMethod), a = 0; a < o.length; a++)
  33967. !function(e) {
  33968. r[e.name] = function(n, r) {
  33969. try {
  33970. try {
  33971. n = e.resolvedRequestType.clazz.decode(t.wrap(n))
  33972. } catch (e) {
  33973. if (!(e instanceof TypeError))
  33974. throw e
  33975. }
  33976. if (null === n || "object" != typeof n)
  33977. throw Error("Illegal arguments");
  33978. n instanceof e.resolvedRequestType.clazz || (n = new e.resolvedRequestType.clazz(n)),
  33979. this.rpcImpl(e.fqn(), n, function(t, n) {
  33980. if (t)
  33981. return void r(t);
  33982. null === n && (n = "");
  33983. try {
  33984. n = e.resolvedResponseType.clazz.decode(n)
  33985. } catch (e) {}
  33986. 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))
  33987. })
  33988. } catch (e) {
  33989. setTimeout(r.bind(this, e), 0)
  33990. }
  33991. }
  33992. ,
  33993. n[e.name] = function(t, i, r) {
  33994. new n(t)[e.name](i, r)
  33995. }
  33996. ,
  33997. Object.defineProperty && (Object.defineProperty(n[e.name], "$options", {
  33998. value: e.buildOpt()
  33999. }),
  34000. Object.defineProperty(r[e.name], "$options", {
  34001. value: n[e.name].$options
  34002. }))
  34003. }(o[a]);
  34004. return Object.defineProperty && (Object.defineProperty(n, "$options", {
  34005. value: i.buildOpt()
  34006. }),
  34007. Object.defineProperty(r, "$options", {
  34008. value: n.$options
  34009. }),
  34010. Object.defineProperty(n, "$type", {
  34011. value: i
  34012. }),
  34013. Object.defineProperty(r, "$type", {
  34014. value: i
  34015. })),
  34016. n
  34017. }(e, this)
  34018. }
  34019. ,
  34020. o.Service = E;
  34021. var w = function(e, t, i, n) {
  34022. a.call(this, e, t, i),
  34023. this.className = "Service.Method",
  34024. this.options = n || {}
  34025. }
  34026. , _ = w.prototype = Object.create(a.prototype);
  34027. _.buildOpt = c.buildOpt,
  34028. o.Service.Method = w;
  34029. var T = function(e, t, i, n, r, o, a, s) {
  34030. w.call(this, e, t, i, s),
  34031. this.className = "Service.RPCMethod",
  34032. this.requestName = n,
  34033. this.responseName = r,
  34034. this.requestStream = o,
  34035. this.responseStream = a,
  34036. this.resolvedRequestType = null,
  34037. this.resolvedResponseType = null
  34038. };
  34039. return T.prototype = Object.create(w.prototype),
  34040. o.Service.RPCMethod = T,
  34041. o
  34042. }(r),
  34043. r.Builder = function(t, i, n) {
  34044. function r(e) {
  34045. e.messages && e.messages.forEach(function(t) {
  34046. t.syntax = e.syntax,
  34047. r(t)
  34048. }),
  34049. e.enums && e.enums.forEach(function(t) {
  34050. t.syntax = e.syntax
  34051. })
  34052. }
  34053. var o = function(e) {
  34054. this.ns = new n.Namespace(this,null,""),
  34055. this.ptr = this.ns,
  34056. this.resolved = !1,
  34057. this.result = null,
  34058. this.files = {},
  34059. this.importRoot = null,
  34060. this.options = e || {}
  34061. }
  34062. , a = o.prototype;
  34063. return o.isMessage = function(e) {
  34064. return "string" == typeof e.name && ("undefined" == typeof e.values && "undefined" == typeof e.rpc)
  34065. }
  34066. ,
  34067. o.isMessageField = function(e) {
  34068. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && "undefined" != typeof e.id
  34069. }
  34070. ,
  34071. o.isEnum = function(e) {
  34072. return "string" == typeof e.name && !("undefined" == typeof e.values || !Array.isArray(e.values) || 0 === e.values.length)
  34073. }
  34074. ,
  34075. o.isService = function(e) {
  34076. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  34077. }
  34078. ,
  34079. o.isExtend = function(e) {
  34080. return "string" == typeof e.ref
  34081. }
  34082. ,
  34083. a.reset = function() {
  34084. return this.ptr = this.ns,
  34085. this
  34086. }
  34087. ,
  34088. a.define = function(e) {
  34089. if ("string" != typeof e || !i.TYPEREF.test(e))
  34090. throw Error("illegal namespace: " + e);
  34091. return e.split(".").forEach(function(e) {
  34092. var t = this.ptr.getChild(e);
  34093. null === t && this.ptr.addChild(t = new n.Namespace(this,this.ptr,e)),
  34094. this.ptr = t
  34095. }, this),
  34096. this
  34097. }
  34098. ,
  34099. a.create = function(e) {
  34100. if (!e)
  34101. return this;
  34102. if (Array.isArray(e)) {
  34103. if (0 === e.length)
  34104. return this;
  34105. e = e.slice()
  34106. } else
  34107. e = [e];
  34108. for (var i = [e]; i.length > 0; ) {
  34109. if (e = i.pop(),
  34110. !Array.isArray(e))
  34111. throw Error("not a valid namespace: " + JSON.stringify(e));
  34112. for (; e.length > 0; ) {
  34113. var r = e.shift();
  34114. if (o.isMessage(r)) {
  34115. var a = new n.Message(this,this.ptr,r.name,r.options,r.isGroup,r.syntax)
  34116. , s = {};
  34117. r.oneofs && Object.keys(r.oneofs).forEach(function(e) {
  34118. a.addChild(s[e] = new n.Message.OneOf(this,a,e))
  34119. }, this),
  34120. r.fields && r.fields.forEach(function(e) {
  34121. if (null !== a.getChild(0 | e.id))
  34122. throw Error("duplicate or invalid field id in " + a.name + ": " + e.id);
  34123. if (e.options && "object" != typeof e.options)
  34124. throw Error("illegal field options in " + a.name + "#" + e.name);
  34125. var t = null;
  34126. if ("string" == typeof e.oneof && !(t = s[e.oneof]))
  34127. throw Error("illegal oneof in " + a.name + "#" + e.name + ": " + e.oneof);
  34128. e = new n.Message.Field(this,a,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,r.syntax),
  34129. t && t.fields.push(e),
  34130. a.addChild(e)
  34131. }, this);
  34132. var l = [];
  34133. if (r.enums && r.enums.forEach(function(e) {
  34134. l.push(e)
  34135. }),
  34136. r.messages && r.messages.forEach(function(e) {
  34137. l.push(e)
  34138. }),
  34139. r.services && r.services.forEach(function(e) {
  34140. l.push(e)
  34141. }),
  34142. r.extensions && ("number" == typeof r.extensions[0] ? a.extensions = [r.extensions] : a.extensions = r.extensions),
  34143. this.ptr.addChild(a),
  34144. l.length > 0) {
  34145. i.push(e),
  34146. e = l,
  34147. l = null,
  34148. this.ptr = a,
  34149. a = null;
  34150. continue
  34151. }
  34152. l = null
  34153. } else if (o.isEnum(r))
  34154. a = new n.Enum(this,this.ptr,r.name,r.options,r.syntax),
  34155. r.values.forEach(function(e) {
  34156. a.addChild(new n.Enum.Value(this,a,e.name,e.id))
  34157. }, this),
  34158. this.ptr.addChild(a);
  34159. else if (o.isService(r))
  34160. a = new n.Service(this,this.ptr,r.name,r.options),
  34161. Object.keys(r.rpc).forEach(function(e) {
  34162. var t = r.rpc[e];
  34163. a.addChild(new n.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  34164. }, this),
  34165. this.ptr.addChild(a);
  34166. else {
  34167. if (!o.isExtend(r))
  34168. throw Error("not a valid definition: " + JSON.stringify(r));
  34169. if (a = this.ptr.resolve(r.ref, !0))
  34170. r.fields.forEach(function(e) {
  34171. if (null !== a.getChild(0 | e.id))
  34172. throw Error("duplicate extended field id in " + a.name + ": " + e.id);
  34173. if (a.extensions) {
  34174. var i = !1;
  34175. if (a.extensions.forEach(function(t) {
  34176. e.id >= t[0] && e.id <= t[1] && (i = !0)
  34177. }),
  34178. !i)
  34179. throw Error("illegal extended field id in " + a.name + ": " + e.id + " (not within valid ranges)")
  34180. }
  34181. var r = e.name;
  34182. this.options.convertFieldsToCamelCase && (r = t.Util.toCamelCase(r));
  34183. var o = new n.Message.ExtensionField(this,a,e.rule,e.type,this.ptr.fqn() + "." + r,e.id,e.options)
  34184. , s = new n.Extension(this,this.ptr,e.name,o);
  34185. o.extension = s,
  34186. this.ptr.addChild(s),
  34187. a.addChild(o)
  34188. }, this);
  34189. else if (!/\.?google\.protobuf\./.test(r.ref))
  34190. throw Error("extended message " + r.ref + " is not defined")
  34191. }
  34192. r = null,
  34193. a = null
  34194. }
  34195. e = null,
  34196. this.ptr = this.ptr.parent
  34197. }
  34198. return this.resolved = !1,
  34199. this.result = null,
  34200. this
  34201. }
  34202. ,
  34203. a.import = function(i, n) {
  34204. var o = "/";
  34205. if ("string" == typeof n) {
  34206. if (t.Util.IS_NODE && (n = e("path").resolve(n)),
  34207. this.files[n] === !0)
  34208. return this.reset();
  34209. this.files[n] = !0
  34210. } else if ("object" == typeof n) {
  34211. var a = n.root;
  34212. t.Util.IS_NODE && (a = e("path").resolve(a)),
  34213. (a.indexOf("\\") >= 0 || n.file.indexOf("\\") >= 0) && (o = "\\");
  34214. var s = a + o + n.file;
  34215. if (this.files[s] === !0)
  34216. return this.reset();
  34217. this.files[s] = !0
  34218. }
  34219. if (i.imports && i.imports.length > 0) {
  34220. var l, c = !1;
  34221. "object" == typeof n ? (this.importRoot = n.root,
  34222. c = !0,
  34223. l = this.importRoot,
  34224. n = n.file,
  34225. (l.indexOf("\\") >= 0 || n.indexOf("\\") >= 0) && (o = "\\")) : "string" == typeof n ? this.importRoot ? l = this.importRoot : n.indexOf("/") >= 0 ? (l = n.replace(/\/[^\/]*$/, ""),
  34226. "" === l && (l = "/")) : n.indexOf("\\") >= 0 ? (l = n.replace(/\\[^\\]*$/, ""),
  34227. o = "\\") : l = "." : l = null;
  34228. for (var h = 0; h < i.imports.length; h++)
  34229. if ("string" == typeof i.imports[h]) {
  34230. if (!l)
  34231. throw Error("cannot determine import root");
  34232. var u = i.imports[h];
  34233. if ("google/protobuf/descriptor.proto" === u)
  34234. continue;
  34235. if (u = l + o + u,
  34236. this.files[u] === !0)
  34237. continue;
  34238. /\.proto$/i.test(u) && !t.DotProto && (u = u.replace(/\.proto$/, ".json"));
  34239. var d = t.Util.fetch(u);
  34240. if (null === d)
  34241. throw Error("failed to import '" + u + "' in '" + n + "': file not found");
  34242. /\.json$/i.test(u) ? this.import(JSON.parse(d + ""), u) : this.import(t.DotProto.Parser.parse(d), u)
  34243. } else
  34244. n ? /\.(\w+)$/.test(n) ? this.import(i.imports[h], n.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  34245. return t + "_import" + h + "." + i
  34246. })) : this.import(i.imports[h], n + "_import" + h) : this.import(i.imports[h]);
  34247. c && (this.importRoot = null)
  34248. }
  34249. i.package && this.define(i.package),
  34250. i.syntax && r(i);
  34251. var p = this.ptr;
  34252. return i.options && Object.keys(i.options).forEach(function(e) {
  34253. p.options[e] = i.options[e]
  34254. }),
  34255. i.messages && (this.create(i.messages),
  34256. this.ptr = p),
  34257. i.enums && (this.create(i.enums),
  34258. this.ptr = p),
  34259. i.services && (this.create(i.services),
  34260. this.ptr = p),
  34261. i.extends && this.create(i.extends),
  34262. this.reset()
  34263. }
  34264. ,
  34265. a.resolveAll = function() {
  34266. var e;
  34267. if (null == this.ptr || "object" == typeof this.ptr.type)
  34268. return this;
  34269. if (this.ptr instanceof n.Namespace)
  34270. this.ptr.children.forEach(function(e) {
  34271. this.ptr = e,
  34272. this.resolveAll()
  34273. }, this);
  34274. else if (this.ptr instanceof n.Message.Field) {
  34275. if (i.TYPE.test(this.ptr.type))
  34276. this.ptr.type = t.TYPES[this.ptr.type];
  34277. else {
  34278. if (!i.TYPEREF.test(this.ptr.type))
  34279. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34280. if (e = (this.ptr instanceof n.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0),
  34281. !e)
  34282. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34283. if (this.ptr.resolvedType = e,
  34284. e instanceof n.Enum) {
  34285. if (this.ptr.type = t.TYPES.enum,
  34286. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  34287. throw Error("proto3 message cannot reference proto2 enum")
  34288. } else {
  34289. if (!(e instanceof n.Message))
  34290. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34291. this.ptr.type = e.isGroup ? t.TYPES.group : t.TYPES.message
  34292. }
  34293. }
  34294. if (this.ptr.map) {
  34295. if (!i.TYPE.test(this.ptr.keyType))
  34296. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  34297. this.ptr.keyType = t.TYPES[this.ptr.keyType]
  34298. }
  34299. } else if (this.ptr instanceof t.Reflect.Service.Method) {
  34300. if (!(this.ptr instanceof t.Reflect.Service.RPCMethod))
  34301. throw Error("illegal service type in " + this.ptr.toString(!0));
  34302. if (e = this.ptr.parent.resolve(this.ptr.requestName, !0),
  34303. !(e && e instanceof t.Reflect.Message))
  34304. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  34305. if (this.ptr.resolvedRequestType = e,
  34306. e = this.ptr.parent.resolve(this.ptr.responseName, !0),
  34307. !(e && e instanceof t.Reflect.Message))
  34308. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  34309. this.ptr.resolvedResponseType = e
  34310. } else if (!(this.ptr instanceof t.Reflect.Message.OneOf || this.ptr instanceof t.Reflect.Extension || this.ptr instanceof t.Reflect.Enum.Value))
  34311. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  34312. return this.reset()
  34313. }
  34314. ,
  34315. a.build = function(e) {
  34316. if (this.reset(),
  34317. this.resolved || (this.resolveAll(),
  34318. this.resolved = !0,
  34319. this.result = null),
  34320. null === this.result && (this.result = this.ns.build()),
  34321. !e)
  34322. return this.result;
  34323. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  34324. if (!i[t[n]]) {
  34325. i = null;
  34326. break
  34327. }
  34328. i = i[t[n]]
  34329. }
  34330. return i
  34331. }
  34332. ,
  34333. a.lookup = function(e, t) {
  34334. return e ? this.ns.resolve(e, t) : this.ns
  34335. }
  34336. ,
  34337. a.toString = function() {
  34338. return "Builder"
  34339. }
  34340. ,
  34341. o.Message = function() {}
  34342. ,
  34343. o.Enum = function() {}
  34344. ,
  34345. o.Service = function() {}
  34346. ,
  34347. o
  34348. }(r, r.Lang, r.Reflect),
  34349. r.Map = function(e, t) {
  34350. function i(e) {
  34351. var t = 0;
  34352. return {
  34353. next: function() {
  34354. return t < e.length ? {
  34355. done: !1,
  34356. value: e[t++]
  34357. } : {
  34358. done: !0
  34359. }
  34360. }
  34361. }
  34362. }
  34363. var n = function(e, i) {
  34364. if (!e.map)
  34365. throw Error("field is not a map");
  34366. if (this.field = e,
  34367. this.keyElem = new t.Element(e.keyType,null,!0,e.syntax),
  34368. this.valueElem = new t.Element(e.type,e.resolvedType,!1,e.syntax),
  34369. this.map = {},
  34370. Object.defineProperty(this, "size", {
  34371. get: function() {
  34372. return Object.keys(this.map).length
  34373. }
  34374. }),
  34375. i)
  34376. for (var n = Object.keys(i), r = 0; r < n.length; r++) {
  34377. var o = this.keyElem.valueFromString(n[r])
  34378. , a = this.valueElem.verifyValue(i[n[r]]);
  34379. this.map[this.keyElem.valueToString(o)] = {
  34380. key: o,
  34381. value: a
  34382. }
  34383. }
  34384. }
  34385. , r = n.prototype;
  34386. return r.clear = function() {
  34387. this.map = {}
  34388. }
  34389. ,
  34390. r.delete = function(e) {
  34391. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  34392. , i = t in this.map;
  34393. return delete this.map[t],
  34394. i
  34395. }
  34396. ,
  34397. r.entries = function() {
  34398. for (var e, t = [], n = Object.keys(this.map), r = 0; r < n.length; r++)
  34399. t.push([(e = this.map[n[r]]).key, e.value]);
  34400. return i(t)
  34401. }
  34402. ,
  34403. r.keys = function() {
  34404. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  34405. e.push(this.map[t[n]].key);
  34406. return i(e)
  34407. }
  34408. ,
  34409. r.values = function() {
  34410. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  34411. e.push(this.map[t[n]].value);
  34412. return i(e)
  34413. }
  34414. ,
  34415. r.forEach = function(e, t) {
  34416. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  34417. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  34418. }
  34419. ,
  34420. r.set = function(e, t) {
  34421. var i = this.keyElem.verifyValue(e)
  34422. , n = this.valueElem.verifyValue(t);
  34423. return this.map[this.keyElem.valueToString(i)] = {
  34424. key: i,
  34425. value: n
  34426. },
  34427. this
  34428. }
  34429. ,
  34430. r.get = function(e) {
  34431. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  34432. if (t in this.map)
  34433. return this.map[t].value
  34434. }
  34435. ,
  34436. r.has = function(e) {
  34437. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  34438. return t in this.map
  34439. }
  34440. ,
  34441. n
  34442. }(r, r.Reflect),
  34443. r.loadProto = function(e, t, i) {
  34444. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34445. t = void 0),
  34446. r.loadJson(r.DotProto.Parser.parse(e), t, i)
  34447. }
  34448. ,
  34449. r.protoFromString = r.loadProto,
  34450. r.loadProtoFile = function(e, t, i) {
  34451. if (t && "object" == typeof t ? (i = t,
  34452. t = null) : t && "function" == typeof t || (t = null),
  34453. t)
  34454. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  34455. if (null === n)
  34456. return void t(Error("Failed to fetch file"));
  34457. try {
  34458. t(null, r.loadProto(n, i, e))
  34459. } catch (e) {
  34460. t(e)
  34461. }
  34462. });
  34463. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  34464. return null === n ? null : r.loadProto(n, i, e)
  34465. }
  34466. ,
  34467. r.protoFromFile = r.loadProtoFile,
  34468. r.newBuilder = function(e) {
  34469. return e = e || {},
  34470. "undefined" == typeof e.convertFieldsToCamelCase && (e.convertFieldsToCamelCase = r.convertFieldsToCamelCase),
  34471. "undefined" == typeof e.populateAccessors && (e.populateAccessors = r.populateAccessors),
  34472. new r.Builder(e)
  34473. }
  34474. ,
  34475. r.loadJson = function(e, t, i) {
  34476. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34477. t = null),
  34478. t && "object" == typeof t || (t = r.newBuilder()),
  34479. "string" == typeof e && (e = JSON.parse(e)),
  34480. t.import(e, i),
  34481. t.resolveAll(),
  34482. t
  34483. }
  34484. ,
  34485. r.loadJsonFile = function(e, t, i) {
  34486. if (t && "object" == typeof t ? (i = t,
  34487. t = null) : t && "function" == typeof t || (t = null),
  34488. t)
  34489. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  34490. if (null === n)
  34491. return void t(Error("Failed to fetch file"));
  34492. try {
  34493. t(null, r.loadJson(JSON.parse(n), i, e))
  34494. } catch (e) {
  34495. t(e)
  34496. }
  34497. });
  34498. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  34499. return null === n ? null : r.loadJson(JSON.parse(n), i, e)
  34500. }
  34501. ,
  34502. r
  34503. })
  34504. }
  34505. ).call(this, e("_process"))
  34506. }
  34507. , {
  34508. _process: 203,
  34509. bytebuffer: 215,
  34510. fs: 197,
  34511. path: 197
  34512. }],
  34513. 215: [function(e, t, i) {
  34514. !function(i, n) {
  34515. "function" == typeof define && define.amd ? define(["long"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = function() {
  34516. var t;
  34517. try {
  34518. t = e("long")
  34519. } catch (e) {}
  34520. return n(t)
  34521. }() : (i.dcodeIO = i.dcodeIO || {}).ByteBuffer = n(i.dcodeIO.Long)
  34522. }(this, function(e) {
  34523. "use strict";
  34524. function t(e) {
  34525. var t = 0;
  34526. return function() {
  34527. return t < e.length ? e.charCodeAt(t++) : null
  34528. }
  34529. }
  34530. function i() {
  34531. var e = []
  34532. , t = [];
  34533. return function() {
  34534. return 0 === arguments.length ? t.join("") + l.apply(String, e) : (e.length + arguments.length > 1024 && (t.push(l.apply(String, e)),
  34535. e.length = 0),
  34536. void Array.prototype.push.apply(e, arguments))
  34537. }
  34538. }
  34539. function n(e, t, i, n, r) {
  34540. 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];
  34541. for (u += d,
  34542. o = p & (1 << -h) - 1,
  34543. p >>= -h,
  34544. h += s; h > 0; o = 256 * o + e[t + u],
  34545. u += d,
  34546. h -= 8)
  34547. ;
  34548. for (a = o & (1 << -h) - 1,
  34549. o >>= -h,
  34550. h += n; h > 0; a = 256 * a + e[t + u],
  34551. u += d,
  34552. h -= 8)
  34553. ;
  34554. if (0 === o)
  34555. o = 1 - c;
  34556. else {
  34557. if (o === l)
  34558. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  34559. a += Math.pow(2, n),
  34560. o -= c
  34561. }
  34562. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  34563. }
  34564. function r(e, t, i, n, r, o) {
  34565. 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;
  34566. for (t = Math.abs(t),
  34567. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  34568. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  34569. t * (l = Math.pow(2, -a)) < 1 && (a--,
  34570. l *= 2),
  34571. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  34572. t * l >= 2 && (a++,
  34573. l /= 2),
  34574. a + u >= h ? (s = 0,
  34575. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  34576. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  34577. a = 0)); r >= 8; e[i + p] = 255 & s,
  34578. p += f,
  34579. s /= 256,
  34580. r -= 8)
  34581. ;
  34582. for (a = a << r | s,
  34583. c += r; c > 0; e[i + p] = 255 & a,
  34584. p += f,
  34585. a /= 256,
  34586. c -= 8)
  34587. ;
  34588. e[i + p - f] |= 128 * g
  34589. }
  34590. var o = function(e, t, i) {
  34591. if ("undefined" == typeof e && (e = o.DEFAULT_CAPACITY),
  34592. "undefined" == typeof t && (t = o.DEFAULT_ENDIAN),
  34593. "undefined" == typeof i && (i = o.DEFAULT_NOASSERT),
  34594. !i) {
  34595. if (e |= 0,
  34596. e < 0)
  34597. throw RangeError("Illegal capacity");
  34598. t = !!t,
  34599. i = !!i
  34600. }
  34601. this.buffer = 0 === e ? s : new ArrayBuffer(e),
  34602. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  34603. this.offset = 0,
  34604. this.markedOffset = -1,
  34605. this.limit = e,
  34606. this.littleEndian = t,
  34607. this.noAssert = i
  34608. };
  34609. o.VERSION = "5.0.1",
  34610. o.LITTLE_ENDIAN = !0,
  34611. o.BIG_ENDIAN = !1,
  34612. o.DEFAULT_CAPACITY = 16,
  34613. o.DEFAULT_ENDIAN = o.BIG_ENDIAN,
  34614. o.DEFAULT_NOASSERT = !1,
  34615. o.Long = e || null;
  34616. var a = o.prototype;
  34617. a.__isByteBuffer__,
  34618. Object.defineProperty(a, "__isByteBuffer__", {
  34619. value: !0,
  34620. enumerable: !1,
  34621. configurable: !1
  34622. });
  34623. var s = new ArrayBuffer(0)
  34624. , l = String.fromCharCode;
  34625. o.accessor = function() {
  34626. return Uint8Array
  34627. }
  34628. ,
  34629. o.allocate = function(e, t, i) {
  34630. return new o(e,t,i)
  34631. }
  34632. ,
  34633. o.concat = function(e, t, i, n) {
  34634. "boolean" != typeof t && "string" == typeof t || (n = i,
  34635. i = t,
  34636. t = void 0);
  34637. for (var r, a = 0, s = 0, l = e.length; s < l; ++s)
  34638. o.isByteBuffer(e[s]) || (e[s] = o.wrap(e[s], t)),
  34639. r = e[s].limit - e[s].offset,
  34640. r > 0 && (a += r);
  34641. if (0 === a)
  34642. return new o(0,i,n);
  34643. var c, h = new o(a,i,n);
  34644. for (s = 0; s < l; )
  34645. c = e[s++],
  34646. r = c.limit - c.offset,
  34647. r <= 0 || (h.view.set(c.view.subarray(c.offset, c.limit), h.offset),
  34648. h.offset += r);
  34649. return h.limit = h.offset,
  34650. h.offset = 0,
  34651. h
  34652. }
  34653. ,
  34654. o.isByteBuffer = function(e) {
  34655. return (e && e.__isByteBuffer__) === !0
  34656. }
  34657. ,
  34658. o.type = function() {
  34659. return ArrayBuffer
  34660. }
  34661. ,
  34662. o.wrap = function(e, t, i, n) {
  34663. if ("string" != typeof t && (n = i,
  34664. i = t,
  34665. t = void 0),
  34666. "string" == typeof e)
  34667. switch ("undefined" == typeof t && (t = "utf8"),
  34668. t) {
  34669. case "base64":
  34670. return o.fromBase64(e, i);
  34671. case "hex":
  34672. return o.fromHex(e, i);
  34673. case "binary":
  34674. return o.fromBinary(e, i);
  34675. case "utf8":
  34676. return o.fromUTF8(e, i);
  34677. case "debug":
  34678. return o.fromDebug(e, i);
  34679. default:
  34680. throw Error("Unsupported encoding: " + t)
  34681. }
  34682. if (null === e || "object" != typeof e)
  34683. throw TypeError("Illegal buffer");
  34684. var r;
  34685. if (o.isByteBuffer(e))
  34686. return r = a.clone.call(e),
  34687. r.markedOffset = -1,
  34688. r;
  34689. if (e instanceof Uint8Array)
  34690. r = new o(0,i,n),
  34691. e.length > 0 && (r.buffer = e.buffer,
  34692. r.offset = e.byteOffset,
  34693. r.limit = e.byteOffset + e.byteLength,
  34694. r.view = new Uint8Array(e.buffer));
  34695. else if (e instanceof ArrayBuffer)
  34696. r = new o(0,i,n),
  34697. e.byteLength > 0 && (r.buffer = e,
  34698. r.offset = 0,
  34699. r.limit = e.byteLength,
  34700. r.view = e.byteLength > 0 ? new Uint8Array(e) : null);
  34701. else {
  34702. if ("[object Array]" !== Object.prototype.toString.call(e))
  34703. throw TypeError("Illegal buffer");
  34704. r = new o(e.length,i,n),
  34705. r.limit = e.length;
  34706. for (var s = 0; s < e.length; ++s)
  34707. r.view[s] = e[s]
  34708. }
  34709. return r
  34710. }
  34711. ,
  34712. a.writeBitSet = function(e, t) {
  34713. var i = "undefined" == typeof t;
  34714. if (i && (t = this.offset),
  34715. !this.noAssert) {
  34716. if (!(e instanceof Array))
  34717. throw TypeError("Illegal BitSet: Not an array");
  34718. if ("number" != typeof t || t % 1 !== 0)
  34719. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34720. if (t >>>= 0,
  34721. t < 0 || t + 0 > this.buffer.byteLength)
  34722. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34723. }
  34724. var n, r = t, o = e.length, a = o >> 3, s = 0;
  34725. for (t += this.writeVarint32(o, t); a--; )
  34726. 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,
  34727. this.writeByte(n, t++);
  34728. if (s < o) {
  34729. var l = 0;
  34730. for (n = 0; s < o; )
  34731. n |= (1 & !!e[s++]) << l++;
  34732. this.writeByte(n, t++)
  34733. }
  34734. return i ? (this.offset = t,
  34735. this) : t - r
  34736. }
  34737. ,
  34738. a.readBitSet = function(e) {
  34739. var t = "undefined" == typeof e;
  34740. t && (e = this.offset);
  34741. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  34742. for (e += n.length; o--; )
  34743. i = this.readByte(e++),
  34744. s[a++] = !!(1 & i),
  34745. s[a++] = !!(2 & i),
  34746. s[a++] = !!(4 & i),
  34747. s[a++] = !!(8 & i),
  34748. s[a++] = !!(16 & i),
  34749. s[a++] = !!(32 & i),
  34750. s[a++] = !!(64 & i),
  34751. s[a++] = !!(128 & i);
  34752. if (a < r) {
  34753. var l = 0;
  34754. for (i = this.readByte(e++); a < r; )
  34755. s[a++] = !!(i >> l++ & 1)
  34756. }
  34757. return t && (this.offset = e),
  34758. s
  34759. }
  34760. ,
  34761. a.readBytes = function(e, t) {
  34762. var i = "undefined" == typeof t;
  34763. if (i && (t = this.offset),
  34764. !this.noAssert) {
  34765. if ("number" != typeof t || t % 1 !== 0)
  34766. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34767. if (t >>>= 0,
  34768. t < 0 || t + e > this.buffer.byteLength)
  34769. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  34770. }
  34771. var n = this.slice(t, t + e);
  34772. return i && (this.offset += e),
  34773. n
  34774. }
  34775. ,
  34776. a.writeBytes = a.append,
  34777. a.writeInt8 = function(e, t) {
  34778. var i = "undefined" == typeof t;
  34779. if (i && (t = this.offset),
  34780. !this.noAssert) {
  34781. if ("number" != typeof e || e % 1 !== 0)
  34782. throw TypeError("Illegal value: " + e + " (not an integer)");
  34783. if (e |= 0,
  34784. "number" != typeof t || t % 1 !== 0)
  34785. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34786. if (t >>>= 0,
  34787. t < 0 || t + 0 > this.buffer.byteLength)
  34788. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34789. }
  34790. t += 1;
  34791. var n = this.buffer.byteLength;
  34792. return t > n && this.resize((n *= 2) > t ? n : t),
  34793. t -= 1,
  34794. this.view[t] = e,
  34795. i && (this.offset += 1),
  34796. this
  34797. }
  34798. ,
  34799. a.writeByte = a.writeInt8,
  34800. a.readInt8 = function(e) {
  34801. var t = "undefined" == typeof e;
  34802. if (t && (e = this.offset),
  34803. !this.noAssert) {
  34804. if ("number" != typeof e || e % 1 !== 0)
  34805. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34806. if (e >>>= 0,
  34807. e < 0 || e + 1 > this.buffer.byteLength)
  34808. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34809. }
  34810. var i = this.view[e];
  34811. return 128 === (128 & i) && (i = -(255 - i + 1)),
  34812. t && (this.offset += 1),
  34813. i
  34814. }
  34815. ,
  34816. a.readByte = a.readInt8,
  34817. a.writeUint8 = function(e, t) {
  34818. var i = "undefined" == typeof t;
  34819. if (i && (t = this.offset),
  34820. !this.noAssert) {
  34821. if ("number" != typeof e || e % 1 !== 0)
  34822. throw TypeError("Illegal value: " + e + " (not an integer)");
  34823. if (e >>>= 0,
  34824. "number" != typeof t || t % 1 !== 0)
  34825. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34826. if (t >>>= 0,
  34827. t < 0 || t + 0 > this.buffer.byteLength)
  34828. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34829. }
  34830. t += 1;
  34831. var n = this.buffer.byteLength;
  34832. return t > n && this.resize((n *= 2) > t ? n : t),
  34833. t -= 1,
  34834. this.view[t] = e,
  34835. i && (this.offset += 1),
  34836. this
  34837. }
  34838. ,
  34839. a.writeUInt8 = a.writeUint8,
  34840. a.readUint8 = function(e) {
  34841. var t = "undefined" == typeof e;
  34842. if (t && (e = this.offset),
  34843. !this.noAssert) {
  34844. if ("number" != typeof e || e % 1 !== 0)
  34845. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34846. if (e >>>= 0,
  34847. e < 0 || e + 1 > this.buffer.byteLength)
  34848. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34849. }
  34850. var i = this.view[e];
  34851. return t && (this.offset += 1),
  34852. i
  34853. }
  34854. ,
  34855. a.readUInt8 = a.readUint8,
  34856. a.writeInt16 = function(e, t) {
  34857. var i = "undefined" == typeof t;
  34858. if (i && (t = this.offset),
  34859. !this.noAssert) {
  34860. if ("number" != typeof e || e % 1 !== 0)
  34861. throw TypeError("Illegal value: " + e + " (not an integer)");
  34862. if (e |= 0,
  34863. "number" != typeof t || t % 1 !== 0)
  34864. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34865. if (t >>>= 0,
  34866. t < 0 || t + 0 > this.buffer.byteLength)
  34867. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34868. }
  34869. t += 2;
  34870. var n = this.buffer.byteLength;
  34871. return t > n && this.resize((n *= 2) > t ? n : t),
  34872. t -= 2,
  34873. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34874. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34875. this.view[t + 1] = 255 & e),
  34876. i && (this.offset += 2),
  34877. this
  34878. }
  34879. ,
  34880. a.writeShort = a.writeInt16,
  34881. a.readInt16 = function(e) {
  34882. var t = "undefined" == typeof e;
  34883. if (t && (e = this.offset),
  34884. !this.noAssert) {
  34885. if ("number" != typeof e || e % 1 !== 0)
  34886. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34887. if (e >>>= 0,
  34888. e < 0 || e + 2 > this.buffer.byteLength)
  34889. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34890. }
  34891. var i = 0;
  34892. return this.littleEndian ? (i = this.view[e],
  34893. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34894. i |= this.view[e + 1]),
  34895. 32768 === (32768 & i) && (i = -(65535 - i + 1)),
  34896. t && (this.offset += 2),
  34897. i
  34898. }
  34899. ,
  34900. a.readShort = a.readInt16,
  34901. a.writeUint16 = function(e, t) {
  34902. var i = "undefined" == typeof t;
  34903. if (i && (t = this.offset),
  34904. !this.noAssert) {
  34905. if ("number" != typeof e || e % 1 !== 0)
  34906. throw TypeError("Illegal value: " + e + " (not an integer)");
  34907. if (e >>>= 0,
  34908. "number" != typeof t || t % 1 !== 0)
  34909. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34910. if (t >>>= 0,
  34911. t < 0 || t + 0 > this.buffer.byteLength)
  34912. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34913. }
  34914. t += 2;
  34915. var n = this.buffer.byteLength;
  34916. return t > n && this.resize((n *= 2) > t ? n : t),
  34917. t -= 2,
  34918. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34919. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34920. this.view[t + 1] = 255 & e),
  34921. i && (this.offset += 2),
  34922. this
  34923. }
  34924. ,
  34925. a.writeUInt16 = a.writeUint16,
  34926. a.readUint16 = function(e) {
  34927. var t = "undefined" == typeof e;
  34928. if (t && (e = this.offset),
  34929. !this.noAssert) {
  34930. if ("number" != typeof e || e % 1 !== 0)
  34931. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34932. if (e >>>= 0,
  34933. e < 0 || e + 2 > this.buffer.byteLength)
  34934. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34935. }
  34936. var i = 0;
  34937. return this.littleEndian ? (i = this.view[e],
  34938. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34939. i |= this.view[e + 1]),
  34940. t && (this.offset += 2),
  34941. i
  34942. }
  34943. ,
  34944. a.readUInt16 = a.readUint16,
  34945. a.writeInt32 = function(e, t) {
  34946. var i = "undefined" == typeof t;
  34947. if (i && (t = this.offset),
  34948. !this.noAssert) {
  34949. if ("number" != typeof e || e % 1 !== 0)
  34950. throw TypeError("Illegal value: " + e + " (not an integer)");
  34951. if (e |= 0,
  34952. "number" != typeof t || t % 1 !== 0)
  34953. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34954. if (t >>>= 0,
  34955. t < 0 || t + 0 > this.buffer.byteLength)
  34956. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34957. }
  34958. t += 4;
  34959. var n = this.buffer.byteLength;
  34960. return t > n && this.resize((n *= 2) > t ? n : t),
  34961. t -= 4,
  34962. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34963. this.view[t + 2] = e >>> 16 & 255,
  34964. this.view[t + 1] = e >>> 8 & 255,
  34965. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34966. this.view[t + 1] = e >>> 16 & 255,
  34967. this.view[t + 2] = e >>> 8 & 255,
  34968. this.view[t + 3] = 255 & e),
  34969. i && (this.offset += 4),
  34970. this
  34971. }
  34972. ,
  34973. a.writeInt = a.writeInt32,
  34974. a.readInt32 = function(e) {
  34975. var t = "undefined" == typeof e;
  34976. if (t && (e = this.offset),
  34977. !this.noAssert) {
  34978. if ("number" != typeof e || e % 1 !== 0)
  34979. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34980. if (e >>>= 0,
  34981. e < 0 || e + 4 > this.buffer.byteLength)
  34982. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34983. }
  34984. var i = 0;
  34985. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34986. i |= this.view[e + 1] << 8,
  34987. i |= this.view[e],
  34988. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34989. i |= this.view[e + 2] << 8,
  34990. i |= this.view[e + 3],
  34991. i += this.view[e] << 24 >>> 0),
  34992. i |= 0,
  34993. t && (this.offset += 4),
  34994. i
  34995. }
  34996. ,
  34997. a.readInt = a.readInt32,
  34998. a.writeUint32 = function(e, t) {
  34999. var i = "undefined" == typeof t;
  35000. if (i && (t = this.offset),
  35001. !this.noAssert) {
  35002. if ("number" != typeof e || e % 1 !== 0)
  35003. throw TypeError("Illegal value: " + e + " (not an integer)");
  35004. if (e >>>= 0,
  35005. "number" != typeof t || t % 1 !== 0)
  35006. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35007. if (t >>>= 0,
  35008. t < 0 || t + 0 > this.buffer.byteLength)
  35009. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35010. }
  35011. t += 4;
  35012. var n = this.buffer.byteLength;
  35013. return t > n && this.resize((n *= 2) > t ? n : t),
  35014. t -= 4,
  35015. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  35016. this.view[t + 2] = e >>> 16 & 255,
  35017. this.view[t + 1] = e >>> 8 & 255,
  35018. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  35019. this.view[t + 1] = e >>> 16 & 255,
  35020. this.view[t + 2] = e >>> 8 & 255,
  35021. this.view[t + 3] = 255 & e),
  35022. i && (this.offset += 4),
  35023. this
  35024. }
  35025. ,
  35026. a.writeUInt32 = a.writeUint32,
  35027. a.readUint32 = function(e) {
  35028. var t = "undefined" == typeof e;
  35029. if (t && (e = this.offset),
  35030. !this.noAssert) {
  35031. if ("number" != typeof e || e % 1 !== 0)
  35032. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35033. if (e >>>= 0,
  35034. e < 0 || e + 4 > this.buffer.byteLength)
  35035. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35036. }
  35037. var i = 0;
  35038. return this.littleEndian ? (i = this.view[e + 2] << 16,
  35039. i |= this.view[e + 1] << 8,
  35040. i |= this.view[e],
  35041. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  35042. i |= this.view[e + 2] << 8,
  35043. i |= this.view[e + 3],
  35044. i += this.view[e] << 24 >>> 0),
  35045. t && (this.offset += 4),
  35046. i
  35047. }
  35048. ,
  35049. a.readUInt32 = a.readUint32,
  35050. e && (a.writeInt64 = function(t, i) {
  35051. var n = "undefined" == typeof i;
  35052. if (n && (i = this.offset),
  35053. !this.noAssert) {
  35054. if ("number" == typeof t)
  35055. t = e.fromNumber(t);
  35056. else if ("string" == typeof t)
  35057. t = e.fromString(t);
  35058. else if (!(t && t instanceof e))
  35059. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  35060. if ("number" != typeof i || i % 1 !== 0)
  35061. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35062. if (i >>>= 0,
  35063. i < 0 || i + 0 > this.buffer.byteLength)
  35064. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35065. }
  35066. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  35067. i += 8;
  35068. var r = this.buffer.byteLength;
  35069. i > r && this.resize((r *= 2) > i ? r : i),
  35070. i -= 8;
  35071. var o = t.low
  35072. , a = t.high;
  35073. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  35074. this.view[i + 2] = o >>> 16 & 255,
  35075. this.view[i + 1] = o >>> 8 & 255,
  35076. this.view[i] = 255 & o,
  35077. i += 4,
  35078. this.view[i + 3] = a >>> 24 & 255,
  35079. this.view[i + 2] = a >>> 16 & 255,
  35080. this.view[i + 1] = a >>> 8 & 255,
  35081. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  35082. this.view[i + 1] = a >>> 16 & 255,
  35083. this.view[i + 2] = a >>> 8 & 255,
  35084. this.view[i + 3] = 255 & a,
  35085. i += 4,
  35086. this.view[i] = o >>> 24 & 255,
  35087. this.view[i + 1] = o >>> 16 & 255,
  35088. this.view[i + 2] = o >>> 8 & 255,
  35089. this.view[i + 3] = 255 & o),
  35090. n && (this.offset += 8),
  35091. this
  35092. }
  35093. ,
  35094. a.writeLong = a.writeInt64,
  35095. a.readInt64 = function(t) {
  35096. var i = "undefined" == typeof t;
  35097. if (i && (t = this.offset),
  35098. !this.noAssert) {
  35099. if ("number" != typeof t || t % 1 !== 0)
  35100. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35101. if (t >>>= 0,
  35102. t < 0 || t + 8 > this.buffer.byteLength)
  35103. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  35104. }
  35105. var n = 0
  35106. , r = 0;
  35107. this.littleEndian ? (n = this.view[t + 2] << 16,
  35108. n |= this.view[t + 1] << 8,
  35109. n |= this.view[t],
  35110. n += this.view[t + 3] << 24 >>> 0,
  35111. t += 4,
  35112. r = this.view[t + 2] << 16,
  35113. r |= this.view[t + 1] << 8,
  35114. r |= this.view[t],
  35115. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  35116. r |= this.view[t + 2] << 8,
  35117. r |= this.view[t + 3],
  35118. r += this.view[t] << 24 >>> 0,
  35119. t += 4,
  35120. n = this.view[t + 1] << 16,
  35121. n |= this.view[t + 2] << 8,
  35122. n |= this.view[t + 3],
  35123. n += this.view[t] << 24 >>> 0);
  35124. var o = new e(n,r,!1);
  35125. return i && (this.offset += 8),
  35126. o
  35127. }
  35128. ,
  35129. a.readLong = a.readInt64,
  35130. a.writeUint64 = function(t, i) {
  35131. var n = "undefined" == typeof i;
  35132. if (n && (i = this.offset),
  35133. !this.noAssert) {
  35134. if ("number" == typeof t)
  35135. t = e.fromNumber(t);
  35136. else if ("string" == typeof t)
  35137. t = e.fromString(t);
  35138. else if (!(t && t instanceof e))
  35139. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  35140. if ("number" != typeof i || i % 1 !== 0)
  35141. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35142. if (i >>>= 0,
  35143. i < 0 || i + 0 > this.buffer.byteLength)
  35144. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35145. }
  35146. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  35147. i += 8;
  35148. var r = this.buffer.byteLength;
  35149. i > r && this.resize((r *= 2) > i ? r : i),
  35150. i -= 8;
  35151. var o = t.low
  35152. , a = t.high;
  35153. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  35154. this.view[i + 2] = o >>> 16 & 255,
  35155. this.view[i + 1] = o >>> 8 & 255,
  35156. this.view[i] = 255 & o,
  35157. i += 4,
  35158. this.view[i + 3] = a >>> 24 & 255,
  35159. this.view[i + 2] = a >>> 16 & 255,
  35160. this.view[i + 1] = a >>> 8 & 255,
  35161. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  35162. this.view[i + 1] = a >>> 16 & 255,
  35163. this.view[i + 2] = a >>> 8 & 255,
  35164. this.view[i + 3] = 255 & a,
  35165. i += 4,
  35166. this.view[i] = o >>> 24 & 255,
  35167. this.view[i + 1] = o >>> 16 & 255,
  35168. this.view[i + 2] = o >>> 8 & 255,
  35169. this.view[i + 3] = 255 & o),
  35170. n && (this.offset += 8),
  35171. this
  35172. }
  35173. ,
  35174. a.writeUInt64 = a.writeUint64,
  35175. a.readUint64 = function(t) {
  35176. var i = "undefined" == typeof t;
  35177. if (i && (t = this.offset),
  35178. !this.noAssert) {
  35179. if ("number" != typeof t || t % 1 !== 0)
  35180. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35181. if (t >>>= 0,
  35182. t < 0 || t + 8 > this.buffer.byteLength)
  35183. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  35184. }
  35185. var n = 0
  35186. , r = 0;
  35187. this.littleEndian ? (n = this.view[t + 2] << 16,
  35188. n |= this.view[t + 1] << 8,
  35189. n |= this.view[t],
  35190. n += this.view[t + 3] << 24 >>> 0,
  35191. t += 4,
  35192. r = this.view[t + 2] << 16,
  35193. r |= this.view[t + 1] << 8,
  35194. r |= this.view[t],
  35195. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  35196. r |= this.view[t + 2] << 8,
  35197. r |= this.view[t + 3],
  35198. r += this.view[t] << 24 >>> 0,
  35199. t += 4,
  35200. n = this.view[t + 1] << 16,
  35201. n |= this.view[t + 2] << 8,
  35202. n |= this.view[t + 3],
  35203. n += this.view[t] << 24 >>> 0);
  35204. var o = new e(n,r,!0);
  35205. return i && (this.offset += 8),
  35206. o
  35207. }
  35208. ,
  35209. a.readUInt64 = a.readUint64),
  35210. a.writeFloat32 = function(e, t) {
  35211. var i = "undefined" == typeof t;
  35212. if (i && (t = this.offset),
  35213. !this.noAssert) {
  35214. if ("number" != typeof e)
  35215. throw TypeError("Illegal value: " + e + " (not a number)");
  35216. if ("number" != typeof t || t % 1 !== 0)
  35217. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35218. if (t >>>= 0,
  35219. t < 0 || t + 0 > this.buffer.byteLength)
  35220. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35221. }
  35222. t += 4;
  35223. var n = this.buffer.byteLength;
  35224. return t > n && this.resize((n *= 2) > t ? n : t),
  35225. t -= 4,
  35226. r(this.view, e, t, this.littleEndian, 23, 4),
  35227. i && (this.offset += 4),
  35228. this
  35229. }
  35230. ,
  35231. a.writeFloat = a.writeFloat32,
  35232. a.readFloat32 = function(e) {
  35233. var t = "undefined" == typeof e;
  35234. if (t && (e = this.offset),
  35235. !this.noAssert) {
  35236. if ("number" != typeof e || e % 1 !== 0)
  35237. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35238. if (e >>>= 0,
  35239. e < 0 || e + 4 > this.buffer.byteLength)
  35240. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35241. }
  35242. var i = n(this.view, e, this.littleEndian, 23, 4);
  35243. return t && (this.offset += 4),
  35244. i
  35245. }
  35246. ,
  35247. a.readFloat = a.readFloat32,
  35248. a.writeFloat64 = function(e, t) {
  35249. var i = "undefined" == typeof t;
  35250. if (i && (t = this.offset),
  35251. !this.noAssert) {
  35252. if ("number" != typeof e)
  35253. throw TypeError("Illegal value: " + e + " (not a number)");
  35254. if ("number" != typeof t || t % 1 !== 0)
  35255. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35256. if (t >>>= 0,
  35257. t < 0 || t + 0 > this.buffer.byteLength)
  35258. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35259. }
  35260. t += 8;
  35261. var n = this.buffer.byteLength;
  35262. return t > n && this.resize((n *= 2) > t ? n : t),
  35263. t -= 8,
  35264. r(this.view, e, t, this.littleEndian, 52, 8),
  35265. i && (this.offset += 8),
  35266. this
  35267. }
  35268. ,
  35269. a.writeDouble = a.writeFloat64,
  35270. a.readFloat64 = function(e) {
  35271. var t = "undefined" == typeof e;
  35272. if (t && (e = this.offset),
  35273. !this.noAssert) {
  35274. if ("number" != typeof e || e % 1 !== 0)
  35275. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35276. if (e >>>= 0,
  35277. e < 0 || e + 8 > this.buffer.byteLength)
  35278. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35279. }
  35280. var i = n(this.view, e, this.littleEndian, 52, 8);
  35281. return t && (this.offset += 8),
  35282. i
  35283. }
  35284. ,
  35285. a.readDouble = a.readFloat64,
  35286. o.MAX_VARINT32_BYTES = 5,
  35287. o.calculateVarint32 = function(e) {
  35288. return e >>>= 0,
  35289. e < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  35290. }
  35291. ,
  35292. o.zigZagEncode32 = function(e) {
  35293. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  35294. }
  35295. ,
  35296. o.zigZagDecode32 = function(e) {
  35297. return e >>> 1 ^ -(1 & e) | 0
  35298. }
  35299. ,
  35300. a.writeVarint32 = function(e, t) {
  35301. var i = "undefined" == typeof t;
  35302. if (i && (t = this.offset),
  35303. !this.noAssert) {
  35304. if ("number" != typeof e || e % 1 !== 0)
  35305. throw TypeError("Illegal value: " + e + " (not an integer)");
  35306. if (e |= 0,
  35307. "number" != typeof t || t % 1 !== 0)
  35308. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35309. if (t >>>= 0,
  35310. t < 0 || t + 0 > this.buffer.byteLength)
  35311. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35312. }
  35313. var n, r = o.calculateVarint32(e);
  35314. t += r;
  35315. var a = this.buffer.byteLength;
  35316. for (t > a && this.resize((a *= 2) > t ? a : t),
  35317. t -= r,
  35318. e >>>= 0; e >= 128; )
  35319. n = 127 & e | 128,
  35320. this.view[t++] = n,
  35321. e >>>= 7;
  35322. return this.view[t++] = e,
  35323. i ? (this.offset = t,
  35324. this) : r
  35325. }
  35326. ,
  35327. a.writeVarint32ZigZag = function(e, t) {
  35328. return this.writeVarint32(o.zigZagEncode32(e), t)
  35329. }
  35330. ,
  35331. a.readVarint32 = function(e) {
  35332. var t = "undefined" == typeof e;
  35333. if (t && (e = this.offset),
  35334. !this.noAssert) {
  35335. if ("number" != typeof e || e % 1 !== 0)
  35336. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35337. if (e >>>= 0,
  35338. e < 0 || e + 1 > this.buffer.byteLength)
  35339. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35340. }
  35341. var i, n = 0, r = 0;
  35342. do {
  35343. if (!this.noAssert && e > this.limit) {
  35344. var o = Error("Truncated");
  35345. throw o.truncated = !0,
  35346. o
  35347. }
  35348. i = this.view[e++],
  35349. n < 5 && (r |= (127 & i) << 7 * n),
  35350. ++n
  35351. } while (0 !== (128 & i));return r |= 0,
  35352. t ? (this.offset = e,
  35353. r) : {
  35354. value: r,
  35355. length: n
  35356. }
  35357. }
  35358. ,
  35359. a.readVarint32ZigZag = function(e) {
  35360. var t = this.readVarint32(e);
  35361. return "object" == typeof t ? t.value = o.zigZagDecode32(t.value) : t = o.zigZagDecode32(t),
  35362. t
  35363. }
  35364. ,
  35365. e && (o.MAX_VARINT64_BYTES = 10,
  35366. o.calculateVarint64 = function(t) {
  35367. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t));
  35368. var i = t.toInt() >>> 0
  35369. , n = t.shiftRightUnsigned(28).toInt() >>> 0
  35370. , r = t.shiftRightUnsigned(56).toInt() >>> 0;
  35371. 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
  35372. }
  35373. ,
  35374. o.zigZagEncode64 = function(t) {
  35375. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  35376. t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()
  35377. }
  35378. ,
  35379. o.zigZagDecode64 = function(t) {
  35380. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  35381. t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()
  35382. }
  35383. ,
  35384. a.writeVarint64 = function(t, i) {
  35385. var n = "undefined" == typeof i;
  35386. if (n && (i = this.offset),
  35387. !this.noAssert) {
  35388. if ("number" == typeof t)
  35389. t = e.fromNumber(t);
  35390. else if ("string" == typeof t)
  35391. t = e.fromString(t);
  35392. else if (!(t && t instanceof e))
  35393. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  35394. if ("number" != typeof i || i % 1 !== 0)
  35395. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35396. if (i >>>= 0,
  35397. i < 0 || i + 0 > this.buffer.byteLength)
  35398. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35399. }
  35400. "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned());
  35401. var r = o.calculateVarint64(t)
  35402. , a = t.toInt() >>> 0
  35403. , s = t.shiftRightUnsigned(28).toInt() >>> 0
  35404. , l = t.shiftRightUnsigned(56).toInt() >>> 0;
  35405. i += r;
  35406. var c = this.buffer.byteLength;
  35407. switch (i > c && this.resize((c *= 2) > i ? c : i),
  35408. i -= r,
  35409. r) {
  35410. case 10:
  35411. this.view[i + 9] = l >>> 7 & 1;
  35412. case 9:
  35413. this.view[i + 8] = 9 !== r ? 128 | l : 127 & l;
  35414. case 8:
  35415. this.view[i + 7] = 8 !== r ? s >>> 21 | 128 : s >>> 21 & 127;
  35416. case 7:
  35417. this.view[i + 6] = 7 !== r ? s >>> 14 | 128 : s >>> 14 & 127;
  35418. case 6:
  35419. this.view[i + 5] = 6 !== r ? s >>> 7 | 128 : s >>> 7 & 127;
  35420. case 5:
  35421. this.view[i + 4] = 5 !== r ? 128 | s : 127 & s;
  35422. case 4:
  35423. this.view[i + 3] = 4 !== r ? a >>> 21 | 128 : a >>> 21 & 127;
  35424. case 3:
  35425. this.view[i + 2] = 3 !== r ? a >>> 14 | 128 : a >>> 14 & 127;
  35426. case 2:
  35427. this.view[i + 1] = 2 !== r ? a >>> 7 | 128 : a >>> 7 & 127;
  35428. case 1:
  35429. this.view[i] = 1 !== r ? 128 | a : 127 & a
  35430. }
  35431. return n ? (this.offset += r,
  35432. this) : r
  35433. }
  35434. ,
  35435. a.writeVarint64ZigZag = function(e, t) {
  35436. return this.writeVarint64(o.zigZagEncode64(e), t)
  35437. }
  35438. ,
  35439. a.readVarint64 = function(t) {
  35440. var i = "undefined" == typeof t;
  35441. if (i && (t = this.offset),
  35442. !this.noAssert) {
  35443. if ("number" != typeof t || t % 1 !== 0)
  35444. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35445. if (t >>>= 0,
  35446. t < 0 || t + 1 > this.buffer.byteLength)
  35447. throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
  35448. }
  35449. var n = t
  35450. , r = 0
  35451. , o = 0
  35452. , a = 0
  35453. , s = 0;
  35454. if (s = this.view[t++],
  35455. r = 127 & s,
  35456. 128 & s && (s = this.view[t++],
  35457. r |= (127 & s) << 7,
  35458. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35459. r |= (127 & s) << 14,
  35460. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35461. r |= (127 & s) << 21,
  35462. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35463. o = 127 & s,
  35464. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35465. o |= (127 & s) << 7,
  35466. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35467. o |= (127 & s) << 14,
  35468. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35469. o |= (127 & s) << 21,
  35470. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35471. a = 127 & s,
  35472. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35473. a |= (127 & s) << 7,
  35474. 128 & s || this.noAssert && "undefined" == typeof s))))))))))
  35475. throw Error("Buffer overrun");
  35476. var l = e.fromBits(r | o << 28, o >>> 4 | a << 24, !1);
  35477. return i ? (this.offset = t,
  35478. l) : {
  35479. value: l,
  35480. length: t - n
  35481. }
  35482. }
  35483. ,
  35484. a.readVarint64ZigZag = function(t) {
  35485. var i = this.readVarint64(t);
  35486. return i && i.value instanceof e ? i.value = o.zigZagDecode64(i.value) : i = o.zigZagDecode64(i),
  35487. i
  35488. }
  35489. ),
  35490. a.writeCString = function(e, i) {
  35491. var n = "undefined" == typeof i;
  35492. n && (i = this.offset);
  35493. var r, o = e.length;
  35494. if (!this.noAssert) {
  35495. if ("string" != typeof e)
  35496. throw TypeError("Illegal str: Not a string");
  35497. for (r = 0; r < o; ++r)
  35498. if (0 === e.charCodeAt(r))
  35499. throw RangeError("Illegal str: Contains NULL-characters");
  35500. if ("number" != typeof i || i % 1 !== 0)
  35501. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35502. if (i >>>= 0,
  35503. i < 0 || i + 0 > this.buffer.byteLength)
  35504. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35505. }
  35506. o = h.calculateUTF16asUTF8(t(e))[1],
  35507. i += o + 1;
  35508. var a = this.buffer.byteLength;
  35509. return i > a && this.resize((a *= 2) > i ? a : i),
  35510. i -= o + 1,
  35511. h.encodeUTF16toUTF8(t(e), function(e) {
  35512. this.view[i++] = e
  35513. }
  35514. .bind(this)),
  35515. this.view[i++] = 0,
  35516. n ? (this.offset = i,
  35517. this) : o
  35518. }
  35519. ,
  35520. a.readCString = function(e) {
  35521. var t = "undefined" == typeof e;
  35522. if (t && (e = this.offset),
  35523. !this.noAssert) {
  35524. if ("number" != typeof e || e % 1 !== 0)
  35525. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35526. if (e >>>= 0,
  35527. e < 0 || e + 1 > this.buffer.byteLength)
  35528. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35529. }
  35530. var n, r = e, o = -1;
  35531. return h.decodeUTF8toUTF16(function() {
  35532. if (0 === o)
  35533. return null;
  35534. if (e >= this.limit)
  35535. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  35536. return o = this.view[e++],
  35537. 0 === o ? null : o
  35538. }
  35539. .bind(this), n = i(), !0),
  35540. t ? (this.offset = e,
  35541. n()) : {
  35542. string: n(),
  35543. length: e - r
  35544. }
  35545. }
  35546. ,
  35547. a.writeIString = function(e, i) {
  35548. var n = "undefined" == typeof i;
  35549. if (n && (i = this.offset),
  35550. !this.noAssert) {
  35551. if ("string" != typeof e)
  35552. throw TypeError("Illegal str: Not a string");
  35553. if ("number" != typeof i || i % 1 !== 0)
  35554. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35555. if (i >>>= 0,
  35556. i < 0 || i + 0 > this.buffer.byteLength)
  35557. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35558. }
  35559. var r, o = i;
  35560. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  35561. i += 4 + r;
  35562. var a = this.buffer.byteLength;
  35563. if (i > a && this.resize((a *= 2) > i ? a : i),
  35564. i -= 4 + r,
  35565. this.littleEndian ? (this.view[i + 3] = r >>> 24 & 255,
  35566. this.view[i + 2] = r >>> 16 & 255,
  35567. this.view[i + 1] = r >>> 8 & 255,
  35568. this.view[i] = 255 & r) : (this.view[i] = r >>> 24 & 255,
  35569. this.view[i + 1] = r >>> 16 & 255,
  35570. this.view[i + 2] = r >>> 8 & 255,
  35571. this.view[i + 3] = 255 & r),
  35572. i += 4,
  35573. h.encodeUTF16toUTF8(t(e), function(e) {
  35574. this.view[i++] = e
  35575. }
  35576. .bind(this)),
  35577. i !== o + 4 + r)
  35578. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + 4 + r));
  35579. return n ? (this.offset = i,
  35580. this) : i - o
  35581. }
  35582. ,
  35583. a.readIString = function(e) {
  35584. var t = "undefined" == typeof e;
  35585. if (t && (e = this.offset),
  35586. !this.noAssert) {
  35587. if ("number" != typeof e || e % 1 !== 0)
  35588. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35589. if (e >>>= 0,
  35590. e < 0 || e + 4 > this.buffer.byteLength)
  35591. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35592. }
  35593. var i = e
  35594. , n = this.readUint32(e)
  35595. , r = this.readUTF8String(n, o.METRICS_BYTES, e += 4);
  35596. return e += r.length,
  35597. t ? (this.offset = e,
  35598. r.string) : {
  35599. string: r.string,
  35600. length: e - i
  35601. }
  35602. }
  35603. ,
  35604. o.METRICS_CHARS = "c",
  35605. o.METRICS_BYTES = "b",
  35606. a.writeUTF8String = function(e, i) {
  35607. var n = "undefined" == typeof i;
  35608. if (n && (i = this.offset),
  35609. !this.noAssert) {
  35610. if ("number" != typeof i || i % 1 !== 0)
  35611. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35612. if (i >>>= 0,
  35613. i < 0 || i + 0 > this.buffer.byteLength)
  35614. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35615. }
  35616. var r, o = i;
  35617. r = h.calculateUTF16asUTF8(t(e))[1],
  35618. i += r;
  35619. var a = this.buffer.byteLength;
  35620. return i > a && this.resize((a *= 2) > i ? a : i),
  35621. i -= r,
  35622. h.encodeUTF16toUTF8(t(e), function(e) {
  35623. this.view[i++] = e
  35624. }
  35625. .bind(this)),
  35626. n ? (this.offset = i,
  35627. this) : i - o
  35628. }
  35629. ,
  35630. a.writeString = a.writeUTF8String,
  35631. o.calculateUTF8Chars = function(e) {
  35632. return h.calculateUTF16asUTF8(t(e))[0]
  35633. }
  35634. ,
  35635. o.calculateUTF8Bytes = function(e) {
  35636. return h.calculateUTF16asUTF8(t(e))[1]
  35637. }
  35638. ,
  35639. o.calculateString = o.calculateUTF8Bytes,
  35640. a.readUTF8String = function(e, t, n) {
  35641. "number" == typeof t && (n = t,
  35642. t = void 0);
  35643. var r = "undefined" == typeof n;
  35644. if (r && (n = this.offset),
  35645. "undefined" == typeof t && (t = o.METRICS_CHARS),
  35646. !this.noAssert) {
  35647. if ("number" != typeof e || e % 1 !== 0)
  35648. throw TypeError("Illegal length: " + e + " (not an integer)");
  35649. if (e |= 0,
  35650. "number" != typeof n || n % 1 !== 0)
  35651. throw TypeError("Illegal offset: " + n + " (not an integer)");
  35652. if (n >>>= 0,
  35653. n < 0 || n + 0 > this.buffer.byteLength)
  35654. throw RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
  35655. }
  35656. var a, s = 0, l = n;
  35657. if (t === o.METRICS_CHARS) {
  35658. if (a = i(),
  35659. h.decodeUTF8(function() {
  35660. return s < e && n < this.limit ? this.view[n++] : null
  35661. }
  35662. .bind(this), function(e) {
  35663. ++s,
  35664. h.UTF8toUTF16(e, a)
  35665. }),
  35666. s !== e)
  35667. throw RangeError("Illegal range: Truncated data, " + s + " == " + e);
  35668. return r ? (this.offset = n,
  35669. a()) : {
  35670. string: a(),
  35671. length: n - l
  35672. }
  35673. }
  35674. if (t === o.METRICS_BYTES) {
  35675. if (!this.noAssert) {
  35676. if ("number" != typeof n || n % 1 !== 0)
  35677. throw TypeError("Illegal offset: " + n + " (not an integer)");
  35678. if (n >>>= 0,
  35679. n < 0 || n + e > this.buffer.byteLength)
  35680. throw RangeError("Illegal offset: 0 <= " + n + " (+" + e + ") <= " + this.buffer.byteLength)
  35681. }
  35682. var c = n + e;
  35683. if (h.decodeUTF8toUTF16(function() {
  35684. return n < c ? this.view[n++] : null
  35685. }
  35686. .bind(this), a = i(), this.noAssert),
  35687. n !== c)
  35688. throw RangeError("Illegal range: Truncated data, " + n + " == " + c);
  35689. return r ? (this.offset = n,
  35690. a()) : {
  35691. string: a(),
  35692. length: n - l
  35693. }
  35694. }
  35695. throw TypeError("Unsupported metrics: " + t)
  35696. }
  35697. ,
  35698. a.readString = a.readUTF8String,
  35699. a.writeVString = function(e, i) {
  35700. var n = "undefined" == typeof i;
  35701. if (n && (i = this.offset),
  35702. !this.noAssert) {
  35703. if ("string" != typeof e)
  35704. throw TypeError("Illegal str: Not a string");
  35705. if ("number" != typeof i || i % 1 !== 0)
  35706. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35707. if (i >>>= 0,
  35708. i < 0 || i + 0 > this.buffer.byteLength)
  35709. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35710. }
  35711. var r, a, s = i;
  35712. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  35713. a = o.calculateVarint32(r),
  35714. i += a + r;
  35715. var l = this.buffer.byteLength;
  35716. if (i > l && this.resize((l *= 2) > i ? l : i),
  35717. i -= a + r,
  35718. i += this.writeVarint32(r, i),
  35719. h.encodeUTF16toUTF8(t(e), function(e) {
  35720. this.view[i++] = e
  35721. }
  35722. .bind(this)),
  35723. i !== s + r + a)
  35724. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + r + a));
  35725. return n ? (this.offset = i,
  35726. this) : i - s
  35727. }
  35728. ,
  35729. a.readVString = function(e) {
  35730. var t = "undefined" == typeof e;
  35731. if (t && (e = this.offset),
  35732. !this.noAssert) {
  35733. if ("number" != typeof e || e % 1 !== 0)
  35734. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35735. if (e >>>= 0,
  35736. e < 0 || e + 1 > this.buffer.byteLength)
  35737. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35738. }
  35739. var i = e
  35740. , n = this.readVarint32(e)
  35741. , r = this.readUTF8String(n.value, o.METRICS_BYTES, e += n.length);
  35742. return e += r.length,
  35743. t ? (this.offset = e,
  35744. r.string) : {
  35745. string: r.string,
  35746. length: e - i
  35747. }
  35748. }
  35749. ,
  35750. a.append = function(e, t, i) {
  35751. "number" != typeof t && "string" == typeof t || (i = t,
  35752. t = void 0);
  35753. var n = "undefined" == typeof i;
  35754. if (n && (i = this.offset),
  35755. !this.noAssert) {
  35756. if ("number" != typeof i || i % 1 !== 0)
  35757. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35758. if (i >>>= 0,
  35759. i < 0 || i + 0 > this.buffer.byteLength)
  35760. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35761. }
  35762. e instanceof o || (e = o.wrap(e, t));
  35763. var r = e.limit - e.offset;
  35764. if (r <= 0)
  35765. return this;
  35766. i += r;
  35767. var a = this.buffer.byteLength;
  35768. return i > a && this.resize((a *= 2) > i ? a : i),
  35769. i -= r,
  35770. this.view.set(e.view.subarray(e.offset, e.limit), i),
  35771. e.offset += r,
  35772. n && (this.offset += r),
  35773. this
  35774. }
  35775. ,
  35776. a.appendTo = function(e, t) {
  35777. return e.append(this, t),
  35778. this
  35779. }
  35780. ,
  35781. a.assert = function(e) {
  35782. return this.noAssert = !e,
  35783. this
  35784. }
  35785. ,
  35786. a.capacity = function() {
  35787. return this.buffer.byteLength
  35788. }
  35789. ,
  35790. a.clear = function() {
  35791. return this.offset = 0,
  35792. this.limit = this.buffer.byteLength,
  35793. this.markedOffset = -1,
  35794. this
  35795. }
  35796. ,
  35797. a.clone = function(e) {
  35798. var t = new o(0,this.littleEndian,this.noAssert);
  35799. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  35800. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  35801. t.view = this.view),
  35802. t.offset = this.offset,
  35803. t.markedOffset = this.markedOffset,
  35804. t.limit = this.limit,
  35805. t
  35806. }
  35807. ,
  35808. a.compact = function(e, t) {
  35809. if ("undefined" == typeof e && (e = this.offset),
  35810. "undefined" == typeof t && (t = this.limit),
  35811. !this.noAssert) {
  35812. if ("number" != typeof e || e % 1 !== 0)
  35813. throw TypeError("Illegal begin: Not an integer");
  35814. if (e >>>= 0,
  35815. "number" != typeof t || t % 1 !== 0)
  35816. throw TypeError("Illegal end: Not an integer");
  35817. if (t >>>= 0,
  35818. e < 0 || e > t || t > this.buffer.byteLength)
  35819. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35820. }
  35821. if (0 === e && t === this.buffer.byteLength)
  35822. return this;
  35823. var i = t - e;
  35824. if (0 === i)
  35825. return this.buffer = s,
  35826. this.view = null,
  35827. this.markedOffset >= 0 && (this.markedOffset -= e),
  35828. this.offset = 0,
  35829. this.limit = 0,
  35830. this;
  35831. var n = new ArrayBuffer(i)
  35832. , r = new Uint8Array(n);
  35833. return r.set(this.view.subarray(e, t)),
  35834. this.buffer = n,
  35835. this.view = r,
  35836. this.markedOffset >= 0 && (this.markedOffset -= e),
  35837. this.offset = 0,
  35838. this.limit = i,
  35839. this
  35840. }
  35841. ,
  35842. a.copy = function(e, t) {
  35843. if ("undefined" == typeof e && (e = this.offset),
  35844. "undefined" == typeof t && (t = this.limit),
  35845. !this.noAssert) {
  35846. if ("number" != typeof e || e % 1 !== 0)
  35847. throw TypeError("Illegal begin: Not an integer");
  35848. if (e >>>= 0,
  35849. "number" != typeof t || t % 1 !== 0)
  35850. throw TypeError("Illegal end: Not an integer");
  35851. if (t >>>= 0,
  35852. e < 0 || e > t || t > this.buffer.byteLength)
  35853. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35854. }
  35855. if (e === t)
  35856. return new o(0,this.littleEndian,this.noAssert);
  35857. var i = t - e
  35858. , n = new o(i,this.littleEndian,this.noAssert);
  35859. return n.offset = 0,
  35860. n.limit = i,
  35861. n.markedOffset >= 0 && (n.markedOffset -= e),
  35862. this.copyTo(n, 0, e, t),
  35863. n
  35864. }
  35865. ,
  35866. a.copyTo = function(e, t, i, n) {
  35867. var r, a;
  35868. if (!this.noAssert && !o.isByteBuffer(e))
  35869. throw TypeError("Illegal target: Not a ByteBuffer");
  35870. if (t = (a = "undefined" == typeof t) ? e.offset : 0 | t,
  35871. i = (r = "undefined" == typeof i) ? this.offset : 0 | i,
  35872. n = "undefined" == typeof n ? this.limit : 0 | n,
  35873. t < 0 || t > e.buffer.byteLength)
  35874. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  35875. if (i < 0 || n > this.buffer.byteLength)
  35876. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  35877. var s = n - i;
  35878. return 0 === s ? e : (e.ensureCapacity(t + s),
  35879. e.view.set(this.view.subarray(i, n), t),
  35880. r && (this.offset += s),
  35881. a && (e.offset += s),
  35882. this)
  35883. }
  35884. ,
  35885. a.ensureCapacity = function(e) {
  35886. var t = this.buffer.byteLength;
  35887. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  35888. }
  35889. ,
  35890. a.fill = function(e, t, i) {
  35891. var n = "undefined" == typeof t;
  35892. if (n && (t = this.offset),
  35893. "string" == typeof e && e.length > 0 && (e = e.charCodeAt(0)),
  35894. "undefined" == typeof t && (t = this.offset),
  35895. "undefined" == typeof i && (i = this.limit),
  35896. !this.noAssert) {
  35897. if ("number" != typeof e || e % 1 !== 0)
  35898. throw TypeError("Illegal value: " + e + " (not an integer)");
  35899. if (e |= 0,
  35900. "number" != typeof t || t % 1 !== 0)
  35901. throw TypeError("Illegal begin: Not an integer");
  35902. if (t >>>= 0,
  35903. "number" != typeof i || i % 1 !== 0)
  35904. throw TypeError("Illegal end: Not an integer");
  35905. if (i >>>= 0,
  35906. t < 0 || t > i || i > this.buffer.byteLength)
  35907. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35908. }
  35909. if (t >= i)
  35910. return this;
  35911. for (; t < i; )
  35912. this.view[t++] = e;
  35913. return n && (this.offset = t),
  35914. this
  35915. }
  35916. ,
  35917. a.flip = function() {
  35918. return this.limit = this.offset,
  35919. this.offset = 0,
  35920. this
  35921. }
  35922. ,
  35923. a.mark = function(e) {
  35924. if (e = "undefined" == typeof e ? this.offset : e,
  35925. !this.noAssert) {
  35926. if ("number" != typeof e || e % 1 !== 0)
  35927. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35928. if (e >>>= 0,
  35929. e < 0 || e + 0 > this.buffer.byteLength)
  35930. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  35931. }
  35932. return this.markedOffset = e,
  35933. this
  35934. }
  35935. ,
  35936. a.order = function(e) {
  35937. if (!this.noAssert && "boolean" != typeof e)
  35938. throw TypeError("Illegal littleEndian: Not a boolean");
  35939. return this.littleEndian = !!e,
  35940. this
  35941. }
  35942. ,
  35943. a.LE = function(e) {
  35944. return this.littleEndian = "undefined" == typeof e || !!e,
  35945. this
  35946. }
  35947. ,
  35948. a.BE = function(e) {
  35949. return this.littleEndian = "undefined" != typeof e && !e,
  35950. this
  35951. }
  35952. ,
  35953. a.prepend = function(e, t, i) {
  35954. "number" != typeof t && "string" == typeof t || (i = t,
  35955. t = void 0);
  35956. var n = "undefined" == typeof i;
  35957. if (n && (i = this.offset),
  35958. !this.noAssert) {
  35959. if ("number" != typeof i || i % 1 !== 0)
  35960. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35961. if (i >>>= 0,
  35962. i < 0 || i + 0 > this.buffer.byteLength)
  35963. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35964. }
  35965. e instanceof o || (e = o.wrap(e, t));
  35966. var r = e.limit - e.offset;
  35967. if (r <= 0)
  35968. return this;
  35969. var a = r - i;
  35970. if (a > 0) {
  35971. var s = new ArrayBuffer(this.buffer.byteLength + a)
  35972. , l = new Uint8Array(s);
  35973. l.set(this.view.subarray(i, this.buffer.byteLength), r),
  35974. this.buffer = s,
  35975. this.view = l,
  35976. this.offset += a,
  35977. this.markedOffset >= 0 && (this.markedOffset += a),
  35978. this.limit += a,
  35979. i += a
  35980. } else {
  35981. new Uint8Array(this.buffer)
  35982. }
  35983. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  35984. e.offset = e.limit,
  35985. n && (this.offset -= r),
  35986. this
  35987. }
  35988. ,
  35989. a.prependTo = function(e, t) {
  35990. return e.prepend(this, t),
  35991. this
  35992. }
  35993. ,
  35994. a.printDebug = function(e) {
  35995. "function" != typeof e && (e = console.log.bind(console)),
  35996. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  35997. }
  35998. ,
  35999. a.remaining = function() {
  36000. return this.limit - this.offset
  36001. }
  36002. ,
  36003. a.reset = function() {
  36004. return this.markedOffset >= 0 ? (this.offset = this.markedOffset,
  36005. this.markedOffset = -1) : this.offset = 0,
  36006. this
  36007. }
  36008. ,
  36009. a.resize = function(e) {
  36010. if (!this.noAssert) {
  36011. if ("number" != typeof e || e % 1 !== 0)
  36012. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  36013. if (e |= 0,
  36014. e < 0)
  36015. throw RangeError("Illegal capacity: 0 <= " + e)
  36016. }
  36017. if (this.buffer.byteLength < e) {
  36018. var t = new ArrayBuffer(e)
  36019. , i = new Uint8Array(t);
  36020. i.set(this.view),
  36021. this.buffer = t,
  36022. this.view = i
  36023. }
  36024. return this
  36025. }
  36026. ,
  36027. a.reverse = function(e, t) {
  36028. if ("undefined" == typeof e && (e = this.offset),
  36029. "undefined" == typeof t && (t = this.limit),
  36030. !this.noAssert) {
  36031. if ("number" != typeof e || e % 1 !== 0)
  36032. throw TypeError("Illegal begin: Not an integer");
  36033. if (e >>>= 0,
  36034. "number" != typeof t || t % 1 !== 0)
  36035. throw TypeError("Illegal end: Not an integer");
  36036. if (t >>>= 0,
  36037. e < 0 || e > t || t > this.buffer.byteLength)
  36038. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36039. }
  36040. return e === t ? this : (Array.prototype.reverse.call(this.view.subarray(e, t)),
  36041. this)
  36042. }
  36043. ,
  36044. a.skip = function(e) {
  36045. if (!this.noAssert) {
  36046. if ("number" != typeof e || e % 1 !== 0)
  36047. throw TypeError("Illegal length: " + e + " (not an integer)");
  36048. e |= 0
  36049. }
  36050. var t = this.offset + e;
  36051. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  36052. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  36053. return this.offset = t,
  36054. this
  36055. }
  36056. ,
  36057. a.slice = function(e, t) {
  36058. if ("undefined" == typeof e && (e = this.offset),
  36059. "undefined" == typeof t && (t = this.limit),
  36060. !this.noAssert) {
  36061. if ("number" != typeof e || e % 1 !== 0)
  36062. throw TypeError("Illegal begin: Not an integer");
  36063. if (e >>>= 0,
  36064. "number" != typeof t || t % 1 !== 0)
  36065. throw TypeError("Illegal end: Not an integer");
  36066. if (t >>>= 0,
  36067. e < 0 || e > t || t > this.buffer.byteLength)
  36068. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36069. }
  36070. var i = this.clone();
  36071. return i.offset = e,
  36072. i.limit = t,
  36073. i
  36074. }
  36075. ,
  36076. a.toBuffer = function(e) {
  36077. var t = this.offset
  36078. , i = this.limit;
  36079. if (!this.noAssert) {
  36080. if ("number" != typeof t || t % 1 !== 0)
  36081. throw TypeError("Illegal offset: Not an integer");
  36082. if (t >>>= 0,
  36083. "number" != typeof i || i % 1 !== 0)
  36084. throw TypeError("Illegal limit: Not an integer");
  36085. if (i >>>= 0,
  36086. t < 0 || t > i || i > this.buffer.byteLength)
  36087. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36088. }
  36089. if (!e && 0 === t && i === this.buffer.byteLength)
  36090. return this.buffer;
  36091. if (t === i)
  36092. return s;
  36093. var n = new ArrayBuffer(i - t);
  36094. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  36095. n
  36096. }
  36097. ,
  36098. a.toArrayBuffer = a.toBuffer,
  36099. a.toString = function(e, t, i) {
  36100. if ("undefined" == typeof e)
  36101. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  36102. switch ("number" == typeof e && (e = "utf8",
  36103. t = e,
  36104. i = t),
  36105. e) {
  36106. case "utf8":
  36107. return this.toUTF8(t, i);
  36108. case "base64":
  36109. return this.toBase64(t, i);
  36110. case "hex":
  36111. return this.toHex(t, i);
  36112. case "binary":
  36113. return this.toBinary(t, i);
  36114. case "debug":
  36115. return this.toDebug();
  36116. case "columns":
  36117. return this.toColumns();
  36118. default:
  36119. throw Error("Unsupported encoding: " + e)
  36120. }
  36121. }
  36122. ;
  36123. var c = function() {
  36124. 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)
  36125. i[t[n]] = n;
  36126. return e.encode = function(e, i) {
  36127. for (var n, r; null !== (n = e()); )
  36128. i(t[n >> 2 & 63]),
  36129. r = (3 & n) << 4,
  36130. null !== (n = e()) ? (r |= n >> 4 & 15,
  36131. i(t[63 & (r | n >> 4 & 15)]),
  36132. r = (15 & n) << 2,
  36133. null !== (n = e()) ? (i(t[63 & (r | n >> 6 & 3)]),
  36134. i(t[63 & n])) : (i(t[63 & r]),
  36135. i(61))) : (i(t[63 & r]),
  36136. i(61),
  36137. i(61))
  36138. }
  36139. ,
  36140. e.decode = function(e, t) {
  36141. function n(e) {
  36142. throw Error("Illegal character code: " + e)
  36143. }
  36144. for (var r, o, a; null !== (r = e()); )
  36145. if (o = i[r],
  36146. "undefined" == typeof o && n(r),
  36147. null !== (r = e()) && (a = i[r],
  36148. "undefined" == typeof a && n(r),
  36149. t(o << 2 >>> 0 | (48 & a) >> 4),
  36150. null !== (r = e()))) {
  36151. if (o = i[r],
  36152. "undefined" == typeof o) {
  36153. if (61 === r)
  36154. break;
  36155. n(r)
  36156. }
  36157. if (t((15 & a) << 4 >>> 0 | (60 & o) >> 2),
  36158. null !== (r = e())) {
  36159. if (a = i[r],
  36160. "undefined" == typeof a) {
  36161. if (61 === r)
  36162. break;
  36163. n(r)
  36164. }
  36165. t((3 & o) << 6 >>> 0 | a)
  36166. }
  36167. }
  36168. }
  36169. ,
  36170. e.test = function(e) {
  36171. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  36172. }
  36173. ,
  36174. e
  36175. }();
  36176. a.toBase64 = function(e, t) {
  36177. if ("undefined" == typeof e && (e = this.offset),
  36178. "undefined" == typeof t && (t = this.limit),
  36179. e |= 0,
  36180. t |= 0,
  36181. e < 0 || t > this.capacity || e > t)
  36182. throw RangeError("begin, end");
  36183. var n;
  36184. return c.encode(function() {
  36185. return e < t ? this.view[e++] : null
  36186. }
  36187. .bind(this), n = i()),
  36188. n()
  36189. }
  36190. ,
  36191. o.fromBase64 = function(e, i) {
  36192. if ("string" != typeof e)
  36193. throw TypeError("str");
  36194. var n = new o(e.length / 4 * 3,i)
  36195. , r = 0;
  36196. return c.decode(t(e), function(e) {
  36197. n.view[r++] = e
  36198. }),
  36199. n.limit = r,
  36200. n
  36201. }
  36202. ,
  36203. o.btoa = function(e) {
  36204. return o.fromBinary(e).toBase64()
  36205. }
  36206. ,
  36207. o.atob = function(e) {
  36208. return o.fromBase64(e).toBinary()
  36209. }
  36210. ,
  36211. a.toBinary = function(e, t) {
  36212. if ("undefined" == typeof e && (e = this.offset),
  36213. "undefined" == typeof t && (t = this.limit),
  36214. e |= 0,
  36215. t |= 0,
  36216. e < 0 || t > this.capacity() || e > t)
  36217. throw RangeError("begin, end");
  36218. if (e === t)
  36219. return "";
  36220. for (var i = [], n = []; e < t; )
  36221. i.push(this.view[e++]),
  36222. i.length >= 1024 && (n.push(String.fromCharCode.apply(String, i)),
  36223. i = []);
  36224. return n.join("") + String.fromCharCode.apply(String, i)
  36225. }
  36226. ,
  36227. o.fromBinary = function(e, t) {
  36228. if ("string" != typeof e)
  36229. throw TypeError("str");
  36230. for (var i, n = 0, r = e.length, a = new o(r,t); n < r; ) {
  36231. if (i = e.charCodeAt(n),
  36232. i > 255)
  36233. throw RangeError("illegal char code: " + i);
  36234. a.view[n++] = i
  36235. }
  36236. return a.limit = r,
  36237. a
  36238. }
  36239. ,
  36240. a.toDebug = function(e) {
  36241. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  36242. if (i !== -1 && (t = this.view[i],
  36243. r += t < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  36244. e && (o += t > 32 && t < 127 ? String.fromCharCode(t) : ".")),
  36245. ++i,
  36246. e && i > 0 && i % 16 === 0 && i !== n) {
  36247. for (; r.length < 51; )
  36248. r += " ";
  36249. a += r + o + "\n",
  36250. r = o = ""
  36251. }
  36252. 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 ? " " : ""
  36253. }
  36254. if (e && " " !== r) {
  36255. for (; r.length < 51; )
  36256. r += " ";
  36257. a += r + o + "\n"
  36258. }
  36259. return e ? a : r
  36260. }
  36261. ,
  36262. o.fromDebug = function(e, t, i) {
  36263. 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; ) {
  36264. switch (n = e.charAt(l++)) {
  36265. case "!":
  36266. if (!i) {
  36267. if (u || d || p) {
  36268. f = !0;
  36269. break
  36270. }
  36271. u = d = p = !0
  36272. }
  36273. s.offset = s.markedOffset = s.limit = c,
  36274. h = !1;
  36275. break;
  36276. case "|":
  36277. if (!i) {
  36278. if (u || p) {
  36279. f = !0;
  36280. break
  36281. }
  36282. u = p = !0
  36283. }
  36284. s.offset = s.limit = c,
  36285. h = !1;
  36286. break;
  36287. case "[":
  36288. if (!i) {
  36289. if (u || d) {
  36290. f = !0;
  36291. break
  36292. }
  36293. u = d = !0
  36294. }
  36295. s.offset = s.markedOffset = c,
  36296. h = !1;
  36297. break;
  36298. case "<":
  36299. if (!i) {
  36300. if (u) {
  36301. f = !0;
  36302. break
  36303. }
  36304. u = !0
  36305. }
  36306. s.offset = c,
  36307. h = !1;
  36308. break;
  36309. case "]":
  36310. if (!i) {
  36311. if (p || d) {
  36312. f = !0;
  36313. break
  36314. }
  36315. p = d = !0
  36316. }
  36317. s.limit = s.markedOffset = c,
  36318. h = !1;
  36319. break;
  36320. case ">":
  36321. if (!i) {
  36322. if (p) {
  36323. f = !0;
  36324. break
  36325. }
  36326. p = !0
  36327. }
  36328. s.limit = c,
  36329. h = !1;
  36330. break;
  36331. case "'":
  36332. if (!i) {
  36333. if (d) {
  36334. f = !0;
  36335. break
  36336. }
  36337. d = !0
  36338. }
  36339. s.markedOffset = c,
  36340. h = !1;
  36341. break;
  36342. case " ":
  36343. h = !1;
  36344. break;
  36345. default:
  36346. if (!i && h) {
  36347. f = !0;
  36348. break
  36349. }
  36350. if (r = parseInt(n + e.charAt(l++), 16),
  36351. !i && (isNaN(r) || r < 0 || r > 255))
  36352. throw TypeError("Illegal str: Not a debug encoded string");
  36353. s.view[c++] = r,
  36354. h = !0
  36355. }
  36356. if (f)
  36357. throw TypeError("Illegal str: Invalid symbol at " + l)
  36358. }
  36359. if (!i) {
  36360. if (!u || !p)
  36361. throw TypeError("Illegal str: Missing offset or limit");
  36362. if (c < s.buffer.byteLength)
  36363. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + c + " < " + a)
  36364. }
  36365. return s
  36366. }
  36367. ,
  36368. a.toHex = function(e, t) {
  36369. if (e = "undefined" == typeof e ? this.offset : e,
  36370. t = "undefined" == typeof t ? this.limit : t,
  36371. !this.noAssert) {
  36372. if ("number" != typeof e || e % 1 !== 0)
  36373. throw TypeError("Illegal begin: Not an integer");
  36374. if (e >>>= 0,
  36375. "number" != typeof t || t % 1 !== 0)
  36376. throw TypeError("Illegal end: Not an integer");
  36377. if (t >>>= 0,
  36378. e < 0 || e > t || t > this.buffer.byteLength)
  36379. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36380. }
  36381. for (var i, n = new Array(t - e); e < t; )
  36382. i = this.view[e++],
  36383. i < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  36384. return n.join("")
  36385. }
  36386. ,
  36387. o.fromHex = function(e, t, i) {
  36388. if (!i) {
  36389. if ("string" != typeof e)
  36390. throw TypeError("Illegal str: Not a string");
  36391. if (e.length % 2 !== 0)
  36392. throw TypeError("Illegal str: Length not a multiple of 2")
  36393. }
  36394. for (var n, r = e.length, a = new o(r / 2 | 0,t), s = 0, l = 0; s < r; s += 2) {
  36395. if (n = parseInt(e.substring(s, s + 2), 16),
  36396. !i && (!isFinite(n) || n < 0 || n > 255))
  36397. throw TypeError("Illegal str: Contains non-hex characters");
  36398. a.view[l++] = n
  36399. }
  36400. return a.limit = l,
  36401. a
  36402. }
  36403. ;
  36404. var h = function() {
  36405. var e = {};
  36406. return e.MAX_CODEPOINT = 1114111,
  36407. e.encodeUTF8 = function(e, t) {
  36408. var i = null;
  36409. for ("number" == typeof e && (i = e,
  36410. e = function() {
  36411. return null
  36412. }
  36413. ); null !== i || null !== (i = e()); )
  36414. i < 128 ? t(127 & i) : i < 2048 ? (t(i >> 6 & 31 | 192),
  36415. t(63 & i | 128)) : i < 65536 ? (t(i >> 12 & 15 | 224),
  36416. t(i >> 6 & 63 | 128),
  36417. t(63 & i | 128)) : (t(i >> 18 & 7 | 240),
  36418. t(i >> 12 & 63 | 128),
  36419. t(i >> 6 & 63 | 128),
  36420. t(63 & i | 128)),
  36421. i = null
  36422. }
  36423. ,
  36424. e.decodeUTF8 = function(e, t) {
  36425. for (var i, n, r, o, a = function(e) {
  36426. e = e.slice(0, e.indexOf(null));
  36427. var t = Error(e.toString());
  36428. throw t.name = "TruncatedError",
  36429. t.bytes = e,
  36430. t
  36431. }; null !== (i = e()); )
  36432. if (0 === (128 & i))
  36433. t(i);
  36434. else if (192 === (224 & i))
  36435. null === (n = e()) && a([i, n]),
  36436. t((31 & i) << 6 | 63 & n);
  36437. else if (224 === (240 & i))
  36438. (null === (n = e()) || null === (r = e())) && a([i, n, r]),
  36439. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  36440. else {
  36441. if (240 !== (248 & i))
  36442. throw RangeError("Illegal starting byte: " + i);
  36443. (null === (n = e()) || null === (r = e()) || null === (o = e())) && a([i, n, r, o]),
  36444. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  36445. }
  36446. }
  36447. ,
  36448. e.UTF16toUTF8 = function(e, t) {
  36449. for (var i, n = null; ; ) {
  36450. if (null === (i = null !== n ? n : e()))
  36451. break;
  36452. i >= 55296 && i <= 57343 && null !== (n = e()) && n >= 56320 && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  36453. n = null) : t(i)
  36454. }
  36455. null !== n && t(n)
  36456. }
  36457. ,
  36458. e.UTF8toUTF16 = function(e, t) {
  36459. var i = null;
  36460. for ("number" == typeof e && (i = e,
  36461. e = function() {
  36462. return null
  36463. }
  36464. ); null !== i || null !== (i = e()); )
  36465. i <= 65535 ? t(i) : (i -= 65536,
  36466. t((i >> 10) + 55296),
  36467. t(i % 1024 + 56320)),
  36468. i = null
  36469. }
  36470. ,
  36471. e.encodeUTF16toUTF8 = function(t, i) {
  36472. e.UTF16toUTF8(t, function(t) {
  36473. e.encodeUTF8(t, i)
  36474. })
  36475. }
  36476. ,
  36477. e.decodeUTF8toUTF16 = function(t, i) {
  36478. e.decodeUTF8(t, function(t) {
  36479. e.UTF8toUTF16(t, i)
  36480. })
  36481. }
  36482. ,
  36483. e.calculateCodePoint = function(e) {
  36484. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36485. }
  36486. ,
  36487. e.calculateUTF8 = function(e) {
  36488. for (var t, i = 0; null !== (t = e()); )
  36489. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  36490. return i
  36491. }
  36492. ,
  36493. e.calculateUTF16asUTF8 = function(t) {
  36494. var i = 0
  36495. , n = 0;
  36496. return e.UTF16toUTF8(t, function(e) {
  36497. ++i,
  36498. n += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36499. }),
  36500. [i, n]
  36501. }
  36502. ,
  36503. e
  36504. }();
  36505. return a.toUTF8 = function(e, t) {
  36506. if ("undefined" == typeof e && (e = this.offset),
  36507. "undefined" == typeof t && (t = this.limit),
  36508. !this.noAssert) {
  36509. if ("number" != typeof e || e % 1 !== 0)
  36510. throw TypeError("Illegal begin: Not an integer");
  36511. if (e >>>= 0,
  36512. "number" != typeof t || t % 1 !== 0)
  36513. throw TypeError("Illegal end: Not an integer");
  36514. if (t >>>= 0,
  36515. e < 0 || e > t || t > this.buffer.byteLength)
  36516. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36517. }
  36518. var n;
  36519. try {
  36520. h.decodeUTF8toUTF16(function() {
  36521. return e < t ? this.view[e++] : null
  36522. }
  36523. .bind(this), n = i())
  36524. } catch (i) {
  36525. if (e !== t)
  36526. throw RangeError("Illegal range: Truncated data, " + e + " != " + t)
  36527. }
  36528. return n()
  36529. }
  36530. ,
  36531. o.fromUTF8 = function(e, i, n) {
  36532. if (!n && "string" != typeof e)
  36533. throw TypeError("Illegal str: Not a string");
  36534. var r = new o(h.calculateUTF16asUTF8(t(e), !0)[1],i,n)
  36535. , a = 0;
  36536. return h.encodeUTF16toUTF8(t(e), function(e) {
  36537. r.view[a++] = e
  36538. }),
  36539. r.limit = a,
  36540. r
  36541. }
  36542. ,
  36543. o
  36544. })
  36545. }
  36546. , {
  36547. long: 216
  36548. }],
  36549. 216: [function(e, t, i) {
  36550. !function(i, n) {
  36551. "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()
  36552. }(this, function() {
  36553. "use strict";
  36554. function e(e, t, i) {
  36555. this.low = 0 | e,
  36556. this.high = 0 | t,
  36557. this.unsigned = !!i
  36558. }
  36559. function t(e) {
  36560. return (e && e.__isLong__) === !0
  36561. }
  36562. function i(e, t) {
  36563. var i, n, o;
  36564. return t ? (e >>>= 0,
  36565. (o = 0 <= e && e < 256) && (n = l[e]) ? n : (i = r(e, (0 | e) < 0 ? -1 : 0, !0),
  36566. o && (l[e] = i),
  36567. i)) : (e |= 0,
  36568. (o = -128 <= e && e < 128) && (n = s[e]) ? n : (i = r(e, e < 0 ? -1 : 0, !1),
  36569. o && (s[e] = i),
  36570. i))
  36571. }
  36572. function n(e, t) {
  36573. if (isNaN(e) || !isFinite(e))
  36574. return t ? m : g;
  36575. if (t) {
  36576. if (e < 0)
  36577. return m;
  36578. if (e >= d)
  36579. return I
  36580. } else {
  36581. if (e <= -p)
  36582. return E;
  36583. if (e + 1 >= p)
  36584. return C
  36585. }
  36586. return e < 0 ? n(-e, t).neg() : r(e % u | 0, e / u | 0, t)
  36587. }
  36588. function r(t, i, n) {
  36589. return new e(t,i,n)
  36590. }
  36591. function o(e, t, i) {
  36592. if (0 === e.length)
  36593. throw Error("empty string");
  36594. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  36595. return g;
  36596. if ("number" == typeof t ? (i = t,
  36597. t = !1) : t = !!t,
  36598. i = i || 10,
  36599. i < 2 || 36 < i)
  36600. throw RangeError("radix");
  36601. var r;
  36602. if ((r = e.indexOf("-")) > 0)
  36603. throw Error("interior hyphen");
  36604. if (0 === r)
  36605. return o(e.substring(1), t, i).neg();
  36606. for (var a = n(c(i, 8)), s = g, l = 0; l < e.length; l += 8) {
  36607. var h = Math.min(8, e.length - l)
  36608. , u = parseInt(e.substring(l, l + h), i);
  36609. if (h < 8) {
  36610. var d = n(c(i, h));
  36611. s = s.mul(d).add(n(u))
  36612. } else
  36613. s = s.mul(a),
  36614. s = s.add(n(u))
  36615. }
  36616. return s.unsigned = t,
  36617. s
  36618. }
  36619. function a(t) {
  36620. return t instanceof e ? t : "number" == typeof t ? n(t) : "string" == typeof t ? o(t) : r(t.low, t.high, t.unsigned)
  36621. }
  36622. e.prototype.__isLong__,
  36623. Object.defineProperty(e.prototype, "__isLong__", {
  36624. value: !0,
  36625. enumerable: !1,
  36626. configurable: !1
  36627. }),
  36628. e.isLong = t;
  36629. var s = {}
  36630. , l = {};
  36631. e.fromInt = i,
  36632. e.fromNumber = n,
  36633. e.fromBits = r;
  36634. var c = Math.pow;
  36635. e.fromString = o,
  36636. e.fromValue = a;
  36637. var h = 1 << 24
  36638. , u = 4294967296
  36639. , d = 0x10000000000000000
  36640. , p = d / 2
  36641. , f = i(h)
  36642. , g = i(0);
  36643. e.ZERO = g;
  36644. var m = i(0, !0);
  36645. e.UZERO = m;
  36646. var v = i(1);
  36647. e.ONE = v;
  36648. var A = i(1, !0);
  36649. e.UONE = A;
  36650. var y = i(-1);
  36651. e.NEG_ONE = y;
  36652. var C = r(-1, 2147483647, !1);
  36653. e.MAX_VALUE = C;
  36654. var I = r(-1, -1, !0);
  36655. e.MAX_UNSIGNED_VALUE = I;
  36656. var E = r(0, -2147483648, !1);
  36657. e.MIN_VALUE = E;
  36658. var b = e.prototype;
  36659. return b.toInt = function() {
  36660. return this.unsigned ? this.low >>> 0 : this.low
  36661. }
  36662. ,
  36663. b.toNumber = function() {
  36664. return this.unsigned ? (this.high >>> 0) * u + (this.low >>> 0) : this.high * u + (this.low >>> 0)
  36665. }
  36666. ,
  36667. b.toString = function(e) {
  36668. if (e = e || 10,
  36669. e < 2 || 36 < e)
  36670. throw RangeError("radix");
  36671. if (this.isZero())
  36672. return "0";
  36673. if (this.isNegative()) {
  36674. if (this.eq(E)) {
  36675. var t = n(e)
  36676. , i = this.div(t)
  36677. , r = i.mul(t).sub(this);
  36678. return i.toString(e) + r.toInt().toString(e)
  36679. }
  36680. return "-" + this.neg().toString(e)
  36681. }
  36682. for (var o = n(c(e, 6), this.unsigned), a = this, s = ""; ; ) {
  36683. var l = a.div(o)
  36684. , h = a.sub(l.mul(o)).toInt() >>> 0
  36685. , u = h.toString(e);
  36686. if (a = l,
  36687. a.isZero())
  36688. return u + s;
  36689. for (; u.length < 6; )
  36690. u = "0" + u;
  36691. s = "" + u + s
  36692. }
  36693. }
  36694. ,
  36695. b.getHighBits = function() {
  36696. return this.high
  36697. }
  36698. ,
  36699. b.getHighBitsUnsigned = function() {
  36700. return this.high >>> 0
  36701. }
  36702. ,
  36703. b.getLowBits = function() {
  36704. return this.low
  36705. }
  36706. ,
  36707. b.getLowBitsUnsigned = function() {
  36708. return this.low >>> 0
  36709. }
  36710. ,
  36711. b.getNumBitsAbs = function() {
  36712. if (this.isNegative())
  36713. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  36714. for (var e = 0 != this.high ? this.high : this.low, t = 31; t > 0 && 0 == (e & 1 << t); t--)
  36715. ;
  36716. return 0 != this.high ? t + 33 : t + 1
  36717. }
  36718. ,
  36719. b.isZero = function() {
  36720. return 0 === this.high && 0 === this.low
  36721. }
  36722. ,
  36723. b.isNegative = function() {
  36724. return !this.unsigned && this.high < 0
  36725. }
  36726. ,
  36727. b.isPositive = function() {
  36728. return this.unsigned || this.high >= 0
  36729. }
  36730. ,
  36731. b.isOdd = function() {
  36732. return 1 === (1 & this.low)
  36733. }
  36734. ,
  36735. b.isEven = function() {
  36736. return 0 === (1 & this.low)
  36737. }
  36738. ,
  36739. b.equals = function(e) {
  36740. return t(e) || (e = a(e)),
  36741. (this.unsigned === e.unsigned || this.high >>> 31 !== 1 || e.high >>> 31 !== 1) && (this.high === e.high && this.low === e.low)
  36742. }
  36743. ,
  36744. b.eq = b.equals,
  36745. b.notEquals = function(e) {
  36746. return !this.eq(e)
  36747. }
  36748. ,
  36749. b.neq = b.notEquals,
  36750. b.lessThan = function(e) {
  36751. return this.comp(e) < 0
  36752. }
  36753. ,
  36754. b.lt = b.lessThan,
  36755. b.lessThanOrEqual = function(e) {
  36756. return this.comp(e) <= 0
  36757. }
  36758. ,
  36759. b.lte = b.lessThanOrEqual,
  36760. b.greaterThan = function(e) {
  36761. return this.comp(e) > 0
  36762. }
  36763. ,
  36764. b.gt = b.greaterThan,
  36765. b.greaterThanOrEqual = function(e) {
  36766. return this.comp(e) >= 0
  36767. }
  36768. ,
  36769. b.gte = b.greaterThanOrEqual,
  36770. b.compare = function(e) {
  36771. if (t(e) || (e = a(e)),
  36772. this.eq(e))
  36773. return 0;
  36774. var i = this.isNegative()
  36775. , n = e.isNegative();
  36776. 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
  36777. }
  36778. ,
  36779. b.comp = b.compare,
  36780. b.negate = function() {
  36781. return !this.unsigned && this.eq(E) ? E : this.not().add(v)
  36782. }
  36783. ,
  36784. b.neg = b.negate,
  36785. b.add = function(e) {
  36786. t(e) || (e = a(e));
  36787. var i = this.high >>> 16
  36788. , n = 65535 & this.high
  36789. , o = this.low >>> 16
  36790. , s = 65535 & this.low
  36791. , l = e.high >>> 16
  36792. , c = 65535 & e.high
  36793. , h = e.low >>> 16
  36794. , u = 65535 & e.low
  36795. , d = 0
  36796. , p = 0
  36797. , f = 0
  36798. , g = 0;
  36799. return g += s + u,
  36800. f += g >>> 16,
  36801. g &= 65535,
  36802. f += o + h,
  36803. p += f >>> 16,
  36804. f &= 65535,
  36805. p += n + c,
  36806. d += p >>> 16,
  36807. p &= 65535,
  36808. d += i + l,
  36809. d &= 65535,
  36810. r(f << 16 | g, d << 16 | p, this.unsigned)
  36811. }
  36812. ,
  36813. b.subtract = function(e) {
  36814. return t(e) || (e = a(e)),
  36815. this.add(e.neg())
  36816. }
  36817. ,
  36818. b.sub = b.subtract,
  36819. b.multiply = function(e) {
  36820. if (this.isZero())
  36821. return g;
  36822. if (t(e) || (e = a(e)),
  36823. e.isZero())
  36824. return g;
  36825. if (this.eq(E))
  36826. return e.isOdd() ? E : g;
  36827. if (e.eq(E))
  36828. return this.isOdd() ? E : g;
  36829. if (this.isNegative())
  36830. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  36831. if (e.isNegative())
  36832. return this.mul(e.neg()).neg();
  36833. if (this.lt(f) && e.lt(f))
  36834. return n(this.toNumber() * e.toNumber(), this.unsigned);
  36835. var i = this.high >>> 16
  36836. , o = 65535 & this.high
  36837. , s = this.low >>> 16
  36838. , l = 65535 & this.low
  36839. , c = e.high >>> 16
  36840. , h = 65535 & e.high
  36841. , u = e.low >>> 16
  36842. , d = 65535 & e.low
  36843. , p = 0
  36844. , m = 0
  36845. , v = 0
  36846. , A = 0;
  36847. return A += l * d,
  36848. v += A >>> 16,
  36849. A &= 65535,
  36850. v += s * d,
  36851. m += v >>> 16,
  36852. v &= 65535,
  36853. v += l * u,
  36854. m += v >>> 16,
  36855. v &= 65535,
  36856. m += o * d,
  36857. p += m >>> 16,
  36858. m &= 65535,
  36859. m += s * u,
  36860. p += m >>> 16,
  36861. m &= 65535,
  36862. m += l * h,
  36863. p += m >>> 16,
  36864. m &= 65535,
  36865. p += i * d + o * u + s * h + l * c,
  36866. p &= 65535,
  36867. r(v << 16 | A, p << 16 | m, this.unsigned)
  36868. }
  36869. ,
  36870. b.mul = b.multiply,
  36871. b.divide = function(e) {
  36872. if (t(e) || (e = a(e)),
  36873. e.isZero())
  36874. throw Error("division by zero");
  36875. if (this.isZero())
  36876. return this.unsigned ? m : g;
  36877. var i, r, o;
  36878. if (this.unsigned) {
  36879. if (e.unsigned || (e = e.toUnsigned()),
  36880. e.gt(this))
  36881. return m;
  36882. if (e.gt(this.shru(1)))
  36883. return A;
  36884. o = m
  36885. } else {
  36886. if (this.eq(E)) {
  36887. if (e.eq(v) || e.eq(y))
  36888. return E;
  36889. if (e.eq(E))
  36890. return v;
  36891. var s = this.shr(1);
  36892. return i = s.div(e).shl(1),
  36893. i.eq(g) ? e.isNegative() ? v : y : (r = this.sub(e.mul(i)),
  36894. o = i.add(r.div(e)))
  36895. }
  36896. if (e.eq(E))
  36897. return this.unsigned ? m : g;
  36898. if (this.isNegative())
  36899. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  36900. if (e.isNegative())
  36901. return this.div(e.neg()).neg();
  36902. o = g
  36903. }
  36904. for (r = this; r.gte(e); ) {
  36905. i = Math.max(1, Math.floor(r.toNumber() / e.toNumber()));
  36906. 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); )
  36907. i -= h,
  36908. u = n(i, this.unsigned),
  36909. d = u.mul(e);
  36910. u.isZero() && (u = v),
  36911. o = o.add(u),
  36912. r = r.sub(d)
  36913. }
  36914. return o
  36915. }
  36916. ,
  36917. b.div = b.divide,
  36918. b.modulo = function(e) {
  36919. return t(e) || (e = a(e)),
  36920. this.sub(this.div(e).mul(e))
  36921. }
  36922. ,
  36923. b.mod = b.modulo,
  36924. b.not = function() {
  36925. return r(~this.low, ~this.high, this.unsigned)
  36926. }
  36927. ,
  36928. b.and = function(e) {
  36929. return t(e) || (e = a(e)),
  36930. r(this.low & e.low, this.high & e.high, this.unsigned)
  36931. }
  36932. ,
  36933. b.or = function(e) {
  36934. return t(e) || (e = a(e)),
  36935. r(this.low | e.low, this.high | e.high, this.unsigned)
  36936. }
  36937. ,
  36938. b.xor = function(e) {
  36939. return t(e) || (e = a(e)),
  36940. r(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  36941. }
  36942. ,
  36943. b.shiftLeft = function(e) {
  36944. return t(e) && (e = e.toInt()),
  36945. 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)
  36946. }
  36947. ,
  36948. b.shl = b.shiftLeft,
  36949. b.shiftRight = function(e) {
  36950. return t(e) && (e = e.toInt()),
  36951. 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)
  36952. }
  36953. ,
  36954. b.shr = b.shiftRight,
  36955. b.shiftRightUnsigned = function(e) {
  36956. if (t(e) && (e = e.toInt()),
  36957. e &= 63,
  36958. 0 === e)
  36959. return this;
  36960. var i = this.high;
  36961. if (e < 32) {
  36962. var n = this.low;
  36963. return r(n >>> e | i << 32 - e, i >>> e, this.unsigned)
  36964. }
  36965. return 32 === e ? r(i, 0, this.unsigned) : r(i >>> e - 32, 0, this.unsigned)
  36966. }
  36967. ,
  36968. b.shru = b.shiftRightUnsigned,
  36969. b.toSigned = function() {
  36970. return this.unsigned ? r(this.low, this.high, !1) : this
  36971. }
  36972. ,
  36973. b.toUnsigned = function() {
  36974. return this.unsigned ? this : r(this.low, this.high, !0)
  36975. }
  36976. ,
  36977. b.toBytes = function(e) {
  36978. return e ? this.toBytesLE() : this.toBytesBE()
  36979. }
  36980. ,
  36981. b.toBytesLE = function() {
  36982. var e = this.high
  36983. , t = this.low;
  36984. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  36985. }
  36986. ,
  36987. b.toBytesBE = function() {
  36988. var e = this.high
  36989. , t = this.low;
  36990. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  36991. }
  36992. ,
  36993. e
  36994. })
  36995. }
  36996. , {}],
  36997. 217: [function(e, t, i) {
  36998. var n = {
  36999. REVISION: "75"
  37000. };
  37001. "function" == typeof define && define.amd ? define("three", n) : "undefined" != typeof i && "undefined" != typeof t && (t.exports = n),
  37002. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  37003. void 0 === Math.sign && (Math.sign = function(e) {
  37004. return e < 0 ? -1 : e > 0 ? 1 : +e
  37005. }
  37006. ),
  37007. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  37008. get: function() {
  37009. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  37010. }
  37011. }),
  37012. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  37013. writable: !0,
  37014. configurable: !0,
  37015. value: function(e) {
  37016. "use strict";
  37017. if (void 0 === e || null === e)
  37018. throw new TypeError("Cannot convert first argument to object");
  37019. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  37020. var r = arguments[i];
  37021. if (void 0 !== r && null !== r) {
  37022. r = Object(r);
  37023. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  37024. var l = o[a]
  37025. , c = Object.getOwnPropertyDescriptor(r, l);
  37026. void 0 !== c && c.enumerable && (t[l] = r[l])
  37027. }
  37028. }
  37029. }
  37030. return t
  37031. }
  37032. }),
  37033. n.MOUSE = {
  37034. LEFT: 0,
  37035. MIDDLE: 1,
  37036. RIGHT: 2
  37037. },
  37038. n.CullFaceNone = 0,
  37039. n.CullFaceBack = 1,
  37040. n.CullFaceFront = 2,
  37041. n.CullFaceFrontBack = 3,
  37042. n.FrontFaceDirectionCW = 0,
  37043. n.FrontFaceDirectionCCW = 1,
  37044. n.BasicShadowMap = 0,
  37045. n.PCFShadowMap = 1,
  37046. n.PCFSoftShadowMap = 2,
  37047. n.FrontSide = 0,
  37048. n.BackSide = 1,
  37049. n.DoubleSide = 2,
  37050. n.FlatShading = 1,
  37051. n.SmoothShading = 2,
  37052. n.NoColors = 0,
  37053. n.FaceColors = 1,
  37054. n.VertexColors = 2,
  37055. n.NoBlending = 0,
  37056. n.NormalBlending = 1,
  37057. n.AdditiveBlending = 2,
  37058. n.SubtractiveBlending = 3,
  37059. n.MultiplyBlending = 4,
  37060. n.CustomBlending = 5,
  37061. n.AddEquation = 100,
  37062. n.SubtractEquation = 101,
  37063. n.ReverseSubtractEquation = 102,
  37064. n.MinEquation = 103,
  37065. n.MaxEquation = 104,
  37066. n.ZeroFactor = 200,
  37067. n.OneFactor = 201,
  37068. n.SrcColorFactor = 202,
  37069. n.OneMinusSrcColorFactor = 203,
  37070. n.SrcAlphaFactor = 204,
  37071. n.OneMinusSrcAlphaFactor = 205,
  37072. n.DstAlphaFactor = 206,
  37073. n.OneMinusDstAlphaFactor = 207,
  37074. n.DstColorFactor = 208,
  37075. n.OneMinusDstColorFactor = 209,
  37076. n.SrcAlphaSaturateFactor = 210,
  37077. n.NeverDepth = 0,
  37078. n.AlwaysDepth = 1,
  37079. n.LessDepth = 2,
  37080. n.LessEqualDepth = 3,
  37081. n.EqualDepth = 4,
  37082. n.GreaterEqualDepth = 5,
  37083. n.GreaterDepth = 6,
  37084. n.NotEqualDepth = 7,
  37085. n.MultiplyOperation = 0,
  37086. n.MixOperation = 1,
  37087. n.AddOperation = 2,
  37088. n.NoToneMapping = 0,
  37089. n.LinearToneMapping = 1,
  37090. n.ReinhardToneMapping = 2,
  37091. n.Uncharted2ToneMapping = 3,
  37092. n.CineonToneMapping = 4,
  37093. n.UVMapping = 300,
  37094. n.CubeReflectionMapping = 301,
  37095. n.CubeRefractionMapping = 302,
  37096. n.EquirectangularReflectionMapping = 303,
  37097. n.EquirectangularRefractionMapping = 304,
  37098. n.SphericalReflectionMapping = 305,
  37099. n.CubeUVReflectionMapping = 306,
  37100. n.CubeUVRefractionMapping = 307,
  37101. n.RepeatWrapping = 1e3,
  37102. n.ClampToEdgeWrapping = 1001,
  37103. n.MirroredRepeatWrapping = 1002,
  37104. n.NearestFilter = 1003,
  37105. n.NearestMipMapNearestFilter = 1004,
  37106. n.NearestMipMapLinearFilter = 1005,
  37107. n.LinearFilter = 1006,
  37108. n.LinearMipMapNearestFilter = 1007,
  37109. n.LinearMipMapLinearFilter = 1008,
  37110. n.UnsignedByteType = 1009,
  37111. n.ByteType = 1010,
  37112. n.ShortType = 1011,
  37113. n.UnsignedShortType = 1012,
  37114. n.IntType = 1013,
  37115. n.UnsignedIntType = 1014,
  37116. n.FloatType = 1015,
  37117. n.HalfFloatType = 1025,
  37118. n.UnsignedShort4444Type = 1016,
  37119. n.UnsignedShort5551Type = 1017,
  37120. n.UnsignedShort565Type = 1018,
  37121. n.AlphaFormat = 1019,
  37122. n.RGBFormat = 1020,
  37123. n.RGBAFormat = 1021,
  37124. n.LuminanceFormat = 1022,
  37125. n.LuminanceAlphaFormat = 1023,
  37126. n.RGBEFormat = n.RGBAFormat,
  37127. n.RGB_S3TC_DXT1_Format = 2001,
  37128. n.RGBA_S3TC_DXT1_Format = 2002,
  37129. n.RGBA_S3TC_DXT3_Format = 2003,
  37130. n.RGBA_S3TC_DXT5_Format = 2004,
  37131. n.RGB_PVRTC_4BPPV1_Format = 2100,
  37132. n.RGB_PVRTC_2BPPV1_Format = 2101,
  37133. n.RGBA_PVRTC_4BPPV1_Format = 2102,
  37134. n.RGBA_PVRTC_2BPPV1_Format = 2103,
  37135. n.RGB_ETC1_Format = 2151,
  37136. n.LoopOnce = 2200,
  37137. n.LoopRepeat = 2201,
  37138. n.LoopPingPong = 2202,
  37139. n.InterpolateDiscrete = 2300,
  37140. n.InterpolateLinear = 2301,
  37141. n.InterpolateSmooth = 2302,
  37142. n.ZeroCurvatureEnding = 2400,
  37143. n.ZeroSlopeEnding = 2401,
  37144. n.WrapAroundEnding = 2402,
  37145. n.TrianglesDrawMode = 0,
  37146. n.TriangleStripDrawMode = 1,
  37147. n.TriangleFanDrawMode = 2,
  37148. n.LinearEncoding = 3e3,
  37149. n.sRGBEncoding = 3001,
  37150. n.GammaEncoding = 3007,
  37151. n.RGBEEncoding = 3002,
  37152. n.LogLuvEncoding = 3003,
  37153. n.RGBM7Encoding = 3004,
  37154. n.RGBM16Encoding = 3005,
  37155. n.RGBDEncoding = 3006,
  37156. n.Color = function(e) {
  37157. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  37158. }
  37159. ,
  37160. n.Color.prototype = {
  37161. constructor: n.Color,
  37162. r: 1,
  37163. g: 1,
  37164. b: 1,
  37165. set: function(e) {
  37166. return e instanceof n.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  37167. this
  37168. },
  37169. setScalar: function(e) {
  37170. this.r = e,
  37171. this.g = e,
  37172. this.b = e
  37173. },
  37174. setHex: function(e) {
  37175. return e = Math.floor(e),
  37176. this.r = (e >> 16 & 255) / 255,
  37177. this.g = (e >> 8 & 255) / 255,
  37178. this.b = (255 & e) / 255,
  37179. this
  37180. },
  37181. setRGB: function(e, t, i) {
  37182. return this.r = e,
  37183. this.g = t,
  37184. this.b = i,
  37185. this
  37186. },
  37187. setHSL: function() {
  37188. function e(e, t, i) {
  37189. return i < 0 && (i += 1),
  37190. i > 1 && (i -= 1),
  37191. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  37192. }
  37193. return function(t, i, r) {
  37194. if (t = n.Math.euclideanModulo(t, 1),
  37195. i = n.Math.clamp(i, 0, 1),
  37196. r = n.Math.clamp(r, 0, 1),
  37197. 0 === i)
  37198. this.r = this.g = this.b = r;
  37199. else {
  37200. var o = r <= .5 ? r * (1 + i) : r + i - r * i
  37201. , a = 2 * r - o;
  37202. this.r = e(a, o, t + 1 / 3),
  37203. this.g = e(a, o, t),
  37204. this.b = e(a, o, t - 1 / 3)
  37205. }
  37206. return this
  37207. }
  37208. }(),
  37209. setStyle: function(e) {
  37210. function t(t) {
  37211. void 0 !== t && parseFloat(t) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored.")
  37212. }
  37213. var i;
  37214. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)) {
  37215. var r, o = i[1], a = i[2];
  37216. switch (o) {
  37217. case "rgb":
  37218. case "rgba":
  37219. if (r = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  37220. return this.r = Math.min(255, parseInt(r[1], 10)) / 255,
  37221. this.g = Math.min(255, parseInt(r[2], 10)) / 255,
  37222. this.b = Math.min(255, parseInt(r[3], 10)) / 255,
  37223. t(r[5]),
  37224. this;
  37225. if (r = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  37226. return this.r = Math.min(100, parseInt(r[1], 10)) / 100,
  37227. this.g = Math.min(100, parseInt(r[2], 10)) / 100,
  37228. this.b = Math.min(100, parseInt(r[3], 10)) / 100,
  37229. t(r[5]),
  37230. this;
  37231. break;
  37232. case "hsl":
  37233. case "hsla":
  37234. if (r = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)) {
  37235. var s = parseFloat(r[1]) / 360
  37236. , l = parseInt(r[2], 10) / 100
  37237. , c = parseInt(r[3], 10) / 100;
  37238. return t(r[5]),
  37239. this.setHSL(s, l, c)
  37240. }
  37241. }
  37242. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(e)) {
  37243. var h = i[1]
  37244. , u = h.length;
  37245. if (3 === u)
  37246. return this.r = parseInt(h.charAt(0) + h.charAt(0), 16) / 255,
  37247. this.g = parseInt(h.charAt(1) + h.charAt(1), 16) / 255,
  37248. this.b = parseInt(h.charAt(2) + h.charAt(2), 16) / 255,
  37249. this;
  37250. if (6 === u)
  37251. return this.r = parseInt(h.charAt(0) + h.charAt(1), 16) / 255,
  37252. this.g = parseInt(h.charAt(2) + h.charAt(3), 16) / 255,
  37253. this.b = parseInt(h.charAt(4) + h.charAt(5), 16) / 255,
  37254. this
  37255. }
  37256. if (e && e.length > 0) {
  37257. var h = n.ColorKeywords[e];
  37258. void 0 !== h ? this.setHex(h) : console.warn("THREE.Color: Unknown color " + e)
  37259. }
  37260. return this
  37261. },
  37262. clone: function() {
  37263. return new this.constructor(this.r,this.g,this.b)
  37264. },
  37265. copy: function(e) {
  37266. return this.r = e.r,
  37267. this.g = e.g,
  37268. this.b = e.b,
  37269. this
  37270. },
  37271. copyGammaToLinear: function(e, t) {
  37272. return void 0 === t && (t = 2),
  37273. this.r = Math.pow(e.r, t),
  37274. this.g = Math.pow(e.g, t),
  37275. this.b = Math.pow(e.b, t),
  37276. this
  37277. },
  37278. copyLinearToGamma: function(e, t) {
  37279. void 0 === t && (t = 2);
  37280. var i = t > 0 ? 1 / t : 1;
  37281. return this.r = Math.pow(e.r, i),
  37282. this.g = Math.pow(e.g, i),
  37283. this.b = Math.pow(e.b, i),
  37284. this
  37285. },
  37286. convertGammaToLinear: function() {
  37287. var e = this.r
  37288. , t = this.g
  37289. , i = this.b;
  37290. return this.r = e * e,
  37291. this.g = t * t,
  37292. this.b = i * i,
  37293. this
  37294. },
  37295. convertLinearToGamma: function() {
  37296. return this.r = Math.sqrt(this.r),
  37297. this.g = Math.sqrt(this.g),
  37298. this.b = Math.sqrt(this.b),
  37299. this
  37300. },
  37301. getHex: function() {
  37302. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  37303. },
  37304. getHexString: function() {
  37305. return ("000000" + this.getHex().toString(16)).slice(-6)
  37306. },
  37307. getHSL: function(e) {
  37308. var t, i, n = e || {
  37309. h: 0,
  37310. s: 0,
  37311. l: 0
  37312. }, 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;
  37313. if (l === s)
  37314. t = 0,
  37315. i = 0;
  37316. else {
  37317. var h = s - l;
  37318. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  37319. s) {
  37320. case r:
  37321. t = (o - a) / h + (o < a ? 6 : 0);
  37322. break;
  37323. case o:
  37324. t = (a - r) / h + 2;
  37325. break;
  37326. case a:
  37327. t = (r - o) / h + 4
  37328. }
  37329. t /= 6
  37330. }
  37331. return n.h = t,
  37332. n.s = i,
  37333. n.l = c,
  37334. n
  37335. },
  37336. getStyle: function() {
  37337. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  37338. },
  37339. offsetHSL: function(e, t, i) {
  37340. var n = this.getHSL();
  37341. return n.h += e,
  37342. n.s += t,
  37343. n.l += i,
  37344. this.setHSL(n.h, n.s, n.l),
  37345. this
  37346. },
  37347. add: function(e) {
  37348. return this.r += e.r,
  37349. this.g += e.g,
  37350. this.b += e.b,
  37351. this
  37352. },
  37353. addColors: function(e, t) {
  37354. return this.r = e.r + t.r,
  37355. this.g = e.g + t.g,
  37356. this.b = e.b + t.b,
  37357. this
  37358. },
  37359. addScalar: function(e) {
  37360. return this.r += e,
  37361. this.g += e,
  37362. this.b += e,
  37363. this
  37364. },
  37365. multiply: function(e) {
  37366. return this.r *= e.r,
  37367. this.g *= e.g,
  37368. this.b *= e.b,
  37369. this
  37370. },
  37371. multiplyScalar: function(e) {
  37372. return this.r *= e,
  37373. this.g *= e,
  37374. this.b *= e,
  37375. this
  37376. },
  37377. lerp: function(e, t) {
  37378. return this.r += (e.r - this.r) * t,
  37379. this.g += (e.g - this.g) * t,
  37380. this.b += (e.b - this.b) * t,
  37381. this
  37382. },
  37383. equals: function(e) {
  37384. return e.r === this.r && e.g === this.g && e.b === this.b
  37385. },
  37386. fromArray: function(e, t) {
  37387. return void 0 === t && (t = 0),
  37388. this.r = e[t],
  37389. this.g = e[t + 1],
  37390. this.b = e[t + 2],
  37391. this
  37392. },
  37393. toArray: function(e, t) {
  37394. return void 0 === e && (e = []),
  37395. void 0 === t && (t = 0),
  37396. e[t] = this.r,
  37397. e[t + 1] = this.g,
  37398. e[t + 2] = this.b,
  37399. e
  37400. }
  37401. },
  37402. n.ColorKeywords = {
  37403. aliceblue: 15792383,
  37404. antiquewhite: 16444375,
  37405. aqua: 65535,
  37406. aquamarine: 8388564,
  37407. azure: 15794175,
  37408. beige: 16119260,
  37409. bisque: 16770244,
  37410. black: 0,
  37411. blanchedalmond: 16772045,
  37412. blue: 255,
  37413. blueviolet: 9055202,
  37414. brown: 10824234,
  37415. burlywood: 14596231,
  37416. cadetblue: 6266528,
  37417. chartreuse: 8388352,
  37418. chocolate: 13789470,
  37419. coral: 16744272,
  37420. cornflowerblue: 6591981,
  37421. cornsilk: 16775388,
  37422. crimson: 14423100,
  37423. cyan: 65535,
  37424. darkblue: 139,
  37425. darkcyan: 35723,
  37426. darkgoldenrod: 12092939,
  37427. darkgray: 11119017,
  37428. darkgreen: 25600,
  37429. darkgrey: 11119017,
  37430. darkkhaki: 12433259,
  37431. darkmagenta: 9109643,
  37432. darkolivegreen: 5597999,
  37433. darkorange: 16747520,
  37434. darkorchid: 10040012,
  37435. darkred: 9109504,
  37436. darksalmon: 15308410,
  37437. darkseagreen: 9419919,
  37438. darkslateblue: 4734347,
  37439. darkslategray: 3100495,
  37440. darkslategrey: 3100495,
  37441. darkturquoise: 52945,
  37442. darkviolet: 9699539,
  37443. deeppink: 16716947,
  37444. deepskyblue: 49151,
  37445. dimgray: 6908265,
  37446. dimgrey: 6908265,
  37447. dodgerblue: 2003199,
  37448. firebrick: 11674146,
  37449. floralwhite: 16775920,
  37450. forestgreen: 2263842,
  37451. fuchsia: 16711935,
  37452. gainsboro: 14474460,
  37453. ghostwhite: 16316671,
  37454. gold: 16766720,
  37455. goldenrod: 14329120,
  37456. gray: 8421504,
  37457. green: 32768,
  37458. greenyellow: 11403055,
  37459. grey: 8421504,
  37460. honeydew: 15794160,
  37461. hotpink: 16738740,
  37462. indianred: 13458524,
  37463. indigo: 4915330,
  37464. ivory: 16777200,
  37465. khaki: 15787660,
  37466. lavender: 15132410,
  37467. lavenderblush: 16773365,
  37468. lawngreen: 8190976,
  37469. lemonchiffon: 16775885,
  37470. lightblue: 11393254,
  37471. lightcoral: 15761536,
  37472. lightcyan: 14745599,
  37473. lightgoldenrodyellow: 16448210,
  37474. lightgray: 13882323,
  37475. lightgreen: 9498256,
  37476. lightgrey: 13882323,
  37477. lightpink: 16758465,
  37478. lightsalmon: 16752762,
  37479. lightseagreen: 2142890,
  37480. lightskyblue: 8900346,
  37481. lightslategray: 7833753,
  37482. lightslategrey: 7833753,
  37483. lightsteelblue: 11584734,
  37484. lightyellow: 16777184,
  37485. lime: 65280,
  37486. limegreen: 3329330,
  37487. linen: 16445670,
  37488. magenta: 16711935,
  37489. maroon: 8388608,
  37490. mediumaquamarine: 6737322,
  37491. mediumblue: 205,
  37492. mediumorchid: 12211667,
  37493. mediumpurple: 9662683,
  37494. mediumseagreen: 3978097,
  37495. mediumslateblue: 8087790,
  37496. mediumspringgreen: 64154,
  37497. mediumturquoise: 4772300,
  37498. mediumvioletred: 13047173,
  37499. midnightblue: 1644912,
  37500. mintcream: 16121850,
  37501. mistyrose: 16770273,
  37502. moccasin: 16770229,
  37503. navajowhite: 16768685,
  37504. navy: 128,
  37505. oldlace: 16643558,
  37506. olive: 8421376,
  37507. olivedrab: 7048739,
  37508. orange: 16753920,
  37509. orangered: 16729344,
  37510. orchid: 14315734,
  37511. palegoldenrod: 15657130,
  37512. palegreen: 10025880,
  37513. paleturquoise: 11529966,
  37514. palevioletred: 14381203,
  37515. papayawhip: 16773077,
  37516. peachpuff: 16767673,
  37517. peru: 13468991,
  37518. pink: 16761035,
  37519. plum: 14524637,
  37520. powderblue: 11591910,
  37521. purple: 8388736,
  37522. red: 16711680,
  37523. rosybrown: 12357519,
  37524. royalblue: 4286945,
  37525. saddlebrown: 9127187,
  37526. salmon: 16416882,
  37527. sandybrown: 16032864,
  37528. seagreen: 3050327,
  37529. seashell: 16774638,
  37530. sienna: 10506797,
  37531. silver: 12632256,
  37532. skyblue: 8900331,
  37533. slateblue: 6970061,
  37534. slategray: 7372944,
  37535. slategrey: 7372944,
  37536. snow: 16775930,
  37537. springgreen: 65407,
  37538. steelblue: 4620980,
  37539. tan: 13808780,
  37540. teal: 32896,
  37541. thistle: 14204888,
  37542. tomato: 16737095,
  37543. turquoise: 4251856,
  37544. violet: 15631086,
  37545. wheat: 16113331,
  37546. white: 16777215,
  37547. whitesmoke: 16119285,
  37548. yellow: 16776960,
  37549. yellowgreen: 10145074
  37550. },
  37551. n.Quaternion = function(e, t, i, n) {
  37552. this._x = e || 0,
  37553. this._y = t || 0,
  37554. this._z = i || 0,
  37555. this._w = void 0 !== n ? n : 1
  37556. }
  37557. ,
  37558. n.Quaternion.prototype = {
  37559. constructor: n.Quaternion,
  37560. get x() {
  37561. return this._x
  37562. },
  37563. set x(e) {
  37564. this._x = e,
  37565. this.onChangeCallback()
  37566. },
  37567. get y() {
  37568. return this._y
  37569. },
  37570. set y(e) {
  37571. this._y = e,
  37572. this.onChangeCallback()
  37573. },
  37574. get z() {
  37575. return this._z
  37576. },
  37577. set z(e) {
  37578. this._z = e,
  37579. this.onChangeCallback()
  37580. },
  37581. get w() {
  37582. return this._w
  37583. },
  37584. set w(e) {
  37585. this._w = e,
  37586. this.onChangeCallback()
  37587. },
  37588. set: function(e, t, i, n) {
  37589. return this._x = e,
  37590. this._y = t,
  37591. this._z = i,
  37592. this._w = n,
  37593. this.onChangeCallback(),
  37594. this
  37595. },
  37596. clone: function() {
  37597. return new this.constructor(this._x,this._y,this._z,this._w)
  37598. },
  37599. copy: function(e) {
  37600. return this._x = e.x,
  37601. this._y = e.y,
  37602. this._z = e.z,
  37603. this._w = e.w,
  37604. this.onChangeCallback(),
  37605. this
  37606. },
  37607. setFromEuler: function(e, t) {
  37608. if (e instanceof n.Euler == !1)
  37609. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  37610. var i = Math.cos(e._x / 2)
  37611. , r = Math.cos(e._y / 2)
  37612. , o = Math.cos(e._z / 2)
  37613. , a = Math.sin(e._x / 2)
  37614. , s = Math.sin(e._y / 2)
  37615. , l = Math.sin(e._z / 2)
  37616. , c = e.order;
  37617. return "XYZ" === c ? (this._x = a * r * o + i * s * l,
  37618. this._y = i * s * o - a * r * l,
  37619. this._z = i * r * l + a * s * o,
  37620. this._w = i * r * o - a * s * l) : "YXZ" === c ? (this._x = a * r * o + i * s * l,
  37621. this._y = i * s * o - a * r * l,
  37622. this._z = i * r * l - a * s * o,
  37623. this._w = i * r * o + a * s * l) : "ZXY" === c ? (this._x = a * r * o - i * s * l,
  37624. this._y = i * s * o + a * r * l,
  37625. this._z = i * r * l + a * s * o,
  37626. this._w = i * r * o - a * s * l) : "ZYX" === c ? (this._x = a * r * o - i * s * l,
  37627. this._y = i * s * o + a * r * l,
  37628. this._z = i * r * l - a * s * o,
  37629. this._w = i * r * o + a * s * l) : "YZX" === c ? (this._x = a * r * o + i * s * l,
  37630. this._y = i * s * o + a * r * l,
  37631. this._z = i * r * l - a * s * o,
  37632. this._w = i * r * o - a * s * l) : "XZY" === c && (this._x = a * r * o - i * s * l,
  37633. this._y = i * s * o - a * r * l,
  37634. this._z = i * r * l + a * s * o,
  37635. this._w = i * r * o + a * s * l),
  37636. t !== !1 && this.onChangeCallback(),
  37637. this
  37638. },
  37639. setFromAxisAngle: function(e, t) {
  37640. var i = t / 2
  37641. , n = Math.sin(i);
  37642. return this._x = e.x * n,
  37643. this._y = e.y * n,
  37644. this._z = e.z * n,
  37645. this._w = Math.cos(i),
  37646. this.onChangeCallback(),
  37647. this
  37648. },
  37649. setFromRotationMatrix: function(e) {
  37650. 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;
  37651. return d > 0 ? (t = .5 / Math.sqrt(d + 1),
  37652. this._w = .25 / t,
  37653. this._x = (h - l) * t,
  37654. this._y = (o - c) * t,
  37655. this._z = (a - r) * t) : n > s && n > u ? (t = 2 * Math.sqrt(1 + n - s - u),
  37656. this._w = (h - l) / t,
  37657. this._x = .25 * t,
  37658. this._y = (r + a) / t,
  37659. this._z = (o + c) / t) : s > u ? (t = 2 * Math.sqrt(1 + s - n - u),
  37660. this._w = (o - c) / t,
  37661. this._x = (r + a) / t,
  37662. this._y = .25 * t,
  37663. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  37664. this._w = (a - r) / t,
  37665. this._x = (o + c) / t,
  37666. this._y = (l + h) / t,
  37667. this._z = .25 * t),
  37668. this.onChangeCallback(),
  37669. this
  37670. },
  37671. setFromUnitVectors: function() {
  37672. var e, t, i = 1e-6;
  37673. return function(r, o) {
  37674. return void 0 === e && (e = new n.Vector3),
  37675. t = r.dot(o) + 1,
  37676. t < i ? (t = 0,
  37677. 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),
  37678. this._x = e.x,
  37679. this._y = e.y,
  37680. this._z = e.z,
  37681. this._w = t,
  37682. this.normalize(),
  37683. this
  37684. }
  37685. }(),
  37686. inverse: function() {
  37687. return this.conjugate().normalize(),
  37688. this
  37689. },
  37690. conjugate: function() {
  37691. return this._x *= -1,
  37692. this._y *= -1,
  37693. this._z *= -1,
  37694. this.onChangeCallback(),
  37695. this
  37696. },
  37697. dot: function(e) {
  37698. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  37699. },
  37700. lengthSq: function() {
  37701. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  37702. },
  37703. length: function() {
  37704. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  37705. },
  37706. normalize: function() {
  37707. var e = this.length();
  37708. return 0 === e ? (this._x = 0,
  37709. this._y = 0,
  37710. this._z = 0,
  37711. this._w = 1) : (e = 1 / e,
  37712. this._x = this._x * e,
  37713. this._y = this._y * e,
  37714. this._z = this._z * e,
  37715. this._w = this._w * e),
  37716. this.onChangeCallback(),
  37717. this
  37718. },
  37719. multiply: function(e, t) {
  37720. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  37721. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  37722. },
  37723. multiplyQuaternions: function(e, t) {
  37724. var i = e._x
  37725. , n = e._y
  37726. , r = e._z
  37727. , o = e._w
  37728. , a = t._x
  37729. , s = t._y
  37730. , l = t._z
  37731. , c = t._w;
  37732. return this._x = i * c + o * a + n * l - r * s,
  37733. this._y = n * c + o * s + r * a - i * l,
  37734. this._z = r * c + o * l + i * s - n * a,
  37735. this._w = o * c - i * a - n * s - r * l,
  37736. this.onChangeCallback(),
  37737. this
  37738. },
  37739. slerp: function(e, t) {
  37740. if (0 === t)
  37741. return this;
  37742. if (1 === t)
  37743. return this.copy(e);
  37744. var i = this._x
  37745. , n = this._y
  37746. , r = this._z
  37747. , o = this._w
  37748. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  37749. if (a < 0 ? (this._w = -e._w,
  37750. this._x = -e._x,
  37751. this._y = -e._y,
  37752. this._z = -e._z,
  37753. a = -a) : this.copy(e),
  37754. a >= 1)
  37755. return this._w = o,
  37756. this._x = i,
  37757. this._y = n,
  37758. this._z = r,
  37759. this;
  37760. var s = Math.sqrt(1 - a * a);
  37761. if (Math.abs(s) < .001)
  37762. return this._w = .5 * (o + this._w),
  37763. this._x = .5 * (i + this._x),
  37764. this._y = .5 * (n + this._y),
  37765. this._z = .5 * (r + this._z),
  37766. this;
  37767. var l = Math.atan2(s, a)
  37768. , c = Math.sin((1 - t) * l) / s
  37769. , h = Math.sin(t * l) / s;
  37770. return this._w = o * c + this._w * h,
  37771. this._x = i * c + this._x * h,
  37772. this._y = n * c + this._y * h,
  37773. this._z = r * c + this._z * h,
  37774. this.onChangeCallback(),
  37775. this
  37776. },
  37777. equals: function(e) {
  37778. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  37779. },
  37780. fromArray: function(e, t) {
  37781. return void 0 === t && (t = 0),
  37782. this._x = e[t],
  37783. this._y = e[t + 1],
  37784. this._z = e[t + 2],
  37785. this._w = e[t + 3],
  37786. this.onChangeCallback(),
  37787. this
  37788. },
  37789. toArray: function(e, t) {
  37790. return void 0 === e && (e = []),
  37791. void 0 === t && (t = 0),
  37792. e[t] = this._x,
  37793. e[t + 1] = this._y,
  37794. e[t + 2] = this._z,
  37795. e[t + 3] = this._w,
  37796. e
  37797. },
  37798. onChange: function(e) {
  37799. return this.onChangeCallback = e,
  37800. this
  37801. },
  37802. onChangeCallback: function() {}
  37803. },
  37804. Object.assign(n.Quaternion, {
  37805. slerp: function(e, t, i, n) {
  37806. return i.copy(e).slerp(t, n)
  37807. },
  37808. slerpFlat: function(e, t, i, n, r, o, a) {
  37809. var s = i[n + 0]
  37810. , l = i[n + 1]
  37811. , c = i[n + 2]
  37812. , h = i[n + 3]
  37813. , u = r[o + 0]
  37814. , d = r[o + 1]
  37815. , p = r[o + 2]
  37816. , f = r[o + 3];
  37817. if (h !== f || s !== u || l !== d || c !== p) {
  37818. var g = 1 - a
  37819. , m = s * u + l * d + c * p + h * f
  37820. , v = m >= 0 ? 1 : -1
  37821. , A = 1 - m * m;
  37822. if (A > Number.EPSILON) {
  37823. var y = Math.sqrt(A)
  37824. , C = Math.atan2(y, m * v);
  37825. g = Math.sin(g * C) / y,
  37826. a = Math.sin(a * C) / y
  37827. }
  37828. var I = a * v;
  37829. if (s = s * g + u * I,
  37830. l = l * g + d * I,
  37831. c = c * g + p * I,
  37832. h = h * g + f * I,
  37833. g === 1 - a) {
  37834. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  37835. s *= E,
  37836. l *= E,
  37837. c *= E,
  37838. h *= E
  37839. }
  37840. }
  37841. e[t] = s,
  37842. e[t + 1] = l,
  37843. e[t + 2] = c,
  37844. e[t + 3] = h
  37845. }
  37846. }),
  37847. n.Vector2 = function(e, t) {
  37848. this.x = e || 0,
  37849. this.y = t || 0
  37850. }
  37851. ,
  37852. n.Vector2.prototype = {
  37853. constructor: n.Vector2,
  37854. get width() {
  37855. return this.x
  37856. },
  37857. set width(e) {
  37858. this.x = e
  37859. },
  37860. get height() {
  37861. return this.y
  37862. },
  37863. set height(e) {
  37864. this.y = e
  37865. },
  37866. set: function(e, t) {
  37867. return this.x = e,
  37868. this.y = t,
  37869. this
  37870. },
  37871. setScalar: function(e) {
  37872. return this.x = e,
  37873. this.y = e,
  37874. this
  37875. },
  37876. setX: function(e) {
  37877. return this.x = e,
  37878. this
  37879. },
  37880. setY: function(e) {
  37881. return this.y = e,
  37882. this
  37883. },
  37884. setComponent: function(e, t) {
  37885. switch (e) {
  37886. case 0:
  37887. this.x = t;
  37888. break;
  37889. case 1:
  37890. this.y = t;
  37891. break;
  37892. default:
  37893. throw new Error("index is out of range: " + e)
  37894. }
  37895. },
  37896. getComponent: function(e) {
  37897. switch (e) {
  37898. case 0:
  37899. return this.x;
  37900. case 1:
  37901. return this.y;
  37902. default:
  37903. throw new Error("index is out of range: " + e)
  37904. }
  37905. },
  37906. clone: function() {
  37907. return new this.constructor(this.x,this.y)
  37908. },
  37909. copy: function(e) {
  37910. return this.x = e.x,
  37911. this.y = e.y,
  37912. this
  37913. },
  37914. add: function(e, t) {
  37915. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37916. this.addVectors(e, t)) : (this.x += e.x,
  37917. this.y += e.y,
  37918. this)
  37919. },
  37920. addScalar: function(e) {
  37921. return this.x += e,
  37922. this.y += e,
  37923. this
  37924. },
  37925. addVectors: function(e, t) {
  37926. return this.x = e.x + t.x,
  37927. this.y = e.y + t.y,
  37928. this
  37929. },
  37930. addScaledVector: function(e, t) {
  37931. return this.x += e.x * t,
  37932. this.y += e.y * t,
  37933. this
  37934. },
  37935. sub: function(e, t) {
  37936. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37937. this.subVectors(e, t)) : (this.x -= e.x,
  37938. this.y -= e.y,
  37939. this)
  37940. },
  37941. subScalar: function(e) {
  37942. return this.x -= e,
  37943. this.y -= e,
  37944. this
  37945. },
  37946. subVectors: function(e, t) {
  37947. return this.x = e.x - t.x,
  37948. this.y = e.y - t.y,
  37949. this
  37950. },
  37951. multiply: function(e) {
  37952. return this.x *= e.x,
  37953. this.y *= e.y,
  37954. this
  37955. },
  37956. multiplyScalar: function(e) {
  37957. return isFinite(e) ? (this.x *= e,
  37958. this.y *= e) : (this.x = 0,
  37959. this.y = 0),
  37960. this
  37961. },
  37962. divide: function(e) {
  37963. return this.x /= e.x,
  37964. this.y /= e.y,
  37965. this
  37966. },
  37967. divideScalar: function(e) {
  37968. return this.multiplyScalar(1 / e)
  37969. },
  37970. min: function(e) {
  37971. return this.x = Math.min(this.x, e.x),
  37972. this.y = Math.min(this.y, e.y),
  37973. this
  37974. },
  37975. max: function(e) {
  37976. return this.x = Math.max(this.x, e.x),
  37977. this.y = Math.max(this.y, e.y),
  37978. this
  37979. },
  37980. clamp: function(e, t) {
  37981. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  37982. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  37983. this
  37984. },
  37985. clampScalar: function() {
  37986. var e, t;
  37987. return function(i, r) {
  37988. return void 0 === e && (e = new n.Vector2,
  37989. t = new n.Vector2),
  37990. e.set(i, i),
  37991. t.set(r, r),
  37992. this.clamp(e, t)
  37993. }
  37994. }(),
  37995. clampLength: function(e, t) {
  37996. var i = this.length();
  37997. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  37998. this
  37999. },
  38000. floor: function() {
  38001. return this.x = Math.floor(this.x),
  38002. this.y = Math.floor(this.y),
  38003. this
  38004. },
  38005. ceil: function() {
  38006. return this.x = Math.ceil(this.x),
  38007. this.y = Math.ceil(this.y),
  38008. this
  38009. },
  38010. round: function() {
  38011. return this.x = Math.round(this.x),
  38012. this.y = Math.round(this.y),
  38013. this
  38014. },
  38015. roundToZero: function() {
  38016. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38017. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38018. this
  38019. },
  38020. negate: function() {
  38021. return this.x = -this.x,
  38022. this.y = -this.y,
  38023. this
  38024. },
  38025. dot: function(e) {
  38026. return this.x * e.x + this.y * e.y
  38027. },
  38028. lengthSq: function() {
  38029. return this.x * this.x + this.y * this.y
  38030. },
  38031. length: function() {
  38032. return Math.sqrt(this.x * this.x + this.y * this.y)
  38033. },
  38034. lengthManhattan: function() {
  38035. return Math.abs(this.x) + Math.abs(this.y)
  38036. },
  38037. normalize: function() {
  38038. return this.divideScalar(this.length())
  38039. },
  38040. angle: function() {
  38041. var e = Math.atan2(this.y, this.x);
  38042. return e < 0 && (e += 2 * Math.PI),
  38043. e
  38044. },
  38045. distanceTo: function(e) {
  38046. return Math.sqrt(this.distanceToSquared(e))
  38047. },
  38048. distanceToSquared: function(e) {
  38049. var t = this.x - e.x
  38050. , i = this.y - e.y;
  38051. return t * t + i * i
  38052. },
  38053. setLength: function(e) {
  38054. return this.multiplyScalar(e / this.length())
  38055. },
  38056. lerp: function(e, t) {
  38057. return this.x += (e.x - this.x) * t,
  38058. this.y += (e.y - this.y) * t,
  38059. this
  38060. },
  38061. lerpVectors: function(e, t, i) {
  38062. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38063. this
  38064. },
  38065. equals: function(e) {
  38066. return e.x === this.x && e.y === this.y
  38067. },
  38068. fromArray: function(e, t) {
  38069. return void 0 === t && (t = 0),
  38070. this.x = e[t],
  38071. this.y = e[t + 1],
  38072. this
  38073. },
  38074. toArray: function(e, t) {
  38075. return void 0 === e && (e = []),
  38076. void 0 === t && (t = 0),
  38077. e[t] = this.x,
  38078. e[t + 1] = this.y,
  38079. e
  38080. },
  38081. fromAttribute: function(e, t, i) {
  38082. return void 0 === i && (i = 0),
  38083. t = t * e.itemSize + i,
  38084. this.x = e.array[t],
  38085. this.y = e.array[t + 1],
  38086. this
  38087. },
  38088. rotateAround: function(e, t) {
  38089. var i = Math.cos(t)
  38090. , n = Math.sin(t)
  38091. , r = this.x - e.x
  38092. , o = this.y - e.y;
  38093. return this.x = r * i - o * n + e.x,
  38094. this.y = r * n + o * i + e.y,
  38095. this
  38096. }
  38097. },
  38098. n.Vector3 = function(e, t, i) {
  38099. this.x = e || 0,
  38100. this.y = t || 0,
  38101. this.z = i || 0
  38102. }
  38103. ,
  38104. n.Vector3.prototype = {
  38105. constructor: n.Vector3,
  38106. set: function(e, t, i) {
  38107. return this.x = e,
  38108. this.y = t,
  38109. this.z = i,
  38110. this
  38111. },
  38112. setScalar: function(e) {
  38113. return this.x = e,
  38114. this.y = e,
  38115. this.z = e,
  38116. this
  38117. },
  38118. setX: function(e) {
  38119. return this.x = e,
  38120. this
  38121. },
  38122. setY: function(e) {
  38123. return this.y = e,
  38124. this
  38125. },
  38126. setZ: function(e) {
  38127. return this.z = e,
  38128. this
  38129. },
  38130. setComponent: function(e, t) {
  38131. switch (e) {
  38132. case 0:
  38133. this.x = t;
  38134. break;
  38135. case 1:
  38136. this.y = t;
  38137. break;
  38138. case 2:
  38139. this.z = t;
  38140. break;
  38141. default:
  38142. throw new Error("index is out of range: " + e)
  38143. }
  38144. },
  38145. getComponent: function(e) {
  38146. switch (e) {
  38147. case 0:
  38148. return this.x;
  38149. case 1:
  38150. return this.y;
  38151. case 2:
  38152. return this.z;
  38153. default:
  38154. throw new Error("index is out of range: " + e)
  38155. }
  38156. },
  38157. clone: function() {
  38158. return new this.constructor(this.x,this.y,this.z)
  38159. },
  38160. copy: function(e) {
  38161. return this.x = e.x,
  38162. this.y = e.y,
  38163. this.z = e.z,
  38164. this
  38165. },
  38166. add: function(e, t) {
  38167. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38168. this.addVectors(e, t)) : (this.x += e.x,
  38169. this.y += e.y,
  38170. this.z += e.z,
  38171. this)
  38172. },
  38173. addScalar: function(e) {
  38174. return this.x += e,
  38175. this.y += e,
  38176. this.z += e,
  38177. this
  38178. },
  38179. addVectors: function(e, t) {
  38180. return this.x = e.x + t.x,
  38181. this.y = e.y + t.y,
  38182. this.z = e.z + t.z,
  38183. this
  38184. },
  38185. addScaledVector: function(e, t) {
  38186. return this.x += e.x * t,
  38187. this.y += e.y * t,
  38188. this.z += e.z * t,
  38189. this
  38190. },
  38191. sub: function(e, t) {
  38192. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38193. this.subVectors(e, t)) : (this.x -= e.x,
  38194. this.y -= e.y,
  38195. this.z -= e.z,
  38196. this)
  38197. },
  38198. subScalar: function(e) {
  38199. return this.x -= e,
  38200. this.y -= e,
  38201. this.z -= e,
  38202. this
  38203. },
  38204. subVectors: function(e, t) {
  38205. return this.x = e.x - t.x,
  38206. this.y = e.y - t.y,
  38207. this.z = e.z - t.z,
  38208. this
  38209. },
  38210. multiply: function(e, t) {
  38211. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  38212. this.multiplyVectors(e, t)) : (this.x *= e.x,
  38213. this.y *= e.y,
  38214. this.z *= e.z,
  38215. this)
  38216. },
  38217. multiplyScalar: function(e) {
  38218. return isFinite(e) ? (this.x *= e,
  38219. this.y *= e,
  38220. this.z *= e) : (this.x = 0,
  38221. this.y = 0,
  38222. this.z = 0),
  38223. this
  38224. },
  38225. multiplyVectors: function(e, t) {
  38226. return this.x = e.x * t.x,
  38227. this.y = e.y * t.y,
  38228. this.z = e.z * t.z,
  38229. this
  38230. },
  38231. applyEuler: function() {
  38232. var e;
  38233. return function(t) {
  38234. return t instanceof n.Euler == !1 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  38235. void 0 === e && (e = new n.Quaternion),
  38236. this.applyQuaternion(e.setFromEuler(t)),
  38237. this
  38238. }
  38239. }(),
  38240. applyAxisAngle: function() {
  38241. var e;
  38242. return function(t, i) {
  38243. return void 0 === e && (e = new n.Quaternion),
  38244. this.applyQuaternion(e.setFromAxisAngle(t, i)),
  38245. this
  38246. }
  38247. }(),
  38248. applyMatrix3: function(e) {
  38249. var t = this.x
  38250. , i = this.y
  38251. , n = this.z
  38252. , r = e.elements;
  38253. return this.x = r[0] * t + r[3] * i + r[6] * n,
  38254. this.y = r[1] * t + r[4] * i + r[7] * n,
  38255. this.z = r[2] * t + r[5] * i + r[8] * n,
  38256. this
  38257. },
  38258. applyMatrix4: function(e) {
  38259. var t = this.x
  38260. , i = this.y
  38261. , n = this.z
  38262. , r = e.elements;
  38263. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  38264. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  38265. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  38266. this
  38267. },
  38268. applyProjection: function(e) {
  38269. var t = this.x
  38270. , i = this.y
  38271. , n = this.z
  38272. , r = e.elements
  38273. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  38274. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  38275. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  38276. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  38277. this
  38278. },
  38279. applyQuaternion: function(e) {
  38280. var t = this.x
  38281. , i = this.y
  38282. , n = this.z
  38283. , r = e.x
  38284. , o = e.y
  38285. , a = e.z
  38286. , s = e.w
  38287. , l = s * t + o * n - a * i
  38288. , c = s * i + a * t - r * n
  38289. , h = s * n + r * i - o * t
  38290. , u = -r * t - o * i - a * n;
  38291. return this.x = l * s + u * -r + c * -a - h * -o,
  38292. this.y = c * s + u * -o + h * -r - l * -a,
  38293. this.z = h * s + u * -a + l * -o - c * -r,
  38294. this
  38295. },
  38296. project: function() {
  38297. var e;
  38298. return function(t) {
  38299. return void 0 === e && (e = new n.Matrix4),
  38300. e.multiplyMatrices(t.projectionMatrix, e.getInverse(t.matrixWorld)),
  38301. this.applyProjection(e)
  38302. }
  38303. }(),
  38304. unproject: function() {
  38305. var e;
  38306. return function(t) {
  38307. return void 0 === e && (e = new n.Matrix4),
  38308. e.multiplyMatrices(t.matrixWorld, e.getInverse(t.projectionMatrix)),
  38309. this.applyProjection(e)
  38310. }
  38311. }(),
  38312. transformDirection: function(e) {
  38313. var t = this.x
  38314. , i = this.y
  38315. , n = this.z
  38316. , r = e.elements;
  38317. return this.x = r[0] * t + r[4] * i + r[8] * n,
  38318. this.y = r[1] * t + r[5] * i + r[9] * n,
  38319. this.z = r[2] * t + r[6] * i + r[10] * n,
  38320. this.normalize(),
  38321. this
  38322. },
  38323. divide: function(e) {
  38324. return this.x /= e.x,
  38325. this.y /= e.y,
  38326. this.z /= e.z,
  38327. this
  38328. },
  38329. divideScalar: function(e) {
  38330. return this.multiplyScalar(1 / e)
  38331. },
  38332. min: function(e) {
  38333. return this.x = Math.min(this.x, e.x),
  38334. this.y = Math.min(this.y, e.y),
  38335. this.z = Math.min(this.z, e.z),
  38336. this
  38337. },
  38338. max: function(e) {
  38339. return this.x = Math.max(this.x, e.x),
  38340. this.y = Math.max(this.y, e.y),
  38341. this.z = Math.max(this.z, e.z),
  38342. this
  38343. },
  38344. clamp: function(e, t) {
  38345. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38346. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38347. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38348. this
  38349. },
  38350. clampScalar: function() {
  38351. var e, t;
  38352. return function(i, r) {
  38353. return void 0 === e && (e = new n.Vector3,
  38354. t = new n.Vector3),
  38355. e.set(i, i, i),
  38356. t.set(r, r, r),
  38357. this.clamp(e, t)
  38358. }
  38359. }(),
  38360. clampLength: function(e, t) {
  38361. var i = this.length();
  38362. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38363. this
  38364. },
  38365. floor: function() {
  38366. return this.x = Math.floor(this.x),
  38367. this.y = Math.floor(this.y),
  38368. this.z = Math.floor(this.z),
  38369. this
  38370. },
  38371. ceil: function() {
  38372. return this.x = Math.ceil(this.x),
  38373. this.y = Math.ceil(this.y),
  38374. this.z = Math.ceil(this.z),
  38375. this
  38376. },
  38377. round: function() {
  38378. return this.x = Math.round(this.x),
  38379. this.y = Math.round(this.y),
  38380. this.z = Math.round(this.z),
  38381. this
  38382. },
  38383. roundToZero: function() {
  38384. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38385. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38386. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38387. this
  38388. },
  38389. negate: function() {
  38390. return this.x = -this.x,
  38391. this.y = -this.y,
  38392. this.z = -this.z,
  38393. this
  38394. },
  38395. dot: function(e) {
  38396. return this.x * e.x + this.y * e.y + this.z * e.z
  38397. },
  38398. lengthSq: function() {
  38399. return this.x * this.x + this.y * this.y + this.z * this.z
  38400. },
  38401. length: function() {
  38402. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  38403. },
  38404. lengthManhattan: function() {
  38405. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  38406. },
  38407. normalize: function() {
  38408. return this.divideScalar(this.length())
  38409. },
  38410. setLength: function(e) {
  38411. return this.multiplyScalar(e / this.length())
  38412. },
  38413. lerp: function(e, t) {
  38414. return this.x += (e.x - this.x) * t,
  38415. this.y += (e.y - this.y) * t,
  38416. this.z += (e.z - this.z) * t,
  38417. this
  38418. },
  38419. lerpVectors: function(e, t, i) {
  38420. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38421. this
  38422. },
  38423. cross: function(e, t) {
  38424. if (void 0 !== t)
  38425. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  38426. this.crossVectors(e, t);
  38427. var i = this.x
  38428. , n = this.y
  38429. , r = this.z;
  38430. return this.x = n * e.z - r * e.y,
  38431. this.y = r * e.x - i * e.z,
  38432. this.z = i * e.y - n * e.x,
  38433. this
  38434. },
  38435. crossVectors: function(e, t) {
  38436. var i = e.x
  38437. , n = e.y
  38438. , r = e.z
  38439. , o = t.x
  38440. , a = t.y
  38441. , s = t.z;
  38442. return this.x = n * s - r * a,
  38443. this.y = r * o - i * s,
  38444. this.z = i * a - n * o,
  38445. this
  38446. },
  38447. projectOnVector: function() {
  38448. var e, t;
  38449. return function(i) {
  38450. return void 0 === e && (e = new n.Vector3),
  38451. e.copy(i).normalize(),
  38452. t = this.dot(e),
  38453. this.copy(e).multiplyScalar(t)
  38454. }
  38455. }(),
  38456. projectOnPlane: function() {
  38457. var e;
  38458. return function(t) {
  38459. return void 0 === e && (e = new n.Vector3),
  38460. e.copy(this).projectOnVector(t),
  38461. this.sub(e)
  38462. }
  38463. }(),
  38464. reflect: function() {
  38465. var e;
  38466. return function(t) {
  38467. return void 0 === e && (e = new n.Vector3),
  38468. this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
  38469. }
  38470. }(),
  38471. angleTo: function(e) {
  38472. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  38473. return Math.acos(n.Math.clamp(t, -1, 1))
  38474. },
  38475. distanceTo: function(e) {
  38476. return Math.sqrt(this.distanceToSquared(e))
  38477. },
  38478. distanceToSquared: function(e) {
  38479. var t = this.x - e.x
  38480. , i = this.y - e.y
  38481. , n = this.z - e.z;
  38482. return t * t + i * i + n * n
  38483. },
  38484. setFromSpherical: function(e) {
  38485. var t = Math.sin(e.phi) * e.radius;
  38486. return this.x = t * Math.sin(e.theta),
  38487. this.y = Math.cos(e.phi) * e.radius,
  38488. this.z = t * Math.cos(e.theta),
  38489. this
  38490. },
  38491. setFromMatrixPosition: function(e) {
  38492. return this.setFromMatrixColumn(e, 3)
  38493. },
  38494. setFromMatrixScale: function(e) {
  38495. var t = this.setFromMatrixColumn(e, 0).length()
  38496. , i = this.setFromMatrixColumn(e, 1).length()
  38497. , n = this.setFromMatrixColumn(e, 2).length();
  38498. return this.x = t,
  38499. this.y = i,
  38500. this.z = n,
  38501. this
  38502. },
  38503. setFromMatrixColumn: function(e, t) {
  38504. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  38505. e = arguments[1],
  38506. t = arguments[0]),
  38507. this.fromArray(e.elements, 4 * t)
  38508. },
  38509. equals: function(e) {
  38510. return e.x === this.x && e.y === this.y && e.z === this.z
  38511. },
  38512. fromArray: function(e, t) {
  38513. return void 0 === t && (t = 0),
  38514. this.x = e[t],
  38515. this.y = e[t + 1],
  38516. this.z = e[t + 2],
  38517. this
  38518. },
  38519. toArray: function(e, t) {
  38520. return void 0 === e && (e = []),
  38521. void 0 === t && (t = 0),
  38522. e[t] = this.x,
  38523. e[t + 1] = this.y,
  38524. e[t + 2] = this.z,
  38525. e
  38526. },
  38527. fromAttribute: function(e, t, i) {
  38528. return void 0 === i && (i = 0),
  38529. t = t * e.itemSize + i,
  38530. this.x = e.array[t],
  38531. this.y = e.array[t + 1],
  38532. this.z = e.array[t + 2],
  38533. this
  38534. }
  38535. },
  38536. n.Vector4 = function(e, t, i, n) {
  38537. this.x = e || 0,
  38538. this.y = t || 0,
  38539. this.z = i || 0,
  38540. this.w = void 0 !== n ? n : 1
  38541. }
  38542. ,
  38543. n.Vector4.prototype = {
  38544. constructor: n.Vector4,
  38545. set: function(e, t, i, n) {
  38546. return this.x = e,
  38547. this.y = t,
  38548. this.z = i,
  38549. this.w = n,
  38550. this
  38551. },
  38552. setScalar: function(e) {
  38553. return this.x = e,
  38554. this.y = e,
  38555. this.z = e,
  38556. this.w = e,
  38557. this
  38558. },
  38559. setX: function(e) {
  38560. return this.x = e,
  38561. this
  38562. },
  38563. setY: function(e) {
  38564. return this.y = e,
  38565. this
  38566. },
  38567. setZ: function(e) {
  38568. return this.z = e,
  38569. this
  38570. },
  38571. setW: function(e) {
  38572. return this.w = e,
  38573. this
  38574. },
  38575. setComponent: function(e, t) {
  38576. switch (e) {
  38577. case 0:
  38578. this.x = t;
  38579. break;
  38580. case 1:
  38581. this.y = t;
  38582. break;
  38583. case 2:
  38584. this.z = t;
  38585. break;
  38586. case 3:
  38587. this.w = t;
  38588. break;
  38589. default:
  38590. throw new Error("index is out of range: " + e)
  38591. }
  38592. },
  38593. getComponent: function(e) {
  38594. switch (e) {
  38595. case 0:
  38596. return this.x;
  38597. case 1:
  38598. return this.y;
  38599. case 2:
  38600. return this.z;
  38601. case 3:
  38602. return this.w;
  38603. default:
  38604. throw new Error("index is out of range: " + e)
  38605. }
  38606. },
  38607. clone: function() {
  38608. return new this.constructor(this.x,this.y,this.z,this.w)
  38609. },
  38610. copy: function(e) {
  38611. return this.x = e.x,
  38612. this.y = e.y,
  38613. this.z = e.z,
  38614. this.w = void 0 !== e.w ? e.w : 1,
  38615. this
  38616. },
  38617. add: function(e, t) {
  38618. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38619. this.addVectors(e, t)) : (this.x += e.x,
  38620. this.y += e.y,
  38621. this.z += e.z,
  38622. this.w += e.w,
  38623. this)
  38624. },
  38625. addScalar: function(e) {
  38626. return this.x += e,
  38627. this.y += e,
  38628. this.z += e,
  38629. this.w += e,
  38630. this
  38631. },
  38632. addVectors: function(e, t) {
  38633. return this.x = e.x + t.x,
  38634. this.y = e.y + t.y,
  38635. this.z = e.z + t.z,
  38636. this.w = e.w + t.w,
  38637. this
  38638. },
  38639. addScaledVector: function(e, t) {
  38640. return this.x += e.x * t,
  38641. this.y += e.y * t,
  38642. this.z += e.z * t,
  38643. this.w += e.w * t,
  38644. this
  38645. },
  38646. sub: function(e, t) {
  38647. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38648. this.subVectors(e, t)) : (this.x -= e.x,
  38649. this.y -= e.y,
  38650. this.z -= e.z,
  38651. this.w -= e.w,
  38652. this)
  38653. },
  38654. subScalar: function(e) {
  38655. return this.x -= e,
  38656. this.y -= e,
  38657. this.z -= e,
  38658. this.w -= e,
  38659. this
  38660. },
  38661. subVectors: function(e, t) {
  38662. return this.x = e.x - t.x,
  38663. this.y = e.y - t.y,
  38664. this.z = e.z - t.z,
  38665. this.w = e.w - t.w,
  38666. this
  38667. },
  38668. multiplyScalar: function(e) {
  38669. return isFinite(e) ? (this.x *= e,
  38670. this.y *= e,
  38671. this.z *= e,
  38672. this.w *= e) : (this.x = 0,
  38673. this.y = 0,
  38674. this.z = 0,
  38675. this.w = 0),
  38676. this
  38677. },
  38678. applyMatrix4: function(e) {
  38679. var t = this.x
  38680. , i = this.y
  38681. , n = this.z
  38682. , r = this.w
  38683. , o = e.elements;
  38684. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  38685. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  38686. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  38687. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  38688. this
  38689. },
  38690. divideScalar: function(e) {
  38691. return this.multiplyScalar(1 / e)
  38692. },
  38693. setAxisAngleFromQuaternion: function(e) {
  38694. this.w = 2 * Math.acos(e.w);
  38695. var t = Math.sqrt(1 - e.w * e.w);
  38696. return t < 1e-4 ? (this.x = 1,
  38697. this.y = 0,
  38698. this.z = 0) : (this.x = e.x / t,
  38699. this.y = e.y / t,
  38700. this.z = e.z / t),
  38701. this
  38702. },
  38703. setAxisAngleFromRotationMatrix: function(e) {
  38704. 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];
  38705. if (Math.abs(c - u) < o && Math.abs(h - f) < o && Math.abs(p - g) < o) {
  38706. if (Math.abs(c + u) < a && Math.abs(h + f) < a && Math.abs(p + g) < a && Math.abs(l + d + m - 3) < a)
  38707. return this.set(1, 0, 0, 0),
  38708. this;
  38709. t = Math.PI;
  38710. var v = (l + 1) / 2
  38711. , A = (d + 1) / 2
  38712. , y = (m + 1) / 2
  38713. , C = (c + u) / 4
  38714. , I = (h + f) / 4
  38715. , E = (p + g) / 4;
  38716. return v > A && v > y ? v < o ? (i = 0,
  38717. n = .707106781,
  38718. r = .707106781) : (i = Math.sqrt(v),
  38719. n = C / i,
  38720. r = I / i) : A > y ? A < o ? (i = .707106781,
  38721. n = 0,
  38722. r = .707106781) : (n = Math.sqrt(A),
  38723. i = C / n,
  38724. r = E / n) : y < o ? (i = .707106781,
  38725. n = .707106781,
  38726. r = 0) : (r = Math.sqrt(y),
  38727. i = I / r,
  38728. n = E / r),
  38729. this.set(i, n, r, t),
  38730. this
  38731. }
  38732. var b = Math.sqrt((g - p) * (g - p) + (h - f) * (h - f) + (u - c) * (u - c));
  38733. return Math.abs(b) < .001 && (b = 1),
  38734. this.x = (g - p) / b,
  38735. this.y = (h - f) / b,
  38736. this.z = (u - c) / b,
  38737. this.w = Math.acos((l + d + m - 1) / 2),
  38738. this
  38739. },
  38740. min: function(e) {
  38741. return this.x = Math.min(this.x, e.x),
  38742. this.y = Math.min(this.y, e.y),
  38743. this.z = Math.min(this.z, e.z),
  38744. this.w = Math.min(this.w, e.w),
  38745. this
  38746. },
  38747. max: function(e) {
  38748. return this.x = Math.max(this.x, e.x),
  38749. this.y = Math.max(this.y, e.y),
  38750. this.z = Math.max(this.z, e.z),
  38751. this.w = Math.max(this.w, e.w),
  38752. this
  38753. },
  38754. clamp: function(e, t) {
  38755. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38756. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38757. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38758. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  38759. this
  38760. },
  38761. clampScalar: function() {
  38762. var e, t;
  38763. return function(i, r) {
  38764. return void 0 === e && (e = new n.Vector4,
  38765. t = new n.Vector4),
  38766. e.set(i, i, i, i),
  38767. t.set(r, r, r, r),
  38768. this.clamp(e, t)
  38769. }
  38770. }(),
  38771. floor: function() {
  38772. return this.x = Math.floor(this.x),
  38773. this.y = Math.floor(this.y),
  38774. this.z = Math.floor(this.z),
  38775. this.w = Math.floor(this.w),
  38776. this
  38777. },
  38778. ceil: function() {
  38779. return this.x = Math.ceil(this.x),
  38780. this.y = Math.ceil(this.y),
  38781. this.z = Math.ceil(this.z),
  38782. this.w = Math.ceil(this.w),
  38783. this
  38784. },
  38785. round: function() {
  38786. return this.x = Math.round(this.x),
  38787. this.y = Math.round(this.y),
  38788. this.z = Math.round(this.z),
  38789. this.w = Math.round(this.w),
  38790. this
  38791. },
  38792. roundToZero: function() {
  38793. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38794. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38795. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38796. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  38797. this
  38798. },
  38799. negate: function() {
  38800. return this.x = -this.x,
  38801. this.y = -this.y,
  38802. this.z = -this.z,
  38803. this.w = -this.w,
  38804. this
  38805. },
  38806. dot: function(e) {
  38807. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  38808. },
  38809. lengthSq: function() {
  38810. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  38811. },
  38812. length: function() {
  38813. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  38814. },
  38815. lengthManhattan: function() {
  38816. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  38817. },
  38818. normalize: function() {
  38819. return this.divideScalar(this.length())
  38820. },
  38821. setLength: function(e) {
  38822. return this.multiplyScalar(e / this.length())
  38823. },
  38824. lerp: function(e, t) {
  38825. return this.x += (e.x - this.x) * t,
  38826. this.y += (e.y - this.y) * t,
  38827. this.z += (e.z - this.z) * t,
  38828. this.w += (e.w - this.w) * t,
  38829. this
  38830. },
  38831. lerpVectors: function(e, t, i) {
  38832. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38833. this
  38834. },
  38835. equals: function(e) {
  38836. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  38837. },
  38838. fromArray: function(e, t) {
  38839. return void 0 === t && (t = 0),
  38840. this.x = e[t],
  38841. this.y = e[t + 1],
  38842. this.z = e[t + 2],
  38843. this.w = e[t + 3],
  38844. this
  38845. },
  38846. toArray: function(e, t) {
  38847. return void 0 === e && (e = []),
  38848. void 0 === t && (t = 0),
  38849. e[t] = this.x,
  38850. e[t + 1] = this.y,
  38851. e[t + 2] = this.z,
  38852. e[t + 3] = this.w,
  38853. e
  38854. },
  38855. fromAttribute: function(e, t, i) {
  38856. return void 0 === i && (i = 0),
  38857. t = t * e.itemSize + i,
  38858. this.x = e.array[t],
  38859. this.y = e.array[t + 1],
  38860. this.z = e.array[t + 2],
  38861. this.w = e.array[t + 3],
  38862. this
  38863. }
  38864. },
  38865. n.Euler = function(e, t, i, r) {
  38866. this._x = e || 0,
  38867. this._y = t || 0,
  38868. this._z = i || 0,
  38869. this._order = r || n.Euler.DefaultOrder
  38870. }
  38871. ,
  38872. n.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  38873. n.Euler.DefaultOrder = "XYZ",
  38874. n.Euler.prototype = {
  38875. constructor: n.Euler,
  38876. get x() {
  38877. return this._x
  38878. },
  38879. set x(e) {
  38880. this._x = e,
  38881. this.onChangeCallback()
  38882. },
  38883. get y() {
  38884. return this._y
  38885. },
  38886. set y(e) {
  38887. this._y = e,
  38888. this.onChangeCallback()
  38889. },
  38890. get z() {
  38891. return this._z
  38892. },
  38893. set z(e) {
  38894. this._z = e,
  38895. this.onChangeCallback()
  38896. },
  38897. get order() {
  38898. return this._order
  38899. },
  38900. set order(e) {
  38901. this._order = e,
  38902. this.onChangeCallback()
  38903. },
  38904. set: function(e, t, i, n) {
  38905. return this._x = e,
  38906. this._y = t,
  38907. this._z = i,
  38908. this._order = n || this._order,
  38909. this.onChangeCallback(),
  38910. this
  38911. },
  38912. clone: function() {
  38913. return new this.constructor(this._x,this._y,this._z,this._order)
  38914. },
  38915. copy: function(e) {
  38916. return this._x = e._x,
  38917. this._y = e._y,
  38918. this._z = e._z,
  38919. this._order = e._order,
  38920. this.onChangeCallback(),
  38921. this
  38922. },
  38923. setFromRotationMatrix: function(e, t, i) {
  38924. var r = n.Math.clamp
  38925. , o = e.elements
  38926. , a = o[0]
  38927. , s = o[4]
  38928. , l = o[8]
  38929. , c = o[1]
  38930. , h = o[5]
  38931. , u = o[9]
  38932. , d = o[2]
  38933. , p = o[6]
  38934. , f = o[10];
  38935. return t = t || this._order,
  38936. "XYZ" === t ? (this._y = Math.asin(r(l, -1, 1)),
  38937. Math.abs(l) < .99999 ? (this._x = Math.atan2(-u, f),
  38938. this._z = Math.atan2(-s, a)) : (this._x = Math.atan2(p, h),
  38939. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-r(u, -1, 1)),
  38940. Math.abs(u) < .99999 ? (this._y = Math.atan2(l, f),
  38941. this._z = Math.atan2(c, h)) : (this._y = Math.atan2(-d, a),
  38942. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(r(p, -1, 1)),
  38943. Math.abs(p) < .99999 ? (this._y = Math.atan2(-d, f),
  38944. this._z = Math.atan2(-s, h)) : (this._y = 0,
  38945. this._z = Math.atan2(c, a))) : "ZYX" === t ? (this._y = Math.asin(-r(d, -1, 1)),
  38946. Math.abs(d) < .99999 ? (this._x = Math.atan2(p, f),
  38947. this._z = Math.atan2(c, a)) : (this._x = 0,
  38948. this._z = Math.atan2(-s, h))) : "YZX" === t ? (this._z = Math.asin(r(c, -1, 1)),
  38949. Math.abs(c) < .99999 ? (this._x = Math.atan2(-u, h),
  38950. this._y = Math.atan2(-d, a)) : (this._x = 0,
  38951. this._y = Math.atan2(l, f))) : "XZY" === t ? (this._z = Math.asin(-r(s, -1, 1)),
  38952. Math.abs(s) < .99999 ? (this._x = Math.atan2(p, h),
  38953. this._y = Math.atan2(l, a)) : (this._x = Math.atan2(-u, f),
  38954. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  38955. this._order = t,
  38956. i !== !1 && this.onChangeCallback(),
  38957. this
  38958. },
  38959. setFromQuaternion: function() {
  38960. var e;
  38961. return function(t, i, r) {
  38962. return void 0 === e && (e = new n.Matrix4),
  38963. e.makeRotationFromQuaternion(t),
  38964. this.setFromRotationMatrix(e, i, r),
  38965. this
  38966. }
  38967. }(),
  38968. setFromVector3: function(e, t) {
  38969. return this.set(e.x, e.y, e.z, t || this._order)
  38970. },
  38971. reorder: function() {
  38972. var e = new n.Quaternion;
  38973. return function(t) {
  38974. e.setFromEuler(this),
  38975. this.setFromQuaternion(e, t)
  38976. }
  38977. }(),
  38978. equals: function(e) {
  38979. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  38980. },
  38981. fromArray: function(e) {
  38982. return this._x = e[0],
  38983. this._y = e[1],
  38984. this._z = e[2],
  38985. void 0 !== e[3] && (this._order = e[3]),
  38986. this.onChangeCallback(),
  38987. this
  38988. },
  38989. toArray: function(e, t) {
  38990. return void 0 === e && (e = []),
  38991. void 0 === t && (t = 0),
  38992. e[t] = this._x,
  38993. e[t + 1] = this._y,
  38994. e[t + 2] = this._z,
  38995. e[t + 3] = this._order,
  38996. e
  38997. },
  38998. toVector3: function(e) {
  38999. return e ? e.set(this._x, this._y, this._z) : new n.Vector3(this._x,this._y,this._z)
  39000. },
  39001. onChange: function(e) {
  39002. return this.onChangeCallback = e,
  39003. this
  39004. },
  39005. onChangeCallback: function() {}
  39006. },
  39007. n.Line3 = function(e, t) {
  39008. this.start = void 0 !== e ? e : new n.Vector3,
  39009. this.end = void 0 !== t ? t : new n.Vector3
  39010. }
  39011. ,
  39012. n.Line3.prototype = {
  39013. constructor: n.Line3,
  39014. set: function(e, t) {
  39015. return this.start.copy(e),
  39016. this.end.copy(t),
  39017. this
  39018. },
  39019. clone: function() {
  39020. return (new this.constructor).copy(this)
  39021. },
  39022. copy: function(e) {
  39023. return this.start.copy(e.start),
  39024. this.end.copy(e.end),
  39025. this
  39026. },
  39027. center: function(e) {
  39028. var t = e || new n.Vector3;
  39029. return t.addVectors(this.start, this.end).multiplyScalar(.5)
  39030. },
  39031. delta: function(e) {
  39032. var t = e || new n.Vector3;
  39033. return t.subVectors(this.end, this.start)
  39034. },
  39035. distanceSq: function() {
  39036. return this.start.distanceToSquared(this.end)
  39037. },
  39038. distance: function() {
  39039. return this.start.distanceTo(this.end)
  39040. },
  39041. at: function(e, t) {
  39042. var i = t || new n.Vector3;
  39043. return this.delta(i).multiplyScalar(e).add(this.start)
  39044. },
  39045. closestPointToPointParameter: function() {
  39046. var e = new n.Vector3
  39047. , t = new n.Vector3;
  39048. return function(i, r) {
  39049. e.subVectors(i, this.start),
  39050. t.subVectors(this.end, this.start);
  39051. var o = t.dot(t)
  39052. , a = t.dot(e)
  39053. , s = a / o;
  39054. return r && (s = n.Math.clamp(s, 0, 1)),
  39055. s
  39056. }
  39057. }(),
  39058. closestPointToPoint: function(e, t, i) {
  39059. var r = this.closestPointToPointParameter(e, t)
  39060. , o = i || new n.Vector3;
  39061. return this.delta(o).multiplyScalar(r).add(this.start)
  39062. },
  39063. applyMatrix4: function(e) {
  39064. return this.start.applyMatrix4(e),
  39065. this.end.applyMatrix4(e),
  39066. this
  39067. },
  39068. equals: function(e) {
  39069. return e.start.equals(this.start) && e.end.equals(this.end)
  39070. }
  39071. },
  39072. n.Box2 = function(e, t) {
  39073. this.min = void 0 !== e ? e : new n.Vector2(+(1 / 0),+(1 / 0)),
  39074. this.max = void 0 !== t ? t : new n.Vector2(-(1 / 0),-(1 / 0))
  39075. }
  39076. ,
  39077. n.Box2.prototype = {
  39078. constructor: n.Box2,
  39079. set: function(e, t) {
  39080. return this.min.copy(e),
  39081. this.max.copy(t),
  39082. this
  39083. },
  39084. setFromPoints: function(e) {
  39085. this.makeEmpty();
  39086. for (var t = 0, i = e.length; t < i; t++)
  39087. this.expandByPoint(e[t]);
  39088. return this
  39089. },
  39090. setFromCenterAndSize: function() {
  39091. var e = new n.Vector2;
  39092. return function(t, i) {
  39093. var n = e.copy(i).multiplyScalar(.5);
  39094. return this.min.copy(t).sub(n),
  39095. this.max.copy(t).add(n),
  39096. this
  39097. }
  39098. }(),
  39099. clone: function() {
  39100. return (new this.constructor).copy(this)
  39101. },
  39102. copy: function(e) {
  39103. return this.min.copy(e.min),
  39104. this.max.copy(e.max),
  39105. this
  39106. },
  39107. makeEmpty: function() {
  39108. return this.min.x = this.min.y = +(1 / 0),
  39109. this.max.x = this.max.y = -(1 / 0),
  39110. this
  39111. },
  39112. isEmpty: function() {
  39113. return this.max.x < this.min.x || this.max.y < this.min.y
  39114. },
  39115. center: function(e) {
  39116. var t = e || new n.Vector2;
  39117. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  39118. },
  39119. size: function(e) {
  39120. var t = e || new n.Vector2;
  39121. return t.subVectors(this.max, this.min)
  39122. },
  39123. expandByPoint: function(e) {
  39124. return this.min.min(e),
  39125. this.max.max(e),
  39126. this
  39127. },
  39128. expandByVector: function(e) {
  39129. return this.min.sub(e),
  39130. this.max.add(e),
  39131. this
  39132. },
  39133. expandByScalar: function(e) {
  39134. return this.min.addScalar(-e),
  39135. this.max.addScalar(e),
  39136. this
  39137. },
  39138. containsPoint: function(e) {
  39139. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  39140. },
  39141. containsBox: function(e) {
  39142. 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
  39143. },
  39144. getParameter: function(e, t) {
  39145. var i = t || new n.Vector2;
  39146. 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))
  39147. },
  39148. intersectsBox: function(e) {
  39149. 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)
  39150. },
  39151. clampPoint: function(e, t) {
  39152. var i = t || new n.Vector2;
  39153. return i.copy(e).clamp(this.min, this.max)
  39154. },
  39155. distanceToPoint: function() {
  39156. var e = new n.Vector2;
  39157. return function(t) {
  39158. var i = e.copy(t).clamp(this.min, this.max);
  39159. return i.sub(t).length()
  39160. }
  39161. }(),
  39162. intersect: function(e) {
  39163. return this.min.max(e.min),
  39164. this.max.min(e.max),
  39165. this
  39166. },
  39167. union: function(e) {
  39168. return this.min.min(e.min),
  39169. this.max.max(e.max),
  39170. this
  39171. },
  39172. translate: function(e) {
  39173. return this.min.add(e),
  39174. this.max.add(e),
  39175. this
  39176. },
  39177. equals: function(e) {
  39178. return e.min.equals(this.min) && e.max.equals(this.max)
  39179. }
  39180. },
  39181. n.Box3 = function(e, t) {
  39182. this.min = void 0 !== e ? e : new n.Vector3(+(1 / 0),+(1 / 0),+(1 / 0)),
  39183. this.max = void 0 !== t ? t : new n.Vector3(-(1 / 0),-(1 / 0),-(1 / 0))
  39184. }
  39185. ,
  39186. n.Box3.prototype = {
  39187. constructor: n.Box3,
  39188. set: function(e, t) {
  39189. return this.min.copy(e),
  39190. this.max.copy(t),
  39191. this
  39192. },
  39193. setFromArray: function(e) {
  39194. this.makeEmpty();
  39195. 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) {
  39196. var c = e[s]
  39197. , h = e[s + 1]
  39198. , u = e[s + 2];
  39199. c < t && (t = c),
  39200. h < i && (i = h),
  39201. u < n && (n = u),
  39202. c > r && (r = c),
  39203. h > o && (o = h),
  39204. u > a && (a = u)
  39205. }
  39206. this.min.set(t, i, n),
  39207. this.max.set(r, o, a)
  39208. },
  39209. setFromPoints: function(e) {
  39210. this.makeEmpty();
  39211. for (var t = 0, i = e.length; t < i; t++)
  39212. this.expandByPoint(e[t]);
  39213. return this
  39214. },
  39215. setFromCenterAndSize: function() {
  39216. var e = new n.Vector3;
  39217. return function(t, i) {
  39218. var n = e.copy(i).multiplyScalar(.5);
  39219. return this.min.copy(t).sub(n),
  39220. this.max.copy(t).add(n),
  39221. this
  39222. }
  39223. }(),
  39224. setFromObject: function() {
  39225. var e;
  39226. return function(t) {
  39227. void 0 === e && (e = new n.Box3);
  39228. var i = this;
  39229. return this.makeEmpty(),
  39230. t.updateMatrixWorld(!0),
  39231. t.traverse(function(t) {
  39232. var n = t.geometry;
  39233. void 0 !== n && (null === n.boundingBox && n.computeBoundingBox(),
  39234. n.boundingBox.isEmpty() === !1 && (e.copy(n.boundingBox),
  39235. e.applyMatrix4(t.matrixWorld),
  39236. i.union(e)))
  39237. }),
  39238. this
  39239. }
  39240. }(),
  39241. clone: function() {
  39242. return (new this.constructor).copy(this)
  39243. },
  39244. copy: function(e) {
  39245. return this.min.copy(e.min),
  39246. this.max.copy(e.max),
  39247. this
  39248. },
  39249. makeEmpty: function() {
  39250. return this.min.x = this.min.y = this.min.z = +(1 / 0),
  39251. this.max.x = this.max.y = this.max.z = -(1 / 0),
  39252. this
  39253. },
  39254. isEmpty: function() {
  39255. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  39256. },
  39257. center: function(e) {
  39258. var t = e || new n.Vector3;
  39259. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  39260. },
  39261. size: function(e) {
  39262. var t = e || new n.Vector3;
  39263. return t.subVectors(this.max, this.min)
  39264. },
  39265. expandByPoint: function(e) {
  39266. return this.min.min(e),
  39267. this.max.max(e),
  39268. this
  39269. },
  39270. expandByVector: function(e) {
  39271. return this.min.sub(e),
  39272. this.max.add(e),
  39273. this
  39274. },
  39275. expandByScalar: function(e) {
  39276. return this.min.addScalar(-e),
  39277. this.max.addScalar(e),
  39278. this
  39279. },
  39280. containsPoint: function(e) {
  39281. 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)
  39282. },
  39283. containsBox: function(e) {
  39284. 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
  39285. },
  39286. getParameter: function(e, t) {
  39287. var i = t || new n.Vector3;
  39288. 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))
  39289. },
  39290. intersectsBox: function(e) {
  39291. 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)
  39292. },
  39293. intersectsSphere: function() {
  39294. var e;
  39295. return function(t) {
  39296. return void 0 === e && (e = new n.Vector3),
  39297. this.clampPoint(t.center, e),
  39298. e.distanceToSquared(t.center) <= t.radius * t.radius
  39299. }
  39300. }(),
  39301. intersectsPlane: function(e) {
  39302. var t, i;
  39303. return e.normal.x > 0 ? (t = e.normal.x * this.min.x,
  39304. i = e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  39305. i = e.normal.x * this.min.x),
  39306. e.normal.y > 0 ? (t += e.normal.y * this.min.y,
  39307. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  39308. i += e.normal.y * this.min.y),
  39309. e.normal.z > 0 ? (t += e.normal.z * this.min.z,
  39310. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  39311. i += e.normal.z * this.min.z),
  39312. t <= e.constant && i >= e.constant
  39313. },
  39314. clampPoint: function(e, t) {
  39315. var i = t || new n.Vector3;
  39316. return i.copy(e).clamp(this.min, this.max)
  39317. },
  39318. distanceToPoint: function() {
  39319. var e = new n.Vector3;
  39320. return function(t) {
  39321. var i = e.copy(t).clamp(this.min, this.max);
  39322. return i.sub(t).length()
  39323. }
  39324. }(),
  39325. getBoundingSphere: function() {
  39326. var e = new n.Vector3;
  39327. return function(t) {
  39328. var i = t || new n.Sphere;
  39329. return i.center = this.center(),
  39330. i.radius = .5 * this.size(e).length(),
  39331. i
  39332. }
  39333. }(),
  39334. intersect: function(e) {
  39335. return this.min.max(e.min),
  39336. this.max.min(e.max),
  39337. this
  39338. },
  39339. union: function(e) {
  39340. return this.min.min(e.min),
  39341. this.max.max(e.max),
  39342. this
  39343. },
  39344. applyMatrix4: function() {
  39345. 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];
  39346. return function(t) {
  39347. return e[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t),
  39348. e[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t),
  39349. e[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t),
  39350. e[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t),
  39351. e[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t),
  39352. e[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t),
  39353. e[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t),
  39354. e[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t),
  39355. this.makeEmpty(),
  39356. this.setFromPoints(e),
  39357. this
  39358. }
  39359. }(),
  39360. translate: function(e) {
  39361. return this.min.add(e),
  39362. this.max.add(e),
  39363. this
  39364. },
  39365. equals: function(e) {
  39366. return e.min.equals(this.min) && e.max.equals(this.max)
  39367. }
  39368. },
  39369. n.Matrix3 = function() {
  39370. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  39371. arguments.length > 0 && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  39372. }
  39373. ,
  39374. n.Matrix3.prototype = {
  39375. constructor: n.Matrix3,
  39376. set: function(e, t, i, n, r, o, a, s, l) {
  39377. var c = this.elements;
  39378. return c[0] = e,
  39379. c[1] = n,
  39380. c[2] = a,
  39381. c[3] = t,
  39382. c[4] = r,
  39383. c[5] = s,
  39384. c[6] = i,
  39385. c[7] = o,
  39386. c[8] = l,
  39387. this
  39388. },
  39389. identity: function() {
  39390. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  39391. this
  39392. },
  39393. clone: function() {
  39394. return (new this.constructor).fromArray(this.elements)
  39395. },
  39396. copy: function(e) {
  39397. var t = e.elements;
  39398. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  39399. this
  39400. },
  39401. setFromMatrix4: function(e) {
  39402. var t = e.elements;
  39403. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  39404. this
  39405. },
  39406. applyToVector3Array: function() {
  39407. var e;
  39408. return function(t, i, r) {
  39409. void 0 === e && (e = new n.Vector3),
  39410. void 0 === i && (i = 0),
  39411. void 0 === r && (r = t.length);
  39412. for (var o = 0, a = i; o < r; o += 3,
  39413. a += 3)
  39414. e.fromArray(t, a),
  39415. e.applyMatrix3(this),
  39416. e.toArray(t, a);
  39417. return t
  39418. }
  39419. }(),
  39420. applyToBuffer: function() {
  39421. var e;
  39422. return function(t, i, r) {
  39423. void 0 === e && (e = new n.Vector3),
  39424. void 0 === i && (i = 0),
  39425. void 0 === r && (r = t.length / t.itemSize);
  39426. for (var o = 0, a = i; o < r; o++,
  39427. a++)
  39428. e.x = t.getX(a),
  39429. e.y = t.getY(a),
  39430. e.z = t.getZ(a),
  39431. e.applyMatrix3(this),
  39432. t.setXYZ(e.x, e.y, e.z);
  39433. return t
  39434. }
  39435. }(),
  39436. multiplyScalar: function(e) {
  39437. var t = this.elements;
  39438. return t[0] *= e,
  39439. t[3] *= e,
  39440. t[6] *= e,
  39441. t[1] *= e,
  39442. t[4] *= e,
  39443. t[7] *= e,
  39444. t[2] *= e,
  39445. t[5] *= e,
  39446. t[8] *= e,
  39447. this
  39448. },
  39449. determinant: function() {
  39450. var e = this.elements
  39451. , t = e[0]
  39452. , i = e[1]
  39453. , n = e[2]
  39454. , r = e[3]
  39455. , o = e[4]
  39456. , a = e[5]
  39457. , s = e[6]
  39458. , l = e[7]
  39459. , c = e[8];
  39460. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  39461. },
  39462. getInverse: function(e, t) {
  39463. e instanceof n.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  39464. var i = e.elements
  39465. , r = this.elements
  39466. , o = i[0]
  39467. , a = i[1]
  39468. , s = i[2]
  39469. , l = i[3]
  39470. , c = i[4]
  39471. , h = i[5]
  39472. , u = i[6]
  39473. , d = i[7]
  39474. , p = i[8]
  39475. , f = p * c - h * d
  39476. , g = h * u - p * l
  39477. , m = d * l - c * u
  39478. , v = o * f + a * g + s * m;
  39479. if (0 === v) {
  39480. var A = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  39481. if (t)
  39482. throw new Error(A);
  39483. return console.warn(A),
  39484. this.identity()
  39485. }
  39486. return r[0] = f,
  39487. r[1] = s * d - p * a,
  39488. r[2] = h * a - s * c,
  39489. r[3] = g,
  39490. r[4] = p * o - s * u,
  39491. r[5] = s * l - h * o,
  39492. r[6] = m,
  39493. r[7] = a * u - d * o,
  39494. r[8] = c * o - a * l,
  39495. this.multiplyScalar(1 / v)
  39496. },
  39497. transpose: function() {
  39498. var e, t = this.elements;
  39499. return e = t[1],
  39500. t[1] = t[3],
  39501. t[3] = e,
  39502. e = t[2],
  39503. t[2] = t[6],
  39504. t[6] = e,
  39505. e = t[5],
  39506. t[5] = t[7],
  39507. t[7] = e,
  39508. this
  39509. },
  39510. flattenToArrayOffset: function(e, t) {
  39511. var i = this.elements;
  39512. return e[t] = i[0],
  39513. e[t + 1] = i[1],
  39514. e[t + 2] = i[2],
  39515. e[t + 3] = i[3],
  39516. e[t + 4] = i[4],
  39517. e[t + 5] = i[5],
  39518. e[t + 6] = i[6],
  39519. e[t + 7] = i[7],
  39520. e[t + 8] = i[8],
  39521. e
  39522. },
  39523. getNormalMatrix: function(e) {
  39524. return this.setFromMatrix4(e).getInverse(this).transpose()
  39525. },
  39526. transposeIntoArray: function(e) {
  39527. var t = this.elements;
  39528. return e[0] = t[0],
  39529. e[1] = t[3],
  39530. e[2] = t[6],
  39531. e[3] = t[1],
  39532. e[4] = t[4],
  39533. e[5] = t[7],
  39534. e[6] = t[2],
  39535. e[7] = t[5],
  39536. e[8] = t[8],
  39537. this
  39538. },
  39539. fromArray: function(e) {
  39540. return this.elements.set(e),
  39541. this
  39542. },
  39543. toArray: function() {
  39544. var e = this.elements;
  39545. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  39546. }
  39547. },
  39548. n.Matrix4 = function() {
  39549. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  39550. arguments.length > 0 && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  39551. }
  39552. ,
  39553. n.Matrix4.prototype = {
  39554. constructor: n.Matrix4,
  39555. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  39556. var m = this.elements;
  39557. return m[0] = e,
  39558. m[4] = t,
  39559. m[8] = i,
  39560. m[12] = n,
  39561. m[1] = r,
  39562. m[5] = o,
  39563. m[9] = a,
  39564. m[13] = s,
  39565. m[2] = l,
  39566. m[6] = c,
  39567. m[10] = h,
  39568. m[14] = u,
  39569. m[3] = d,
  39570. m[7] = p,
  39571. m[11] = f,
  39572. m[15] = g,
  39573. this
  39574. },
  39575. identity: function() {
  39576. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39577. this
  39578. },
  39579. clone: function() {
  39580. return (new n.Matrix4).fromArray(this.elements)
  39581. },
  39582. copy: function(e) {
  39583. return this.elements.set(e.elements),
  39584. this
  39585. },
  39586. copyPosition: function(e) {
  39587. var t = this.elements
  39588. , i = e.elements;
  39589. return t[12] = i[12],
  39590. t[13] = i[13],
  39591. t[14] = i[14],
  39592. this
  39593. },
  39594. extractBasis: function(e, t, i) {
  39595. return e.setFromMatrixColumn(this, 0),
  39596. t.setFromMatrixColumn(this, 1),
  39597. i.setFromMatrixColumn(this, 2),
  39598. this
  39599. },
  39600. makeBasis: function(e, t, i) {
  39601. 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),
  39602. this
  39603. },
  39604. extractRotation: function() {
  39605. var e;
  39606. return function(t) {
  39607. void 0 === e && (e = new n.Vector3);
  39608. var i = this.elements
  39609. , r = t.elements
  39610. , o = 1 / e.setFromMatrixColumn(t, 0).length()
  39611. , a = 1 / e.setFromMatrixColumn(t, 1).length()
  39612. , s = 1 / e.setFromMatrixColumn(t, 2).length();
  39613. return i[0] = r[0] * o,
  39614. i[1] = r[1] * o,
  39615. i[2] = r[2] * o,
  39616. i[4] = r[4] * a,
  39617. i[5] = r[5] * a,
  39618. i[6] = r[6] * a,
  39619. i[8] = r[8] * s,
  39620. i[9] = r[9] * s,
  39621. i[10] = r[10] * s,
  39622. this
  39623. }
  39624. }(),
  39625. makeRotationFromEuler: function(e) {
  39626. e instanceof n.Euler == !1 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39627. var t = this.elements
  39628. , i = e.x
  39629. , r = e.y
  39630. , o = e.z
  39631. , a = Math.cos(i)
  39632. , s = Math.sin(i)
  39633. , l = Math.cos(r)
  39634. , c = Math.sin(r)
  39635. , h = Math.cos(o)
  39636. , u = Math.sin(o);
  39637. if ("XYZ" === e.order) {
  39638. var d = a * h
  39639. , p = a * u
  39640. , f = s * h
  39641. , g = s * u;
  39642. t[0] = l * h,
  39643. t[4] = -l * u,
  39644. t[8] = c,
  39645. t[1] = p + f * c,
  39646. t[5] = d - g * c,
  39647. t[9] = -s * l,
  39648. t[2] = g - d * c,
  39649. t[6] = f + p * c,
  39650. t[10] = a * l
  39651. } else if ("YXZ" === e.order) {
  39652. var m = l * h
  39653. , v = l * u
  39654. , A = c * h
  39655. , y = c * u;
  39656. t[0] = m + y * s,
  39657. t[4] = A * s - v,
  39658. t[8] = a * c,
  39659. t[1] = a * u,
  39660. t[5] = a * h,
  39661. t[9] = -s,
  39662. t[2] = v * s - A,
  39663. t[6] = y + m * s,
  39664. t[10] = a * l
  39665. } else if ("ZXY" === e.order) {
  39666. var m = l * h
  39667. , v = l * u
  39668. , A = c * h
  39669. , y = c * u;
  39670. t[0] = m - y * s,
  39671. t[4] = -a * u,
  39672. t[8] = A + v * s,
  39673. t[1] = v + A * s,
  39674. t[5] = a * h,
  39675. t[9] = y - m * s,
  39676. t[2] = -a * c,
  39677. t[6] = s,
  39678. t[10] = a * l
  39679. } else if ("ZYX" === e.order) {
  39680. var d = a * h
  39681. , p = a * u
  39682. , f = s * h
  39683. , g = s * u;
  39684. t[0] = l * h,
  39685. t[4] = f * c - p,
  39686. t[8] = d * c + g,
  39687. t[1] = l * u,
  39688. t[5] = g * c + d,
  39689. t[9] = p * c - f,
  39690. t[2] = -c,
  39691. t[6] = s * l,
  39692. t[10] = a * l
  39693. } else if ("YZX" === e.order) {
  39694. var C = a * l
  39695. , I = a * c
  39696. , E = s * l
  39697. , b = s * c;
  39698. t[0] = l * h,
  39699. t[4] = b - C * u,
  39700. t[8] = E * u + I,
  39701. t[1] = u,
  39702. t[5] = a * h,
  39703. t[9] = -s * h,
  39704. t[2] = -c * h,
  39705. t[6] = I * u + E,
  39706. t[10] = C - b * u
  39707. } else if ("XZY" === e.order) {
  39708. var C = a * l
  39709. , I = a * c
  39710. , E = s * l
  39711. , b = s * c;
  39712. t[0] = l * h,
  39713. t[4] = -u,
  39714. t[8] = c * h,
  39715. t[1] = C * u + b,
  39716. t[5] = a * h,
  39717. t[9] = I * u - E,
  39718. t[2] = E * u - I,
  39719. t[6] = s * h,
  39720. t[10] = b * u + C
  39721. }
  39722. return t[3] = 0,
  39723. t[7] = 0,
  39724. t[11] = 0,
  39725. t[12] = 0,
  39726. t[13] = 0,
  39727. t[14] = 0,
  39728. t[15] = 1,
  39729. this
  39730. },
  39731. makeRotationFromQuaternion: function(e) {
  39732. var t = this.elements
  39733. , i = e.x
  39734. , n = e.y
  39735. , r = e.z
  39736. , o = e.w
  39737. , a = i + i
  39738. , s = n + n
  39739. , l = r + r
  39740. , c = i * a
  39741. , h = i * s
  39742. , u = i * l
  39743. , d = n * s
  39744. , p = n * l
  39745. , f = r * l
  39746. , g = o * a
  39747. , m = o * s
  39748. , v = o * l;
  39749. return t[0] = 1 - (d + f),
  39750. t[4] = h - v,
  39751. t[8] = u + m,
  39752. t[1] = h + v,
  39753. t[5] = 1 - (c + f),
  39754. t[9] = p - g,
  39755. t[2] = u - m,
  39756. t[6] = p + g,
  39757. t[10] = 1 - (c + d),
  39758. t[3] = 0,
  39759. t[7] = 0,
  39760. t[11] = 0,
  39761. t[12] = 0,
  39762. t[13] = 0,
  39763. t[14] = 0,
  39764. t[15] = 1,
  39765. this
  39766. },
  39767. lookAt: function() {
  39768. var e, t, i;
  39769. return function(r, o, a) {
  39770. void 0 === e && (e = new n.Vector3),
  39771. void 0 === t && (t = new n.Vector3),
  39772. void 0 === i && (i = new n.Vector3);
  39773. var s = this.elements;
  39774. return i.subVectors(r, o).normalize(),
  39775. 0 === i.lengthSq() && (i.z = 1),
  39776. e.crossVectors(a, i).normalize(),
  39777. 0 === e.lengthSq() && (i.x += 1e-4,
  39778. e.crossVectors(a, i).normalize()),
  39779. t.crossVectors(i, e),
  39780. s[0] = e.x,
  39781. s[4] = t.x,
  39782. s[8] = i.x,
  39783. s[1] = e.y,
  39784. s[5] = t.y,
  39785. s[9] = i.y,
  39786. s[2] = e.z,
  39787. s[6] = t.z,
  39788. s[10] = i.z,
  39789. this
  39790. }
  39791. }(),
  39792. multiply: function(e, t) {
  39793. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  39794. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  39795. },
  39796. multiplyMatrices: function(e, t) {
  39797. var i = e.elements
  39798. , n = t.elements
  39799. , r = this.elements
  39800. , o = i[0]
  39801. , a = i[4]
  39802. , s = i[8]
  39803. , l = i[12]
  39804. , c = i[1]
  39805. , h = i[5]
  39806. , u = i[9]
  39807. , d = i[13]
  39808. , p = i[2]
  39809. , f = i[6]
  39810. , g = i[10]
  39811. , m = i[14]
  39812. , v = i[3]
  39813. , A = i[7]
  39814. , y = i[11]
  39815. , C = i[15]
  39816. , I = n[0]
  39817. , E = n[4]
  39818. , b = n[8]
  39819. , w = n[12]
  39820. , _ = n[1]
  39821. , T = n[5]
  39822. , x = n[9]
  39823. , S = n[13]
  39824. , M = n[2]
  39825. , R = n[6]
  39826. , P = n[10]
  39827. , O = n[14]
  39828. , L = n[3]
  39829. , D = n[7]
  39830. , N = n[11]
  39831. , B = n[15];
  39832. return r[0] = o * I + a * _ + s * M + l * L,
  39833. r[4] = o * E + a * T + s * R + l * D,
  39834. r[8] = o * b + a * x + s * P + l * N,
  39835. r[12] = o * w + a * S + s * O + l * B,
  39836. r[1] = c * I + h * _ + u * M + d * L,
  39837. r[5] = c * E + h * T + u * R + d * D,
  39838. r[9] = c * b + h * x + u * P + d * N,
  39839. r[13] = c * w + h * S + u * O + d * B,
  39840. r[2] = p * I + f * _ + g * M + m * L,
  39841. r[6] = p * E + f * T + g * R + m * D,
  39842. r[10] = p * b + f * x + g * P + m * N,
  39843. r[14] = p * w + f * S + g * O + m * B,
  39844. r[3] = v * I + A * _ + y * M + C * L,
  39845. r[7] = v * E + A * T + y * R + C * D,
  39846. r[11] = v * b + A * x + y * P + C * N,
  39847. r[15] = v * w + A * S + y * O + C * B,
  39848. this
  39849. },
  39850. multiplyToArray: function(e, t, i) {
  39851. var n = this.elements;
  39852. return this.multiplyMatrices(e, t),
  39853. i[0] = n[0],
  39854. i[1] = n[1],
  39855. i[2] = n[2],
  39856. i[3] = n[3],
  39857. i[4] = n[4],
  39858. i[5] = n[5],
  39859. i[6] = n[6],
  39860. i[7] = n[7],
  39861. i[8] = n[8],
  39862. i[9] = n[9],
  39863. i[10] = n[10],
  39864. i[11] = n[11],
  39865. i[12] = n[12],
  39866. i[13] = n[13],
  39867. i[14] = n[14],
  39868. i[15] = n[15],
  39869. this
  39870. },
  39871. multiplyScalar: function(e) {
  39872. var t = this.elements;
  39873. return t[0] *= e,
  39874. t[4] *= e,
  39875. t[8] *= e,
  39876. t[12] *= e,
  39877. t[1] *= e,
  39878. t[5] *= e,
  39879. t[9] *= e,
  39880. t[13] *= e,
  39881. t[2] *= e,
  39882. t[6] *= e,
  39883. t[10] *= e,
  39884. t[14] *= e,
  39885. t[3] *= e,
  39886. t[7] *= e,
  39887. t[11] *= e,
  39888. t[15] *= e,
  39889. this
  39890. },
  39891. applyToVector3Array: function() {
  39892. var e;
  39893. return function(t, i, r) {
  39894. void 0 === e && (e = new n.Vector3),
  39895. void 0 === i && (i = 0),
  39896. void 0 === r && (r = t.length);
  39897. for (var o = 0, a = i; o < r; o += 3,
  39898. a += 3)
  39899. e.fromArray(t, a),
  39900. e.applyMatrix4(this),
  39901. e.toArray(t, a);
  39902. return t
  39903. }
  39904. }(),
  39905. applyToBuffer: function() {
  39906. var e;
  39907. return function(t, i, r) {
  39908. void 0 === e && (e = new n.Vector3),
  39909. void 0 === i && (i = 0),
  39910. void 0 === r && (r = t.length / t.itemSize);
  39911. for (var o = 0, a = i; o < r; o++,
  39912. a++)
  39913. e.x = t.getX(a),
  39914. e.y = t.getY(a),
  39915. e.z = t.getZ(a),
  39916. e.applyMatrix4(this),
  39917. t.setXYZ(e.x, e.y, e.z);
  39918. return t
  39919. }
  39920. }(),
  39921. determinant: function() {
  39922. var e = this.elements
  39923. , t = e[0]
  39924. , i = e[4]
  39925. , n = e[8]
  39926. , r = e[12]
  39927. , o = e[1]
  39928. , a = e[5]
  39929. , s = e[9]
  39930. , l = e[13]
  39931. , c = e[2]
  39932. , h = e[6]
  39933. , u = e[10]
  39934. , d = e[14]
  39935. , p = e[3]
  39936. , f = e[7]
  39937. , g = e[11]
  39938. , m = e[15];
  39939. 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)
  39940. },
  39941. transpose: function() {
  39942. var e, t = this.elements;
  39943. return e = t[1],
  39944. t[1] = t[4],
  39945. t[4] = e,
  39946. e = t[2],
  39947. t[2] = t[8],
  39948. t[8] = e,
  39949. e = t[6],
  39950. t[6] = t[9],
  39951. t[9] = e,
  39952. e = t[3],
  39953. t[3] = t[12],
  39954. t[12] = e,
  39955. e = t[7],
  39956. t[7] = t[13],
  39957. t[13] = e,
  39958. e = t[11],
  39959. t[11] = t[14],
  39960. t[14] = e,
  39961. this
  39962. },
  39963. flattenToArrayOffset: function(e, t) {
  39964. var i = this.elements;
  39965. return e[t] = i[0],
  39966. e[t + 1] = i[1],
  39967. e[t + 2] = i[2],
  39968. e[t + 3] = i[3],
  39969. e[t + 4] = i[4],
  39970. e[t + 5] = i[5],
  39971. e[t + 6] = i[6],
  39972. e[t + 7] = i[7],
  39973. e[t + 8] = i[8],
  39974. e[t + 9] = i[9],
  39975. e[t + 10] = i[10],
  39976. e[t + 11] = i[11],
  39977. e[t + 12] = i[12],
  39978. e[t + 13] = i[13],
  39979. e[t + 14] = i[14],
  39980. e[t + 15] = i[15],
  39981. e
  39982. },
  39983. getPosition: function() {
  39984. var e;
  39985. return function() {
  39986. return void 0 === e && (e = new n.Vector3),
  39987. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  39988. e.setFromMatrixColumn(this, 3)
  39989. }
  39990. }(),
  39991. setPosition: function(e) {
  39992. var t = this.elements;
  39993. return t[12] = e.x,
  39994. t[13] = e.y,
  39995. t[14] = e.z,
  39996. this
  39997. },
  39998. getInverse: function(e, t) {
  39999. var i = this.elements
  40000. , n = e.elements
  40001. , r = n[0]
  40002. , o = n[1]
  40003. , a = n[2]
  40004. , s = n[3]
  40005. , l = n[4]
  40006. , c = n[5]
  40007. , h = n[6]
  40008. , u = n[7]
  40009. , d = n[8]
  40010. , p = n[9]
  40011. , f = n[10]
  40012. , g = n[11]
  40013. , m = n[12]
  40014. , v = n[13]
  40015. , A = n[14]
  40016. , y = n[15]
  40017. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  40018. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  40019. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  40020. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  40021. , w = r * C + o * I + a * E + s * b;
  40022. if (0 === w) {
  40023. var _ = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  40024. if (t)
  40025. throw new Error(_);
  40026. return console.warn(_),
  40027. this.identity()
  40028. }
  40029. return i[0] = C,
  40030. i[1] = v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y,
  40031. i[2] = c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y,
  40032. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  40033. i[4] = I,
  40034. i[5] = d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y,
  40035. i[6] = m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y,
  40036. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  40037. i[8] = E,
  40038. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y,
  40039. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y,
  40040. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  40041. i[12] = b,
  40042. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A,
  40043. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A,
  40044. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  40045. this.multiplyScalar(1 / w)
  40046. },
  40047. scale: function(e) {
  40048. var t = this.elements
  40049. , i = e.x
  40050. , n = e.y
  40051. , r = e.z;
  40052. return t[0] *= i,
  40053. t[4] *= n,
  40054. t[8] *= r,
  40055. t[1] *= i,
  40056. t[5] *= n,
  40057. t[9] *= r,
  40058. t[2] *= i,
  40059. t[6] *= n,
  40060. t[10] *= r,
  40061. t[3] *= i,
  40062. t[7] *= n,
  40063. t[11] *= r,
  40064. this
  40065. },
  40066. getMaxScaleOnAxis: function() {
  40067. var e = this.elements
  40068. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  40069. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  40070. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  40071. return Math.sqrt(Math.max(t, i, n))
  40072. },
  40073. makeTranslation: function(e, t, i) {
  40074. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  40075. this
  40076. },
  40077. makeRotationX: function(e) {
  40078. var t = Math.cos(e)
  40079. , i = Math.sin(e);
  40080. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  40081. this
  40082. },
  40083. makeRotationY: function(e) {
  40084. var t = Math.cos(e)
  40085. , i = Math.sin(e);
  40086. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  40087. this
  40088. },
  40089. makeRotationZ: function(e) {
  40090. var t = Math.cos(e)
  40091. , i = Math.sin(e);
  40092. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  40093. this
  40094. },
  40095. makeRotationAxis: function(e, t) {
  40096. var i = Math.cos(t)
  40097. , n = Math.sin(t)
  40098. , r = 1 - i
  40099. , o = e.x
  40100. , a = e.y
  40101. , s = e.z
  40102. , l = r * o
  40103. , c = r * a;
  40104. 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),
  40105. this
  40106. },
  40107. makeScale: function(e, t, i) {
  40108. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  40109. this
  40110. },
  40111. compose: function(e, t, i) {
  40112. return this.makeRotationFromQuaternion(t),
  40113. this.scale(i),
  40114. this.setPosition(e),
  40115. this
  40116. },
  40117. decompose: function() {
  40118. var e, t;
  40119. return function(i, r, o) {
  40120. void 0 === e && (e = new n.Vector3),
  40121. void 0 === t && (t = new n.Matrix4);
  40122. var a = this.elements
  40123. , s = e.set(a[0], a[1], a[2]).length()
  40124. , l = e.set(a[4], a[5], a[6]).length()
  40125. , c = e.set(a[8], a[9], a[10]).length()
  40126. , h = this.determinant();
  40127. h < 0 && (s = -s),
  40128. i.x = a[12],
  40129. i.y = a[13],
  40130. i.z = a[14],
  40131. t.elements.set(this.elements);
  40132. var u = 1 / s
  40133. , d = 1 / l
  40134. , p = 1 / c;
  40135. return t.elements[0] *= u,
  40136. t.elements[1] *= u,
  40137. t.elements[2] *= u,
  40138. t.elements[4] *= d,
  40139. t.elements[5] *= d,
  40140. t.elements[6] *= d,
  40141. t.elements[8] *= p,
  40142. t.elements[9] *= p,
  40143. t.elements[10] *= p,
  40144. r.setFromRotationMatrix(t),
  40145. o.x = s,
  40146. o.y = l,
  40147. o.z = c,
  40148. this
  40149. }
  40150. }(),
  40151. makeFrustum: function(e, t, i, n, r, o) {
  40152. var a = this.elements
  40153. , s = 2 * r / (t - e)
  40154. , l = 2 * r / (n - i)
  40155. , c = (t + e) / (t - e)
  40156. , h = (n + i) / (n - i)
  40157. , u = -(o + r) / (o - r)
  40158. , d = -2 * o * r / (o - r);
  40159. return a[0] = s,
  40160. a[4] = 0,
  40161. a[8] = c,
  40162. a[12] = 0,
  40163. a[1] = 0,
  40164. a[5] = l,
  40165. a[9] = h,
  40166. a[13] = 0,
  40167. a[2] = 0,
  40168. a[6] = 0,
  40169. a[10] = u,
  40170. a[14] = d,
  40171. a[3] = 0,
  40172. a[7] = 0,
  40173. a[11] = -1,
  40174. a[15] = 0,
  40175. this
  40176. },
  40177. makePerspective: function(e, t, i, r) {
  40178. var o = i * Math.tan(n.Math.degToRad(.5 * e))
  40179. , a = -o
  40180. , s = a * t
  40181. , l = o * t;
  40182. return this.makeFrustum(s, l, a, o, i, r)
  40183. },
  40184. makeOrthographic: function(e, t, i, n, r, o) {
  40185. var a = this.elements
  40186. , s = 1 / (t - e)
  40187. , l = 1 / (i - n)
  40188. , c = 1 / (o - r)
  40189. , h = (t + e) * s
  40190. , u = (i + n) * l
  40191. , d = (o + r) * c;
  40192. return a[0] = 2 * s,
  40193. a[4] = 0,
  40194. a[8] = 0,
  40195. a[12] = -h,
  40196. a[1] = 0,
  40197. a[5] = 2 * l,
  40198. a[9] = 0,
  40199. a[13] = -u,
  40200. a[2] = 0,
  40201. a[6] = 0,
  40202. a[10] = -2 * c,
  40203. a[14] = -d,
  40204. a[3] = 0,
  40205. a[7] = 0,
  40206. a[11] = 0,
  40207. a[15] = 1,
  40208. this
  40209. },
  40210. equals: function(e) {
  40211. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  40212. if (t[n] !== i[n])
  40213. return !1;
  40214. return !0
  40215. },
  40216. fromArray: function(e) {
  40217. return this.elements.set(e),
  40218. this
  40219. },
  40220. toArray: function() {
  40221. var e = this.elements;
  40222. 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]]
  40223. }
  40224. },
  40225. n.Ray = function(e, t) {
  40226. this.origin = void 0 !== e ? e : new n.Vector3,
  40227. this.direction = void 0 !== t ? t : new n.Vector3
  40228. }
  40229. ,
  40230. n.Ray.prototype = {
  40231. constructor: n.Ray,
  40232. set: function(e, t) {
  40233. return this.origin.copy(e),
  40234. this.direction.copy(t),
  40235. this
  40236. },
  40237. clone: function() {
  40238. return (new this.constructor).copy(this)
  40239. },
  40240. copy: function(e) {
  40241. return this.origin.copy(e.origin),
  40242. this.direction.copy(e.direction),
  40243. this
  40244. },
  40245. at: function(e, t) {
  40246. var i = t || new n.Vector3;
  40247. return i.copy(this.direction).multiplyScalar(e).add(this.origin)
  40248. },
  40249. lookAt: function(e) {
  40250. this.direction.copy(e).sub(this.origin).normalize()
  40251. },
  40252. recast: function() {
  40253. var e = new n.Vector3;
  40254. return function(t) {
  40255. return this.origin.copy(this.at(t, e)),
  40256. this
  40257. }
  40258. }(),
  40259. closestPointToPoint: function(e, t) {
  40260. var i = t || new n.Vector3;
  40261. i.subVectors(e, this.origin);
  40262. var r = i.dot(this.direction);
  40263. return r < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(r).add(this.origin)
  40264. },
  40265. distanceToPoint: function(e) {
  40266. return Math.sqrt(this.distanceSqToPoint(e))
  40267. },
  40268. distanceSqToPoint: function() {
  40269. var e = new n.Vector3;
  40270. return function(t) {
  40271. var i = e.subVectors(t, this.origin).dot(this.direction);
  40272. return i < 0 ? this.origin.distanceToSquared(t) : (e.copy(this.direction).multiplyScalar(i).add(this.origin),
  40273. e.distanceToSquared(t))
  40274. }
  40275. }(),
  40276. distanceSqToSegment: function() {
  40277. var e = new n.Vector3
  40278. , t = new n.Vector3
  40279. , i = new n.Vector3;
  40280. return function(n, r, o, a) {
  40281. e.copy(n).add(r).multiplyScalar(.5),
  40282. t.copy(r).sub(n).normalize(),
  40283. i.copy(this.origin).sub(e);
  40284. 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);
  40285. if (m > 0)
  40286. if (s = d * f - p,
  40287. l = d * p - f,
  40288. h = u * m,
  40289. s >= 0)
  40290. if (l >= -h)
  40291. if (l <= h) {
  40292. var v = 1 / m;
  40293. s *= v,
  40294. l *= v,
  40295. c = s * (s + d * l + 2 * p) + l * (d * s + l + 2 * f) + g
  40296. } else
  40297. l = u,
  40298. s = Math.max(0, -(d * l + p)),
  40299. c = -s * s + l * (l + 2 * f) + g;
  40300. else
  40301. l = -u,
  40302. s = Math.max(0, -(d * l + p)),
  40303. c = -s * s + l * (l + 2 * f) + g;
  40304. else
  40305. l <= -h ? (s = Math.max(0, -(-d * u + p)),
  40306. l = s > 0 ? -u : Math.min(Math.max(-u, -f), u),
  40307. c = -s * s + l * (l + 2 * f) + g) : l <= h ? (s = 0,
  40308. l = Math.min(Math.max(-u, -f), u),
  40309. c = l * (l + 2 * f) + g) : (s = Math.max(0, -(d * u + p)),
  40310. l = s > 0 ? u : Math.min(Math.max(-u, -f), u),
  40311. c = -s * s + l * (l + 2 * f) + g);
  40312. else
  40313. l = d > 0 ? -u : u,
  40314. s = Math.max(0, -(d * l + p)),
  40315. c = -s * s + l * (l + 2 * f) + g;
  40316. return o && o.copy(this.direction).multiplyScalar(s).add(this.origin),
  40317. a && a.copy(t).multiplyScalar(l).add(e),
  40318. c
  40319. }
  40320. }(),
  40321. intersectSphere: function() {
  40322. var e = new n.Vector3;
  40323. return function(t, i) {
  40324. e.subVectors(t.center, this.origin);
  40325. var n = e.dot(this.direction)
  40326. , r = e.dot(e) - n * n
  40327. , o = t.radius * t.radius;
  40328. if (r > o)
  40329. return null;
  40330. var a = Math.sqrt(o - r)
  40331. , s = n - a
  40332. , l = n + a;
  40333. return s < 0 && l < 0 ? null : s < 0 ? this.at(l, i) : this.at(s, i)
  40334. }
  40335. }(),
  40336. intersectsSphere: function(e) {
  40337. return this.distanceToPoint(e.center) <= e.radius
  40338. },
  40339. distanceToPlane: function(e) {
  40340. var t = e.normal.dot(this.direction);
  40341. if (0 === t)
  40342. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  40343. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  40344. return i >= 0 ? i : null
  40345. },
  40346. intersectPlane: function(e, t) {
  40347. var i = this.distanceToPlane(e);
  40348. return null === i ? null : this.at(i, t)
  40349. },
  40350. intersectsPlane: function(e) {
  40351. var t = e.distanceToPoint(this.origin);
  40352. if (0 === t)
  40353. return !0;
  40354. var i = e.normal.dot(this.direction);
  40355. return i * t < 0
  40356. },
  40357. intersectBox: function(e, t) {
  40358. 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;
  40359. return l >= 0 ? (i = (e.min.x - u.x) * l,
  40360. n = (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  40361. n = (e.min.x - u.x) * l),
  40362. c >= 0 ? (r = (e.min.y - u.y) * c,
  40363. o = (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  40364. o = (e.min.y - u.y) * c),
  40365. i > o || r > n ? null : ((r > i || i !== i) && (i = r),
  40366. (o < n || n !== n) && (n = o),
  40367. h >= 0 ? (a = (e.min.z - u.z) * h,
  40368. s = (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  40369. s = (e.min.z - u.z) * h),
  40370. i > s || a > n ? null : ((a > i || i !== i) && (i = a),
  40371. (s < n || n !== n) && (n = s),
  40372. n < 0 ? null : this.at(i >= 0 ? i : n, t)))
  40373. },
  40374. intersectsBox: function() {
  40375. var e = new n.Vector3;
  40376. return function(t) {
  40377. return null !== this.intersectBox(t, e)
  40378. }
  40379. }(),
  40380. intersectTriangle: function() {
  40381. var e = new n.Vector3
  40382. , t = new n.Vector3
  40383. , i = new n.Vector3
  40384. , r = new n.Vector3;
  40385. return function(n, o, a, s, l) {
  40386. t.subVectors(o, n),
  40387. i.subVectors(a, n),
  40388. r.crossVectors(t, i);
  40389. var c, h = this.direction.dot(r);
  40390. if (h > 0) {
  40391. if (s)
  40392. return null;
  40393. c = 1
  40394. } else {
  40395. if (!(h < 0))
  40396. return null;
  40397. c = -1,
  40398. h = -h
  40399. }
  40400. e.subVectors(this.origin, n);
  40401. var u = c * this.direction.dot(i.crossVectors(e, i));
  40402. if (u < 0)
  40403. return null;
  40404. var d = c * this.direction.dot(t.cross(e));
  40405. if (d < 0)
  40406. return null;
  40407. if (u + d > h)
  40408. return null;
  40409. var p = -c * e.dot(r);
  40410. return p < 0 ? null : this.at(p / h, l)
  40411. }
  40412. }(),
  40413. applyMatrix4: function(e) {
  40414. return this.direction.add(this.origin).applyMatrix4(e),
  40415. this.origin.applyMatrix4(e),
  40416. this.direction.sub(this.origin),
  40417. this.direction.normalize(),
  40418. this
  40419. },
  40420. equals: function(e) {
  40421. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  40422. }
  40423. },
  40424. n.Sphere = function(e, t) {
  40425. this.center = void 0 !== e ? e : new n.Vector3,
  40426. this.radius = void 0 !== t ? t : 0
  40427. }
  40428. ,
  40429. n.Sphere.prototype = {
  40430. constructor: n.Sphere,
  40431. set: function(e, t) {
  40432. return this.center.copy(e),
  40433. this.radius = t,
  40434. this
  40435. },
  40436. setFromPoints: function() {
  40437. var e = new n.Box3;
  40438. return function(t, i) {
  40439. var n = this.center;
  40440. void 0 !== i ? n.copy(i) : e.setFromPoints(t).center(n);
  40441. for (var r = 0, o = 0, a = t.length; o < a; o++)
  40442. r = Math.max(r, n.distanceToSquared(t[o]));
  40443. return this.radius = Math.sqrt(r),
  40444. this
  40445. }
  40446. }(),
  40447. clone: function() {
  40448. return (new this.constructor).copy(this)
  40449. },
  40450. copy: function(e) {
  40451. return this.center.copy(e.center),
  40452. this.radius = e.radius,
  40453. this
  40454. },
  40455. empty: function() {
  40456. return this.radius <= 0
  40457. },
  40458. containsPoint: function(e) {
  40459. return e.distanceToSquared(this.center) <= this.radius * this.radius
  40460. },
  40461. distanceToPoint: function(e) {
  40462. return e.distanceTo(this.center) - this.radius
  40463. },
  40464. intersectsSphere: function(e) {
  40465. var t = this.radius + e.radius;
  40466. return e.center.distanceToSquared(this.center) <= t * t
  40467. },
  40468. intersectsBox: function(e) {
  40469. return e.intersectsSphere(this)
  40470. },
  40471. intersectsPlane: function(e) {
  40472. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  40473. },
  40474. clampPoint: function(e, t) {
  40475. var i = this.center.distanceToSquared(e)
  40476. , r = t || new n.Vector3;
  40477. return r.copy(e),
  40478. i > this.radius * this.radius && (r.sub(this.center).normalize(),
  40479. r.multiplyScalar(this.radius).add(this.center)),
  40480. r
  40481. },
  40482. getBoundingBox: function(e) {
  40483. var t = e || new n.Box3;
  40484. return t.set(this.center, this.center),
  40485. t.expandByScalar(this.radius),
  40486. t
  40487. },
  40488. applyMatrix4: function(e) {
  40489. return this.center.applyMatrix4(e),
  40490. this.radius = this.radius * e.getMaxScaleOnAxis(),
  40491. this
  40492. },
  40493. translate: function(e) {
  40494. return this.center.add(e),
  40495. this
  40496. },
  40497. equals: function(e) {
  40498. return e.center.equals(this.center) && e.radius === this.radius
  40499. }
  40500. },
  40501. n.Frustum = function(e, t, i, r, o, a) {
  40502. 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]
  40503. }
  40504. ,
  40505. n.Frustum.prototype = {
  40506. constructor: n.Frustum,
  40507. set: function(e, t, i, n, r, o) {
  40508. var a = this.planes;
  40509. return a[0].copy(e),
  40510. a[1].copy(t),
  40511. a[2].copy(i),
  40512. a[3].copy(n),
  40513. a[4].copy(r),
  40514. a[5].copy(o),
  40515. this
  40516. },
  40517. clone: function() {
  40518. return (new this.constructor).copy(this)
  40519. },
  40520. copy: function(e) {
  40521. for (var t = this.planes, i = 0; i < 6; i++)
  40522. t[i].copy(e.planes[i]);
  40523. return this
  40524. },
  40525. setFromMatrix: function(e) {
  40526. var t = this.planes
  40527. , i = e.elements
  40528. , n = i[0]
  40529. , r = i[1]
  40530. , o = i[2]
  40531. , a = i[3]
  40532. , s = i[4]
  40533. , l = i[5]
  40534. , c = i[6]
  40535. , h = i[7]
  40536. , u = i[8]
  40537. , d = i[9]
  40538. , p = i[10]
  40539. , f = i[11]
  40540. , g = i[12]
  40541. , m = i[13]
  40542. , v = i[14]
  40543. , A = i[15];
  40544. return t[0].setComponents(a - n, h - s, f - u, A - g).normalize(),
  40545. t[1].setComponents(a + n, h + s, f + u, A + g).normalize(),
  40546. t[2].setComponents(a + r, h + l, f + d, A + m).normalize(),
  40547. t[3].setComponents(a - r, h - l, f - d, A - m).normalize(),
  40548. t[4].setComponents(a - o, h - c, f - p, A - v).normalize(),
  40549. t[5].setComponents(a + o, h + c, f + p, A + v).normalize(),
  40550. this
  40551. },
  40552. intersectsObject: function() {
  40553. var e = new n.Sphere;
  40554. return function(t) {
  40555. var i = t.geometry;
  40556. return null === i.boundingSphere && i.computeBoundingSphere(),
  40557. e.copy(i.boundingSphere),
  40558. e.applyMatrix4(t.matrixWorld),
  40559. this.intersectsSphere(e)
  40560. }
  40561. }(),
  40562. intersectsSphere: function(e) {
  40563. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  40564. var o = t[r].distanceToPoint(i);
  40565. if (o < n)
  40566. return !1
  40567. }
  40568. return !0
  40569. },
  40570. intersectsBox: function() {
  40571. var e = new n.Vector3
  40572. , t = new n.Vector3;
  40573. return function(i) {
  40574. for (var n = this.planes, r = 0; r < 6; r++) {
  40575. var o = n[r];
  40576. e.x = o.normal.x > 0 ? i.min.x : i.max.x,
  40577. t.x = o.normal.x > 0 ? i.max.x : i.min.x,
  40578. e.y = o.normal.y > 0 ? i.min.y : i.max.y,
  40579. t.y = o.normal.y > 0 ? i.max.y : i.min.y,
  40580. e.z = o.normal.z > 0 ? i.min.z : i.max.z,
  40581. t.z = o.normal.z > 0 ? i.max.z : i.min.z;
  40582. var a = o.distanceToPoint(e)
  40583. , s = o.distanceToPoint(t);
  40584. if (a < 0 && s < 0)
  40585. return !1
  40586. }
  40587. return !0
  40588. }
  40589. }(),
  40590. containsPoint: function(e) {
  40591. for (var t = this.planes, i = 0; i < 6; i++)
  40592. if (t[i].distanceToPoint(e) < 0)
  40593. return !1;
  40594. return !0
  40595. }
  40596. },
  40597. n.Plane = function(e, t) {
  40598. this.normal = void 0 !== e ? e : new n.Vector3(1,0,0),
  40599. this.constant = void 0 !== t ? t : 0
  40600. }
  40601. ,
  40602. n.Plane.prototype = {
  40603. constructor: n.Plane,
  40604. set: function(e, t) {
  40605. return this.normal.copy(e),
  40606. this.constant = t,
  40607. this
  40608. },
  40609. setComponents: function(e, t, i, n) {
  40610. return this.normal.set(e, t, i),
  40611. this.constant = n,
  40612. this
  40613. },
  40614. setFromNormalAndCoplanarPoint: function(e, t) {
  40615. return this.normal.copy(e),
  40616. this.constant = -t.dot(this.normal),
  40617. this
  40618. },
  40619. setFromCoplanarPoints: function() {
  40620. var e = new n.Vector3
  40621. , t = new n.Vector3;
  40622. return function(i, n, r) {
  40623. var o = e.subVectors(r, n).cross(t.subVectors(i, n)).normalize();
  40624. return this.setFromNormalAndCoplanarPoint(o, i),
  40625. this
  40626. }
  40627. }(),
  40628. clone: function() {
  40629. return (new this.constructor).copy(this)
  40630. },
  40631. copy: function(e) {
  40632. return this.normal.copy(e.normal),
  40633. this.constant = e.constant,
  40634. this
  40635. },
  40636. normalize: function() {
  40637. var e = 1 / this.normal.length();
  40638. return this.normal.multiplyScalar(e),
  40639. this.constant *= e,
  40640. this
  40641. },
  40642. negate: function() {
  40643. return this.constant *= -1,
  40644. this.normal.negate(),
  40645. this
  40646. },
  40647. distanceToPoint: function(e) {
  40648. return this.normal.dot(e) + this.constant
  40649. },
  40650. distanceToSphere: function(e) {
  40651. return this.distanceToPoint(e.center) - e.radius
  40652. },
  40653. projectPoint: function(e, t) {
  40654. return this.orthoPoint(e, t).sub(e).negate()
  40655. },
  40656. orthoPoint: function(e, t) {
  40657. var i = this.distanceToPoint(e)
  40658. , r = t || new n.Vector3;
  40659. return r.copy(this.normal).multiplyScalar(i)
  40660. },
  40661. intersectLine: function() {
  40662. var e = new n.Vector3;
  40663. return function(t, i) {
  40664. var r = i || new n.Vector3
  40665. , o = t.delta(e)
  40666. , a = this.normal.dot(o);
  40667. if (0 !== a) {
  40668. var s = -(t.start.dot(this.normal) + this.constant) / a;
  40669. if (!(s < 0 || s > 1))
  40670. return r.copy(o).multiplyScalar(s).add(t.start)
  40671. } else if (0 === this.distanceToPoint(t.start))
  40672. return r.copy(t.start)
  40673. }
  40674. }(),
  40675. intersectsLine: function(e) {
  40676. var t = this.distanceToPoint(e.start)
  40677. , i = this.distanceToPoint(e.end);
  40678. return t < 0 && i > 0 || i < 0 && t > 0
  40679. },
  40680. intersectsBox: function(e) {
  40681. return e.intersectsPlane(this)
  40682. },
  40683. intersectsSphere: function(e) {
  40684. return e.intersectsPlane(this)
  40685. },
  40686. coplanarPoint: function(e) {
  40687. var t = e || new n.Vector3;
  40688. return t.copy(this.normal).multiplyScalar(-this.constant)
  40689. },
  40690. applyMatrix4: function() {
  40691. var e = new n.Vector3
  40692. , t = new n.Vector3
  40693. , i = new n.Matrix3;
  40694. return function(n, r) {
  40695. var o = r || i.getNormalMatrix(n)
  40696. , a = e.copy(this.normal).applyMatrix3(o)
  40697. , s = this.coplanarPoint(t);
  40698. return s.applyMatrix4(n),
  40699. this.setFromNormalAndCoplanarPoint(a, s),
  40700. this
  40701. }
  40702. }(),
  40703. translate: function(e) {
  40704. return this.constant = this.constant - e.dot(this.normal),
  40705. this
  40706. },
  40707. equals: function(e) {
  40708. return e.normal.equals(this.normal) && e.constant === this.constant
  40709. }
  40710. },
  40711. n.Spherical = function(e, t, i) {
  40712. return this.radius = void 0 !== e ? e : 1,
  40713. this.phi = void 0 !== t ? t : 0,
  40714. this.theta = void 0 !== i ? i : 0,
  40715. this
  40716. }
  40717. ,
  40718. n.Spherical.prototype = {
  40719. constructor: n.Spherical,
  40720. set: function(e, t, i) {
  40721. this.radius = e,
  40722. this.phi = t,
  40723. this.theta = i
  40724. },
  40725. clone: function() {
  40726. return (new this.constructor).copy(this)
  40727. },
  40728. copy: function(e) {
  40729. return this.radius.copy(e.radius),
  40730. this.phi.copy(e.phi),
  40731. this.theta.copy(e.theta),
  40732. this
  40733. },
  40734. makeSafe: function() {
  40735. var e = 1e-6;
  40736. this.phi = Math.max(e, Math.min(Math.PI - e, this.phi))
  40737. },
  40738. setFromVector3: function(e) {
  40739. return this.radius = e.length(),
  40740. 0 === this.radius ? (this.theta = 0,
  40741. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  40742. this.phi = Math.acos(n.Math.clamp(e.y / this.radius, -1, 1))),
  40743. this
  40744. }
  40745. },
  40746. n.Math = {
  40747. generateUUID: function() {
  40748. var e, t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), i = new Array(36), n = 0;
  40749. return function() {
  40750. for (var r = 0; r < 36; r++)
  40751. 8 === r || 13 === r || 18 === r || 23 === r ? i[r] = "-" : 14 === r ? i[r] = "4" : (n <= 2 && (n = 33554432 + 16777216 * Math.random() | 0),
  40752. e = 15 & n,
  40753. n >>= 4,
  40754. i[r] = t[19 === r ? 3 & e | 8 : e]);
  40755. return i.join("")
  40756. }
  40757. }(),
  40758. clamp: function(e, t, i) {
  40759. return Math.max(t, Math.min(i, e))
  40760. },
  40761. euclideanModulo: function(e, t) {
  40762. return (e % t + t) % t
  40763. },
  40764. mapLinear: function(e, t, i, n, r) {
  40765. return n + (e - t) * (r - n) / (i - t)
  40766. },
  40767. smoothstep: function(e, t, i) {
  40768. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  40769. e * e * (3 - 2 * e))
  40770. },
  40771. smootherstep: function(e, t, i) {
  40772. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  40773. e * e * e * (e * (6 * e - 15) + 10))
  40774. },
  40775. random16: function() {
  40776. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  40777. Math.random()
  40778. },
  40779. randInt: function(e, t) {
  40780. return e + Math.floor(Math.random() * (t - e + 1))
  40781. },
  40782. randFloat: function(e, t) {
  40783. return e + Math.random() * (t - e)
  40784. },
  40785. randFloatSpread: function(e) {
  40786. return e * (.5 - Math.random())
  40787. },
  40788. degToRad: function() {
  40789. var e = Math.PI / 180;
  40790. return function(t) {
  40791. return t * e
  40792. }
  40793. }(),
  40794. radToDeg: function() {
  40795. var e = 180 / Math.PI;
  40796. return function(t) {
  40797. return t * e
  40798. }
  40799. }(),
  40800. isPowerOfTwo: function(e) {
  40801. return 0 === (e & e - 1) && 0 !== e
  40802. },
  40803. nearestPowerOfTwo: function(e) {
  40804. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  40805. },
  40806. nextPowerOfTwo: function(e) {
  40807. return e--,
  40808. e |= e >> 1,
  40809. e |= e >> 2,
  40810. e |= e >> 4,
  40811. e |= e >> 8,
  40812. e |= e >> 16,
  40813. e++,
  40814. e
  40815. }
  40816. },
  40817. n.Spline = function(e) {
  40818. function t(e, t, i, n, r, o, a) {
  40819. var s = .5 * (i - e)
  40820. , l = .5 * (n - t);
  40821. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  40822. }
  40823. this.points = e;
  40824. var i, r, o, a, s, l, c, h, u, d = [], p = {
  40825. x: 0,
  40826. y: 0,
  40827. z: 0
  40828. };
  40829. this.initFromArray = function(e) {
  40830. this.points = [];
  40831. for (var t = 0; t < e.length; t++)
  40832. this.points[t] = {
  40833. x: e[t][0],
  40834. y: e[t][1],
  40835. z: e[t][2]
  40836. }
  40837. }
  40838. ,
  40839. this.getPoint = function(e) {
  40840. return i = (this.points.length - 1) * e,
  40841. r = Math.floor(i),
  40842. o = i - r,
  40843. d[0] = 0 === r ? r : r - 1,
  40844. d[1] = r,
  40845. d[2] = r > this.points.length - 2 ? this.points.length - 1 : r + 1,
  40846. d[3] = r > this.points.length - 3 ? this.points.length - 1 : r + 2,
  40847. l = this.points[d[0]],
  40848. c = this.points[d[1]],
  40849. h = this.points[d[2]],
  40850. u = this.points[d[3]],
  40851. a = o * o,
  40852. s = o * a,
  40853. p.x = t(l.x, c.x, h.x, u.x, o, a, s),
  40854. p.y = t(l.y, c.y, h.y, u.y, o, a, s),
  40855. p.z = t(l.z, c.z, h.z, u.z, o, a, s),
  40856. p
  40857. }
  40858. ,
  40859. this.getControlPointsArray = function() {
  40860. var e, t, i = this.points.length, n = [];
  40861. for (e = 0; e < i; e++)
  40862. t = this.points[e],
  40863. n[e] = [t.x, t.y, t.z];
  40864. return n
  40865. }
  40866. ,
  40867. this.getLength = function(e) {
  40868. var t, i, r, o, a = 0, s = 0, l = 0, c = new n.Vector3, h = new n.Vector3, u = [], d = 0;
  40869. for (u[0] = 0,
  40870. e || (e = 100),
  40871. r = this.points.length * e,
  40872. c.copy(this.points[0]),
  40873. t = 1; t < r; t++)
  40874. i = t / r,
  40875. o = this.getPoint(i),
  40876. h.copy(o),
  40877. d += h.distanceTo(c),
  40878. c.copy(o),
  40879. a = (this.points.length - 1) * i,
  40880. s = Math.floor(a),
  40881. s !== l && (u[s] = d,
  40882. l = s);
  40883. return u[u.length] = d,
  40884. {
  40885. chunks: u,
  40886. total: d
  40887. }
  40888. }
  40889. ,
  40890. this.reparametrizeByArcLength = function(e) {
  40891. var t, i, r, o, a, s, l, c, h = [], u = new n.Vector3, d = this.getLength();
  40892. for (h.push(u.copy(this.points[0]).clone()),
  40893. t = 1; t < this.points.length; t++) {
  40894. for (s = d.chunks[t] - d.chunks[t - 1],
  40895. l = Math.ceil(e * s / d.total),
  40896. o = (t - 1) / (this.points.length - 1),
  40897. a = t / (this.points.length - 1),
  40898. i = 1; i < l - 1; i++)
  40899. r = o + i * (1 / l) * (a - o),
  40900. c = this.getPoint(r),
  40901. h.push(u.copy(c).clone());
  40902. h.push(u.copy(this.points[t]).clone())
  40903. }
  40904. this.points = h
  40905. }
  40906. }
  40907. ,
  40908. n.Triangle = function(e, t, i) {
  40909. this.a = void 0 !== e ? e : new n.Vector3,
  40910. this.b = void 0 !== t ? t : new n.Vector3,
  40911. this.c = void 0 !== i ? i : new n.Vector3
  40912. }
  40913. ,
  40914. n.Triangle.normal = function() {
  40915. var e = new n.Vector3;
  40916. return function(t, i, r, o) {
  40917. var a = o || new n.Vector3;
  40918. a.subVectors(r, i),
  40919. e.subVectors(t, i),
  40920. a.cross(e);
  40921. var s = a.lengthSq();
  40922. return s > 0 ? a.multiplyScalar(1 / Math.sqrt(s)) : a.set(0, 0, 0)
  40923. }
  40924. }(),
  40925. n.Triangle.barycoordFromPoint = function() {
  40926. var e = new n.Vector3
  40927. , t = new n.Vector3
  40928. , i = new n.Vector3;
  40929. return function(r, o, a, s, l) {
  40930. e.subVectors(s, o),
  40931. t.subVectors(a, o),
  40932. i.subVectors(r, o);
  40933. var c = e.dot(e)
  40934. , h = e.dot(t)
  40935. , u = e.dot(i)
  40936. , d = t.dot(t)
  40937. , p = t.dot(i)
  40938. , f = c * d - h * h
  40939. , g = l || new n.Vector3;
  40940. if (0 === f)
  40941. return g.set(-2, -1, -1);
  40942. var m = 1 / f
  40943. , v = (d * u - h * p) * m
  40944. , A = (c * p - h * u) * m;
  40945. return g.set(1 - v - A, A, v)
  40946. }
  40947. }(),
  40948. n.Triangle.containsPoint = function() {
  40949. var e = new n.Vector3;
  40950. return function(t, i, r, o) {
  40951. var a = n.Triangle.barycoordFromPoint(t, i, r, o, e);
  40952. return a.x >= 0 && a.y >= 0 && a.x + a.y <= 1
  40953. }
  40954. }(),
  40955. n.Triangle.prototype = {
  40956. constructor: n.Triangle,
  40957. set: function(e, t, i) {
  40958. return this.a.copy(e),
  40959. this.b.copy(t),
  40960. this.c.copy(i),
  40961. this
  40962. },
  40963. setFromPointsAndIndices: function(e, t, i, n) {
  40964. return this.a.copy(e[t]),
  40965. this.b.copy(e[i]),
  40966. this.c.copy(e[n]),
  40967. this
  40968. },
  40969. clone: function() {
  40970. return (new this.constructor).copy(this)
  40971. },
  40972. copy: function(e) {
  40973. return this.a.copy(e.a),
  40974. this.b.copy(e.b),
  40975. this.c.copy(e.c),
  40976. this
  40977. },
  40978. area: function() {
  40979. var e = new n.Vector3
  40980. , t = new n.Vector3;
  40981. return function() {
  40982. return e.subVectors(this.c, this.b),
  40983. t.subVectors(this.a, this.b),
  40984. .5 * e.cross(t).length()
  40985. }
  40986. }(),
  40987. midpoint: function(e) {
  40988. var t = e || new n.Vector3;
  40989. return t.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  40990. },
  40991. normal: function(e) {
  40992. return n.Triangle.normal(this.a, this.b, this.c, e)
  40993. },
  40994. plane: function(e) {
  40995. var t = e || new n.Plane;
  40996. return t.setFromCoplanarPoints(this.a, this.b, this.c)
  40997. },
  40998. barycoordFromPoint: function(e, t) {
  40999. return n.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  41000. },
  41001. containsPoint: function(e) {
  41002. return n.Triangle.containsPoint(e, this.a, this.b, this.c)
  41003. },
  41004. equals: function(e) {
  41005. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  41006. }
  41007. },
  41008. n.Interpolant = function(e, t, i, n) {
  41009. this.parameterPositions = e,
  41010. this._cachedIndex = 0,
  41011. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  41012. this.sampleValues = t,
  41013. this.valueSize = i
  41014. }
  41015. ,
  41016. n.Interpolant.prototype = {
  41017. constructor: n.Interpolant,
  41018. evaluate: function(e) {
  41019. var t = this.parameterPositions
  41020. , i = this._cachedIndex
  41021. , n = t[i]
  41022. , r = t[i - 1];
  41023. e: {
  41024. t: {
  41025. var o;
  41026. i: {
  41027. n: if (!(e < n)) {
  41028. for (var a = i + 2; ; ) {
  41029. if (void 0 === n) {
  41030. if (e < r)
  41031. break n;
  41032. return i = t.length,
  41033. this._cachedIndex = i,
  41034. this.afterEnd_(i - 1, e, r)
  41035. }
  41036. if (i === a)
  41037. break;
  41038. if (r = n,
  41039. n = t[++i],
  41040. e < n)
  41041. break t
  41042. }
  41043. o = t.length;
  41044. break i
  41045. }
  41046. {
  41047. if (e >= r)
  41048. break e;
  41049. var s = t[1];
  41050. e < s && (i = 2,
  41051. r = s);
  41052. for (var a = i - 2; ; ) {
  41053. if (void 0 === r)
  41054. return this._cachedIndex = 0,
  41055. this.beforeStart_(0, e, n);
  41056. if (i === a)
  41057. break;
  41058. if (n = r,
  41059. r = t[--i - 1],
  41060. e >= r)
  41061. break t
  41062. }
  41063. o = i,
  41064. i = 0
  41065. }
  41066. }
  41067. for (; i < o; ) {
  41068. var l = i + o >>> 1;
  41069. e < t[l] ? o = l : i = l + 1
  41070. }
  41071. if (n = t[i],
  41072. r = t[i - 1],
  41073. void 0 === r)
  41074. return this._cachedIndex = 0,
  41075. this.beforeStart_(0, e, n);
  41076. if (void 0 === n)
  41077. return i = t.length,
  41078. this._cachedIndex = i,
  41079. this.afterEnd_(i - 1, r, e)
  41080. }
  41081. this._cachedIndex = i,
  41082. this.intervalChanged_(i, r, n)
  41083. }
  41084. return this.interpolate_(i, r, e, n)
  41085. },
  41086. settings: null,
  41087. DefaultSettings_: {},
  41088. getSettings_: function() {
  41089. return this.settings || this.DefaultSettings_
  41090. },
  41091. copySampleValue_: function(e) {
  41092. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  41093. t[o] = i[r + o];
  41094. return t
  41095. },
  41096. interpolate_: function(e, t, i, n) {
  41097. throw new Error("call to abstract method")
  41098. },
  41099. intervalChanged_: function(e, t, i) {}
  41100. },
  41101. Object.assign(n.Interpolant.prototype, {
  41102. beforeStart_: n.Interpolant.prototype.copySampleValue_,
  41103. afterEnd_: n.Interpolant.prototype.copySampleValue_
  41104. }),
  41105. n.CubicInterpolant = function(e, t, i, r) {
  41106. n.Interpolant.call(this, e, t, i, r),
  41107. this._weightPrev = -0,
  41108. this._offsetPrev = -0,
  41109. this._weightNext = -0,
  41110. this._offsetNext = -0
  41111. }
  41112. ,
  41113. n.CubicInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  41114. constructor: n.CubicInterpolant,
  41115. DefaultSettings_: {
  41116. endingStart: n.ZeroCurvatureEnding,
  41117. endingEnd: n.ZeroCurvatureEnding
  41118. },
  41119. intervalChanged_: function(e, t, i) {
  41120. var r = this.parameterPositions
  41121. , o = e - 2
  41122. , a = e + 1
  41123. , s = r[o]
  41124. , l = r[a];
  41125. if (void 0 === s)
  41126. switch (this.getSettings_().endingStart) {
  41127. case n.ZeroSlopeEnding:
  41128. o = e,
  41129. s = 2 * t - i;
  41130. break;
  41131. case n.WrapAroundEnding:
  41132. o = r.length - 2,
  41133. s = t + r[o] - r[o + 1];
  41134. break;
  41135. default:
  41136. o = e,
  41137. s = i
  41138. }
  41139. if (void 0 === l)
  41140. switch (this.getSettings_().endingEnd) {
  41141. case n.ZeroSlopeEnding:
  41142. a = e,
  41143. l = 2 * i - t;
  41144. break;
  41145. case n.WrapAroundEnding:
  41146. a = 1,
  41147. l = i + r[1] - r[0];
  41148. break;
  41149. default:
  41150. a = e - 1,
  41151. l = t
  41152. }
  41153. var c = .5 * (i - t)
  41154. , h = this.valueSize;
  41155. this._weightPrev = c / (t - s),
  41156. this._weightNext = c / (l - i),
  41157. this._offsetPrev = o * h,
  41158. this._offsetNext = a * h
  41159. },
  41160. interpolate_: function(e, t, i, n) {
  41161. 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)
  41162. r[C] = m * o[c + C] + v * o[l + C] + A * o[s + C] + y * o[h + C];
  41163. return r
  41164. }
  41165. }),
  41166. n.DiscreteInterpolant = function(e, t, i, r) {
  41167. n.Interpolant.call(this, e, t, i, r)
  41168. }
  41169. ,
  41170. n.DiscreteInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  41171. constructor: n.DiscreteInterpolant,
  41172. interpolate_: function(e, t, i, n) {
  41173. return this.copySampleValue_(e - 1)
  41174. }
  41175. }),
  41176. n.LinearInterpolant = function(e, t, i, r) {
  41177. n.Interpolant.call(this, e, t, i, r)
  41178. }
  41179. ,
  41180. n.LinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  41181. constructor: n.LinearInterpolant,
  41182. interpolate_: function(e, t, i, n) {
  41183. 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)
  41184. r[u] = o[l + u] * h + o[s + u] * c;
  41185. return r
  41186. }
  41187. }),
  41188. n.QuaternionLinearInterpolant = function(e, t, i, r) {
  41189. n.Interpolant.call(this, e, t, i, r)
  41190. }
  41191. ,
  41192. n.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  41193. constructor: n.QuaternionLinearInterpolant,
  41194. interpolate_: function(e, t, i, r) {
  41195. 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)
  41196. n.Quaternion.slerpFlat(o, 0, a, l - s, a, l, c);
  41197. return o
  41198. }
  41199. }),
  41200. n.Clock = function(e) {
  41201. this.autoStart = void 0 === e || e,
  41202. this.startTime = 0,
  41203. this.oldTime = 0,
  41204. this.elapsedTime = 0,
  41205. this.running = !1
  41206. }
  41207. ,
  41208. n.Clock.prototype = {
  41209. constructor: n.Clock,
  41210. start: function() {
  41211. this.startTime = performance.now(),
  41212. this.oldTime = this.startTime,
  41213. this.running = !0
  41214. },
  41215. stop: function() {
  41216. this.getElapsedTime(),
  41217. this.running = !1
  41218. },
  41219. getElapsedTime: function() {
  41220. return this.getDelta(),
  41221. this.elapsedTime
  41222. },
  41223. getDelta: function() {
  41224. var e = 0;
  41225. if (this.autoStart && !this.running && this.start(),
  41226. this.running) {
  41227. var t = performance.now();
  41228. e = .001 * (t - this.oldTime),
  41229. this.oldTime = t,
  41230. this.elapsedTime += e
  41231. }
  41232. return e
  41233. }
  41234. },
  41235. n.EventDispatcher = function() {}
  41236. ,
  41237. n.EventDispatcher.prototype = {
  41238. constructor: n.EventDispatcher,
  41239. apply: function(e) {
  41240. e.addEventListener = n.EventDispatcher.prototype.addEventListener,
  41241. e.hasEventListener = n.EventDispatcher.prototype.hasEventListener,
  41242. e.removeEventListener = n.EventDispatcher.prototype.removeEventListener,
  41243. e.dispatchEvent = n.EventDispatcher.prototype.dispatchEvent
  41244. },
  41245. addEventListener: function(e, t) {
  41246. void 0 === this._listeners && (this._listeners = {});
  41247. var i = this._listeners;
  41248. void 0 === i[e] && (i[e] = []),
  41249. i[e].indexOf(t) === -1 && i[e].push(t)
  41250. },
  41251. hasEventListener: function(e, t) {
  41252. if (void 0 === this._listeners)
  41253. return !1;
  41254. var i = this._listeners;
  41255. return void 0 !== i[e] && i[e].indexOf(t) !== -1
  41256. },
  41257. removeEventListener: function(e, t) {
  41258. if (void 0 !== this._listeners) {
  41259. var i = this._listeners
  41260. , n = i[e];
  41261. if (void 0 !== n) {
  41262. var r = n.indexOf(t);
  41263. r !== -1 && n.splice(r, 1)
  41264. }
  41265. }
  41266. },
  41267. dispatchEvent: function(e) {
  41268. if (void 0 !== this._listeners) {
  41269. var t = this._listeners
  41270. , i = t[e.type];
  41271. if (void 0 !== i) {
  41272. e.target = this;
  41273. for (var n = [], r = i.length, o = 0; o < r; o++)
  41274. n[o] = i[o];
  41275. for (var o = 0; o < r; o++)
  41276. n[o].call(this, e)
  41277. }
  41278. }
  41279. }
  41280. },
  41281. n.Layers = function() {
  41282. this.mask = 1
  41283. }
  41284. ,
  41285. n.Layers.prototype = {
  41286. constructor: n.Layers,
  41287. set: function(e) {
  41288. this.mask = 1 << e
  41289. },
  41290. enable: function(e) {
  41291. this.mask |= 1 << e
  41292. },
  41293. toggle: function(e) {
  41294. this.mask ^= 1 << e
  41295. },
  41296. disable: function(e) {
  41297. this.mask &= ~(1 << e)
  41298. },
  41299. test: function(e) {
  41300. return 0 !== (this.mask & e.mask)
  41301. }
  41302. },
  41303. function(e) {
  41304. function t(e, t) {
  41305. return e.distance - t.distance
  41306. }
  41307. function i(e, t, n, r) {
  41308. if (e.visible !== !1 && (e.raycast(t, n),
  41309. r === !0))
  41310. for (var o = e.children, a = 0, s = o.length; a < s; a++)
  41311. i(o[a], t, n, !0)
  41312. }
  41313. e.Raycaster = function(t, i, n, r) {
  41314. this.ray = new e.Ray(t,i),
  41315. this.near = n || 0,
  41316. this.far = r || 1 / 0,
  41317. this.params = {
  41318. Mesh: {},
  41319. Line: {},
  41320. LOD: {},
  41321. Points: {
  41322. threshold: 1
  41323. },
  41324. Sprite: {}
  41325. },
  41326. Object.defineProperties(this.params, {
  41327. PointCloud: {
  41328. get: function() {
  41329. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  41330. this.Points
  41331. }
  41332. }
  41333. })
  41334. }
  41335. ,
  41336. e.Raycaster.prototype = {
  41337. constructor: e.Raycaster,
  41338. linePrecision: 1,
  41339. set: function(e, t) {
  41340. this.ray.set(e, t)
  41341. },
  41342. setFromCamera: function(t, i) {
  41343. i instanceof e.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(i.matrixWorld),
  41344. 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),
  41345. this.ray.direction.set(0, 0, -1).transformDirection(i.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  41346. },
  41347. intersectObject: function(e, n) {
  41348. var r = [];
  41349. return i(e, this, r, n),
  41350. r.sort(t),
  41351. r
  41352. },
  41353. intersectObjects: function(e, n) {
  41354. var r = [];
  41355. if (Array.isArray(e) === !1)
  41356. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  41357. r;
  41358. for (var o = 0, a = e.length; o < a; o++)
  41359. i(e[o], this, r, n);
  41360. return r.sort(t),
  41361. r
  41362. }
  41363. }
  41364. }(n),
  41365. n.Object3D = function() {
  41366. function e() {
  41367. o.setFromEuler(r, !1)
  41368. }
  41369. function t() {
  41370. r.setFromQuaternion(o, void 0, !1)
  41371. }
  41372. Object.defineProperty(this, "id", {
  41373. value: n.Object3DIdCount++
  41374. }),
  41375. this.uuid = n.Math.generateUUID(),
  41376. this.name = "",
  41377. this.type = "Object3D",
  41378. this.parent = null,
  41379. this.children = [],
  41380. this.up = n.Object3D.DefaultUp.clone();
  41381. var i = new n.Vector3
  41382. , r = new n.Euler
  41383. , o = new n.Quaternion
  41384. , a = new n.Vector3(1,1,1);
  41385. r.onChange(e),
  41386. o.onChange(t),
  41387. Object.defineProperties(this, {
  41388. position: {
  41389. enumerable: !0,
  41390. value: i
  41391. },
  41392. rotation: {
  41393. enumerable: !0,
  41394. value: r
  41395. },
  41396. quaternion: {
  41397. enumerable: !0,
  41398. value: o
  41399. },
  41400. scale: {
  41401. enumerable: !0,
  41402. value: a
  41403. },
  41404. modelViewMatrix: {
  41405. value: new n.Matrix4
  41406. },
  41407. normalMatrix: {
  41408. value: new n.Matrix3
  41409. }
  41410. }),
  41411. this.rotationAutoUpdate = !0,
  41412. this.matrix = new n.Matrix4,
  41413. this.matrixWorld = new n.Matrix4,
  41414. this.matrixAutoUpdate = n.Object3D.DefaultMatrixAutoUpdate,
  41415. this.matrixWorldNeedsUpdate = !1,
  41416. this.layers = new n.Layers,
  41417. this.visible = !0,
  41418. this.castShadow = !1,
  41419. this.receiveShadow = !1,
  41420. this.frustumCulled = !0,
  41421. this.renderOrder = 0,
  41422. this.userData = {}
  41423. }
  41424. ,
  41425. n.Object3D.DefaultUp = new n.Vector3(0,1,0),
  41426. n.Object3D.DefaultMatrixAutoUpdate = !0,
  41427. n.Object3D.prototype = {
  41428. constructor: n.Object3D,
  41429. applyMatrix: function(e) {
  41430. this.matrix.multiplyMatrices(e, this.matrix),
  41431. this.matrix.decompose(this.position, this.quaternion, this.scale)
  41432. },
  41433. setRotationFromAxisAngle: function(e, t) {
  41434. this.quaternion.setFromAxisAngle(e, t)
  41435. },
  41436. setRotationFromEuler: function(e) {
  41437. this.quaternion.setFromEuler(e, !0)
  41438. },
  41439. setRotationFromMatrix: function(e) {
  41440. this.quaternion.setFromRotationMatrix(e)
  41441. },
  41442. setRotationFromQuaternion: function(e) {
  41443. this.quaternion.copy(e)
  41444. },
  41445. rotateOnAxis: function() {
  41446. var e = new n.Quaternion;
  41447. return function(t, i) {
  41448. return e.setFromAxisAngle(t, i),
  41449. this.quaternion.multiply(e),
  41450. this
  41451. }
  41452. }(),
  41453. rotateX: function() {
  41454. var e = new n.Vector3(1,0,0);
  41455. return function(t) {
  41456. return this.rotateOnAxis(e, t)
  41457. }
  41458. }(),
  41459. rotateY: function() {
  41460. var e = new n.Vector3(0,1,0);
  41461. return function(t) {
  41462. return this.rotateOnAxis(e, t)
  41463. }
  41464. }(),
  41465. rotateZ: function() {
  41466. var e = new n.Vector3(0,0,1);
  41467. return function(t) {
  41468. return this.rotateOnAxis(e, t)
  41469. }
  41470. }(),
  41471. translateOnAxis: function() {
  41472. var e = new n.Vector3;
  41473. return function(t, i) {
  41474. return e.copy(t).applyQuaternion(this.quaternion),
  41475. this.position.add(e.multiplyScalar(i)),
  41476. this
  41477. }
  41478. }(),
  41479. translateX: function() {
  41480. var e = new n.Vector3(1,0,0);
  41481. return function(t) {
  41482. return this.translateOnAxis(e, t)
  41483. }
  41484. }(),
  41485. translateY: function() {
  41486. var e = new n.Vector3(0,1,0);
  41487. return function(t) {
  41488. return this.translateOnAxis(e, t)
  41489. }
  41490. }(),
  41491. translateZ: function() {
  41492. var e = new n.Vector3(0,0,1);
  41493. return function(t) {
  41494. return this.translateOnAxis(e, t)
  41495. }
  41496. }(),
  41497. localToWorld: function(e) {
  41498. return e.applyMatrix4(this.matrixWorld)
  41499. },
  41500. worldToLocal: function() {
  41501. var e = new n.Matrix4;
  41502. return function(t) {
  41503. return t.applyMatrix4(e.getInverse(this.matrixWorld))
  41504. }
  41505. }(),
  41506. lookAt: function() {
  41507. var e = new n.Matrix4;
  41508. return function(t) {
  41509. e.lookAt(t, this.position, this.up),
  41510. this.quaternion.setFromRotationMatrix(e)
  41511. }
  41512. }(),
  41513. add: function(e) {
  41514. if (arguments.length > 1) {
  41515. for (var t = 0; t < arguments.length; t++)
  41516. this.add(arguments[t]);
  41517. return this
  41518. }
  41519. return e === this ? (console.error("THREE.Object3D.add: object can't be added as a child of itself.", e),
  41520. this) : (e instanceof n.Object3D ? (null !== e.parent && e.parent.remove(e),
  41521. e.parent = this,
  41522. e.dispatchEvent({
  41523. type: "added"
  41524. }),
  41525. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  41526. this)
  41527. },
  41528. remove: function(e) {
  41529. if (arguments.length > 1)
  41530. for (var t = 0; t < arguments.length; t++)
  41531. this.remove(arguments[t]);
  41532. var i = this.children.indexOf(e);
  41533. i !== -1 && (e.parent = null,
  41534. e.dispatchEvent({
  41535. type: "removed"
  41536. }),
  41537. this.children.splice(i, 1))
  41538. },
  41539. getObjectById: function(e) {
  41540. return this.getObjectByProperty("id", e)
  41541. },
  41542. getObjectByName: function(e) {
  41543. return this.getObjectByProperty("name", e)
  41544. },
  41545. getObjectByProperty: function(e, t) {
  41546. if (this[e] === t)
  41547. return this;
  41548. for (var i = 0, n = this.children.length; i < n; i++) {
  41549. var r = this.children[i]
  41550. , o = r.getObjectByProperty(e, t);
  41551. if (void 0 !== o)
  41552. return o
  41553. }
  41554. },
  41555. getWorldPosition: function(e) {
  41556. var t = e || new n.Vector3;
  41557. return this.updateMatrixWorld(!0),
  41558. t.setFromMatrixPosition(this.matrixWorld)
  41559. },
  41560. getWorldQuaternion: function() {
  41561. var e = new n.Vector3
  41562. , t = new n.Vector3;
  41563. return function(i) {
  41564. var r = i || new n.Quaternion;
  41565. return this.updateMatrixWorld(!0),
  41566. this.matrixWorld.decompose(e, r, t),
  41567. r
  41568. }
  41569. }(),
  41570. getWorldRotation: function() {
  41571. var e = new n.Quaternion;
  41572. return function(t) {
  41573. var i = t || new n.Euler;
  41574. return this.getWorldQuaternion(e),
  41575. i.setFromQuaternion(e, this.rotation.order, !1)
  41576. }
  41577. }(),
  41578. getWorldScale: function() {
  41579. var e = new n.Vector3
  41580. , t = new n.Quaternion;
  41581. return function(i) {
  41582. var r = i || new n.Vector3;
  41583. return this.updateMatrixWorld(!0),
  41584. this.matrixWorld.decompose(e, t, r),
  41585. r
  41586. }
  41587. }(),
  41588. getWorldDirection: function() {
  41589. var e = new n.Quaternion;
  41590. return function(t) {
  41591. var i = t || new n.Vector3;
  41592. return this.getWorldQuaternion(e),
  41593. i.set(0, 0, 1).applyQuaternion(e)
  41594. }
  41595. }(),
  41596. raycast: function() {},
  41597. traverse: function(e) {
  41598. e(this);
  41599. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41600. t[i].traverse(e)
  41601. },
  41602. traverseVisible: function(e) {
  41603. if (this.visible !== !1) {
  41604. e(this);
  41605. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41606. t[i].traverseVisible(e)
  41607. }
  41608. },
  41609. traverseAncestors: function(e) {
  41610. var t = this.parent;
  41611. null !== t && (e(t),
  41612. t.traverseAncestors(e))
  41613. },
  41614. updateMatrix: function() {
  41615. this.matrix.compose(this.position, this.quaternion, this.scale),
  41616. this.matrixWorldNeedsUpdate = !0
  41617. },
  41618. updateMatrixWorld: function(e) {
  41619. this.matrixAutoUpdate === !0 && this.updateMatrix(),
  41620. this.matrixWorldNeedsUpdate !== !0 && e !== !0 || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  41621. this.matrixWorldNeedsUpdate = !1,
  41622. e = !0);
  41623. for (var t = 0, i = this.children.length; t < i; t++)
  41624. this.children[t].updateMatrixWorld(e)
  41625. },
  41626. toJSON: function(e) {
  41627. function t(e) {
  41628. var t = [];
  41629. for (var i in e) {
  41630. var n = e[i];
  41631. delete n.metadata,
  41632. t.push(n)
  41633. }
  41634. return t
  41635. }
  41636. var i = void 0 === e
  41637. , n = {};
  41638. i && (e = {
  41639. geometries: {},
  41640. materials: {},
  41641. textures: {},
  41642. images: {}
  41643. },
  41644. n.metadata = {
  41645. version: 4.4,
  41646. type: "Object",
  41647. generator: "Object3D.toJSON"
  41648. });
  41649. var r = {};
  41650. if (r.uuid = this.uuid,
  41651. r.type = this.type,
  41652. "" !== this.name && (r.name = this.name),
  41653. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  41654. this.castShadow === !0 && (r.castShadow = !0),
  41655. this.receiveShadow === !0 && (r.receiveShadow = !0),
  41656. this.visible === !1 && (r.visible = !1),
  41657. r.matrix = this.matrix.toArray(),
  41658. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  41659. r.geometry = this.geometry.uuid),
  41660. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  41661. r.material = this.material.uuid),
  41662. this.children.length > 0) {
  41663. r.children = [];
  41664. for (var o = 0; o < this.children.length; o++)
  41665. r.children.push(this.children[o].toJSON(e).object)
  41666. }
  41667. if (i) {
  41668. var a = t(e.geometries)
  41669. , s = t(e.materials)
  41670. , l = t(e.textures)
  41671. , c = t(e.images);
  41672. a.length > 0 && (n.geometries = a),
  41673. s.length > 0 && (n.materials = s),
  41674. l.length > 0 && (n.textures = l),
  41675. c.length > 0 && (n.images = c)
  41676. }
  41677. return n.object = r,
  41678. n
  41679. },
  41680. clone: function(e) {
  41681. return (new this.constructor).copy(this, e)
  41682. },
  41683. copy: function(e, t) {
  41684. if (void 0 === t && (t = !0),
  41685. this.name = e.name,
  41686. this.up.copy(e.up),
  41687. this.position.copy(e.position),
  41688. this.quaternion.copy(e.quaternion),
  41689. this.scale.copy(e.scale),
  41690. this.rotationAutoUpdate = e.rotationAutoUpdate,
  41691. this.matrix.copy(e.matrix),
  41692. this.matrixWorld.copy(e.matrixWorld),
  41693. this.matrixAutoUpdate = e.matrixAutoUpdate,
  41694. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  41695. this.visible = e.visible,
  41696. this.castShadow = e.castShadow,
  41697. this.receiveShadow = e.receiveShadow,
  41698. this.frustumCulled = e.frustumCulled,
  41699. this.renderOrder = e.renderOrder,
  41700. this.userData = JSON.parse(JSON.stringify(e.userData)),
  41701. t === !0)
  41702. for (var i = 0; i < e.children.length; i++) {
  41703. var n = e.children[i];
  41704. this.add(n.clone())
  41705. }
  41706. return this
  41707. }
  41708. },
  41709. n.EventDispatcher.prototype.apply(n.Object3D.prototype),
  41710. n.Object3DIdCount = 0,
  41711. n.Face3 = function(e, t, i, r, o, a) {
  41712. this.a = e,
  41713. this.b = t,
  41714. this.c = i,
  41715. this.normal = r instanceof n.Vector3 ? r : new n.Vector3,
  41716. this.vertexNormals = Array.isArray(r) ? r : [],
  41717. this.color = o instanceof n.Color ? o : new n.Color,
  41718. this.vertexColors = Array.isArray(o) ? o : [],
  41719. this.materialIndex = void 0 !== a ? a : 0
  41720. }
  41721. ,
  41722. n.Face3.prototype = {
  41723. constructor: n.Face3,
  41724. clone: function() {
  41725. return (new this.constructor).copy(this)
  41726. },
  41727. copy: function(e) {
  41728. this.a = e.a,
  41729. this.b = e.b,
  41730. this.c = e.c,
  41731. this.normal.copy(e.normal),
  41732. this.color.copy(e.color),
  41733. this.materialIndex = e.materialIndex;
  41734. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  41735. this.vertexNormals[t] = e.vertexNormals[t].clone();
  41736. for (var t = 0, i = e.vertexColors.length; t < i; t++)
  41737. this.vertexColors[t] = e.vertexColors[t].clone();
  41738. return this
  41739. }
  41740. },
  41741. n.BufferAttribute = function(e, t) {
  41742. this.uuid = n.Math.generateUUID(),
  41743. this.array = e,
  41744. this.itemSize = t,
  41745. this.dynamic = !1,
  41746. this.updateRange = {
  41747. offset: 0,
  41748. count: -1
  41749. },
  41750. this.version = 0
  41751. }
  41752. ,
  41753. n.BufferAttribute.prototype = {
  41754. constructor: n.BufferAttribute,
  41755. get count() {
  41756. return this.array.length / this.itemSize
  41757. },
  41758. set needsUpdate(e) {
  41759. e === !0 && this.version++
  41760. },
  41761. setDynamic: function(e) {
  41762. return this.dynamic = e,
  41763. this
  41764. },
  41765. copy: function(e) {
  41766. return this.array = new e.array.constructor(e.array),
  41767. this.itemSize = e.itemSize,
  41768. this.dynamic = e.dynamic,
  41769. this
  41770. },
  41771. copyAt: function(e, t, i) {
  41772. e *= this.itemSize,
  41773. i *= t.itemSize;
  41774. for (var n = 0, r = this.itemSize; n < r; n++)
  41775. this.array[e + n] = t.array[i + n];
  41776. return this
  41777. },
  41778. copyArray: function(e) {
  41779. return this.array.set(e),
  41780. this
  41781. },
  41782. copyColorsArray: function(e) {
  41783. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  41784. var a = e[r];
  41785. void 0 === a && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", r),
  41786. a = new n.Color),
  41787. t[i++] = a.r,
  41788. t[i++] = a.g,
  41789. t[i++] = a.b
  41790. }
  41791. return this
  41792. },
  41793. copyIndicesArray: function(e) {
  41794. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41795. var o = e[n];
  41796. t[i++] = o.a,
  41797. t[i++] = o.b,
  41798. t[i++] = o.c
  41799. }
  41800. return this
  41801. },
  41802. copyVector2sArray: function(e) {
  41803. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  41804. var a = e[r];
  41805. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", r),
  41806. a = new n.Vector2),
  41807. t[i++] = a.x,
  41808. t[i++] = a.y
  41809. }
  41810. return this
  41811. },
  41812. copyVector3sArray: function(e) {
  41813. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  41814. var a = e[r];
  41815. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", r),
  41816. a = new n.Vector3),
  41817. t[i++] = a.x,
  41818. t[i++] = a.y,
  41819. t[i++] = a.z
  41820. }
  41821. return this
  41822. },
  41823. copyVector4sArray: function(e) {
  41824. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  41825. var a = e[r];
  41826. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", r),
  41827. a = new n.Vector4),
  41828. t[i++] = a.x,
  41829. t[i++] = a.y,
  41830. t[i++] = a.z,
  41831. t[i++] = a.w
  41832. }
  41833. return this
  41834. },
  41835. set: function(e, t) {
  41836. return void 0 === t && (t = 0),
  41837. this.array.set(e, t),
  41838. this
  41839. },
  41840. getX: function(e) {
  41841. return this.array[e * this.itemSize]
  41842. },
  41843. setX: function(e, t) {
  41844. return this.array[e * this.itemSize] = t,
  41845. this
  41846. },
  41847. getY: function(e) {
  41848. return this.array[e * this.itemSize + 1]
  41849. },
  41850. setY: function(e, t) {
  41851. return this.array[e * this.itemSize + 1] = t,
  41852. this
  41853. },
  41854. getZ: function(e) {
  41855. return this.array[e * this.itemSize + 2]
  41856. },
  41857. setZ: function(e, t) {
  41858. return this.array[e * this.itemSize + 2] = t,
  41859. this
  41860. },
  41861. getW: function(e) {
  41862. return this.array[e * this.itemSize + 3]
  41863. },
  41864. setW: function(e, t) {
  41865. return this.array[e * this.itemSize + 3] = t,
  41866. this
  41867. },
  41868. setXY: function(e, t, i) {
  41869. return e *= this.itemSize,
  41870. this.array[e + 0] = t,
  41871. this.array[e + 1] = i,
  41872. this
  41873. },
  41874. setXYZ: function(e, t, i, n) {
  41875. return e *= this.itemSize,
  41876. this.array[e + 0] = t,
  41877. this.array[e + 1] = i,
  41878. this.array[e + 2] = n,
  41879. this
  41880. },
  41881. setXYZW: function(e, t, i, n, r) {
  41882. return e *= this.itemSize,
  41883. this.array[e + 0] = t,
  41884. this.array[e + 1] = i,
  41885. this.array[e + 2] = n,
  41886. this.array[e + 3] = r,
  41887. this
  41888. },
  41889. clone: function() {
  41890. return (new this.constructor).copy(this)
  41891. }
  41892. },
  41893. n.Int8Attribute = function(e, t) {
  41894. return new n.BufferAttribute(new Int8Array(e),t)
  41895. }
  41896. ,
  41897. n.Uint8Attribute = function(e, t) {
  41898. return new n.BufferAttribute(new Uint8Array(e),t)
  41899. }
  41900. ,
  41901. n.Uint8ClampedAttribute = function(e, t) {
  41902. return new n.BufferAttribute(new Uint8ClampedArray(e),t)
  41903. }
  41904. ,
  41905. n.Int16Attribute = function(e, t) {
  41906. return new n.BufferAttribute(new Int16Array(e),t)
  41907. }
  41908. ,
  41909. n.Uint16Attribute = function(e, t) {
  41910. return new n.BufferAttribute(new Uint16Array(e),t)
  41911. }
  41912. ;
  41913. n.Int32Attribute = function(e, t) {
  41914. return new n.BufferAttribute(new Int32Array(e),t)
  41915. }
  41916. ;
  41917. n.Uint32Attribute = function(e, t) {
  41918. return new n.BufferAttribute(new Uint32Array(e),t)
  41919. }
  41920. ,
  41921. n.Float32Attribute = function(e, t) {
  41922. return new n.BufferAttribute(new Float32Array(e),t)
  41923. }
  41924. ,
  41925. n.Float64Attribute = function(e, t) {
  41926. return new n.BufferAttribute(new Float64Array(e),t)
  41927. }
  41928. ,
  41929. n.DynamicBufferAttribute = function(e, t) {
  41930. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  41931. new n.BufferAttribute(e,t).setDynamic(!0)
  41932. }
  41933. ,
  41934. n.InstancedBufferAttribute = function(e, t, i) {
  41935. n.BufferAttribute.call(this, e, t),
  41936. this.meshPerAttribute = i || 1
  41937. }
  41938. ,
  41939. n.InstancedBufferAttribute.prototype = Object.create(n.BufferAttribute.prototype),
  41940. n.InstancedBufferAttribute.prototype.constructor = n.InstancedBufferAttribute,
  41941. n.InstancedBufferAttribute.prototype.copy = function(e) {
  41942. return n.BufferAttribute.prototype.copy.call(this, e),
  41943. this.meshPerAttribute = e.meshPerAttribute,
  41944. this
  41945. }
  41946. ,
  41947. n.InterleavedBuffer = function(e, t) {
  41948. this.uuid = n.Math.generateUUID(),
  41949. this.array = e,
  41950. this.stride = t,
  41951. this.dynamic = !1,
  41952. this.updateRange = {
  41953. offset: 0,
  41954. count: -1
  41955. },
  41956. this.version = 0
  41957. }
  41958. ,
  41959. n.InterleavedBuffer.prototype = {
  41960. constructor: n.InterleavedBuffer,
  41961. get length() {
  41962. return this.array.length
  41963. },
  41964. get count() {
  41965. return this.array.length / this.stride
  41966. },
  41967. set needsUpdate(e) {
  41968. e === !0 && this.version++
  41969. },
  41970. setDynamic: function(e) {
  41971. return this.dynamic = e,
  41972. this
  41973. },
  41974. copy: function(e) {
  41975. return this.array = new e.array.constructor(e.array),
  41976. this.stride = e.stride,
  41977. this.dynamic = e.dynamic,
  41978. this
  41979. },
  41980. copyAt: function(e, t, i) {
  41981. e *= this.stride,
  41982. i *= t.stride;
  41983. for (var n = 0, r = this.stride; n < r; n++)
  41984. this.array[e + n] = t.array[i + n];
  41985. return this
  41986. },
  41987. set: function(e, t) {
  41988. return void 0 === t && (t = 0),
  41989. this.array.set(e, t),
  41990. this
  41991. },
  41992. clone: function() {
  41993. return (new this.constructor).copy(this)
  41994. }
  41995. },
  41996. n.InstancedInterleavedBuffer = function(e, t, i) {
  41997. n.InterleavedBuffer.call(this, e, t),
  41998. this.meshPerAttribute = i || 1
  41999. }
  42000. ,
  42001. n.InstancedInterleavedBuffer.prototype = Object.create(n.InterleavedBuffer.prototype),
  42002. n.InstancedInterleavedBuffer.prototype.constructor = n.InstancedInterleavedBuffer,
  42003. n.InstancedInterleavedBuffer.prototype.copy = function(e) {
  42004. return n.InterleavedBuffer.prototype.copy.call(this, e),
  42005. this.meshPerAttribute = e.meshPerAttribute,
  42006. this
  42007. }
  42008. ,
  42009. n.InterleavedBufferAttribute = function(e, t, i) {
  42010. this.uuid = n.Math.generateUUID(),
  42011. this.data = e,
  42012. this.itemSize = t,
  42013. this.offset = i
  42014. }
  42015. ,
  42016. n.InterleavedBufferAttribute.prototype = {
  42017. constructor: n.InterleavedBufferAttribute,
  42018. get length() {
  42019. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  42020. this.array.length
  42021. },
  42022. get count() {
  42023. return this.data.count
  42024. },
  42025. setX: function(e, t) {
  42026. return this.data.array[e * this.data.stride + this.offset] = t,
  42027. this
  42028. },
  42029. setY: function(e, t) {
  42030. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  42031. this
  42032. },
  42033. setZ: function(e, t) {
  42034. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  42035. this
  42036. },
  42037. setW: function(e, t) {
  42038. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  42039. this
  42040. },
  42041. getX: function(e) {
  42042. return this.data.array[e * this.data.stride + this.offset]
  42043. },
  42044. getY: function(e) {
  42045. return this.data.array[e * this.data.stride + this.offset + 1]
  42046. },
  42047. getZ: function(e) {
  42048. return this.data.array[e * this.data.stride + this.offset + 2]
  42049. },
  42050. getW: function(e) {
  42051. return this.data.array[e * this.data.stride + this.offset + 3]
  42052. },
  42053. setXY: function(e, t, i) {
  42054. return e = e * this.data.stride + this.offset,
  42055. this.data.array[e + 0] = t,
  42056. this.data.array[e + 1] = i,
  42057. this
  42058. },
  42059. setXYZ: function(e, t, i, n) {
  42060. return e = e * this.data.stride + this.offset,
  42061. this.data.array[e + 0] = t,
  42062. this.data.array[e + 1] = i,
  42063. this.data.array[e + 2] = n,
  42064. this
  42065. },
  42066. setXYZW: function(e, t, i, n, r) {
  42067. return e = e * this.data.stride + this.offset,
  42068. this.data.array[e + 0] = t,
  42069. this.data.array[e + 1] = i,
  42070. this.data.array[e + 2] = n,
  42071. this.data.array[e + 3] = r,
  42072. this
  42073. }
  42074. },
  42075. n.Geometry = function() {
  42076. Object.defineProperty(this, "id", {
  42077. value: n.GeometryIdCount++
  42078. }),
  42079. this.uuid = n.Math.generateUUID(),
  42080. this.name = "",
  42081. this.type = "Geometry",
  42082. this.vertices = [],
  42083. this.colors = [],
  42084. this.faces = [],
  42085. this.faceVertexUvs = [[]],
  42086. this.morphTargets = [],
  42087. this.morphNormals = [],
  42088. this.skinWeights = [],
  42089. this.skinIndices = [],
  42090. this.lineDistances = [],
  42091. this.boundingBox = null,
  42092. this.boundingSphere = null,
  42093. this.verticesNeedUpdate = !1,
  42094. this.elementsNeedUpdate = !1,
  42095. this.uvsNeedUpdate = !1,
  42096. this.normalsNeedUpdate = !1,
  42097. this.colorsNeedUpdate = !1,
  42098. this.lineDistancesNeedUpdate = !1,
  42099. this.groupsNeedUpdate = !1
  42100. }
  42101. ,
  42102. n.Geometry.prototype = {
  42103. constructor: n.Geometry,
  42104. applyMatrix: function(e) {
  42105. for (var t = (new n.Matrix3).getNormalMatrix(e), i = 0, r = this.vertices.length; i < r; i++) {
  42106. var o = this.vertices[i];
  42107. o.applyMatrix4(e)
  42108. }
  42109. for (var i = 0, r = this.faces.length; i < r; i++) {
  42110. var a = this.faces[i];
  42111. a.normal.applyMatrix3(t).normalize();
  42112. for (var s = 0, l = a.vertexNormals.length; s < l; s++)
  42113. a.vertexNormals[s].applyMatrix3(t).normalize()
  42114. }
  42115. return null !== this.boundingBox && this.computeBoundingBox(),
  42116. null !== this.boundingSphere && this.computeBoundingSphere(),
  42117. this.verticesNeedUpdate = !0,
  42118. this.normalsNeedUpdate = !0,
  42119. this
  42120. },
  42121. rotateX: function() {
  42122. var e;
  42123. return function(t) {
  42124. return void 0 === e && (e = new n.Matrix4),
  42125. e.makeRotationX(t),
  42126. this.applyMatrix(e),
  42127. this
  42128. }
  42129. }(),
  42130. rotateY: function() {
  42131. var e;
  42132. return function(t) {
  42133. return void 0 === e && (e = new n.Matrix4),
  42134. e.makeRotationY(t),
  42135. this.applyMatrix(e),
  42136. this
  42137. }
  42138. }(),
  42139. rotateZ: function() {
  42140. var e;
  42141. return function(t) {
  42142. return void 0 === e && (e = new n.Matrix4),
  42143. e.makeRotationZ(t),
  42144. this.applyMatrix(e),
  42145. this
  42146. }
  42147. }(),
  42148. translate: function() {
  42149. var e;
  42150. return function(t, i, r) {
  42151. return void 0 === e && (e = new n.Matrix4),
  42152. e.makeTranslation(t, i, r),
  42153. this.applyMatrix(e),
  42154. this
  42155. }
  42156. }(),
  42157. scale: function() {
  42158. var e;
  42159. return function(t, i, r) {
  42160. return void 0 === e && (e = new n.Matrix4),
  42161. e.makeScale(t, i, r),
  42162. this.applyMatrix(e),
  42163. this
  42164. }
  42165. }(),
  42166. lookAt: function() {
  42167. var e;
  42168. return function(t) {
  42169. void 0 === e && (e = new n.Object3D),
  42170. e.lookAt(t),
  42171. e.updateMatrix(),
  42172. this.applyMatrix(e.matrix)
  42173. }
  42174. }(),
  42175. fromBufferGeometry: function(e) {
  42176. function t(e, t, r, o) {
  42177. var a = void 0 !== s ? [u[e].clone(), u[t].clone(), u[r].clone()] : []
  42178. , f = void 0 !== l ? [i.colors[e].clone(), i.colors[t].clone(), i.colors[r].clone()] : []
  42179. , g = new n.Face3(e,t,r,a,f,o);
  42180. i.faces.push(g),
  42181. void 0 !== c && i.faceVertexUvs[0].push([d[e].clone(), d[t].clone(), d[r].clone()]),
  42182. void 0 !== h && i.faceVertexUvs[1].push([p[e].clone(), p[t].clone(), p[r].clone()])
  42183. }
  42184. var i = this
  42185. , r = null !== e.index ? e.index.array : void 0
  42186. , o = e.attributes
  42187. , a = o.position.array
  42188. , s = void 0 !== o.normal ? o.normal.array : void 0
  42189. , l = void 0 !== o.color ? o.color.array : void 0
  42190. , c = void 0 !== o.uv ? o.uv.array : void 0
  42191. , h = void 0 !== o.uv2 ? o.uv2.array : void 0;
  42192. void 0 !== h && (this.faceVertexUvs[1] = []);
  42193. for (var u = [], d = [], p = [], f = 0, g = 0; f < a.length; f += 3,
  42194. g += 2)
  42195. i.vertices.push(new n.Vector3(a[f],a[f + 1],a[f + 2])),
  42196. void 0 !== s && u.push(new n.Vector3(s[f],s[f + 1],s[f + 2])),
  42197. void 0 !== l && i.colors.push(new n.Color(l[f],l[f + 1],l[f + 2])),
  42198. void 0 !== c && d.push(new n.Vector2(c[g],c[g + 1])),
  42199. void 0 !== h && p.push(new n.Vector2(h[g],h[g + 1]));
  42200. if (void 0 !== r) {
  42201. var m = e.groups;
  42202. if (m.length > 0)
  42203. for (var f = 0; f < m.length; f++)
  42204. for (var v = m[f], A = v.start, y = v.count, g = A, C = A + y; g < C; g += 3)
  42205. t(r[g], r[g + 1], r[g + 2], v.materialIndex);
  42206. else
  42207. for (var f = 0; f < r.length; f += 3)
  42208. t(r[f], r[f + 1], r[f + 2])
  42209. } else
  42210. for (var f = 0; f < a.length / 3; f += 3)
  42211. t(f, f + 1, f + 2);
  42212. return this.computeFaceNormals(),
  42213. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42214. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42215. this
  42216. },
  42217. center: function() {
  42218. this.computeBoundingBox();
  42219. var e = this.boundingBox.center().negate();
  42220. return this.translate(e.x, e.y, e.z),
  42221. e
  42222. },
  42223. normalize: function() {
  42224. this.computeBoundingSphere();
  42225. var e = this.boundingSphere.center
  42226. , t = this.boundingSphere.radius
  42227. , i = 0 === t ? 1 : 1 / t
  42228. , r = new n.Matrix4;
  42229. 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),
  42230. this.applyMatrix(r),
  42231. this
  42232. },
  42233. computeFaceNormals: function() {
  42234. for (var e = new n.Vector3, t = new n.Vector3, i = 0, r = this.faces.length; i < r; i++) {
  42235. var o = this.faces[i]
  42236. , a = this.vertices[o.a]
  42237. , s = this.vertices[o.b]
  42238. , l = this.vertices[o.c];
  42239. e.subVectors(l, s),
  42240. t.subVectors(a, s),
  42241. e.cross(t),
  42242. e.normalize(),
  42243. o.normal.copy(e)
  42244. }
  42245. },
  42246. computeVertexNormals: function(e) {
  42247. void 0 === e && (e = !0);
  42248. var t, i, r, o, a, s;
  42249. for (s = new Array(this.vertices.length),
  42250. t = 0,
  42251. i = this.vertices.length; t < i; t++)
  42252. s[t] = new n.Vector3;
  42253. if (e) {
  42254. var l, c, h, u = new n.Vector3, d = new n.Vector3;
  42255. for (r = 0,
  42256. o = this.faces.length; r < o; r++)
  42257. a = this.faces[r],
  42258. l = this.vertices[a.a],
  42259. c = this.vertices[a.b],
  42260. h = this.vertices[a.c],
  42261. u.subVectors(h, c),
  42262. d.subVectors(l, c),
  42263. u.cross(d),
  42264. s[a.a].add(u),
  42265. s[a.b].add(u),
  42266. s[a.c].add(u)
  42267. } else
  42268. for (r = 0,
  42269. o = this.faces.length; r < o; r++)
  42270. a = this.faces[r],
  42271. s[a.a].add(a.normal),
  42272. s[a.b].add(a.normal),
  42273. s[a.c].add(a.normal);
  42274. for (t = 0,
  42275. i = this.vertices.length; t < i; t++)
  42276. s[t].normalize();
  42277. for (r = 0,
  42278. o = this.faces.length; r < o; r++) {
  42279. a = this.faces[r];
  42280. var p = a.vertexNormals;
  42281. 3 === p.length ? (p[0].copy(s[a.a]),
  42282. p[1].copy(s[a.b]),
  42283. p[2].copy(s[a.c])) : (p[0] = s[a.a].clone(),
  42284. p[1] = s[a.b].clone(),
  42285. p[2] = s[a.c].clone())
  42286. }
  42287. this.faces.length > 0 && (this.normalsNeedUpdate = !0)
  42288. },
  42289. computeMorphNormals: function() {
  42290. var e, t, i, r, o;
  42291. for (i = 0,
  42292. r = this.faces.length; i < r; i++)
  42293. for (o = this.faces[i],
  42294. o.__originalFaceNormal ? o.__originalFaceNormal.copy(o.normal) : o.__originalFaceNormal = o.normal.clone(),
  42295. o.__originalVertexNormals || (o.__originalVertexNormals = []),
  42296. e = 0,
  42297. t = o.vertexNormals.length; e < t; e++)
  42298. o.__originalVertexNormals[e] ? o.__originalVertexNormals[e].copy(o.vertexNormals[e]) : o.__originalVertexNormals[e] = o.vertexNormals[e].clone();
  42299. var a = new n.Geometry;
  42300. for (a.faces = this.faces,
  42301. e = 0,
  42302. t = this.morphTargets.length; e < t; e++) {
  42303. if (!this.morphNormals[e]) {
  42304. this.morphNormals[e] = {},
  42305. this.morphNormals[e].faceNormals = [],
  42306. this.morphNormals[e].vertexNormals = [];
  42307. var s, l, c = this.morphNormals[e].faceNormals, h = this.morphNormals[e].vertexNormals;
  42308. for (i = 0,
  42309. r = this.faces.length; i < r; i++)
  42310. s = new n.Vector3,
  42311. l = {
  42312. a: new n.Vector3,
  42313. b: new n.Vector3,
  42314. c: new n.Vector3
  42315. },
  42316. c.push(s),
  42317. h.push(l)
  42318. }
  42319. var u = this.morphNormals[e];
  42320. a.vertices = this.morphTargets[e].vertices,
  42321. a.computeFaceNormals(),
  42322. a.computeVertexNormals();
  42323. var s, l;
  42324. for (i = 0,
  42325. r = this.faces.length; i < r; i++)
  42326. o = this.faces[i],
  42327. s = u.faceNormals[i],
  42328. l = u.vertexNormals[i],
  42329. s.copy(o.normal),
  42330. l.a.copy(o.vertexNormals[0]),
  42331. l.b.copy(o.vertexNormals[1]),
  42332. l.c.copy(o.vertexNormals[2])
  42333. }
  42334. for (i = 0,
  42335. r = this.faces.length; i < r; i++)
  42336. o = this.faces[i],
  42337. o.normal = o.__originalFaceNormal,
  42338. o.vertexNormals = o.__originalVertexNormals
  42339. },
  42340. computeTangents: function() {
  42341. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  42342. },
  42343. computeLineDistances: function() {
  42344. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  42345. i > 0 && (e += t[i].distanceTo(t[i - 1])),
  42346. this.lineDistances[i] = e
  42347. },
  42348. computeBoundingBox: function() {
  42349. null === this.boundingBox && (this.boundingBox = new n.Box3),
  42350. this.boundingBox.setFromPoints(this.vertices)
  42351. },
  42352. computeBoundingSphere: function() {
  42353. null === this.boundingSphere && (this.boundingSphere = new n.Sphere),
  42354. this.boundingSphere.setFromPoints(this.vertices)
  42355. },
  42356. merge: function(e, t, i) {
  42357. if (e instanceof n.Geometry == !1)
  42358. return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e);
  42359. 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];
  42360. void 0 === i && (i = 0),
  42361. void 0 !== t && (r = (new n.Matrix3).getNormalMatrix(t));
  42362. for (var d = 0, p = s.length; d < p; d++) {
  42363. var f = s[d]
  42364. , g = f.clone();
  42365. void 0 !== t && g.applyMatrix4(t),
  42366. a.push(g)
  42367. }
  42368. for (d = 0,
  42369. p = c.length; d < p; d++) {
  42370. var m, v, A, y = c[d], C = y.vertexNormals, I = y.vertexColors;
  42371. m = new n.Face3(y.a + o,y.b + o,y.c + o),
  42372. m.normal.copy(y.normal),
  42373. void 0 !== r && m.normal.applyMatrix3(r).normalize();
  42374. for (var E = 0, b = C.length; E < b; E++)
  42375. v = C[E].clone(),
  42376. void 0 !== r && v.applyMatrix3(r).normalize(),
  42377. m.vertexNormals.push(v);
  42378. m.color.copy(y.color);
  42379. for (var E = 0, b = I.length; E < b; E++)
  42380. A = I[E],
  42381. m.vertexColors.push(A.clone());
  42382. m.materialIndex = y.materialIndex + i,
  42383. l.push(m)
  42384. }
  42385. for (d = 0,
  42386. p = u.length; d < p; d++) {
  42387. var w = u[d]
  42388. , _ = [];
  42389. if (void 0 !== w) {
  42390. for (var E = 0, b = w.length; E < b; E++)
  42391. _.push(w[E].clone());
  42392. h.push(_)
  42393. }
  42394. }
  42395. },
  42396. mergeMesh: function(e) {
  42397. return e instanceof n.Mesh == !1 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  42398. void this.merge(e.geometry, e.matrix))
  42399. },
  42400. mergeVertices: function() {
  42401. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = 4, d = Math.pow(10, u);
  42402. for (i = 0,
  42403. n = this.vertices.length; i < n; i++)
  42404. e = this.vertices[i],
  42405. t = Math.round(e.x * d) + "_" + Math.round(e.y * d) + "_" + Math.round(e.z * d),
  42406. void 0 === l[t] ? (l[t] = i,
  42407. c.push(this.vertices[i]),
  42408. h[i] = c.length - 1) : h[i] = h[l[t]];
  42409. var p = [];
  42410. for (i = 0,
  42411. n = this.faces.length; i < n; i++) {
  42412. r = this.faces[i],
  42413. r.a = h[r.a],
  42414. r.b = h[r.b],
  42415. r.c = h[r.c],
  42416. o = [r.a, r.b, r.c];
  42417. for (var f = -1, g = 0; g < 3; g++)
  42418. if (o[g] === o[(g + 1) % 3]) {
  42419. f = g,
  42420. p.push(i);
  42421. break
  42422. }
  42423. }
  42424. for (i = p.length - 1; i >= 0; i--) {
  42425. var m = p[i];
  42426. for (this.faces.splice(m, 1),
  42427. a = 0,
  42428. s = this.faceVertexUvs.length; a < s; a++)
  42429. this.faceVertexUvs[a].splice(m, 1)
  42430. }
  42431. var v = this.vertices.length - c.length;
  42432. return this.vertices = c,
  42433. v
  42434. },
  42435. sortFacesByMaterialIndex: function() {
  42436. function e(e, t) {
  42437. return e.materialIndex - t.materialIndex
  42438. }
  42439. for (var t = this.faces, i = t.length, n = 0; n < i; n++)
  42440. t[n]._id = n;
  42441. t.sort(e);
  42442. var r, o, a = this.faceVertexUvs[0], s = this.faceVertexUvs[1];
  42443. a && a.length === i && (r = []),
  42444. s && s.length === i && (o = []);
  42445. for (var n = 0; n < i; n++) {
  42446. var l = t[n]._id;
  42447. r && r.push(a[l]),
  42448. o && o.push(s[l])
  42449. }
  42450. r && (this.faceVertexUvs[0] = r),
  42451. o && (this.faceVertexUvs[1] = o)
  42452. },
  42453. toJSON: function() {
  42454. function e(e, t, i) {
  42455. return i ? e | 1 << t : e & ~(1 << t)
  42456. }
  42457. function t(e) {
  42458. var t = e.x.toString() + e.y.toString() + e.z.toString();
  42459. return void 0 !== d[t] ? d[t] : (d[t] = u.length / 3,
  42460. u.push(e.x, e.y, e.z),
  42461. d[t])
  42462. }
  42463. function i(e) {
  42464. var t = e.r.toString() + e.g.toString() + e.b.toString();
  42465. return void 0 !== f[t] ? f[t] : (f[t] = p.length,
  42466. p.push(e.getHex()),
  42467. f[t])
  42468. }
  42469. function n(e) {
  42470. var t = e.x.toString() + e.y.toString();
  42471. return void 0 !== m[t] ? m[t] : (m[t] = g.length / 2,
  42472. g.push(e.x, e.y),
  42473. m[t])
  42474. }
  42475. var r = {
  42476. metadata: {
  42477. version: 4.4,
  42478. type: "Geometry",
  42479. generator: "Geometry.toJSON"
  42480. }
  42481. };
  42482. if (r.uuid = this.uuid,
  42483. r.type = this.type,
  42484. "" !== this.name && (r.name = this.name),
  42485. void 0 !== this.parameters) {
  42486. var o = this.parameters;
  42487. for (var a in o)
  42488. void 0 !== o[a] && (r[a] = o[a]);
  42489. return r
  42490. }
  42491. for (var s = [], l = 0; l < this.vertices.length; l++) {
  42492. var c = this.vertices[l];
  42493. s.push(c.x, c.y, c.z)
  42494. }
  42495. for (var h = [], u = [], d = {}, p = [], f = {}, g = [], m = {}, l = 0; l < this.faces.length; l++) {
  42496. var v = this.faces[l]
  42497. , A = !0
  42498. , y = !1
  42499. , C = void 0 !== this.faceVertexUvs[0][l]
  42500. , I = v.normal.length() > 0
  42501. , E = v.vertexNormals.length > 0
  42502. , b = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  42503. , w = v.vertexColors.length > 0
  42504. , _ = 0;
  42505. if (_ = e(_, 0, 0),
  42506. _ = e(_, 1, A),
  42507. _ = e(_, 2, y),
  42508. _ = e(_, 3, C),
  42509. _ = e(_, 4, I),
  42510. _ = e(_, 5, E),
  42511. _ = e(_, 6, b),
  42512. _ = e(_, 7, w),
  42513. h.push(_),
  42514. h.push(v.a, v.b, v.c),
  42515. h.push(v.materialIndex),
  42516. C) {
  42517. var T = this.faceVertexUvs[0][l];
  42518. h.push(n(T[0]), n(T[1]), n(T[2]))
  42519. }
  42520. if (I && h.push(t(v.normal)),
  42521. E) {
  42522. var x = v.vertexNormals;
  42523. h.push(t(x[0]), t(x[1]), t(x[2]))
  42524. }
  42525. if (b && h.push(i(v.color)),
  42526. w) {
  42527. var S = v.vertexColors;
  42528. h.push(i(S[0]), i(S[1]), i(S[2]))
  42529. }
  42530. }
  42531. return r.data = {},
  42532. r.data.vertices = s,
  42533. r.data.normals = u,
  42534. p.length > 0 && (r.data.colors = p),
  42535. g.length > 0 && (r.data.uvs = [g]),
  42536. r.data.faces = h,
  42537. r
  42538. },
  42539. clone: function() {
  42540. return (new n.Geometry).copy(this)
  42541. },
  42542. copy: function(e) {
  42543. this.vertices = [],
  42544. this.faces = [],
  42545. this.faceVertexUvs = [[]];
  42546. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  42547. this.vertices.push(t[i].clone());
  42548. for (var r = e.faces, i = 0, n = r.length; i < n; i++)
  42549. this.faces.push(r[i].clone());
  42550. for (var i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  42551. var o = e.faceVertexUvs[i];
  42552. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  42553. for (var a = 0, s = o.length; a < s; a++) {
  42554. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  42555. var d = l[h];
  42556. c.push(d.clone())
  42557. }
  42558. this.faceVertexUvs[i].push(c)
  42559. }
  42560. }
  42561. return this
  42562. },
  42563. dispose: function() {
  42564. this.dispatchEvent({
  42565. type: "dispose"
  42566. })
  42567. }
  42568. },
  42569. n.EventDispatcher.prototype.apply(n.Geometry.prototype),
  42570. n.GeometryIdCount = 0,
  42571. n.DirectGeometry = function() {
  42572. Object.defineProperty(this, "id", {
  42573. value: n.GeometryIdCount++
  42574. }),
  42575. this.uuid = n.Math.generateUUID(),
  42576. this.name = "",
  42577. this.type = "DirectGeometry",
  42578. this.indices = [],
  42579. this.vertices = [],
  42580. this.normals = [],
  42581. this.colors = [],
  42582. this.uvs = [],
  42583. this.uvs2 = [],
  42584. this.groups = [],
  42585. this.morphTargets = {},
  42586. this.skinWeights = [],
  42587. this.skinIndices = [],
  42588. this.boundingBox = null,
  42589. this.boundingSphere = null,
  42590. this.verticesNeedUpdate = !1,
  42591. this.normalsNeedUpdate = !1,
  42592. this.colorsNeedUpdate = !1,
  42593. this.uvsNeedUpdate = !1,
  42594. this.groupsNeedUpdate = !1
  42595. }
  42596. ,
  42597. n.DirectGeometry.prototype = {
  42598. constructor: n.DirectGeometry,
  42599. computeBoundingBox: n.Geometry.prototype.computeBoundingBox,
  42600. computeBoundingSphere: n.Geometry.prototype.computeBoundingSphere,
  42601. computeFaceNormals: function() {
  42602. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  42603. },
  42604. computeVertexNormals: function() {
  42605. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  42606. },
  42607. computeGroups: function(e) {
  42608. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  42609. var a = r[o];
  42610. a.materialIndex !== i && (i = a.materialIndex,
  42611. void 0 !== t && (t.count = 3 * o - t.start,
  42612. n.push(t)),
  42613. t = {
  42614. start: 3 * o,
  42615. materialIndex: i
  42616. })
  42617. }
  42618. void 0 !== t && (t.count = 3 * o - t.start,
  42619. n.push(t)),
  42620. this.groups = n
  42621. },
  42622. fromGeometry: function(e) {
  42623. 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;
  42624. if (c > 0) {
  42625. t = [];
  42626. for (var h = 0; h < c; h++)
  42627. t[h] = [];
  42628. this.morphTargets.position = t
  42629. }
  42630. var u, d = e.morphNormals, p = d.length;
  42631. if (p > 0) {
  42632. u = [];
  42633. for (var h = 0; h < p; h++)
  42634. u[h] = [];
  42635. this.morphTargets.normal = u
  42636. }
  42637. for (var f = e.skinIndices, g = e.skinWeights, m = f.length === r.length, v = g.length === r.length, h = 0; h < i.length; h++) {
  42638. var A = i[h];
  42639. this.vertices.push(r[A.a], r[A.b], r[A.c]);
  42640. var y = A.vertexNormals;
  42641. if (3 === y.length)
  42642. this.normals.push(y[0], y[1], y[2]);
  42643. else {
  42644. var C = A.normal;
  42645. this.normals.push(C, C, C)
  42646. }
  42647. var I = A.vertexColors;
  42648. if (3 === I.length)
  42649. this.colors.push(I[0], I[1], I[2]);
  42650. else {
  42651. var E = A.color;
  42652. this.colors.push(E, E, E)
  42653. }
  42654. if (a === !0) {
  42655. var b = o[0][h];
  42656. void 0 !== b ? this.uvs.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", h),
  42657. this.uvs.push(new n.Vector2, new n.Vector2, new n.Vector2))
  42658. }
  42659. if (s === !0) {
  42660. var b = o[1][h];
  42661. void 0 !== b ? this.uvs2.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", h),
  42662. this.uvs2.push(new n.Vector2, new n.Vector2, new n.Vector2))
  42663. }
  42664. for (var w = 0; w < c; w++) {
  42665. var _ = l[w].vertices;
  42666. t[w].push(_[A.a], _[A.b], _[A.c])
  42667. }
  42668. for (var w = 0; w < p; w++) {
  42669. var T = d[w].vertexNormals[h];
  42670. u[w].push(T.a, T.b, T.c)
  42671. }
  42672. m && this.skinIndices.push(f[A.a], f[A.b], f[A.c]),
  42673. v && this.skinWeights.push(g[A.a], g[A.b], g[A.c])
  42674. }
  42675. return this.computeGroups(e),
  42676. this.verticesNeedUpdate = e.verticesNeedUpdate,
  42677. this.normalsNeedUpdate = e.normalsNeedUpdate,
  42678. this.colorsNeedUpdate = e.colorsNeedUpdate,
  42679. this.uvsNeedUpdate = e.uvsNeedUpdate,
  42680. this.groupsNeedUpdate = e.groupsNeedUpdate,
  42681. this
  42682. },
  42683. dispose: function() {
  42684. this.dispatchEvent({
  42685. type: "dispose"
  42686. })
  42687. }
  42688. },
  42689. n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),
  42690. n.BufferGeometry = function() {
  42691. Object.defineProperty(this, "id", {
  42692. value: n.GeometryIdCount++
  42693. }),
  42694. this.uuid = n.Math.generateUUID(),
  42695. this.name = "",
  42696. this.type = "BufferGeometry",
  42697. this.index = null,
  42698. this.attributes = {},
  42699. this.morphAttributes = {},
  42700. this.groups = [],
  42701. this.boundingBox = null,
  42702. this.boundingSphere = null,
  42703. this.drawRange = {
  42704. start: 0,
  42705. count: 1 / 0
  42706. }
  42707. }
  42708. ,
  42709. n.BufferGeometry.prototype = {
  42710. constructor: n.BufferGeometry,
  42711. getIndex: function() {
  42712. return this.index
  42713. },
  42714. setIndex: function(e) {
  42715. this.index = e
  42716. },
  42717. addAttribute: function(e, t) {
  42718. return t instanceof n.BufferAttribute == !1 && t instanceof n.InterleavedBufferAttribute == !1 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  42719. void this.addAttribute(e, new n.BufferAttribute(arguments[1],arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  42720. void this.setIndex(t)) : (this.attributes[e] = t,
  42721. this)
  42722. },
  42723. getAttribute: function(e) {
  42724. return this.attributes[e]
  42725. },
  42726. removeAttribute: function(e) {
  42727. return delete this.attributes[e],
  42728. this
  42729. },
  42730. addGroup: function(e, t, i) {
  42731. this.groups.push({
  42732. start: e,
  42733. count: t,
  42734. materialIndex: void 0 !== i ? i : 0
  42735. })
  42736. },
  42737. clearGroups: function() {
  42738. this.groups = []
  42739. },
  42740. setDrawRange: function(e, t) {
  42741. this.drawRange.start = e,
  42742. this.drawRange.count = t
  42743. },
  42744. applyMatrix: function(e) {
  42745. var t = this.attributes.position;
  42746. void 0 !== t && (e.applyToVector3Array(t.array),
  42747. t.needsUpdate = !0);
  42748. var i = this.attributes.normal;
  42749. if (void 0 !== i) {
  42750. var r = (new n.Matrix3).getNormalMatrix(e);
  42751. r.applyToVector3Array(i.array),
  42752. i.needsUpdate = !0
  42753. }
  42754. return null !== this.boundingBox && this.computeBoundingBox(),
  42755. null !== this.boundingSphere && this.computeBoundingSphere(),
  42756. this
  42757. },
  42758. rotateX: function() {
  42759. var e;
  42760. return function(t) {
  42761. return void 0 === e && (e = new n.Matrix4),
  42762. e.makeRotationX(t),
  42763. this.applyMatrix(e),
  42764. this
  42765. }
  42766. }(),
  42767. rotateY: function() {
  42768. var e;
  42769. return function(t) {
  42770. return void 0 === e && (e = new n.Matrix4),
  42771. e.makeRotationY(t),
  42772. this.applyMatrix(e),
  42773. this
  42774. }
  42775. }(),
  42776. rotateZ: function() {
  42777. var e;
  42778. return function(t) {
  42779. return void 0 === e && (e = new n.Matrix4),
  42780. e.makeRotationZ(t),
  42781. this.applyMatrix(e),
  42782. this
  42783. }
  42784. }(),
  42785. translate: function() {
  42786. var e;
  42787. return function(t, i, r) {
  42788. return void 0 === e && (e = new n.Matrix4),
  42789. e.makeTranslation(t, i, r),
  42790. this.applyMatrix(e),
  42791. this
  42792. }
  42793. }(),
  42794. scale: function() {
  42795. var e;
  42796. return function(t, i, r) {
  42797. return void 0 === e && (e = new n.Matrix4),
  42798. e.makeScale(t, i, r),
  42799. this.applyMatrix(e),
  42800. this
  42801. }
  42802. }(),
  42803. lookAt: function() {
  42804. var e;
  42805. return function(t) {
  42806. void 0 === e && (e = new n.Object3D),
  42807. e.lookAt(t),
  42808. e.updateMatrix(),
  42809. this.applyMatrix(e.matrix)
  42810. }
  42811. }(),
  42812. center: function() {
  42813. this.computeBoundingBox();
  42814. var e = this.boundingBox.center().negate();
  42815. return this.translate(e.x, e.y, e.z),
  42816. e
  42817. },
  42818. setFromObject: function(e) {
  42819. var t = e.geometry;
  42820. if (e instanceof n.Points || e instanceof n.Line) {
  42821. var i = new n.Float32Attribute(3 * t.vertices.length,3)
  42822. , r = new n.Float32Attribute(3 * t.colors.length,3);
  42823. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  42824. this.addAttribute("color", r.copyColorsArray(t.colors)),
  42825. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  42826. var o = new n.Float32Attribute(t.lineDistances.length,1);
  42827. this.addAttribute("lineDistance", o.copyArray(t.lineDistances))
  42828. }
  42829. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  42830. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  42831. } else
  42832. e instanceof n.Mesh && t instanceof n.Geometry && this.fromGeometry(t);
  42833. return this
  42834. },
  42835. updateFromObject: function(e) {
  42836. var t = e.geometry;
  42837. if (e instanceof n.Mesh) {
  42838. var i = t.__directGeometry;
  42839. if (void 0 === i)
  42840. return this.fromGeometry(t);
  42841. i.verticesNeedUpdate = t.verticesNeedUpdate,
  42842. i.normalsNeedUpdate = t.normalsNeedUpdate,
  42843. i.colorsNeedUpdate = t.colorsNeedUpdate,
  42844. i.uvsNeedUpdate = t.uvsNeedUpdate,
  42845. i.groupsNeedUpdate = t.groupsNeedUpdate,
  42846. t.verticesNeedUpdate = !1,
  42847. t.normalsNeedUpdate = !1,
  42848. t.colorsNeedUpdate = !1,
  42849. t.uvsNeedUpdate = !1,
  42850. t.groupsNeedUpdate = !1,
  42851. t = i
  42852. }
  42853. if (t.verticesNeedUpdate === !0) {
  42854. var r = this.attributes.position;
  42855. void 0 !== r && (r.copyVector3sArray(t.vertices),
  42856. r.needsUpdate = !0),
  42857. t.verticesNeedUpdate = !1
  42858. }
  42859. if (t.normalsNeedUpdate === !0) {
  42860. var r = this.attributes.normal;
  42861. void 0 !== r && (r.copyVector3sArray(t.normals),
  42862. r.needsUpdate = !0),
  42863. t.normalsNeedUpdate = !1
  42864. }
  42865. if (t.colorsNeedUpdate === !0) {
  42866. var r = this.attributes.color;
  42867. void 0 !== r && (r.copyColorsArray(t.colors),
  42868. r.needsUpdate = !0),
  42869. t.colorsNeedUpdate = !1
  42870. }
  42871. if (t.uvsNeedUpdate) {
  42872. var r = this.attributes.uv;
  42873. void 0 !== r && (r.copyVector2sArray(t.uvs),
  42874. r.needsUpdate = !0),
  42875. t.uvsNeedUpdate = !1
  42876. }
  42877. if (t.lineDistancesNeedUpdate) {
  42878. var r = this.attributes.lineDistance;
  42879. void 0 !== r && (r.copyArray(t.lineDistances),
  42880. r.needsUpdate = !0),
  42881. t.lineDistancesNeedUpdate = !1
  42882. }
  42883. return t.groupsNeedUpdate && (t.computeGroups(e.geometry),
  42884. this.groups = t.groups,
  42885. t.groupsNeedUpdate = !1),
  42886. this
  42887. },
  42888. fromGeometry: function(e) {
  42889. return e.__directGeometry = (new n.DirectGeometry).fromGeometry(e),
  42890. this.fromDirectGeometry(e.__directGeometry)
  42891. },
  42892. fromDirectGeometry: function(e) {
  42893. var t = new Float32Array(3 * e.vertices.length);
  42894. if (this.addAttribute("position", new n.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  42895. e.normals.length > 0) {
  42896. var i = new Float32Array(3 * e.normals.length);
  42897. this.addAttribute("normal", new n.BufferAttribute(i,3).copyVector3sArray(e.normals))
  42898. }
  42899. if (e.colors.length > 0) {
  42900. var r = new Float32Array(3 * e.colors.length);
  42901. this.addAttribute("color", new n.BufferAttribute(r,3).copyColorsArray(e.colors))
  42902. }
  42903. if (e.uvs.length > 0) {
  42904. var o = new Float32Array(2 * e.uvs.length);
  42905. this.addAttribute("uv", new n.BufferAttribute(o,2).copyVector2sArray(e.uvs))
  42906. }
  42907. if (e.uvs2.length > 0) {
  42908. var a = new Float32Array(2 * e.uvs2.length);
  42909. this.addAttribute("uv2", new n.BufferAttribute(a,2).copyVector2sArray(e.uvs2))
  42910. }
  42911. if (e.indices.length > 0) {
  42912. var s = e.vertices.length > 65535 ? Uint32Array : Uint16Array
  42913. , l = new s(3 * e.indices.length);
  42914. this.setIndex(new n.BufferAttribute(l,1).copyIndicesArray(e.indices))
  42915. }
  42916. this.groups = e.groups;
  42917. for (var c in e.morphTargets) {
  42918. for (var h = [], u = e.morphTargets[c], d = 0, p = u.length; d < p; d++) {
  42919. var f = u[d]
  42920. , g = new n.Float32Attribute(3 * f.length,3);
  42921. h.push(g.copyVector3sArray(f))
  42922. }
  42923. this.morphAttributes[c] = h
  42924. }
  42925. if (e.skinIndices.length > 0) {
  42926. var m = new n.Float32Attribute(4 * e.skinIndices.length,4);
  42927. this.addAttribute("skinIndex", m.copyVector4sArray(e.skinIndices))
  42928. }
  42929. if (e.skinWeights.length > 0) {
  42930. var v = new n.Float32Attribute(4 * e.skinWeights.length,4);
  42931. this.addAttribute("skinWeight", v.copyVector4sArray(e.skinWeights))
  42932. }
  42933. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42934. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42935. this
  42936. },
  42937. computeBoundingBox: function() {
  42938. new n.Vector3;
  42939. return function() {
  42940. null === this.boundingBox && (this.boundingBox = new n.Box3);
  42941. var e = this.attributes.position.array;
  42942. e && this.boundingBox.setFromArray(e),
  42943. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  42944. this.boundingBox.max.set(0, 0, 0)),
  42945. (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)
  42946. }
  42947. }(),
  42948. computeBoundingSphere: function() {
  42949. var e = new n.Box3
  42950. , t = new n.Vector3;
  42951. return function() {
  42952. null === this.boundingSphere && (this.boundingSphere = new n.Sphere);
  42953. var i = this.attributes.position.array;
  42954. if (i) {
  42955. var r = this.boundingSphere.center;
  42956. e.setFromArray(i),
  42957. e.center(r);
  42958. for (var o = 0, a = 0, s = i.length; a < s; a += 3)
  42959. t.fromArray(i, a),
  42960. o = Math.max(o, r.distanceToSquared(t));
  42961. this.boundingSphere.radius = Math.sqrt(o),
  42962. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  42963. }
  42964. }
  42965. }(),
  42966. computeFaceNormals: function() {},
  42967. computeVertexNormals: function() {
  42968. var e = this.index
  42969. , t = this.attributes
  42970. , i = this.groups;
  42971. if (t.position) {
  42972. var r = t.position.array;
  42973. if (void 0 === t.normal)
  42974. this.addAttribute("normal", new n.BufferAttribute(new Float32Array(r.length),3));
  42975. else
  42976. for (var o = t.normal.array, a = 0, s = o.length; a < s; a++)
  42977. o[a] = 0;
  42978. 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;
  42979. if (e) {
  42980. var v = e.array;
  42981. 0 === i.length && this.addGroup(0, v.length);
  42982. for (var A = 0, y = i.length; A < y; ++A)
  42983. for (var C = i[A], I = C.start, E = C.count, a = I, s = I + E; a < s; a += 3)
  42984. l = 3 * v[a + 0],
  42985. c = 3 * v[a + 1],
  42986. h = 3 * v[a + 2],
  42987. d.fromArray(r, l),
  42988. p.fromArray(r, c),
  42989. f.fromArray(r, h),
  42990. g.subVectors(f, p),
  42991. m.subVectors(d, p),
  42992. g.cross(m),
  42993. u[l] += g.x,
  42994. u[l + 1] += g.y,
  42995. u[l + 2] += g.z,
  42996. u[c] += g.x,
  42997. u[c + 1] += g.y,
  42998. u[c + 2] += g.z,
  42999. u[h] += g.x,
  43000. u[h + 1] += g.y,
  43001. u[h + 2] += g.z
  43002. } else
  43003. for (var a = 0, s = r.length; a < s; a += 9)
  43004. d.fromArray(r, a),
  43005. p.fromArray(r, a + 3),
  43006. f.fromArray(r, a + 6),
  43007. g.subVectors(f, p),
  43008. m.subVectors(d, p),
  43009. g.cross(m),
  43010. u[a] = g.x,
  43011. u[a + 1] = g.y,
  43012. u[a + 2] = g.z,
  43013. u[a + 3] = g.x,
  43014. u[a + 4] = g.y,
  43015. u[a + 5] = g.z,
  43016. u[a + 6] = g.x,
  43017. u[a + 7] = g.y,
  43018. u[a + 8] = g.z;
  43019. this.normalizeNormals(),
  43020. t.normal.needsUpdate = !0
  43021. }
  43022. },
  43023. merge: function(e, t) {
  43024. if (e instanceof n.BufferGeometry == !1)
  43025. return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e);
  43026. void 0 === t && (t = 0);
  43027. var i = this.attributes;
  43028. for (var r in i)
  43029. if (void 0 !== e.attributes[r])
  43030. 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++,
  43031. u++)
  43032. a[u] = l[h];
  43033. return this
  43034. },
  43035. normalizeNormals: function() {
  43036. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  43037. e = r[o],
  43038. t = r[o + 1],
  43039. i = r[o + 2],
  43040. n = 1 / Math.sqrt(e * e + t * t + i * i),
  43041. r[o] *= n,
  43042. r[o + 1] *= n,
  43043. r[o + 2] *= n
  43044. },
  43045. toNonIndexed: function() {
  43046. if (null === this.index)
  43047. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  43048. this;
  43049. var e = new n.BufferGeometry
  43050. , t = this.index.array
  43051. , i = this.attributes;
  43052. for (var r in i) {
  43053. 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++) {
  43054. c = t[u] * s;
  43055. for (var p = 0; p < s; p++)
  43056. l[h++] = a[c++]
  43057. }
  43058. e.addAttribute(r, new n.BufferAttribute(l,s))
  43059. }
  43060. return e
  43061. },
  43062. toJSON: function() {
  43063. var e = {
  43064. metadata: {
  43065. version: 4.4,
  43066. type: "BufferGeometry",
  43067. generator: "BufferGeometry.toJSON"
  43068. }
  43069. };
  43070. if (e.uuid = this.uuid,
  43071. e.type = this.type,
  43072. "" !== this.name && (e.name = this.name),
  43073. void 0 !== this.parameters) {
  43074. var t = this.parameters;
  43075. for (var i in t)
  43076. void 0 !== t[i] && (e[i] = t[i]);
  43077. return e
  43078. }
  43079. e.data = {
  43080. attributes: {}
  43081. };
  43082. var n = this.index;
  43083. if (null !== n) {
  43084. var r = Array.prototype.slice.call(n.array);
  43085. e.data.index = {
  43086. type: n.array.constructor.name,
  43087. array: r
  43088. }
  43089. }
  43090. var o = this.attributes;
  43091. for (var i in o) {
  43092. var a = o[i]
  43093. , r = Array.prototype.slice.call(a.array);
  43094. e.data.attributes[i] = {
  43095. itemSize: a.itemSize,
  43096. type: a.array.constructor.name,
  43097. array: r
  43098. }
  43099. }
  43100. var s = this.groups;
  43101. s.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(s)));
  43102. var l = this.boundingSphere;
  43103. return null !== l && (e.data.boundingSphere = {
  43104. center: l.center.toArray(),
  43105. radius: l.radius
  43106. }),
  43107. e
  43108. },
  43109. clone: function() {
  43110. return (new n.BufferGeometry).copy(this)
  43111. },
  43112. copy: function(e) {
  43113. var t = e.index;
  43114. null !== t && this.setIndex(t.clone());
  43115. var i = e.attributes;
  43116. for (var n in i) {
  43117. var r = i[n];
  43118. this.addAttribute(n, r.clone())
  43119. }
  43120. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  43121. var l = o[a];
  43122. this.addGroup(l.start, l.count)
  43123. }
  43124. return this
  43125. },
  43126. dispose: function() {
  43127. this.dispatchEvent({
  43128. type: "dispose"
  43129. })
  43130. }
  43131. },
  43132. n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),
  43133. n.BufferGeometry.MaxIndex = 65535,
  43134. n.InstancedBufferGeometry = function() {
  43135. n.BufferGeometry.call(this),
  43136. this.type = "InstancedBufferGeometry",
  43137. this.maxInstancedCount = void 0
  43138. }
  43139. ,
  43140. n.InstancedBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  43141. n.InstancedBufferGeometry.prototype.constructor = n.InstancedBufferGeometry,
  43142. n.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  43143. this.groups.push({
  43144. start: e,
  43145. count: t,
  43146. instances: i
  43147. })
  43148. }
  43149. ,
  43150. n.InstancedBufferGeometry.prototype.copy = function(e) {
  43151. var t = e.index;
  43152. null !== t && this.setIndex(t.clone());
  43153. var i = e.attributes;
  43154. for (var n in i) {
  43155. var r = i[n];
  43156. this.addAttribute(n, r.clone())
  43157. }
  43158. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  43159. var l = o[a];
  43160. this.addGroup(l.start, l.count, l.instances)
  43161. }
  43162. return this
  43163. }
  43164. ,
  43165. n.EventDispatcher.prototype.apply(n.InstancedBufferGeometry.prototype),
  43166. n.Uniform = function(e, t) {
  43167. this.type = e,
  43168. this.value = t,
  43169. this.dynamic = !1
  43170. }
  43171. ,
  43172. n.Uniform.prototype = {
  43173. constructor: n.Uniform,
  43174. onUpdate: function(e) {
  43175. return this.dynamic = !0,
  43176. this.onUpdateCallback = e,
  43177. this
  43178. }
  43179. },
  43180. n.AnimationClip = function(e, t, i) {
  43181. this.name = e || n.Math.generateUUID(),
  43182. this.tracks = i,
  43183. this.duration = void 0 !== t ? t : -1,
  43184. this.duration < 0 && this.resetDuration(),
  43185. this.trim(),
  43186. this.optimize()
  43187. }
  43188. ,
  43189. n.AnimationClip.prototype = {
  43190. constructor: n.AnimationClip,
  43191. resetDuration: function() {
  43192. for (var e = this.tracks, t = 0, i = 0, n = e.length; i !== n; ++i) {
  43193. var r = this.tracks[i];
  43194. t = Math.max(t, r.times[r.times.length - 1])
  43195. }
  43196. this.duration = t
  43197. },
  43198. trim: function() {
  43199. for (var e = 0; e < this.tracks.length; e++)
  43200. this.tracks[e].trim(0, this.duration);
  43201. return this
  43202. },
  43203. optimize: function() {
  43204. for (var e = 0; e < this.tracks.length; e++)
  43205. this.tracks[e].optimize();
  43206. return this
  43207. }
  43208. },
  43209. Object.assign(n.AnimationClip, {
  43210. parse: function(e) {
  43211. for (var t = [], i = e.tracks, r = 1 / (e.fps || 1), o = 0, a = i.length; o !== a; ++o)
  43212. t.push(n.KeyframeTrack.parse(i[o]).scale(r));
  43213. return new n.AnimationClip(e.name,e.duration,t)
  43214. },
  43215. toJSON: function(e) {
  43216. for (var t = [], i = e.tracks, r = {
  43217. name: e.name,
  43218. duration: e.duration,
  43219. tracks: t
  43220. }, o = 0, a = i.length; o !== a; ++o)
  43221. t.push(n.KeyframeTrack.toJSON(i[o]));
  43222. return r
  43223. },
  43224. CreateFromMorphTargetSequence: function(e, t, i) {
  43225. for (var r = t.length, o = [], a = 0; a < r; a++) {
  43226. var s = []
  43227. , l = [];
  43228. s.push((a + r - 1) % r, a, (a + 1) % r),
  43229. l.push(0, 1, 0);
  43230. var c = n.AnimationUtils.getKeyframeOrder(s);
  43231. s = n.AnimationUtils.sortedArray(s, 1, c),
  43232. l = n.AnimationUtils.sortedArray(l, 1, c),
  43233. 0 === s[0] && (s.push(r),
  43234. l.push(l[0])),
  43235. o.push(new n.NumberKeyframeTrack(".morphTargetInfluences[" + t[a].name + "]",s,l).scale(1 / i))
  43236. }
  43237. return new n.AnimationClip(e,-1,o)
  43238. },
  43239. findByName: function(e, t) {
  43240. for (var i = 0; i < e.length; i++)
  43241. if (e[i].name === t)
  43242. return e[i];
  43243. return null
  43244. },
  43245. CreateClipsFromMorphTargetSequences: function(e, t) {
  43246. for (var i = {}, r = /^([\w-]*?)([\d]+)$/, o = 0, a = e.length; o < a; o++) {
  43247. var s = e[o]
  43248. , l = s.name.match(r);
  43249. if (l && l.length > 1) {
  43250. var c = l[1]
  43251. , h = i[c];
  43252. h || (i[c] = h = []),
  43253. h.push(s)
  43254. }
  43255. }
  43256. var u = [];
  43257. for (var c in i)
  43258. u.push(n.AnimationClip.CreateFromMorphTargetSequence(c, i[c], t));
  43259. return u
  43260. },
  43261. parseAnimation: function(e, t, i) {
  43262. if (!e)
  43263. return console.error(" no animation in JSONLoader data"),
  43264. null;
  43265. for (var r = function(e, t, i, r, o) {
  43266. if (0 !== i.length) {
  43267. var a = []
  43268. , s = [];
  43269. n.AnimationUtils.flattenJSON(i, a, s, r),
  43270. 0 !== a.length && o.push(new e(t,a,s))
  43271. }
  43272. }, o = [], a = e.name || "default", s = e.length || -1, l = e.fps || 30, c = e.hierarchy || [], h = 0; h < c.length; h++) {
  43273. var u = c[h].keys;
  43274. if (u && 0 != u.length)
  43275. if (u[0].morphTargets) {
  43276. for (var d = {}, p = 0; p < u.length; p++)
  43277. if (u[p].morphTargets)
  43278. for (var f = 0; f < u[p].morphTargets.length; f++)
  43279. d[u[p].morphTargets[f]] = -1;
  43280. for (var g in d) {
  43281. for (var m = [], v = [], f = 0; f !== u[p].morphTargets.length; ++f) {
  43282. var A = u[p];
  43283. m.push(A.time),
  43284. v.push(A.morphTarget === g ? 1 : 0)
  43285. }
  43286. o.push(new n.NumberKeyframeTrack(".morphTargetInfluence[" + g + "]",m,v))
  43287. }
  43288. s = d.length * (l || 1)
  43289. } else {
  43290. var y = ".bones[" + t[h].name + "]";
  43291. r(n.VectorKeyframeTrack, y + ".position", u, "pos", o),
  43292. r(n.QuaternionKeyframeTrack, y + ".quaternion", u, "rot", o),
  43293. r(n.VectorKeyframeTrack, y + ".scale", u, "scl", o)
  43294. }
  43295. }
  43296. if (0 === o.length)
  43297. return null;
  43298. var C = new n.AnimationClip(a,s,o);
  43299. return C
  43300. }
  43301. }),
  43302. n.AnimationMixer = function(e) {
  43303. this._root = e,
  43304. this._initMemoryManager(),
  43305. this._accuIndex = 0,
  43306. this.time = 0,
  43307. this.timeScale = 1
  43308. }
  43309. ,
  43310. n.AnimationMixer.prototype = {
  43311. constructor: n.AnimationMixer,
  43312. clipAction: function(e, t) {
  43313. 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];
  43314. if (void 0 !== l) {
  43315. var c = l.actionByRoot[o];
  43316. if (void 0 !== c)
  43317. return c;
  43318. if (i = l.knownActions[0],
  43319. s = i._clip,
  43320. e !== a && e !== s)
  43321. throw new Error("Different clips with the same name detected!")
  43322. }
  43323. if (null === s)
  43324. return null;
  43325. var h = new n.AnimationMixer._Action(this,s,t);
  43326. return this._bindAction(h, i),
  43327. this._addInactiveAction(h, a, o),
  43328. h
  43329. },
  43330. existingAction: function(e, t) {
  43331. var i = t || this._root
  43332. , n = i.uuid
  43333. , r = "string" == typeof e ? e : e.name
  43334. , o = this._actionsByClip[r];
  43335. return void 0 !== o ? o.actionByRoot[n] || null : null
  43336. },
  43337. stopAllAction: function() {
  43338. var e = this._actions
  43339. , t = this._nActiveActions
  43340. , i = this._bindings
  43341. , n = this._nActiveBindings;
  43342. this._nActiveActions = 0,
  43343. this._nActiveBindings = 0;
  43344. for (var r = 0; r !== t; ++r)
  43345. e[r].reset();
  43346. for (var r = 0; r !== n; ++r)
  43347. i[r].useCount = 0;
  43348. return this
  43349. },
  43350. update: function(e) {
  43351. e *= this.timeScale;
  43352. 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) {
  43353. var s = t[a];
  43354. s.enabled && s._update(n, e, r, o)
  43355. }
  43356. for (var l = this._bindings, c = this._nActiveBindings, a = 0; a !== c; ++a)
  43357. l[a].apply(o);
  43358. return this
  43359. },
  43360. getRoot: function() {
  43361. return this._root
  43362. },
  43363. uncacheClip: function(e) {
  43364. var t = this._actions
  43365. , i = e.name
  43366. , n = this._actionsByClip
  43367. , r = n[i];
  43368. if (void 0 !== r) {
  43369. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  43370. var l = o[a];
  43371. this._deactivateAction(l);
  43372. var c = l._cacheIndex
  43373. , h = t[t.length - 1];
  43374. l._cacheIndex = null,
  43375. l._byClipCacheIndex = null,
  43376. h._cacheIndex = c,
  43377. t[c] = h,
  43378. t.pop(),
  43379. this._removeInactiveBindingsForAction(l)
  43380. }
  43381. delete n[i]
  43382. }
  43383. },
  43384. uncacheRoot: function(e) {
  43385. var t = e.uuid
  43386. , i = this._actionsByClip;
  43387. for (var n in i) {
  43388. var r = i[n].actionByRoot
  43389. , o = r[t];
  43390. void 0 !== o && (this._deactivateAction(o),
  43391. this._removeInactiveAction(o))
  43392. }
  43393. var a = this._bindingsByRootAndName
  43394. , s = a[t];
  43395. if (void 0 !== s)
  43396. for (var l in s) {
  43397. var c = s[l];
  43398. c.restoreOriginalState(),
  43399. this._removeInactiveBinding(c)
  43400. }
  43401. },
  43402. uncacheAction: function(e, t) {
  43403. var i = this.existingAction(e, t);
  43404. null !== i && (this._deactivateAction(i),
  43405. this._removeInactiveAction(i))
  43406. }
  43407. },
  43408. n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),
  43409. n.AnimationMixer._Action = function(e, t, i) {
  43410. this._mixer = e,
  43411. this._clip = t,
  43412. this._localRoot = i || null;
  43413. for (var r = t.tracks, o = r.length, a = new Array(o), s = {
  43414. endingStart: n.ZeroCurvatureEnding,
  43415. endingEnd: n.ZeroCurvatureEnding
  43416. }, l = 0; l !== o; ++l) {
  43417. var c = r[l].createInterpolant(null);
  43418. a[l] = c,
  43419. c.settings = s
  43420. }
  43421. this._interpolantSettings = s,
  43422. this._interpolants = a,
  43423. this._propertyBindings = new Array(o),
  43424. this._cacheIndex = null,
  43425. this._byClipCacheIndex = null,
  43426. this._timeScaleInterpolant = null,
  43427. this._weightInterpolant = null,
  43428. this.loop = n.LoopRepeat,
  43429. this._loopCount = -1,
  43430. this._startTime = null,
  43431. this.time = 0,
  43432. this.timeScale = 1,
  43433. this._effectiveTimeScale = 1,
  43434. this.weight = 1,
  43435. this._effectiveWeight = 1,
  43436. this.repetitions = 1 / 0,
  43437. this.paused = !1,
  43438. this.enabled = !0,
  43439. this.clampWhenFinished = !1,
  43440. this.zeroSlopeAtStart = !0,
  43441. this.zeroSlopeAtEnd = !0
  43442. }
  43443. ,
  43444. n.AnimationMixer._Action.prototype = {
  43445. constructor: n.AnimationMixer._Action,
  43446. play: function() {
  43447. return this._mixer._activateAction(this),
  43448. this
  43449. },
  43450. stop: function() {
  43451. return this._mixer._deactivateAction(this),
  43452. this.reset()
  43453. },
  43454. reset: function() {
  43455. return this.paused = !1,
  43456. this.enabled = !0,
  43457. this.time = 0,
  43458. this._loopCount = -1,
  43459. this._startTime = null,
  43460. this.stopFading().stopWarping()
  43461. },
  43462. isRunning: function() {
  43463. this._startTime;
  43464. return this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  43465. },
  43466. isScheduled: function() {
  43467. return this._mixer._isActiveAction(this)
  43468. },
  43469. startAt: function(e) {
  43470. return this._startTime = e,
  43471. this
  43472. },
  43473. setLoop: function(e, t) {
  43474. return this.loop = e,
  43475. this.repetitions = t,
  43476. this
  43477. },
  43478. setEffectiveWeight: function(e) {
  43479. return this.weight = e,
  43480. this._effectiveWeight = this.enabled ? e : 0,
  43481. this.stopFading()
  43482. },
  43483. getEffectiveWeight: function() {
  43484. return this._effectiveWeight
  43485. },
  43486. fadeIn: function(e) {
  43487. return this._scheduleFading(e, 0, 1)
  43488. },
  43489. fadeOut: function(e) {
  43490. return this._scheduleFading(e, 1, 0)
  43491. },
  43492. crossFadeFrom: function(e, t, i) {
  43493. this._mixer;
  43494. if (e.fadeOut(t),
  43495. this.fadeIn(t),
  43496. i) {
  43497. var n = this._clip.duration
  43498. , r = e._clip.duration
  43499. , o = r / n
  43500. , a = n / r;
  43501. e.warp(1, o, t),
  43502. this.warp(a, 1, t)
  43503. }
  43504. return this
  43505. },
  43506. crossFadeTo: function(e, t, i) {
  43507. return e.crossFadeFrom(this, t, i)
  43508. },
  43509. stopFading: function() {
  43510. var e = this._weightInterpolant;
  43511. return null !== e && (this._weightInterpolant = null,
  43512. this._mixer._takeBackControlInterpolant(e)),
  43513. this
  43514. },
  43515. setEffectiveTimeScale: function(e) {
  43516. return this.timeScale = e,
  43517. this._effectiveTimeScale = this.paused ? 0 : e,
  43518. this.stopWarping()
  43519. },
  43520. getEffectiveTimeScale: function() {
  43521. return this._effectiveTimeScale
  43522. },
  43523. setDuration: function(e) {
  43524. return this.timeScale = this._clip.duration / e,
  43525. this.stopWarping()
  43526. },
  43527. syncWith: function(e) {
  43528. return this.time = e.time,
  43529. this.timeScale = e.timeScale,
  43530. this.stopWarping()
  43531. },
  43532. halt: function(e) {
  43533. return this.warp(this._currentTimeScale, 0, e)
  43534. },
  43535. warp: function(e, t, i) {
  43536. var n = this._mixer
  43537. , r = n.time
  43538. , o = this._timeScaleInterpolant
  43539. , a = this.timeScale;
  43540. null === o && (o = n._lendControlInterpolant(),
  43541. this._timeScaleInterpolant = o);
  43542. var s = o.parameterPositions
  43543. , l = o.sampleValues;
  43544. return s[0] = r,
  43545. s[1] = r + i,
  43546. l[0] = e / a,
  43547. l[1] = t / a,
  43548. this
  43549. },
  43550. stopWarping: function() {
  43551. var e = this._timeScaleInterpolant;
  43552. return null !== e && (this._timeScaleInterpolant = null,
  43553. this._mixer._takeBackControlInterpolant(e)),
  43554. this
  43555. },
  43556. getMixer: function() {
  43557. return this._mixer
  43558. },
  43559. getClip: function() {
  43560. return this._clip
  43561. },
  43562. getRoot: function() {
  43563. return this._localRoot || this._mixer._root
  43564. },
  43565. _update: function(e, t, i, n) {
  43566. var r = this._startTime;
  43567. if (null !== r) {
  43568. var o = (e - r) * i;
  43569. if (o < 0 || 0 === i)
  43570. return;
  43571. this._startTime = null,
  43572. t = i * o
  43573. }
  43574. t *= this._updateTimeScale(e);
  43575. var a = this._updateTime(t)
  43576. , s = this._updateWeight(e);
  43577. if (s > 0)
  43578. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  43579. l[h].evaluate(a),
  43580. c[h].accumulate(n, s)
  43581. },
  43582. _updateWeight: function(e) {
  43583. var t = 0;
  43584. if (this.enabled) {
  43585. t = this.weight;
  43586. var i = this._weightInterpolant;
  43587. if (null !== i) {
  43588. var n = i.evaluate(e)[0];
  43589. t *= n,
  43590. e > i.parameterPositions[1] && (this.stopFading(),
  43591. 0 === n && (this.enabled = !1))
  43592. }
  43593. }
  43594. return this._effectiveWeight = t,
  43595. t
  43596. },
  43597. _updateTimeScale: function(e) {
  43598. var t = 0;
  43599. if (!this.paused) {
  43600. t = this.timeScale;
  43601. var i = this._timeScaleInterpolant;
  43602. if (null !== i) {
  43603. var n = i.evaluate(e)[0];
  43604. t *= n,
  43605. e > i.parameterPositions[1] && (this.stopWarping(),
  43606. 0 === t ? this.pause = !0 : this.timeScale = t)
  43607. }
  43608. }
  43609. return this._effectiveTimeScale = t,
  43610. t
  43611. },
  43612. _updateTime: function(e) {
  43613. var t = this.time + e;
  43614. if (0 === e)
  43615. return t;
  43616. var i = this._clip.duration
  43617. , r = this.loop
  43618. , o = this._loopCount
  43619. , a = !1;
  43620. switch (r) {
  43621. case n.LoopOnce:
  43622. if (o === -1 && (this.loopCount = 0,
  43623. this._setEndings(!0, !0, !1)),
  43624. t >= i)
  43625. t = i;
  43626. else {
  43627. if (!(t < 0))
  43628. break;
  43629. t = 0
  43630. }
  43631. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  43632. this._mixer.dispatchEvent({
  43633. type: "finished",
  43634. action: this,
  43635. direction: e < 0 ? -1 : 1
  43636. });
  43637. break;
  43638. case n.LoopPingPong:
  43639. a = !0;
  43640. case n.LoopRepeat:
  43641. if (o === -1 && (e > 0 ? (o = 0,
  43642. this._setEndings(!0, 0 === this.repetitions, a)) : this._setEndings(0 === this.repetitions, !0, a)),
  43643. t >= i || t < 0) {
  43644. var s = Math.floor(t / i);
  43645. t -= i * s,
  43646. o += Math.abs(s);
  43647. var l = this.repetitions - o;
  43648. if (l < 0) {
  43649. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  43650. t = e > 0 ? i : 0,
  43651. this._mixer.dispatchEvent({
  43652. type: "finished",
  43653. action: this,
  43654. direction: e > 0 ? 1 : -1
  43655. });
  43656. break
  43657. }
  43658. if (0 === l) {
  43659. var c = e < 0;
  43660. this._setEndings(c, !c, a)
  43661. } else
  43662. this._setEndings(!1, !1, a);
  43663. this._loopCount = o,
  43664. this._mixer.dispatchEvent({
  43665. type: "loop",
  43666. action: this,
  43667. loopDelta: s
  43668. })
  43669. }
  43670. if (r === n.LoopPingPong && 1 === (1 & o))
  43671. return this.time = t,
  43672. i - t
  43673. }
  43674. return this.time = t,
  43675. t
  43676. },
  43677. _setEndings: function(e, t, i) {
  43678. var r = this._interpolantSettings;
  43679. i ? (r.endingStart = n.ZeroSlopeEnding,
  43680. r.endingEnd = n.ZeroSlopeEnding) : (e ? r.endingStart = this.zeroSlopeAtStart ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingStart = n.WrapAroundEnding,
  43681. t ? r.endingEnd = this.zeroSlopeAtEnd ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingEnd = n.WrapAroundEnding)
  43682. },
  43683. _scheduleFading: function(e, t, i) {
  43684. var n = this._mixer
  43685. , r = n.time
  43686. , o = this._weightInterpolant;
  43687. null === o && (o = n._lendControlInterpolant(),
  43688. this._weightInterpolant = o);
  43689. var a = o.parameterPositions
  43690. , s = o.sampleValues;
  43691. return a[0] = r,
  43692. s[0] = t,
  43693. a[1] = r + e,
  43694. s[1] = i,
  43695. this
  43696. }
  43697. },
  43698. Object.assign(n.AnimationMixer.prototype, {
  43699. _bindAction: function(e, t) {
  43700. var i = e._localRoot || this._root
  43701. , r = e._clip.tracks
  43702. , o = r.length
  43703. , a = e._propertyBindings
  43704. , s = e._interpolants
  43705. , l = i.uuid
  43706. , c = this._bindingsByRootAndName
  43707. , h = c[l];
  43708. void 0 === h && (h = {},
  43709. c[l] = h);
  43710. for (var u = 0; u !== o; ++u) {
  43711. var d = r[u]
  43712. , p = d.name
  43713. , f = h[p];
  43714. if (void 0 !== f)
  43715. a[u] = f;
  43716. else {
  43717. if (f = a[u],
  43718. void 0 !== f) {
  43719. null === f._cacheIndex && (++f.referenceCount,
  43720. this._addInactiveBinding(f, l, p));
  43721. continue
  43722. }
  43723. var g = t && t._propertyBindings[u].binding.parsedPath;
  43724. f = new n.PropertyMixer(n.PropertyBinding.create(i, p, g),d.ValueTypeName,d.getValueSize()),
  43725. ++f.referenceCount,
  43726. this._addInactiveBinding(f, l, p),
  43727. a[u] = f
  43728. }
  43729. s[u].resultBuffer = f.buffer
  43730. }
  43731. },
  43732. _activateAction: function(e) {
  43733. if (!this._isActiveAction(e)) {
  43734. if (null === e._cacheIndex) {
  43735. var t = (e._localRoot || this._root).uuid
  43736. , i = e._clip.name
  43737. , n = this._actionsByClip[i];
  43738. this._bindAction(e, n && n.knownActions[0]),
  43739. this._addInactiveAction(e, i, t)
  43740. }
  43741. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  43742. var s = r[o];
  43743. 0 === s.useCount++ && (this._lendBinding(s),
  43744. s.saveOriginalState())
  43745. }
  43746. this._lendAction(e)
  43747. }
  43748. },
  43749. _deactivateAction: function(e) {
  43750. if (this._isActiveAction(e)) {
  43751. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43752. var r = t[i];
  43753. 0 === --r.useCount && (r.restoreOriginalState(),
  43754. this._takeBackBinding(r))
  43755. }
  43756. this._takeBackAction(e)
  43757. }
  43758. },
  43759. _initMemoryManager: function() {
  43760. this._actions = [],
  43761. this._nActiveActions = 0,
  43762. this._actionsByClip = {},
  43763. this._bindings = [],
  43764. this._nActiveBindings = 0,
  43765. this._bindingsByRootAndName = {},
  43766. this._controlInterpolants = [],
  43767. this._nActiveControlInterpolants = 0;
  43768. var e = this;
  43769. this.stats = {
  43770. actions: {
  43771. get total() {
  43772. return e._actions.length
  43773. },
  43774. get inUse() {
  43775. return e._nActiveActions
  43776. }
  43777. },
  43778. bindings: {
  43779. get total() {
  43780. return e._bindings.length
  43781. },
  43782. get inUse() {
  43783. return e._nActiveBindings
  43784. }
  43785. },
  43786. controlInterpolants: {
  43787. get total() {
  43788. return e._controlInterpolants.length
  43789. },
  43790. get inUse() {
  43791. return e._nActiveControlInterpolants
  43792. }
  43793. }
  43794. }
  43795. },
  43796. _isActiveAction: function(e) {
  43797. var t = e._cacheIndex;
  43798. return null !== t && t < this._nActiveActions
  43799. },
  43800. _addInactiveAction: function(e, t, i) {
  43801. var n = this._actions
  43802. , r = this._actionsByClip
  43803. , o = r[t];
  43804. if (void 0 === o)
  43805. o = {
  43806. knownActions: [e],
  43807. actionByRoot: {}
  43808. },
  43809. e._byClipCacheIndex = 0,
  43810. r[t] = o;
  43811. else {
  43812. var a = o.knownActions;
  43813. e._byClipCacheIndex = a.length,
  43814. a.push(e)
  43815. }
  43816. e._cacheIndex = n.length,
  43817. n.push(e),
  43818. o.actionByRoot[i] = e
  43819. },
  43820. _removeInactiveAction: function(e) {
  43821. var t = this._actions
  43822. , i = t[t.length - 1]
  43823. , n = e._cacheIndex;
  43824. i._cacheIndex = n,
  43825. t[n] = i,
  43826. t.pop(),
  43827. e._cacheIndex = null;
  43828. var r = e._clip.name
  43829. , o = this._actionsByClip
  43830. , a = o[r]
  43831. , s = a.knownActions
  43832. , l = s[s.length - 1]
  43833. , c = e._byClipCacheIndex;
  43834. l._byClipCacheIndex = c,
  43835. s[c] = l,
  43836. s.pop(),
  43837. e._byClipCacheIndex = null;
  43838. var h = a.actionByRoot
  43839. , u = (t._localRoot || this._root).uuid;
  43840. delete h[u],
  43841. 0 === s.length && delete o[r],
  43842. this._removeInactiveBindingsForAction(e)
  43843. },
  43844. _removeInactiveBindingsForAction: function(e) {
  43845. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43846. var r = t[i];
  43847. 0 === --r.referenceCount && this._removeInactiveBinding(r)
  43848. }
  43849. },
  43850. _lendAction: function(e) {
  43851. var t = this._actions
  43852. , i = e._cacheIndex
  43853. , n = this._nActiveActions++
  43854. , r = t[n];
  43855. e._cacheIndex = n,
  43856. t[n] = e,
  43857. r._cacheIndex = i,
  43858. t[i] = r
  43859. },
  43860. _takeBackAction: function(e) {
  43861. var t = this._actions
  43862. , i = e._cacheIndex
  43863. , n = --this._nActiveActions
  43864. , r = t[n];
  43865. e._cacheIndex = n,
  43866. t[n] = e,
  43867. r._cacheIndex = i,
  43868. t[i] = r
  43869. },
  43870. _addInactiveBinding: function(e, t, i) {
  43871. var n = this._bindingsByRootAndName
  43872. , r = n[t]
  43873. , o = this._bindings;
  43874. void 0 === r && (r = {},
  43875. n[t] = r),
  43876. r[i] = e,
  43877. e._cacheIndex = o.length,
  43878. o.push(e)
  43879. },
  43880. _removeInactiveBinding: function(e) {
  43881. var t = this._bindings
  43882. , i = e.binding
  43883. , n = i.rootNode.uuid
  43884. , r = i.path
  43885. , o = this._bindingsByRootAndName
  43886. , a = o[n]
  43887. , s = t[t.length - 1]
  43888. , l = e._cacheIndex;
  43889. s._cacheIndex = l,
  43890. t[l] = s,
  43891. t.pop(),
  43892. delete a[r];
  43893. e: {
  43894. for (var c in a)
  43895. break e;
  43896. delete o[n]
  43897. }
  43898. },
  43899. _lendBinding: function(e) {
  43900. var t = this._bindings
  43901. , i = e._cacheIndex
  43902. , n = this._nActiveBindings++
  43903. , r = t[n];
  43904. e._cacheIndex = n,
  43905. t[n] = e,
  43906. r._cacheIndex = i,
  43907. t[i] = r
  43908. },
  43909. _takeBackBinding: function(e) {
  43910. var t = this._bindings
  43911. , i = e._cacheIndex
  43912. , n = --this._nActiveBindings
  43913. , r = t[n];
  43914. e._cacheIndex = n,
  43915. t[n] = e,
  43916. r._cacheIndex = i,
  43917. t[i] = r
  43918. },
  43919. _lendControlInterpolant: function() {
  43920. var e = this._controlInterpolants
  43921. , t = this._nActiveControlInterpolants++
  43922. , i = e[t];
  43923. return void 0 === i && (i = new n.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),
  43924. i.__cacheIndex = t,
  43925. e[t] = i),
  43926. i
  43927. },
  43928. _takeBackControlInterpolant: function(e) {
  43929. var t = this._controlInterpolants
  43930. , i = e.__cacheIndex
  43931. , n = --this._nActiveControlInterpolants
  43932. , r = t[n];
  43933. e.__cacheIndex = n,
  43934. t[n] = e,
  43935. r.__cacheIndex = i,
  43936. t[i] = r
  43937. },
  43938. _controlInterpolantsResultBuffer: new Float32Array(1)
  43939. }),
  43940. n.AnimationObjectGroup = function(e) {
  43941. this.uuid = n.Math.generateUUID(),
  43942. this._objects = Array.prototype.slice.call(arguments),
  43943. this.nCachedObjects_ = 0;
  43944. var t = {};
  43945. this._indicesByUUID = t;
  43946. for (var i = 0, r = arguments.length; i !== r; ++i)
  43947. t[arguments[i].uuid] = i;
  43948. this._paths = [],
  43949. this._parsedPaths = [],
  43950. this._bindings = [],
  43951. this._bindingsIndicesByPath = {};
  43952. var o = this;
  43953. this.stats = {
  43954. objects: {
  43955. get total() {
  43956. return o._objects.length
  43957. },
  43958. get inUse() {
  43959. return this.total - o.nCachedObjects_
  43960. }
  43961. },
  43962. get bindingsPerObject() {
  43963. return o._bindings.length
  43964. }
  43965. }
  43966. }
  43967. ,
  43968. n.AnimationObjectGroup.prototype = {
  43969. constructor: n.AnimationObjectGroup,
  43970. add: function(e) {
  43971. 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) {
  43972. var d = arguments[h]
  43973. , p = d.uuid
  43974. , f = o[p];
  43975. if (void 0 === f) {
  43976. f = i++,
  43977. o[p] = f,
  43978. t.push(d);
  43979. for (var g = 0, m = c; g !== m; ++g)
  43980. l[g].push(new n.PropertyBinding(d,a[g],s[g]))
  43981. } else if (f < r) {
  43982. var v = t[f]
  43983. , A = --r
  43984. , y = t[A];
  43985. o[y.uuid] = f,
  43986. t[f] = y,
  43987. o[p] = A,
  43988. t[A] = d;
  43989. for (var g = 0, m = c; g !== m; ++g) {
  43990. var C = l[g]
  43991. , I = C[A]
  43992. , E = C[f];
  43993. C[f] = I,
  43994. void 0 === E && (E = new n.PropertyBinding(d,a[g],s[g])),
  43995. C[A] = E
  43996. }
  43997. } else
  43998. t[f] !== v && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  43999. }
  44000. this.nCachedObjects_ = r
  44001. },
  44002. remove: function(e) {
  44003. for (var t = this._objects, i = (t.length,
  44004. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  44005. var l = arguments[a]
  44006. , c = l.uuid
  44007. , h = n[c];
  44008. if (void 0 !== h && h >= i) {
  44009. var u = i++
  44010. , d = t[u];
  44011. n[d.uuid] = h,
  44012. t[h] = d,
  44013. n[c] = u,
  44014. t[u] = l;
  44015. for (var p = 0, f = o; p !== f; ++p) {
  44016. var g = r[p]
  44017. , m = g[u]
  44018. , v = g[h];
  44019. g[h] = m,
  44020. g[u] = v
  44021. }
  44022. }
  44023. }
  44024. this.nCachedObjects_ = i
  44025. },
  44026. uncache: function(e) {
  44027. 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) {
  44028. var c = arguments[s]
  44029. , h = c.uuid
  44030. , u = r[h];
  44031. if (void 0 !== u)
  44032. if (delete r[h],
  44033. u < n) {
  44034. var d = --n
  44035. , p = t[d]
  44036. , f = --i
  44037. , g = t[f];
  44038. r[p.uuid] = u,
  44039. t[u] = p,
  44040. r[g.uuid] = d,
  44041. t[d] = g,
  44042. t.pop();
  44043. for (var m = 0, v = a; m !== v; ++m) {
  44044. var A = o[m]
  44045. , y = A[d]
  44046. , C = A[f];
  44047. A[u] = y,
  44048. A[d] = C,
  44049. A.pop()
  44050. }
  44051. } else {
  44052. var f = --i
  44053. , g = t[f];
  44054. r[g.uuid] = u,
  44055. t[u] = g,
  44056. t.pop();
  44057. for (var m = 0, v = a; m !== v; ++m) {
  44058. var A = o[m];
  44059. A[u] = A[f],
  44060. A.pop()
  44061. }
  44062. }
  44063. }
  44064. this.nCachedObjects_ = n
  44065. },
  44066. subscribe_: function(e, t) {
  44067. var i = this._bindingsIndicesByPath
  44068. , r = i[e]
  44069. , o = this._bindings;
  44070. if (void 0 !== r)
  44071. return o[r];
  44072. var a = this._paths
  44073. , s = this._parsedPaths
  44074. , l = this._objects
  44075. , c = l.length
  44076. , h = this.nCachedObjects_
  44077. , u = new Array(c);
  44078. r = o.length,
  44079. i[e] = r,
  44080. a.push(e),
  44081. s.push(t),
  44082. o.push(u);
  44083. for (var d = h, p = l.length; d !== p; ++d) {
  44084. var f = l[d];
  44085. u[d] = new n.PropertyBinding(f,e,t)
  44086. }
  44087. return u
  44088. },
  44089. unsubscribe_: function(e) {
  44090. var t = this._bindingsIndicesByPath
  44091. , i = t[e];
  44092. if (void 0 !== i) {
  44093. var n = this._paths
  44094. , r = this._parsedPaths
  44095. , o = this._bindings
  44096. , a = o.length - 1
  44097. , s = o[a]
  44098. , l = e[a];
  44099. t[l] = i,
  44100. o[i] = s,
  44101. o.pop(),
  44102. r[i] = r[a],
  44103. r.pop(),
  44104. n[i] = n[a],
  44105. n.pop()
  44106. }
  44107. }
  44108. },
  44109. n.AnimationUtils = {
  44110. arraySlice: function(e, t, i) {
  44111. return n.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  44112. },
  44113. convertArray: function(e, t, i) {
  44114. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  44115. },
  44116. isTypedArray: function(e) {
  44117. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  44118. },
  44119. getKeyframeOrder: function(e) {
  44120. function t(t, i) {
  44121. return e[t] - e[i]
  44122. }
  44123. for (var i = e.length, n = new Array(i), r = 0; r !== i; ++r)
  44124. n[r] = r;
  44125. return n.sort(t),
  44126. n
  44127. },
  44128. sortedArray: function(e, t, i) {
  44129. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  44130. for (var s = i[o] * t, l = 0; l !== t; ++l)
  44131. r[a++] = e[s + l];
  44132. return r
  44133. },
  44134. flattenJSON: function(e, t, i, n) {
  44135. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  44136. o = e[r++];
  44137. if (void 0 !== o) {
  44138. var a = o[n];
  44139. if (void 0 !== a)
  44140. if (Array.isArray(a)) {
  44141. do
  44142. a = o[n],
  44143. void 0 !== a && (t.push(o.time),
  44144. i.push.apply(i, a)),
  44145. o = e[r++];
  44146. while (void 0 !== o)
  44147. } else if (void 0 !== a.toArray) {
  44148. do
  44149. a = o[n],
  44150. void 0 !== a && (t.push(o.time),
  44151. a.toArray(i, i.length)),
  44152. o = e[r++];
  44153. while (void 0 !== o)
  44154. } else
  44155. do
  44156. a = o[n],
  44157. void 0 !== a && (t.push(o.time),
  44158. i.push(a)),
  44159. o = e[r++];
  44160. while (void 0 !== o)
  44161. }
  44162. }
  44163. },
  44164. n.KeyframeTrack = function(e, t, i, r) {
  44165. if (void 0 === e)
  44166. throw new Error("track name is undefined");
  44167. if (void 0 === t || 0 === t.length)
  44168. throw new Error("no keyframes in track named " + e);
  44169. this.name = e,
  44170. this.times = n.AnimationUtils.convertArray(t, this.TimeBufferType),
  44171. this.values = n.AnimationUtils.convertArray(i, this.ValueBufferType),
  44172. this.setInterpolation(r || this.DefaultInterpolation),
  44173. this.validate(),
  44174. this.optimize()
  44175. }
  44176. ,
  44177. n.KeyframeTrack.prototype = {
  44178. constructor: n.KeyframeTrack,
  44179. TimeBufferType: Float32Array,
  44180. ValueBufferType: Float32Array,
  44181. DefaultInterpolation: n.InterpolateLinear,
  44182. InterpolantFactoryMethodDiscrete: function(e) {
  44183. return new n.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  44184. },
  44185. InterpolantFactoryMethodLinear: function(e) {
  44186. return new n.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44187. },
  44188. InterpolantFactoryMethodSmooth: function(e) {
  44189. return new n.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  44190. },
  44191. setInterpolation: function(e) {
  44192. var t = void 0;
  44193. switch (e) {
  44194. case n.InterpolateDiscrete:
  44195. t = this.InterpolantFactoryMethodDiscrete;
  44196. break;
  44197. case n.InterpolateLinear:
  44198. t = this.InterpolantFactoryMethodLinear;
  44199. break;
  44200. case n.InterpolateSmooth:
  44201. t = this.InterpolantFactoryMethodSmooth
  44202. }
  44203. if (void 0 === t) {
  44204. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  44205. if (void 0 === this.createInterpolant) {
  44206. if (e === this.DefaultInterpolation)
  44207. throw new Error(i);
  44208. this.setInterpolation(this.DefaultInterpolation)
  44209. }
  44210. return void console.warn(i)
  44211. }
  44212. this.createInterpolant = t
  44213. },
  44214. getInterpolation: function() {
  44215. switch (this.createInterpolant) {
  44216. case this.InterpolantFactoryMethodDiscrete:
  44217. return n.InterpolateDiscrete;
  44218. case this.InterpolantFactoryMethodLinear:
  44219. return n.InterpolateLinear;
  44220. case this.InterpolantFactoryMethodSmooth:
  44221. return n.InterpolateSmooth
  44222. }
  44223. },
  44224. getValueSize: function() {
  44225. return this.values.length / this.times.length
  44226. },
  44227. shift: function(e) {
  44228. if (0 !== e)
  44229. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  44230. t[i] += e;
  44231. return this
  44232. },
  44233. scale: function(e) {
  44234. if (1 !== e)
  44235. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  44236. t[i] *= e;
  44237. return this
  44238. },
  44239. trim: function(e, t) {
  44240. for (var i = this.times, r = i.length, o = 0, a = r - 1; o !== r && i[o] < e; )
  44241. ++o;
  44242. for (; a !== -1 && i[a] > t; )
  44243. --a;
  44244. if (++a,
  44245. 0 !== o || a !== r) {
  44246. o >= a && (a = Math.max(a, 1),
  44247. o = a - 1);
  44248. var s = this.getValueSize();
  44249. this.times = n.AnimationUtils.arraySlice(i, o, a),
  44250. this.values = n.AnimationUtils.arraySlice(this.values, o * s, a * s)
  44251. }
  44252. return this
  44253. },
  44254. validate: function() {
  44255. var e = !0
  44256. , t = this.getValueSize();
  44257. t - Math.floor(t) !== 0 && (console.error("invalid value size in track", this),
  44258. e = !1);
  44259. var i = this.times
  44260. , r = this.values
  44261. , o = i.length;
  44262. 0 === o && (console.error("track is empty", this),
  44263. e = !1);
  44264. for (var a = null, s = 0; s !== o; s++) {
  44265. var l = i[s];
  44266. if ("number" == typeof l && isNaN(l)) {
  44267. console.error("time is not a valid number", this, s, l),
  44268. e = !1;
  44269. break
  44270. }
  44271. if (null !== a && a > l) {
  44272. console.error("out of order keys", this, s, l, a),
  44273. e = !1;
  44274. break
  44275. }
  44276. a = l
  44277. }
  44278. if (void 0 !== r && n.AnimationUtils.isTypedArray(r))
  44279. for (var s = 0, c = r.length; s !== c; ++s) {
  44280. var h = r[s];
  44281. if (isNaN(h)) {
  44282. console.error("value is not a valid number", this, s, h),
  44283. e = !1;
  44284. break
  44285. }
  44286. }
  44287. return e
  44288. },
  44289. optimize: function() {
  44290. for (var e = this.times, t = this.values, i = this.getValueSize(), r = 1, o = 1, a = e.length - 1; o <= a; ++o) {
  44291. var s = !1
  44292. , l = e[o]
  44293. , c = e[o + 1];
  44294. if (l !== c && (1 !== o || l !== l[0]))
  44295. for (var h = o * i, u = h - i, d = h + i, p = 0; p !== i; ++p) {
  44296. var f = t[h + p];
  44297. if (f !== t[u + p] || f !== t[d + p]) {
  44298. s = !0;
  44299. break
  44300. }
  44301. }
  44302. if (s) {
  44303. if (o !== r) {
  44304. e[r] = e[o];
  44305. for (var g = o * i, m = r * i, p = 0; p !== i; ++p)
  44306. t[m + p] = t[g + p]
  44307. }
  44308. ++r
  44309. }
  44310. }
  44311. return r !== e.length && (this.times = n.AnimationUtils.arraySlice(e, 0, r),
  44312. this.values = n.AnimationUtils.arraySlice(t, 0, r * i)),
  44313. this
  44314. }
  44315. },
  44316. Object.assign(n.KeyframeTrack, {
  44317. parse: function(e) {
  44318. if (void 0 === e.type)
  44319. throw new Error("track type undefined, can not parse");
  44320. var t = n.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  44321. if (void 0 === e.times) {
  44322. console.warn("legacy JSON format detected, converting");
  44323. var i = []
  44324. , r = [];
  44325. n.AnimationUtils.flattenJSON(e.keys, i, r, "value"),
  44326. e.times = i,
  44327. e.values = r
  44328. }
  44329. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  44330. },
  44331. toJSON: function(e) {
  44332. var t, i = e.constructor;
  44333. if (void 0 !== i.toJSON)
  44334. t = i.toJSON(e);
  44335. else {
  44336. t = {
  44337. name: e.name,
  44338. times: n.AnimationUtils.convertArray(e.times, Array),
  44339. values: n.AnimationUtils.convertArray(e.values, Array)
  44340. };
  44341. var r = e.getInterpolation();
  44342. r !== e.DefaultInterpolation && (t.interpolation = r)
  44343. }
  44344. return t.type = e.ValueTypeName,
  44345. t
  44346. },
  44347. _getTrackTypeForValueTypeName: function(e) {
  44348. switch (e.toLowerCase()) {
  44349. case "scalar":
  44350. case "double":
  44351. case "float":
  44352. case "number":
  44353. case "integer":
  44354. return n.NumberKeyframeTrack;
  44355. case "vector":
  44356. case "vector2":
  44357. case "vector3":
  44358. case "vector4":
  44359. return n.VectorKeyframeTrack;
  44360. case "color":
  44361. return n.ColorKeyframeTrack;
  44362. case "quaternion":
  44363. return n.QuaternionKeyframeTrack;
  44364. case "bool":
  44365. case "boolean":
  44366. return n.BooleanKeyframeTrack;
  44367. case "string":
  44368. return n.StringKeyframeTrack
  44369. }
  44370. throw new Error("Unsupported typeName: " + e)
  44371. }
  44372. }),
  44373. n.PropertyBinding = function(e, t, i) {
  44374. this.path = t,
  44375. this.parsedPath = i || n.PropertyBinding.parseTrackName(t),
  44376. this.node = n.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  44377. this.rootNode = e
  44378. }
  44379. ,
  44380. n.PropertyBinding.prototype = {
  44381. constructor: n.PropertyBinding,
  44382. getValue: function(e, t) {
  44383. this.bind(),
  44384. this.getValue(e, t)
  44385. },
  44386. setValue: function(e, t) {
  44387. this.bind(),
  44388. this.setValue(e, t)
  44389. },
  44390. bind: function() {
  44391. var e = this.node
  44392. , t = this.parsedPath
  44393. , i = t.objectName
  44394. , r = t.propertyName
  44395. , o = t.propertyIndex;
  44396. if (e || (e = n.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  44397. this.node = e),
  44398. this.getValue = this._getValue_unavailable,
  44399. this.setValue = this._setValue_unavailable,
  44400. !e)
  44401. return void console.error(" trying to update node for track: " + this.path + " but it wasn't found.");
  44402. if (i) {
  44403. var a = t.objectIndex;
  44404. switch (i) {
  44405. case "materials":
  44406. if (!e.material)
  44407. return void console.error(" can not bind to material as node does not have a material", this);
  44408. if (!e.material.materials)
  44409. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  44410. e = e.material.materials;
  44411. break;
  44412. case "bones":
  44413. if (!e.skeleton)
  44414. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  44415. e = e.skeleton.bones;
  44416. for (var s = 0; s < e.length; s++)
  44417. if (e[s].name === a) {
  44418. a = s;
  44419. break
  44420. }
  44421. break;
  44422. default:
  44423. if (void 0 === e[i])
  44424. return void console.error(" can not bind to objectName of node, undefined", this);
  44425. e = e[i]
  44426. }
  44427. if (void 0 !== a) {
  44428. if (void 0 === e[a])
  44429. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  44430. e = e[a]
  44431. }
  44432. }
  44433. var l = e[r];
  44434. if (!l) {
  44435. var c = t.nodeName;
  44436. return void console.error(" trying to update property for track: " + c + "." + r + " but it wasn't found.", e)
  44437. }
  44438. var h = this.Versioning.None;
  44439. void 0 !== e.needsUpdate ? (h = this.Versioning.NeedsUpdate,
  44440. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (h = this.Versioning.MatrixWorldNeedsUpdate,
  44441. this.targetObject = e);
  44442. var u = this.BindingType.Direct;
  44443. if (void 0 !== o) {
  44444. if ("morphTargetInfluences" === r) {
  44445. if (!e.geometry)
  44446. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  44447. if (!e.geometry.morphTargets)
  44448. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  44449. for (var s = 0; s < this.node.geometry.morphTargets.length; s++)
  44450. if (e.geometry.morphTargets[s].name === o) {
  44451. o = s;
  44452. break
  44453. }
  44454. }
  44455. u = this.BindingType.ArrayElement,
  44456. this.resolvedProperty = l,
  44457. this.propertyIndex = o
  44458. } else
  44459. void 0 !== l.fromArray && void 0 !== l.toArray ? (u = this.BindingType.HasFromToArray,
  44460. this.resolvedProperty = l) : void 0 !== l.length ? (u = this.BindingType.EntireArray,
  44461. this.resolvedProperty = l) : this.propertyName = r;
  44462. this.getValue = this.GetterByBindingType[u],
  44463. this.setValue = this.SetterByBindingTypeAndVersioning[u][h]
  44464. },
  44465. unbind: function() {
  44466. this.node = null,
  44467. this.getValue = this._getValue_unbound,
  44468. this.setValue = this._setValue_unbound
  44469. }
  44470. },
  44471. Object.assign(n.PropertyBinding.prototype, {
  44472. _getValue_unavailable: function() {},
  44473. _setValue_unavailable: function() {},
  44474. _getValue_unbound: n.PropertyBinding.prototype.getValue,
  44475. _setValue_unbound: n.PropertyBinding.prototype.setValue,
  44476. BindingType: {
  44477. Direct: 0,
  44478. EntireArray: 1,
  44479. ArrayElement: 2,
  44480. HasFromToArray: 3
  44481. },
  44482. Versioning: {
  44483. None: 0,
  44484. NeedsUpdate: 1,
  44485. MatrixWorldNeedsUpdate: 2
  44486. },
  44487. GetterByBindingType: [function(e, t) {
  44488. e[t] = this.node[this.propertyName]
  44489. }
  44490. , function(e, t) {
  44491. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44492. e[t++] = i[n]
  44493. }
  44494. , function(e, t) {
  44495. e[t] = this.resolvedProperty[this.propertyIndex]
  44496. }
  44497. , function(e, t) {
  44498. this.resolvedProperty.toArray(e, t)
  44499. }
  44500. ],
  44501. SetterByBindingTypeAndVersioning: [[function(e, t) {
  44502. this.node[this.propertyName] = e[t]
  44503. }
  44504. , function(e, t) {
  44505. this.node[this.propertyName] = e[t],
  44506. this.targetObject.needsUpdate = !0
  44507. }
  44508. , function(e, t) {
  44509. this.node[this.propertyName] = e[t],
  44510. this.targetObject.matrixWorldNeedsUpdate = !0
  44511. }
  44512. ], [function(e, t) {
  44513. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44514. i[n] = e[t++]
  44515. }
  44516. , function(e, t) {
  44517. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44518. i[n] = e[t++];
  44519. this.targetObject.needsUpdate = !0
  44520. }
  44521. , function(e, t) {
  44522. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44523. i[n] = e[t++];
  44524. this.targetObject.matrixWorldNeedsUpdate = !0
  44525. }
  44526. ], [function(e, t) {
  44527. this.resolvedProperty[this.propertyIndex] = e[t]
  44528. }
  44529. , function(e, t) {
  44530. this.resolvedProperty[this.propertyIndex] = e[t],
  44531. this.targetObject.needsUpdate = !0
  44532. }
  44533. , function(e, t) {
  44534. this.resolvedProperty[this.propertyIndex] = e[t],
  44535. this.targetObject.matrixWorldNeedsUpdate = !0
  44536. }
  44537. ], [function(e, t) {
  44538. this.resolvedProperty.fromArray(e, t)
  44539. }
  44540. , function(e, t) {
  44541. this.resolvedProperty.fromArray(e, t),
  44542. this.targetObject.needsUpdate = !0
  44543. }
  44544. , function(e, t) {
  44545. this.resolvedProperty.fromArray(e, t),
  44546. this.targetObject.matrixWorldNeedsUpdate = !0
  44547. }
  44548. ]]
  44549. }),
  44550. n.PropertyBinding.Composite = function(e, t, i) {
  44551. var r = i || n.PropertyBinding.parseTrackName(t);
  44552. this._targetGroup = e,
  44553. this._bindings = e.subscribe_(t, r)
  44554. }
  44555. ,
  44556. n.PropertyBinding.Composite.prototype = {
  44557. constructor: n.PropertyBinding.Composite,
  44558. getValue: function(e, t) {
  44559. this.bind();
  44560. var i = this._targetGroup.nCachedObjects_
  44561. , n = this._bindings[i];
  44562. void 0 !== n && n.getValue(e, t)
  44563. },
  44564. setValue: function(e, t) {
  44565. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  44566. i[n].setValue(e, t)
  44567. },
  44568. bind: function() {
  44569. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44570. e[t].bind()
  44571. },
  44572. unbind: function() {
  44573. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44574. e[t].unbind()
  44575. }
  44576. },
  44577. n.PropertyBinding.create = function(e, t, i) {
  44578. return e instanceof n.AnimationObjectGroup ? new n.PropertyBinding.Composite(e,t,i) : new n.PropertyBinding(e,t,i)
  44579. }
  44580. ,
  44581. n.PropertyBinding.parseTrackName = function(e) {
  44582. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  44583. , i = t.exec(e);
  44584. if (!i)
  44585. throw new Error("cannot parse trackName at all: " + e);
  44586. i.index === t.lastIndex && t.lastIndex++;
  44587. var n = {
  44588. nodeName: i[3],
  44589. objectName: i[5],
  44590. objectIndex: i[7],
  44591. propertyName: i[9],
  44592. propertyIndex: i[11]
  44593. };
  44594. if (null === n.propertyName || 0 === n.propertyName.length)
  44595. throw new Error("can not parse propertyName from trackName: " + e);
  44596. return n
  44597. }
  44598. ,
  44599. n.PropertyBinding.findNode = function(e, t) {
  44600. if (!t || "" === t || "root" === t || "." === t || t === -1 || t === e.name || t === e.uuid)
  44601. return e;
  44602. if (e.skeleton) {
  44603. var i = function(e) {
  44604. for (var i = 0; i < e.bones.length; i++) {
  44605. var n = e.bones[i];
  44606. if (n.name === t)
  44607. return n
  44608. }
  44609. return null
  44610. }
  44611. , n = i(e.skeleton);
  44612. if (n)
  44613. return n
  44614. }
  44615. if (e.children) {
  44616. var r = function(e) {
  44617. for (var i = 0; i < e.length; i++) {
  44618. var n = e[i];
  44619. if (n.name === t || n.uuid === t)
  44620. return n;
  44621. var o = r(n.children);
  44622. if (o)
  44623. return o
  44624. }
  44625. return null
  44626. }
  44627. , o = r(e.children);
  44628. if (o)
  44629. return o
  44630. }
  44631. return null
  44632. }
  44633. ,
  44634. n.PropertyMixer = function(e, t, i) {
  44635. this.binding = e,
  44636. this.valueSize = i;
  44637. var n, r = Float64Array;
  44638. switch (t) {
  44639. case "quaternion":
  44640. n = this._slerp;
  44641. break;
  44642. case "string":
  44643. case "bool":
  44644. r = Array,
  44645. n = this._select;
  44646. break;
  44647. default:
  44648. n = this._lerp
  44649. }
  44650. this.buffer = new r(4 * i),
  44651. this._mixBufferRegion = n,
  44652. this.cumulativeWeight = 0,
  44653. this.useCount = 0,
  44654. this.referenceCount = 0
  44655. }
  44656. ,
  44657. n.PropertyMixer.prototype = {
  44658. constructor: n.PropertyMixer,
  44659. accumulate: function(e, t) {
  44660. var i = this.buffer
  44661. , n = this.valueSize
  44662. , r = e * n + n
  44663. , o = this.cumulativeWeight;
  44664. if (0 === o) {
  44665. for (var a = 0; a !== n; ++a)
  44666. i[r + a] = i[a];
  44667. o = t
  44668. } else {
  44669. o += t;
  44670. var s = t / o;
  44671. this._mixBufferRegion(i, r, 0, s, n)
  44672. }
  44673. this.cumulativeWeight = o
  44674. },
  44675. apply: function(e) {
  44676. var t = this.valueSize
  44677. , i = this.buffer
  44678. , n = e * t + t
  44679. , r = this.cumulativeWeight
  44680. , o = this.binding;
  44681. if (this.cumulativeWeight = 0,
  44682. r < 1) {
  44683. var a = 3 * t;
  44684. this._mixBufferRegion(i, n, a, 1 - r, t)
  44685. }
  44686. for (var s = t, l = t + t; s !== l; ++s)
  44687. if (i[s] !== i[s + t]) {
  44688. o.setValue(i, n);
  44689. break
  44690. }
  44691. },
  44692. saveOriginalState: function() {
  44693. var e = this.binding
  44694. , t = this.buffer
  44695. , i = this.valueSize
  44696. , n = 3 * i;
  44697. e.getValue(t, n);
  44698. for (var r = i, o = n; r !== o; ++r)
  44699. t[r] = t[n + r % i];
  44700. this.cumulativeWeight = 0
  44701. },
  44702. restoreOriginalState: function() {
  44703. var e = 3 * this.valueSize;
  44704. this.binding.setValue(this.buffer, e)
  44705. },
  44706. _select: function(e, t, i, n, r) {
  44707. if (n >= .5)
  44708. for (var o = 0; o !== r; ++o)
  44709. e[t + o] = e[i + o]
  44710. },
  44711. _slerp: function(e, t, i, r, o) {
  44712. n.Quaternion.slerpFlat(e, t, e, t, e, i, r)
  44713. },
  44714. _lerp: function(e, t, i, n, r) {
  44715. for (var o = 1 - n, a = 0; a !== r; ++a) {
  44716. var s = t + a;
  44717. e[s] = e[s] * o + e[i + a] * n
  44718. }
  44719. }
  44720. },
  44721. n.BooleanKeyframeTrack = function(e, t, i) {
  44722. n.KeyframeTrack.call(this, e, t, i)
  44723. }
  44724. ,
  44725. n.BooleanKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  44726. constructor: n.BooleanKeyframeTrack,
  44727. ValueTypeName: "bool",
  44728. ValueBufferType: Array,
  44729. DefaultInterpolation: n.IntepolateDiscrete,
  44730. InterpolantFactoryMethodLinear: void 0,
  44731. InterpolantFactoryMethodSmooth: void 0
  44732. }),
  44733. n.NumberKeyframeTrack = function(e, t, i, r) {
  44734. n.KeyframeTrack.call(this, e, t, i, r)
  44735. }
  44736. ,
  44737. n.NumberKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  44738. constructor: n.NumberKeyframeTrack,
  44739. ValueTypeName: "number"
  44740. }),
  44741. n.QuaternionKeyframeTrack = function(e, t, i, r) {
  44742. n.KeyframeTrack.call(this, e, t, i, r)
  44743. }
  44744. ,
  44745. n.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  44746. constructor: n.QuaternionKeyframeTrack,
  44747. ValueTypeName: "quaternion",
  44748. DefaultInterpolation: n.InterpolateLinear,
  44749. InterpolantFactoryMethodLinear: function(e) {
  44750. return new n.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44751. },
  44752. InterpolantFactoryMethodSmooth: void 0
  44753. }),
  44754. n.StringKeyframeTrack = function(e, t, i, r) {
  44755. n.KeyframeTrack.call(this, e, t, i, r)
  44756. }
  44757. ,
  44758. n.StringKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  44759. constructor: n.StringKeyframeTrack,
  44760. ValueTypeName: "string",
  44761. ValueBufferType: Array,
  44762. DefaultInterpolation: n.IntepolateDiscrete,
  44763. InterpolantFactoryMethodLinear: void 0,
  44764. InterpolantFactoryMethodSmooth: void 0
  44765. }),
  44766. n.VectorKeyframeTrack = function(e, t, i, r) {
  44767. n.KeyframeTrack.call(this, e, t, i, r)
  44768. }
  44769. ,
  44770. n.VectorKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  44771. constructor: n.VectorKeyframeTrack,
  44772. ValueTypeName: "vector"
  44773. }),
  44774. n.Audio = function(e) {
  44775. n.Object3D.call(this),
  44776. this.type = "Audio",
  44777. this.context = e.context,
  44778. this.source = this.context.createBufferSource(),
  44779. this.source.onended = this.onEnded.bind(this),
  44780. this.gain = this.context.createGain(),
  44781. this.gain.connect(e.getInput()),
  44782. this.autoplay = !1,
  44783. this.startTime = 0,
  44784. this.playbackRate = 1,
  44785. this.isPlaying = !1,
  44786. this.hasPlaybackControl = !0,
  44787. this.sourceType = "empty",
  44788. this.filter = null
  44789. }
  44790. ,
  44791. n.Audio.prototype = Object.create(n.Object3D.prototype),
  44792. n.Audio.prototype.constructor = n.Audio,
  44793. n.Audio.prototype.getOutput = function() {
  44794. return this.gain
  44795. }
  44796. ,
  44797. n.Audio.prototype.load = function(e) {
  44798. var t = new n.AudioBuffer(this.context);
  44799. return t.load(e),
  44800. this.setBuffer(t),
  44801. this
  44802. }
  44803. ,
  44804. n.Audio.prototype.setNodeSource = function(e) {
  44805. return this.hasPlaybackControl = !1,
  44806. this.sourceType = "audioNode",
  44807. this.source = e,
  44808. this.connect(),
  44809. this
  44810. }
  44811. ,
  44812. n.Audio.prototype.setBuffer = function(e) {
  44813. var t = this;
  44814. return e.onReady(function(e) {
  44815. t.source.buffer = e,
  44816. t.sourceType = "buffer",
  44817. t.autoplay && t.play()
  44818. }),
  44819. this
  44820. }
  44821. ,
  44822. n.Audio.prototype.play = function() {
  44823. if (this.isPlaying === !0)
  44824. return void console.warn("THREE.Audio: Audio is already playing.");
  44825. if (this.hasPlaybackControl === !1)
  44826. return void console.warn("THREE.Audio: this Audio has no playback control.");
  44827. var e = this.context.createBufferSource();
  44828. e.buffer = this.source.buffer,
  44829. e.loop = this.source.loop,
  44830. e.onended = this.source.onended,
  44831. e.start(0, this.startTime),
  44832. e.playbackRate.value = this.playbackRate,
  44833. this.isPlaying = !0,
  44834. this.source = e,
  44835. this.connect()
  44836. }
  44837. ,
  44838. n.Audio.prototype.pause = function() {
  44839. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44840. void (this.startTime = this.context.currentTime))
  44841. }
  44842. ,
  44843. n.Audio.prototype.stop = function() {
  44844. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44845. void (this.startTime = 0))
  44846. }
  44847. ,
  44848. n.Audio.prototype.connect = function() {
  44849. null !== this.filter ? (this.source.connect(this.filter),
  44850. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  44851. }
  44852. ,
  44853. n.Audio.prototype.disconnect = function() {
  44854. null !== this.filter ? (this.source.disconnect(this.filter),
  44855. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  44856. }
  44857. ,
  44858. n.Audio.prototype.getFilter = function() {
  44859. return this.filter
  44860. }
  44861. ,
  44862. n.Audio.prototype.setFilter = function(e) {
  44863. void 0 === e && (e = null),
  44864. this.isPlaying === !0 ? (this.disconnect(),
  44865. this.filter = e,
  44866. this.connect()) : this.filter = e
  44867. }
  44868. ,
  44869. n.Audio.prototype.setPlaybackRate = function(e) {
  44870. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  44871. void (this.isPlaying === !0 && (this.source.playbackRate.value = this.playbackRate)))
  44872. }
  44873. ,
  44874. n.Audio.prototype.getPlaybackRate = function() {
  44875. return this.playbackRate
  44876. }
  44877. ,
  44878. n.Audio.prototype.onEnded = function() {
  44879. this.isPlaying = !1
  44880. }
  44881. ,
  44882. n.Audio.prototype.setLoop = function(e) {
  44883. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  44884. }
  44885. ,
  44886. n.Audio.prototype.getLoop = function() {
  44887. return this.hasPlaybackControl === !1 ? (console.warn("THREE.Audio: this Audio has no playback control."),
  44888. !1) : this.source.loop
  44889. }
  44890. ,
  44891. n.Audio.prototype.setVolume = function(e) {
  44892. this.gain.gain.value = e
  44893. }
  44894. ,
  44895. n.Audio.prototype.getVolume = function() {
  44896. return this.gain.gain.value
  44897. }
  44898. ,
  44899. n.AudioAnalyser = function(e, t) {
  44900. this.analyser = e.context.createAnalyser(),
  44901. this.analyser.fftSize = void 0 !== t ? t : 2048,
  44902. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  44903. e.getOutput().connect(this.analyser)
  44904. }
  44905. ,
  44906. n.AudioAnalyser.prototype = {
  44907. constructor: n.AudioAnalyser,
  44908. getData: function() {
  44909. return this.analyser.getByteFrequencyData(this.data),
  44910. this.data
  44911. }
  44912. },
  44913. n.AudioBuffer = function(e) {
  44914. this.context = e,
  44915. this.ready = !1,
  44916. this.readyCallbacks = []
  44917. }
  44918. ,
  44919. n.AudioBuffer.prototype.load = function(e) {
  44920. var t = this
  44921. , i = new XMLHttpRequest;
  44922. return i.open("GET", e, !0),
  44923. i.responseType = "arraybuffer",
  44924. i.onload = function(e) {
  44925. t.context.decodeAudioData(this.response, function(e) {
  44926. t.buffer = e,
  44927. t.ready = !0;
  44928. for (var i = 0; i < t.readyCallbacks.length; i++)
  44929. t.readyCallbacks[i](t.buffer);
  44930. t.readyCallbacks = []
  44931. })
  44932. }
  44933. ,
  44934. i.send(),
  44935. this
  44936. }
  44937. ,
  44938. n.AudioBuffer.prototype.onReady = function(e) {
  44939. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  44940. }
  44941. ,
  44942. n.PositionalAudio = function(e) {
  44943. n.Audio.call(this, e),
  44944. this.panner = this.context.createPanner(),
  44945. this.panner.connect(this.gain)
  44946. }
  44947. ,
  44948. n.PositionalAudio.prototype = Object.create(n.Audio.prototype),
  44949. n.PositionalAudio.prototype.constructor = n.PositionalAudio,
  44950. n.PositionalAudio.prototype.getOutput = function() {
  44951. return this.panner
  44952. }
  44953. ,
  44954. n.PositionalAudio.prototype.setRefDistance = function(e) {
  44955. this.panner.refDistance = e
  44956. }
  44957. ,
  44958. n.PositionalAudio.prototype.getRefDistance = function() {
  44959. return this.panner.refDistance
  44960. }
  44961. ,
  44962. n.PositionalAudio.prototype.setRolloffFactor = function(e) {
  44963. this.panner.rolloffFactor = e
  44964. }
  44965. ,
  44966. n.PositionalAudio.prototype.getRolloffFactor = function() {
  44967. return this.panner.rolloffFactor
  44968. }
  44969. ,
  44970. n.PositionalAudio.prototype.setDistanceModel = function(e) {
  44971. this.panner.distanceModel = e
  44972. }
  44973. ,
  44974. n.PositionalAudio.prototype.getDistanceModel = function() {
  44975. return this.panner.distanceModel
  44976. }
  44977. ,
  44978. n.PositionalAudio.prototype.setMaxDistance = function(e) {
  44979. this.panner.maxDistance = e
  44980. }
  44981. ,
  44982. n.PositionalAudio.prototype.getMaxDistance = function() {
  44983. return this.panner.maxDistance
  44984. }
  44985. ,
  44986. n.PositionalAudio.prototype.updateMatrixWorld = function() {
  44987. var e = new n.Vector3;
  44988. return function(t) {
  44989. n.Object3D.prototype.updateMatrixWorld.call(this, t),
  44990. e.setFromMatrixPosition(this.matrixWorld),
  44991. this.panner.setPosition(e.x, e.y, e.z)
  44992. }
  44993. }(),
  44994. n.AudioListener = function() {
  44995. n.Object3D.call(this),
  44996. this.type = "AudioListener",
  44997. this.context = new (window.AudioContext || window.webkitAudioContext),
  44998. this.gain = this.context.createGain(),
  44999. this.gain.connect(this.context.destination),
  45000. this.filter = null
  45001. }
  45002. ,
  45003. n.AudioListener.prototype = Object.create(n.Object3D.prototype),
  45004. n.AudioListener.prototype.constructor = n.AudioListener,
  45005. n.AudioListener.prototype.getInput = function() {
  45006. return this.gain
  45007. }
  45008. ,
  45009. n.AudioListener.prototype.removeFilter = function() {
  45010. null !== this.filter && (this.gain.disconnect(this.filter),
  45011. this.filter.disconnect(this.context.destination),
  45012. this.gain.connect(this.context.destination),
  45013. this.filter = null)
  45014. }
  45015. ,
  45016. n.AudioListener.prototype.setFilter = function(e) {
  45017. null !== this.filter ? (this.gain.disconnect(this.filter),
  45018. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  45019. this.filter = e,
  45020. this.gain.connect(this.filter),
  45021. this.filter.connect(this.context.destination)
  45022. }
  45023. ,
  45024. n.AudioListener.prototype.getFilter = function() {
  45025. return this.filter
  45026. }
  45027. ,
  45028. n.AudioListener.prototype.setMasterVolume = function(e) {
  45029. this.gain.gain.value = e
  45030. }
  45031. ,
  45032. n.AudioListener.prototype.getMasterVolume = function() {
  45033. return this.gain.gain.value
  45034. }
  45035. ,
  45036. n.AudioListener.prototype.updateMatrixWorld = function() {
  45037. var e = new n.Vector3
  45038. , t = new n.Quaternion
  45039. , i = new n.Vector3
  45040. , r = new n.Vector3;
  45041. return function(o) {
  45042. n.Object3D.prototype.updateMatrixWorld.call(this, o);
  45043. var a = this.context.listener
  45044. , s = this.up;
  45045. this.matrixWorld.decompose(e, t, i),
  45046. r.set(0, 0, -1).applyQuaternion(t),
  45047. a.setPosition(e.x, e.y, e.z),
  45048. a.setOrientation(r.x, r.y, r.z, s.x, s.y, s.z)
  45049. }
  45050. }(),
  45051. n.Camera = function() {
  45052. n.Object3D.call(this),
  45053. this.type = "Camera",
  45054. this.matrixWorldInverse = new n.Matrix4,
  45055. this.projectionMatrix = new n.Matrix4
  45056. }
  45057. ,
  45058. n.Camera.prototype = Object.create(n.Object3D.prototype),
  45059. n.Camera.prototype.constructor = n.Camera,
  45060. n.Camera.prototype.getWorldDirection = function() {
  45061. var e = new n.Quaternion;
  45062. return function(t) {
  45063. var i = t || new n.Vector3;
  45064. return this.getWorldQuaternion(e),
  45065. i.set(0, 0, -1).applyQuaternion(e)
  45066. }
  45067. }(),
  45068. n.Camera.prototype.lookAt = function() {
  45069. var e = new n.Matrix4;
  45070. return function(t) {
  45071. e.lookAt(this.position, t, this.up),
  45072. this.quaternion.setFromRotationMatrix(e)
  45073. }
  45074. }(),
  45075. n.Camera.prototype.clone = function() {
  45076. return (new this.constructor).copy(this)
  45077. }
  45078. ,
  45079. n.Camera.prototype.copy = function(e) {
  45080. return n.Object3D.prototype.copy.call(this, e),
  45081. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  45082. this.projectionMatrix.copy(e.projectionMatrix),
  45083. this
  45084. }
  45085. ,
  45086. n.CubeCamera = function(e, t, i) {
  45087. n.Object3D.call(this),
  45088. this.type = "CubeCamera";
  45089. var r = 90
  45090. , o = 1
  45091. , a = new n.PerspectiveCamera(r,o,e,t);
  45092. a.up.set(0, -1, 0),
  45093. a.lookAt(new n.Vector3(1,0,0)),
  45094. this.add(a);
  45095. var s = new n.PerspectiveCamera(r,o,e,t);
  45096. s.up.set(0, -1, 0),
  45097. s.lookAt(new n.Vector3(-1,0,0)),
  45098. this.add(s);
  45099. var l = new n.PerspectiveCamera(r,o,e,t);
  45100. l.up.set(0, 0, 1),
  45101. l.lookAt(new n.Vector3(0,1,0)),
  45102. this.add(l);
  45103. var c = new n.PerspectiveCamera(r,o,e,t);
  45104. c.up.set(0, 0, -1),
  45105. c.lookAt(new n.Vector3(0,-1,0)),
  45106. this.add(c);
  45107. var h = new n.PerspectiveCamera(r,o,e,t);
  45108. h.up.set(0, -1, 0),
  45109. h.lookAt(new n.Vector3(0,0,1)),
  45110. this.add(h);
  45111. var u = new n.PerspectiveCamera(r,o,e,t);
  45112. u.up.set(0, -1, 0),
  45113. u.lookAt(new n.Vector3(0,0,-1)),
  45114. this.add(u);
  45115. var d = {
  45116. format: n.RGBFormat,
  45117. magFilter: n.LinearFilter,
  45118. minFilter: n.LinearFilter
  45119. };
  45120. this.renderTarget = new n.WebGLRenderTargetCube(i,i,d),
  45121. this.updateCubeMap = function(e, t) {
  45122. null === this.parent && this.updateMatrixWorld();
  45123. var i = this.renderTarget
  45124. , n = i.texture.generateMipmaps;
  45125. i.texture.generateMipmaps = !1,
  45126. i.activeCubeFace = 0,
  45127. e.render(t, a, i),
  45128. i.activeCubeFace = 1,
  45129. e.render(t, s, i),
  45130. i.activeCubeFace = 2,
  45131. e.render(t, l, i),
  45132. i.activeCubeFace = 3,
  45133. e.render(t, c, i),
  45134. i.activeCubeFace = 4,
  45135. e.render(t, h, i),
  45136. i.texture.generateMipmaps = n,
  45137. i.activeCubeFace = 5,
  45138. e.render(t, u, i),
  45139. e.setRenderTarget(null)
  45140. }
  45141. }
  45142. ,
  45143. n.CubeCamera.prototype = Object.create(n.Object3D.prototype),
  45144. n.CubeCamera.prototype.constructor = n.CubeCamera,
  45145. n.OrthographicCamera = function(e, t, i, r, o, a) {
  45146. n.Camera.call(this),
  45147. this.type = "OrthographicCamera",
  45148. this.zoom = 1,
  45149. this.left = e,
  45150. this.right = t,
  45151. this.top = i,
  45152. this.bottom = r,
  45153. this.near = void 0 !== o ? o : .1,
  45154. this.far = void 0 !== a ? a : 2e3,
  45155. this.updateProjectionMatrix()
  45156. }
  45157. ,
  45158. n.OrthographicCamera.prototype = Object.create(n.Camera.prototype),
  45159. n.OrthographicCamera.prototype.constructor = n.OrthographicCamera,
  45160. n.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  45161. var e = (this.right - this.left) / (2 * this.zoom)
  45162. , t = (this.top - this.bottom) / (2 * this.zoom)
  45163. , i = (this.right + this.left) / 2
  45164. , n = (this.top + this.bottom) / 2;
  45165. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  45166. }
  45167. ,
  45168. n.OrthographicCamera.prototype.copy = function(e) {
  45169. return n.Camera.prototype.copy.call(this, e),
  45170. this.left = e.left,
  45171. this.right = e.right,
  45172. this.top = e.top,
  45173. this.bottom = e.bottom,
  45174. this.near = e.near,
  45175. this.far = e.far,
  45176. this.zoom = e.zoom,
  45177. this
  45178. }
  45179. ,
  45180. n.OrthographicCamera.prototype.toJSON = function(e) {
  45181. var t = n.Object3D.prototype.toJSON.call(this, e);
  45182. return t.object.zoom = this.zoom,
  45183. t.object.left = this.left,
  45184. t.object.right = this.right,
  45185. t.object.top = this.top,
  45186. t.object.bottom = this.bottom,
  45187. t.object.near = this.near,
  45188. t.object.far = this.far,
  45189. t
  45190. }
  45191. ,
  45192. n.PerspectiveCamera = function(e, t, i, r) {
  45193. n.Camera.call(this),
  45194. this.type = "PerspectiveCamera",
  45195. this.focalLength = 10,
  45196. this.zoom = 1,
  45197. this.fov = void 0 !== e ? e : 50,
  45198. this.aspect = void 0 !== t ? t : 1,
  45199. this.near = void 0 !== i ? i : .1,
  45200. this.far = void 0 !== r ? r : 2e3,
  45201. this.updateProjectionMatrix()
  45202. }
  45203. ,
  45204. n.PerspectiveCamera.prototype = Object.create(n.Camera.prototype),
  45205. n.PerspectiveCamera.prototype.constructor = n.PerspectiveCamera,
  45206. n.PerspectiveCamera.prototype.setLens = function(e, t) {
  45207. void 0 === t && (t = 24),
  45208. this.fov = 2 * n.Math.radToDeg(Math.atan(t / (2 * e))),
  45209. this.updateProjectionMatrix()
  45210. }
  45211. ,
  45212. n.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  45213. this.fullWidth = e,
  45214. this.fullHeight = t,
  45215. this.x = i,
  45216. this.y = n,
  45217. this.width = r,
  45218. this.height = o,
  45219. this.updateProjectionMatrix()
  45220. }
  45221. ,
  45222. n.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  45223. var e = n.Math.radToDeg(2 * Math.atan(Math.tan(.5 * n.Math.degToRad(this.fov)) / this.zoom));
  45224. if (this.fullWidth) {
  45225. var t = this.fullWidth / this.fullHeight
  45226. , i = Math.tan(n.Math.degToRad(.5 * e)) * this.near
  45227. , r = -i
  45228. , o = t * r
  45229. , a = t * i
  45230. , s = Math.abs(a - o)
  45231. , l = Math.abs(i - r);
  45232. 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)
  45233. } else
  45234. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  45235. }
  45236. ,
  45237. n.PerspectiveCamera.prototype.copy = function(e) {
  45238. return n.Camera.prototype.copy.call(this, e),
  45239. this.focalLength = e.focalLength,
  45240. this.zoom = e.zoom,
  45241. this.fov = e.fov,
  45242. this.aspect = e.aspect,
  45243. this.near = e.near,
  45244. this.far = e.far,
  45245. this
  45246. }
  45247. ,
  45248. n.PerspectiveCamera.prototype.toJSON = function(e) {
  45249. var t = n.Object3D.prototype.toJSON.call(this, e);
  45250. return t.object.focalLength = this.focalLength,
  45251. t.object.zoom = this.zoom,
  45252. t.object.fov = this.fov,
  45253. t.object.aspect = this.aspect,
  45254. t.object.near = this.near,
  45255. t.object.far = this.far,
  45256. t
  45257. }
  45258. ,
  45259. n.StereoCamera = function() {
  45260. this.type = "StereoCamera",
  45261. this.aspect = 1,
  45262. this.cameraL = new n.PerspectiveCamera,
  45263. this.cameraL.layers.enable(1),
  45264. this.cameraL.matrixAutoUpdate = !1,
  45265. this.cameraR = new n.PerspectiveCamera,
  45266. this.cameraR.layers.enable(2),
  45267. this.cameraR.matrixAutoUpdate = !1
  45268. }
  45269. ,
  45270. n.StereoCamera.prototype = {
  45271. constructor: n.StereoCamera,
  45272. update: function() {
  45273. var e, t, i, r, o, a = new n.Matrix4, s = new n.Matrix4;
  45274. return function(l) {
  45275. var c = e !== l.focalLength || t !== l.fov || i !== l.aspect * this.aspect || r !== l.near || o !== l.far;
  45276. if (c) {
  45277. e = l.focalLength,
  45278. t = l.fov,
  45279. i = l.aspect * this.aspect,
  45280. r = l.near,
  45281. o = l.far;
  45282. var h, u, d = l.projectionMatrix.clone(), p = .032, f = p * r / e, g = r * Math.tan(n.Math.degToRad(.5 * t));
  45283. s.elements[12] = -p,
  45284. a.elements[12] = p,
  45285. h = -g * i + f,
  45286. u = g * i + f,
  45287. d.elements[0] = 2 * r / (u - h),
  45288. d.elements[8] = (u + h) / (u - h),
  45289. this.cameraL.projectionMatrix.copy(d),
  45290. h = -g * i - f,
  45291. u = g * i - f,
  45292. d.elements[0] = 2 * r / (u - h),
  45293. d.elements[8] = (u + h) / (u - h),
  45294. this.cameraR.projectionMatrix.copy(d)
  45295. }
  45296. this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(s),
  45297. this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(a)
  45298. }
  45299. }()
  45300. },
  45301. n.Light = function(e, t) {
  45302. n.Object3D.call(this),
  45303. this.type = "Light",
  45304. this.color = new n.Color(e),
  45305. this.intensity = void 0 !== t ? t : 1,
  45306. this.receiveShadow = void 0
  45307. }
  45308. ,
  45309. n.Light.prototype = Object.create(n.Object3D.prototype),
  45310. n.Light.prototype.constructor = n.Light,
  45311. n.Light.prototype.copy = function(e) {
  45312. return n.Object3D.prototype.copy.call(this, e),
  45313. this.color.copy(e.color),
  45314. this.intensity = e.intensity,
  45315. this
  45316. }
  45317. ,
  45318. n.Light.prototype.toJSON = function(e) {
  45319. var t = n.Object3D.prototype.toJSON.call(this, e);
  45320. return t.object.color = this.color.getHex(),
  45321. t.object.intensity = this.intensity,
  45322. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  45323. void 0 !== this.distance && (t.object.distance = this.distance),
  45324. void 0 !== this.angle && (t.object.angle = this.angle),
  45325. void 0 !== this.decay && (t.object.decay = this.decay),
  45326. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  45327. t
  45328. }
  45329. ,
  45330. n.LightShadow = function(e) {
  45331. this.camera = e,
  45332. this.bias = 0,
  45333. this.radius = 1,
  45334. this.mapSize = new n.Vector2(512,512),
  45335. this.map = null,
  45336. this.matrix = new n.Matrix4
  45337. }
  45338. ,
  45339. n.LightShadow.prototype = {
  45340. constructor: n.LightShadow,
  45341. copy: function(e) {
  45342. return this.camera = e.camera.clone(),
  45343. this.bias = e.bias,
  45344. this.radius = e.radius,
  45345. this.mapSize.copy(e.mapSize),
  45346. this
  45347. },
  45348. clone: function() {
  45349. return (new this.constructor).copy(this)
  45350. }
  45351. },
  45352. n.AmbientLight = function(e, t) {
  45353. n.Light.call(this, e, t),
  45354. this.type = "AmbientLight",
  45355. this.castShadow = void 0
  45356. }
  45357. ,
  45358. n.AmbientLight.prototype = Object.create(n.Light.prototype),
  45359. n.AmbientLight.prototype.constructor = n.AmbientLight,
  45360. n.DirectionalLight = function(e, t) {
  45361. n.Light.call(this, e, t),
  45362. this.type = "DirectionalLight",
  45363. this.position.set(0, 1, 0),
  45364. this.updateMatrix(),
  45365. this.target = new n.Object3D,
  45366. this.shadow = new n.LightShadow(new n.OrthographicCamera(-5,5,5,-5,.5,500))
  45367. }
  45368. ,
  45369. n.DirectionalLight.prototype = Object.create(n.Light.prototype),
  45370. n.DirectionalLight.prototype.constructor = n.DirectionalLight,
  45371. n.DirectionalLight.prototype.copy = function(e) {
  45372. return n.Light.prototype.copy.call(this, e),
  45373. this.target = e.target.clone(),
  45374. this.shadow = e.shadow.clone(),
  45375. this
  45376. }
  45377. ,
  45378. n.HemisphereLight = function(e, t, i) {
  45379. n.Light.call(this, e, i),
  45380. this.type = "HemisphereLight",
  45381. this.castShadow = void 0,
  45382. this.position.set(0, 1, 0),
  45383. this.updateMatrix(),
  45384. this.groundColor = new n.Color(t)
  45385. }
  45386. ,
  45387. n.HemisphereLight.prototype = Object.create(n.Light.prototype),
  45388. n.HemisphereLight.prototype.constructor = n.HemisphereLight,
  45389. n.HemisphereLight.prototype.copy = function(e) {
  45390. return n.Light.prototype.copy.call(this, e),
  45391. this.groundColor.copy(e.groundColor),
  45392. this
  45393. }
  45394. ,
  45395. n.PointLight = function(e, t, i, r) {
  45396. n.Light.call(this, e, t),
  45397. this.type = "PointLight",
  45398. this.distance = void 0 !== i ? i : 0,
  45399. this.decay = void 0 !== r ? r : 1,
  45400. this.shadow = new n.LightShadow(new n.PerspectiveCamera(90,1,.5,500))
  45401. }
  45402. ,
  45403. n.PointLight.prototype = Object.create(n.Light.prototype),
  45404. n.PointLight.prototype.constructor = n.PointLight,
  45405. Object.defineProperty(n.PointLight.prototype, "power", {
  45406. get: function() {
  45407. return 4 * this.intensity * Math.PI
  45408. },
  45409. set: function(e) {
  45410. this.intensity = e / (4 * Math.PI)
  45411. }
  45412. }),
  45413. n.PointLight.prototype.copy = function(e) {
  45414. return n.Light.prototype.copy.call(this, e),
  45415. this.distance = e.distance,
  45416. this.decay = e.decay,
  45417. this.shadow = e.shadow.clone(),
  45418. this
  45419. }
  45420. ,
  45421. n.SpotLight = function(e, t, i, r, o, a) {
  45422. n.Light.call(this, e, t),
  45423. this.type = "SpotLight",
  45424. this.position.set(0, 1, 0),
  45425. this.updateMatrix(),
  45426. this.target = new n.Object3D,
  45427. this.distance = void 0 !== i ? i : 0,
  45428. this.angle = void 0 !== r ? r : Math.PI / 3,
  45429. this.penumbra = void 0 !== o ? o : 0,
  45430. this.decay = void 0 !== a ? a : 1,
  45431. this.shadow = new n.LightShadow(new n.PerspectiveCamera(50,1,.5,500))
  45432. }
  45433. ,
  45434. n.SpotLight.prototype = Object.create(n.Light.prototype),
  45435. n.SpotLight.prototype.constructor = n.SpotLight,
  45436. Object.defineProperty(n.SpotLight.prototype, "power", {
  45437. get: function() {
  45438. return this.intensity * Math.PI
  45439. },
  45440. set: function(e) {
  45441. this.intensity = e / Math.PI
  45442. }
  45443. }),
  45444. n.SpotLight.prototype.copy = function(e) {
  45445. return n.Light.prototype.copy.call(this, e),
  45446. this.distance = e.distance,
  45447. this.angle = e.angle,
  45448. this.penumbra = e.penumbra,
  45449. this.decay = e.decay,
  45450. this.target = e.target.clone(),
  45451. this.shadow = e.shadow.clone(),
  45452. this
  45453. }
  45454. ,
  45455. n.Cache = {
  45456. enabled: !1,
  45457. files: {},
  45458. add: function(e, t) {
  45459. this.enabled !== !1 && (this.files[e] = t)
  45460. },
  45461. get: function(e) {
  45462. if (this.enabled !== !1)
  45463. return this.files[e]
  45464. },
  45465. remove: function(e) {
  45466. delete this.files[e]
  45467. },
  45468. clear: function() {
  45469. this.files = {}
  45470. }
  45471. },
  45472. n.Loader = function() {
  45473. this.onLoadStart = function() {}
  45474. ,
  45475. this.onLoadProgress = function() {}
  45476. ,
  45477. this.onLoadComplete = function() {}
  45478. }
  45479. ,
  45480. n.Loader.prototype = {
  45481. constructor: n.Loader,
  45482. crossOrigin: void 0,
  45483. extractUrlBase: function(e) {
  45484. var t = e.split("/");
  45485. return 1 === t.length ? "./" : (t.pop(),
  45486. t.join("/") + "/")
  45487. },
  45488. initMaterials: function(e, t, i) {
  45489. for (var n = [], r = 0; r < e.length; ++r)
  45490. n[r] = this.createMaterial(e[r], t, i);
  45491. return n
  45492. },
  45493. createMaterial: function() {
  45494. var e, t, i;
  45495. return function(r, o, a) {
  45496. function s(e, i, r, s, c) {
  45497. var h, u = o + e, d = n.Loader.Handlers.get(u);
  45498. null !== d ? h = d.load(u) : (t.setCrossOrigin(a),
  45499. h = t.load(u)),
  45500. void 0 !== i && (h.repeat.fromArray(i),
  45501. 1 !== i[0] && (h.wrapS = n.RepeatWrapping),
  45502. 1 !== i[1] && (h.wrapT = n.RepeatWrapping)),
  45503. void 0 !== r && h.offset.fromArray(r),
  45504. void 0 !== s && ("repeat" === s[0] && (h.wrapS = n.RepeatWrapping),
  45505. "mirror" === s[0] && (h.wrapS = n.MirroredRepeatWrapping),
  45506. "repeat" === s[1] && (h.wrapT = n.RepeatWrapping),
  45507. "mirror" === s[1] && (h.wrapT = n.MirroredRepeatWrapping)),
  45508. void 0 !== c && (h.anisotropy = c);
  45509. var p = n.Math.generateUUID();
  45510. return l[p] = h,
  45511. p
  45512. }
  45513. void 0 === e && (e = new n.Color),
  45514. void 0 === t && (t = new n.TextureLoader),
  45515. void 0 === i && (i = new n.MaterialLoader);
  45516. var l = {}
  45517. , c = {
  45518. uuid: n.Math.generateUUID(),
  45519. type: "MeshLambertMaterial"
  45520. };
  45521. for (var h in r) {
  45522. var u = r[h];
  45523. switch (h) {
  45524. case "DbgColor":
  45525. case "DbgIndex":
  45526. case "opticalDensity":
  45527. case "illumination":
  45528. break;
  45529. case "DbgName":
  45530. c.name = u;
  45531. break;
  45532. case "blending":
  45533. c.blending = n[u];
  45534. break;
  45535. case "colorAmbient":
  45536. case "mapAmbient":
  45537. console.warn("THREE.Loader.createMaterial:", h, "is no longer supported.");
  45538. break;
  45539. case "colorDiffuse":
  45540. c.color = e.fromArray(u).getHex();
  45541. break;
  45542. case "colorSpecular":
  45543. c.specular = e.fromArray(u).getHex();
  45544. break;
  45545. case "colorEmissive":
  45546. c.emissive = e.fromArray(u).getHex();
  45547. break;
  45548. case "specularCoef":
  45549. c.shininess = u;
  45550. break;
  45551. case "shading":
  45552. "basic" === u.toLowerCase() && (c.type = "MeshBasicMaterial"),
  45553. "phong" === u.toLowerCase() && (c.type = "MeshPhongMaterial");
  45554. break;
  45555. case "mapDiffuse":
  45556. c.map = s(u, r.mapDiffuseRepeat, r.mapDiffuseOffset, r.mapDiffuseWrap, r.mapDiffuseAnisotropy);
  45557. break;
  45558. case "mapDiffuseRepeat":
  45559. case "mapDiffuseOffset":
  45560. case "mapDiffuseWrap":
  45561. case "mapDiffuseAnisotropy":
  45562. break;
  45563. case "mapLight":
  45564. c.lightMap = s(u, r.mapLightRepeat, r.mapLightOffset, r.mapLightWrap, r.mapLightAnisotropy);
  45565. break;
  45566. case "mapLightRepeat":
  45567. case "mapLightOffset":
  45568. case "mapLightWrap":
  45569. case "mapLightAnisotropy":
  45570. break;
  45571. case "mapAO":
  45572. c.aoMap = s(u, r.mapAORepeat, r.mapAOOffset, r.mapAOWrap, r.mapAOAnisotropy);
  45573. break;
  45574. case "mapAORepeat":
  45575. case "mapAOOffset":
  45576. case "mapAOWrap":
  45577. case "mapAOAnisotropy":
  45578. break;
  45579. case "mapBump":
  45580. c.bumpMap = s(u, r.mapBumpRepeat, r.mapBumpOffset, r.mapBumpWrap, r.mapBumpAnisotropy);
  45581. break;
  45582. case "mapBumpScale":
  45583. c.bumpScale = u;
  45584. break;
  45585. case "mapBumpRepeat":
  45586. case "mapBumpOffset":
  45587. case "mapBumpWrap":
  45588. case "mapBumpAnisotropy":
  45589. break;
  45590. case "mapNormal":
  45591. c.normalMap = s(u, r.mapNormalRepeat, r.mapNormalOffset, r.mapNormalWrap, r.mapNormalAnisotropy);
  45592. break;
  45593. case "mapNormalFactor":
  45594. c.normalScale = [u, u];
  45595. break;
  45596. case "mapNormalRepeat":
  45597. case "mapNormalOffset":
  45598. case "mapNormalWrap":
  45599. case "mapNormalAnisotropy":
  45600. break;
  45601. case "mapSpecular":
  45602. c.specularMap = s(u, r.mapSpecularRepeat, r.mapSpecularOffset, r.mapSpecularWrap, r.mapSpecularAnisotropy);
  45603. break;
  45604. case "mapSpecularRepeat":
  45605. case "mapSpecularOffset":
  45606. case "mapSpecularWrap":
  45607. case "mapSpecularAnisotropy":
  45608. break;
  45609. case "mapAlpha":
  45610. c.alphaMap = s(u, r.mapAlphaRepeat, r.mapAlphaOffset, r.mapAlphaWrap, r.mapAlphaAnisotropy);
  45611. break;
  45612. case "mapAlphaRepeat":
  45613. case "mapAlphaOffset":
  45614. case "mapAlphaWrap":
  45615. case "mapAlphaAnisotropy":
  45616. break;
  45617. case "flipSided":
  45618. c.side = n.BackSide;
  45619. break;
  45620. case "doubleSided":
  45621. c.side = n.DoubleSide;
  45622. break;
  45623. case "transparency":
  45624. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  45625. c.opacity = u;
  45626. break;
  45627. case "depthTest":
  45628. case "depthWrite":
  45629. case "colorWrite":
  45630. case "opacity":
  45631. case "reflectivity":
  45632. case "transparent":
  45633. case "visible":
  45634. case "wireframe":
  45635. c[h] = u;
  45636. break;
  45637. case "vertexColors":
  45638. u === !0 && (c.vertexColors = n.VertexColors),
  45639. "face" === u && (c.vertexColors = n.FaceColors);
  45640. break;
  45641. default:
  45642. console.error("THREE.Loader.createMaterial: Unsupported", h, u)
  45643. }
  45644. }
  45645. return "MeshBasicMaterial" === c.type && delete c.emissive,
  45646. "MeshPhongMaterial" !== c.type && delete c.specular,
  45647. c.opacity < 1 && (c.transparent = !0),
  45648. i.setTextures(l),
  45649. i.parse(c)
  45650. }
  45651. }()
  45652. },
  45653. n.Loader.Handlers = {
  45654. handlers: [],
  45655. add: function(e, t) {
  45656. this.handlers.push(e, t)
  45657. },
  45658. get: function(e) {
  45659. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  45660. var r = t[i]
  45661. , o = t[i + 1];
  45662. if (r.test(e))
  45663. return o
  45664. }
  45665. return null
  45666. }
  45667. },
  45668. n.XHRLoader = function(e) {
  45669. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  45670. }
  45671. ,
  45672. n.XHRLoader.prototype = {
  45673. constructor: n.XHRLoader,
  45674. load: function(e, t, i, r) {
  45675. void 0 !== this.path && (e = this.path + e);
  45676. var o = this
  45677. , a = n.Cache.get(e);
  45678. if (void 0 !== a)
  45679. return t && setTimeout(function() {
  45680. t(a)
  45681. }, 0),
  45682. a;
  45683. var s = new XMLHttpRequest;
  45684. return s.overrideMimeType("text/plain"),
  45685. s.open("GET", e, !0),
  45686. s.addEventListener("load", function(i) {
  45687. var a = i.target.response;
  45688. n.Cache.add(e, a),
  45689. 200 === this.status ? (t && t(a),
  45690. o.manager.itemEnd(e)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  45691. t && t(a),
  45692. o.manager.itemEnd(e)) : (r && r(i),
  45693. o.manager.itemError(e))
  45694. }, !1),
  45695. void 0 !== i && s.addEventListener("progress", function(e) {
  45696. i(e)
  45697. }, !1),
  45698. s.addEventListener("error", function(t) {
  45699. r && r(t),
  45700. o.manager.itemError(e)
  45701. }, !1),
  45702. void 0 !== this.responseType && (s.responseType = this.responseType),
  45703. void 0 !== this.withCredentials && (s.withCredentials = this.withCredentials),
  45704. s.send(null),
  45705. o.manager.itemStart(e),
  45706. s
  45707. },
  45708. setPath: function(e) {
  45709. this.path = e
  45710. },
  45711. setResponseType: function(e) {
  45712. this.responseType = e
  45713. },
  45714. setWithCredentials: function(e) {
  45715. this.withCredentials = e
  45716. }
  45717. },
  45718. n.FontLoader = function(e) {
  45719. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  45720. }
  45721. ,
  45722. n.FontLoader.prototype = {
  45723. constructor: n.FontLoader,
  45724. load: function(e, t, i, r) {
  45725. var o = new n.XHRLoader(this.manager);
  45726. o.load(e, function(e) {
  45727. t(new n.Font(JSON.parse(e.substring(65, e.length - 2))))
  45728. }, i, r)
  45729. }
  45730. },
  45731. n.ImageLoader = function(e) {
  45732. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  45733. }
  45734. ,
  45735. n.ImageLoader.prototype = {
  45736. constructor: n.ImageLoader,
  45737. load: function(e, t, i, r) {
  45738. void 0 !== this.path && (e = this.path + e);
  45739. var o = this
  45740. , a = n.Cache.get(e);
  45741. if (void 0 !== a)
  45742. return o.manager.itemStart(e),
  45743. t ? setTimeout(function() {
  45744. t(a),
  45745. o.manager.itemEnd(e)
  45746. }, 0) : o.manager.itemEnd(e),
  45747. a;
  45748. var s = document.createElement("img");
  45749. return s.addEventListener("load", function(i) {
  45750. n.Cache.add(e, this),
  45751. t && t(this),
  45752. o.manager.itemEnd(e)
  45753. }, !1),
  45754. void 0 !== i && s.addEventListener("progress", function(e) {
  45755. i(e)
  45756. }, !1),
  45757. s.addEventListener("error", function(t) {
  45758. r && r(t),
  45759. o.manager.itemError(e)
  45760. }, !1),
  45761. void 0 !== this.crossOrigin && (s.crossOrigin = this.crossOrigin),
  45762. o.manager.itemStart(e),
  45763. s.src = e,
  45764. s
  45765. },
  45766. setCrossOrigin: function(e) {
  45767. this.crossOrigin = e
  45768. },
  45769. setPath: function(e) {
  45770. this.path = e
  45771. }
  45772. },
  45773. n.JSONLoader = function(e) {
  45774. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  45775. e = void 0),
  45776. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  45777. this.withCredentials = !1
  45778. }
  45779. ,
  45780. n.JSONLoader.prototype = {
  45781. constructor: n.JSONLoader,
  45782. get statusDomElement() {
  45783. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  45784. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  45785. this._statusDomElement
  45786. },
  45787. load: function(e, t, i, r) {
  45788. var o = this
  45789. , a = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : n.Loader.prototype.extractUrlBase(e)
  45790. , s = new n.XHRLoader(this.manager);
  45791. s.setWithCredentials(this.withCredentials),
  45792. s.load(e, function(i) {
  45793. var n = JSON.parse(i)
  45794. , r = n.metadata;
  45795. if (void 0 !== r) {
  45796. var s = r.type;
  45797. if (void 0 !== s) {
  45798. if ("object" === s.toLowerCase())
  45799. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.ObjectLoader instead.");
  45800. if ("scene" === s.toLowerCase())
  45801. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.SceneLoader instead.")
  45802. }
  45803. }
  45804. var l = o.parse(n, a);
  45805. t(l.geometry, l.materials)
  45806. }, i, r)
  45807. },
  45808. setTexturePath: function(e) {
  45809. this.texturePath = e
  45810. },
  45811. parse: function(e, t) {
  45812. function i(t) {
  45813. function i(e, t) {
  45814. return e & 1 << t
  45815. }
  45816. 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;
  45817. if (void 0 !== e.uvs) {
  45818. for (r = 0; r < e.uvs.length; r++)
  45819. e.uvs[r].length && B++;
  45820. for (r = 0; r < B; r++)
  45821. s.faceVertexUvs[r] = []
  45822. }
  45823. for (l = 0,
  45824. c = L.length; l < c; )
  45825. E = new n.Vector3,
  45826. E.x = L[l++] * t,
  45827. E.y = L[l++] * t,
  45828. E.z = L[l++] * t,
  45829. s.vertices.push(E);
  45830. for (l = 0,
  45831. c = O.length; l < c; )
  45832. if (f = O[l++],
  45833. g = i(f, 0),
  45834. m = i(f, 1),
  45835. v = i(f, 3),
  45836. A = i(f, 4),
  45837. y = i(f, 5),
  45838. C = i(f, 6),
  45839. I = i(f, 7),
  45840. g) {
  45841. if (w = new n.Face3,
  45842. w.a = O[l],
  45843. w.b = O[l + 1],
  45844. w.c = O[l + 3],
  45845. _ = new n.Face3,
  45846. _.a = O[l + 1],
  45847. _.b = O[l + 2],
  45848. _.c = O[l + 3],
  45849. l += 4,
  45850. m && (p = O[l++],
  45851. w.materialIndex = p,
  45852. _.materialIndex = p),
  45853. a = s.faces.length,
  45854. v)
  45855. for (r = 0; r < B; r++)
  45856. for (S = e.uvs[r],
  45857. s.faceVertexUvs[r][a] = [],
  45858. s.faceVertexUvs[r][a + 1] = [],
  45859. o = 0; o < 4; o++)
  45860. d = O[l++],
  45861. R = S[2 * d],
  45862. P = S[2 * d + 1],
  45863. M = new n.Vector2(R,P),
  45864. 2 !== o && s.faceVertexUvs[r][a].push(M),
  45865. 0 !== o && s.faceVertexUvs[r][a + 1].push(M);
  45866. if (A && (u = 3 * O[l++],
  45867. w.normal.set(D[u++], D[u++], D[u]),
  45868. _.normal.copy(w.normal)),
  45869. y)
  45870. for (r = 0; r < 4; r++)
  45871. u = 3 * O[l++],
  45872. x = new n.Vector3(D[u++],D[u++],D[u]),
  45873. 2 !== r && w.vertexNormals.push(x),
  45874. 0 !== r && _.vertexNormals.push(x);
  45875. if (C && (h = O[l++],
  45876. T = N[h],
  45877. w.color.setHex(T),
  45878. _.color.setHex(T)),
  45879. I)
  45880. for (r = 0; r < 4; r++)
  45881. h = O[l++],
  45882. T = N[h],
  45883. 2 !== r && w.vertexColors.push(new n.Color(T)),
  45884. 0 !== r && _.vertexColors.push(new n.Color(T));
  45885. s.faces.push(w),
  45886. s.faces.push(_)
  45887. } else {
  45888. if (b = new n.Face3,
  45889. b.a = O[l++],
  45890. b.b = O[l++],
  45891. b.c = O[l++],
  45892. m && (p = O[l++],
  45893. b.materialIndex = p),
  45894. a = s.faces.length,
  45895. v)
  45896. for (r = 0; r < B; r++)
  45897. for (S = e.uvs[r],
  45898. s.faceVertexUvs[r][a] = [],
  45899. o = 0; o < 3; o++)
  45900. d = O[l++],
  45901. R = S[2 * d],
  45902. P = S[2 * d + 1],
  45903. M = new n.Vector2(R,P),
  45904. s.faceVertexUvs[r][a].push(M);
  45905. if (A && (u = 3 * O[l++],
  45906. b.normal.set(D[u++], D[u++], D[u])),
  45907. y)
  45908. for (r = 0; r < 3; r++)
  45909. u = 3 * O[l++],
  45910. x = new n.Vector3(D[u++],D[u++],D[u]),
  45911. b.vertexNormals.push(x);
  45912. if (C && (h = O[l++],
  45913. b.color.setHex(N[h])),
  45914. I)
  45915. for (r = 0; r < 3; r++)
  45916. h = O[l++],
  45917. b.vertexColors.push(new n.Color(N[h]));
  45918. s.faces.push(b)
  45919. }
  45920. }
  45921. function r() {
  45922. var t = void 0 !== e.influencesPerVertex ? e.influencesPerVertex : 2;
  45923. if (e.skinWeights)
  45924. for (var i = 0, r = e.skinWeights.length; i < r; i += t) {
  45925. var o = e.skinWeights[i]
  45926. , a = t > 1 ? e.skinWeights[i + 1] : 0
  45927. , l = t > 2 ? e.skinWeights[i + 2] : 0
  45928. , c = t > 3 ? e.skinWeights[i + 3] : 0;
  45929. s.skinWeights.push(new n.Vector4(o,a,l,c))
  45930. }
  45931. if (e.skinIndices)
  45932. for (var i = 0, r = e.skinIndices.length; i < r; i += t) {
  45933. var h = e.skinIndices[i]
  45934. , u = t > 1 ? e.skinIndices[i + 1] : 0
  45935. , d = t > 2 ? e.skinIndices[i + 2] : 0
  45936. , p = t > 3 ? e.skinIndices[i + 3] : 0;
  45937. s.skinIndices.push(new n.Vector4(h,u,d,p))
  45938. }
  45939. s.bones = e.bones,
  45940. 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.")
  45941. }
  45942. function o(t) {
  45943. if (void 0 !== e.morphTargets)
  45944. for (var i = 0, r = e.morphTargets.length; i < r; i++) {
  45945. s.morphTargets[i] = {},
  45946. s.morphTargets[i].name = e.morphTargets[i].name,
  45947. s.morphTargets[i].vertices = [];
  45948. for (var o = s.morphTargets[i].vertices, a = e.morphTargets[i].vertices, l = 0, c = a.length; l < c; l += 3) {
  45949. var h = new n.Vector3;
  45950. h.x = a[l] * t,
  45951. h.y = a[l + 1] * t,
  45952. h.z = a[l + 2] * t,
  45953. o.push(h)
  45954. }
  45955. }
  45956. if (void 0 !== e.morphColors && e.morphColors.length > 0) {
  45957. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  45958. for (var u = s.faces, d = e.morphColors[0].colors, i = 0, r = u.length; i < r; i++)
  45959. u[i].color.fromArray(d, 3 * i)
  45960. }
  45961. }
  45962. function a() {
  45963. var t = []
  45964. , i = [];
  45965. void 0 !== e.animation && i.push(e.animation),
  45966. void 0 !== e.animations && (e.animations.length ? i = i.concat(e.animations) : i.push(e.animations));
  45967. for (var r = 0; r < i.length; r++) {
  45968. var o = n.AnimationClip.parseAnimation(i[r], s.bones);
  45969. o && t.push(o)
  45970. }
  45971. if (s.morphTargets) {
  45972. var a = n.AnimationClip.CreateClipsFromMorphTargetSequences(s.morphTargets, 10);
  45973. t = t.concat(a)
  45974. }
  45975. t.length > 0 && (s.animations = t)
  45976. }
  45977. var s = new n.Geometry
  45978. , l = void 0 !== e.scale ? 1 / e.scale : 1;
  45979. if (i(l),
  45980. r(),
  45981. o(l),
  45982. a(),
  45983. s.computeFaceNormals(),
  45984. s.computeBoundingSphere(),
  45985. void 0 === e.materials || 0 === e.materials.length)
  45986. return {
  45987. geometry: s
  45988. };
  45989. var c = n.Loader.prototype.initMaterials(e.materials, t, this.crossOrigin);
  45990. return {
  45991. geometry: s,
  45992. materials: c
  45993. }
  45994. }
  45995. },
  45996. n.LoadingManager = function(e, t, i) {
  45997. var n = this
  45998. , r = !1
  45999. , o = 0
  46000. , a = 0;
  46001. this.onStart = void 0,
  46002. this.onLoad = e,
  46003. this.onProgress = t,
  46004. this.onError = i,
  46005. this.itemStart = function(e) {
  46006. a++,
  46007. r === !1 && void 0 !== n.onStart && n.onStart(e, o, a),
  46008. r = !0
  46009. }
  46010. ,
  46011. this.itemEnd = function(e) {
  46012. o++,
  46013. void 0 !== n.onProgress && n.onProgress(e, o, a),
  46014. o === a && (r = !1,
  46015. void 0 !== n.onLoad && n.onLoad())
  46016. }
  46017. ,
  46018. this.itemError = function(e) {
  46019. void 0 !== n.onError && n.onError(e)
  46020. }
  46021. }
  46022. ,
  46023. n.DefaultLoadingManager = new n.LoadingManager,
  46024. n.BufferGeometryLoader = function(e) {
  46025. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  46026. }
  46027. ,
  46028. n.BufferGeometryLoader.prototype = {
  46029. constructor: n.BufferGeometryLoader,
  46030. load: function(e, t, i, r) {
  46031. var o = this
  46032. , a = new n.XHRLoader(o.manager);
  46033. a.load(e, function(e) {
  46034. t(o.parse(JSON.parse(e)))
  46035. }, i, r)
  46036. },
  46037. parse: function(e) {
  46038. var t = new n.BufferGeometry
  46039. , i = e.data.index
  46040. , r = {
  46041. Int8Array: Int8Array,
  46042. Uint8Array: Uint8Array,
  46043. Uint8ClampedArray: Uint8ClampedArray,
  46044. Int16Array: Int16Array,
  46045. Uint16Array: Uint16Array,
  46046. Int32Array: Int32Array,
  46047. Uint32Array: Uint32Array,
  46048. Float32Array: Float32Array,
  46049. Float64Array: Float64Array
  46050. };
  46051. if (void 0 !== i) {
  46052. var o = new r[i.type](i.array);
  46053. t.setIndex(new n.BufferAttribute(o,1))
  46054. }
  46055. var a = e.data.attributes;
  46056. for (var s in a) {
  46057. var l = a[s]
  46058. , o = new r[l.type](l.array);
  46059. t.addAttribute(s, new n.BufferAttribute(o,l.itemSize))
  46060. }
  46061. var c = e.data.groups || e.data.drawcalls || e.data.offsets;
  46062. if (void 0 !== c)
  46063. for (var h = 0, u = c.length; h !== u; ++h) {
  46064. var d = c[h];
  46065. t.addGroup(d.start, d.count, d.materialIndex)
  46066. }
  46067. var p = e.data.boundingSphere;
  46068. if (void 0 !== p) {
  46069. var f = new n.Vector3;
  46070. void 0 !== p.center && f.fromArray(p.center),
  46071. t.boundingSphere = new n.Sphere(f,p.radius)
  46072. }
  46073. return t
  46074. }
  46075. },
  46076. n.MaterialLoader = function(e) {
  46077. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  46078. this.textures = {}
  46079. }
  46080. ,
  46081. n.MaterialLoader.prototype = {
  46082. constructor: n.MaterialLoader,
  46083. load: function(e, t, i, r) {
  46084. var o = this
  46085. , a = new n.XHRLoader(o.manager);
  46086. a.load(e, function(e) {
  46087. t(o.parse(JSON.parse(e)))
  46088. }, i, r)
  46089. },
  46090. setTextures: function(e) {
  46091. this.textures = e
  46092. },
  46093. getTexture: function(e) {
  46094. var t = this.textures;
  46095. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  46096. t[e]
  46097. },
  46098. parse: function(e) {
  46099. var t = new n[e.type];
  46100. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  46101. void 0 !== e.name && (t.name = e.name),
  46102. void 0 !== e.color && t.color.setHex(e.color),
  46103. void 0 !== e.roughness && (t.roughness = e.roughness),
  46104. void 0 !== e.metalness && (t.metalness = e.metalness),
  46105. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  46106. void 0 !== e.specular && t.specular.setHex(e.specular),
  46107. void 0 !== e.shininess && (t.shininess = e.shininess),
  46108. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  46109. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  46110. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  46111. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  46112. void 0 !== e.shading && (t.shading = e.shading),
  46113. void 0 !== e.blending && (t.blending = e.blending),
  46114. void 0 !== e.side && (t.side = e.side),
  46115. void 0 !== e.opacity && (t.opacity = e.opacity),
  46116. void 0 !== e.transparent && (t.transparent = e.transparent),
  46117. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  46118. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  46119. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  46120. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  46121. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  46122. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  46123. void 0 !== e.size && (t.size = e.size),
  46124. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  46125. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  46126. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  46127. t.transparent = !0),
  46128. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  46129. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  46130. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  46131. void 0 !== e.normalScale) {
  46132. var i = e.normalScale;
  46133. Array.isArray(i) === !1 && (i = [i, i]),
  46134. t.normalScale = (new n.Vector2).fromArray(i)
  46135. }
  46136. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  46137. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  46138. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  46139. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  46140. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  46141. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  46142. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  46143. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  46144. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  46145. t.combine = n.MultiplyOperation),
  46146. e.reflectivity && (t.reflectivity = e.reflectivity),
  46147. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  46148. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  46149. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  46150. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  46151. void 0 !== e.materials)
  46152. for (var r = 0, o = e.materials.length; r < o; r++)
  46153. t.materials.push(this.parse(e.materials[r]));
  46154. return t
  46155. }
  46156. },
  46157. n.ObjectLoader = function(e) {
  46158. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  46159. this.texturePath = ""
  46160. }
  46161. ,
  46162. n.ObjectLoader.prototype = {
  46163. constructor: n.ObjectLoader,
  46164. load: function(e, t, i, r) {
  46165. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  46166. var o = this
  46167. , a = new n.XHRLoader(o.manager);
  46168. a.load(e, function(e) {
  46169. o.parse(JSON.parse(e), t)
  46170. }, i, r)
  46171. },
  46172. setTexturePath: function(e) {
  46173. this.texturePath = e
  46174. },
  46175. setCrossOrigin: function(e) {
  46176. this.crossOrigin = e
  46177. },
  46178. parse: function(e, t) {
  46179. var i = this.parseGeometries(e.geometries)
  46180. , n = this.parseImages(e.images, function() {
  46181. void 0 !== t && t(a)
  46182. })
  46183. , r = this.parseTextures(e.textures, n)
  46184. , o = this.parseMaterials(e.materials, r)
  46185. , a = this.parseObject(e.object, i, o);
  46186. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  46187. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  46188. a
  46189. },
  46190. parseGeometries: function(e) {
  46191. var t = {};
  46192. if (void 0 !== e)
  46193. for (var i = new n.JSONLoader, r = new n.BufferGeometryLoader, o = 0, a = e.length; o < a; o++) {
  46194. var s, l = e[o];
  46195. switch (l.type) {
  46196. case "PlaneGeometry":
  46197. case "PlaneBufferGeometry":
  46198. s = new n[l.type](l.width,l.height,l.widthSegments,l.heightSegments);
  46199. break;
  46200. case "BoxGeometry":
  46201. case "BoxBufferGeometry":
  46202. case "CubeGeometry":
  46203. s = new n[l.type](l.width,l.height,l.depth,l.widthSegments,l.heightSegments,l.depthSegments);
  46204. break;
  46205. case "CircleGeometry":
  46206. case "CircleBufferGeometry":
  46207. s = new n[l.type](l.radius,l.segments,l.thetaStart,l.thetaLength);
  46208. break;
  46209. case "CylinderGeometry":
  46210. case "CylinderBufferGeometry":
  46211. s = new n[l.type](l.radiusTop,l.radiusBottom,l.height,l.radialSegments,l.heightSegments,l.openEnded,l.thetaStart,l.thetaLength);
  46212. break;
  46213. case "SphereGeometry":
  46214. case "SphereBufferGeometry":
  46215. s = new n[l.type](l.radius,l.widthSegments,l.heightSegments,l.phiStart,l.phiLength,l.thetaStart,l.thetaLength);
  46216. break;
  46217. case "DodecahedronGeometry":
  46218. s = new n.DodecahedronGeometry(l.radius,l.detail);
  46219. break;
  46220. case "IcosahedronGeometry":
  46221. s = new n.IcosahedronGeometry(l.radius,l.detail);
  46222. break;
  46223. case "OctahedronGeometry":
  46224. s = new n.OctahedronGeometry(l.radius,l.detail);
  46225. break;
  46226. case "TetrahedronGeometry":
  46227. s = new n.TetrahedronGeometry(l.radius,l.detail);
  46228. break;
  46229. case "RingGeometry":
  46230. case "RingBufferGeometry":
  46231. s = new n[l.type](l.innerRadius,l.outerRadius,l.thetaSegments,l.phiSegments,l.thetaStart,l.thetaLength);
  46232. break;
  46233. case "TorusGeometry":
  46234. case "TorusBufferGeometry":
  46235. s = new n[l.type](l.radius,l.tube,l.radialSegments,l.tubularSegments,l.arc);
  46236. break;
  46237. case "TorusKnotGeometry":
  46238. case "TorusKnotBufferGeometry":
  46239. s = new n[l.type](l.radius,l.tube,l.tubularSegments,l.radialSegments,l.p,l.q);
  46240. break;
  46241. case "LatheGeometry":
  46242. s = new n.LatheGeometry(l.points,l.segments,l.phiStart,l.phiLength);
  46243. break;
  46244. case "BufferGeometry":
  46245. s = r.parse(l);
  46246. break;
  46247. case "Geometry":
  46248. s = i.parse(l.data, this.texturePath).geometry;
  46249. break;
  46250. default:
  46251. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + l.type + '"');
  46252. continue
  46253. }
  46254. s.uuid = l.uuid,
  46255. void 0 !== l.name && (s.name = l.name),
  46256. t[l.uuid] = s
  46257. }
  46258. return t
  46259. },
  46260. parseMaterials: function(e, t) {
  46261. var i = {};
  46262. if (void 0 !== e) {
  46263. var r = new n.MaterialLoader;
  46264. r.setTextures(t);
  46265. for (var o = 0, a = e.length; o < a; o++) {
  46266. var s = r.parse(e[o]);
  46267. i[s.uuid] = s
  46268. }
  46269. }
  46270. return i
  46271. },
  46272. parseAnimations: function(e) {
  46273. for (var t = [], i = 0; i < e.length; i++) {
  46274. var r = n.AnimationClip.parse(e[i]);
  46275. t.push(r)
  46276. }
  46277. return t
  46278. },
  46279. parseImages: function(e, t) {
  46280. function i(e) {
  46281. return r.manager.itemStart(e),
  46282. s.load(e, function() {
  46283. r.manager.itemEnd(e)
  46284. })
  46285. }
  46286. var r = this
  46287. , o = {};
  46288. if (void 0 !== e && e.length > 0) {
  46289. var a = new n.LoadingManager(t)
  46290. , s = new n.ImageLoader(a);
  46291. s.setCrossOrigin(this.crossOrigin);
  46292. for (var l = 0, c = e.length; l < c; l++) {
  46293. var h = e[l]
  46294. , u = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url) ? h.url : r.texturePath + h.url;
  46295. o[h.uuid] = i(u)
  46296. }
  46297. }
  46298. return o
  46299. },
  46300. parseTextures: function(e, t) {
  46301. function i(e) {
  46302. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  46303. n[e])
  46304. }
  46305. var r = {};
  46306. if (void 0 !== e)
  46307. for (var o = 0, a = e.length; o < a; o++) {
  46308. var s = e[o];
  46309. void 0 === s.image && console.warn('THREE.ObjectLoader: No "image" specified for', s.uuid),
  46310. void 0 === t[s.image] && console.warn("THREE.ObjectLoader: Undefined image", s.image);
  46311. var l = new n.Texture(t[s.image]);
  46312. l.needsUpdate = !0,
  46313. l.uuid = s.uuid,
  46314. void 0 !== s.name && (l.name = s.name),
  46315. void 0 !== s.mapping && (l.mapping = i(s.mapping)),
  46316. void 0 !== s.offset && (l.offset = new n.Vector2(s.offset[0],s.offset[1])),
  46317. void 0 !== s.repeat && (l.repeat = new n.Vector2(s.repeat[0],s.repeat[1])),
  46318. void 0 !== s.minFilter && (l.minFilter = i(s.minFilter)),
  46319. void 0 !== s.magFilter && (l.magFilter = i(s.magFilter)),
  46320. void 0 !== s.anisotropy && (l.anisotropy = s.anisotropy),
  46321. Array.isArray(s.wrap) && (l.wrapS = i(s.wrap[0]),
  46322. l.wrapT = i(s.wrap[1])),
  46323. r[s.uuid] = l
  46324. }
  46325. return r
  46326. },
  46327. parseObject: function() {
  46328. var e = new n.Matrix4;
  46329. return function(t, i, r) {
  46330. function o(e) {
  46331. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  46332. i[e]
  46333. }
  46334. function a(e) {
  46335. if (void 0 !== e)
  46336. return void 0 === r[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  46337. r[e]
  46338. }
  46339. var s;
  46340. switch (t.type) {
  46341. case "Scene":
  46342. s = new n.Scene;
  46343. break;
  46344. case "PerspectiveCamera":
  46345. s = new n.PerspectiveCamera(t.fov,t.aspect,t.near,t.far);
  46346. break;
  46347. case "OrthographicCamera":
  46348. s = new n.OrthographicCamera(t.left,t.right,t.top,t.bottom,t.near,t.far);
  46349. break;
  46350. case "AmbientLight":
  46351. s = new n.AmbientLight(t.color,t.intensity);
  46352. break;
  46353. case "DirectionalLight":
  46354. s = new n.DirectionalLight(t.color,t.intensity);
  46355. break;
  46356. case "PointLight":
  46357. s = new n.PointLight(t.color,t.intensity,t.distance,t.decay);
  46358. break;
  46359. case "SpotLight":
  46360. s = new n.SpotLight(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);
  46361. break;
  46362. case "HemisphereLight":
  46363. s = new n.HemisphereLight(t.color,t.groundColor,t.intensity);
  46364. break;
  46365. case "Mesh":
  46366. var l = o(t.geometry)
  46367. , c = a(t.material);
  46368. s = l.bones && l.bones.length > 0 ? new n.SkinnedMesh(l,c) : new n.Mesh(l,c);
  46369. break;
  46370. case "LOD":
  46371. s = new n.LOD;
  46372. break;
  46373. case "Line":
  46374. s = new n.Line(o(t.geometry),a(t.material),t.mode);
  46375. break;
  46376. case "PointCloud":
  46377. case "Points":
  46378. s = new n.Points(o(t.geometry),a(t.material));
  46379. break;
  46380. case "Sprite":
  46381. s = new n.Sprite(a(t.material));
  46382. break;
  46383. case "Group":
  46384. s = new n.Group;
  46385. break;
  46386. default:
  46387. s = new n.Object3D
  46388. }
  46389. if (s.uuid = t.uuid,
  46390. void 0 !== t.name && (s.name = t.name),
  46391. void 0 !== t.matrix ? (e.fromArray(t.matrix),
  46392. e.decompose(s.position, s.quaternion, s.scale)) : (void 0 !== t.position && s.position.fromArray(t.position),
  46393. void 0 !== t.rotation && s.rotation.fromArray(t.rotation),
  46394. void 0 !== t.scale && s.scale.fromArray(t.scale)),
  46395. void 0 !== t.castShadow && (s.castShadow = t.castShadow),
  46396. void 0 !== t.receiveShadow && (s.receiveShadow = t.receiveShadow),
  46397. void 0 !== t.visible && (s.visible = t.visible),
  46398. void 0 !== t.userData && (s.userData = t.userData),
  46399. void 0 !== t.children)
  46400. for (var h in t.children)
  46401. s.add(this.parseObject(t.children[h], i, r));
  46402. if ("LOD" === t.type)
  46403. for (var u = t.levels, d = 0; d < u.length; d++) {
  46404. var p = u[d]
  46405. , h = s.getObjectByProperty("uuid", p.object);
  46406. void 0 !== h && s.addLevel(h, p.distance)
  46407. }
  46408. return s
  46409. }
  46410. }()
  46411. },
  46412. n.TextureLoader = function(e) {
  46413. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  46414. }
  46415. ,
  46416. n.TextureLoader.prototype = {
  46417. constructor: n.TextureLoader,
  46418. load: function(e, t, i, r) {
  46419. var o = new n.Texture
  46420. , a = new n.ImageLoader(this.manager);
  46421. return a.setCrossOrigin(this.crossOrigin),
  46422. a.setPath(this.path),
  46423. a.load(e, function(e) {
  46424. o.image = e,
  46425. o.needsUpdate = !0,
  46426. void 0 !== t && t(o)
  46427. }, i, r),
  46428. o
  46429. },
  46430. setCrossOrigin: function(e) {
  46431. this.crossOrigin = e
  46432. },
  46433. setPath: function(e) {
  46434. this.path = e
  46435. }
  46436. },
  46437. n.CubeTextureLoader = function(e) {
  46438. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  46439. }
  46440. ,
  46441. n.CubeTextureLoader.prototype = {
  46442. constructor: n.CubeTextureLoader,
  46443. load: function(e, t, i, r) {
  46444. function o(i) {
  46445. s.load(e[i], function(e) {
  46446. a.images[i] = e,
  46447. l++,
  46448. 6 === l && (a.needsUpdate = !0,
  46449. t && t(a))
  46450. }, void 0, r)
  46451. }
  46452. var a = new n.CubeTexture
  46453. , s = new n.ImageLoader(this.manager);
  46454. s.setCrossOrigin(this.crossOrigin),
  46455. s.setPath(this.path);
  46456. for (var l = 0, c = 0; c < e.length; ++c)
  46457. o(c);
  46458. return a
  46459. },
  46460. setCrossOrigin: function(e) {
  46461. this.crossOrigin = e
  46462. },
  46463. setPath: function(e) {
  46464. this.path = e
  46465. }
  46466. },
  46467. n.DataTextureLoader = n.BinaryTextureLoader = function(e) {
  46468. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  46469. this._parser = null
  46470. }
  46471. ,
  46472. n.BinaryTextureLoader.prototype = {
  46473. constructor: n.BinaryTextureLoader,
  46474. load: function(e, t, i, r) {
  46475. var o = this
  46476. , a = new n.DataTexture
  46477. , s = new n.XHRLoader(this.manager);
  46478. return s.setResponseType("arraybuffer"),
  46479. s.load(e, function(e) {
  46480. var i = o._parser(e);
  46481. i && (void 0 !== i.image ? a.image = i.image : void 0 !== i.data && (a.image.width = i.width,
  46482. a.image.height = i.height,
  46483. a.image.data = i.data),
  46484. a.wrapS = void 0 !== i.wrapS ? i.wrapS : n.ClampToEdgeWrapping,
  46485. a.wrapT = void 0 !== i.wrapT ? i.wrapT : n.ClampToEdgeWrapping,
  46486. a.magFilter = void 0 !== i.magFilter ? i.magFilter : n.LinearFilter,
  46487. a.minFilter = void 0 !== i.minFilter ? i.minFilter : n.LinearMipMapLinearFilter,
  46488. a.anisotropy = void 0 !== i.anisotropy ? i.anisotropy : 1,
  46489. void 0 !== i.format && (a.format = i.format),
  46490. void 0 !== i.type && (a.type = i.type),
  46491. void 0 !== i.mipmaps && (a.mipmaps = i.mipmaps),
  46492. 1 === i.mipmapCount && (a.minFilter = n.LinearFilter),
  46493. a.needsUpdate = !0,
  46494. t && t(a, i))
  46495. }, i, r),
  46496. a
  46497. }
  46498. },
  46499. n.CompressedTextureLoader = function(e) {
  46500. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  46501. this._parser = null
  46502. }
  46503. ;
  46504. n.CompressedTextureLoader.prototype = {
  46505. constructor: n.CompressedTextureLoader,
  46506. load: function(e, t, i, r) {
  46507. function o(o) {
  46508. c.load(e[o], function(e) {
  46509. var i = a._parser(e, !0);
  46510. s[o] = {
  46511. width: i.width,
  46512. height: i.height,
  46513. format: i.format,
  46514. mipmaps: i.mipmaps
  46515. },
  46516. h += 1,
  46517. 6 === h && (1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  46518. l.format = i.format,
  46519. l.needsUpdate = !0,
  46520. t && t(l))
  46521. }, i, r)
  46522. }
  46523. var a = this
  46524. , s = []
  46525. , l = new n.CompressedTexture;
  46526. l.image = s;
  46527. var c = new n.XHRLoader(this.manager);
  46528. if (c.setPath(this.path),
  46529. c.setResponseType("arraybuffer"),
  46530. Array.isArray(e))
  46531. for (var h = 0, u = 0, d = e.length; u < d; ++u)
  46532. o(u);
  46533. else
  46534. c.load(e, function(e) {
  46535. var i = a._parser(e, !0);
  46536. if (i.isCubemap)
  46537. for (var r = i.mipmaps.length / i.mipmapCount, o = 0; o < r; o++) {
  46538. s[o] = {
  46539. mipmaps: []
  46540. };
  46541. for (var c = 0; c < i.mipmapCount; c++)
  46542. s[o].mipmaps.push(i.mipmaps[o * i.mipmapCount + c]),
  46543. s[o].format = i.format,
  46544. s[o].width = i.width,
  46545. s[o].height = i.height
  46546. }
  46547. else
  46548. l.image.width = i.width,
  46549. l.image.height = i.height,
  46550. l.mipmaps = i.mipmaps;
  46551. 1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  46552. l.format = i.format,
  46553. l.needsUpdate = !0,
  46554. t && t(l)
  46555. }, i, r);
  46556. return l
  46557. },
  46558. setPath: function(e) {
  46559. this.path = e
  46560. }
  46561. };
  46562. n.Material = function() {
  46563. Object.defineProperty(this, "id", {
  46564. value: n.MaterialIdCount++
  46565. }),
  46566. this.uuid = n.Math.generateUUID(),
  46567. this.name = "",
  46568. this.type = "Material",
  46569. this.side = n.FrontSide,
  46570. this.opacity = 1,
  46571. this.transparent = !1,
  46572. this.blending = n.NormalBlending,
  46573. this.blendSrc = n.SrcAlphaFactor,
  46574. this.blendDst = n.OneMinusSrcAlphaFactor,
  46575. this.blendEquation = n.AddEquation,
  46576. this.blendSrcAlpha = null,
  46577. this.blendDstAlpha = null,
  46578. this.blendEquationAlpha = null,
  46579. this.depthFunc = n.LessEqualDepth,
  46580. this.depthTest = !0,
  46581. this.depthWrite = !0,
  46582. this.colorWrite = !0,
  46583. this.precision = null,
  46584. this.polygonOffset = !1,
  46585. this.polygonOffsetFactor = 0,
  46586. this.polygonOffsetUnits = 0,
  46587. this.alphaTest = 0,
  46588. this.premultipliedAlpha = !1,
  46589. this.overdraw = 0,
  46590. this.visible = !0,
  46591. this._needsUpdate = !0
  46592. }
  46593. ,
  46594. n.Material.prototype = {
  46595. constructor: n.Material,
  46596. get needsUpdate() {
  46597. return this._needsUpdate
  46598. },
  46599. set needsUpdate(e) {
  46600. e === !0 && this.update(),
  46601. this._needsUpdate = e
  46602. },
  46603. setValues: function(e) {
  46604. if (void 0 !== e)
  46605. for (var t in e) {
  46606. var i = e[t];
  46607. if (void 0 !== i) {
  46608. var r = this[t];
  46609. 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.")
  46610. } else
  46611. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  46612. }
  46613. },
  46614. toJSON: function(e) {
  46615. function t(e) {
  46616. var t = [];
  46617. for (var i in e) {
  46618. var n = e[i];
  46619. delete n.metadata,
  46620. t.push(n)
  46621. }
  46622. return t
  46623. }
  46624. var i = void 0 === e;
  46625. i && (e = {
  46626. textures: {},
  46627. images: {}
  46628. });
  46629. var r = {
  46630. metadata: {
  46631. version: 4.4,
  46632. type: "Material",
  46633. generator: "Material.toJSON"
  46634. }
  46635. };
  46636. if (r.uuid = this.uuid,
  46637. r.type = this.type,
  46638. "" !== this.name && (r.name = this.name),
  46639. this.color instanceof n.Color && (r.color = this.color.getHex()),
  46640. .5 !== this.roughness && (r.roughness = this.roughness),
  46641. .5 !== this.metalness && (r.metalness = this.metalness),
  46642. this.emissive instanceof n.Color && (r.emissive = this.emissive.getHex()),
  46643. this.specular instanceof n.Color && (r.specular = this.specular.getHex()),
  46644. void 0 !== this.shininess && (r.shininess = this.shininess),
  46645. this.map instanceof n.Texture && (r.map = this.map.toJSON(e).uuid),
  46646. this.alphaMap instanceof n.Texture && (r.alphaMap = this.alphaMap.toJSON(e).uuid),
  46647. this.lightMap instanceof n.Texture && (r.lightMap = this.lightMap.toJSON(e).uuid),
  46648. this.bumpMap instanceof n.Texture && (r.bumpMap = this.bumpMap.toJSON(e).uuid,
  46649. r.bumpScale = this.bumpScale),
  46650. this.normalMap instanceof n.Texture && (r.normalMap = this.normalMap.toJSON(e).uuid,
  46651. r.normalScale = this.normalScale.toArray()),
  46652. this.displacementMap instanceof n.Texture && (r.displacementMap = this.displacementMap.toJSON(e).uuid,
  46653. r.displacementScale = this.displacementScale,
  46654. r.displacementBias = this.displacementBias),
  46655. this.roughnessMap instanceof n.Texture && (r.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  46656. this.metalnessMap instanceof n.Texture && (r.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  46657. this.emissiveMap instanceof n.Texture && (r.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  46658. this.specularMap instanceof n.Texture && (r.specularMap = this.specularMap.toJSON(e).uuid),
  46659. this.envMap instanceof n.Texture && (r.envMap = this.envMap.toJSON(e).uuid,
  46660. r.reflectivity = this.reflectivity),
  46661. void 0 !== this.size && (r.size = this.size),
  46662. void 0 !== this.sizeAttenuation && (r.sizeAttenuation = this.sizeAttenuation),
  46663. void 0 !== this.vertexColors && this.vertexColors !== n.NoColors && (r.vertexColors = this.vertexColors),
  46664. void 0 !== this.shading && this.shading !== n.SmoothShading && (r.shading = this.shading),
  46665. void 0 !== this.blending && this.blending !== n.NormalBlending && (r.blending = this.blending),
  46666. void 0 !== this.side && this.side !== n.FrontSide && (r.side = this.side),
  46667. this.opacity < 1 && (r.opacity = this.opacity),
  46668. this.transparent === !0 && (r.transparent = this.transparent),
  46669. this.alphaTest > 0 && (r.alphaTest = this.alphaTest),
  46670. this.premultipliedAlpha === !0 && (r.premultipliedAlpha = this.premultipliedAlpha),
  46671. this.wireframe === !0 && (r.wireframe = this.wireframe),
  46672. this.wireframeLinewidth > 1 && (r.wireframeLinewidth = this.wireframeLinewidth),
  46673. i) {
  46674. var o = t(e.textures)
  46675. , a = t(e.images);
  46676. o.length > 0 && (r.textures = o),
  46677. a.length > 0 && (r.images = a)
  46678. }
  46679. return r
  46680. },
  46681. clone: function() {
  46682. return (new this.constructor).copy(this)
  46683. },
  46684. copy: function(e) {
  46685. return this.name = e.name,
  46686. this.side = e.side,
  46687. this.opacity = e.opacity,
  46688. this.transparent = e.transparent,
  46689. this.blending = e.blending,
  46690. this.blendSrc = e.blendSrc,
  46691. this.blendDst = e.blendDst,
  46692. this.blendEquation = e.blendEquation,
  46693. this.blendSrcAlpha = e.blendSrcAlpha,
  46694. this.blendDstAlpha = e.blendDstAlpha,
  46695. this.blendEquationAlpha = e.blendEquationAlpha,
  46696. this.depthFunc = e.depthFunc,
  46697. this.depthTest = e.depthTest,
  46698. this.depthWrite = e.depthWrite,
  46699. this.colorWrite = e.colorWrite,
  46700. this.precision = e.precision,
  46701. this.polygonOffset = e.polygonOffset,
  46702. this.polygonOffsetFactor = e.polygonOffsetFactor,
  46703. this.polygonOffsetUnits = e.polygonOffsetUnits,
  46704. this.alphaTest = e.alphaTest,
  46705. this.premultipliedAlpha = e.premultipliedAlpha,
  46706. this.overdraw = e.overdraw,
  46707. this.visible = e.visible,
  46708. this
  46709. },
  46710. update: function() {
  46711. this.dispatchEvent({
  46712. type: "update"
  46713. })
  46714. },
  46715. dispose: function() {
  46716. this.dispatchEvent({
  46717. type: "dispose"
  46718. })
  46719. }
  46720. },
  46721. n.EventDispatcher.prototype.apply(n.Material.prototype),
  46722. n.MaterialIdCount = 0,
  46723. n.LineBasicMaterial = function(e) {
  46724. n.Material.call(this),
  46725. this.type = "LineBasicMaterial",
  46726. this.color = new n.Color(16777215),
  46727. this.linewidth = 1,
  46728. this.linecap = "round",
  46729. this.linejoin = "round",
  46730. this.blending = n.NormalBlending,
  46731. this.vertexColors = n.NoColors,
  46732. this.fog = !0,
  46733. this.setValues(e)
  46734. }
  46735. ,
  46736. n.LineBasicMaterial.prototype = Object.create(n.Material.prototype),
  46737. n.LineBasicMaterial.prototype.constructor = n.LineBasicMaterial,
  46738. n.LineBasicMaterial.prototype.copy = function(e) {
  46739. return n.Material.prototype.copy.call(this, e),
  46740. this.color.copy(e.color),
  46741. this.linewidth = e.linewidth,
  46742. this.linecap = e.linecap,
  46743. this.linejoin = e.linejoin,
  46744. this.vertexColors = e.vertexColors,
  46745. this.fog = e.fog,
  46746. this
  46747. }
  46748. ,
  46749. n.LineDashedMaterial = function(e) {
  46750. n.Material.call(this),
  46751. this.type = "LineDashedMaterial",
  46752. this.color = new n.Color(16777215),
  46753. this.linewidth = 1,
  46754. this.scale = 1,
  46755. this.dashSize = 3,
  46756. this.gapSize = 1,
  46757. this.blending = n.NormalBlending,
  46758. this.vertexColors = n.NoColors,
  46759. this.fog = !0,
  46760. this.setValues(e)
  46761. }
  46762. ,
  46763. n.LineDashedMaterial.prototype = Object.create(n.Material.prototype),
  46764. n.LineDashedMaterial.prototype.constructor = n.LineDashedMaterial,
  46765. n.LineDashedMaterial.prototype.copy = function(e) {
  46766. return n.Material.prototype.copy.call(this, e),
  46767. this.color.copy(e.color),
  46768. this.linewidth = e.linewidth,
  46769. this.scale = e.scale,
  46770. this.dashSize = e.dashSize,
  46771. this.gapSize = e.gapSize,
  46772. this.vertexColors = e.vertexColors,
  46773. this.fog = e.fog,
  46774. this
  46775. }
  46776. ,
  46777. n.MeshBasicMaterial = function(e) {
  46778. n.Material.call(this),
  46779. this.type = "MeshBasicMaterial",
  46780. this.color = new n.Color(16777215),
  46781. this.map = null,
  46782. this.aoMap = null,
  46783. this.aoMapIntensity = 1,
  46784. this.specularMap = null,
  46785. this.alphaMap = null,
  46786. this.envMap = null,
  46787. this.combine = n.MultiplyOperation,
  46788. this.reflectivity = 1,
  46789. this.refractionRatio = .98,
  46790. this.fog = !0,
  46791. this.shading = n.SmoothShading,
  46792. this.blending = n.NormalBlending,
  46793. this.wireframe = !1,
  46794. this.wireframeLinewidth = 1,
  46795. this.wireframeLinecap = "round",
  46796. this.wireframeLinejoin = "round",
  46797. this.vertexColors = n.NoColors,
  46798. this.skinning = !1,
  46799. this.morphTargets = !1,
  46800. this.setValues(e)
  46801. }
  46802. ,
  46803. n.MeshBasicMaterial.prototype = Object.create(n.Material.prototype),
  46804. n.MeshBasicMaterial.prototype.constructor = n.MeshBasicMaterial,
  46805. n.MeshBasicMaterial.prototype.copy = function(e) {
  46806. return n.Material.prototype.copy.call(this, e),
  46807. this.color.copy(e.color),
  46808. this.map = e.map,
  46809. this.aoMap = e.aoMap,
  46810. this.aoMapIntensity = e.aoMapIntensity,
  46811. this.specularMap = e.specularMap,
  46812. this.alphaMap = e.alphaMap,
  46813. this.envMap = e.envMap,
  46814. this.combine = e.combine,
  46815. this.reflectivity = e.reflectivity,
  46816. this.refractionRatio = e.refractionRatio,
  46817. this.fog = e.fog,
  46818. this.shading = e.shading,
  46819. this.wireframe = e.wireframe,
  46820. this.wireframeLinewidth = e.wireframeLinewidth,
  46821. this.wireframeLinecap = e.wireframeLinecap,
  46822. this.wireframeLinejoin = e.wireframeLinejoin,
  46823. this.vertexColors = e.vertexColors,
  46824. this.skinning = e.skinning,
  46825. this.morphTargets = e.morphTargets,
  46826. this
  46827. }
  46828. ,
  46829. n.MeshLambertMaterial = function(e) {
  46830. n.Material.call(this),
  46831. this.type = "MeshLambertMaterial",
  46832. this.color = new n.Color(16777215),
  46833. this.map = null,
  46834. this.lightMap = null,
  46835. this.lightMapIntensity = 1,
  46836. this.aoMap = null,
  46837. this.aoMapIntensity = 1,
  46838. this.emissive = new n.Color(0),
  46839. this.emissiveIntensity = 1,
  46840. this.emissiveMap = null,
  46841. this.specularMap = null,
  46842. this.alphaMap = null,
  46843. this.envMap = null,
  46844. this.combine = n.MultiplyOperation,
  46845. this.reflectivity = 1,
  46846. this.refractionRatio = .98,
  46847. this.fog = !0,
  46848. this.blending = n.NormalBlending,
  46849. this.wireframe = !1,
  46850. this.wireframeLinewidth = 1,
  46851. this.wireframeLinecap = "round",
  46852. this.wireframeLinejoin = "round",
  46853. this.vertexColors = n.NoColors,
  46854. this.skinning = !1,
  46855. this.morphTargets = !1,
  46856. this.morphNormals = !1,
  46857. this.setValues(e)
  46858. }
  46859. ,
  46860. n.MeshLambertMaterial.prototype = Object.create(n.Material.prototype),
  46861. n.MeshLambertMaterial.prototype.constructor = n.MeshLambertMaterial,
  46862. n.MeshLambertMaterial.prototype.copy = function(e) {
  46863. return n.Material.prototype.copy.call(this, e),
  46864. this.color.copy(e.color),
  46865. this.map = e.map,
  46866. this.lightMap = e.lightMap,
  46867. this.lightMapIntensity = e.lightMapIntensity,
  46868. this.aoMap = e.aoMap,
  46869. this.aoMapIntensity = e.aoMapIntensity,
  46870. this.emissive.copy(e.emissive),
  46871. this.emissiveMap = e.emissiveMap,
  46872. this.emissiveIntensity = e.emissiveIntensity,
  46873. this.specularMap = e.specularMap,
  46874. this.alphaMap = e.alphaMap,
  46875. this.envMap = e.envMap,
  46876. this.combine = e.combine,
  46877. this.reflectivity = e.reflectivity,
  46878. this.refractionRatio = e.refractionRatio,
  46879. this.fog = e.fog,
  46880. this.wireframe = e.wireframe,
  46881. this.wireframeLinewidth = e.wireframeLinewidth,
  46882. this.wireframeLinecap = e.wireframeLinecap,
  46883. this.wireframeLinejoin = e.wireframeLinejoin,
  46884. this.vertexColors = e.vertexColors,
  46885. this.skinning = e.skinning,
  46886. this.morphTargets = e.morphTargets,
  46887. this.morphNormals = e.morphNormals,
  46888. this
  46889. }
  46890. ,
  46891. n.MeshPhongMaterial = function(e) {
  46892. n.Material.call(this),
  46893. this.type = "MeshPhongMaterial",
  46894. this.color = new n.Color(16777215),
  46895. this.specular = new n.Color(1118481),
  46896. this.shininess = 30,
  46897. this.map = null,
  46898. this.lightMap = null,
  46899. this.lightMapIntensity = 1,
  46900. this.aoMap = null,
  46901. this.aoMapIntensity = 1,
  46902. this.emissive = new n.Color(0),
  46903. this.emissiveIntensity = 1,
  46904. this.emissiveMap = null,
  46905. this.bumpMap = null,
  46906. this.bumpScale = 1,
  46907. this.normalMap = null,
  46908. this.normalScale = new n.Vector2(1,1),
  46909. this.displacementMap = null,
  46910. this.displacementScale = 1,
  46911. this.displacementBias = 0,
  46912. this.specularMap = null,
  46913. this.alphaMap = null,
  46914. this.envMap = null,
  46915. this.combine = n.MultiplyOperation,
  46916. this.reflectivity = 1,
  46917. this.refractionRatio = .98,
  46918. this.fog = !0,
  46919. this.shading = n.SmoothShading,
  46920. this.blending = n.NormalBlending,
  46921. this.wireframe = !1,
  46922. this.wireframeLinewidth = 1,
  46923. this.wireframeLinecap = "round",
  46924. this.wireframeLinejoin = "round",
  46925. this.vertexColors = n.NoColors,
  46926. this.skinning = !1,
  46927. this.morphTargets = !1,
  46928. this.morphNormals = !1,
  46929. this.setValues(e)
  46930. }
  46931. ,
  46932. n.MeshPhongMaterial.prototype = Object.create(n.Material.prototype),
  46933. n.MeshPhongMaterial.prototype.constructor = n.MeshPhongMaterial,
  46934. n.MeshPhongMaterial.prototype.copy = function(e) {
  46935. return n.Material.prototype.copy.call(this, e),
  46936. this.color.copy(e.color),
  46937. this.specular.copy(e.specular),
  46938. this.shininess = e.shininess,
  46939. this.map = e.map,
  46940. this.lightMap = e.lightMap,
  46941. this.lightMapIntensity = e.lightMapIntensity,
  46942. this.aoMap = e.aoMap,
  46943. this.aoMapIntensity = e.aoMapIntensity,
  46944. this.emissive.copy(e.emissive),
  46945. this.emissiveMap = e.emissiveMap,
  46946. this.emissiveIntensity = e.emissiveIntensity,
  46947. this.bumpMap = e.bumpMap,
  46948. this.bumpScale = e.bumpScale,
  46949. this.normalMap = e.normalMap,
  46950. this.normalScale.copy(e.normalScale),
  46951. this.displacementMap = e.displacementMap,
  46952. this.displacementScale = e.displacementScale,
  46953. this.displacementBias = e.displacementBias,
  46954. this.specularMap = e.specularMap,
  46955. this.alphaMap = e.alphaMap,
  46956. this.envMap = e.envMap,
  46957. this.combine = e.combine,
  46958. this.reflectivity = e.reflectivity,
  46959. this.refractionRatio = e.refractionRatio,
  46960. this.fog = e.fog,
  46961. this.shading = e.shading,
  46962. this.wireframe = e.wireframe,
  46963. this.wireframeLinewidth = e.wireframeLinewidth,
  46964. this.wireframeLinecap = e.wireframeLinecap,
  46965. this.wireframeLinejoin = e.wireframeLinejoin,
  46966. this.vertexColors = e.vertexColors,
  46967. this.skinning = e.skinning,
  46968. this.morphTargets = e.morphTargets,
  46969. this.morphNormals = e.morphNormals,
  46970. this
  46971. }
  46972. ,
  46973. n.MeshStandardMaterial = function(e) {
  46974. n.Material.call(this),
  46975. this.type = "MeshStandardMaterial",
  46976. this.color = new n.Color(16777215),
  46977. this.roughness = .5,
  46978. this.metalness = .5,
  46979. this.map = null,
  46980. this.lightMap = null,
  46981. this.lightMapIntensity = 1,
  46982. this.aoMap = null,
  46983. this.aoMapIntensity = 1,
  46984. this.emissive = new n.Color(0),
  46985. this.emissiveIntensity = 1,
  46986. this.emissiveMap = null,
  46987. this.bumpMap = null,
  46988. this.bumpScale = 1,
  46989. this.normalMap = null,
  46990. this.normalScale = new n.Vector2(1,1),
  46991. this.displacementMap = null,
  46992. this.displacementScale = 1,
  46993. this.displacementBias = 0,
  46994. this.roughnessMap = null,
  46995. this.metalnessMap = null,
  46996. this.alphaMap = null,
  46997. this.envMap = null,
  46998. this.envMapIntensity = 1,
  46999. this.refractionRatio = .98,
  47000. this.fog = !0,
  47001. this.shading = n.SmoothShading,
  47002. this.blending = n.NormalBlending,
  47003. this.wireframe = !1,
  47004. this.wireframeLinewidth = 1,
  47005. this.wireframeLinecap = "round",
  47006. this.wireframeLinejoin = "round",
  47007. this.vertexColors = n.NoColors,
  47008. this.skinning = !1,
  47009. this.morphTargets = !1,
  47010. this.morphNormals = !1,
  47011. this.setValues(e)
  47012. }
  47013. ,
  47014. n.MeshStandardMaterial.prototype = Object.create(n.Material.prototype),
  47015. n.MeshStandardMaterial.prototype.constructor = n.MeshStandardMaterial,
  47016. n.MeshStandardMaterial.prototype.copy = function(e) {
  47017. return n.Material.prototype.copy.call(this, e),
  47018. this.color.copy(e.color),
  47019. this.roughness = e.roughness,
  47020. this.metalness = e.metalness,
  47021. this.map = e.map,
  47022. this.lightMap = e.lightMap,
  47023. this.lightMapIntensity = e.lightMapIntensity,
  47024. this.aoMap = e.aoMap,
  47025. this.aoMapIntensity = e.aoMapIntensity,
  47026. this.emissive.copy(e.emissive),
  47027. this.emissiveMap = e.emissiveMap,
  47028. this.emissiveIntensity = e.emissiveIntensity,
  47029. this.bumpMap = e.bumpMap,
  47030. this.bumpScale = e.bumpScale,
  47031. this.normalMap = e.normalMap,
  47032. this.normalScale.copy(e.normalScale),
  47033. this.displacementMap = e.displacementMap,
  47034. this.displacementScale = e.displacementScale,
  47035. this.displacementBias = e.displacementBias,
  47036. this.roughnessMap = e.roughnessMap,
  47037. this.metalnessMap = e.metalnessMap,
  47038. this.alphaMap = e.alphaMap,
  47039. this.envMap = e.envMap,
  47040. this.envMapIntensity = e.envMapIntensity,
  47041. this.refractionRatio = e.refractionRatio,
  47042. this.fog = e.fog,
  47043. this.shading = e.shading,
  47044. this.wireframe = e.wireframe,
  47045. this.wireframeLinewidth = e.wireframeLinewidth,
  47046. this.wireframeLinecap = e.wireframeLinecap,
  47047. this.wireframeLinejoin = e.wireframeLinejoin,
  47048. this.vertexColors = e.vertexColors,
  47049. this.skinning = e.skinning,
  47050. this.morphTargets = e.morphTargets,
  47051. this.morphNormals = e.morphNormals,
  47052. this
  47053. }
  47054. ,
  47055. n.MeshDepthMaterial = function(e) {
  47056. n.Material.call(this),
  47057. this.type = "MeshDepthMaterial",
  47058. this.morphTargets = !1,
  47059. this.wireframe = !1,
  47060. this.wireframeLinewidth = 1,
  47061. this.setValues(e)
  47062. }
  47063. ,
  47064. n.MeshDepthMaterial.prototype = Object.create(n.Material.prototype),
  47065. n.MeshDepthMaterial.prototype.constructor = n.MeshDepthMaterial,
  47066. n.MeshDepthMaterial.prototype.copy = function(e) {
  47067. return n.Material.prototype.copy.call(this, e),
  47068. this.wireframe = e.wireframe,
  47069. this.wireframeLinewidth = e.wireframeLinewidth,
  47070. this
  47071. }
  47072. ,
  47073. n.MeshNormalMaterial = function(e) {
  47074. n.Material.call(this, e),
  47075. this.type = "MeshNormalMaterial",
  47076. this.wireframe = !1,
  47077. this.wireframeLinewidth = 1,
  47078. this.morphTargets = !1,
  47079. this.setValues(e)
  47080. }
  47081. ,
  47082. n.MeshNormalMaterial.prototype = Object.create(n.Material.prototype),
  47083. n.MeshNormalMaterial.prototype.constructor = n.MeshNormalMaterial,
  47084. n.MeshNormalMaterial.prototype.copy = function(e) {
  47085. return n.Material.prototype.copy.call(this, e),
  47086. this.wireframe = e.wireframe,
  47087. this.wireframeLinewidth = e.wireframeLinewidth,
  47088. this
  47089. }
  47090. ,
  47091. n.MultiMaterial = function(e) {
  47092. this.uuid = n.Math.generateUUID(),
  47093. this.type = "MultiMaterial",
  47094. this.materials = e instanceof Array ? e : [],
  47095. this.visible = !0
  47096. }
  47097. ,
  47098. n.MultiMaterial.prototype = {
  47099. constructor: n.MultiMaterial,
  47100. toJSON: function(e) {
  47101. for (var t = {
  47102. metadata: {
  47103. version: 4.2,
  47104. type: "material",
  47105. generator: "MaterialExporter"
  47106. },
  47107. uuid: this.uuid,
  47108. type: this.type,
  47109. materials: []
  47110. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  47111. var o = i[n].toJSON(e);
  47112. delete o.metadata,
  47113. t.materials.push(o)
  47114. }
  47115. return t.visible = this.visible,
  47116. t
  47117. },
  47118. clone: function() {
  47119. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  47120. e.materials.push(this.materials[t].clone());
  47121. return e.visible = this.visible,
  47122. e
  47123. }
  47124. },
  47125. n.PointsMaterial = function(e) {
  47126. n.Material.call(this),
  47127. this.type = "PointsMaterial",
  47128. this.color = new n.Color(16777215),
  47129. this.map = null,
  47130. this.size = 1,
  47131. this.sizeAttenuation = !0,
  47132. this.blending = n.NormalBlending,
  47133. this.vertexColors = n.NoColors,
  47134. this.fog = !0,
  47135. this.setValues(e)
  47136. }
  47137. ,
  47138. n.PointsMaterial.prototype = Object.create(n.Material.prototype),
  47139. n.PointsMaterial.prototype.constructor = n.PointsMaterial,
  47140. n.PointsMaterial.prototype.copy = function(e) {
  47141. return n.Material.prototype.copy.call(this, e),
  47142. this.color.copy(e.color),
  47143. this.map = e.map,
  47144. this.size = e.size,
  47145. this.sizeAttenuation = e.sizeAttenuation,
  47146. this.vertexColors = e.vertexColors,
  47147. this.fog = e.fog,
  47148. this
  47149. }
  47150. ,
  47151. n.ShaderMaterial = function(e) {
  47152. n.Material.call(this),
  47153. this.type = "ShaderMaterial",
  47154. this.defines = {},
  47155. this.uniforms = {},
  47156. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  47157. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  47158. this.shading = n.SmoothShading,
  47159. this.linewidth = 1,
  47160. this.wireframe = !1,
  47161. this.wireframeLinewidth = 1,
  47162. this.fog = !1,
  47163. this.lights = !1,
  47164. this.vertexColors = n.NoColors,
  47165. this.skinning = !1,
  47166. this.morphTargets = !1,
  47167. this.morphNormals = !1,
  47168. this.extensions = {
  47169. derivatives: !1,
  47170. fragDepth: !1,
  47171. drawBuffers: !1,
  47172. shaderTextureLOD: !1
  47173. },
  47174. this.defaultAttributeValues = {
  47175. color: [1, 1, 1],
  47176. uv: [0, 0],
  47177. uv2: [0, 0]
  47178. },
  47179. this.index0AttributeName = void 0,
  47180. void 0 !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  47181. this.setValues(e))
  47182. }
  47183. ,
  47184. n.ShaderMaterial.prototype = Object.create(n.Material.prototype),
  47185. n.ShaderMaterial.prototype.constructor = n.ShaderMaterial,
  47186. n.ShaderMaterial.prototype.copy = function(e) {
  47187. return n.Material.prototype.copy.call(this, e),
  47188. this.fragmentShader = e.fragmentShader,
  47189. this.vertexShader = e.vertexShader,
  47190. this.uniforms = n.UniformsUtils.clone(e.uniforms),
  47191. this.defines = e.defines,
  47192. this.shading = e.shading,
  47193. this.wireframe = e.wireframe,
  47194. this.wireframeLinewidth = e.wireframeLinewidth,
  47195. this.fog = e.fog,
  47196. this.lights = e.lights,
  47197. this.vertexColors = e.vertexColors,
  47198. this.skinning = e.skinning,
  47199. this.morphTargets = e.morphTargets,
  47200. this.morphNormals = e.morphNormals,
  47201. this.extensions = e.extensions,
  47202. this
  47203. }
  47204. ,
  47205. n.ShaderMaterial.prototype.toJSON = function(e) {
  47206. var t = n.Material.prototype.toJSON.call(this, e);
  47207. return t.uniforms = this.uniforms,
  47208. t.vertexShader = this.vertexShader,
  47209. t.fragmentShader = this.fragmentShader,
  47210. t
  47211. }
  47212. ,
  47213. n.RawShaderMaterial = function(e) {
  47214. n.ShaderMaterial.call(this, e),
  47215. this.type = "RawShaderMaterial"
  47216. }
  47217. ,
  47218. n.RawShaderMaterial.prototype = Object.create(n.ShaderMaterial.prototype),
  47219. n.RawShaderMaterial.prototype.constructor = n.RawShaderMaterial,
  47220. n.SpriteMaterial = function(e) {
  47221. n.Material.call(this),
  47222. this.type = "SpriteMaterial",
  47223. this.color = new n.Color(16777215),
  47224. this.map = null,
  47225. this.rotation = 0,
  47226. this.fog = !1,
  47227. this.setValues(e)
  47228. }
  47229. ,
  47230. n.SpriteMaterial.prototype = Object.create(n.Material.prototype),
  47231. n.SpriteMaterial.prototype.constructor = n.SpriteMaterial,
  47232. n.SpriteMaterial.prototype.copy = function(e) {
  47233. return n.Material.prototype.copy.call(this, e),
  47234. this.color.copy(e.color),
  47235. this.map = e.map,
  47236. this.rotation = e.rotation,
  47237. this.fog = e.fog,
  47238. this
  47239. }
  47240. ,
  47241. n.Texture = function(e, t, i, r, o, a, s, l, c) {
  47242. Object.defineProperty(this, "id", {
  47243. value: n.TextureIdCount++
  47244. }),
  47245. this.uuid = n.Math.generateUUID(),
  47246. this.name = "",
  47247. this.sourceFile = "",
  47248. this.image = void 0 !== e ? e : n.Texture.DEFAULT_IMAGE,
  47249. this.mipmaps = [],
  47250. this.mapping = void 0 !== t ? t : n.Texture.DEFAULT_MAPPING,
  47251. this.wrapS = void 0 !== i ? i : n.ClampToEdgeWrapping,
  47252. this.wrapT = void 0 !== r ? r : n.ClampToEdgeWrapping,
  47253. this.magFilter = void 0 !== o ? o : n.LinearFilter,
  47254. this.minFilter = void 0 !== a ? a : n.LinearMipMapLinearFilter,
  47255. this.anisotropy = void 0 !== c ? c : 1,
  47256. this.format = void 0 !== s ? s : n.RGBAFormat,
  47257. this.type = void 0 !== l ? l : n.UnsignedByteType,
  47258. this.offset = new n.Vector2(0,0),
  47259. this.repeat = new n.Vector2(1,1),
  47260. this.generateMipmaps = !0,
  47261. this.premultiplyAlpha = !1,
  47262. this.flipY = !0,
  47263. this.unpackAlignment = 4,
  47264. this.encoding = n.LinearEncoding,
  47265. this.version = 0,
  47266. this.onUpdate = null
  47267. }
  47268. ,
  47269. n.Texture.DEFAULT_IMAGE = void 0,
  47270. n.Texture.DEFAULT_MAPPING = n.UVMapping,
  47271. n.Texture.prototype = {
  47272. constructor: n.Texture,
  47273. set needsUpdate(e) {
  47274. e === !0 && this.version++
  47275. },
  47276. clone: function() {
  47277. return (new this.constructor).copy(this)
  47278. },
  47279. copy: function(e) {
  47280. return this.image = e.image,
  47281. this.mipmaps = e.mipmaps.slice(0),
  47282. this.mapping = e.mapping,
  47283. this.wrapS = e.wrapS,
  47284. this.wrapT = e.wrapT,
  47285. this.magFilter = e.magFilter,
  47286. this.minFilter = e.minFilter,
  47287. this.anisotropy = e.anisotropy,
  47288. this.format = e.format,
  47289. this.type = e.type,
  47290. this.offset.copy(e.offset),
  47291. this.repeat.copy(e.repeat),
  47292. this.generateMipmaps = e.generateMipmaps,
  47293. this.premultiplyAlpha = e.premultiplyAlpha,
  47294. this.flipY = e.flipY,
  47295. this.unpackAlignment = e.unpackAlignment,
  47296. this.encoding = e.encoding,
  47297. this
  47298. },
  47299. toJSON: function(e) {
  47300. function t(e) {
  47301. var t;
  47302. return void 0 !== e.toDataURL ? t = e : (t = document.createElement("canvas"),
  47303. t.width = e.width,
  47304. t.height = e.height,
  47305. t.getContext("2d").drawImage(e, 0, 0, e.width, e.height)),
  47306. t.width > 2048 || t.height > 2048 ? t.toDataURL("image/jpeg", .6) : t.toDataURL("image/png")
  47307. }
  47308. if (void 0 !== e.textures[this.uuid])
  47309. return e.textures[this.uuid];
  47310. var i = {
  47311. metadata: {
  47312. version: 4.4,
  47313. type: "Texture",
  47314. generator: "Texture.toJSON"
  47315. },
  47316. uuid: this.uuid,
  47317. name: this.name,
  47318. mapping: this.mapping,
  47319. repeat: [this.repeat.x, this.repeat.y],
  47320. offset: [this.offset.x, this.offset.y],
  47321. wrap: [this.wrapS, this.wrapT],
  47322. minFilter: this.minFilter,
  47323. magFilter: this.magFilter,
  47324. anisotropy: this.anisotropy
  47325. };
  47326. if (void 0 !== this.image) {
  47327. var r = this.image;
  47328. void 0 === r.uuid && (r.uuid = n.Math.generateUUID()),
  47329. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  47330. uuid: r.uuid,
  47331. url: t(r)
  47332. }),
  47333. i.image = r.uuid
  47334. }
  47335. return e.textures[this.uuid] = i,
  47336. i
  47337. },
  47338. dispose: function() {
  47339. this.dispatchEvent({
  47340. type: "dispose"
  47341. })
  47342. },
  47343. transformUv: function(e) {
  47344. if (this.mapping === n.UVMapping) {
  47345. if (e.multiply(this.repeat),
  47346. e.add(this.offset),
  47347. e.x < 0 || e.x > 1)
  47348. switch (this.wrapS) {
  47349. case n.RepeatWrapping:
  47350. e.x = e.x - Math.floor(e.x);
  47351. break;
  47352. case n.ClampToEdgeWrapping:
  47353. e.x = e.x < 0 ? 0 : 1;
  47354. break;
  47355. case n.MirroredRepeatWrapping:
  47356. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  47357. }
  47358. if (e.y < 0 || e.y > 1)
  47359. switch (this.wrapT) {
  47360. case n.RepeatWrapping:
  47361. e.y = e.y - Math.floor(e.y);
  47362. break;
  47363. case n.ClampToEdgeWrapping:
  47364. e.y = e.y < 0 ? 0 : 1;
  47365. break;
  47366. case n.MirroredRepeatWrapping:
  47367. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  47368. }
  47369. this.flipY && (e.y = 1 - e.y)
  47370. }
  47371. }
  47372. },
  47373. n.EventDispatcher.prototype.apply(n.Texture.prototype),
  47374. n.TextureIdCount = 0,
  47375. n.CanvasTexture = function(e, t, i, r, o, a, s, l, c) {
  47376. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  47377. this.needsUpdate = !0
  47378. }
  47379. ,
  47380. n.CanvasTexture.prototype = Object.create(n.Texture.prototype),
  47381. n.CanvasTexture.prototype.constructor = n.CanvasTexture,
  47382. n.CubeTexture = function(e, t, i, r, o, a, s, l, c) {
  47383. e = void 0 !== e ? e : [],
  47384. t = void 0 !== t ? t : n.CubeReflectionMapping,
  47385. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  47386. this.flipY = !1
  47387. }
  47388. ,
  47389. n.CubeTexture.prototype = Object.create(n.Texture.prototype),
  47390. n.CubeTexture.prototype.constructor = n.CubeTexture,
  47391. Object.defineProperty(n.CubeTexture.prototype, "images", {
  47392. get: function() {
  47393. return this.image
  47394. },
  47395. set: function(e) {
  47396. this.image = e
  47397. }
  47398. }),
  47399. n.CompressedTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  47400. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  47401. this.image = {
  47402. width: t,
  47403. height: i
  47404. },
  47405. this.mipmaps = e,
  47406. this.flipY = !1,
  47407. this.generateMipmaps = !1
  47408. }
  47409. ,
  47410. n.CompressedTexture.prototype = Object.create(n.Texture.prototype),
  47411. n.CompressedTexture.prototype.constructor = n.CompressedTexture,
  47412. n.DataTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  47413. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  47414. this.image = {
  47415. data: e,
  47416. width: t,
  47417. height: i
  47418. },
  47419. this.magFilter = void 0 !== c ? c : n.NearestFilter,
  47420. this.minFilter = void 0 !== h ? h : n.NearestFilter,
  47421. this.flipY = !1,
  47422. this.generateMipmaps = !1
  47423. }
  47424. ,
  47425. n.DataTexture.prototype = Object.create(n.Texture.prototype),
  47426. n.DataTexture.prototype.constructor = n.DataTexture,
  47427. n.VideoTexture = function(e, t, i, r, o, a, s, l, c) {
  47428. function h() {
  47429. requestAnimationFrame(h),
  47430. e.readyState === e.HAVE_ENOUGH_DATA && (u.needsUpdate = !0)
  47431. }
  47432. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  47433. this.generateMipmaps = !1;
  47434. var u = this;
  47435. h()
  47436. }
  47437. ,
  47438. n.VideoTexture.prototype = Object.create(n.Texture.prototype),
  47439. n.VideoTexture.prototype.constructor = n.VideoTexture,
  47440. n.Group = function() {
  47441. n.Object3D.call(this),
  47442. this.type = "Group"
  47443. }
  47444. ,
  47445. n.Group.prototype = Object.create(n.Object3D.prototype),
  47446. n.Group.prototype.constructor = n.Group,
  47447. n.Points = function(e, t) {
  47448. n.Object3D.call(this),
  47449. this.type = "Points",
  47450. this.geometry = void 0 !== e ? e : new n.Geometry,
  47451. this.material = void 0 !== t ? t : new n.PointsMaterial({
  47452. color: 16777215 * Math.random()
  47453. })
  47454. }
  47455. ,
  47456. n.Points.prototype = Object.create(n.Object3D.prototype),
  47457. n.Points.prototype.constructor = n.Points,
  47458. n.Points.prototype.raycast = function() {
  47459. var e = new n.Matrix4
  47460. , t = new n.Ray
  47461. , i = new n.Sphere;
  47462. return function(r, o) {
  47463. function a(e, i) {
  47464. var n = t.distanceSqToPoint(e);
  47465. if (n < d) {
  47466. var a = t.closestPointToPoint(e);
  47467. a.applyMatrix4(c);
  47468. var l = r.ray.origin.distanceTo(a);
  47469. if (l < r.near || l > r.far)
  47470. return;
  47471. o.push({
  47472. distance: l,
  47473. distanceToRay: Math.sqrt(n),
  47474. point: a.clone(),
  47475. index: i,
  47476. face: null,
  47477. object: s
  47478. })
  47479. }
  47480. }
  47481. var s = this
  47482. , l = this.geometry
  47483. , c = this.matrixWorld
  47484. , h = r.params.Points.threshold;
  47485. if (null === l.boundingSphere && l.computeBoundingSphere(),
  47486. i.copy(l.boundingSphere),
  47487. i.applyMatrix4(c),
  47488. r.ray.intersectsSphere(i) !== !1) {
  47489. e.getInverse(c),
  47490. t.copy(r.ray).applyMatrix4(e);
  47491. var u = h / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  47492. , d = u * u
  47493. , p = new n.Vector3;
  47494. if (l instanceof n.BufferGeometry) {
  47495. var f = l.index
  47496. , g = l.attributes
  47497. , m = g.position.array;
  47498. if (null !== f)
  47499. for (var v = f.array, A = 0, y = v.length; A < y; A++) {
  47500. var C = v[A];
  47501. p.fromArray(m, 3 * C),
  47502. a(p, C)
  47503. }
  47504. else
  47505. for (var A = 0, I = m.length / 3; A < I; A++)
  47506. p.fromArray(m, 3 * A),
  47507. a(p, A)
  47508. } else
  47509. for (var E = l.vertices, A = 0, I = E.length; A < I; A++)
  47510. a(E[A], A)
  47511. }
  47512. }
  47513. }(),
  47514. n.Points.prototype.clone = function() {
  47515. return new this.constructor(this.geometry,this.material).copy(this)
  47516. }
  47517. ,
  47518. n.Line = function(e, t, i) {
  47519. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  47520. new n.LineSegments(e,t)) : (n.Object3D.call(this),
  47521. this.type = "Line",
  47522. this.geometry = void 0 !== e ? e : new n.Geometry,
  47523. void (this.material = void 0 !== t ? t : new n.LineBasicMaterial({
  47524. color: 16777215 * Math.random()
  47525. })))
  47526. }
  47527. ,
  47528. n.Line.prototype = Object.create(n.Object3D.prototype),
  47529. n.Line.prototype.constructor = n.Line,
  47530. n.Line.prototype.raycast = function() {
  47531. var e = new n.Matrix4
  47532. , t = new n.Ray
  47533. , i = new n.Sphere;
  47534. return function(r, o) {
  47535. var a = r.linePrecision
  47536. , s = a * a
  47537. , l = this.geometry
  47538. , c = this.matrixWorld;
  47539. if (null === l.boundingSphere && l.computeBoundingSphere(),
  47540. i.copy(l.boundingSphere),
  47541. i.applyMatrix4(c),
  47542. r.ray.intersectsSphere(i) !== !1) {
  47543. e.getInverse(c),
  47544. t.copy(r.ray).applyMatrix4(e);
  47545. var h = new n.Vector3
  47546. , u = new n.Vector3
  47547. , d = new n.Vector3
  47548. , p = new n.Vector3
  47549. , f = this instanceof n.LineSegments ? 2 : 1;
  47550. if (l instanceof n.BufferGeometry) {
  47551. var g = l.index
  47552. , m = l.attributes
  47553. , v = m.position.array;
  47554. if (null !== g)
  47555. for (var A = g.array, y = 0, C = A.length - 1; y < C; y += f) {
  47556. var I = A[y]
  47557. , E = A[y + 1];
  47558. h.fromArray(v, 3 * I),
  47559. u.fromArray(v, 3 * E);
  47560. var b = t.distanceSqToSegment(h, u, p, d);
  47561. if (!(b > s)) {
  47562. p.applyMatrix4(this.matrixWorld);
  47563. var w = r.ray.origin.distanceTo(p);
  47564. w < r.near || w > r.far || o.push({
  47565. distance: w,
  47566. point: d.clone().applyMatrix4(this.matrixWorld),
  47567. index: y,
  47568. face: null,
  47569. faceIndex: null,
  47570. object: this
  47571. })
  47572. }
  47573. }
  47574. else
  47575. for (var y = 0, C = v.length / 3 - 1; y < C; y += f) {
  47576. h.fromArray(v, 3 * y),
  47577. u.fromArray(v, 3 * y + 3);
  47578. var b = t.distanceSqToSegment(h, u, p, d);
  47579. if (!(b > s)) {
  47580. p.applyMatrix4(this.matrixWorld);
  47581. var w = r.ray.origin.distanceTo(p);
  47582. w < r.near || w > r.far || o.push({
  47583. distance: w,
  47584. point: d.clone().applyMatrix4(this.matrixWorld),
  47585. index: y,
  47586. face: null,
  47587. faceIndex: null,
  47588. object: this
  47589. })
  47590. }
  47591. }
  47592. } else if (l instanceof n.Geometry)
  47593. for (var _ = l.vertices, T = _.length, y = 0; y < T - 1; y += f) {
  47594. var b = t.distanceSqToSegment(_[y], _[y + 1], p, d);
  47595. if (!(b > s)) {
  47596. p.applyMatrix4(this.matrixWorld);
  47597. var w = r.ray.origin.distanceTo(p);
  47598. w < r.near || w > r.far || o.push({
  47599. distance: w,
  47600. point: d.clone().applyMatrix4(this.matrixWorld),
  47601. index: y,
  47602. face: null,
  47603. faceIndex: null,
  47604. object: this
  47605. })
  47606. }
  47607. }
  47608. }
  47609. }
  47610. }(),
  47611. n.Line.prototype.clone = function() {
  47612. return new this.constructor(this.geometry,this.material).copy(this)
  47613. }
  47614. ,
  47615. n.LineStrip = 0,
  47616. n.LinePieces = 1,
  47617. n.LineSegments = function(e, t) {
  47618. n.Line.call(this, e, t),
  47619. this.type = "LineSegments"
  47620. }
  47621. ,
  47622. n.LineSegments.prototype = Object.create(n.Line.prototype),
  47623. n.LineSegments.prototype.constructor = n.LineSegments,
  47624. n.Mesh = function(e, t) {
  47625. n.Object3D.call(this),
  47626. this.type = "Mesh",
  47627. this.geometry = void 0 !== e ? e : new n.Geometry,
  47628. this.material = void 0 !== t ? t : new n.MeshBasicMaterial({
  47629. color: 16777215 * Math.random()
  47630. }),
  47631. this.drawMode = n.TrianglesDrawMode,
  47632. this.updateMorphTargets()
  47633. }
  47634. ,
  47635. n.Mesh.prototype = Object.create(n.Object3D.prototype),
  47636. n.Mesh.prototype.constructor = n.Mesh,
  47637. n.Mesh.prototype.setDrawMode = function(e) {
  47638. this.drawMode = e
  47639. }
  47640. ,
  47641. n.Mesh.prototype.updateMorphTargets = function() {
  47642. if (void 0 !== this.geometry.morphTargets && this.geometry.morphTargets.length > 0) {
  47643. this.morphTargetBase = -1,
  47644. this.morphTargetInfluences = [],
  47645. this.morphTargetDictionary = {};
  47646. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  47647. this.morphTargetInfluences.push(0),
  47648. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  47649. }
  47650. }
  47651. ,
  47652. n.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  47653. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  47654. 0)
  47655. }
  47656. ,
  47657. n.Mesh.prototype.raycast = function() {
  47658. function e(e, t, i, r, o, a, s) {
  47659. return n.Triangle.barycoordFromPoint(e, t, i, r, m),
  47660. o.multiplyScalar(m.x),
  47661. a.multiplyScalar(m.y),
  47662. s.multiplyScalar(m.z),
  47663. o.add(a).add(s),
  47664. o.clone()
  47665. }
  47666. function t(e, t, i, r, o, a, s) {
  47667. var l, c = e.material;
  47668. if (l = c.side === n.BackSide ? i.intersectTriangle(a, o, r, !0, s) : i.intersectTriangle(r, o, a, c.side !== n.DoubleSide, s),
  47669. null === l)
  47670. return null;
  47671. A.copy(s),
  47672. A.applyMatrix4(e.matrixWorld);
  47673. var h = t.ray.origin.distanceTo(A);
  47674. return h < t.near || h > t.far ? null : {
  47675. distance: h,
  47676. point: A.clone(),
  47677. object: e
  47678. }
  47679. }
  47680. function i(i, r, o, a, h, u, d, m) {
  47681. s.fromArray(a, 3 * u),
  47682. l.fromArray(a, 3 * d),
  47683. c.fromArray(a, 3 * m);
  47684. var A = t(i, r, o, s, l, c, v);
  47685. return A && (h && (p.fromArray(h, 2 * u),
  47686. f.fromArray(h, 2 * d),
  47687. g.fromArray(h, 2 * m),
  47688. A.uv = e(v, s, l, c, p, f, g)),
  47689. A.face = new n.Face3(u,d,m,n.Triangle.normal(s, l, c)),
  47690. A.faceIndex = u),
  47691. A
  47692. }
  47693. var r = new n.Matrix4
  47694. , o = new n.Ray
  47695. , a = new n.Sphere
  47696. , s = new n.Vector3
  47697. , l = new n.Vector3
  47698. , c = new n.Vector3
  47699. , h = new n.Vector3
  47700. , u = new n.Vector3
  47701. , d = new n.Vector3
  47702. , p = new n.Vector2
  47703. , f = new n.Vector2
  47704. , g = new n.Vector2
  47705. , m = new n.Vector3
  47706. , v = new n.Vector3
  47707. , A = new n.Vector3;
  47708. return function(m, A) {
  47709. var y = this.geometry
  47710. , C = this.material
  47711. , I = this.matrixWorld;
  47712. if (void 0 !== C && (null === y.boundingSphere && y.computeBoundingSphere(),
  47713. a.copy(y.boundingSphere),
  47714. a.applyMatrix4(I),
  47715. m.ray.intersectsSphere(a) !== !1 && (r.getInverse(I),
  47716. o.copy(m.ray).applyMatrix4(r),
  47717. null === y.boundingBox || o.intersectsBox(y.boundingBox) !== !1))) {
  47718. var E, b;
  47719. if (y instanceof n.BufferGeometry) {
  47720. var w, _, T, x = y.index, S = y.attributes, M = S.position.array;
  47721. if (void 0 !== S.uv && (E = S.uv.array),
  47722. null !== x)
  47723. for (var R = x.array, P = 0, O = R.length; P < O; P += 3)
  47724. w = R[P],
  47725. _ = R[P + 1],
  47726. T = R[P + 2],
  47727. b = i(this, m, o, M, E, w, _, T),
  47728. b && (b.faceIndex = Math.floor(P / 3),
  47729. A.push(b));
  47730. else
  47731. for (var P = 0, O = M.length; P < O; P += 9)
  47732. w = P / 3,
  47733. _ = w + 1,
  47734. T = w + 2,
  47735. b = i(this, m, o, M, E, w, _, T),
  47736. b && (b.index = w,
  47737. A.push(b))
  47738. } else if (y instanceof n.Geometry) {
  47739. 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];
  47740. k.length > 0 && (E = k);
  47741. for (var H = 0, G = U.length; H < G; H++) {
  47742. var z = U[H]
  47743. , W = B === !0 ? F[z.materialIndex] : C;
  47744. if (void 0 !== W) {
  47745. if (L = V[z.a],
  47746. D = V[z.b],
  47747. N = V[z.c],
  47748. W.morphTargets === !0) {
  47749. var j = y.morphTargets
  47750. , Y = this.morphTargetInfluences;
  47751. s.set(0, 0, 0),
  47752. l.set(0, 0, 0),
  47753. c.set(0, 0, 0);
  47754. for (var X = 0, Z = j.length; X < Z; X++) {
  47755. var q = Y[X];
  47756. if (0 !== q) {
  47757. var K = j[X].vertices;
  47758. s.addScaledVector(h.subVectors(K[z.a], L), q),
  47759. l.addScaledVector(u.subVectors(K[z.b], D), q),
  47760. c.addScaledVector(d.subVectors(K[z.c], N), q)
  47761. }
  47762. }
  47763. s.add(L),
  47764. l.add(D),
  47765. c.add(N),
  47766. L = s,
  47767. D = l,
  47768. N = c
  47769. }
  47770. if (b = t(this, m, o, L, D, N, v)) {
  47771. if (E) {
  47772. var Q = E[H];
  47773. p.copy(Q[0]),
  47774. f.copy(Q[1]),
  47775. g.copy(Q[2]),
  47776. b.uv = e(v, L, D, N, p, f, g)
  47777. }
  47778. b.face = z,
  47779. b.faceIndex = H,
  47780. A.push(b)
  47781. }
  47782. }
  47783. }
  47784. }
  47785. }
  47786. }
  47787. }(),
  47788. n.Mesh.prototype.clone = function() {
  47789. return new this.constructor(this.geometry,this.material).copy(this)
  47790. }
  47791. ,
  47792. n.Bone = function(e) {
  47793. n.Object3D.call(this),
  47794. this.type = "Bone",
  47795. this.skin = e
  47796. }
  47797. ,
  47798. n.Bone.prototype = Object.create(n.Object3D.prototype),
  47799. n.Bone.prototype.constructor = n.Bone,
  47800. n.Bone.prototype.copy = function(e) {
  47801. return n.Object3D.prototype.copy.call(this, e),
  47802. this.skin = e.skin,
  47803. this
  47804. }
  47805. ,
  47806. n.Skeleton = function(e, t, i) {
  47807. if (this.useVertexTexture = void 0 === i || i,
  47808. this.identityMatrix = new n.Matrix4,
  47809. e = e || [],
  47810. this.bones = e.slice(0),
  47811. this.useVertexTexture) {
  47812. var r = Math.sqrt(4 * this.bones.length);
  47813. r = n.Math.nextPowerOfTwo(Math.ceil(r)),
  47814. r = Math.max(r, 4),
  47815. this.boneTextureWidth = r,
  47816. this.boneTextureHeight = r,
  47817. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  47818. this.boneTexture = new n.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,n.RGBAFormat,n.FloatType)
  47819. } else
  47820. this.boneMatrices = new Float32Array(16 * this.bones.length);
  47821. if (void 0 === t)
  47822. this.calculateInverses();
  47823. else if (this.bones.length === t.length)
  47824. this.boneInverses = t.slice(0);
  47825. else {
  47826. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  47827. this.boneInverses = [];
  47828. for (var o = 0, a = this.bones.length; o < a; o++)
  47829. this.boneInverses.push(new n.Matrix4)
  47830. }
  47831. }
  47832. ,
  47833. n.Skeleton.prototype.calculateInverses = function() {
  47834. this.boneInverses = [];
  47835. for (var e = 0, t = this.bones.length; e < t; e++) {
  47836. var i = new n.Matrix4;
  47837. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  47838. this.boneInverses.push(i)
  47839. }
  47840. }
  47841. ,
  47842. n.Skeleton.prototype.pose = function() {
  47843. for (var e, t = 0, i = this.bones.length; t < i; t++)
  47844. e = this.bones[t],
  47845. e && e.matrixWorld.getInverse(this.boneInverses[t]);
  47846. for (var t = 0, i = this.bones.length; t < i; t++)
  47847. e = this.bones[t],
  47848. e && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  47849. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  47850. e.matrix.decompose(e.position, e.quaternion, e.scale));
  47851. }
  47852. ,
  47853. n.Skeleton.prototype.update = function() {
  47854. var e = new n.Matrix4;
  47855. return function() {
  47856. for (var t = 0, i = this.bones.length; t < i; t++) {
  47857. var n = this.bones[t] ? this.bones[t].matrixWorld : this.identityMatrix;
  47858. e.multiplyMatrices(n, this.boneInverses[t]),
  47859. e.flattenToArrayOffset(this.boneMatrices, 16 * t)
  47860. }
  47861. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  47862. }
  47863. }(),
  47864. n.Skeleton.prototype.clone = function() {
  47865. return new n.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  47866. }
  47867. ,
  47868. n.SkinnedMesh = function(e, t, i) {
  47869. n.Mesh.call(this, e, t),
  47870. this.type = "SkinnedMesh",
  47871. this.bindMode = "attached",
  47872. this.bindMatrix = new n.Matrix4,
  47873. this.bindMatrixInverse = new n.Matrix4;
  47874. var r = [];
  47875. if (this.geometry && void 0 !== this.geometry.bones) {
  47876. for (var o, a, s = 0, l = this.geometry.bones.length; s < l; ++s)
  47877. a = this.geometry.bones[s],
  47878. o = new n.Bone(this),
  47879. r.push(o),
  47880. o.name = a.name,
  47881. o.position.fromArray(a.pos),
  47882. o.quaternion.fromArray(a.rotq),
  47883. void 0 !== a.scl && o.scale.fromArray(a.scl);
  47884. for (var s = 0, l = this.geometry.bones.length; s < l; ++s)
  47885. a = this.geometry.bones[s],
  47886. a.parent !== -1 && null !== a.parent ? r[a.parent].add(r[s]) : this.add(r[s])
  47887. }
  47888. this.normalizeSkinWeights(),
  47889. this.updateMatrixWorld(!0),
  47890. this.bind(new n.Skeleton(r,void 0,i), this.matrixWorld)
  47891. }
  47892. ,
  47893. n.SkinnedMesh.prototype = Object.create(n.Mesh.prototype),
  47894. n.SkinnedMesh.prototype.constructor = n.SkinnedMesh,
  47895. n.SkinnedMesh.prototype.bind = function(e, t) {
  47896. this.skeleton = e,
  47897. void 0 === t && (this.updateMatrixWorld(!0),
  47898. this.skeleton.calculateInverses(),
  47899. t = this.matrixWorld),
  47900. this.bindMatrix.copy(t),
  47901. this.bindMatrixInverse.getInverse(t)
  47902. }
  47903. ,
  47904. n.SkinnedMesh.prototype.pose = function() {
  47905. this.skeleton.pose()
  47906. }
  47907. ,
  47908. n.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  47909. if (this.geometry instanceof n.Geometry)
  47910. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  47911. var t = this.geometry.skinWeights[e]
  47912. , i = 1 / t.lengthManhattan();
  47913. i !== 1 / 0 ? t.multiplyScalar(i) : t.set(1, 0, 0, 0)
  47914. }
  47915. else if (this.geometry instanceof n.BufferGeometry)
  47916. for (var r = new n.Vector4, o = this.geometry.attributes.skinWeight, e = 0; e < o.count; e++) {
  47917. r.x = o.getX(e),
  47918. r.y = o.getY(e),
  47919. r.z = o.getZ(e),
  47920. r.w = o.getW(e);
  47921. var i = 1 / r.lengthManhattan();
  47922. i !== 1 / 0 ? r.multiplyScalar(i) : r.set(1, 0, 0, 0),
  47923. o.setXYZW(e, r.x, r.y, r.z, r.w)
  47924. }
  47925. }
  47926. ,
  47927. n.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  47928. n.Mesh.prototype.updateMatrixWorld.call(this, !0),
  47929. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  47930. }
  47931. ,
  47932. n.SkinnedMesh.prototype.clone = function() {
  47933. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  47934. }
  47935. ,
  47936. n.LOD = function() {
  47937. n.Object3D.call(this),
  47938. this.type = "LOD",
  47939. Object.defineProperties(this, {
  47940. levels: {
  47941. enumerable: !0,
  47942. value: []
  47943. },
  47944. objects: {
  47945. get: function() {
  47946. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  47947. this.levels
  47948. }
  47949. }
  47950. })
  47951. }
  47952. ,
  47953. n.LOD.prototype = Object.create(n.Object3D.prototype),
  47954. n.LOD.prototype.constructor = n.LOD,
  47955. n.LOD.prototype.addLevel = function(e, t) {
  47956. void 0 === t && (t = 0),
  47957. t = Math.abs(t);
  47958. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  47959. ;
  47960. i.splice(n, 0, {
  47961. distance: t,
  47962. object: e
  47963. }),
  47964. this.add(e)
  47965. }
  47966. ,
  47967. n.LOD.prototype.getObjectForDistance = function(e) {
  47968. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  47969. ;
  47970. return t[i - 1].object
  47971. }
  47972. ,
  47973. n.LOD.prototype.raycast = function() {
  47974. var e = new n.Vector3;
  47975. return function(t, i) {
  47976. e.setFromMatrixPosition(this.matrixWorld);
  47977. var n = t.ray.origin.distanceTo(e);
  47978. this.getObjectForDistance(n).raycast(t, i)
  47979. }
  47980. }(),
  47981. n.LOD.prototype.update = function() {
  47982. var e = new n.Vector3
  47983. , t = new n.Vector3;
  47984. return function(i) {
  47985. var n = this.levels;
  47986. if (n.length > 1) {
  47987. e.setFromMatrixPosition(i.matrixWorld),
  47988. t.setFromMatrixPosition(this.matrixWorld);
  47989. var r = e.distanceTo(t);
  47990. n[0].object.visible = !0;
  47991. for (var o = 1, a = n.length; o < a && r >= n[o].distance; o++)
  47992. n[o - 1].object.visible = !1,
  47993. n[o].object.visible = !0;
  47994. for (; o < a; o++)
  47995. n[o].object.visible = !1
  47996. }
  47997. }
  47998. }(),
  47999. n.LOD.prototype.copy = function(e) {
  48000. n.Object3D.prototype.copy.call(this, e, !1);
  48001. for (var t = e.levels, i = 0, r = t.length; i < r; i++) {
  48002. var o = t[i];
  48003. this.addLevel(o.object.clone(), o.distance)
  48004. }
  48005. return this
  48006. }
  48007. ,
  48008. n.LOD.prototype.toJSON = function(e) {
  48009. var t = n.Object3D.prototype.toJSON.call(this, e);
  48010. t.object.levels = [];
  48011. for (var i = this.levels, r = 0, o = i.length; r < o; r++) {
  48012. var a = i[r];
  48013. t.object.levels.push({
  48014. object: a.object.uuid,
  48015. distance: a.distance
  48016. })
  48017. }
  48018. return t
  48019. }
  48020. ,
  48021. n.Sprite = function() {
  48022. var e = new Uint16Array([0, 1, 2, 0, 2, 3])
  48023. , t = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0])
  48024. , i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1])
  48025. , r = new n.BufferGeometry;
  48026. return r.setIndex(new n.BufferAttribute(e,1)),
  48027. r.addAttribute("position", new n.BufferAttribute(t,3)),
  48028. r.addAttribute("uv", new n.BufferAttribute(i,2)),
  48029. function(e) {
  48030. n.Object3D.call(this),
  48031. this.type = "Sprite",
  48032. this.geometry = r,
  48033. this.material = void 0 !== e ? e : new n.SpriteMaterial
  48034. }
  48035. }(),
  48036. n.Sprite.prototype = Object.create(n.Object3D.prototype),
  48037. n.Sprite.prototype.constructor = n.Sprite,
  48038. n.Sprite.prototype.raycast = function() {
  48039. var e = new n.Vector3;
  48040. return function(t, i) {
  48041. e.setFromMatrixPosition(this.matrixWorld);
  48042. var n = t.ray.distanceSqToPoint(e)
  48043. , r = this.scale.x * this.scale.y;
  48044. n > r || i.push({
  48045. distance: Math.sqrt(n),
  48046. point: this.position,
  48047. face: null,
  48048. object: this
  48049. })
  48050. }
  48051. }(),
  48052. n.Sprite.prototype.clone = function() {
  48053. return new this.constructor(this.material).copy(this)
  48054. }
  48055. ,
  48056. n.Particle = n.Sprite,
  48057. n.LensFlare = function(e, t, i, r, o) {
  48058. n.Object3D.call(this),
  48059. this.lensFlares = [],
  48060. this.positionScreen = new n.Vector3,
  48061. this.customUpdateCallback = void 0,
  48062. void 0 !== e && this.add(e, t, i, r, o)
  48063. }
  48064. ,
  48065. n.LensFlare.prototype = Object.create(n.Object3D.prototype),
  48066. n.LensFlare.prototype.constructor = n.LensFlare,
  48067. n.LensFlare.prototype.add = function(e, t, i, r, o, a) {
  48068. void 0 === t && (t = -1),
  48069. void 0 === i && (i = 0),
  48070. void 0 === a && (a = 1),
  48071. void 0 === o && (o = new n.Color(16777215)),
  48072. void 0 === r && (r = n.NormalBlending),
  48073. i = Math.min(i, Math.max(0, i)),
  48074. this.lensFlares.push({
  48075. texture: e,
  48076. size: t,
  48077. distance: i,
  48078. x: 0,
  48079. y: 0,
  48080. z: 0,
  48081. scale: 1,
  48082. rotation: 0,
  48083. opacity: a,
  48084. color: o,
  48085. blending: r
  48086. })
  48087. }
  48088. ,
  48089. n.LensFlare.prototype.updateLensFlares = function() {
  48090. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  48091. for (e = 0; e < i; e++)
  48092. t = this.lensFlares[e],
  48093. t.x = this.positionScreen.x + n * t.distance,
  48094. t.y = this.positionScreen.y + r * t.distance,
  48095. t.wantedRotation = t.x * Math.PI * .25,
  48096. t.rotation += .25 * (t.wantedRotation - t.rotation)
  48097. }
  48098. ,
  48099. n.LensFlare.prototype.copy = function(e) {
  48100. n.Object3D.prototype.copy.call(this, e),
  48101. this.positionScreen.copy(e.positionScreen),
  48102. this.customUpdateCallback = e.customUpdateCallback;
  48103. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  48104. this.lensFlares.push(e.lensFlares[t]);
  48105. return this
  48106. }
  48107. ,
  48108. n.Scene = function() {
  48109. n.Object3D.call(this),
  48110. this.type = "Scene",
  48111. this.fog = null,
  48112. this.overrideMaterial = null,
  48113. this.autoUpdate = !0
  48114. }
  48115. ,
  48116. n.Scene.prototype = Object.create(n.Object3D.prototype),
  48117. n.Scene.prototype.constructor = n.Scene,
  48118. n.Scene.prototype.copy = function(e, t) {
  48119. return n.Object3D.prototype.copy.call(this, e, t),
  48120. null !== e.fog && (this.fog = e.fog.clone()),
  48121. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  48122. this.autoUpdate = e.autoUpdate,
  48123. this.matrixAutoUpdate = e.matrixAutoUpdate,
  48124. this
  48125. }
  48126. ,
  48127. n.Fog = function(e, t, i) {
  48128. this.name = "",
  48129. this.color = new n.Color(e),
  48130. this.near = void 0 !== t ? t : 1,
  48131. this.far = void 0 !== i ? i : 1e3
  48132. }
  48133. ,
  48134. n.Fog.prototype.clone = function() {
  48135. return new n.Fog(this.color.getHex(),this.near,this.far)
  48136. }
  48137. ,
  48138. n.FogExp2 = function(e, t) {
  48139. this.name = "",
  48140. this.color = new n.Color(e),
  48141. this.density = void 0 !== t ? t : 25e-5
  48142. }
  48143. ,
  48144. n.FogExp2.prototype.clone = function() {
  48145. return new n.FogExp2(this.color.getHex(),this.density)
  48146. }
  48147. ,
  48148. n.ShaderChunk = {},
  48149. n.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  48150. n.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  48151. n.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  48152. 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",
  48153. n.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  48154. n.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  48155. n.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  48156. 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",
  48157. 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",
  48158. n.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  48159. n.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  48160. n.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  48161. n.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  48162. 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",
  48163. 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",
  48164. n.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  48165. n.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  48166. n.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  48167. 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",
  48168. n.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  48169. 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",
  48170. n.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  48171. 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",
  48172. 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",
  48173. 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",
  48174. 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",
  48175. 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",
  48176. 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",
  48177. n.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  48178. n.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  48179. 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",
  48180. 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",
  48181. n.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  48182. 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",
  48183. n.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  48184. n.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  48185. 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",
  48186. 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",
  48187. 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",
  48188. n.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  48189. 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",
  48190. 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",
  48191. 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",
  48192. n.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  48193. n.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  48194. 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",
  48195. n.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  48196. n.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  48197. n.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  48198. 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",
  48199. 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";
  48200. 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";
  48201. 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",
  48202. 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",
  48203. n.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  48204. 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",
  48205. n.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  48206. n.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  48207. 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",
  48208. 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",
  48209. 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",
  48210. 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",
  48211. 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",
  48212. 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",
  48213. 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",
  48214. 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",
  48215. 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",
  48216. n.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  48217. n.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  48218. 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",
  48219. n.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  48220. n.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  48221. n.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  48222. 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",
  48223. 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",
  48224. 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",
  48225. 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",
  48226. n.UniformsUtils = {
  48227. merge: function(e) {
  48228. for (var t = {}, i = 0; i < e.length; i++) {
  48229. var n = this.clone(e[i]);
  48230. for (var r in n)
  48231. t[r] = n[r]
  48232. }
  48233. return t
  48234. },
  48235. clone: function(e) {
  48236. var t = {};
  48237. for (var i in e) {
  48238. t[i] = {};
  48239. for (var r in e[i]) {
  48240. var o = e[i][r];
  48241. 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
  48242. }
  48243. }
  48244. return t
  48245. }
  48246. },
  48247. n.UniformsLib = {
  48248. common: {
  48249. diffuse: {
  48250. type: "c",
  48251. value: new n.Color(15658734)
  48252. },
  48253. opacity: {
  48254. type: "f",
  48255. value: 1
  48256. },
  48257. map: {
  48258. type: "t",
  48259. value: null
  48260. },
  48261. offsetRepeat: {
  48262. type: "v4",
  48263. value: new n.Vector4(0,0,1,1)
  48264. },
  48265. specularMap: {
  48266. type: "t",
  48267. value: null
  48268. },
  48269. alphaMap: {
  48270. type: "t",
  48271. value: null
  48272. },
  48273. envMap: {
  48274. type: "t",
  48275. value: null
  48276. },
  48277. flipEnvMap: {
  48278. type: "f",
  48279. value: -1
  48280. },
  48281. reflectivity: {
  48282. type: "f",
  48283. value: 1
  48284. },
  48285. refractionRatio: {
  48286. type: "f",
  48287. value: .98
  48288. }
  48289. },
  48290. aomap: {
  48291. aoMap: {
  48292. type: "t",
  48293. value: null
  48294. },
  48295. aoMapIntensity: {
  48296. type: "f",
  48297. value: 1
  48298. }
  48299. },
  48300. lightmap: {
  48301. lightMap: {
  48302. type: "t",
  48303. value: null
  48304. },
  48305. lightMapIntensity: {
  48306. type: "f",
  48307. value: 1
  48308. }
  48309. },
  48310. emissivemap: {
  48311. emissiveMap: {
  48312. type: "t",
  48313. value: null
  48314. }
  48315. },
  48316. bumpmap: {
  48317. bumpMap: {
  48318. type: "t",
  48319. value: null
  48320. },
  48321. bumpScale: {
  48322. type: "f",
  48323. value: 1
  48324. }
  48325. },
  48326. normalmap: {
  48327. normalMap: {
  48328. type: "t",
  48329. value: null
  48330. },
  48331. normalScale: {
  48332. type: "v2",
  48333. value: new n.Vector2(1,1)
  48334. }
  48335. },
  48336. displacementmap: {
  48337. displacementMap: {
  48338. type: "t",
  48339. value: null
  48340. },
  48341. displacementScale: {
  48342. type: "f",
  48343. value: 1
  48344. },
  48345. displacementBias: {
  48346. type: "f",
  48347. value: 0
  48348. }
  48349. },
  48350. roughnessmap: {
  48351. roughnessMap: {
  48352. type: "t",
  48353. value: null
  48354. }
  48355. },
  48356. metalnessmap: {
  48357. metalnessMap: {
  48358. type: "t",
  48359. value: null
  48360. }
  48361. },
  48362. fog: {
  48363. fogDensity: {
  48364. type: "f",
  48365. value: 25e-5
  48366. },
  48367. fogNear: {
  48368. type: "f",
  48369. value: 1
  48370. },
  48371. fogFar: {
  48372. type: "f",
  48373. value: 2e3
  48374. },
  48375. fogColor: {
  48376. type: "c",
  48377. value: new n.Color(16777215)
  48378. }
  48379. },
  48380. lights: {
  48381. ambientLightColor: {
  48382. type: "fv",
  48383. value: []
  48384. },
  48385. directionalLights: {
  48386. type: "sa",
  48387. value: [],
  48388. properties: {
  48389. direction: {
  48390. type: "v3"
  48391. },
  48392. color: {
  48393. type: "c"
  48394. },
  48395. shadow: {
  48396. type: "i"
  48397. },
  48398. shadowBias: {
  48399. type: "f"
  48400. },
  48401. shadowRadius: {
  48402. type: "f"
  48403. },
  48404. shadowMapSize: {
  48405. type: "v2"
  48406. }
  48407. }
  48408. },
  48409. directionalShadowMap: {
  48410. type: "tv",
  48411. value: []
  48412. },
  48413. directionalShadowMatrix: {
  48414. type: "m4v",
  48415. value: []
  48416. },
  48417. spotLights: {
  48418. type: "sa",
  48419. value: [],
  48420. properties: {
  48421. color: {
  48422. type: "c"
  48423. },
  48424. position: {
  48425. type: "v3"
  48426. },
  48427. direction: {
  48428. type: "v3"
  48429. },
  48430. distance: {
  48431. type: "f"
  48432. },
  48433. coneCos: {
  48434. type: "f"
  48435. },
  48436. penumbraCos: {
  48437. type: "f"
  48438. },
  48439. decay: {
  48440. type: "f"
  48441. },
  48442. shadow: {
  48443. type: "i"
  48444. },
  48445. shadowBias: {
  48446. type: "f"
  48447. },
  48448. shadowRadius: {
  48449. type: "f"
  48450. },
  48451. shadowMapSize: {
  48452. type: "v2"
  48453. }
  48454. }
  48455. },
  48456. spotShadowMap: {
  48457. type: "tv",
  48458. value: []
  48459. },
  48460. spotShadowMatrix: {
  48461. type: "m4v",
  48462. value: []
  48463. },
  48464. pointLights: {
  48465. type: "sa",
  48466. value: [],
  48467. properties: {
  48468. color: {
  48469. type: "c"
  48470. },
  48471. position: {
  48472. type: "v3"
  48473. },
  48474. decay: {
  48475. type: "f"
  48476. },
  48477. distance: {
  48478. type: "f"
  48479. },
  48480. shadow: {
  48481. type: "i"
  48482. },
  48483. shadowBias: {
  48484. type: "f"
  48485. },
  48486. shadowRadius: {
  48487. type: "f"
  48488. },
  48489. shadowMapSize: {
  48490. type: "v2"
  48491. }
  48492. }
  48493. },
  48494. pointShadowMap: {
  48495. type: "tv",
  48496. value: []
  48497. },
  48498. pointShadowMatrix: {
  48499. type: "m4v",
  48500. value: []
  48501. },
  48502. hemisphereLights: {
  48503. type: "sa",
  48504. value: [],
  48505. properties: {
  48506. direction: {
  48507. type: "v3"
  48508. },
  48509. skyColor: {
  48510. type: "c"
  48511. },
  48512. groundColor: {
  48513. type: "c"
  48514. }
  48515. }
  48516. }
  48517. },
  48518. points: {
  48519. diffuse: {
  48520. type: "c",
  48521. value: new n.Color(15658734)
  48522. },
  48523. opacity: {
  48524. type: "f",
  48525. value: 1
  48526. },
  48527. size: {
  48528. type: "f",
  48529. value: 1
  48530. },
  48531. scale: {
  48532. type: "f",
  48533. value: 1
  48534. },
  48535. map: {
  48536. type: "t",
  48537. value: null
  48538. },
  48539. offsetRepeat: {
  48540. type: "v4",
  48541. value: new n.Vector4(0,0,1,1)
  48542. }
  48543. }
  48544. },
  48545. 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",
  48546. 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",
  48547. 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",
  48548. 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",
  48549. 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",
  48550. 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",
  48551. 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",
  48552. 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",
  48553. 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",
  48554. 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",
  48555. 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",
  48556. 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",
  48557. 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",
  48558. 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",
  48559. 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",
  48560. 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",
  48561. 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",
  48562. 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",
  48563. 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",
  48564. 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",
  48565. 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",
  48566. 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",
  48567. 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",
  48568. 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",
  48569. n.ShaderLib = {
  48570. basic: {
  48571. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.fog]),
  48572. vertexShader: n.ShaderChunk.meshbasic_vert,
  48573. fragmentShader: n.ShaderChunk.meshbasic_frag
  48574. },
  48575. lambert: {
  48576. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.fog, n.UniformsLib.lights, {
  48577. emissive: {
  48578. type: "c",
  48579. value: new n.Color(0)
  48580. }
  48581. }]),
  48582. vertexShader: n.ShaderChunk.meshlambert_vert,
  48583. fragmentShader: n.ShaderChunk.meshlambert_frag
  48584. },
  48585. phong: {
  48586. 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, {
  48587. emissive: {
  48588. type: "c",
  48589. value: new n.Color(0)
  48590. },
  48591. specular: {
  48592. type: "c",
  48593. value: new n.Color(1118481)
  48594. },
  48595. shininess: {
  48596. type: "f",
  48597. value: 30
  48598. }
  48599. }]),
  48600. vertexShader: n.ShaderChunk.meshphong_vert,
  48601. fragmentShader: n.ShaderChunk.meshphong_frag
  48602. },
  48603. standard: {
  48604. 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, {
  48605. emissive: {
  48606. type: "c",
  48607. value: new n.Color(0)
  48608. },
  48609. roughness: {
  48610. type: "f",
  48611. value: .5
  48612. },
  48613. metalness: {
  48614. type: "f",
  48615. value: 0
  48616. },
  48617. envMapIntensity: {
  48618. type: "f",
  48619. value: 1
  48620. }
  48621. }]),
  48622. vertexShader: n.ShaderChunk.meshstandard_vert,
  48623. fragmentShader: n.ShaderChunk.meshstandard_frag
  48624. },
  48625. points: {
  48626. uniforms: n.UniformsUtils.merge([n.UniformsLib.points, n.UniformsLib.fog]),
  48627. vertexShader: n.ShaderChunk.points_vert,
  48628. fragmentShader: n.ShaderChunk.points_frag
  48629. },
  48630. dashed: {
  48631. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.fog, {
  48632. scale: {
  48633. type: "f",
  48634. value: 1
  48635. },
  48636. dashSize: {
  48637. type: "f",
  48638. value: 1
  48639. },
  48640. totalSize: {
  48641. type: "f",
  48642. value: 2
  48643. }
  48644. }]),
  48645. vertexShader: n.ShaderChunk.linedashed_vert,
  48646. fragmentShader: n.ShaderChunk.linedashed_frag
  48647. },
  48648. depth: {
  48649. uniforms: {
  48650. mNear: {
  48651. type: "f",
  48652. value: 1
  48653. },
  48654. mFar: {
  48655. type: "f",
  48656. value: 2e3
  48657. },
  48658. opacity: {
  48659. type: "f",
  48660. value: 1
  48661. }
  48662. },
  48663. vertexShader: n.ShaderChunk.depth_vert,
  48664. fragmentShader: n.ShaderChunk.depth_frag
  48665. },
  48666. normal: {
  48667. uniforms: {
  48668. opacity: {
  48669. type: "f",
  48670. value: 1
  48671. }
  48672. },
  48673. vertexShader: n.ShaderChunk.normal_vert,
  48674. fragmentShader: n.ShaderChunk.normal_frag
  48675. },
  48676. cube: {
  48677. uniforms: {
  48678. tCube: {
  48679. type: "t",
  48680. value: null
  48681. },
  48682. tFlip: {
  48683. type: "f",
  48684. value: -1
  48685. }
  48686. },
  48687. vertexShader: n.ShaderChunk.cube_vert,
  48688. fragmentShader: n.ShaderChunk.cube_frag
  48689. },
  48690. equirect: {
  48691. uniforms: {
  48692. tEquirect: {
  48693. type: "t",
  48694. value: null
  48695. },
  48696. tFlip: {
  48697. type: "f",
  48698. value: -1
  48699. }
  48700. },
  48701. vertexShader: n.ShaderChunk.equirect_vert,
  48702. fragmentShader: n.ShaderChunk.equirect_frag
  48703. },
  48704. depthRGBA: {
  48705. uniforms: {},
  48706. vertexShader: n.ShaderChunk.depthRGBA_vert,
  48707. fragmentShader: n.ShaderChunk.depthRGBA_frag
  48708. },
  48709. distanceRGBA: {
  48710. uniforms: {
  48711. lightPos: {
  48712. type: "v3",
  48713. value: new n.Vector3(0,0,0)
  48714. }
  48715. },
  48716. vertexShader: n.ShaderChunk.distanceRGBA_vert,
  48717. fragmentShader: n.ShaderChunk.distanceRGBA_frag
  48718. }
  48719. },
  48720. n.WebGLRenderer = function(e) {
  48721. function t() {
  48722. return null === ye ? Oe : 1
  48723. }
  48724. function i(e, t, i, n) {
  48725. se === !0 && (e *= n,
  48726. t *= n,
  48727. i *= n),
  48728. Ye.clearColor(e, t, i, n)
  48729. }
  48730. function r() {
  48731. Ye.init(),
  48732. Ye.scissor(we.copy(Le).multiplyScalar(Oe)),
  48733. Ye.viewport(Te.copy(Ne).multiplyScalar(Oe)),
  48734. i(Se.r, Se.g, Se.b, Me)
  48735. }
  48736. function o() {
  48737. Ae = null,
  48738. be = null,
  48739. Ee = "",
  48740. Ie = -1,
  48741. Ye.reset()
  48742. }
  48743. function a(e) {
  48744. e.preventDefault(),
  48745. o(),
  48746. r(),
  48747. Xe.clear()
  48748. }
  48749. function s(e) {
  48750. var t = e.target;
  48751. t.removeEventListener("dispose", s),
  48752. h(t),
  48753. ke.textures--
  48754. }
  48755. function l(e) {
  48756. var t = e.target;
  48757. t.removeEventListener("dispose", l),
  48758. u(t),
  48759. ke.textures--
  48760. }
  48761. function c(e) {
  48762. var t = e.target;
  48763. t.removeEventListener("dispose", c),
  48764. d(t)
  48765. }
  48766. function h(e) {
  48767. var t = Xe.get(e);
  48768. if (e.image && t.__image__webglTextureCube)
  48769. Ge.deleteTexture(t.__image__webglTextureCube);
  48770. else {
  48771. if (void 0 === t.__webglInit)
  48772. return;
  48773. Ge.deleteTexture(t.__webglTexture)
  48774. }
  48775. Xe.delete(e)
  48776. }
  48777. function u(e) {
  48778. var t = Xe.get(e)
  48779. , i = Xe.get(e.texture);
  48780. if (e && void 0 !== i.__webglTexture) {
  48781. if (Ge.deleteTexture(i.__webglTexture),
  48782. e instanceof n.WebGLRenderTargetCube)
  48783. for (var r = 0; r < 6; r++)
  48784. Ge.deleteFramebuffer(t.__webglFramebuffer[r]),
  48785. Ge.deleteRenderbuffer(t.__webglDepthbuffer[r]);
  48786. else
  48787. Ge.deleteFramebuffer(t.__webglFramebuffer),
  48788. Ge.deleteRenderbuffer(t.__webglDepthbuffer);
  48789. Xe.delete(e.texture),
  48790. Xe.delete(e)
  48791. }
  48792. }
  48793. function d(e) {
  48794. p(e),
  48795. Xe.delete(e)
  48796. }
  48797. function p(e) {
  48798. var t = Xe.get(e).program;
  48799. e.program = void 0,
  48800. void 0 !== t && qe.releaseProgram(t)
  48801. }
  48802. function f(e, t, i, r) {
  48803. var o;
  48804. if (i instanceof n.InstancedBufferGeometry && (o = We.get("ANGLE_instanced_arrays"),
  48805. null === o))
  48806. return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  48807. void 0 === r && (r = 0),
  48808. Ye.initAttributes();
  48809. var a = i.attributes
  48810. , s = t.getAttributes()
  48811. , l = e.defaultAttributeValues;
  48812. for (var c in s) {
  48813. var h = s[c];
  48814. if (h >= 0) {
  48815. var u = a[c];
  48816. if (void 0 !== u) {
  48817. var d = u.itemSize
  48818. , p = Ze.getAttributeBuffer(u);
  48819. if (u instanceof n.InterleavedBufferAttribute) {
  48820. var f = u.data
  48821. , g = f.stride
  48822. , m = u.offset;
  48823. f instanceof n.InstancedInterleavedBuffer ? (Ye.enableAttributeAndDivisor(h, f.meshPerAttribute, o),
  48824. void 0 === i.maxInstancedCount && (i.maxInstancedCount = f.meshPerAttribute * f.count)) : Ye.enableAttribute(h),
  48825. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  48826. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, g * f.array.BYTES_PER_ELEMENT, (r * g + m) * f.array.BYTES_PER_ELEMENT)
  48827. } else
  48828. u instanceof n.InstancedBufferAttribute ? (Ye.enableAttributeAndDivisor(h, u.meshPerAttribute, o),
  48829. void 0 === i.maxInstancedCount && (i.maxInstancedCount = u.meshPerAttribute * u.count)) : Ye.enableAttribute(h),
  48830. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  48831. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, 0, r * d * 4)
  48832. } else if (void 0 !== l) {
  48833. var v = l[c];
  48834. if (void 0 !== v)
  48835. switch (v.length) {
  48836. case 2:
  48837. Ge.vertexAttrib2fv(h, v);
  48838. break;
  48839. case 3:
  48840. Ge.vertexAttrib3fv(h, v);
  48841. break;
  48842. case 4:
  48843. Ge.vertexAttrib4fv(h, v);
  48844. break;
  48845. default:
  48846. Ge.vertexAttrib1fv(h, v)
  48847. }
  48848. }
  48849. }
  48850. }
  48851. Ye.disableUnusedAttributes()
  48852. }
  48853. function g(e, t) {
  48854. return Math.abs(t[0]) - Math.abs(e[0])
  48855. }
  48856. function m(e, t) {
  48857. 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
  48858. }
  48859. function v(e, t) {
  48860. 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
  48861. }
  48862. function A(e, t, i, n, r) {
  48863. var o, a;
  48864. i.transparent ? (o = de,
  48865. a = ++pe) : (o = he,
  48866. a = ++ue);
  48867. var s = o[a];
  48868. void 0 !== s ? (s.id = e.id,
  48869. s.object = e,
  48870. s.geometry = t,
  48871. s.material = i,
  48872. s.z = Ve.z,
  48873. s.group = r) : (s = {
  48874. id: e.id,
  48875. object: e,
  48876. geometry: t,
  48877. material: i,
  48878. z: Ve.z,
  48879. group: r
  48880. },
  48881. o.push(s))
  48882. }
  48883. function y(e, t) {
  48884. if (e.visible !== !1) {
  48885. if (e.layers.test(t.layers))
  48886. if (e instanceof n.Light)
  48887. ce.push(e);
  48888. else if (e instanceof n.Sprite)
  48889. e.frustumCulled !== !1 && Be.intersectsObject(e) !== !0 || ge.push(e);
  48890. else if (e instanceof n.LensFlare)
  48891. me.push(e);
  48892. else if (e instanceof n.ImmediateRenderObject)
  48893. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  48894. Ve.applyProjection(Fe)),
  48895. A(e, null, e.material, Ve.z, null);
  48896. else if ((e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && (e instanceof n.SkinnedMesh && e.skeleton.update(),
  48897. e.frustumCulled === !1 || Be.intersectsObject(e) === !0)) {
  48898. var i = e.material;
  48899. if (i.visible === !0) {
  48900. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  48901. Ve.applyProjection(Fe));
  48902. var r = Ze.update(e);
  48903. if (i instanceof n.MultiMaterial)
  48904. for (var o = r.groups, a = i.materials, s = 0, l = o.length; s < l; s++) {
  48905. var c = o[s]
  48906. , h = a[c.materialIndex];
  48907. h.visible === !0 && A(e, r, h, Ve.z, c)
  48908. }
  48909. else
  48910. A(e, r, i, Ve.z, null)
  48911. }
  48912. }
  48913. for (var u = e.children, s = 0, l = u.length; s < l; s++)
  48914. y(u[s], t)
  48915. }
  48916. }
  48917. function C(e, t, i, r) {
  48918. for (var o = 0, a = e.length; o < a; o++) {
  48919. var s = e[o]
  48920. , l = s.object
  48921. , c = s.geometry
  48922. , h = void 0 === r ? s.material : r
  48923. , u = s.group;
  48924. if (l.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  48925. l.normalMatrix.getNormalMatrix(l.modelViewMatrix),
  48926. l instanceof n.ImmediateRenderObject) {
  48927. E(h);
  48928. var d = w(t, i, h, l);
  48929. Ee = "",
  48930. l.render(function(e) {
  48931. ve.renderBufferImmediate(e, d, h)
  48932. })
  48933. } else
  48934. ve.renderBufferDirect(t, i, c, h, l, u)
  48935. }
  48936. }
  48937. function I(e, t, i) {
  48938. var r = Xe.get(e)
  48939. , o = qe.getParameters(e, Ue, t, i)
  48940. , a = qe.getProgramCode(e, o)
  48941. , s = r.program
  48942. , l = !0;
  48943. if (void 0 === s)
  48944. e.addEventListener("dispose", c);
  48945. else if (s.code !== a)
  48946. p(e);
  48947. else {
  48948. if (void 0 !== o.shaderID)
  48949. return;
  48950. l = !1
  48951. }
  48952. if (l) {
  48953. if (o.shaderID) {
  48954. var h = n.ShaderLib[o.shaderID];
  48955. r.__webglShader = {
  48956. name: e.type,
  48957. uniforms: n.UniformsUtils.clone(h.uniforms),
  48958. vertexShader: h.vertexShader,
  48959. fragmentShader: h.fragmentShader
  48960. }
  48961. } else
  48962. r.__webglShader = {
  48963. name: e.type,
  48964. uniforms: e.uniforms,
  48965. vertexShader: e.vertexShader,
  48966. fragmentShader: e.fragmentShader
  48967. };
  48968. e.__webglShader = r.__webglShader,
  48969. s = qe.acquireProgram(e, o, a),
  48970. r.program = s,
  48971. e.program = s
  48972. }
  48973. var u = s.getAttributes();
  48974. if (e.morphTargets) {
  48975. e.numSupportedMorphTargets = 0;
  48976. for (var d = 0; d < ve.maxMorphTargets; d++)
  48977. u["morphTarget" + d] >= 0 && e.numSupportedMorphTargets++
  48978. }
  48979. if (e.morphNormals) {
  48980. e.numSupportedMorphNormals = 0;
  48981. for (var d = 0; d < ve.maxMorphNormals; d++)
  48982. u["morphNormal" + d] >= 0 && e.numSupportedMorphNormals++
  48983. }
  48984. r.uniformsList = [];
  48985. var f = r.__webglShader.uniforms
  48986. , g = r.program.getUniforms();
  48987. for (var m in f) {
  48988. var v = g[m];
  48989. v && r.uniformsList.push([r.__webglShader.uniforms[m], v])
  48990. }
  48991. (e instanceof n.MeshPhongMaterial || e instanceof n.MeshLambertMaterial || e instanceof n.MeshStandardMaterial || e.lights) && (r.lightsHash = Ue.hash,
  48992. f.ambientLightColor.value = Ue.ambient,
  48993. f.directionalLights.value = Ue.directional,
  48994. f.spotLights.value = Ue.spot,
  48995. f.pointLights.value = Ue.point,
  48996. f.hemisphereLights.value = Ue.hemi,
  48997. f.directionalShadowMap.value = Ue.directionalShadowMap,
  48998. f.directionalShadowMatrix.value = Ue.directionalShadowMatrix,
  48999. f.spotShadowMap.value = Ue.spotShadowMap,
  49000. f.spotShadowMatrix.value = Ue.spotShadowMatrix,
  49001. f.pointShadowMap.value = Ue.pointShadowMap,
  49002. f.pointShadowMatrix.value = Ue.pointShadowMatrix),
  49003. r.hasDynamicUniforms = !1;
  49004. for (var A = 0, y = r.uniformsList.length; A < y; A++) {
  49005. var C = r.uniformsList[A][0];
  49006. if (C.dynamic === !0) {
  49007. r.hasDynamicUniforms = !0;
  49008. break
  49009. }
  49010. }
  49011. }
  49012. function E(e) {
  49013. b(e),
  49014. 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),
  49015. Ye.setDepthFunc(e.depthFunc),
  49016. Ye.setDepthTest(e.depthTest),
  49017. Ye.setDepthWrite(e.depthWrite),
  49018. Ye.setColorWrite(e.colorWrite),
  49019. Ye.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  49020. }
  49021. function b(e) {
  49022. e.side !== n.DoubleSide ? Ye.enable(Ge.CULL_FACE) : Ye.disable(Ge.CULL_FACE),
  49023. Ye.setFlipSided(e.side === n.BackSide)
  49024. }
  49025. function w(e, t, i, r) {
  49026. xe = 0;
  49027. var o = Xe.get(i);
  49028. void 0 === o.program && (i.needsUpdate = !0),
  49029. void 0 !== o.lightsHash && o.lightsHash !== Ue.hash && (i.needsUpdate = !0),
  49030. i.needsUpdate && (I(i, t, r),
  49031. i.needsUpdate = !1);
  49032. var a = !1
  49033. , s = !1
  49034. , l = !1
  49035. , c = o.program
  49036. , h = c.getUniforms()
  49037. , u = o.__webglShader.uniforms;
  49038. if (c.id !== Ae && (Ge.useProgram(c.program),
  49039. Ae = c.id,
  49040. a = !0,
  49041. s = !0,
  49042. l = !0),
  49043. i.id !== Ie && (Ie = i.id,
  49044. s = !0),
  49045. (a || e !== be) && (Ge.uniformMatrix4fv(h.projectionMatrix, !1, e.projectionMatrix.elements),
  49046. je.logarithmicDepthBuffer && Ge.uniform1f(h.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  49047. e !== be && (be = e,
  49048. s = !0,
  49049. l = !0),
  49050. (i instanceof n.ShaderMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial || i.envMap) && void 0 !== h.cameraPosition && (Ve.setFromMatrixPosition(e.matrixWorld),
  49051. Ge.uniform3f(h.cameraPosition, Ve.x, Ve.y, Ve.z)),
  49052. (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),
  49053. void 0 !== h.toneMappingExposure && Ge.uniform1f(h.toneMappingExposure, ve.toneMappingExposure),
  49054. void 0 !== h.toneMappingWhitePoint && Ge.uniform1f(h.toneMappingWhitePoint, ve.toneMappingWhitePoint)),
  49055. i.skinning)
  49056. if (r.bindMatrix && void 0 !== h.bindMatrix && Ge.uniformMatrix4fv(h.bindMatrix, !1, r.bindMatrix.elements),
  49057. r.bindMatrixInverse && void 0 !== h.bindMatrixInverse && Ge.uniformMatrix4fv(h.bindMatrixInverse, !1, r.bindMatrixInverse.elements),
  49058. je.floatVertexTextures && r.skeleton && r.skeleton.useVertexTexture) {
  49059. if (void 0 !== h.boneTexture) {
  49060. var d = B();
  49061. Ge.uniform1i(h.boneTexture, d),
  49062. ve.setTexture(r.skeleton.boneTexture, d)
  49063. }
  49064. void 0 !== h.boneTextureWidth && Ge.uniform1i(h.boneTextureWidth, r.skeleton.boneTextureWidth),
  49065. void 0 !== h.boneTextureHeight && Ge.uniform1i(h.boneTextureHeight, r.skeleton.boneTextureHeight)
  49066. } else
  49067. r.skeleton && r.skeleton.boneMatrices && void 0 !== h.boneGlobalMatrices && Ge.uniformMatrix4fv(h.boneGlobalMatrices, !1, r.skeleton.boneMatrices);
  49068. return s && ((i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshStandardMaterial || i.lights) && D(u, l),
  49069. t && i.fog && R(u, t),
  49070. (i instanceof n.MeshBasicMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial) && T(u, i),
  49071. i instanceof n.LineBasicMaterial ? x(u, i) : i instanceof n.LineDashedMaterial ? (x(u, i),
  49072. 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,
  49073. u.mFar.value = e.far,
  49074. u.opacity.value = i.opacity) : i instanceof n.MeshNormalMaterial && (u.opacity.value = i.opacity),
  49075. V(o.uniformsList)),
  49076. N(h, r),
  49077. void 0 !== h.modelMatrix && Ge.uniformMatrix4fv(h.modelMatrix, !1, r.matrixWorld.elements),
  49078. o.hasDynamicUniforms === !0 && _(o.uniformsList, r, e),
  49079. c
  49080. }
  49081. function _(e, t, i) {
  49082. for (var n = [], r = 0, o = e.length; r < o; r++) {
  49083. var a = e[r][0]
  49084. , s = a.onUpdateCallback;
  49085. void 0 !== s && (s.bind(a)(t, i),
  49086. n.push(e[r]))
  49087. }
  49088. V(n)
  49089. }
  49090. function T(e, t) {
  49091. e.opacity.value = t.opacity,
  49092. e.diffuse.value = t.color,
  49093. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  49094. e.map.value = t.map,
  49095. e.specularMap.value = t.specularMap,
  49096. e.alphaMap.value = t.alphaMap,
  49097. t.aoMap && (e.aoMap.value = t.aoMap,
  49098. e.aoMapIntensity.value = t.aoMapIntensity);
  49099. var i;
  49100. 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),
  49101. void 0 !== i) {
  49102. i instanceof n.WebGLRenderTarget && (i = i.texture);
  49103. var r = i.offset
  49104. , o = i.repeat;
  49105. e.offsetRepeat.value.set(r.x, r.y, o.x, o.y)
  49106. }
  49107. e.envMap.value = t.envMap,
  49108. e.flipEnvMap.value = t.envMap instanceof n.WebGLRenderTargetCube ? 1 : -1,
  49109. e.reflectivity.value = t.reflectivity,
  49110. e.refractionRatio.value = t.refractionRatio
  49111. }
  49112. function x(e, t) {
  49113. e.diffuse.value = t.color,
  49114. e.opacity.value = t.opacity
  49115. }
  49116. function S(e, t) {
  49117. e.dashSize.value = t.dashSize,
  49118. e.totalSize.value = t.dashSize + t.gapSize,
  49119. e.scale.value = t.scale
  49120. }
  49121. function M(e, t) {
  49122. if (e.diffuse.value = t.color,
  49123. e.opacity.value = t.opacity,
  49124. e.size.value = t.size * Oe,
  49125. e.scale.value = te.clientHeight / 2,
  49126. e.map.value = t.map,
  49127. null !== t.map) {
  49128. var i = t.map.offset
  49129. , n = t.map.repeat;
  49130. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  49131. }
  49132. }
  49133. function R(e, t) {
  49134. e.fogColor.value = t.color,
  49135. t instanceof n.Fog ? (e.fogNear.value = t.near,
  49136. e.fogFar.value = t.far) : t instanceof n.FogExp2 && (e.fogDensity.value = t.density)
  49137. }
  49138. function P(e, t) {
  49139. t.lightMap && (e.lightMap.value = t.lightMap,
  49140. e.lightMapIntensity.value = t.lightMapIntensity),
  49141. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  49142. }
  49143. function O(e, t) {
  49144. e.specular.value = t.specular,
  49145. e.shininess.value = Math.max(t.shininess, 1e-4),
  49146. t.lightMap && (e.lightMap.value = t.lightMap,
  49147. e.lightMapIntensity.value = t.lightMapIntensity),
  49148. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  49149. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  49150. e.bumpScale.value = t.bumpScale),
  49151. t.normalMap && (e.normalMap.value = t.normalMap,
  49152. e.normalScale.value.copy(t.normalScale)),
  49153. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  49154. e.displacementScale.value = t.displacementScale,
  49155. e.displacementBias.value = t.displacementBias)
  49156. }
  49157. function L(e, t) {
  49158. e.roughness.value = t.roughness,
  49159. e.metalness.value = t.metalness,
  49160. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  49161. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  49162. t.lightMap && (e.lightMap.value = t.lightMap,
  49163. e.lightMapIntensity.value = t.lightMapIntensity),
  49164. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  49165. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  49166. e.bumpScale.value = t.bumpScale),
  49167. t.normalMap && (e.normalMap.value = t.normalMap,
  49168. e.normalScale.value.copy(t.normalScale)),
  49169. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  49170. e.displacementScale.value = t.displacementScale,
  49171. e.displacementBias.value = t.displacementBias),
  49172. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  49173. }
  49174. function D(e, t) {
  49175. e.ambientLightColor.needsUpdate = t,
  49176. e.directionalLights.needsUpdate = t,
  49177. e.pointLights.needsUpdate = t,
  49178. e.spotLights.needsUpdate = t,
  49179. e.hemisphereLights.needsUpdate = t
  49180. }
  49181. function N(e, t) {
  49182. Ge.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  49183. e.normalMatrix && Ge.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  49184. }
  49185. function B() {
  49186. var e = xe;
  49187. return e >= je.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + je.maxTextures),
  49188. xe += 1,
  49189. e
  49190. }
  49191. function F(e, t, i, r) {
  49192. var o, a;
  49193. if ("1i" === t)
  49194. Ge.uniform1i(i, r);
  49195. else if ("1f" === t)
  49196. Ge.uniform1f(i, r);
  49197. else if ("2f" === t)
  49198. Ge.uniform2f(i, r[0], r[1]);
  49199. else if ("3f" === t)
  49200. Ge.uniform3f(i, r[0], r[1], r[2]);
  49201. else if ("4f" === t)
  49202. Ge.uniform4f(i, r[0], r[1], r[2], r[3]);
  49203. else if ("1iv" === t)
  49204. Ge.uniform1iv(i, r);
  49205. else if ("3iv" === t)
  49206. Ge.uniform3iv(i, r);
  49207. else if ("1fv" === t)
  49208. Ge.uniform1fv(i, r);
  49209. else if ("2fv" === t)
  49210. Ge.uniform2fv(i, r);
  49211. else if ("3fv" === t)
  49212. Ge.uniform3fv(i, r);
  49213. else if ("4fv" === t)
  49214. Ge.uniform4fv(i, r);
  49215. else if ("Matrix2fv" === t)
  49216. Ge.uniformMatrix2fv(i, !1, r);
  49217. else if ("Matrix3fv" === t)
  49218. Ge.uniformMatrix3fv(i, !1, r);
  49219. else if ("Matrix4fv" === t)
  49220. Ge.uniformMatrix4fv(i, !1, r);
  49221. else if ("i" === t)
  49222. Ge.uniform1i(i, r);
  49223. else if ("f" === t)
  49224. Ge.uniform1f(i, r);
  49225. else if ("v2" === t)
  49226. Ge.uniform2f(i, r.x, r.y);
  49227. else if ("v3" === t)
  49228. Ge.uniform3f(i, r.x, r.y, r.z);
  49229. else if ("v4" === t)
  49230. Ge.uniform4f(i, r.x, r.y, r.z, r.w);
  49231. else if ("c" === t)
  49232. Ge.uniform3f(i, r.r, r.g, r.b);
  49233. else if ("s" === t) {
  49234. var s = e.properties;
  49235. for (var l in s) {
  49236. var c = s[l]
  49237. , h = i[l]
  49238. , u = r[l];
  49239. F(c, c.type, h, u)
  49240. }
  49241. } else if ("sa" === t)
  49242. for (var s = e.properties, d = 0, p = r.length; d < p; d++)
  49243. for (var l in s) {
  49244. var c = s[l]
  49245. , h = i[d][l]
  49246. , u = r[d][l];
  49247. F(c, c.type, h, u)
  49248. }
  49249. else if ("iv1" === t)
  49250. Ge.uniform1iv(i, r);
  49251. else if ("iv" === t)
  49252. Ge.uniform3iv(i, r);
  49253. else if ("fv1" === t)
  49254. Ge.uniform1fv(i, r);
  49255. else if ("fv" === t)
  49256. Ge.uniform3fv(i, r);
  49257. else if ("v2v" === t) {
  49258. void 0 === e._array && (e._array = new Float32Array(2 * r.length));
  49259. for (var d = 0, f = 0, g = r.length; d < g; d++,
  49260. f += 2)
  49261. e._array[f + 0] = r[d].x,
  49262. e._array[f + 1] = r[d].y;
  49263. Ge.uniform2fv(i, e._array)
  49264. } else if ("v3v" === t) {
  49265. void 0 === e._array && (e._array = new Float32Array(3 * r.length));
  49266. for (var d = 0, m = 0, g = r.length; d < g; d++,
  49267. m += 3)
  49268. e._array[m + 0] = r[d].x,
  49269. e._array[m + 1] = r[d].y,
  49270. e._array[m + 2] = r[d].z;
  49271. Ge.uniform3fv(i, e._array)
  49272. } else if ("v4v" === t) {
  49273. void 0 === e._array && (e._array = new Float32Array(4 * r.length));
  49274. for (var d = 0, v = 0, g = r.length; d < g; d++,
  49275. v += 4)
  49276. e._array[v + 0] = r[d].x,
  49277. e._array[v + 1] = r[d].y,
  49278. e._array[v + 2] = r[d].z,
  49279. e._array[v + 3] = r[d].w;
  49280. Ge.uniform4fv(i, e._array)
  49281. } else if ("m2" === t)
  49282. Ge.uniformMatrix2fv(i, !1, r.elements);
  49283. else if ("m3" === t)
  49284. Ge.uniformMatrix3fv(i, !1, r.elements);
  49285. else if ("m3v" === t) {
  49286. void 0 === e._array && (e._array = new Float32Array(9 * r.length));
  49287. for (var d = 0, g = r.length; d < g; d++)
  49288. r[d].flattenToArrayOffset(e._array, 9 * d);
  49289. Ge.uniformMatrix3fv(i, !1, e._array)
  49290. } else if ("m4" === t)
  49291. Ge.uniformMatrix4fv(i, !1, r.elements);
  49292. else if ("m4v" === t) {
  49293. void 0 === e._array && (e._array = new Float32Array(16 * r.length));
  49294. for (var d = 0, g = r.length; d < g; d++)
  49295. r[d].flattenToArrayOffset(e._array, 16 * d);
  49296. Ge.uniformMatrix4fv(i, !1, e._array)
  49297. } else if ("t" === t) {
  49298. if (o = r,
  49299. a = B(),
  49300. Ge.uniform1i(i, a),
  49301. !o)
  49302. return;
  49303. 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)
  49304. } else if ("tv" === t) {
  49305. void 0 === e._array && (e._array = []);
  49306. for (var d = 0, g = e.value.length; d < g; d++)
  49307. e._array[d] = B();
  49308. Ge.uniform1iv(i, e._array);
  49309. for (var d = 0, g = e.value.length; d < g; d++)
  49310. o = e.value[d],
  49311. a = e._array[d],
  49312. 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))
  49313. } else
  49314. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  49315. }
  49316. function V(e) {
  49317. for (var t = 0, i = e.length; t < i; t++) {
  49318. var n = e[t][0];
  49319. if (n.needsUpdate !== !1) {
  49320. var r = n.type
  49321. , o = e[t][1]
  49322. , a = n.value;
  49323. F(n, r, o, a)
  49324. }
  49325. }
  49326. }
  49327. function U(e, t) {
  49328. 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;
  49329. for (Ue.shadowsPointLight = 0,
  49330. i = 0,
  49331. r = e.length; i < r; i++)
  49332. if (o = e[i],
  49333. a = o.color,
  49334. s = o.intensity,
  49335. l = o.distance,
  49336. o instanceof n.AmbientLight)
  49337. c += a.r * s,
  49338. h += a.g * s,
  49339. u += a.b * s;
  49340. else if (o instanceof n.DirectionalLight) {
  49341. var A = Ke.get(o);
  49342. A.color.copy(o.color).multiplyScalar(o.intensity),
  49343. A.direction.setFromMatrixPosition(o.matrixWorld),
  49344. Ve.setFromMatrixPosition(o.target.matrixWorld),
  49345. A.direction.sub(Ve),
  49346. A.direction.transformDirection(d),
  49347. A.shadow = o.castShadow,
  49348. o.castShadow && (A.shadowBias = o.shadow.bias,
  49349. A.shadowRadius = o.shadow.radius,
  49350. A.shadowMapSize = o.shadow.mapSize,
  49351. Ue.shadows[v++] = o),
  49352. Ue.directionalShadowMap[p] = o.shadow.map,
  49353. Ue.directionalShadowMatrix[p] = o.shadow.matrix,
  49354. Ue.directional[p++] = A
  49355. } else if (o instanceof n.SpotLight) {
  49356. var A = Ke.get(o);
  49357. A.position.setFromMatrixPosition(o.matrixWorld),
  49358. A.position.applyMatrix4(d),
  49359. A.color.copy(a).multiplyScalar(s),
  49360. A.distance = l,
  49361. A.direction.setFromMatrixPosition(o.matrixWorld),
  49362. Ve.setFromMatrixPosition(o.target.matrixWorld),
  49363. A.direction.sub(Ve),
  49364. A.direction.transformDirection(d),
  49365. A.coneCos = Math.cos(o.angle),
  49366. A.penumbraCos = Math.cos(o.angle * (1 - o.penumbra)),
  49367. A.decay = 0 === o.distance ? 0 : o.decay,
  49368. A.shadow = o.castShadow,
  49369. o.castShadow && (A.shadowBias = o.shadow.bias,
  49370. A.shadowRadius = o.shadow.radius,
  49371. A.shadowMapSize = o.shadow.mapSize,
  49372. Ue.shadows[v++] = o),
  49373. Ue.spotShadowMap[g] = o.shadow.map,
  49374. Ue.spotShadowMatrix[g] = o.shadow.matrix,
  49375. Ue.spot[g++] = A
  49376. } else if (o instanceof n.PointLight) {
  49377. var A = Ke.get(o);
  49378. A.position.setFromMatrixPosition(o.matrixWorld),
  49379. A.position.applyMatrix4(d),
  49380. A.color.copy(o.color).multiplyScalar(o.intensity),
  49381. A.distance = o.distance,
  49382. A.decay = 0 === o.distance ? 0 : o.decay,
  49383. A.shadow = o.castShadow,
  49384. o.castShadow && (A.shadowBias = o.shadow.bias,
  49385. A.shadowRadius = o.shadow.radius,
  49386. A.shadowMapSize = o.shadow.mapSize,
  49387. Ue.shadows[v++] = o),
  49388. Ue.pointShadowMap[f] = o.shadow.map,
  49389. void 0 === Ue.pointShadowMatrix[f] && (Ue.pointShadowMatrix[f] = new n.Matrix4),
  49390. Ve.setFromMatrixPosition(o.matrixWorld).negate(),
  49391. Ue.pointShadowMatrix[f].identity().setPosition(Ve),
  49392. Ue.point[f++] = A
  49393. } else if (o instanceof n.HemisphereLight) {
  49394. var A = Ke.get(o);
  49395. A.direction.setFromMatrixPosition(o.matrixWorld),
  49396. A.direction.transformDirection(d),
  49397. A.direction.normalize(),
  49398. A.skyColor.copy(o.color).multiplyScalar(s),
  49399. A.groundColor.copy(o.groundColor).multiplyScalar(s),
  49400. Ue.hemi[m++] = A
  49401. }
  49402. Ue.ambient[0] = c,
  49403. Ue.ambient[1] = h,
  49404. Ue.ambient[2] = u,
  49405. Ue.directional.length = p,
  49406. Ue.spot.length = g,
  49407. Ue.point.length = f,
  49408. Ue.hemi.length = m,
  49409. Ue.shadows.length = v,
  49410. Ue.hash = p + "," + f + "," + g + "," + m + "," + v
  49411. }
  49412. function k(e, t, i) {
  49413. var r;
  49414. if (i ? (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, ee(t.wrapS)),
  49415. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, ee(t.wrapT)),
  49416. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, ee(t.magFilter)),
  49417. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, ee(t.minFilter))) : (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, Ge.CLAMP_TO_EDGE),
  49418. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, Ge.CLAMP_TO_EDGE),
  49419. 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),
  49420. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, $(t.magFilter)),
  49421. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, $(t.minFilter)),
  49422. 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)),
  49423. r = We.get("EXT_texture_filter_anisotropic")) {
  49424. if (t.type === n.FloatType && null === We.get("OES_texture_float_linear"))
  49425. return;
  49426. if (t.type === n.HalfFloatType && null === We.get("OES_texture_half_float_linear"))
  49427. return;
  49428. (t.anisotropy > 1 || Xe.get(t).__currentAnisotropy) && (Ge.texParameterf(e, r.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, ve.getMaxAnisotropy())),
  49429. Xe.get(t).__currentAnisotropy = t.anisotropy)
  49430. }
  49431. }
  49432. function H(e, t, i) {
  49433. void 0 === e.__webglInit && (e.__webglInit = !0,
  49434. t.addEventListener("dispose", s),
  49435. e.__webglTexture = Ge.createTexture(),
  49436. ke.textures++),
  49437. Ye.activeTexture(Ge.TEXTURE0 + i),
  49438. Ye.bindTexture(Ge.TEXTURE_2D, e.__webglTexture),
  49439. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, t.flipY),
  49440. Ge.pixelStorei(Ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  49441. Ge.pixelStorei(Ge.UNPACK_ALIGNMENT, t.unpackAlignment);
  49442. var r = G(t.image, je.maxTextureSize);
  49443. W(t) && z(r) === !1 && (r = j(r));
  49444. var o = z(r)
  49445. , a = ee(t.format)
  49446. , l = ee(t.type);
  49447. k(Ge.TEXTURE_2D, t, o);
  49448. var c, h = t.mipmaps;
  49449. if (t instanceof n.DataTexture)
  49450. if (h.length > 0 && o) {
  49451. for (var u = 0, d = h.length; u < d; u++)
  49452. c = h[u],
  49453. Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  49454. t.generateMipmaps = !1
  49455. } else
  49456. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, r.width, r.height, 0, a, l, r.data);
  49457. else if (t instanceof n.CompressedTexture)
  49458. for (var u = 0, d = h.length; u < d; u++)
  49459. c = h[u],
  49460. 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);
  49461. else if (h.length > 0 && o) {
  49462. for (var u = 0, d = h.length; u < d; u++)
  49463. c = h[u],
  49464. Ye.texImage2D(Ge.TEXTURE_2D, u, a, a, l, c);
  49465. t.generateMipmaps = !1
  49466. } else
  49467. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, a, l, r);
  49468. t.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  49469. e.__version = t.version,
  49470. t.onUpdate && t.onUpdate(t)
  49471. }
  49472. function G(e, t) {
  49473. if (e.width > t || e.height > t) {
  49474. var i = t / Math.max(e.width, e.height)
  49475. , n = document.createElement("canvas");
  49476. n.width = Math.floor(e.width * i),
  49477. n.height = Math.floor(e.height * i);
  49478. var r = n.getContext("2d");
  49479. return r.drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  49480. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  49481. n
  49482. }
  49483. return e
  49484. }
  49485. function z(e) {
  49486. return n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  49487. }
  49488. function W(e) {
  49489. return e.wrapS !== n.ClampToEdgeWrapping || e.wrapT !== n.ClampToEdgeWrapping || e.minFilter !== n.NearestFilter && e.minFilter !== n.LinearFilter
  49490. }
  49491. function j(e) {
  49492. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  49493. var t = document.createElement("canvas");
  49494. t.width = n.Math.nearestPowerOfTwo(e.width),
  49495. t.height = n.Math.nearestPowerOfTwo(e.height);
  49496. var i = t.getContext("2d");
  49497. return i.drawImage(e, 0, 0, t.width, t.height),
  49498. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  49499. t
  49500. }
  49501. return e
  49502. }
  49503. function Y(e, t) {
  49504. var i = Xe.get(e);
  49505. if (6 === e.image.length)
  49506. if (e.version > 0 && i.__version !== e.version) {
  49507. i.__image__webglTextureCube || (e.addEventListener("dispose", s),
  49508. i.__image__webglTextureCube = Ge.createTexture(),
  49509. ke.textures++),
  49510. Ye.activeTexture(Ge.TEXTURE0 + t),
  49511. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  49512. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, e.flipY);
  49513. for (var r = e instanceof n.CompressedTexture, o = e.image[0]instanceof n.DataTexture, a = [], l = 0; l < 6; l++)
  49514. !ve.autoScaleCubemaps || r || o ? a[l] = o ? e.image[l].image : e.image[l] : a[l] = G(e.image[l], je.maxCubemapSize);
  49515. var c = a[0]
  49516. , h = z(c)
  49517. , u = ee(e.format)
  49518. , d = ee(e.type);
  49519. k(Ge.TEXTURE_CUBE_MAP, e, h);
  49520. for (var l = 0; l < 6; l++)
  49521. if (r)
  49522. for (var p, f = a[l].mipmaps, g = 0, m = f.length; g < m; g++)
  49523. p = f[g],
  49524. 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);
  49525. else
  49526. 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]);
  49527. e.generateMipmaps && h && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  49528. i.__version = e.version,
  49529. e.onUpdate && e.onUpdate(e)
  49530. } else
  49531. Ye.activeTexture(Ge.TEXTURE0 + t),
  49532. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  49533. }
  49534. function X(e, t) {
  49535. Ye.activeTexture(Ge.TEXTURE0 + t),
  49536. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, Xe.get(e).__webglTexture)
  49537. }
  49538. function Z(e, t, i, n) {
  49539. var r = ee(t.texture.format)
  49540. , o = ee(t.texture.type);
  49541. Ye.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  49542. Ge.bindFramebuffer(Ge.FRAMEBUFFER, e),
  49543. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, i, n, Xe.get(t.texture).__webglTexture, 0),
  49544. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  49545. }
  49546. function q(e, t) {
  49547. Ge.bindRenderbuffer(Ge.RENDERBUFFER, e),
  49548. t.depthBuffer && !t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_COMPONENT16, t.width, t.height),
  49549. 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),
  49550. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_STENCIL_ATTACHMENT, Ge.RENDERBUFFER, e)) : Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.RGBA4, t.width, t.height),
  49551. Ge.bindRenderbuffer(Ge.RENDERBUFFER, null)
  49552. }
  49553. function K(e) {
  49554. var t = Xe.get(e)
  49555. , i = e instanceof n.WebGLRenderTargetCube;
  49556. if (i) {
  49557. t.__webglDepthbuffer = [];
  49558. for (var r = 0; r < 6; r++)
  49559. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer[r]),
  49560. t.__webglDepthbuffer[r] = Ge.createRenderbuffer(),
  49561. q(t.__webglDepthbuffer[r], e)
  49562. } else
  49563. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer),
  49564. t.__webglDepthbuffer = Ge.createRenderbuffer(),
  49565. q(t.__webglDepthbuffer, e);
  49566. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  49567. }
  49568. function Q(e) {
  49569. var t = Xe.get(e)
  49570. , i = Xe.get(e.texture);
  49571. e.addEventListener("dispose", l),
  49572. i.__webglTexture = Ge.createTexture(),
  49573. ke.textures++;
  49574. var r = e instanceof n.WebGLRenderTargetCube
  49575. , o = n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height);
  49576. if (r) {
  49577. t.__webglFramebuffer = [];
  49578. for (var a = 0; a < 6; a++)
  49579. t.__webglFramebuffer[a] = Ge.createFramebuffer()
  49580. } else
  49581. t.__webglFramebuffer = Ge.createFramebuffer();
  49582. if (r) {
  49583. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__webglTexture),
  49584. k(Ge.TEXTURE_CUBE_MAP, e.texture, o);
  49585. for (var a = 0; a < 6; a++)
  49586. Z(t.__webglFramebuffer[a], e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + a);
  49587. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  49588. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, null)
  49589. } else
  49590. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture),
  49591. k(Ge.TEXTURE_2D, e.texture, o),
  49592. Z(t.__webglFramebuffer, e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_2D),
  49593. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  49594. Ye.bindTexture(Ge.TEXTURE_2D, null);
  49595. e.depthBuffer && K(e)
  49596. }
  49597. function J(e) {
  49598. var t = e instanceof n.WebGLRenderTargetCube ? Ge.TEXTURE_CUBE_MAP : Ge.TEXTURE_2D
  49599. , i = Xe.get(e.texture).__webglTexture;
  49600. Ye.bindTexture(t, i),
  49601. Ge.generateMipmap(t),
  49602. Ye.bindTexture(t, null)
  49603. }
  49604. function $(e) {
  49605. return e === n.NearestFilter || e === n.NearestMipMapNearestFilter || e === n.NearestMipMapLinearFilter ? Ge.NEAREST : Ge.LINEAR
  49606. }
  49607. function ee(e) {
  49608. var t;
  49609. if (e === n.RepeatWrapping)
  49610. return Ge.REPEAT;
  49611. if (e === n.ClampToEdgeWrapping)
  49612. return Ge.CLAMP_TO_EDGE;
  49613. if (e === n.MirroredRepeatWrapping)
  49614. return Ge.MIRRORED_REPEAT;
  49615. if (e === n.NearestFilter)
  49616. return Ge.NEAREST;
  49617. if (e === n.NearestMipMapNearestFilter)
  49618. return Ge.NEAREST_MIPMAP_NEAREST;
  49619. if (e === n.NearestMipMapLinearFilter)
  49620. return Ge.NEAREST_MIPMAP_LINEAR;
  49621. if (e === n.LinearFilter)
  49622. return Ge.LINEAR;
  49623. if (e === n.LinearMipMapNearestFilter)
  49624. return Ge.LINEAR_MIPMAP_NEAREST;
  49625. if (e === n.LinearMipMapLinearFilter)
  49626. return Ge.LINEAR_MIPMAP_LINEAR;
  49627. if (e === n.UnsignedByteType)
  49628. return Ge.UNSIGNED_BYTE;
  49629. if (e === n.UnsignedShort4444Type)
  49630. return Ge.UNSIGNED_SHORT_4_4_4_4;
  49631. if (e === n.UnsignedShort5551Type)
  49632. return Ge.UNSIGNED_SHORT_5_5_5_1;
  49633. if (e === n.UnsignedShort565Type)
  49634. return Ge.UNSIGNED_SHORT_5_6_5;
  49635. if (e === n.ByteType)
  49636. return Ge.BYTE;
  49637. if (e === n.ShortType)
  49638. return Ge.SHORT;
  49639. if (e === n.UnsignedShortType)
  49640. return Ge.UNSIGNED_SHORT;
  49641. if (e === n.IntType)
  49642. return Ge.INT;
  49643. if (e === n.UnsignedIntType)
  49644. return Ge.UNSIGNED_INT;
  49645. if (e === n.FloatType)
  49646. return Ge.FLOAT;
  49647. if (t = We.get("OES_texture_half_float"),
  49648. null !== t && e === n.HalfFloatType)
  49649. return t.HALF_FLOAT_OES;
  49650. if (e === n.AlphaFormat)
  49651. return Ge.ALPHA;
  49652. if (e === n.RGBFormat)
  49653. return Ge.RGB;
  49654. if (e === n.RGBAFormat)
  49655. return Ge.RGBA;
  49656. if (e === n.LuminanceFormat)
  49657. return Ge.LUMINANCE;
  49658. if (e === n.LuminanceAlphaFormat)
  49659. return Ge.LUMINANCE_ALPHA;
  49660. if (e === n.AddEquation)
  49661. return Ge.FUNC_ADD;
  49662. if (e === n.SubtractEquation)
  49663. return Ge.FUNC_SUBTRACT;
  49664. if (e === n.ReverseSubtractEquation)
  49665. return Ge.FUNC_REVERSE_SUBTRACT;
  49666. if (e === n.ZeroFactor)
  49667. return Ge.ZERO;
  49668. if (e === n.OneFactor)
  49669. return Ge.ONE;
  49670. if (e === n.SrcColorFactor)
  49671. return Ge.SRC_COLOR;
  49672. if (e === n.OneMinusSrcColorFactor)
  49673. return Ge.ONE_MINUS_SRC_COLOR;
  49674. if (e === n.SrcAlphaFactor)
  49675. return Ge.SRC_ALPHA;
  49676. if (e === n.OneMinusSrcAlphaFactor)
  49677. return Ge.ONE_MINUS_SRC_ALPHA;
  49678. if (e === n.DstAlphaFactor)
  49679. return Ge.DST_ALPHA;
  49680. if (e === n.OneMinusDstAlphaFactor)
  49681. return Ge.ONE_MINUS_DST_ALPHA;
  49682. if (e === n.DstColorFactor)
  49683. return Ge.DST_COLOR;
  49684. if (e === n.OneMinusDstColorFactor)
  49685. return Ge.ONE_MINUS_DST_COLOR;
  49686. if (e === n.SrcAlphaSaturateFactor)
  49687. return Ge.SRC_ALPHA_SATURATE;
  49688. if (t = We.get("WEBGL_compressed_texture_s3tc"),
  49689. null !== t) {
  49690. if (e === n.RGB_S3TC_DXT1_Format)
  49691. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  49692. if (e === n.RGBA_S3TC_DXT1_Format)
  49693. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  49694. if (e === n.RGBA_S3TC_DXT3_Format)
  49695. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  49696. if (e === n.RGBA_S3TC_DXT5_Format)
  49697. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  49698. }
  49699. if (t = We.get("WEBGL_compressed_texture_pvrtc"),
  49700. null !== t) {
  49701. if (e === n.RGB_PVRTC_4BPPV1_Format)
  49702. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  49703. if (e === n.RGB_PVRTC_2BPPV1_Format)
  49704. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  49705. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  49706. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  49707. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  49708. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  49709. }
  49710. if (t = We.get("WEBGL_compressed_texture_etc1"),
  49711. null !== t && e === n.RGB_ETC1_Format)
  49712. return t.COMPRESSED_RGB_ETC1_WEBGL;
  49713. if (t = We.get("EXT_blend_minmax"),
  49714. null !== t) {
  49715. if (e === n.MinEquation)
  49716. return t.MIN_EXT;
  49717. if (e === n.MaxEquation)
  49718. return t.MAX_EXT
  49719. }
  49720. return 0
  49721. }
  49722. console.log("THREE.WebGLRenderer", n.REVISION),
  49723. e = e || {};
  49724. var te = void 0 !== e.canvas ? e.canvas : document.createElement("canvas")
  49725. , ie = void 0 !== e.context ? e.context : null
  49726. , ne = void 0 !== e.alpha && e.alpha
  49727. , re = void 0 === e.depth || e.depth
  49728. , oe = void 0 === e.stencil || e.stencil
  49729. , ae = void 0 !== e.antialias && e.antialias
  49730. , se = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  49731. , le = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  49732. , ce = []
  49733. , he = []
  49734. , ue = -1
  49735. , de = []
  49736. , pe = -1
  49737. , fe = new Float32Array(8)
  49738. , ge = []
  49739. , me = [];
  49740. this.domElement = te,
  49741. this.context = null,
  49742. this.autoClear = !0,
  49743. this.autoClearColor = !0,
  49744. this.autoClearDepth = !0,
  49745. this.autoClearStencil = !0,
  49746. this.sortObjects = !0,
  49747. this.gammaFactor = 2,
  49748. this.gammaInput = !1,
  49749. this.gammaOutput = !1,
  49750. this.physicallyCorrectLights = !1,
  49751. this.toneMapping = n.LinearToneMapping,
  49752. this.toneMappingExposure = 1,
  49753. this.toneMappingWhitePoint = 1,
  49754. this.maxMorphTargets = 8,
  49755. this.maxMorphNormals = 4,
  49756. this.autoScaleCubemaps = !0;
  49757. var ve = this
  49758. , Ae = null
  49759. , ye = null
  49760. , Ce = null
  49761. , Ie = -1
  49762. , Ee = ""
  49763. , be = null
  49764. , we = new n.Vector4
  49765. , _e = null
  49766. , Te = new n.Vector4
  49767. , xe = 0
  49768. , Se = new n.Color(0)
  49769. , Me = 0
  49770. , Re = te.width
  49771. , Pe = te.height
  49772. , Oe = 1
  49773. , Le = new n.Vector4(0,0,Re,Pe)
  49774. , De = !1
  49775. , Ne = new n.Vector4(0,0,Re,Pe)
  49776. , Be = new n.Frustum
  49777. , Fe = new n.Matrix4
  49778. , Ve = new n.Vector3
  49779. , Ue = {
  49780. hash: "",
  49781. ambient: [0, 0, 0],
  49782. directional: [],
  49783. directionalShadowMap: [],
  49784. directionalShadowMatrix: [],
  49785. spot: [],
  49786. spotShadowMap: [],
  49787. spotShadowMatrix: [],
  49788. point: [],
  49789. pointShadowMap: [],
  49790. pointShadowMatrix: [],
  49791. hemi: [],
  49792. shadows: [],
  49793. shadowsPointLight: 0
  49794. }
  49795. , ke = {
  49796. geometries: 0,
  49797. textures: 0
  49798. }
  49799. , He = {
  49800. calls: 0,
  49801. vertices: 0,
  49802. faces: 0,
  49803. points: 0
  49804. };
  49805. this.info = {
  49806. render: He,
  49807. memory: ke,
  49808. programs: null
  49809. };
  49810. var Ge;
  49811. try {
  49812. var ze = {
  49813. alpha: ne,
  49814. depth: re,
  49815. stencil: oe,
  49816. antialias: ae,
  49817. premultipliedAlpha: se,
  49818. preserveDrawingBuffer: le
  49819. };
  49820. if (Ge = ie || te.getContext("webgl", ze) || te.getContext("experimental-webgl", ze),
  49821. null === Ge)
  49822. throw null !== te.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  49823. void 0 === Ge.getShaderPrecisionFormat && (Ge.getShaderPrecisionFormat = function() {
  49824. return {
  49825. rangeMin: 1,
  49826. rangeMax: 1,
  49827. precision: 1
  49828. }
  49829. }
  49830. ),
  49831. te.addEventListener("webglcontextlost", a, !1)
  49832. } catch (e) {
  49833. console.error("THREE.WebGLRenderer: " + e)
  49834. }
  49835. var We = new n.WebGLExtensions(Ge);
  49836. We.get("OES_texture_float"),
  49837. We.get("OES_texture_float_linear"),
  49838. We.get("OES_texture_half_float"),
  49839. We.get("OES_texture_half_float_linear"),
  49840. We.get("OES_standard_derivatives"),
  49841. We.get("ANGLE_instanced_arrays"),
  49842. We.get("OES_element_index_uint") && (n.BufferGeometry.MaxIndex = 4294967296);
  49843. var je = new n.WebGLCapabilities(Ge,We,e)
  49844. , Ye = new n.WebGLState(Ge,We,ee)
  49845. , Xe = new n.WebGLProperties
  49846. , Ze = new n.WebGLObjects(Ge,Xe,this.info)
  49847. , qe = new n.WebGLPrograms(this,je)
  49848. , Ke = new n.WebGLLights;
  49849. this.info.programs = qe.programs;
  49850. var Qe = new n.WebGLBufferRenderer(Ge,We,He)
  49851. , Je = new n.WebGLIndexedBufferRenderer(Ge,We,He);
  49852. r(),
  49853. this.context = Ge,
  49854. this.capabilities = je,
  49855. this.extensions = We,
  49856. this.properties = Xe,
  49857. this.state = Ye;
  49858. var $e = new n.WebGLShadowMap(this,Ue,Ze);
  49859. this.shadowMap = $e;
  49860. var et = new n.SpritePlugin(this,ge)
  49861. , tt = new n.LensFlarePlugin(this,me);
  49862. this.getContext = function() {
  49863. return Ge
  49864. }
  49865. ,
  49866. this.getContextAttributes = function() {
  49867. return Ge.getContextAttributes()
  49868. }
  49869. ,
  49870. this.forceContextLoss = function() {
  49871. We.get("WEBGL_lose_context").loseContext()
  49872. }
  49873. ,
  49874. this.getMaxAnisotropy = function() {
  49875. var e;
  49876. return function() {
  49877. if (void 0 !== e)
  49878. return e;
  49879. var t = We.get("EXT_texture_filter_anisotropic");
  49880. return e = null !== t ? Ge.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  49881. }
  49882. }(),
  49883. this.getPrecision = function() {
  49884. return je.precision
  49885. }
  49886. ,
  49887. this.getPixelRatio = function() {
  49888. return Oe
  49889. }
  49890. ,
  49891. this.setPixelRatio = function(e) {
  49892. void 0 !== e && (Oe = e,
  49893. this.setSize(Ne.z, Ne.w, !1))
  49894. }
  49895. ,
  49896. this.getSize = function() {
  49897. return {
  49898. width: Re,
  49899. height: Pe
  49900. }
  49901. }
  49902. ,
  49903. this.setSize = function(e, t, i, devicePixelRatio) {
  49904. if(devicePixelRatio != void 0) Oe = devicePixelRatio; //xzw add 改分辨率 始终保持清晰
  49905. Re = e,
  49906. Pe = t,
  49907. te.width = e * Oe,
  49908. te.height = t * Oe,
  49909. i !== !1 && (te.style.width = e + "px",
  49910. te.style.height = t + "px"),
  49911. this.setViewport(0, 0, e, t)
  49912. }
  49913. ,
  49914. this.setViewport = function(e, t, i, n) {
  49915. Ye.viewport(Ne.set(e, t, i, n))
  49916. }
  49917. ,
  49918. this.setScissor = function(e, t, i, n) {
  49919. Ye.scissor(Le.set(e, t, i, n))
  49920. }
  49921. ,
  49922. this.setScissorTest = function(e) {
  49923. Ye.setScissorTest(De = e)
  49924. }
  49925. ,
  49926. this.getClearColor = function() {
  49927. return Se
  49928. }
  49929. ,
  49930. this.setClearColor = function(e, t) {
  49931. Se.set(e),
  49932. Me = void 0 !== t ? t : 1,
  49933. i(Se.r, Se.g, Se.b, Me)
  49934. }
  49935. ,
  49936. this.getClearAlpha = function() {
  49937. return Me
  49938. }
  49939. ,
  49940. this.setClearAlpha = function(e) {
  49941. Me = e,
  49942. i(Se.r, Se.g, Se.b, Me)
  49943. }
  49944. ,
  49945. this.clear = function(e, t, i) {
  49946. var n = 0;
  49947. (void 0 === e || e) && (n |= Ge.COLOR_BUFFER_BIT),
  49948. (void 0 === t || t) && (n |= Ge.DEPTH_BUFFER_BIT),
  49949. (void 0 === i || i) && (n |= Ge.STENCIL_BUFFER_BIT),
  49950. Ge.clear(n)
  49951. }
  49952. ,
  49953. this.clearColor = function() {
  49954. this.clear(!0, !1, !1)
  49955. }
  49956. ,
  49957. this.clearDepth = function() {
  49958. this.clear(!1, !0, !1)
  49959. }
  49960. ,
  49961. this.clearStencil = function() {
  49962. this.clear(!1, !1, !0)
  49963. }
  49964. ,
  49965. this.clearTarget = function(e, t, i, n) {
  49966. this.setRenderTarget(e),
  49967. this.clear(t, i, n)
  49968. }
  49969. ,
  49970. this.resetGLState = o,
  49971. this.dispose = function() {
  49972. te.removeEventListener("webglcontextlost", a, !1)
  49973. }
  49974. ,
  49975. this.renderBufferImmediate = function(e, t, i) {
  49976. Ye.initAttributes();
  49977. var r = Xe.get(e);
  49978. e.hasPositions && !r.position && (r.position = Ge.createBuffer()),
  49979. e.hasNormals && !r.normal && (r.normal = Ge.createBuffer()),
  49980. e.hasUvs && !r.uv && (r.uv = Ge.createBuffer()),
  49981. e.hasColors && !r.color && (r.color = Ge.createBuffer());
  49982. var o = t.getAttributes();
  49983. if (e.hasPositions && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.position),
  49984. Ge.bufferData(Ge.ARRAY_BUFFER, e.positionArray, Ge.DYNAMIC_DRAW),
  49985. Ye.enableAttribute(o.position),
  49986. Ge.vertexAttribPointer(o.position, 3, Ge.FLOAT, !1, 0, 0)),
  49987. e.hasNormals) {
  49988. if (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.normal),
  49989. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === n.FlatShading)
  49990. for (var a = 0, s = 3 * e.count; a < s; a += 9) {
  49991. var l = e.normalArray
  49992. , c = (l[a + 0] + l[a + 3] + l[a + 6]) / 3
  49993. , h = (l[a + 1] + l[a + 4] + l[a + 7]) / 3
  49994. , u = (l[a + 2] + l[a + 5] + l[a + 8]) / 3;
  49995. l[a + 0] = c,
  49996. l[a + 1] = h,
  49997. l[a + 2] = u,
  49998. l[a + 3] = c,
  49999. l[a + 4] = h,
  50000. l[a + 5] = u,
  50001. l[a + 6] = c,
  50002. l[a + 7] = h,
  50003. l[a + 8] = u
  50004. }
  50005. Ge.bufferData(Ge.ARRAY_BUFFER, e.normalArray, Ge.DYNAMIC_DRAW),
  50006. Ye.enableAttribute(o.normal),
  50007. Ge.vertexAttribPointer(o.normal, 3, Ge.FLOAT, !1, 0, 0)
  50008. }
  50009. e.hasUvs && i.map && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.uv),
  50010. Ge.bufferData(Ge.ARRAY_BUFFER, e.uvArray, Ge.DYNAMIC_DRAW),
  50011. Ye.enableAttribute(o.uv),
  50012. Ge.vertexAttribPointer(o.uv, 2, Ge.FLOAT, !1, 0, 0)),
  50013. e.hasColors && i.vertexColors !== n.NoColors && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.color),
  50014. Ge.bufferData(Ge.ARRAY_BUFFER, e.colorArray, Ge.DYNAMIC_DRAW),
  50015. Ye.enableAttribute(o.color),
  50016. Ge.vertexAttribPointer(o.color, 3, Ge.FLOAT, !1, 0, 0)),
  50017. Ye.disableUnusedAttributes(),
  50018. Ge.drawArrays(Ge.TRIANGLES, 0, e.count),
  50019. e.count = 0
  50020. }
  50021. ,
  50022. this.renderBufferDirect = function(e, i, r, o, a, s) {
  50023. E(o);
  50024. var l = w(e, i, o, a)
  50025. , c = !1
  50026. , h = r.id + "_" + l.id + "_" + o.wireframe;
  50027. h !== Ee && (Ee = h,
  50028. c = !0);
  50029. var u = a.morphTargetInfluences;
  50030. if (void 0 !== u) {
  50031. for (var d = [], p = 0, m = u.length; p < m; p++) {
  50032. var v = u[p];
  50033. d.push([v, p])
  50034. }
  50035. d.sort(g),
  50036. d.length > 8 && (d.length = 8);
  50037. for (var A = r.morphAttributes, p = 0, m = d.length; p < m; p++) {
  50038. var v = d[p];
  50039. if (fe[p] = v[0],
  50040. 0 !== v[0]) {
  50041. var y = v[1];
  50042. o.morphTargets === !0 && A.position && r.addAttribute("morphTarget" + p, A.position[y]),
  50043. o.morphNormals === !0 && A.normal && r.addAttribute("morphNormal" + p, A.normal[y])
  50044. } else
  50045. o.morphTargets === !0 && r.removeAttribute("morphTarget" + p),
  50046. o.morphNormals === !0 && r.removeAttribute("morphNormal" + p)
  50047. }
  50048. var C = l.getUniforms();
  50049. null !== C.morphTargetInfluences && Ge.uniform1fv(C.morphTargetInfluences, fe),
  50050. c = !0
  50051. }
  50052. var y = r.index
  50053. , I = r.attributes.position;
  50054. o.wireframe === !0 && (y = Ze.getWireframeAttribute(r));
  50055. var b;
  50056. null !== y ? (b = Je,
  50057. b.setIndex(y)) : b = Qe,
  50058. c && (f(o, l, r),
  50059. null !== y && Ge.bindBuffer(Ge.ELEMENT_ARRAY_BUFFER, Ze.getAttributeBuffer(y)));
  50060. var _ = 0
  50061. , T = 1 / 0;
  50062. null !== y ? T = y.count : void 0 !== I && (T = I.count);
  50063. var x = r.drawRange.start
  50064. , S = r.drawRange.count
  50065. , M = null !== s ? s.start : 0
  50066. , R = null !== s ? s.count : 1 / 0
  50067. , P = Math.max(_, x, M)
  50068. , O = Math.min(_ + T, x + S, M + R) - 1
  50069. , L = Math.max(0, O - P + 1);
  50070. if (a instanceof n.Mesh)
  50071. if (o.wireframe === !0)
  50072. Ye.setLineWidth(o.wireframeLinewidth * t()),
  50073. b.setMode(Ge.LINES);
  50074. else
  50075. switch (a.drawMode) {
  50076. case n.TrianglesDrawMode:
  50077. b.setMode(Ge.TRIANGLES);
  50078. break;
  50079. case n.TriangleStripDrawMode:
  50080. b.setMode(Ge.TRIANGLE_STRIP);
  50081. break;
  50082. case n.TriangleFanDrawMode:
  50083. b.setMode(Ge.TRIANGLE_FAN)
  50084. }
  50085. else if (a instanceof n.Line) {
  50086. var D = o.linewidth;
  50087. void 0 === D && (D = 1),
  50088. Ye.setLineWidth(D * t()),
  50089. a instanceof n.LineSegments ? b.setMode(Ge.LINES) : b.setMode(Ge.LINE_STRIP)
  50090. } else
  50091. a instanceof n.Points && b.setMode(Ge.POINTS);
  50092. r instanceof n.InstancedBufferGeometry ? r.maxInstancedCount > 0 && b.renderInstances(r, P, L) : b.render(P, L)
  50093. }
  50094. ,
  50095. this.render = function(e, t, i, r) {
  50096. if (t instanceof n.Camera == !1)
  50097. return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");
  50098. var o = e.fog;
  50099. if (Ee = "",
  50100. Ie = -1,
  50101. be = null,
  50102. e.autoUpdate === !0 && e.updateMatrixWorld(),
  50103. null === t.parent && t.updateMatrixWorld(),
  50104. t.matrixWorldInverse.getInverse(t.matrixWorld),
  50105. Fe.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  50106. Be.setFromMatrix(Fe),
  50107. ce.length = 0,
  50108. ue = -1,
  50109. pe = -1,
  50110. ge.length = 0,
  50111. me.length = 0,
  50112. y(e, t),
  50113. he.length = ue + 1,
  50114. de.length = pe + 1,
  50115. ve.sortObjects === !0 && (he.sort(m),
  50116. de.sort(v)),
  50117. U(ce, t),
  50118. $e.render(e, t),
  50119. He.calls = 0,
  50120. He.vertices = 0,
  50121. He.faces = 0,
  50122. He.points = 0,
  50123. void 0 === i && (i = null),
  50124. this.setRenderTarget(i),
  50125. (this.autoClear || r) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  50126. e.overrideMaterial) {
  50127. var a = e.overrideMaterial;
  50128. C(he, t, o, a),
  50129. C(de, t, o, a)
  50130. } else
  50131. Ye.setBlending(n.NoBlending),
  50132. C(he, t, o),
  50133. C(de, t, o);
  50134. if (et.render(e, t),
  50135. tt.render(e, t, Te),
  50136. i) {
  50137. var s = i.texture;
  50138. s.generateMipmaps && z(i) && s.minFilter !== n.NearestFilter && s.minFilter !== n.LinearFilter && J(i)
  50139. }
  50140. Ye.setDepthTest(!0),
  50141. Ye.setDepthWrite(!0),
  50142. Ye.setColorWrite(!0)
  50143. }
  50144. ,
  50145. this.setFaceCulling = function(e, t) {
  50146. e === n.CullFaceNone ? Ye.disable(Ge.CULL_FACE) : (t === n.FrontFaceDirectionCW ? Ge.frontFace(Ge.CW) : Ge.frontFace(Ge.CCW),
  50147. e === n.CullFaceBack ? Ge.cullFace(Ge.BACK) : e === n.CullFaceFront ? Ge.cullFace(Ge.FRONT) : Ge.cullFace(Ge.FRONT_AND_BACK),
  50148. Ye.enable(Ge.CULL_FACE))
  50149. }
  50150. ,
  50151. this.setTexture = function(e, t) {
  50152. var i = Xe.get(e);
  50153. if (e.version > 0 && i.__version !== e.version) {
  50154. var n = e.image;
  50155. 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)
  50156. }
  50157. Ye.activeTexture(Ge.TEXTURE0 + t),
  50158. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture)
  50159. }
  50160. ,
  50161. this.getCurrentRenderTarget = function() {
  50162. return ye
  50163. }
  50164. ,
  50165. this.setRenderTarget = function(e) {
  50166. ye = e,
  50167. e && void 0 === Xe.get(e).__webglFramebuffer && Q(e);
  50168. var t, i = e instanceof n.WebGLRenderTargetCube;
  50169. if (e) {
  50170. var r = Xe.get(e);
  50171. t = i ? r.__webglFramebuffer[e.activeCubeFace] : r.__webglFramebuffer,
  50172. we.copy(e.scissor),
  50173. _e = e.scissorTest,
  50174. Te.copy(e.viewport)
  50175. } else
  50176. t = null,
  50177. we.copy(Le).multiplyScalar(Oe),
  50178. _e = De,
  50179. Te.copy(Ne).multiplyScalar(Oe);
  50180. if (Ce !== t && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, t),
  50181. Ce = t),
  50182. Ye.scissor(we),
  50183. Ye.setScissorTest(_e),
  50184. Ye.viewport(Te),
  50185. i) {
  50186. var o = Xe.get(e.texture);
  50187. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, o.__webglTexture, e.activeMipMapLevel)
  50188. }
  50189. }
  50190. ,
  50191. this.readRenderTargetPixels = function(e, t, i, r, o, a) {
  50192. if (e instanceof n.WebGLRenderTarget == !1)
  50193. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
  50194. var s = Xe.get(e).__webglFramebuffer;
  50195. if (s) {
  50196. var l = !1;
  50197. s !== Ce && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, s),
  50198. l = !0);
  50199. try {
  50200. var c = e.texture;
  50201. if (c.format !== n.RGBAFormat && ee(c.format) !== Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_FORMAT))
  50202. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  50203. 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")))
  50204. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  50205. 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.")
  50206. } finally {
  50207. l && Ge.bindFramebuffer(Ge.FRAMEBUFFER, Ce)
  50208. }
  50209. }
  50210. }
  50211. }
  50212. ,
  50213. n.WebGLRenderTarget = function(e, t, i) {
  50214. this.uuid = n.Math.generateUUID(),
  50215. this.width = e,
  50216. this.height = t,
  50217. this.scissor = new n.Vector4(0,0,e,t),
  50218. this.scissorTest = !1,
  50219. this.viewport = new n.Vector4(0,0,e,t),
  50220. i = i || {},
  50221. void 0 === i.minFilter && (i.minFilter = n.LinearFilter),
  50222. this.texture = new n.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  50223. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  50224. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  50225. }
  50226. ,
  50227. n.WebGLRenderTarget.prototype = {
  50228. constructor: n.WebGLRenderTarget,
  50229. setSize: function(e, t) {
  50230. this.width === e && this.height === t || (this.width = e,
  50231. this.height = t,
  50232. this.dispose()),
  50233. this.viewport.set(0, 0, e, t),
  50234. this.scissor.set(0, 0, e, t)
  50235. },
  50236. clone: function() {
  50237. return (new this.constructor).copy(this)
  50238. },
  50239. copy: function(e) {
  50240. return this.width = e.width,
  50241. this.height = e.height,
  50242. this.viewport.copy(e.viewport),
  50243. this.texture = e.texture.clone(),
  50244. this.depthBuffer = e.depthBuffer,
  50245. this.stencilBuffer = e.stencilBuffer,
  50246. this
  50247. },
  50248. dispose: function() {
  50249. this.dispatchEvent({
  50250. type: "dispose"
  50251. })
  50252. }
  50253. },
  50254. n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),
  50255. n.WebGLRenderTargetCube = function(e, t, i) {
  50256. n.WebGLRenderTarget.call(this, e, t, i),
  50257. this.activeCubeFace = 0,
  50258. this.activeMipMapLevel = 0
  50259. }
  50260. ,
  50261. n.WebGLRenderTargetCube.prototype = Object.create(n.WebGLRenderTarget.prototype),
  50262. n.WebGLRenderTargetCube.prototype.constructor = n.WebGLRenderTargetCube,
  50263. n.WebGLBufferRenderer = function(e, t, i) {
  50264. function r(e) {
  50265. s = e
  50266. }
  50267. function o(t, n) {
  50268. e.drawArrays(s, t, n),
  50269. i.calls++,
  50270. i.vertices += n,
  50271. s === e.TRIANGLES && (i.faces += n / 3)
  50272. }
  50273. function a(r) {
  50274. var o = t.get("ANGLE_instanced_arrays");
  50275. if (null === o)
  50276. return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  50277. var a = r.attributes.position
  50278. , l = 0;
  50279. a instanceof n.InterleavedBufferAttribute ? (l = a.data.count,
  50280. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)) : (l = a.count,
  50281. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)),
  50282. i.calls++,
  50283. i.vertices += l * r.maxInstancedCount,
  50284. s === e.TRIANGLES && (i.faces += r.maxInstancedCount * l / 3)
  50285. }
  50286. var s;
  50287. this.setMode = r,
  50288. this.render = o,
  50289. this.renderInstances = a
  50290. }
  50291. ,
  50292. n.WebGLIndexedBufferRenderer = function(e, t, i) {
  50293. function n(e) {
  50294. s = e
  50295. }
  50296. function r(i) {
  50297. i.array instanceof Uint32Array && t.get("OES_element_index_uint") ? (l = e.UNSIGNED_INT,
  50298. c = 4) : (l = e.UNSIGNED_SHORT,
  50299. c = 2)
  50300. }
  50301. function o(t, n) {
  50302. e.drawElements(s, n, l, t * c),
  50303. i.calls++,
  50304. i.vertices += n,
  50305. s === e.TRIANGLES && (i.faces += n / 3)
  50306. }
  50307. function a(n, r, o) {
  50308. var a = t.get("ANGLE_instanced_arrays");
  50309. 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),
  50310. i.calls++,
  50311. i.vertices += o * n.maxInstancedCount,
  50312. void (s === e.TRIANGLES && (i.faces += n.maxInstancedCount * o / 3)))
  50313. }
  50314. var s, l, c;
  50315. this.setMode = n,
  50316. this.setIndex = r,
  50317. this.render = o,
  50318. this.renderInstances = a
  50319. }
  50320. ,
  50321. n.WebGLExtensions = function(e) {
  50322. var t = {};
  50323. this.get = function(i) {
  50324. if (void 0 !== t[i])
  50325. return t[i];
  50326. var n;
  50327. switch (i) {
  50328. case "EXT_texture_filter_anisotropic":
  50329. n = e.getExtension("EXT_texture_filter_anisotropic") || e.getExtension("MOZ_EXT_texture_filter_anisotropic") || e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  50330. break;
  50331. case "WEBGL_compressed_texture_s3tc":
  50332. n = e.getExtension("WEBGL_compressed_texture_s3tc") || e.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  50333. break;
  50334. case "WEBGL_compressed_texture_pvrtc":
  50335. n = e.getExtension("WEBGL_compressed_texture_pvrtc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  50336. break;
  50337. case "WEBGL_compressed_texture_etc1":
  50338. n = e.getExtension("WEBGL_compressed_texture_etc1");
  50339. break;
  50340. default:
  50341. n = e.getExtension(i)
  50342. }
  50343. return null === n && console.warn("THREE.WebGLRenderer: " + i + " extension not supported."),
  50344. t[i] = n,
  50345. n
  50346. }
  50347. }
  50348. ,
  50349. n.WebGLCapabilities = function(e, t, i) {
  50350. function n(t) {
  50351. if ("highp" === t) {
  50352. if (e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0)
  50353. return "highp";
  50354. t = "mediump"
  50355. }
  50356. 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"
  50357. }
  50358. this.getMaxPrecision = n,
  50359. this.precision = void 0 !== i.precision ? i.precision : "highp",
  50360. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  50361. this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  50362. this.maxVertexTextures = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  50363. this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE),
  50364. this.maxCubemapSize = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),
  50365. this.maxAttributes = e.getParameter(e.MAX_VERTEX_ATTRIBS),
  50366. this.maxVertexUniforms = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),
  50367. this.maxVaryings = e.getParameter(e.MAX_VARYING_VECTORS),
  50368. this.maxFragmentUniforms = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),
  50369. this.vertexTextures = this.maxVertexTextures > 0,
  50370. this.floatFragmentTextures = !!t.get("OES_texture_float"),
  50371. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  50372. var r = n(this.precision);
  50373. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  50374. this.precision = r),
  50375. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!t.get("EXT_frag_depth"))
  50376. }
  50377. ,
  50378. n.WebGLGeometries = function(e, t, i) {
  50379. function r(e) {
  50380. var t = e.geometry;
  50381. if (void 0 !== h[t.id])
  50382. return h[t.id];
  50383. t.addEventListener("dispose", o);
  50384. var r;
  50385. return t instanceof n.BufferGeometry ? r = t : t instanceof n.Geometry && (void 0 === t._bufferGeometry && (t._bufferGeometry = (new n.BufferGeometry).setFromObject(e)),
  50386. r = t._bufferGeometry),
  50387. h[t.id] = r,
  50388. i.memory.geometries++,
  50389. r
  50390. }
  50391. function o(e) {
  50392. var n = e.target
  50393. , r = h[n.id];
  50394. null !== r.index && s(r.index),
  50395. l(r.attributes),
  50396. n.removeEventListener("dispose", o),
  50397. delete h[n.id];
  50398. var a = t.get(n);
  50399. a.wireframe && s(a.wireframe),
  50400. t.delete(n);
  50401. var c = t.get(r);
  50402. c.wireframe && s(c.wireframe),
  50403. t.delete(r),
  50404. i.memory.geometries--
  50405. }
  50406. function a(e) {
  50407. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  50408. }
  50409. function s(t) {
  50410. var i = a(t);
  50411. void 0 !== i && (e.deleteBuffer(i),
  50412. c(t))
  50413. }
  50414. function l(e) {
  50415. for (var t in e)
  50416. s(e[t])
  50417. }
  50418. function c(e) {
  50419. e instanceof n.InterleavedBufferAttribute ? t.delete(e.data) : t.delete(e)
  50420. }
  50421. var h = {};
  50422. this.get = r
  50423. }
  50424. ,
  50425. n.WebGLLights = function() {
  50426. var e = {};
  50427. this.get = function(t) {
  50428. if (void 0 !== e[t.id])
  50429. return e[t.id];
  50430. var i;
  50431. switch (t.type) {
  50432. case "DirectionalLight":
  50433. i = {
  50434. direction: new n.Vector3,
  50435. color: new n.Color,
  50436. shadow: !1,
  50437. shadowBias: 0,
  50438. shadowRadius: 1,
  50439. shadowMapSize: new n.Vector2
  50440. };
  50441. break;
  50442. case "SpotLight":
  50443. i = {
  50444. position: new n.Vector3,
  50445. direction: new n.Vector3,
  50446. color: new n.Color,
  50447. distance: 0,
  50448. coneCos: 0,
  50449. penumbraCos: 0,
  50450. decay: 0,
  50451. shadow: !1,
  50452. shadowBias: 0,
  50453. shadowRadius: 1,
  50454. shadowMapSize: new n.Vector2
  50455. };
  50456. break;
  50457. case "PointLight":
  50458. i = {
  50459. position: new n.Vector3,
  50460. color: new n.Color,
  50461. distance: 0,
  50462. decay: 0,
  50463. shadow: !1,
  50464. shadowBias: 0,
  50465. shadowRadius: 1,
  50466. shadowMapSize: new n.Vector2
  50467. };
  50468. break;
  50469. case "HemisphereLight":
  50470. i = {
  50471. direction: new n.Vector3,
  50472. skyColor: new n.Color,
  50473. groundColor: new n.Color
  50474. }
  50475. }
  50476. return e[t.id] = i,
  50477. i
  50478. }
  50479. }
  50480. ,
  50481. n.WebGLObjects = function(e, t, i) {
  50482. function r(t) {
  50483. var i = u.get(t);
  50484. t.geometry instanceof n.Geometry && i.updateFromObject(t);
  50485. var r = i.index
  50486. , a = i.attributes;
  50487. null !== r && o(r, e.ELEMENT_ARRAY_BUFFER);
  50488. for (var s in a)
  50489. o(a[s], e.ARRAY_BUFFER);
  50490. var l = i.morphAttributes;
  50491. for (var s in l)
  50492. for (var c = l[s], h = 0, d = c.length; h < d; h++)
  50493. o(c[h], e.ARRAY_BUFFER);
  50494. return i
  50495. }
  50496. function o(e, i) {
  50497. var r = e instanceof n.InterleavedBufferAttribute ? e.data : e
  50498. , o = t.get(r);
  50499. void 0 === o.__webglBuffer ? a(o, r, i) : o.version !== r.version && s(o, r, i)
  50500. }
  50501. function a(t, i, n) {
  50502. t.__webglBuffer = e.createBuffer(),
  50503. e.bindBuffer(n, t.__webglBuffer);
  50504. var r = i.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW;
  50505. e.bufferData(n, i.array, r),
  50506. t.version = i.version
  50507. }
  50508. function s(t, i, n) {
  50509. e.bindBuffer(n, t.__webglBuffer),
  50510. 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)),
  50511. i.updateRange.count = 0),
  50512. t.version = i.version
  50513. }
  50514. function l(e) {
  50515. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  50516. }
  50517. function c(i) {
  50518. var r = t.get(i);
  50519. if (void 0 !== r.wireframe)
  50520. return r.wireframe;
  50521. var a = []
  50522. , s = i.index
  50523. , l = i.attributes
  50524. , c = l.position;
  50525. if (null !== s)
  50526. for (var u = {}, d = s.array, p = 0, f = d.length; p < f; p += 3) {
  50527. var g = d[p + 0]
  50528. , m = d[p + 1]
  50529. , v = d[p + 2];
  50530. h(u, g, m) && a.push(g, m),
  50531. h(u, m, v) && a.push(m, v),
  50532. h(u, v, g) && a.push(v, g)
  50533. }
  50534. else
  50535. for (var d = l.position.array, p = 0, f = d.length / 3 - 1; p < f; p += 3) {
  50536. var g = p + 0
  50537. , m = p + 1
  50538. , v = p + 2;
  50539. a.push(g, m, m, v, v, g)
  50540. }
  50541. var A = c.count > 65535 ? Uint32Array : Uint16Array
  50542. , y = new n.BufferAttribute(new A(a),1);
  50543. return o(y, e.ELEMENT_ARRAY_BUFFER),
  50544. r.wireframe = y,
  50545. y
  50546. }
  50547. function h(e, t, i) {
  50548. if (t > i) {
  50549. var n = t;
  50550. t = i,
  50551. i = n
  50552. }
  50553. var r = e[t];
  50554. return void 0 === r ? (e[t] = [i],
  50555. !0) : r.indexOf(i) === -1 && (r.push(i),
  50556. !0)
  50557. }
  50558. var u = new n.WebGLGeometries(e,t,i);
  50559. this.getAttributeBuffer = l,
  50560. this.getWireframeAttribute = c,
  50561. this.update = r
  50562. }
  50563. ,
  50564. n.WebGLProgram = function() {
  50565. function e(e) {
  50566. switch (e) {
  50567. case n.LinearEncoding:
  50568. return ["Linear", "( value )"];
  50569. case n.sRGBEncoding:
  50570. return ["sRGB", "( value )"];
  50571. case n.RGBEEncoding:
  50572. return ["RGBE", "( value )"];
  50573. case n.RGBM7Encoding:
  50574. return ["RGBM", "( value, 7.0 )"];
  50575. case n.RGBM16Encoding:
  50576. return ["RGBM", "( value, 16.0 )"];
  50577. case n.RGBDEncoding:
  50578. return ["RGBD", "( value, 256.0 )"];
  50579. case n.GammaEncoding:
  50580. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  50581. default:
  50582. throw new Error("unsupported encoding: " + e)
  50583. }
  50584. }
  50585. function t(t, i) {
  50586. var n = e(i);
  50587. return "vec4 " + t + "( vec4 value ) { return " + n[0] + "ToLinear" + n[1] + "; }"
  50588. }
  50589. function i(t, i) {
  50590. var n = e(i);
  50591. return "vec4 " + t + "( vec4 value ) { return LinearTo" + n[0] + n[1] + "; }"
  50592. }
  50593. function r(e, t) {
  50594. var i;
  50595. switch (t) {
  50596. case n.LinearToneMapping:
  50597. i = "Linear";
  50598. break;
  50599. case n.ReinhardToneMapping:
  50600. i = "Reinhard";
  50601. break;
  50602. case n.Uncharted2ToneMapping:
  50603. i = "Uncharted2";
  50604. break;
  50605. case n.CineonToneMapping:
  50606. i = "OptimizedCineon";
  50607. break;
  50608. default:
  50609. throw new Error("unsupported toneMapping: " + t)
  50610. }
  50611. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  50612. }
  50613. function o(e, t, i) {
  50614. e = e || {};
  50615. 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" : ""];
  50616. return n.filter(c).join("\n")
  50617. }
  50618. function a(e) {
  50619. var t = [];
  50620. for (var i in e) {
  50621. var n = e[i];
  50622. n !== !1 && t.push("#define " + i + " " + n)
  50623. }
  50624. return t.join("\n")
  50625. }
  50626. function s(e, t, i) {
  50627. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), o = 0; o < r; o++) {
  50628. var a = e.getActiveUniform(t, o)
  50629. , s = a.name
  50630. , l = e.getUniformLocation(t, s)
  50631. , c = f.exec(s);
  50632. if (c) {
  50633. var h = c[1]
  50634. , u = c[2]
  50635. , d = n[h];
  50636. d || (d = n[h] = {}),
  50637. d[u] = l
  50638. } else if (c = g.exec(s)) {
  50639. var p = c[1]
  50640. , v = c[2]
  50641. , A = c[3]
  50642. , y = n[p];
  50643. y || (y = n[p] = []);
  50644. var C = y[v];
  50645. C || (C = y[v] = {}),
  50646. C[A] = l
  50647. } else if (c = m.exec(s)) {
  50648. var p = c[1];
  50649. n[p] = l
  50650. } else
  50651. n[s] = l
  50652. }
  50653. return n
  50654. }
  50655. function l(e, t, i) {
  50656. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), o = 0; o < r; o++) {
  50657. var a = e.getActiveAttrib(t, o)
  50658. , s = a.name;
  50659. n[s] = e.getAttribLocation(t, s)
  50660. }
  50661. return n
  50662. }
  50663. function c(e) {
  50664. return "" !== e
  50665. }
  50666. function h(e, t) {
  50667. 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)
  50668. }
  50669. function u(e) {
  50670. function t(e, t) {
  50671. var i = n.ShaderChunk[t];
  50672. if (void 0 === i)
  50673. throw new Error("Can not resolve #include <" + t + ">");
  50674. return u(i)
  50675. }
  50676. var i = /#include +<([\w\d.]+)>/g;
  50677. return e.replace(i, t)
  50678. }
  50679. function d(e) {
  50680. function t(e, t, i, n) {
  50681. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  50682. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  50683. return r
  50684. }
  50685. var i = /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
  50686. return e.replace(i, t)
  50687. }
  50688. var p = 0
  50689. , f = /^([\w\d_]+)\.([\w\d_]+)$/
  50690. , g = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/
  50691. , m = /^([\w\d_]+)\[0\]$/;
  50692. return function(e, f, g, m) {
  50693. var v = e.context
  50694. , A = g.extensions
  50695. , y = g.defines
  50696. , C = g.__webglShader.vertexShader
  50697. , I = g.__webglShader.fragmentShader
  50698. , E = "SHADOWMAP_TYPE_BASIC";
  50699. m.shadowMapType === n.PCFShadowMap ? E = "SHADOWMAP_TYPE_PCF" : m.shadowMapType === n.PCFSoftShadowMap && (E = "SHADOWMAP_TYPE_PCF_SOFT");
  50700. var b = "ENVMAP_TYPE_CUBE"
  50701. , w = "ENVMAP_MODE_REFLECTION"
  50702. , _ = "ENVMAP_BLENDING_MULTIPLY";
  50703. if (m.envMap) {
  50704. switch (g.envMap.mapping) {
  50705. case n.CubeReflectionMapping:
  50706. case n.CubeRefractionMapping:
  50707. b = "ENVMAP_TYPE_CUBE";
  50708. break;
  50709. case n.CubeUVReflectionMapping:
  50710. case n.CubeUVRefractionMapping:
  50711. b = "ENVMAP_TYPE_CUBE_UV";
  50712. break;
  50713. case n.EquirectangularReflectionMapping:
  50714. case n.EquirectangularRefractionMapping:
  50715. b = "ENVMAP_TYPE_EQUIREC";
  50716. break;
  50717. case n.SphericalReflectionMapping:
  50718. b = "ENVMAP_TYPE_SPHERE"
  50719. }
  50720. switch (g.envMap.mapping) {
  50721. case n.CubeRefractionMapping:
  50722. case n.EquirectangularRefractionMapping:
  50723. w = "ENVMAP_MODE_REFRACTION"
  50724. }
  50725. switch (g.combine) {
  50726. case n.MultiplyOperation:
  50727. _ = "ENVMAP_BLENDING_MULTIPLY";
  50728. break;
  50729. case n.MixOperation:
  50730. _ = "ENVMAP_BLENDING_MIX";
  50731. break;
  50732. case n.AddOperation:
  50733. _ = "ENVMAP_BLENDING_ADD"
  50734. }
  50735. }
  50736. var T, x, S = e.gammaFactor > 0 ? e.gammaFactor : 1, M = o(A, m, e.extensions), R = a(y), P = v.createProgram();
  50737. g instanceof n.RawShaderMaterial ? (T = "",
  50738. 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"),
  50739. 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")),
  50740. C = u(C, m),
  50741. C = h(C, m),
  50742. I = u(I, m),
  50743. I = h(I, m),
  50744. g instanceof n.ShaderMaterial == !1 && (C = d(C),
  50745. I = d(I));
  50746. var O = T + C
  50747. , L = x + I
  50748. , D = n.WebGLShader(v, v.VERTEX_SHADER, O)
  50749. , N = n.WebGLShader(v, v.FRAGMENT_SHADER, L);
  50750. v.attachShader(P, D),
  50751. v.attachShader(P, N),
  50752. void 0 !== g.index0AttributeName ? v.bindAttribLocation(P, 0, g.index0AttributeName) : m.morphTargets === !0 && v.bindAttribLocation(P, 0, "position"),
  50753. v.linkProgram(P);
  50754. var B = v.getProgramInfoLog(P)
  50755. , F = v.getShaderInfoLog(D)
  50756. , V = v.getShaderInfoLog(N)
  50757. , U = !0
  50758. , k = !0;
  50759. v.getProgramParameter(P, v.LINK_STATUS) === !1 ? (U = !1,
  50760. 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),
  50761. k && (this.diagnostics = {
  50762. runnable: U,
  50763. material: g,
  50764. programLog: B,
  50765. vertexShader: {
  50766. log: F,
  50767. prefix: T
  50768. },
  50769. fragmentShader: {
  50770. log: V,
  50771. prefix: x
  50772. }
  50773. }),
  50774. v.deleteShader(D),
  50775. v.deleteShader(N);
  50776. var H;
  50777. this.getUniforms = function() {
  50778. return void 0 === H && (H = s(v, P)),
  50779. H
  50780. }
  50781. ;
  50782. var G;
  50783. return this.getAttributes = function() {
  50784. return void 0 === G && (G = l(v, P)),
  50785. G
  50786. }
  50787. ,
  50788. this.destroy = function() {
  50789. v.deleteProgram(P),
  50790. this.program = void 0
  50791. }
  50792. ,
  50793. Object.defineProperties(this, {
  50794. uniforms: {
  50795. get: function() {
  50796. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  50797. this.getUniforms()
  50798. }
  50799. },
  50800. attributes: {
  50801. get: function() {
  50802. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  50803. this.getAttributes()
  50804. }
  50805. }
  50806. }),
  50807. this.id = p++,
  50808. this.code = f,
  50809. this.usedTimes = 1,
  50810. this.program = P,
  50811. this.vertexShader = D,
  50812. this.fragmentShader = N,
  50813. this
  50814. }
  50815. }(),
  50816. n.WebGLPrograms = function(e, t) {
  50817. function i(e) {
  50818. if (t.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  50819. return 1024;
  50820. var i = t.maxVertexUniforms
  50821. , r = Math.floor((i - 20) / 4)
  50822. , o = r;
  50823. return void 0 !== e && e instanceof n.SkinnedMesh && (o = Math.min(e.skeleton.bones.length, o),
  50824. 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)")),
  50825. o
  50826. }
  50827. function r(e, t) {
  50828. var i;
  50829. return e ? e instanceof n.Texture ? i = e.encoding : e instanceof n.WebGLRenderTarget && (i = e.texture.encoding) : i = n.LinearEncoding,
  50830. i === n.LinearEncoding && t && (i = n.GammaEncoding),
  50831. i
  50832. }
  50833. var o = []
  50834. , a = {
  50835. MeshDepthMaterial: "depth",
  50836. MeshNormalMaterial: "normal",
  50837. MeshBasicMaterial: "basic",
  50838. MeshLambertMaterial: "lambert",
  50839. MeshPhongMaterial: "phong",
  50840. MeshStandardMaterial: "standard",
  50841. LineBasicMaterial: "basic",
  50842. LineDashedMaterial: "dashed",
  50843. PointsMaterial: "points"
  50844. }
  50845. , 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"];
  50846. this.getParameters = function(o, s, l, c) {
  50847. var h = a[o.type]
  50848. , u = i(c)
  50849. , d = e.getPrecision();
  50850. null !== o.precision && (d = t.getMaxPrecision(o.precision),
  50851. d !== o.precision && console.warn("THREE.WebGLProgram.getParameters:", o.precision, "not supported, using", d, "instead."));
  50852. var p = {
  50853. shaderID: h,
  50854. precision: d,
  50855. supportsVertexTextures: t.vertexTextures,
  50856. outputEncoding: r(e.getCurrentRenderTarget(), e.gammaOutput),
  50857. map: !!o.map,
  50858. mapEncoding: r(o.map, e.gammaInput),
  50859. envMap: !!o.envMap,
  50860. envMapMode: o.envMap && o.envMap.mapping,
  50861. envMapEncoding: r(o.envMap, e.gammaInput),
  50862. envMapCubeUV: !!o.envMap && (o.envMap.mapping === n.CubeUVReflectionMapping || o.envMap.mapping === n.CubeUVRefractionMapping),
  50863. lightMap: !!o.lightMap,
  50864. aoMap: !!o.aoMap,
  50865. emissiveMap: !!o.emissiveMap,
  50866. emissiveMapEncoding: r(o.emissiveMap, e.gammaInput),
  50867. bumpMap: !!o.bumpMap,
  50868. normalMap: !!o.normalMap,
  50869. displacementMap: !!o.displacementMap,
  50870. roughnessMap: !!o.roughnessMap,
  50871. metalnessMap: !!o.metalnessMap,
  50872. specularMap: !!o.specularMap,
  50873. alphaMap: !!o.alphaMap,
  50874. combine: o.combine,
  50875. vertexColors: o.vertexColors,
  50876. fog: l,
  50877. useFog: o.fog,
  50878. fogExp: l instanceof n.FogExp2,
  50879. flatShading: o.shading === n.FlatShading,
  50880. sizeAttenuation: o.sizeAttenuation,
  50881. logarithmicDepthBuffer: t.logarithmicDepthBuffer,
  50882. skinning: o.skinning,
  50883. maxBones: u,
  50884. useVertexTexture: t.floatVertexTextures && c && c.skeleton && c.skeleton.useVertexTexture,
  50885. morphTargets: o.morphTargets,
  50886. morphNormals: o.morphNormals,
  50887. maxMorphTargets: e.maxMorphTargets,
  50888. maxMorphNormals: e.maxMorphNormals,
  50889. numDirLights: s.directional.length,
  50890. numPointLights: s.point.length,
  50891. numSpotLights: s.spot.length,
  50892. numHemiLights: s.hemi.length,
  50893. pointLightShadows: s.shadowsPointLight,
  50894. shadowMapEnabled: e.shadowMap.enabled && c.receiveShadow && s.shadows.length > 0,
  50895. shadowMapType: e.shadowMap.type,
  50896. toneMapping: e.toneMapping,
  50897. physicallyCorrectLights: e.physicallyCorrectLights,
  50898. premultipliedAlpha: o.premultipliedAlpha,
  50899. alphaTest: o.alphaTest,
  50900. doubleSided: o.side === n.DoubleSide,
  50901. flipSided: o.side === n.BackSide
  50902. };
  50903. return p
  50904. }
  50905. ,
  50906. this.getProgramCode = function(e, t) {
  50907. var i = [];
  50908. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  50909. i.push(e.vertexShader)),
  50910. void 0 !== e.defines)
  50911. for (var n in e.defines)
  50912. i.push(n),
  50913. i.push(e.defines[n]);
  50914. for (var r = 0; r < s.length; r++) {
  50915. var o = s[r];
  50916. i.push(o),
  50917. i.push(t[o])
  50918. }
  50919. return i.join()
  50920. }
  50921. ,
  50922. this.acquireProgram = function(t, i, r) {
  50923. for (var a, s = 0, l = o.length; s < l; s++) {
  50924. var c = o[s];
  50925. if (c.code === r) {
  50926. a = c,
  50927. ++a.usedTimes;
  50928. break
  50929. }
  50930. }
  50931. return void 0 === a && (a = new n.WebGLProgram(e,r,t,i),
  50932. o.push(a)),
  50933. a
  50934. }
  50935. ,
  50936. this.releaseProgram = function(e) {
  50937. if (0 === --e.usedTimes) {
  50938. var t = o.indexOf(e);
  50939. o[t] = o[o.length - 1],
  50940. o.pop(),
  50941. e.destroy()
  50942. }
  50943. }
  50944. ,
  50945. this.programs = o
  50946. }
  50947. ,
  50948. n.WebGLProperties = function() {
  50949. var e = {};
  50950. this.get = function(t) {
  50951. var i = t.uuid
  50952. , n = e[i];
  50953. return void 0 === n && (n = {},
  50954. e[i] = n),
  50955. n
  50956. }
  50957. ,
  50958. this.delete = function(t) {
  50959. delete e[t.uuid]
  50960. }
  50961. ,
  50962. this.clear = function() {
  50963. e = {}
  50964. }
  50965. }
  50966. ,
  50967. n.WebGLShader = function() {
  50968. function e(e) {
  50969. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  50970. t[i] = i + 1 + ": " + t[i];
  50971. return t.join("\n")
  50972. }
  50973. return function(t, i, n) {
  50974. var r = t.createShader(i);
  50975. return t.shaderSource(r, n),
  50976. t.compileShader(r),
  50977. t.getShaderParameter(r, t.COMPILE_STATUS) === !1 && console.error("THREE.WebGLShader: Shader couldn't compile."),
  50978. "" !== t.getShaderInfoLog(r) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", i === t.VERTEX_SHADER ? "vertex" : "fragment", t.getShaderInfoLog(r), e(n)),
  50979. r
  50980. }
  50981. }(),
  50982. n.WebGLShadowMap = function(e, t, i) {
  50983. function r(e, t, i, r) {
  50984. var o = e.geometry
  50985. , a = null
  50986. , s = v
  50987. , l = e.customDepthMaterial;
  50988. if (i && (s = A,
  50989. l = e.customDistanceMaterial),
  50990. l)
  50991. a = l;
  50992. else {
  50993. var c = void 0 !== o.morphTargets && o.morphTargets.length > 0 && t.morphTargets
  50994. , h = e instanceof n.SkinnedMesh && t.skinning
  50995. , u = 0;
  50996. c && (u |= f),
  50997. h && (u |= g),
  50998. a = s[u]
  50999. }
  51000. return a.visible = t.visible,
  51001. a.wireframe = t.wireframe,
  51002. a.wireframeLinewidth = t.wireframeLinewidth,
  51003. i && void 0 !== a.uniforms.lightPos && a.uniforms.lightPos.value.copy(r),
  51004. a
  51005. }
  51006. function o(e, t, i) {
  51007. if (e.visible !== !1) {
  51008. 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)) {
  51009. var r = e.material;
  51010. r.visible === !0 && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  51011. p.push(e))
  51012. }
  51013. for (var a = e.children, s = 0, c = a.length; s < c; s++)
  51014. o(a[s], t, i)
  51015. }
  51016. }
  51017. 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) {
  51018. var x = 0 !== (T & f)
  51019. , S = 0 !== (T & g)
  51020. , M = new n.ShaderMaterial({
  51021. uniforms: b,
  51022. vertexShader: E.vertexShader,
  51023. fragmentShader: E.fragmentShader,
  51024. morphTargets: x,
  51025. skinning: S
  51026. });
  51027. v[T] = M;
  51028. var R = new n.ShaderMaterial({
  51029. defines: {
  51030. USE_SHADOWMAP: ""
  51031. },
  51032. uniforms: _,
  51033. vertexShader: w.vertexShader,
  51034. fragmentShader: w.fragmentShader,
  51035. morphTargets: x,
  51036. skinning: S
  51037. });
  51038. A[T] = R
  51039. }
  51040. var P = this;
  51041. this.enabled = !1,
  51042. this.autoUpdate = !0,
  51043. this.needsUpdate = !1,
  51044. this.type = n.PCFShadowMap,
  51045. this.cullFace = n.CullFaceFront,
  51046. this.render = function(f, g) {
  51047. var m, v, A = t.shadows;
  51048. if (0 !== A.length && P.enabled !== !1 && (P.autoUpdate !== !1 || P.needsUpdate !== !1)) {
  51049. s.clearColor(1, 1, 1, 1),
  51050. s.disable(a.BLEND),
  51051. s.enable(a.CULL_FACE),
  51052. a.frontFace(a.CCW),
  51053. a.cullFace(P.cullFace === n.CullFaceFront ? a.FRONT : a.BACK),
  51054. s.setDepthTest(!0),
  51055. s.setScissorTest(!1);
  51056. for (var E = 0, b = A.length; E < b; E++) {
  51057. var w = A[E]
  51058. , _ = w.shadow
  51059. , T = _.camera;
  51060. if (h.copy(_.mapSize),
  51061. w instanceof n.PointLight) {
  51062. m = 6,
  51063. v = !0;
  51064. var x = h.x
  51065. , S = h.y;
  51066. I[0].set(2 * x, S, x, S),
  51067. I[1].set(0, S, x, S),
  51068. I[2].set(3 * x, S, x, S),
  51069. I[3].set(x, S, x, S),
  51070. I[4].set(3 * x, 0, x, S),
  51071. I[5].set(x, 0, x, S),
  51072. h.x *= 4,
  51073. h.y *= 2
  51074. } else
  51075. m = 1,
  51076. v = !1;
  51077. if (null === _.map) {
  51078. var M = {
  51079. minFilter: n.NearestFilter,
  51080. magFilter: n.NearestFilter,
  51081. format: n.RGBAFormat
  51082. };
  51083. _.map = new n.WebGLRenderTarget(h.x,h.y,M),
  51084. w instanceof n.SpotLight && (T.aspect = h.x / h.y),
  51085. T.updateProjectionMatrix()
  51086. }
  51087. var R = _.map
  51088. , O = _.matrix;
  51089. d.setFromMatrixPosition(w.matrixWorld),
  51090. T.position.copy(d),
  51091. e.setRenderTarget(R),
  51092. e.clear();
  51093. for (var L = 0; L < m; L++) {
  51094. if (v) {
  51095. u.copy(T.position),
  51096. u.add(y[L]),
  51097. T.up.copy(C[L]),
  51098. T.lookAt(u);
  51099. var D = I[L];
  51100. s.viewport(D)
  51101. } else
  51102. u.setFromMatrixPosition(w.target.matrixWorld),
  51103. T.lookAt(u);
  51104. T.updateMatrixWorld(),
  51105. T.matrixWorldInverse.getInverse(T.matrixWorld),
  51106. O.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  51107. O.multiply(T.projectionMatrix),
  51108. O.multiply(T.matrixWorldInverse),
  51109. c.multiplyMatrices(T.projectionMatrix, T.matrixWorldInverse),
  51110. l.setFromMatrix(c),
  51111. p.length = 0,
  51112. o(f, g, T);
  51113. for (var N = 0, B = p.length; N < B; N++) {
  51114. var F = p[N]
  51115. , V = i.update(F)
  51116. , U = F.material;
  51117. if (U instanceof n.MultiMaterial)
  51118. for (var k = V.groups, H = U.materials, G = 0, z = k.length; G < z; G++) {
  51119. var W = k[G]
  51120. , j = H[W.materialIndex];
  51121. if (j.visible === !0) {
  51122. var Y = r(F, j, v, d);
  51123. e.renderBufferDirect(T, null, V, Y, F, W)
  51124. }
  51125. }
  51126. else {
  51127. var Y = r(F, U, v, d);
  51128. e.renderBufferDirect(T, null, V, Y, F, null)
  51129. }
  51130. }
  51131. }
  51132. }
  51133. var X = e.getClearColor()
  51134. , Z = e.getClearAlpha();
  51135. e.setClearColor(X, Z),
  51136. s.enable(a.BLEND),
  51137. P.cullFace === n.CullFaceFront && a.cullFace(a.BACK),
  51138. P.needsUpdate = !1
  51139. }
  51140. }
  51141. }
  51142. ,
  51143. n.WebGLState = function(e, t, i) {
  51144. var r = this
  51145. , o = new n.Vector4
  51146. , a = new Uint8Array(16)
  51147. , s = new Uint8Array(16)
  51148. , l = new Uint8Array(16)
  51149. , c = {}
  51150. , h = null
  51151. , u = null
  51152. , d = null
  51153. , p = null
  51154. , f = null
  51155. , g = null
  51156. , m = null
  51157. , v = null
  51158. , A = !1
  51159. , y = null
  51160. , C = null
  51161. , I = null
  51162. , E = null
  51163. , b = null
  51164. , w = null
  51165. , _ = null
  51166. , T = null
  51167. , x = null
  51168. , S = null
  51169. , M = null
  51170. , R = null
  51171. , P = null
  51172. , O = null
  51173. , L = null
  51174. , D = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  51175. , N = void 0
  51176. , B = {}
  51177. , F = new n.Vector4
  51178. , V = null
  51179. , U = null
  51180. , k = new n.Vector4
  51181. , H = new n.Vector4
  51182. , G = e.createTexture();
  51183. e.bindTexture(e.TEXTURE_2D, G),
  51184. e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR),
  51185. e.texImage2D(e.TEXTURE_2D, 0, e.RGB, 1, 1, 0, e.RGB, e.UNSIGNED_BYTE, new Uint8Array(3)),
  51186. this.init = function() {
  51187. this.clearColor(0, 0, 0, 1),
  51188. this.clearDepth(1),
  51189. this.clearStencil(0),
  51190. this.enable(e.DEPTH_TEST),
  51191. e.depthFunc(e.LEQUAL),
  51192. e.frontFace(e.CCW),
  51193. e.cullFace(e.BACK),
  51194. this.enable(e.CULL_FACE),
  51195. this.enable(e.BLEND),
  51196. e.blendEquation(e.FUNC_ADD),
  51197. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  51198. }
  51199. ,
  51200. this.initAttributes = function() {
  51201. for (var e = 0, t = a.length; e < t; e++)
  51202. a[e] = 0
  51203. }
  51204. ,
  51205. this.enableAttribute = function(i) {
  51206. if (a[i] = 1,
  51207. 0 === s[i] && (e.enableVertexAttribArray(i),
  51208. s[i] = 1),
  51209. 0 !== l[i]) {
  51210. var n = t.get("ANGLE_instanced_arrays");
  51211. n.vertexAttribDivisorANGLE(i, 0),
  51212. l[i] = 0
  51213. }
  51214. }
  51215. ,
  51216. this.enableAttributeAndDivisor = function(t, i, n) {
  51217. a[t] = 1,
  51218. 0 === s[t] && (e.enableVertexAttribArray(t),
  51219. s[t] = 1),
  51220. l[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  51221. l[t] = i)
  51222. }
  51223. ,
  51224. this.disableUnusedAttributes = function() {
  51225. for (var t = 0, i = s.length; t < i; t++)
  51226. s[t] !== a[t] && (e.disableVertexAttribArray(t),
  51227. s[t] = 0)
  51228. }
  51229. ,
  51230. this.enable = function(t) {
  51231. c[t] !== !0 && (e.enable(t),
  51232. c[t] = !0)
  51233. }
  51234. ,
  51235. this.disable = function(t) {
  51236. c[t] !== !1 && (e.disable(t),
  51237. c[t] = !1)
  51238. }
  51239. ,
  51240. this.getCompressedTextureFormats = function() {
  51241. if (null === h && (h = [],
  51242. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  51243. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  51244. h.push(i[n]);
  51245. return h
  51246. }
  51247. ,
  51248. this.setBlending = function(t, r, o, a, s, l, c, h) {
  51249. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  51250. t === u && h === A || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  51251. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  51252. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  51253. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  51254. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  51255. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  51256. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  51257. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  51258. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  51259. u = t,
  51260. A = h),
  51261. t === n.CustomBlending ? (s = s || r,
  51262. l = l || o,
  51263. c = c || a,
  51264. r === d && s === g || (e.blendEquationSeparate(i(r), i(s)),
  51265. d = r,
  51266. g = s),
  51267. o === p && a === f && l === m && c === v || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  51268. p = o,
  51269. f = a,
  51270. m = l,
  51271. v = c)) : (d = null,
  51272. p = null,
  51273. f = null,
  51274. g = null,
  51275. m = null,
  51276. v = null)
  51277. }
  51278. ,
  51279. this.setDepthFunc = function(t) {
  51280. if (y !== t) {
  51281. if (t)
  51282. switch (t) {
  51283. case n.NeverDepth:
  51284. e.depthFunc(e.NEVER);
  51285. break;
  51286. case n.AlwaysDepth:
  51287. e.depthFunc(e.ALWAYS);
  51288. break;
  51289. case n.LessDepth:
  51290. e.depthFunc(e.LESS);
  51291. break;
  51292. case n.LessEqualDepth:
  51293. e.depthFunc(e.LEQUAL);
  51294. break;
  51295. case n.EqualDepth:
  51296. e.depthFunc(e.EQUAL);
  51297. break;
  51298. case n.GreaterEqualDepth:
  51299. e.depthFunc(e.GEQUAL);
  51300. break;
  51301. case n.GreaterDepth:
  51302. e.depthFunc(e.GREATER);
  51303. break;
  51304. case n.NotEqualDepth:
  51305. e.depthFunc(e.NOTEQUAL);
  51306. break;
  51307. default:
  51308. e.depthFunc(e.LEQUAL)
  51309. }
  51310. else
  51311. e.depthFunc(e.LEQUAL);
  51312. y = t
  51313. }
  51314. }
  51315. ,
  51316. this.setDepthTest = function(t) {
  51317. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  51318. }
  51319. ,
  51320. this.setDepthWrite = function(t) {
  51321. C !== t && (e.depthMask(t),
  51322. C = t)
  51323. }
  51324. ,
  51325. this.setColorWrite = function(t) {
  51326. I !== t && (e.colorMask(t, t, t, t),
  51327. I = t)
  51328. }
  51329. ,
  51330. this.setStencilFunc = function(t, i, n) {
  51331. b === t && w === i && _ === n || (e.stencilFunc(t, i, n),
  51332. b = t,
  51333. w = i,
  51334. _ = n)
  51335. }
  51336. ,
  51337. this.setStencilOp = function(t, i, n) {
  51338. T === t && x === i && S === n || (e.stencilOp(t, i, n),
  51339. T = t,
  51340. x = i,
  51341. S = n)
  51342. }
  51343. ,
  51344. this.setStencilTest = function(t) {
  51345. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  51346. }
  51347. ,
  51348. this.setStencilWrite = function(t) {
  51349. E !== t && (e.stencilMask(t),
  51350. E = t)
  51351. }
  51352. ,
  51353. this.setFlipSided = function(t) {
  51354. M !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  51355. M = t)
  51356. }
  51357. ,
  51358. this.setLineWidth = function(t) {
  51359. t !== R && (e.lineWidth(t),
  51360. R = t)
  51361. }
  51362. ,
  51363. this.setPolygonOffset = function(t, i, n) {
  51364. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  51365. !t || P === i && O === n || (e.polygonOffset(i, n),
  51366. P = i,
  51367. O = n)
  51368. }
  51369. ,
  51370. this.getScissorTest = function() {
  51371. return L
  51372. }
  51373. ,
  51374. this.setScissorTest = function(t) {
  51375. L = t,
  51376. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  51377. }
  51378. ,
  51379. this.activeTexture = function(t) {
  51380. void 0 === t && (t = e.TEXTURE0 + D - 1),
  51381. N !== t && (e.activeTexture(t),
  51382. N = t)
  51383. }
  51384. ,
  51385. this.bindTexture = function(t, i) {
  51386. void 0 === N && r.activeTexture();
  51387. var n = B[N];
  51388. void 0 === n && (n = {
  51389. type: void 0,
  51390. texture: void 0
  51391. },
  51392. B[N] = n),
  51393. n.type === t && n.texture === i || (e.bindTexture(t, i || G),
  51394. n.type = t,
  51395. n.texture = i)
  51396. }
  51397. ,
  51398. this.compressedTexImage2D = function() {
  51399. try {
  51400. e.compressedTexImage2D.apply(e, arguments)
  51401. } catch (e) {
  51402. console.error(e)
  51403. }
  51404. }
  51405. ,
  51406. this.texImage2D = function() {
  51407. try {
  51408. e.texImage2D.apply(e, arguments)
  51409. } catch (e) {
  51410. console.error(e)
  51411. }
  51412. }
  51413. ,
  51414. this.clearColor = function(t, i, n, r) {
  51415. o.set(t, i, n, r),
  51416. F.equals(o) === !1 && (e.clearColor(t, i, n, r),
  51417. F.copy(o))
  51418. }
  51419. ,
  51420. this.clearDepth = function(t) {
  51421. V !== t && (e.clearDepth(t),
  51422. V = t)
  51423. }
  51424. ,
  51425. this.clearStencil = function(t) {
  51426. U !== t && (e.clearStencil(t),
  51427. U = t)
  51428. }
  51429. ,
  51430. this.scissor = function(t) {
  51431. k.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  51432. k.copy(t))
  51433. }
  51434. ,
  51435. this.viewport = function(t) {
  51436. H.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  51437. H.copy(t))
  51438. }
  51439. ,
  51440. this.reset = function() {
  51441. for (var t = 0; t < s.length; t++)
  51442. 1 === s[t] && (e.disableVertexAttribArray(t),
  51443. s[t] = 0);
  51444. c = {},
  51445. h = null,
  51446. N = void 0,
  51447. B = {},
  51448. u = null,
  51449. I = null,
  51450. C = null,
  51451. E = null,
  51452. M = null
  51453. }
  51454. }
  51455. ,
  51456. n.LensFlarePlugin = function(e, t) {
  51457. function i() {
  51458. var e = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1])
  51459. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  51460. o = p.createBuffer(),
  51461. a = p.createBuffer(),
  51462. p.bindBuffer(p.ARRAY_BUFFER, o),
  51463. p.bufferData(p.ARRAY_BUFFER, e, p.STATIC_DRAW),
  51464. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  51465. p.bufferData(p.ELEMENT_ARRAY_BUFFER, t, p.STATIC_DRAW),
  51466. u = p.createTexture(),
  51467. d = p.createTexture(),
  51468. f.bindTexture(p.TEXTURE_2D, u),
  51469. p.texImage2D(p.TEXTURE_2D, 0, p.RGB, 16, 16, 0, p.RGB, p.UNSIGNED_BYTE, null),
  51470. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  51471. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  51472. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  51473. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  51474. f.bindTexture(p.TEXTURE_2D, d),
  51475. p.texImage2D(p.TEXTURE_2D, 0, p.RGBA, 16, 16, 0, p.RGBA, p.UNSIGNED_BYTE, null),
  51476. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  51477. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  51478. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  51479. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  51480. h = p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0;
  51481. var i;
  51482. i = h ? {
  51483. 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"),
  51484. 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")
  51485. } : {
  51486. 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"),
  51487. 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")
  51488. },
  51489. s = r(i),
  51490. l = {
  51491. vertex: p.getAttribLocation(s, "position"),
  51492. uv: p.getAttribLocation(s, "uv")
  51493. },
  51494. c = {
  51495. renderType: p.getUniformLocation(s, "renderType"),
  51496. map: p.getUniformLocation(s, "map"),
  51497. occlusionMap: p.getUniformLocation(s, "occlusionMap"),
  51498. opacity: p.getUniformLocation(s, "opacity"),
  51499. color: p.getUniformLocation(s, "color"),
  51500. scale: p.getUniformLocation(s, "scale"),
  51501. rotation: p.getUniformLocation(s, "rotation"),
  51502. screenPosition: p.getUniformLocation(s, "screenPosition")
  51503. }
  51504. }
  51505. function r(t) {
  51506. var i = p.createProgram()
  51507. , n = p.createShader(p.FRAGMENT_SHADER)
  51508. , r = p.createShader(p.VERTEX_SHADER)
  51509. , o = "precision " + e.getPrecision() + " float;\n";
  51510. return p.shaderSource(n, o + t.fragmentShader),
  51511. p.shaderSource(r, o + t.vertexShader),
  51512. p.compileShader(n),
  51513. p.compileShader(r),
  51514. p.attachShader(i, n),
  51515. p.attachShader(i, r),
  51516. p.linkProgram(i),
  51517. i
  51518. }
  51519. var o, a, s, l, c, h, u, d, p = e.context, f = e.state;
  51520. this.render = function(r, g, m) {
  51521. if (0 !== t.length) {
  51522. var v = new n.Vector3
  51523. , A = m.w / m.z
  51524. , y = .5 * m.z
  51525. , C = .5 * m.w
  51526. , I = 16 / m.w
  51527. , E = new n.Vector2(I * A,I)
  51528. , b = new n.Vector3(1,1,0)
  51529. , w = new n.Vector2(1,1);
  51530. void 0 === s && i(),
  51531. p.useProgram(s),
  51532. f.initAttributes(),
  51533. f.enableAttribute(l.vertex),
  51534. f.enableAttribute(l.uv),
  51535. f.disableUnusedAttributes(),
  51536. p.uniform1i(c.occlusionMap, 0),
  51537. p.uniform1i(c.map, 1),
  51538. p.bindBuffer(p.ARRAY_BUFFER, o),
  51539. p.vertexAttribPointer(l.vertex, 2, p.FLOAT, !1, 16, 0),
  51540. p.vertexAttribPointer(l.uv, 2, p.FLOAT, !1, 16, 8),
  51541. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  51542. f.disable(p.CULL_FACE),
  51543. f.setDepthWrite(!1);
  51544. for (var _ = 0, T = t.length; _ < T; _++) {
  51545. I = 16 / m.w,
  51546. E.set(I * A, I);
  51547. var x = t[_];
  51548. if (v.set(x.matrixWorld.elements[12], x.matrixWorld.elements[13], x.matrixWorld.elements[14]),
  51549. v.applyMatrix4(g.matrixWorldInverse),
  51550. v.applyProjection(g.projectionMatrix),
  51551. b.copy(v),
  51552. w.x = b.x * y + y,
  51553. w.y = b.y * C + C,
  51554. h || w.x > 0 && w.x < m.z && w.y > 0 && w.y < m.w) {
  51555. f.activeTexture(p.TEXTURE0),
  51556. f.bindTexture(p.TEXTURE_2D, null),
  51557. f.activeTexture(p.TEXTURE1),
  51558. f.bindTexture(p.TEXTURE_2D, u),
  51559. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGB, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  51560. p.uniform1i(c.renderType, 0),
  51561. p.uniform2f(c.scale, E.x, E.y),
  51562. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  51563. f.disable(p.BLEND),
  51564. f.enable(p.DEPTH_TEST),
  51565. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  51566. f.activeTexture(p.TEXTURE0),
  51567. f.bindTexture(p.TEXTURE_2D, d),
  51568. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGBA, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  51569. p.uniform1i(c.renderType, 1),
  51570. f.disable(p.DEPTH_TEST),
  51571. f.activeTexture(p.TEXTURE1),
  51572. f.bindTexture(p.TEXTURE_2D, u),
  51573. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  51574. x.positionScreen.copy(b),
  51575. x.customUpdateCallback ? x.customUpdateCallback(x) : x.updateLensFlares(),
  51576. p.uniform1i(c.renderType, 2),
  51577. f.enable(p.BLEND);
  51578. for (var S = 0, M = x.lensFlares.length; S < M; S++) {
  51579. var R = x.lensFlares[S];
  51580. R.opacity > .001 && R.scale > .001 && (b.x = R.x,
  51581. b.y = R.y,
  51582. b.z = R.z,
  51583. I = R.size * R.scale / m.w,
  51584. E.x = I * A,
  51585. E.y = I,
  51586. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  51587. p.uniform2f(c.scale, E.x, E.y),
  51588. p.uniform1f(c.rotation, R.rotation),
  51589. p.uniform1f(c.opacity, R.opacity),
  51590. p.uniform3f(c.color, R.color.r, R.color.g, R.color.b),
  51591. f.setBlending(R.blending, R.blendEquation, R.blendSrc, R.blendDst),
  51592. e.setTexture(R.texture, 1),
  51593. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0))
  51594. }
  51595. }
  51596. }
  51597. f.enable(p.CULL_FACE),
  51598. f.enable(p.DEPTH_TEST),
  51599. f.setDepthWrite(!0),
  51600. e.resetGLState()
  51601. }
  51602. }
  51603. }
  51604. ,
  51605. n.SpritePlugin = function(e, t) {
  51606. function i() {
  51607. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  51608. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  51609. a = d.createBuffer(),
  51610. s = d.createBuffer(),
  51611. d.bindBuffer(d.ARRAY_BUFFER, a),
  51612. d.bufferData(d.ARRAY_BUFFER, e, d.STATIC_DRAW),
  51613. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  51614. d.bufferData(d.ELEMENT_ARRAY_BUFFER, t, d.STATIC_DRAW),
  51615. l = r(),
  51616. c = {
  51617. position: d.getAttribLocation(l, "position"),
  51618. uv: d.getAttribLocation(l, "uv")
  51619. },
  51620. h = {
  51621. uvOffset: d.getUniformLocation(l, "uvOffset"),
  51622. uvScale: d.getUniformLocation(l, "uvScale"),
  51623. rotation: d.getUniformLocation(l, "rotation"),
  51624. scale: d.getUniformLocation(l, "scale"),
  51625. color: d.getUniformLocation(l, "color"),
  51626. map: d.getUniformLocation(l, "map"),
  51627. opacity: d.getUniformLocation(l, "opacity"),
  51628. modelViewMatrix: d.getUniformLocation(l, "modelViewMatrix"),
  51629. projectionMatrix: d.getUniformLocation(l, "projectionMatrix"),
  51630. fogType: d.getUniformLocation(l, "fogType"),
  51631. fogDensity: d.getUniformLocation(l, "fogDensity"),
  51632. fogNear: d.getUniformLocation(l, "fogNear"),
  51633. fogFar: d.getUniformLocation(l, "fogFar"),
  51634. fogColor: d.getUniformLocation(l, "fogColor"),
  51635. alphaTest: d.getUniformLocation(l, "alphaTest")
  51636. };
  51637. var i = document.createElement("canvas");
  51638. i.width = 8,
  51639. i.height = 8;
  51640. var o = i.getContext("2d");
  51641. o.fillStyle = "white",
  51642. o.fillRect(0, 0, 8, 8),
  51643. u = new n.Texture(i),
  51644. u.needsUpdate = !0
  51645. }
  51646. function r() {
  51647. var t = d.createProgram()
  51648. , i = d.createShader(d.VERTEX_SHADER)
  51649. , n = d.createShader(d.FRAGMENT_SHADER);
  51650. 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")),
  51651. 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")),
  51652. d.compileShader(i),
  51653. d.compileShader(n),
  51654. d.attachShader(t, i),
  51655. d.attachShader(t, n),
  51656. d.linkProgram(t),
  51657. t
  51658. }
  51659. function o(e, t) {
  51660. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  51661. }
  51662. 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;
  51663. this.render = function(r, v) {
  51664. if (0 !== t.length) {
  51665. void 0 === l && i(),
  51666. d.useProgram(l),
  51667. p.initAttributes(),
  51668. p.enableAttribute(c.position),
  51669. p.enableAttribute(c.uv),
  51670. p.disableUnusedAttributes(),
  51671. p.disable(d.CULL_FACE),
  51672. p.enable(d.BLEND),
  51673. d.bindBuffer(d.ARRAY_BUFFER, a),
  51674. d.vertexAttribPointer(c.position, 2, d.FLOAT, !1, 16, 0),
  51675. d.vertexAttribPointer(c.uv, 2, d.FLOAT, !1, 16, 8),
  51676. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  51677. d.uniformMatrix4fv(h.projectionMatrix, !1, v.projectionMatrix.elements),
  51678. p.activeTexture(d.TEXTURE0),
  51679. d.uniform1i(h.map, 0);
  51680. var A = 0
  51681. , y = 0
  51682. , C = r.fog;
  51683. C ? (d.uniform3f(h.fogColor, C.color.r, C.color.g, C.color.b),
  51684. C instanceof n.Fog ? (d.uniform1f(h.fogNear, C.near),
  51685. d.uniform1f(h.fogFar, C.far),
  51686. d.uniform1i(h.fogType, 1),
  51687. A = 1,
  51688. y = 1) : C instanceof n.FogExp2 && (d.uniform1f(h.fogDensity, C.density),
  51689. d.uniform1i(h.fogType, 2),
  51690. A = 2,
  51691. y = 2)) : (d.uniform1i(h.fogType, 0),
  51692. A = 0,
  51693. y = 0);
  51694. for (var I = 0, E = t.length; I < E; I++) {
  51695. var b = t[I];
  51696. b.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse, b.matrixWorld),
  51697. b.z = -b.modelViewMatrix.elements[14]
  51698. }
  51699. t.sort(o);
  51700. for (var w = [], I = 0, E = t.length; I < E; I++) {
  51701. var b = t[I]
  51702. , _ = b.material;
  51703. d.uniform1f(h.alphaTest, _.alphaTest),
  51704. d.uniformMatrix4fv(h.modelViewMatrix, !1, b.modelViewMatrix.elements),
  51705. b.matrixWorld.decompose(f, g, m),
  51706. w[0] = m.x,
  51707. w[1] = m.y;
  51708. var T = 0;
  51709. r.fog && _.fog && (T = y),
  51710. A !== T && (d.uniform1i(h.fogType, T),
  51711. A = T),
  51712. null !== _.map ? (d.uniform2f(h.uvOffset, _.map.offset.x, _.map.offset.y),
  51713. d.uniform2f(h.uvScale, _.map.repeat.x, _.map.repeat.y)) : (d.uniform2f(h.uvOffset, 0, 0),
  51714. d.uniform2f(h.uvScale, 1, 1)),
  51715. d.uniform1f(h.opacity, _.opacity),
  51716. d.uniform3f(h.color, _.color.r, _.color.g, _.color.b),
  51717. d.uniform1f(h.rotation, _.rotation),
  51718. d.uniform2fv(h.scale, w),
  51719. p.setBlending(_.blending, _.blendEquation, _.blendSrc, _.blendDst),
  51720. p.setDepthTest(_.depthTest),
  51721. p.setDepthWrite(_.depthWrite),
  51722. _.map && _.map.image && _.map.image.width ? e.setTexture(_.map, 0) : e.setTexture(u, 0),
  51723. d.drawElements(d.TRIANGLES, 6, d.UNSIGNED_SHORT, 0)
  51724. }
  51725. p.enable(d.CULL_FACE),
  51726. e.resetGLState()
  51727. }
  51728. }
  51729. }
  51730. ,
  51731. Object.defineProperties(n.Box2.prototype, {
  51732. empty: {
  51733. value: function() {
  51734. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  51735. this.isEmpty()
  51736. }
  51737. },
  51738. isIntersectionBox: {
  51739. value: function(e) {
  51740. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51741. this.intersectsBox(e)
  51742. }
  51743. }
  51744. }),
  51745. Object.defineProperties(n.Box3.prototype, {
  51746. empty: {
  51747. value: function() {
  51748. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  51749. this.isEmpty()
  51750. }
  51751. },
  51752. isIntersectionBox: {
  51753. value: function(e) {
  51754. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51755. this.intersectsBox(e)
  51756. }
  51757. },
  51758. isIntersectionSphere: {
  51759. value: function(e) {
  51760. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51761. this.intersectsSphere(e)
  51762. }
  51763. }
  51764. }),
  51765. Object.defineProperties(n.Matrix3.prototype, {
  51766. multiplyVector3: {
  51767. value: function(e) {
  51768. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  51769. e.applyMatrix3(this)
  51770. }
  51771. },
  51772. multiplyVector3Array: {
  51773. value: function(e) {
  51774. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51775. this.applyToVector3Array(e)
  51776. }
  51777. }
  51778. }),
  51779. Object.defineProperties(n.Matrix4.prototype, {
  51780. extractPosition: {
  51781. value: function(e) {
  51782. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  51783. this.copyPosition(e)
  51784. }
  51785. },
  51786. setRotationFromQuaternion: {
  51787. value: function(e) {
  51788. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  51789. this.makeRotationFromQuaternion(e)
  51790. }
  51791. },
  51792. multiplyVector3: {
  51793. value: function(e) {
  51794. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  51795. e.applyProjection(this)
  51796. }
  51797. },
  51798. multiplyVector4: {
  51799. value: function(e) {
  51800. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51801. e.applyMatrix4(this)
  51802. }
  51803. },
  51804. multiplyVector3Array: {
  51805. value: function(e) {
  51806. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51807. this.applyToVector3Array(e)
  51808. }
  51809. },
  51810. rotateAxis: {
  51811. value: function(e) {
  51812. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  51813. e.transformDirection(this)
  51814. }
  51815. },
  51816. crossVector: {
  51817. value: function(e) {
  51818. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51819. e.applyMatrix4(this)
  51820. }
  51821. },
  51822. translate: {
  51823. value: function(e) {
  51824. console.error("THREE.Matrix4: .translate() has been removed.")
  51825. }
  51826. },
  51827. rotateX: {
  51828. value: function(e) {
  51829. console.error("THREE.Matrix4: .rotateX() has been removed.")
  51830. }
  51831. },
  51832. rotateY: {
  51833. value: function(e) {
  51834. console.error("THREE.Matrix4: .rotateY() has been removed.")
  51835. }
  51836. },
  51837. rotateZ: {
  51838. value: function(e) {
  51839. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  51840. }
  51841. },
  51842. rotateByAxis: {
  51843. value: function(e, t) {
  51844. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  51845. }
  51846. }
  51847. }),
  51848. Object.defineProperties(n.Plane.prototype, {
  51849. isIntersectionLine: {
  51850. value: function(e) {
  51851. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  51852. this.intersectsLine(e)
  51853. }
  51854. }
  51855. }),
  51856. Object.defineProperties(n.Quaternion.prototype, {
  51857. multiplyVector3: {
  51858. value: function(e) {
  51859. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  51860. e.applyQuaternion(this)
  51861. }
  51862. }
  51863. }),
  51864. Object.defineProperties(n.Ray.prototype, {
  51865. isIntersectionBox: {
  51866. value: function(e) {
  51867. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51868. this.intersectsBox(e)
  51869. }
  51870. },
  51871. isIntersectionPlane: {
  51872. value: function(e) {
  51873. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  51874. this.intersectsPlane(e)
  51875. }
  51876. },
  51877. isIntersectionSphere: {
  51878. value: function(e) {
  51879. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51880. this.intersectsSphere(e)
  51881. }
  51882. }
  51883. }),
  51884. Object.defineProperties(n.Vector3.prototype, {
  51885. setEulerFromRotationMatrix: {
  51886. value: function() {
  51887. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  51888. }
  51889. },
  51890. setEulerFromQuaternion: {
  51891. value: function() {
  51892. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  51893. }
  51894. },
  51895. getPositionFromMatrix: {
  51896. value: function(e) {
  51897. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  51898. this.setFromMatrixPosition(e)
  51899. }
  51900. },
  51901. getScaleFromMatrix: {
  51902. value: function(e) {
  51903. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  51904. this.setFromMatrixScale(e)
  51905. }
  51906. },
  51907. getColumnFromMatrix: {
  51908. value: function(e, t) {
  51909. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  51910. this.setFromMatrixColumn(e, t)
  51911. }
  51912. }
  51913. }),
  51914. n.Face4 = function(e, t, i, r, o, a, s) {
  51915. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  51916. new n.Face3(e,t,i,o,a,s)
  51917. }
  51918. ,
  51919. n.Vertex = function(e, t, i) {
  51920. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  51921. new n.Vector3(e,t,i)
  51922. }
  51923. ,
  51924. Object.defineProperties(n.Object3D.prototype, {
  51925. eulerOrder: {
  51926. get: function() {
  51927. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51928. this.rotation.order
  51929. },
  51930. set: function(e) {
  51931. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51932. this.rotation.order = e
  51933. }
  51934. },
  51935. getChildByName: {
  51936. value: function(e) {
  51937. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  51938. this.getObjectByName(e)
  51939. }
  51940. },
  51941. renderDepth: {
  51942. set: function(e) {
  51943. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  51944. }
  51945. },
  51946. translate: {
  51947. value: function(e, t) {
  51948. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  51949. this.translateOnAxis(t, e)
  51950. }
  51951. },
  51952. useQuaternion: {
  51953. get: function() {
  51954. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51955. },
  51956. set: function(e) {
  51957. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51958. }
  51959. }
  51960. }),
  51961. Object.defineProperties(n, {
  51962. PointCloud: {
  51963. value: function(e, t) {
  51964. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  51965. new n.Points(e,t)
  51966. }
  51967. },
  51968. ParticleSystem: {
  51969. value: function(e, t) {
  51970. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  51971. new n.Points(e,t)
  51972. }
  51973. }
  51974. }),
  51975. Object.defineProperties(n.Light.prototype, {
  51976. onlyShadow: {
  51977. set: function(e) {
  51978. console.warn("THREE.Light: .onlyShadow has been removed.")
  51979. }
  51980. },
  51981. shadowCameraFov: {
  51982. set: function(e) {
  51983. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  51984. this.shadow.camera.fov = e
  51985. }
  51986. },
  51987. shadowCameraLeft: {
  51988. set: function(e) {
  51989. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  51990. this.shadow.camera.left = e
  51991. }
  51992. },
  51993. shadowCameraRight: {
  51994. set: function(e) {
  51995. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  51996. this.shadow.camera.right = e
  51997. }
  51998. },
  51999. shadowCameraTop: {
  52000. set: function(e) {
  52001. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  52002. this.shadow.camera.top = e
  52003. }
  52004. },
  52005. shadowCameraBottom: {
  52006. set: function(e) {
  52007. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  52008. this.shadow.camera.bottom = e
  52009. }
  52010. },
  52011. shadowCameraNear: {
  52012. set: function(e) {
  52013. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  52014. this.shadow.camera.near = e
  52015. }
  52016. },
  52017. shadowCameraFar: {
  52018. set: function(e) {
  52019. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  52020. this.shadow.camera.far = e
  52021. }
  52022. },
  52023. shadowCameraVisible: {
  52024. set: function(e) {
  52025. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  52026. }
  52027. },
  52028. shadowBias: {
  52029. set: function(e) {
  52030. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  52031. this.shadow.bias = e
  52032. }
  52033. },
  52034. shadowDarkness: {
  52035. set: function(e) {
  52036. console.warn("THREE.Light: .shadowDarkness has been removed.")
  52037. }
  52038. },
  52039. shadowMapWidth: {
  52040. set: function(e) {
  52041. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  52042. this.shadow.mapSize.width = e
  52043. }
  52044. },
  52045. shadowMapHeight: {
  52046. set: function(e) {
  52047. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  52048. this.shadow.mapSize.height = e
  52049. }
  52050. }
  52051. }),
  52052. Object.defineProperties(n.BufferAttribute.prototype, {
  52053. length: {
  52054. get: function() {
  52055. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  52056. this.array.length
  52057. }
  52058. }
  52059. }),
  52060. Object.defineProperties(n.BufferGeometry.prototype, {
  52061. drawcalls: {
  52062. get: function() {
  52063. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  52064. this.groups
  52065. }
  52066. },
  52067. offsets: {
  52068. get: function() {
  52069. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  52070. this.groups
  52071. }
  52072. },
  52073. addIndex: {
  52074. value: function(e) {
  52075. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  52076. this.setIndex(e)
  52077. }
  52078. },
  52079. addDrawCall: {
  52080. value: function(e, t, i) {
  52081. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  52082. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  52083. this.addGroup(e, t)
  52084. }
  52085. },
  52086. clearDrawCalls: {
  52087. value: function() {
  52088. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  52089. this.clearGroups()
  52090. }
  52091. },
  52092. computeTangents: {
  52093. value: function() {
  52094. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  52095. }
  52096. },
  52097. computeOffsets: {
  52098. value: function() {
  52099. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  52100. }
  52101. }
  52102. }),
  52103. Object.defineProperties(n.Material.prototype, {
  52104. wrapAround: {
  52105. get: function() {
  52106. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  52107. },
  52108. set: function(e) {
  52109. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  52110. }
  52111. },
  52112. wrapRGB: {
  52113. get: function() {
  52114. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  52115. new n.Color
  52116. }
  52117. }
  52118. }),
  52119. Object.defineProperties(n, {
  52120. PointCloudMaterial: {
  52121. value: function(e) {
  52122. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  52123. new n.PointsMaterial(e)
  52124. }
  52125. },
  52126. ParticleBasicMaterial: {
  52127. value: function(e) {
  52128. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  52129. new n.PointsMaterial(e)
  52130. }
  52131. },
  52132. ParticleSystemMaterial: {
  52133. value: function(e) {
  52134. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  52135. new n.PointsMaterial(e)
  52136. }
  52137. }
  52138. }),
  52139. Object.defineProperties(n.MeshPhongMaterial.prototype, {
  52140. metal: {
  52141. get: function() {
  52142. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  52143. !1
  52144. },
  52145. set: function(e) {
  52146. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  52147. }
  52148. }
  52149. }),
  52150. Object.defineProperties(n.ShaderMaterial.prototype, {
  52151. derivatives: {
  52152. get: function() {
  52153. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  52154. this.extensions.derivatives
  52155. },
  52156. set: function(e) {
  52157. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  52158. this.extensions.derivatives = e
  52159. }
  52160. }
  52161. }),
  52162. Object.defineProperties(n.WebGLRenderer.prototype, {
  52163. supportsFloatTextures: {
  52164. value: function() {
  52165. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  52166. this.extensions.get("OES_texture_float")
  52167. }
  52168. },
  52169. supportsHalfFloatTextures: {
  52170. value: function() {
  52171. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  52172. this.extensions.get("OES_texture_half_float")
  52173. }
  52174. },
  52175. supportsStandardDerivatives: {
  52176. value: function() {
  52177. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  52178. this.extensions.get("OES_standard_derivatives")
  52179. }
  52180. },
  52181. supportsCompressedTextureS3TC: {
  52182. value: function() {
  52183. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  52184. this.extensions.get("WEBGL_compressed_texture_s3tc")
  52185. }
  52186. },
  52187. supportsCompressedTexturePVRTC: {
  52188. value: function() {
  52189. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  52190. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  52191. }
  52192. },
  52193. supportsBlendMinMax: {
  52194. value: function() {
  52195. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  52196. this.extensions.get("EXT_blend_minmax")
  52197. }
  52198. },
  52199. supportsVertexTextures: {
  52200. value: function() {
  52201. return this.capabilities.vertexTextures
  52202. }
  52203. },
  52204. supportsInstancedArrays: {
  52205. value: function() {
  52206. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  52207. this.extensions.get("ANGLE_instanced_arrays")
  52208. }
  52209. },
  52210. enableScissorTest: {
  52211. value: function(e) {
  52212. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  52213. this.setScissorTest(e)
  52214. }
  52215. },
  52216. initMaterial: {
  52217. value: function() {
  52218. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  52219. }
  52220. },
  52221. addPrePlugin: {
  52222. value: function() {
  52223. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  52224. }
  52225. },
  52226. addPostPlugin: {
  52227. value: function() {
  52228. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  52229. }
  52230. },
  52231. updateShadowMap: {
  52232. value: function() {
  52233. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  52234. }
  52235. },
  52236. shadowMapEnabled: {
  52237. get: function() {
  52238. return this.shadowMap.enabled
  52239. },
  52240. set: function(e) {
  52241. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  52242. this.shadowMap.enabled = e
  52243. }
  52244. },
  52245. shadowMapType: {
  52246. get: function() {
  52247. return this.shadowMap.type
  52248. },
  52249. set: function(e) {
  52250. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  52251. this.shadowMap.type = e
  52252. }
  52253. },
  52254. shadowMapCullFace: {
  52255. get: function() {
  52256. return this.shadowMap.cullFace
  52257. },
  52258. set: function(e) {
  52259. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  52260. this.shadowMap.cullFace = e
  52261. }
  52262. }
  52263. }),
  52264. Object.defineProperties(n.WebGLRenderTarget.prototype, {
  52265. wrapS: {
  52266. get: function() {
  52267. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  52268. this.texture.wrapS
  52269. },
  52270. set: function(e) {
  52271. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  52272. this.texture.wrapS = e
  52273. }
  52274. },
  52275. wrapT: {
  52276. get: function() {
  52277. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  52278. this.texture.wrapT
  52279. },
  52280. set: function(e) {
  52281. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  52282. this.texture.wrapT = e
  52283. }
  52284. },
  52285. magFilter: {
  52286. get: function() {
  52287. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  52288. this.texture.magFilter
  52289. },
  52290. set: function(e) {
  52291. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  52292. this.texture.magFilter = e
  52293. }
  52294. },
  52295. minFilter: {
  52296. get: function() {
  52297. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  52298. this.texture.minFilter
  52299. },
  52300. set: function(e) {
  52301. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  52302. this.texture.minFilter = e
  52303. }
  52304. },
  52305. anisotropy: {
  52306. get: function() {
  52307. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  52308. this.texture.anisotropy
  52309. },
  52310. set: function(e) {
  52311. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  52312. this.texture.anisotropy = e
  52313. }
  52314. },
  52315. offset: {
  52316. get: function() {
  52317. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  52318. this.texture.offset
  52319. },
  52320. set: function(e) {
  52321. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  52322. this.texture.offset = e
  52323. }
  52324. },
  52325. repeat: {
  52326. get: function() {
  52327. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  52328. this.texture.repeat
  52329. },
  52330. set: function(e) {
  52331. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  52332. this.texture.repeat = e
  52333. }
  52334. },
  52335. format: {
  52336. get: function() {
  52337. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  52338. this.texture.format
  52339. },
  52340. set: function(e) {
  52341. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  52342. this.texture.format = e
  52343. }
  52344. },
  52345. type: {
  52346. get: function() {
  52347. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  52348. this.texture.type
  52349. },
  52350. set: function(e) {
  52351. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  52352. this.texture.type = e
  52353. }
  52354. },
  52355. generateMipmaps: {
  52356. get: function() {
  52357. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  52358. this.texture.generateMipmaps
  52359. },
  52360. set: function(e) {
  52361. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  52362. this.texture.generateMipmaps = e
  52363. }
  52364. }
  52365. }),
  52366. n.GeometryUtils = {
  52367. merge: function(e, t, i) {
  52368. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");
  52369. var r;
  52370. t instanceof n.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  52371. r = t.matrix,
  52372. t = t.geometry),
  52373. e.merge(t, r, i)
  52374. },
  52375. center: function(e) {
  52376. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  52377. e.center()
  52378. }
  52379. },
  52380. n.ImageUtils = {
  52381. crossOrigin: void 0,
  52382. loadTexture: function(e, t, i, r) {
  52383. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  52384. var o = new n.TextureLoader;
  52385. o.setCrossOrigin(this.crossOrigin);
  52386. var a = o.load(e, i, void 0, r);
  52387. return t && (a.mapping = t),
  52388. a
  52389. },
  52390. loadTextureCube: function(e, t, i, r) {
  52391. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  52392. var o = new n.CubeTextureLoader;
  52393. o.setCrossOrigin(this.crossOrigin);
  52394. var a = o.load(e, i, void 0, r);
  52395. return t && (a.mapping = t),
  52396. a
  52397. },
  52398. loadCompressedTexture: function() {
  52399. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  52400. },
  52401. loadCompressedTextureCube: function() {
  52402. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  52403. }
  52404. },
  52405. n.Projector = function() {
  52406. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  52407. this.projectVector = function(e, t) {
  52408. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  52409. e.project(t)
  52410. }
  52411. ,
  52412. this.unprojectVector = function(e, t) {
  52413. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  52414. e.unproject(t)
  52415. }
  52416. ,
  52417. this.pickingRay = function(e, t) {
  52418. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  52419. }
  52420. }
  52421. ,
  52422. n.CanvasRenderer = function() {
  52423. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  52424. this.domElement = document.createElement("canvas"),
  52425. this.clear = function() {}
  52426. ,
  52427. this.render = function() {}
  52428. ,
  52429. this.setClearColor = function() {}
  52430. ,
  52431. this.setSize = function() {}
  52432. }
  52433. ,
  52434. n.MeshFaceMaterial = n.MultiMaterial,
  52435. n.CurveUtils = {
  52436. tangentQuadraticBezier: function(e, t, i, n) {
  52437. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  52438. },
  52439. tangentCubicBezier: function(e, t, i, n, r) {
  52440. 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
  52441. },
  52442. tangentSpline: function(e, t, i, n, r) {
  52443. var o = 6 * e * e - 6 * e
  52444. , a = 3 * e * e - 4 * e + 1
  52445. , s = -6 * e * e + 6 * e
  52446. , l = 3 * e * e - 2 * e;
  52447. return o + a + s + l
  52448. },
  52449. interpolate: function(e, t, i, n, r) {
  52450. var o = .5 * (i - e)
  52451. , a = .5 * (n - t)
  52452. , s = r * r
  52453. , l = r * s;
  52454. return (2 * t - 2 * i + o + a) * l + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  52455. }
  52456. },
  52457. n.SceneUtils = {
  52458. createMultiMaterialObject: function(e, t) {
  52459. for (var i = new n.Group, r = 0, o = t.length; r < o; r++)
  52460. i.add(new n.Mesh(e,t[r]));
  52461. return i
  52462. },
  52463. detach: function(e, t, i) {
  52464. e.applyMatrix(t.matrixWorld),
  52465. t.remove(e),
  52466. i.add(e)
  52467. },
  52468. attach: function(e, t, i) {
  52469. var r = new n.Matrix4;
  52470. r.getInverse(i.matrixWorld),
  52471. e.applyMatrix(r),
  52472. t.remove(e),
  52473. i.add(e)
  52474. }
  52475. },
  52476. n.ShapeUtils = {
  52477. area: function(e) {
  52478. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  52479. i += e[n].x * e[r].y - e[r].x * e[n].y;
  52480. return .5 * i
  52481. },
  52482. triangulate: function() {
  52483. function e(e, t, i, n, r, o) {
  52484. var a, s, l, c, h, u, d, p, f;
  52485. if (s = e[o[t]].x,
  52486. l = e[o[t]].y,
  52487. c = e[o[i]].x,
  52488. h = e[o[i]].y,
  52489. u = e[o[n]].x,
  52490. d = e[o[n]].y,
  52491. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  52492. return !1;
  52493. var g, m, v, A, y, C, I, E, b, w, _, T, x, S, M;
  52494. for (g = u - c,
  52495. m = d - h,
  52496. v = s - u,
  52497. A = l - d,
  52498. y = c - s,
  52499. C = h - l,
  52500. a = 0; a < r; a++)
  52501. if (p = e[o[a]].x,
  52502. f = e[o[a]].y,
  52503. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = p - s,
  52504. E = f - l,
  52505. b = p - c,
  52506. w = f - h,
  52507. _ = p - u,
  52508. T = f - d,
  52509. M = g * w - m * b,
  52510. x = y * E - C * I,
  52511. S = v * T - A * _,
  52512. M >= -Number.EPSILON && S >= -Number.EPSILON && x >= -Number.EPSILON))
  52513. return !1;
  52514. return !0
  52515. }
  52516. return function(t, i) {
  52517. var r = t.length;
  52518. if (r < 3)
  52519. return null;
  52520. var o, a, s, l = [], c = [], h = [];
  52521. if (n.ShapeUtils.area(t) > 0)
  52522. for (a = 0; a < r; a++)
  52523. c[a] = a;
  52524. else
  52525. for (a = 0; a < r; a++)
  52526. c[a] = r - 1 - a;
  52527. var u = r
  52528. , d = 2 * u;
  52529. for (a = u - 1; u > 2; ) {
  52530. if (d-- <= 0)
  52531. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  52532. i ? h : l;
  52533. if (o = a,
  52534. u <= o && (o = 0),
  52535. a = o + 1,
  52536. u <= a && (a = 0),
  52537. s = a + 1,
  52538. u <= s && (s = 0),
  52539. e(t, o, a, s, u, c)) {
  52540. var p, f, g, m, v;
  52541. for (p = c[o],
  52542. f = c[a],
  52543. g = c[s],
  52544. l.push([t[p], t[f], t[g]]),
  52545. h.push([c[o], c[a], c[s]]),
  52546. m = a,
  52547. v = a + 1; v < u; m++,
  52548. v++)
  52549. c[m] = c[v];
  52550. u--,
  52551. d = 2 * u
  52552. }
  52553. }
  52554. return i ? h : l
  52555. }
  52556. }(),
  52557. triangulateShape: function(e, t) {
  52558. function i(e, t, i) {
  52559. 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
  52560. }
  52561. function r(e, t, n, r, o) {
  52562. var a = t.x - e.x
  52563. , s = t.y - e.y
  52564. , l = r.x - n.x
  52565. , c = r.y - n.y
  52566. , h = e.x - n.x
  52567. , u = e.y - n.y
  52568. , d = s * l - a * c
  52569. , p = s * h - a * u;
  52570. if (Math.abs(d) > Number.EPSILON) {
  52571. var f;
  52572. if (d > 0) {
  52573. if (p < 0 || p > d)
  52574. return [];
  52575. if (f = c * h - l * u,
  52576. f < 0 || f > d)
  52577. return []
  52578. } else {
  52579. if (p > 0 || p < d)
  52580. return [];
  52581. if (f = c * h - l * u,
  52582. f > 0 || f < d)
  52583. return []
  52584. }
  52585. if (0 === f)
  52586. return !o || 0 !== p && p !== d ? [e] : [];
  52587. if (f === d)
  52588. return !o || 0 !== p && p !== d ? [t] : [];
  52589. if (0 === p)
  52590. return [n];
  52591. if (p === d)
  52592. return [r];
  52593. var g = f / d;
  52594. return [{
  52595. x: e.x + g * a,
  52596. y: e.y + g * s
  52597. }]
  52598. }
  52599. if (0 !== p || c * h !== l * u)
  52600. return [];
  52601. var m = 0 === a && 0 === s
  52602. , v = 0 === l && 0 === c;
  52603. if (m && v)
  52604. return e.x !== n.x || e.y !== n.y ? [] : [e];
  52605. if (m)
  52606. return i(n, r, e) ? [e] : [];
  52607. if (v)
  52608. return i(e, t, n) ? [n] : [];
  52609. var A, y, C, I, E, b, w, _;
  52610. return 0 !== a ? (e.x < t.x ? (A = e,
  52611. C = e.x,
  52612. y = t,
  52613. I = t.x) : (A = t,
  52614. C = t.x,
  52615. y = e,
  52616. I = e.x),
  52617. n.x < r.x ? (E = n,
  52618. w = n.x,
  52619. b = r,
  52620. _ = r.x) : (E = r,
  52621. w = r.x,
  52622. b = n,
  52623. _ = n.x)) : (e.y < t.y ? (A = e,
  52624. C = e.y,
  52625. y = t,
  52626. I = t.y) : (A = t,
  52627. C = t.y,
  52628. y = e,
  52629. I = e.y),
  52630. n.y < r.y ? (E = n,
  52631. w = n.y,
  52632. b = r,
  52633. _ = r.y) : (E = r,
  52634. w = r.y,
  52635. b = n,
  52636. _ = n.y)),
  52637. C <= w ? I < w ? [] : I === w ? o ? [] : [E] : I <= _ ? [E, y] : [E, b] : C > _ ? [] : C === _ ? o ? [] : [A] : I <= _ ? [A, y] : [A, b]
  52638. }
  52639. function o(e, t, i, n) {
  52640. var r = t.x - e.x
  52641. , o = t.y - e.y
  52642. , a = i.x - e.x
  52643. , s = i.y - e.y
  52644. , l = n.x - e.x
  52645. , c = n.y - e.y
  52646. , h = r * s - o * a
  52647. , u = r * c - o * l;
  52648. if (Math.abs(h) > Number.EPSILON) {
  52649. var d = l * s - c * a;
  52650. return h > 0 ? u >= 0 && d >= 0 : u >= 0 || d >= 0
  52651. }
  52652. return u > 0
  52653. }
  52654. function a(e, t) {
  52655. function i(e, t) {
  52656. var i = A.length - 1
  52657. , n = e - 1;
  52658. n < 0 && (n = i);
  52659. var r = e + 1;
  52660. r > i && (r = 0);
  52661. var a = o(A[e], A[n], A[r], s[t]);
  52662. if (!a)
  52663. return !1;
  52664. var l = s.length - 1
  52665. , c = t - 1;
  52666. c < 0 && (c = l);
  52667. var h = t + 1;
  52668. return h > l && (h = 0),
  52669. a = o(s[t], s[c], s[h], A[e]),
  52670. !!a
  52671. }
  52672. function n(e, t) {
  52673. var i, n, o;
  52674. for (i = 0; i < A.length; i++)
  52675. if (n = i + 1,
  52676. n %= A.length,
  52677. o = r(e, t, A[i], A[n], !0),
  52678. o.length > 0)
  52679. return !0;
  52680. return !1
  52681. }
  52682. function a(e, i) {
  52683. var n, o, a, s, l;
  52684. for (n = 0; n < y.length; n++)
  52685. for (o = t[y[n]],
  52686. a = 0; a < o.length; a++)
  52687. if (s = a + 1,
  52688. s %= o.length,
  52689. l = r(e, i, o[a], o[s], !0),
  52690. l.length > 0)
  52691. return !0;
  52692. return !1
  52693. }
  52694. 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++)
  52695. y.push(I);
  52696. for (var b = 0, w = 2 * y.length; y.length > 0; ) {
  52697. if (w--,
  52698. w < 0) {
  52699. console.log("Infinite Loop! Holes left:" + y.length + ", Probably Hole outside Shape!");
  52700. break
  52701. }
  52702. for (c = b; c < A.length; c++) {
  52703. h = A[c],
  52704. l = -1;
  52705. for (var I = 0; I < y.length; I++)
  52706. if (d = y[I],
  52707. p = h.x + ":" + h.y + ":" + d,
  52708. void 0 === C[p]) {
  52709. s = t[d];
  52710. for (var _ = 0; _ < s.length; _++)
  52711. if (u = s[_],
  52712. i(c, _) && !n(h, u) && !a(h, u)) {
  52713. l = _,
  52714. y.splice(I, 1),
  52715. f = A.slice(0, c + 1),
  52716. g = A.slice(c),
  52717. m = s.slice(l),
  52718. v = s.slice(0, l + 1),
  52719. A = f.concat(m).concat(v).concat(g),
  52720. b = c;
  52721. break
  52722. }
  52723. if (l >= 0)
  52724. break;
  52725. C[p] = !0
  52726. }
  52727. if (l >= 0)
  52728. break
  52729. }
  52730. }
  52731. return A
  52732. }
  52733. for (var s, l, c, h, u, d, p = {}, f = e.concat(), g = 0, m = t.length; g < m; g++)
  52734. Array.prototype.push.apply(f, t[g]);
  52735. for (s = 0,
  52736. l = f.length; s < l; s++)
  52737. u = f[s].x + ":" + f[s].y,
  52738. void 0 !== p[u] && console.warn("THREE.Shape: Duplicate point", u),
  52739. p[u] = s;
  52740. var v = a(e, t)
  52741. , A = n.ShapeUtils.triangulate(v, !1);
  52742. for (s = 0,
  52743. l = A.length; s < l; s++)
  52744. for (h = A[s],
  52745. c = 0; c < 3; c++)
  52746. u = h[c].x + ":" + h[c].y,
  52747. d = p[u],
  52748. void 0 !== d && (h[c] = d);
  52749. return A.concat()
  52750. },
  52751. isClockWise: function(e) {
  52752. return n.ShapeUtils.area(e) < 0
  52753. },
  52754. b2: function() {
  52755. function e(e, t) {
  52756. var i = 1 - e;
  52757. return i * i * t
  52758. }
  52759. function t(e, t) {
  52760. return 2 * (1 - e) * e * t
  52761. }
  52762. function i(e, t) {
  52763. return e * e * t
  52764. }
  52765. return function(n, r, o, a) {
  52766. return e(n, r) + t(n, o) + i(n, a)
  52767. }
  52768. }(),
  52769. b3: function() {
  52770. function e(e, t) {
  52771. var i = 1 - e;
  52772. return i * i * i * t
  52773. }
  52774. function t(e, t) {
  52775. var i = 1 - e;
  52776. return 3 * i * i * e * t
  52777. }
  52778. function i(e, t) {
  52779. var i = 1 - e;
  52780. return 3 * i * e * e * t
  52781. }
  52782. function n(e, t) {
  52783. return e * e * e * t
  52784. }
  52785. return function(r, o, a, s, l) {
  52786. return e(r, o) + t(r, a) + i(r, s) + n(r, l)
  52787. }
  52788. }()
  52789. },
  52790. n.Curve = function() {}
  52791. ,
  52792. n.Curve.prototype = {
  52793. constructor: n.Curve,
  52794. getPoint: function(e) {
  52795. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  52796. null
  52797. },
  52798. getPointAt: function(e) {
  52799. var t = this.getUtoTmapping(e);
  52800. return this.getPoint(t)
  52801. },
  52802. getPoints: function(e) {
  52803. e || (e = 5);
  52804. var t, i = [];
  52805. for (t = 0; t <= e; t++)
  52806. i.push(this.getPoint(t / e));
  52807. return i
  52808. },
  52809. getSpacedPoints: function(e) {
  52810. e || (e = 5);
  52811. var t, i = [];
  52812. for (t = 0; t <= e; t++)
  52813. i.push(this.getPointAt(t / e));
  52814. return i
  52815. },
  52816. getLength: function() {
  52817. var e = this.getLengths();
  52818. return e[e.length - 1]
  52819. },
  52820. getLengths: function(e) {
  52821. if (e || (e = this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  52822. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  52823. return this.cacheArcLengths;
  52824. this.needsUpdate = !1;
  52825. var t, i, n = [], r = this.getPoint(0), o = 0;
  52826. for (n.push(0),
  52827. i = 1; i <= e; i++)
  52828. t = this.getPoint(i / e),
  52829. o += t.distanceTo(r),
  52830. n.push(o),
  52831. r = t;
  52832. return this.cacheArcLengths = n,
  52833. n
  52834. },
  52835. updateArcLengths: function() {
  52836. this.needsUpdate = !0,
  52837. this.getLengths()
  52838. },
  52839. getUtoTmapping: function(e, t) {
  52840. var i, n = this.getLengths(), r = 0, o = n.length;
  52841. i = t ? t : e * n[o - 1];
  52842. for (var a, s = 0, l = o - 1; s <= l; )
  52843. if (r = Math.floor(s + (l - s) / 2),
  52844. a = n[r] - i,
  52845. a < 0)
  52846. s = r + 1;
  52847. else {
  52848. if (!(a > 0)) {
  52849. l = r;
  52850. break
  52851. }
  52852. l = r - 1
  52853. }
  52854. if (r = l,
  52855. n[r] === i) {
  52856. var c = r / (o - 1);
  52857. return c
  52858. }
  52859. var h = n[r]
  52860. , u = n[r + 1]
  52861. , d = u - h
  52862. , p = (i - h) / d
  52863. , c = (r + p) / (o - 1);
  52864. return c
  52865. },
  52866. getTangent: function(e) {
  52867. var t = 1e-4
  52868. , i = e - t
  52869. , n = e + t;
  52870. i < 0 && (i = 0),
  52871. n > 1 && (n = 1);
  52872. var r = this.getPoint(i)
  52873. , o = this.getPoint(n)
  52874. , a = o.clone().sub(r);
  52875. return a.normalize()
  52876. },
  52877. getTangentAt: function(e) {
  52878. var t = this.getUtoTmapping(e);
  52879. return this.getTangent(t)
  52880. }
  52881. },
  52882. n.Curve.create = function(e, t) {
  52883. return e.prototype = Object.create(n.Curve.prototype),
  52884. e.prototype.constructor = e,
  52885. e.prototype.getPoint = t,
  52886. e
  52887. }
  52888. ,
  52889. n.CurvePath = function() {
  52890. this.curves = [],
  52891. this.autoClose = !1
  52892. }
  52893. ,
  52894. n.CurvePath.prototype = Object.create(n.Curve.prototype),
  52895. n.CurvePath.prototype.constructor = n.CurvePath,
  52896. n.CurvePath.prototype.add = function(e) {
  52897. this.curves.push(e)
  52898. }
  52899. ,
  52900. n.CurvePath.prototype.closePath = function() {
  52901. var e = this.curves[0].getPoint(0)
  52902. , t = this.curves[this.curves.length - 1].getPoint(1);
  52903. e.equals(t) || this.curves.push(new n.LineCurve(t,e))
  52904. }
  52905. ,
  52906. n.CurvePath.prototype.getPoint = function(e) {
  52907. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  52908. if (i[n] >= t) {
  52909. var r = i[n] - t
  52910. , o = this.curves[n]
  52911. , a = 1 - r / o.getLength();
  52912. return o.getPointAt(a)
  52913. }
  52914. n++
  52915. }
  52916. return null
  52917. }
  52918. ,
  52919. n.CurvePath.prototype.getLength = function() {
  52920. var e = this.getCurveLengths();
  52921. return e[e.length - 1]
  52922. }
  52923. ,
  52924. n.CurvePath.prototype.getCurveLengths = function() {
  52925. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  52926. return this.cacheLengths;
  52927. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  52928. t += this.curves[i].getLength(),
  52929. e.push(t);
  52930. return this.cacheLengths = e,
  52931. e
  52932. }
  52933. ,
  52934. n.CurvePath.prototype.createPointsGeometry = function(e) {
  52935. var t = this.getPoints(e);
  52936. return this.createGeometry(t)
  52937. }
  52938. ,
  52939. n.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  52940. var t = this.getSpacedPoints(e);
  52941. return this.createGeometry(t)
  52942. }
  52943. ,
  52944. n.CurvePath.prototype.createGeometry = function(e) {
  52945. for (var t = new n.Geometry, i = 0, r = e.length; i < r; i++) {
  52946. var o = e[i];
  52947. t.vertices.push(new n.Vector3(o.x,o.y,o.z || 0))
  52948. }
  52949. return t
  52950. }
  52951. ,
  52952. n.Font = function(e) {
  52953. this.data = e
  52954. }
  52955. ,
  52956. n.Font.prototype = {
  52957. constructor: n.Font,
  52958. generateShapes: function(e, t, i) {
  52959. function r(e) {
  52960. for (var i = String(e).split(""), n = t / a.resolution, r = 0, s = [], l = 0; l < i.length; l++) {
  52961. var c = o(i[l], n, r);
  52962. r += c.offset,
  52963. s.push(c.path)
  52964. }
  52965. return s
  52966. }
  52967. function o(e, t, r) {
  52968. var o = a.glyphs[e] || a.glyphs["?"];
  52969. if (o) {
  52970. 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;
  52971. if (o.o)
  52972. for (var E = o._cachedOutline || (o._cachedOutline = o.o.split(" ")), b = 0, w = E.length; b < w; ) {
  52973. var _ = E[b++];
  52974. switch (_) {
  52975. case "m":
  52976. s = E[b++] * t + r,
  52977. l = E[b++] * t,
  52978. A.moveTo(s, l);
  52979. break;
  52980. case "l":
  52981. s = E[b++] * t + r,
  52982. l = E[b++] * t,
  52983. A.lineTo(s, l);
  52984. break;
  52985. case "q":
  52986. if (c = E[b++] * t + r,
  52987. h = E[b++] * t,
  52988. p = E[b++] * t + r,
  52989. f = E[b++] * t,
  52990. A.quadraticCurveTo(p, f, c, h),
  52991. v = y[y.length - 1]) {
  52992. u = v.x,
  52993. d = v.y;
  52994. for (var T = 1; T <= i; T++) {
  52995. var x = T / i;
  52996. C(x, u, p, c),
  52997. C(x, d, f, h)
  52998. }
  52999. }
  53000. break;
  53001. case "b":
  53002. if (c = E[b++] * t + r,
  53003. h = E[b++] * t,
  53004. p = E[b++] * t + r,
  53005. f = E[b++] * t,
  53006. g = E[b++] * t + r,
  53007. m = E[b++] * t,
  53008. A.bezierCurveTo(p, f, g, m, c, h),
  53009. v = y[y.length - 1]) {
  53010. u = v.x,
  53011. d = v.y;
  53012. for (var T = 1; T <= i; T++) {
  53013. var x = T / i;
  53014. I(x, u, p, g, c),
  53015. I(x, d, f, m, h)
  53016. }
  53017. }
  53018. }
  53019. }
  53020. return {
  53021. offset: o.ha * t,
  53022. path: A
  53023. }
  53024. }
  53025. }
  53026. void 0 === t && (t = 100),
  53027. void 0 === i && (i = 4);
  53028. for (var a = this.data, s = r(e), l = [], c = 0, h = s.length; c < h; c++)
  53029. Array.prototype.push.apply(l, s[c].toShapes());
  53030. return l
  53031. }
  53032. },
  53033. n.Path = function(e) {
  53034. n.CurvePath.call(this),
  53035. this.actions = [],
  53036. e && this.fromPoints(e)
  53037. }
  53038. ,
  53039. n.Path.prototype = Object.create(n.CurvePath.prototype),
  53040. n.Path.prototype.constructor = n.Path,
  53041. n.Path.prototype.fromPoints = function(e) {
  53042. this.moveTo(e[0].x, e[0].y);
  53043. for (var t = 1, i = e.length; t < i; t++)
  53044. this.lineTo(e[t].x, e[t].y)
  53045. }
  53046. ,
  53047. n.Path.prototype.moveTo = function(e, t) {
  53048. this.actions.push({
  53049. action: "moveTo",
  53050. args: [e, t]
  53051. })
  53052. }
  53053. ,
  53054. n.Path.prototype.lineTo = function(e, t) {
  53055. var i = this.actions[this.actions.length - 1].args
  53056. , r = i[i.length - 2]
  53057. , o = i[i.length - 1]
  53058. , a = new n.LineCurve(new n.Vector2(r,o),new n.Vector2(e,t));
  53059. this.curves.push(a),
  53060. this.actions.push({
  53061. action: "lineTo",
  53062. args: [e, t]
  53063. })
  53064. }
  53065. ,
  53066. n.Path.prototype.quadraticCurveTo = function(e, t, i, r) {
  53067. var o = this.actions[this.actions.length - 1].args
  53068. , a = o[o.length - 2]
  53069. , s = o[o.length - 1]
  53070. , l = new n.QuadraticBezierCurve(new n.Vector2(a,s),new n.Vector2(e,t),new n.Vector2(i,r));
  53071. this.curves.push(l),
  53072. this.actions.push({
  53073. action: "quadraticCurveTo",
  53074. args: [e, t, i, r]
  53075. })
  53076. }
  53077. ,
  53078. n.Path.prototype.bezierCurveTo = function(e, t, i, r, o, a) {
  53079. var s = this.actions[this.actions.length - 1].args
  53080. , l = s[s.length - 2]
  53081. , c = s[s.length - 1]
  53082. , h = new n.CubicBezierCurve(new n.Vector2(l,c),new n.Vector2(e,t),new n.Vector2(i,r),new n.Vector2(o,a));
  53083. this.curves.push(h),
  53084. this.actions.push({
  53085. action: "bezierCurveTo",
  53086. args: [e, t, i, r, o, a]
  53087. })
  53088. }
  53089. ,
  53090. n.Path.prototype.splineThru = function(e) {
  53091. var t = Array.prototype.slice.call(arguments)
  53092. , i = this.actions[this.actions.length - 1].args
  53093. , r = i[i.length - 2]
  53094. , o = i[i.length - 1]
  53095. , a = [new n.Vector2(r,o)];
  53096. Array.prototype.push.apply(a, e);
  53097. var s = new n.SplineCurve(a);
  53098. this.curves.push(s),
  53099. this.actions.push({
  53100. action: "splineThru",
  53101. args: t
  53102. })
  53103. }
  53104. ,
  53105. n.Path.prototype.arc = function(e, t, i, n, r, o) {
  53106. var a = this.actions[this.actions.length - 1].args
  53107. , s = a[a.length - 2]
  53108. , l = a[a.length - 1];
  53109. this.absarc(e + s, t + l, i, n, r, o)
  53110. }
  53111. ,
  53112. n.Path.prototype.absarc = function(e, t, i, n, r, o) {
  53113. this.absellipse(e, t, i, i, n, r, o)
  53114. }
  53115. ,
  53116. n.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  53117. var l = this.actions[this.actions.length - 1].args
  53118. , c = l[l.length - 2]
  53119. , h = l[l.length - 1];
  53120. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  53121. }
  53122. ,
  53123. n.Path.prototype.absellipse = function(e, t, i, r, o, a, s, l) {
  53124. var c = [e, t, i, r, o, a, s, l || 0]
  53125. , h = new n.EllipseCurve(e,t,i,r,o,a,s,l);
  53126. this.curves.push(h);
  53127. var u = h.getPoint(1);
  53128. c.push(u.x),
  53129. c.push(u.y),
  53130. this.actions.push({
  53131. action: "ellipse",
  53132. args: c
  53133. })
  53134. }
  53135. ,
  53136. n.Path.prototype.getSpacedPoints = function(e) {
  53137. e || (e = 40);
  53138. for (var t = [], i = 0; i < e; i++)
  53139. t.push(this.getPoint(i / e));
  53140. return this.autoClose && t.push(t[0]),
  53141. t
  53142. }
  53143. ,
  53144. n.Path.prototype.getPoints = function(e) {
  53145. e = e || 12;
  53146. 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++) {
  53147. var A = this.actions[m]
  53148. , y = A.action
  53149. , C = A.args;
  53150. switch (y) {
  53151. case "moveTo":
  53152. g.push(new n.Vector2(C[0],C[1]));
  53153. break;
  53154. case "lineTo":
  53155. g.push(new n.Vector2(C[0],C[1]));
  53156. break;
  53157. case "quadraticCurveTo":
  53158. t = C[2],
  53159. i = C[3],
  53160. a = C[0],
  53161. s = C[1],
  53162. g.length > 0 ? (h = g[g.length - 1],
  53163. l = h.x,
  53164. c = h.y) : (h = this.actions[m - 1].args,
  53165. l = h[h.length - 2],
  53166. c = h[h.length - 1]);
  53167. for (var I = 1; I <= e; I++) {
  53168. var E = I / e;
  53169. u = p(E, l, a, t),
  53170. d = p(E, c, s, i),
  53171. g.push(new n.Vector2(u,d))
  53172. }
  53173. break;
  53174. case "bezierCurveTo":
  53175. t = C[4],
  53176. i = C[5],
  53177. a = C[0],
  53178. s = C[1],
  53179. r = C[2],
  53180. o = C[3],
  53181. g.length > 0 ? (h = g[g.length - 1],
  53182. l = h.x,
  53183. c = h.y) : (h = this.actions[m - 1].args,
  53184. l = h[h.length - 2],
  53185. c = h[h.length - 1]);
  53186. for (var I = 1; I <= e; I++) {
  53187. var E = I / e;
  53188. u = f(E, l, a, r, t),
  53189. d = f(E, c, s, o, i),
  53190. g.push(new n.Vector2(u,d))
  53191. }
  53192. break;
  53193. case "splineThru":
  53194. h = this.actions[m - 1].args;
  53195. var b = new n.Vector2(h[h.length - 2],h[h.length - 1])
  53196. , w = [b]
  53197. , _ = e * C[0].length;
  53198. w = w.concat(C[0]);
  53199. for (var T = new n.SplineCurve(w), I = 1; I <= _; I++)
  53200. g.push(T.getPointAt(I / _));
  53201. break;
  53202. case "arc":
  53203. 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++) {
  53204. var E = I / N;
  53205. L || (E = 1 - E),
  53206. x = P + E * D,
  53207. u = S + R * Math.cos(x),
  53208. d = M + R * Math.sin(x),
  53209. g.push(new n.Vector2(u,d))
  53210. }
  53211. break;
  53212. case "ellipse":
  53213. 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;
  53214. 0 !== k && (B = Math.cos(k),
  53215. F = Math.sin(k));
  53216. for (var I = 1; I <= N; I++) {
  53217. var E = I / N;
  53218. if (L || (E = 1 - E),
  53219. x = P + E * D,
  53220. u = S + V * Math.cos(x),
  53221. d = M + U * Math.sin(x),
  53222. 0 !== k) {
  53223. var H = u
  53224. , G = d;
  53225. u = (H - S) * B - (G - M) * F + S,
  53226. d = (H - S) * F + (G - M) * B + M
  53227. }
  53228. g.push(new n.Vector2(u,d))
  53229. }
  53230. }
  53231. }
  53232. var z = g[g.length - 1];
  53233. 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),
  53234. this.autoClose && g.push(g[0]),
  53235. g
  53236. }
  53237. ,
  53238. n.Path.prototype.toShapes = function(e, t) {
  53239. function i(e) {
  53240. for (var t = [], i = new n.Path, r = 0, o = e.length; r < o; r++) {
  53241. var a = e[r]
  53242. , s = a.args
  53243. , l = a.action;
  53244. "moveTo" === l && 0 !== i.actions.length && (t.push(i),
  53245. i = new n.Path),
  53246. i[l].apply(i, s)
  53247. }
  53248. return 0 !== i.actions.length && t.push(i),
  53249. t
  53250. }
  53251. function r(e) {
  53252. for (var t = [], i = 0, r = e.length; i < r; i++) {
  53253. var o = e[i]
  53254. , a = new n.Shape;
  53255. a.actions = o.actions,
  53256. a.curves = o.curves,
  53257. t.push(a)
  53258. }
  53259. return t
  53260. }
  53261. function o(e, t) {
  53262. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  53263. var a = t[r]
  53264. , s = t[o]
  53265. , l = s.x - a.x
  53266. , c = s.y - a.y;
  53267. if (Math.abs(c) > Number.EPSILON) {
  53268. if (c < 0 && (a = t[o],
  53269. l = -l,
  53270. s = t[r],
  53271. c = -c),
  53272. e.y < a.y || e.y > s.y)
  53273. continue;
  53274. if (e.y === a.y) {
  53275. if (e.x === a.x)
  53276. return !0
  53277. } else {
  53278. var h = c * (e.x - a.x) - l * (e.y - a.y);
  53279. if (0 === h)
  53280. return !0;
  53281. if (h < 0)
  53282. continue;
  53283. n = !n
  53284. }
  53285. } else {
  53286. if (e.y !== a.y)
  53287. continue;
  53288. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  53289. return !0
  53290. }
  53291. }
  53292. return n
  53293. }
  53294. var a = n.ShapeUtils.isClockWise
  53295. , s = i(this.actions);
  53296. if (0 === s.length)
  53297. return [];
  53298. if (t === !0)
  53299. return r(s);
  53300. var l, c, h, u = [];
  53301. if (1 === s.length)
  53302. return c = s[0],
  53303. h = new n.Shape,
  53304. h.actions = c.actions,
  53305. h.curves = c.curves,
  53306. u.push(h),
  53307. u;
  53308. var d = !a(s[0].getPoints());
  53309. d = e ? !d : d;
  53310. var p, f = [], g = [], m = [], v = 0;
  53311. g[v] = void 0,
  53312. m[v] = [];
  53313. for (var A = 0, y = s.length; A < y; A++)
  53314. c = s[A],
  53315. p = c.getPoints(),
  53316. l = a(p),
  53317. l = e ? !l : l,
  53318. l ? (!d && g[v] && v++,
  53319. g[v] = {
  53320. s: new n.Shape,
  53321. p: p
  53322. },
  53323. g[v].s.actions = c.actions,
  53324. g[v].s.curves = c.curves,
  53325. d && v++,
  53326. m[v] = []) : m[v].push({
  53327. h: c,
  53328. p: p[0]
  53329. });
  53330. if (!g[0])
  53331. return r(s);
  53332. if (g.length > 1) {
  53333. for (var C = !1, I = [], E = 0, b = g.length; E < b; E++)
  53334. f[E] = [];
  53335. for (var E = 0, b = g.length; E < b; E++)
  53336. for (var w = m[E], _ = 0; _ < w.length; _++) {
  53337. for (var T = w[_], x = !0, S = 0; S < g.length; S++)
  53338. o(T.p, g[S].p) && (E !== S && I.push({
  53339. froms: E,
  53340. tos: S,
  53341. hole: _
  53342. }),
  53343. x ? (x = !1,
  53344. f[S].push(T)) : C = !0);
  53345. x && f[E].push(T)
  53346. }
  53347. I.length > 0 && (C || (m = f))
  53348. }
  53349. for (var M, A = 0, R = g.length; A < R; A++) {
  53350. h = g[A].s,
  53351. u.push(h),
  53352. M = m[A];
  53353. for (var P = 0, O = M.length; P < O; P++)
  53354. h.holes.push(M[P].h)
  53355. }
  53356. return u
  53357. }
  53358. ,
  53359. n.Shape = function() {
  53360. n.Path.apply(this, arguments),
  53361. this.holes = []
  53362. }
  53363. ,
  53364. n.Shape.prototype = Object.create(n.Path.prototype),
  53365. n.Shape.prototype.constructor = n.Shape,
  53366. n.Shape.prototype.extrude = function(e) {
  53367. return new n.ExtrudeGeometry(this,e)
  53368. }
  53369. ,
  53370. n.Shape.prototype.makeGeometry = function(e) {
  53371. return new n.ShapeGeometry(this,e)
  53372. }
  53373. ,
  53374. n.Shape.prototype.getPointsHoles = function(e) {
  53375. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  53376. t[i] = this.holes[i].getPoints(e);
  53377. return t
  53378. }
  53379. ,
  53380. n.Shape.prototype.extractAllPoints = function(e) {
  53381. return {
  53382. shape: this.getPoints(e),
  53383. holes: this.getPointsHoles(e)
  53384. }
  53385. }
  53386. ,
  53387. n.Shape.prototype.extractPoints = function(e) {
  53388. return this.extractAllPoints(e)
  53389. }
  53390. ,
  53391. n.LineCurve = function(e, t) {
  53392. this.v1 = e,
  53393. this.v2 = t
  53394. }
  53395. ,
  53396. n.LineCurve.prototype = Object.create(n.Curve.prototype),
  53397. n.LineCurve.prototype.constructor = n.LineCurve,
  53398. n.LineCurve.prototype.getPoint = function(e) {
  53399. var t = this.v2.clone().sub(this.v1);
  53400. return t.multiplyScalar(e).add(this.v1),
  53401. t
  53402. }
  53403. ,
  53404. n.LineCurve.prototype.getPointAt = function(e) {
  53405. return this.getPoint(e)
  53406. }
  53407. ,
  53408. n.LineCurve.prototype.getTangent = function(e) {
  53409. var t = this.v2.clone().sub(this.v1);
  53410. return t.normalize()
  53411. }
  53412. ,
  53413. n.QuadraticBezierCurve = function(e, t, i) {
  53414. this.v0 = e,
  53415. this.v1 = t,
  53416. this.v2 = i
  53417. }
  53418. ,
  53419. n.QuadraticBezierCurve.prototype = Object.create(n.Curve.prototype),
  53420. n.QuadraticBezierCurve.prototype.constructor = n.QuadraticBezierCurve,
  53421. n.QuadraticBezierCurve.prototype.getPoint = function(e) {
  53422. var t = n.ShapeUtils.b2;
  53423. 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))
  53424. }
  53425. ,
  53426. n.QuadraticBezierCurve.prototype.getTangent = function(e) {
  53427. var t = n.CurveUtils.tangentQuadraticBezier;
  53428. 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()
  53429. }
  53430. ,
  53431. n.CubicBezierCurve = function(e, t, i, n) {
  53432. this.v0 = e,
  53433. this.v1 = t,
  53434. this.v2 = i,
  53435. this.v3 = n
  53436. }
  53437. ,
  53438. n.CubicBezierCurve.prototype = Object.create(n.Curve.prototype),
  53439. n.CubicBezierCurve.prototype.constructor = n.CubicBezierCurve,
  53440. n.CubicBezierCurve.prototype.getPoint = function(e) {
  53441. var t = n.ShapeUtils.b3;
  53442. 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))
  53443. }
  53444. ,
  53445. n.CubicBezierCurve.prototype.getTangent = function(e) {
  53446. var t = n.CurveUtils.tangentCubicBezier;
  53447. 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()
  53448. }
  53449. ,
  53450. n.SplineCurve = function(e) {
  53451. this.points = void 0 == e ? [] : e
  53452. }
  53453. ,
  53454. n.SplineCurve.prototype = Object.create(n.Curve.prototype),
  53455. n.SplineCurve.prototype.constructor = n.SplineCurve,
  53456. n.SplineCurve.prototype.getPoint = function(e) {
  53457. var t = this.points
  53458. , i = (t.length - 1) * e
  53459. , r = Math.floor(i)
  53460. , o = i - r
  53461. , a = t[0 === r ? r : r - 1]
  53462. , s = t[r]
  53463. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  53464. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  53465. , h = n.CurveUtils.interpolate;
  53466. return new n.Vector2(h(a.x, s.x, l.x, c.x, o),h(a.y, s.y, l.y, c.y, o))
  53467. }
  53468. ,
  53469. n.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  53470. this.aX = e,
  53471. this.aY = t,
  53472. this.xRadius = i,
  53473. this.yRadius = n,
  53474. this.aStartAngle = r,
  53475. this.aEndAngle = o,
  53476. this.aClockwise = a,
  53477. this.aRotation = s || 0
  53478. }
  53479. ,
  53480. n.EllipseCurve.prototype = Object.create(n.Curve.prototype),
  53481. n.EllipseCurve.prototype.constructor = n.EllipseCurve,
  53482. n.EllipseCurve.prototype.getPoint = function(e) {
  53483. var t = this.aEndAngle - this.aStartAngle;
  53484. t < 0 && (t += 2 * Math.PI),
  53485. t > 2 * Math.PI && (t -= 2 * Math.PI);
  53486. var i;
  53487. i = this.aClockwise === !0 ? this.aEndAngle + (1 - e) * (2 * Math.PI - t) : this.aStartAngle + e * t;
  53488. var r = this.aX + this.xRadius * Math.cos(i)
  53489. , o = this.aY + this.yRadius * Math.sin(i);
  53490. if (0 !== this.aRotation) {
  53491. var a = Math.cos(this.aRotation)
  53492. , s = Math.sin(this.aRotation)
  53493. , l = r
  53494. , c = o;
  53495. r = (l - this.aX) * a - (c - this.aY) * s + this.aX,
  53496. o = (l - this.aX) * s + (c - this.aY) * a + this.aY
  53497. }
  53498. return new n.Vector2(r,o)
  53499. }
  53500. ,
  53501. n.ArcCurve = function(e, t, i, r, o, a) {
  53502. n.EllipseCurve.call(this, e, t, i, i, r, o, a)
  53503. }
  53504. ,
  53505. n.ArcCurve.prototype = Object.create(n.EllipseCurve.prototype),
  53506. n.ArcCurve.prototype.constructor = n.ArcCurve,
  53507. n.LineCurve3 = n.Curve.create(function(e, t) {
  53508. this.v1 = e,
  53509. this.v2 = t
  53510. }, function(e) {
  53511. var t = new n.Vector3;
  53512. return t.subVectors(this.v2, this.v1),
  53513. t.multiplyScalar(e),
  53514. t.add(this.v1),
  53515. t
  53516. }),
  53517. n.QuadraticBezierCurve3 = n.Curve.create(function(e, t, i) {
  53518. this.v0 = e,
  53519. this.v1 = t,
  53520. this.v2 = i
  53521. }, function(e) {
  53522. var t = n.ShapeUtils.b2;
  53523. 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))
  53524. }),
  53525. n.CubicBezierCurve3 = n.Curve.create(function(e, t, i, n) {
  53526. this.v0 = e,
  53527. this.v1 = t,
  53528. this.v2 = i,
  53529. this.v3 = n
  53530. }, function(e) {
  53531. var t = n.ShapeUtils.b3;
  53532. 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))
  53533. }),
  53534. n.SplineCurve3 = n.Curve.create(function(e) {
  53535. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  53536. this.points = void 0 == e ? [] : e
  53537. }, function(e) {
  53538. var t = this.points
  53539. , i = (t.length - 1) * e
  53540. , r = Math.floor(i)
  53541. , o = i - r
  53542. , a = t[0 == r ? r : r - 1]
  53543. , s = t[r]
  53544. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  53545. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  53546. , h = n.CurveUtils.interpolate;
  53547. 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))
  53548. }),
  53549. n.CatmullRomCurve3 = function() {
  53550. function e() {}
  53551. var t = new n.Vector3
  53552. , i = new e
  53553. , r = new e
  53554. , o = new e;
  53555. return e.prototype.init = function(e, t, i, n) {
  53556. this.c0 = e,
  53557. this.c1 = i,
  53558. this.c2 = -3 * e + 3 * t - 2 * i - n,
  53559. this.c3 = 2 * e - 2 * t + i + n
  53560. }
  53561. ,
  53562. e.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  53563. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  53564. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  53565. s *= o,
  53566. l *= o,
  53567. this.init(t, i, s, l)
  53568. }
  53569. ,
  53570. e.prototype.initCatmullRom = function(e, t, i, n, r) {
  53571. this.init(t, i, r * (i - e), r * (n - t))
  53572. }
  53573. ,
  53574. e.prototype.calc = function(e) {
  53575. var t = e * e
  53576. , i = t * e;
  53577. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  53578. }
  53579. ,
  53580. n.Curve.create(function(e) {
  53581. this.points = e || [],
  53582. this.closed = !1
  53583. }, function(e) {
  53584. var a, s, l, c, h = this.points;
  53585. c = h.length,
  53586. c < 2 && console.log("duh, you need at least 2 points"),
  53587. a = (c - (this.closed ? 0 : 1)) * e,
  53588. s = Math.floor(a),
  53589. l = a - s,
  53590. this.closed ? s += s > 0 ? 0 : (Math.floor(Math.abs(s) / h.length) + 1) * h.length : 0 === l && s === c - 1 && (s = c - 2,
  53591. l = 1);
  53592. var u, d, p, f;
  53593. if (this.closed || s > 0 ? u = h[(s - 1) % c] : (t.subVectors(h[0], h[1]).add(h[0]),
  53594. u = t),
  53595. d = h[s % c],
  53596. p = h[(s + 1) % c],
  53597. this.closed || s + 2 < c ? f = h[(s + 2) % c] : (t.subVectors(h[c - 1], h[c - 2]).add(h[c - 1]),
  53598. f = t),
  53599. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  53600. var g = "chordal" === this.type ? .5 : .25
  53601. , m = Math.pow(u.distanceToSquared(d), g)
  53602. , v = Math.pow(d.distanceToSquared(p), g)
  53603. , A = Math.pow(p.distanceToSquared(f), g);
  53604. v < 1e-4 && (v = 1),
  53605. m < 1e-4 && (m = v),
  53606. A < 1e-4 && (A = v),
  53607. i.initNonuniformCatmullRom(u.x, d.x, p.x, f.x, m, v, A),
  53608. r.initNonuniformCatmullRom(u.y, d.y, p.y, f.y, m, v, A),
  53609. o.initNonuniformCatmullRom(u.z, d.z, p.z, f.z, m, v, A)
  53610. } else if ("catmullrom" === this.type) {
  53611. var y = void 0 !== this.tension ? this.tension : .5;
  53612. i.initCatmullRom(u.x, d.x, p.x, f.x, y),
  53613. r.initCatmullRom(u.y, d.y, p.y, f.y, y),
  53614. o.initCatmullRom(u.z, d.z, p.z, f.z, y)
  53615. }
  53616. var C = new n.Vector3(i.calc(l),r.calc(l),o.calc(l));
  53617. return C
  53618. })
  53619. }(),
  53620. n.ClosedSplineCurve3 = function(e) {
  53621. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  53622. n.CatmullRomCurve3.call(this, e),
  53623. this.type = "catmullrom",
  53624. this.closed = !0
  53625. }
  53626. ,
  53627. n.ClosedSplineCurve3.prototype = Object.create(n.CatmullRomCurve3.prototype),
  53628. n.BoxGeometry = function(e, t, i, r, o, a) {
  53629. n.Geometry.call(this),
  53630. this.type = "BoxGeometry",
  53631. this.parameters = {
  53632. width: e,
  53633. height: t,
  53634. depth: i,
  53635. widthSegments: r,
  53636. heightSegments: o,
  53637. depthSegments: a
  53638. },
  53639. this.fromBufferGeometry(new n.BoxBufferGeometry(e,t,i,r,o,a)),
  53640. this.mergeVertices()
  53641. }
  53642. ,
  53643. n.BoxGeometry.prototype = Object.create(n.Geometry.prototype),
  53644. n.BoxGeometry.prototype.constructor = n.BoxGeometry,
  53645. n.CubeGeometry = n.BoxGeometry,
  53646. n.BoxBufferGeometry = function(e, t, i, r, o, a) {
  53647. function s(e, t, i) {
  53648. var n = 0;
  53649. return n += e * t * 2,
  53650. n += e * i * 2,
  53651. n += i * t * 2,
  53652. 4 * n
  53653. }
  53654. function l(e, t, i, r, o, a, s, l, h, u, I) {
  53655. 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++)
  53656. for (var L = O * b - _, D = 0; D < x; D++) {
  53657. var N = D * E - w;
  53658. P[e] = N * r,
  53659. P[t] = L * o,
  53660. P[i] = T,
  53661. p[m] = P.x,
  53662. p[m + 1] = P.y,
  53663. p[m + 2] = P.z,
  53664. P[e] = 0,
  53665. P[t] = 0,
  53666. P[i] = l > 0 ? 1 : -1,
  53667. f[m] = P.x,
  53668. f[m + 1] = P.y,
  53669. f[m + 2] = P.z,
  53670. g[v] = D / h,
  53671. g[v + 1] = 1 - O / u,
  53672. m += 3,
  53673. v += 2,
  53674. M += 1
  53675. }
  53676. for (O = 0; O < u; O++)
  53677. for (D = 0; D < h; D++) {
  53678. var B = y + D + x * O
  53679. , F = y + D + x * (O + 1)
  53680. , V = y + (D + 1) + x * (O + 1)
  53681. , U = y + (D + 1) + x * O;
  53682. d[A] = B,
  53683. d[A + 1] = F,
  53684. d[A + 2] = U,
  53685. d[A + 3] = F,
  53686. d[A + 4] = V,
  53687. d[A + 5] = U,
  53688. A += 6,
  53689. R += 6
  53690. }
  53691. c.addGroup(C, R, I),
  53692. C += R,
  53693. y += M
  53694. }
  53695. n.BufferGeometry.call(this),
  53696. this.type = "BoxBufferGeometry",
  53697. this.parameters = {
  53698. width: e,
  53699. height: t,
  53700. depth: i,
  53701. widthSegments: r,
  53702. heightSegments: o,
  53703. depthSegments: a
  53704. };
  53705. var c = this;
  53706. r = Math.floor(r) || 1,
  53707. o = Math.floor(o) || 1,
  53708. a = Math.floor(a) || 1;
  53709. var h = s(r, o, a)
  53710. , u = h / 4 * 6
  53711. , d = new (u > 65535 ? Uint32Array : Uint16Array)(u)
  53712. , p = new Float32Array(3 * h)
  53713. , f = new Float32Array(3 * h)
  53714. , g = new Float32Array(2 * h)
  53715. , m = 0
  53716. , v = 0
  53717. , A = 0
  53718. , y = 0
  53719. , C = 0;
  53720. l("z", "y", "x", -1, -1, i, t, e, a, o, 0),
  53721. l("z", "y", "x", 1, -1, i, t, -e, a, o, 1),
  53722. l("x", "z", "y", 1, 1, e, i, t, r, a, 2),
  53723. l("x", "z", "y", 1, -1, e, i, -t, r, a, 3),
  53724. l("x", "y", "z", 1, -1, e, t, i, r, o, 4),
  53725. l("x", "y", "z", -1, -1, e, t, -i, r, o, 5),
  53726. this.setIndex(new n.BufferAttribute(d,1)),
  53727. this.addAttribute("position", new n.BufferAttribute(p,3)),
  53728. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  53729. this.addAttribute("uv", new n.BufferAttribute(g,2))
  53730. }
  53731. ,
  53732. n.BoxBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  53733. n.BoxBufferGeometry.prototype.constructor = n.BoxBufferGeometry,
  53734. n.CircleGeometry = function(e, t, i, r) {
  53735. n.Geometry.call(this),
  53736. this.type = "CircleGeometry",
  53737. this.parameters = {
  53738. radius: e,
  53739. segments: t,
  53740. thetaStart: i,
  53741. thetaLength: r
  53742. },
  53743. this.fromBufferGeometry(new n.CircleBufferGeometry(e,t,i,r))
  53744. }
  53745. ,
  53746. n.CircleGeometry.prototype = Object.create(n.Geometry.prototype),
  53747. n.CircleGeometry.prototype.constructor = n.CircleGeometry,
  53748. n.CircleBufferGeometry = function(e, t, i, r) {
  53749. n.BufferGeometry.call(this),
  53750. this.type = "CircleBufferGeometry",
  53751. this.parameters = {
  53752. radius: e,
  53753. segments: t,
  53754. thetaStart: i,
  53755. thetaLength: r
  53756. },
  53757. e = e || 50,
  53758. t = void 0 !== t ? Math.max(3, t) : 8,
  53759. i = void 0 !== i ? i : 0,
  53760. r = void 0 !== r ? r : 2 * Math.PI;
  53761. var o = t + 2
  53762. , a = new Float32Array(3 * o)
  53763. , s = new Float32Array(3 * o)
  53764. , l = new Float32Array(2 * o);
  53765. s[2] = 1,
  53766. l[0] = .5,
  53767. l[1] = .5;
  53768. for (var c = 0, h = 3, u = 2; c <= t; c++,
  53769. h += 3,
  53770. u += 2) {
  53771. var d = i + c / t * r;
  53772. a[h] = e * Math.cos(d),
  53773. a[h + 1] = e * Math.sin(d),
  53774. s[h + 2] = 1,
  53775. l[u] = (a[h] / e + 1) / 2,
  53776. l[u + 1] = (a[h + 1] / e + 1) / 2
  53777. }
  53778. for (var p = [], h = 1; h <= t; h++)
  53779. p.push(h, h + 1, 0);
  53780. this.setIndex(new n.BufferAttribute(new Uint16Array(p),1)),
  53781. this.addAttribute("position", new n.BufferAttribute(a,3)),
  53782. this.addAttribute("normal", new n.BufferAttribute(s,3)),
  53783. this.addAttribute("uv", new n.BufferAttribute(l,2)),
  53784. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  53785. }
  53786. ,
  53787. n.CircleBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  53788. n.CircleBufferGeometry.prototype.constructor = n.CircleBufferGeometry,
  53789. n.CylinderBufferGeometry = function(e, t, i, r, o, a, s, l) {
  53790. function c() {
  53791. var e = (r + 1) * (o + 1);
  53792. return a === !1 && (e += 2 * (r + 1) + 2 * r),
  53793. e
  53794. }
  53795. function h() {
  53796. var e = r * o * 2 * 3;
  53797. return a === !1 && (e += 2 * r * 3),
  53798. e
  53799. }
  53800. function u() {
  53801. var a, c, h = new n.Vector3, u = new n.Vector3, d = (t - e) / i;
  53802. for (c = 0; c <= o; c++) {
  53803. var p = []
  53804. , f = c / o
  53805. , b = f * (t - e) + e;
  53806. for (a = 0; a <= r; a++) {
  53807. var w = a / r;
  53808. u.x = b * Math.sin(w * l + s),
  53809. u.y = -f * i + E,
  53810. u.z = b * Math.cos(w * l + s),
  53811. m.setXYZ(y, u.x, u.y, u.z),
  53812. h.copy(u),
  53813. (0 === e && 0 === c || 0 === t && c === o) && (h.x = Math.sin(w * l + s),
  53814. h.z = Math.cos(w * l + s)),
  53815. h.setY(Math.sqrt(h.x * h.x + h.z * h.z) * d).normalize(),
  53816. v.setXYZ(y, h.x, h.y, h.z),
  53817. A.setXY(y, w, 1 - f),
  53818. p.push(y),
  53819. y++
  53820. }
  53821. I.push(p)
  53822. }
  53823. for (a = 0; a < r; a++)
  53824. for (c = 0; c < o; c++) {
  53825. var _ = I[c][a]
  53826. , T = I[c + 1][a]
  53827. , x = I[c + 1][a + 1]
  53828. , S = I[c][a + 1];
  53829. g.setX(C, _),
  53830. C++,
  53831. g.setX(C, T),
  53832. C++,
  53833. g.setX(C, S),
  53834. C++,
  53835. g.setX(C, T),
  53836. C++,
  53837. g.setX(C, x),
  53838. C++,
  53839. g.setX(C, S),
  53840. C++
  53841. }
  53842. }
  53843. function d(i) {
  53844. var o, a, c, h = new n.Vector2, u = new n.Vector3, d = i === !0 ? e : t, p = i === !0 ? 1 : -1;
  53845. for (a = y,
  53846. o = 1; o <= r; o++)
  53847. m.setXYZ(y, 0, E * p, 0),
  53848. v.setXYZ(y, 0, p, 0),
  53849. i === !0 ? (h.x = o / r,
  53850. h.y = 0) : (h.x = (o - 1) / r,
  53851. h.y = 1),
  53852. A.setXY(y, h.x, h.y),
  53853. y++;
  53854. for (c = y,
  53855. o = 0; o <= r; o++) {
  53856. var f = o / r;
  53857. u.x = d * Math.sin(f * l + s),
  53858. u.y = E * p,
  53859. u.z = d * Math.cos(f * l + s),
  53860. m.setXYZ(y, u.x, u.y, u.z),
  53861. v.setXYZ(y, 0, p, 0),
  53862. A.setXY(y, f, i === !0 ? 1 : 0),
  53863. y++
  53864. }
  53865. for (o = 0; o < r; o++) {
  53866. var I = a + o
  53867. , b = c + o;
  53868. i === !0 ? (g.setX(C, b),
  53869. C++,
  53870. g.setX(C, b + 1),
  53871. C++,
  53872. g.setX(C, I),
  53873. C++) : (g.setX(C, b + 1),
  53874. C++,
  53875. g.setX(C, b),
  53876. C++,
  53877. g.setX(C, I),
  53878. C++)
  53879. }
  53880. }
  53881. n.BufferGeometry.call(this),
  53882. this.type = "CylinderBufferGeometry",
  53883. this.parameters = {
  53884. radiusTop: e,
  53885. radiusBottom: t,
  53886. height: i,
  53887. radialSegments: r,
  53888. heightSegments: o,
  53889. openEnded: a,
  53890. thetaStart: s,
  53891. thetaLength: l
  53892. },
  53893. e = void 0 !== e ? e : 20,
  53894. t = void 0 !== t ? t : 20,
  53895. i = void 0 !== i ? i : 100,
  53896. r = Math.floor(r) || 8,
  53897. o = Math.floor(o) || 1,
  53898. a = void 0 !== a && a,
  53899. s = void 0 !== s ? s : 0,
  53900. l = void 0 !== l ? l : 2 * Math.PI;
  53901. var p = c()
  53902. , f = h()
  53903. , g = new n.BufferAttribute(new (f > 65535 ? Uint32Array : Uint16Array)(f),1)
  53904. , m = new n.BufferAttribute(new Float32Array(3 * p),3)
  53905. , v = new n.BufferAttribute(new Float32Array(3 * p),3)
  53906. , A = new n.BufferAttribute(new Float32Array(2 * p),2)
  53907. , y = 0
  53908. , C = 0
  53909. , I = []
  53910. , E = i / 2;
  53911. u(),
  53912. a === !1 && (e > 0 && d(!0),
  53913. t > 0 && d(!1)),
  53914. this.setIndex(g),
  53915. this.addAttribute("position", m),
  53916. this.addAttribute("normal", v),
  53917. this.addAttribute("uv", A)
  53918. }
  53919. ,
  53920. n.CylinderBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  53921. n.CylinderBufferGeometry.prototype.constructor = n.CylinderBufferGeometry,
  53922. n.CylinderGeometry = function(e, t, i, r, o, a, s, l) {
  53923. n.Geometry.call(this),
  53924. this.type = "CylinderGeometry",
  53925. this.parameters = {
  53926. radiusTop: e,
  53927. radiusBottom: t,
  53928. height: i,
  53929. radialSegments: r,
  53930. heightSegments: o,
  53931. openEnded: a,
  53932. thetaStart: s,
  53933. thetaLength: l
  53934. },
  53935. this.fromBufferGeometry(new n.CylinderBufferGeometry(e,t,i,r,o,a,s,l)),
  53936. this.mergeVertices()
  53937. }
  53938. ,
  53939. n.CylinderGeometry.prototype = Object.create(n.Geometry.prototype),
  53940. n.CylinderGeometry.prototype.constructor = n.CylinderGeometry,
  53941. n.EdgesGeometry = function(e, t) {
  53942. function i(e, t) {
  53943. return e - t
  53944. }
  53945. n.BufferGeometry.call(this),
  53946. t = void 0 !== t ? t : 1;
  53947. var r, o = Math.cos(n.Math.degToRad(t)), a = [0, 0], s = {}, l = ["a", "b", "c"];
  53948. e instanceof n.BufferGeometry ? (r = new n.Geometry,
  53949. r.fromBufferGeometry(e)) : r = e.clone(),
  53950. r.mergeVertices(),
  53951. r.computeFaceNormals();
  53952. for (var c = r.vertices, h = r.faces, u = 0, d = h.length; u < d; u++)
  53953. for (var p = h[u], f = 0; f < 3; f++) {
  53954. a[0] = p[l[f]],
  53955. a[1] = p[l[(f + 1) % 3]],
  53956. a.sort(i);
  53957. var g = a.toString();
  53958. void 0 === s[g] ? s[g] = {
  53959. vert1: a[0],
  53960. vert2: a[1],
  53961. face1: u,
  53962. face2: void 0
  53963. } : s[g].face2 = u
  53964. }
  53965. var m = [];
  53966. for (var g in s) {
  53967. var v = s[g];
  53968. if (void 0 === v.face2 || h[v.face1].normal.dot(h[v.face2].normal) <= o) {
  53969. var A = c[v.vert1];
  53970. m.push(A.x),
  53971. m.push(A.y),
  53972. m.push(A.z),
  53973. A = c[v.vert2],
  53974. m.push(A.x),
  53975. m.push(A.y),
  53976. m.push(A.z)
  53977. }
  53978. }
  53979. this.addAttribute("position", new n.BufferAttribute(new Float32Array(m),3))
  53980. }
  53981. ,
  53982. n.EdgesGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  53983. n.EdgesGeometry.prototype.constructor = n.EdgesGeometry,
  53984. n.ExtrudeGeometry = function(e, t) {
  53985. return "undefined" == typeof e ? void (e = []) : (n.Geometry.call(this),
  53986. this.type = "ExtrudeGeometry",
  53987. e = Array.isArray(e) ? e : [e],
  53988. this.addShapeList(e, t),
  53989. void this.computeFaceNormals())
  53990. }
  53991. ;
  53992. n.ExtrudeGeometry.prototype = Object.create(n.Geometry.prototype);
  53993. n.ExtrudeGeometry.prototype.constructor = n.ExtrudeGeometry,
  53994. n.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  53995. for (var i = e.length, n = 0; n < i; n++) {
  53996. var r = e[n];
  53997. this.addShape(r, t)
  53998. }
  53999. }
  54000. ,
  54001. n.ExtrudeGeometry.prototype.addShape = function(e, t) {
  54002. function i(e, t, i) {
  54003. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  54004. t.clone().multiplyScalar(i).add(e)
  54005. }
  54006. function r(e, t, i) {
  54007. 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;
  54008. if (Math.abs(d) > Number.EPSILON) {
  54009. var p = Math.sqrt(u)
  54010. , f = Math.sqrt(c * c + h * h)
  54011. , g = t.x - l / p
  54012. , m = t.y + s / p
  54013. , v = i.x - h / f
  54014. , A = i.y + c / f
  54015. , y = ((v - g) * h - (A - m) * c) / (s * h - l * c);
  54016. r = g + s * y - e.x,
  54017. o = m + l * y - e.y;
  54018. var C = r * r + o * o;
  54019. if (C <= 2)
  54020. return new n.Vector2(r,o);
  54021. a = Math.sqrt(C / 2)
  54022. } else {
  54023. var I = !1;
  54024. s > Number.EPSILON ? c > Number.EPSILON && (I = !0) : s < -Number.EPSILON ? c < -Number.EPSILON && (I = !0) : Math.sign(l) === Math.sign(h) && (I = !0),
  54025. I ? (r = -l,
  54026. o = s,
  54027. a = Math.sqrt(u)) : (r = s,
  54028. o = l,
  54029. a = Math.sqrt(u / 2))
  54030. }
  54031. return new n.Vector2(r / a,o / a)
  54032. }
  54033. function o() {
  54034. if (C) {
  54035. var e = 0
  54036. , t = z * e;
  54037. for (Y = 0; Y < W; Y++)
  54038. G = N[Y],
  54039. c(G[2] + t, G[1] + t, G[0] + t);
  54040. for (e = E + 2 * y,
  54041. t = z * e,
  54042. Y = 0; Y < W; Y++)
  54043. G = N[Y],
  54044. c(G[0] + t, G[1] + t, G[2] + t)
  54045. } else {
  54046. for (Y = 0; Y < W; Y++)
  54047. G = N[Y],
  54048. c(G[2], G[1], G[0]);
  54049. for (Y = 0; Y < W; Y++)
  54050. G = N[Y],
  54051. c(G[0] + z * E, G[1] + z * E, G[2] + z * E)
  54052. }
  54053. }
  54054. function a() {
  54055. var e = 0;
  54056. for (s(B, e),
  54057. e += B.length,
  54058. x = 0,
  54059. S = L.length; x < S; x++)
  54060. T = L[x],
  54061. s(T, e),
  54062. e += T.length
  54063. }
  54064. function s(e, t) {
  54065. var i, n;
  54066. for (Y = e.length; --Y >= 0; ) {
  54067. i = Y,
  54068. n = Y - 1,
  54069. n < 0 && (n = e.length - 1);
  54070. var r = 0
  54071. , o = E + 2 * y;
  54072. for (r = 0; r < o; r++) {
  54073. var a = z * r
  54074. , s = z * (r + 1)
  54075. , l = t + i + a
  54076. , c = t + n + a
  54077. , u = t + n + s
  54078. , d = t + i + s;
  54079. h(l, c, u, d, e, r, o, i, n)
  54080. }
  54081. }
  54082. }
  54083. function l(e, t, i) {
  54084. M.vertices.push(new n.Vector3(e,t,i))
  54085. }
  54086. function c(e, t, i) {
  54087. e += R,
  54088. t += R,
  54089. i += R,
  54090. M.faces.push(new n.Face3(e,t,i,null,null,0));
  54091. var r = _.generateTopUV(M, e, t, i);
  54092. M.faceVertexUvs[0].push(r)
  54093. }
  54094. function h(e, t, i, r, o, a, s, l, c) {
  54095. e += R,
  54096. t += R,
  54097. i += R,
  54098. r += R,
  54099. M.faces.push(new n.Face3(e,t,r,null,null,1)),
  54100. M.faces.push(new n.Face3(t,i,r,null,null,1));
  54101. var h = _.generateSideWallUV(M, e, t, i, r);
  54102. M.faceVertexUvs[0].push([h[0], h[1], h[3]]),
  54103. M.faceVertexUvs[0].push([h[1], h[2], h[3]])
  54104. }
  54105. 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;
  54106. b && (u = b.getSpacedPoints(E),
  54107. w = !0,
  54108. C = !1,
  54109. d = void 0 !== t.frames ? t.frames : new n.TubeGeometry.FrenetFrames(b,E,!1),
  54110. p = new n.Vector3,
  54111. f = new n.Vector3,
  54112. g = new n.Vector3),
  54113. C || (y = 0,
  54114. v = 0,
  54115. A = 0);
  54116. 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);
  54117. if (D) {
  54118. for (O = O.reverse(),
  54119. x = 0,
  54120. S = L.length; x < S; x++)
  54121. T = L[x],
  54122. n.ShapeUtils.isClockWise(T) && (L[x] = T.reverse());
  54123. D = !1
  54124. }
  54125. var N = n.ShapeUtils.triangulateShape(O, L)
  54126. , B = O;
  54127. for (x = 0,
  54128. S = L.length; x < S; x++)
  54129. T = L[x],
  54130. O = O.concat(T);
  54131. 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++,
  54132. Z++,
  54133. q++)
  54134. Z === X && (Z = 0),
  54135. q === X && (q = 0),
  54136. j[Y] = r(B[Y], B[Z], B[q]);
  54137. var K, Q = [], J = j.concat();
  54138. for (x = 0,
  54139. S = L.length; x < S; x++) {
  54140. for (T = L[x],
  54141. K = [],
  54142. Y = 0,
  54143. X = T.length,
  54144. Z = X - 1,
  54145. q = Y + 1; Y < X; Y++,
  54146. Z++,
  54147. q++)
  54148. Z === X && (Z = 0),
  54149. q === X && (q = 0),
  54150. K[Y] = r(T[Y], T[Z], T[q]);
  54151. Q.push(K),
  54152. J = J.concat(K)
  54153. }
  54154. for (F = 0; F < y; F++) {
  54155. for (U = F / y,
  54156. k = v * (1 - U),
  54157. V = A * Math.sin(U * Math.PI / 2),
  54158. Y = 0,
  54159. X = B.length; Y < X; Y++)
  54160. H = i(B[Y], j[Y], V),
  54161. l(H.x, H.y, -k);
  54162. for (x = 0,
  54163. S = L.length; x < S; x++)
  54164. for (T = L[x],
  54165. K = Q[x],
  54166. Y = 0,
  54167. X = T.length; Y < X; Y++)
  54168. H = i(T[Y], K[Y], V),
  54169. l(H.x, H.y, -k)
  54170. }
  54171. for (V = A,
  54172. Y = 0; Y < z; Y++)
  54173. H = C ? i(O[Y], J[Y], V) : O[Y],
  54174. w ? (f.copy(d.normals[0]).multiplyScalar(H.x),
  54175. p.copy(d.binormals[0]).multiplyScalar(H.y),
  54176. g.copy(u[0]).add(f).add(p),
  54177. l(g.x, g.y, g.z)) : l(H.x, H.y, 0);
  54178. var $;
  54179. for ($ = 1; $ <= E; $++)
  54180. for (Y = 0; Y < z; Y++)
  54181. H = C ? i(O[Y], J[Y], V) : O[Y],
  54182. w ? (f.copy(d.normals[$]).multiplyScalar(H.x),
  54183. p.copy(d.binormals[$]).multiplyScalar(H.y),
  54184. g.copy(u[$]).add(f).add(p),
  54185. l(g.x, g.y, g.z)) : l(H.x, H.y, m / E * $);
  54186. for (F = y - 1; F >= 0; F--) {
  54187. for (U = F / y,
  54188. k = v * (1 - U),
  54189. V = A * Math.sin(U * Math.PI / 2),
  54190. Y = 0,
  54191. X = B.length; Y < X; Y++)
  54192. H = i(B[Y], j[Y], V),
  54193. l(H.x, H.y, m + k);
  54194. for (x = 0,
  54195. S = L.length; x < S; x++)
  54196. for (T = L[x],
  54197. K = Q[x],
  54198. Y = 0,
  54199. X = T.length; Y < X; Y++)
  54200. H = i(T[Y], K[Y], V),
  54201. w ? l(H.x, H.y + u[E - 1].y, u[E - 1].x + k) : l(H.x, H.y, m + k)
  54202. }
  54203. o(),
  54204. a()
  54205. }
  54206. ,
  54207. n.ExtrudeGeometry.WorldUVGenerator = {
  54208. generateTopUV: function(e, t, i, r) {
  54209. var o = e.vertices
  54210. , a = o[t]
  54211. , s = o[i]
  54212. , l = o[r];
  54213. return [new n.Vector2(a.x,a.y), new n.Vector2(s.x,s.y), new n.Vector2(l.x,l.y)]
  54214. },
  54215. generateSideWallUV: function(e, t, i, r, o) {
  54216. var a = e.vertices
  54217. , s = a[t]
  54218. , l = a[i]
  54219. , c = a[r]
  54220. , h = a[o];
  54221. 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)]
  54222. }
  54223. },
  54224. n.ShapeGeometry = function(e, t) {
  54225. n.Geometry.call(this),
  54226. this.type = "ShapeGeometry",
  54227. Array.isArray(e) === !1 && (e = [e]),
  54228. this.addShapeList(e, t),
  54229. this.computeFaceNormals()
  54230. }
  54231. ,
  54232. n.ShapeGeometry.prototype = Object.create(n.Geometry.prototype),
  54233. n.ShapeGeometry.prototype.constructor = n.ShapeGeometry,
  54234. n.ShapeGeometry.prototype.addShapeList = function(e, t) {
  54235. for (var i = 0, n = e.length; i < n; i++)
  54236. this.addShape(e[i], t);
  54237. return this
  54238. }
  54239. ,
  54240. n.ShapeGeometry.prototype.addShape = function(e, t) {
  54241. void 0 === t && (t = {});
  54242. 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);
  54243. if (p) {
  54244. for (u = u.reverse(),
  54245. i = 0,
  54246. r = d.length; i < r; i++)
  54247. o = d[i],
  54248. n.ShapeUtils.isClockWise(o) && (d[i] = o.reverse());
  54249. p = !1
  54250. }
  54251. var f = n.ShapeUtils.triangulateShape(u, d);
  54252. for (i = 0,
  54253. r = d.length; i < r; i++)
  54254. o = d[i],
  54255. u = u.concat(o);
  54256. var g, m, v = u.length, A = f.length;
  54257. for (i = 0; i < v; i++)
  54258. g = u[i],
  54259. this.vertices.push(new n.Vector3(g.x,g.y,0));
  54260. for (i = 0; i < A; i++) {
  54261. m = f[i];
  54262. var y = m[0] + c
  54263. , C = m[1] + c
  54264. , I = m[2] + c;
  54265. this.faces.push(new n.Face3(y,C,I,null,null,s)),
  54266. this.faceVertexUvs[0].push(l.generateTopUV(this, y, C, I))
  54267. }
  54268. }
  54269. ,
  54270. n.LatheBufferGeometry = function(e, t, i, r) {
  54271. n.BufferGeometry.call(this),
  54272. this.type = "LatheBufferGeometry",
  54273. this.parameters = {
  54274. points: e,
  54275. segments: t,
  54276. phiStart: i,
  54277. phiLength: r
  54278. },
  54279. t = Math.floor(t) || 12,
  54280. i = i || 0,
  54281. r = r || 2 * Math.PI,
  54282. r = n.Math.clamp(r, 0, 2 * Math.PI);
  54283. 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),
  54284. 1 / t), m = new n.Vector3, v = new n.Vector2;
  54285. for (a = 0; a <= t; a++) {
  54286. var A = i + a * g * r
  54287. , y = Math.sin(A)
  54288. , C = Math.cos(A);
  54289. for (s = 0; s <= e.length - 1; s++)
  54290. m.x = e[s].x * y,
  54291. m.y = e[s].y,
  54292. m.z = e[s].x * C,
  54293. u.setXYZ(p, m.x, m.y, m.z),
  54294. v.x = a / t,
  54295. v.y = s / (e.length - 1),
  54296. d.setXY(p, v.x, v.y),
  54297. p++
  54298. }
  54299. for (a = 0; a < t; a++)
  54300. for (s = 0; s < e.length - 1; s++) {
  54301. o = s + a * e.length;
  54302. var I = o
  54303. , E = o + e.length
  54304. , b = o + e.length + 1
  54305. , w = o + 1;
  54306. h.setX(f, I),
  54307. f++,
  54308. h.setX(f, E),
  54309. f++,
  54310. h.setX(f, w),
  54311. f++,
  54312. h.setX(f, E),
  54313. f++,
  54314. h.setX(f, b),
  54315. f++,
  54316. h.setX(f, w),
  54317. f++
  54318. }
  54319. if (this.setIndex(h),
  54320. this.addAttribute("position", u),
  54321. this.addAttribute("uv", d),
  54322. this.computeVertexNormals(),
  54323. r === 2 * Math.PI) {
  54324. var _ = this.attributes.normal.array
  54325. , T = new n.Vector3
  54326. , x = new n.Vector3
  54327. , S = new n.Vector3;
  54328. for (o = t * e.length * 3,
  54329. a = 0,
  54330. s = 0; a < e.length; a++,
  54331. s += 3)
  54332. T.x = _[s + 0],
  54333. T.y = _[s + 1],
  54334. T.z = _[s + 2],
  54335. x.x = _[o + s + 0],
  54336. x.y = _[o + s + 1],
  54337. x.z = _[o + s + 2],
  54338. S.addVectors(T, x).normalize(),
  54339. _[s + 0] = _[o + s + 0] = S.x,
  54340. _[s + 1] = _[o + s + 1] = S.y,
  54341. _[s + 2] = _[o + s + 2] = S.z
  54342. }
  54343. }
  54344. ,
  54345. n.LatheBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54346. n.LatheBufferGeometry.prototype.constructor = n.LatheBufferGeometry,
  54347. n.LatheGeometry = function(e, t, i, r) {
  54348. n.Geometry.call(this),
  54349. this.type = "LatheGeometry",
  54350. this.parameters = {
  54351. points: e,
  54352. segments: t,
  54353. phiStart: i,
  54354. phiLength: r
  54355. },
  54356. this.fromBufferGeometry(new n.LatheBufferGeometry(e,t,i,r)),
  54357. this.mergeVertices()
  54358. }
  54359. ,
  54360. n.LatheGeometry.prototype = Object.create(n.Geometry.prototype),
  54361. n.LatheGeometry.prototype.constructor = n.LatheGeometry,
  54362. n.PlaneGeometry = function(e, t, i, r) {
  54363. n.Geometry.call(this),
  54364. this.type = "PlaneGeometry",
  54365. this.parameters = {
  54366. width: e,
  54367. height: t,
  54368. widthSegments: i,
  54369. heightSegments: r
  54370. },
  54371. this.fromBufferGeometry(new n.PlaneBufferGeometry(e,t,i,r))
  54372. }
  54373. ,
  54374. n.PlaneGeometry.prototype = Object.create(n.Geometry.prototype),
  54375. n.PlaneGeometry.prototype.constructor = n.PlaneGeometry,
  54376. n.PlaneBufferGeometry = function(e, t, i, r) {
  54377. n.BufferGeometry.call(this),
  54378. this.type = "PlaneBufferGeometry",
  54379. this.parameters = {
  54380. width: e,
  54381. height: t,
  54382. widthSegments: i,
  54383. heightSegments: r
  54384. };
  54385. 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++)
  54386. for (var y = A * d - a, C = 0; C < c; C++) {
  54387. var I = C * u - o;
  54388. p[m] = I,
  54389. p[m + 1] = -y,
  54390. f[m + 2] = 1,
  54391. g[v] = C / s,
  54392. g[v + 1] = 1 - A / l,
  54393. m += 3,
  54394. v += 2
  54395. }
  54396. m = 0;
  54397. for (var E = new (p.length / 3 > 65535 ? Uint32Array : Uint16Array)(s * l * 6), A = 0; A < l; A++)
  54398. for (var C = 0; C < s; C++) {
  54399. var b = C + c * A
  54400. , w = C + c * (A + 1)
  54401. , _ = C + 1 + c * (A + 1)
  54402. , T = C + 1 + c * A;
  54403. E[m] = b,
  54404. E[m + 1] = w,
  54405. E[m + 2] = T,
  54406. E[m + 3] = w,
  54407. E[m + 4] = _,
  54408. E[m + 5] = T,
  54409. m += 6
  54410. }
  54411. this.setIndex(new n.BufferAttribute(E,1)),
  54412. this.addAttribute("position", new n.BufferAttribute(p,3)),
  54413. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  54414. this.addAttribute("uv", new n.BufferAttribute(g,2))
  54415. }
  54416. ,
  54417. n.PlaneBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54418. n.PlaneBufferGeometry.prototype.constructor = n.PlaneBufferGeometry,
  54419. n.RingBufferGeometry = function(e, t, i, r, o, a) {
  54420. n.BufferGeometry.call(this),
  54421. this.type = "RingBufferGeometry",
  54422. this.parameters = {
  54423. innerRadius: e,
  54424. outerRadius: t,
  54425. thetaSegments: i,
  54426. phiSegments: r,
  54427. thetaStart: o,
  54428. thetaLength: a
  54429. },
  54430. e = e || 20,
  54431. t = t || 50,
  54432. o = void 0 !== o ? o : 0,
  54433. a = void 0 !== a ? a : 2 * Math.PI,
  54434. i = void 0 !== i ? Math.max(3, i) : 8,
  54435. r = void 0 !== r ? Math.max(1, r) : 1;
  54436. 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;
  54437. for (l = 0; l <= r; l++) {
  54438. for (c = 0; c <= i; c++)
  54439. s = o + c / i * a,
  54440. C.x = A * Math.cos(s),
  54441. C.y = A * Math.sin(s),
  54442. p.setXYZ(m, C.x, C.y, C.z),
  54443. f.setXYZ(m, 0, 0, 1),
  54444. I.x = (C.x / t + 1) / 2,
  54445. I.y = (C.y / t + 1) / 2,
  54446. g.setXY(m, I.x, I.y),
  54447. m++;
  54448. A += y
  54449. }
  54450. for (l = 0; l < r; l++) {
  54451. var E = l * (i + 1);
  54452. for (c = 0; c < i; c++) {
  54453. s = c + E;
  54454. var b = s
  54455. , w = s + i + 1
  54456. , _ = s + i + 2
  54457. , T = s + 1;
  54458. d.setX(v, b),
  54459. v++,
  54460. d.setX(v, w),
  54461. v++,
  54462. d.setX(v, _),
  54463. v++,
  54464. d.setX(v, b),
  54465. v++,
  54466. d.setX(v, _),
  54467. v++,
  54468. d.setX(v, T),
  54469. v++
  54470. }
  54471. }
  54472. this.setIndex(d),
  54473. this.addAttribute("position", p),
  54474. this.addAttribute("normal", f),
  54475. this.addAttribute("uv", g)
  54476. }
  54477. ,
  54478. n.RingBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54479. n.RingBufferGeometry.prototype.constructor = n.RingBufferGeometry,
  54480. n.RingGeometry = function(e, t, i, r, o, a) {
  54481. n.Geometry.call(this),
  54482. this.type = "RingGeometry",
  54483. this.parameters = {
  54484. innerRadius: e,
  54485. outerRadius: t,
  54486. thetaSegments: i,
  54487. phiSegments: r,
  54488. thetaStart: o,
  54489. thetaLength: a
  54490. },
  54491. this.fromBufferGeometry(new n.RingBufferGeometry(e,t,i,r,o,a))
  54492. }
  54493. ,
  54494. n.RingGeometry.prototype = Object.create(n.Geometry.prototype),
  54495. n.RingGeometry.prototype.constructor = n.RingGeometry,
  54496. n.SphereGeometry = function(e, t, i, r, o, a, s) {
  54497. n.Geometry.call(this),
  54498. this.type = "SphereGeometry",
  54499. this.parameters = {
  54500. radius: e,
  54501. widthSegments: t,
  54502. heightSegments: i,
  54503. phiStart: r,
  54504. phiLength: o,
  54505. thetaStart: a,
  54506. thetaLength: s
  54507. },
  54508. this.fromBufferGeometry(new n.SphereBufferGeometry(e,t,i,r,o,a,s))
  54509. }
  54510. ,
  54511. n.SphereGeometry.prototype = Object.create(n.Geometry.prototype),
  54512. n.SphereGeometry.prototype.constructor = n.SphereGeometry,
  54513. n.SphereBufferGeometry = function(e, t, i, r, o, a, s) {
  54514. n.BufferGeometry.call(this),
  54515. this.type = "SphereBufferGeometry",
  54516. this.parameters = {
  54517. radius: e,
  54518. widthSegments: t,
  54519. heightSegments: i,
  54520. phiStart: r,
  54521. phiLength: o,
  54522. thetaStart: a,
  54523. thetaLength: s
  54524. },
  54525. e = e || 50,
  54526. t = Math.max(3, Math.floor(t) || 8),
  54527. i = Math.max(2, Math.floor(i) || 6),
  54528. r = void 0 !== r ? r : 0,
  54529. o = void 0 !== o ? o : 2 * Math.PI,
  54530. a = void 0 !== a ? a : 0,
  54531. s = void 0 !== s ? s : Math.PI;
  54532. 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++) {
  54533. for (var v = [], A = m / i, y = 0; y <= t; y++) {
  54534. var C = y / t
  54535. , I = -e * Math.cos(r + C * o) * Math.sin(a + A * s)
  54536. , E = e * Math.cos(a + A * s)
  54537. , b = e * Math.sin(r + C * o) * Math.sin(a + A * s);
  54538. g.set(I, E, b).normalize(),
  54539. h.setXYZ(p, I, E, b),
  54540. u.setXYZ(p, g.x, g.y, g.z),
  54541. d.setXY(p, C, 1 - A),
  54542. v.push(p),
  54543. p++
  54544. }
  54545. f.push(v)
  54546. }
  54547. for (var w = [], m = 0; m < i; m++)
  54548. for (var y = 0; y < t; y++) {
  54549. var _ = f[m][y + 1]
  54550. , T = f[m][y]
  54551. , x = f[m + 1][y]
  54552. , S = f[m + 1][y + 1];
  54553. (0 !== m || a > 0) && w.push(_, T, S),
  54554. (m !== i - 1 || l < Math.PI) && w.push(T, x, S)
  54555. }
  54556. this.setIndex(new (h.count > 65535 ? n.Uint32Attribute : n.Uint16Attribute)(w,1)),
  54557. this.addAttribute("position", h),
  54558. this.addAttribute("normal", u),
  54559. this.addAttribute("uv", d),
  54560. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  54561. }
  54562. ,
  54563. n.SphereBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54564. n.SphereBufferGeometry.prototype.constructor = n.SphereBufferGeometry,
  54565. n.TextGeometry = function(e, t) {
  54566. t = t || {};
  54567. var i = t.font;
  54568. if (i instanceof n.Font == !1)
  54569. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  54570. new n.Geometry;
  54571. var r = i.generateShapes(e, t.size, t.curveSegments);
  54572. t.amount = void 0 !== t.height ? t.height : 50,
  54573. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  54574. void 0 === t.bevelSize && (t.bevelSize = 8),
  54575. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  54576. n.ExtrudeGeometry.call(this, r, t),
  54577. this.type = "TextGeometry"
  54578. }
  54579. ,
  54580. n.TextGeometry.prototype = Object.create(n.ExtrudeGeometry.prototype),
  54581. n.TextGeometry.prototype.constructor = n.TextGeometry,
  54582. n.TorusBufferGeometry = function(e, t, i, r, o) {
  54583. n.BufferGeometry.call(this),
  54584. this.type = "TorusBufferGeometry",
  54585. this.parameters = {
  54586. radius: e,
  54587. tube: t,
  54588. radialSegments: i,
  54589. tubularSegments: r,
  54590. arc: o
  54591. },
  54592. e = e || 100,
  54593. t = t || 40,
  54594. i = Math.floor(i) || 8,
  54595. r = Math.floor(r) || 6,
  54596. o = o || 2 * Math.PI;
  54597. 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;
  54598. for (a = 0; a <= i; a++)
  54599. for (s = 0; s <= r; s++) {
  54600. var C = s / r * o
  54601. , I = a / i * Math.PI * 2;
  54602. A.x = (e + t * Math.cos(I)) * Math.cos(C),
  54603. A.y = (e + t * Math.cos(I)) * Math.sin(C),
  54604. A.z = t * Math.sin(I),
  54605. u[f] = A.x,
  54606. u[f + 1] = A.y,
  54607. u[f + 2] = A.z,
  54608. v.x = e * Math.cos(C),
  54609. v.y = e * Math.sin(C),
  54610. y.subVectors(A, v).normalize(),
  54611. d[f] = y.x,
  54612. d[f + 1] = y.y,
  54613. d[f + 2] = y.z,
  54614. p[g] = s / r,
  54615. p[g + 1] = a / i,
  54616. f += 3,
  54617. g += 2
  54618. }
  54619. for (a = 1; a <= i; a++)
  54620. for (s = 1; s <= r; s++) {
  54621. var E = (r + 1) * a + s - 1
  54622. , b = (r + 1) * (a - 1) + s - 1
  54623. , w = (r + 1) * (a - 1) + s
  54624. , _ = (r + 1) * a + s;
  54625. h[m] = E,
  54626. h[m + 1] = b,
  54627. h[m + 2] = _,
  54628. h[m + 3] = b,
  54629. h[m + 4] = w,
  54630. h[m + 5] = _,
  54631. m += 6
  54632. }
  54633. this.setIndex(new n.BufferAttribute(h,1)),
  54634. this.addAttribute("position", new n.BufferAttribute(u,3)),
  54635. this.addAttribute("normal", new n.BufferAttribute(d,3)),
  54636. this.addAttribute("uv", new n.BufferAttribute(p,2))
  54637. }
  54638. ,
  54639. n.TorusBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54640. n.TorusBufferGeometry.prototype.constructor = n.TorusBufferGeometry,
  54641. n.TorusGeometry = function(e, t, i, r, o) {
  54642. n.Geometry.call(this),
  54643. this.type = "TorusGeometry",
  54644. this.parameters = {
  54645. radius: e,
  54646. tube: t,
  54647. radialSegments: i,
  54648. tubularSegments: r,
  54649. arc: o
  54650. },
  54651. this.fromBufferGeometry(new n.TorusBufferGeometry(e,t,i,r,o))
  54652. }
  54653. ,
  54654. n.TorusGeometry.prototype = Object.create(n.Geometry.prototype),
  54655. n.TorusGeometry.prototype.constructor = n.TorusGeometry,
  54656. n.TorusKnotBufferGeometry = function(e, t, i, r, o, a) {
  54657. function s(e, t, i, n, r) {
  54658. var o = Math.cos(e)
  54659. , a = Math.sin(e)
  54660. , s = i / t * e
  54661. , l = Math.cos(s);
  54662. r.x = n * (2 + l) * .5 * o,
  54663. r.y = n * (2 + l) * a * .5,
  54664. r.z = n * Math.sin(s) * .5
  54665. }
  54666. n.BufferGeometry.call(this),
  54667. this.type = "TorusKnotBufferGeometry",
  54668. this.parameters = {
  54669. radius: e,
  54670. tube: t,
  54671. tubularSegments: i,
  54672. radialSegments: r,
  54673. p: o,
  54674. q: a
  54675. },
  54676. e = e || 100,
  54677. t = t || 40,
  54678. i = Math.floor(i) || 64,
  54679. r = Math.floor(r) || 8,
  54680. o = o || 2,
  54681. a = a || 3;
  54682. 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;
  54683. for (l = 0; l <= i; ++l) {
  54684. var T = l / i * o * Math.PI * 2;
  54685. for (s(T, o, a, e, I),
  54686. s(T + .01, o, a, e, E),
  54687. w.subVectors(E, I),
  54688. _.addVectors(E, I),
  54689. b.crossVectors(w, _),
  54690. _.crossVectors(b, w),
  54691. b.normalize(),
  54692. _.normalize(),
  54693. c = 0; c <= r; ++c) {
  54694. var x = c / r * Math.PI * 2
  54695. , S = -t * Math.cos(x)
  54696. , M = t * Math.sin(x);
  54697. A.x = I.x + (S * _.x + M * b.x),
  54698. A.y = I.y + (S * _.y + M * b.y),
  54699. A.z = I.z + (S * _.z + M * b.z),
  54700. p.setXYZ(m, A.x, A.y, A.z),
  54701. y.subVectors(A, I).normalize(),
  54702. f.setXYZ(m, y.x, y.y, y.z),
  54703. C.x = l / i,
  54704. C.y = c / r,
  54705. g.setXY(m, C.x, C.y),
  54706. m++
  54707. }
  54708. }
  54709. for (c = 1; c <= i; c++)
  54710. for (l = 1; l <= r; l++) {
  54711. var R = (r + 1) * (c - 1) + (l - 1)
  54712. , P = (r + 1) * c + (l - 1)
  54713. , O = (r + 1) * c + l
  54714. , L = (r + 1) * (c - 1) + l;
  54715. d.setX(v, R),
  54716. v++,
  54717. d.setX(v, P),
  54718. v++,
  54719. d.setX(v, L),
  54720. v++,
  54721. d.setX(v, P),
  54722. v++,
  54723. d.setX(v, O),
  54724. v++,
  54725. d.setX(v, L),
  54726. v++
  54727. }
  54728. this.setIndex(d),
  54729. this.addAttribute("position", p),
  54730. this.addAttribute("normal", f),
  54731. this.addAttribute("uv", g)
  54732. }
  54733. ,
  54734. n.TorusKnotBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54735. n.TorusKnotBufferGeometry.prototype.constructor = n.TorusKnotBufferGeometry,
  54736. n.TorusKnotGeometry = function(e, t, i, r, o, a, s) {
  54737. n.Geometry.call(this),
  54738. this.type = "TorusKnotGeometry",
  54739. this.parameters = {
  54740. radius: e,
  54741. tube: t,
  54742. tubularSegments: i,
  54743. radialSegments: r,
  54744. p: o,
  54745. q: a
  54746. },
  54747. void 0 !== s && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  54748. this.fromBufferGeometry(new n.TorusKnotBufferGeometry(e,t,i,r,o,a)),
  54749. this.mergeVertices()
  54750. }
  54751. ,
  54752. n.TorusKnotGeometry.prototype = Object.create(n.Geometry.prototype),
  54753. n.TorusKnotGeometry.prototype.constructor = n.TorusKnotGeometry,
  54754. n.TubeGeometry = function(e, t, i, r, o, a) {
  54755. function s(e, t, i) {
  54756. return R.vertices.push(new n.Vector3(e,t,i)) - 1
  54757. }
  54758. n.Geometry.call(this),
  54759. this.type = "TubeGeometry",
  54760. this.parameters = {
  54761. path: e,
  54762. segments: t,
  54763. radius: i,
  54764. radialSegments: r,
  54765. closed: o,
  54766. taper: a
  54767. },
  54768. t = t || 64,
  54769. i = i || 1,
  54770. r = r || 8,
  54771. o = o || !1,
  54772. a = a || n.TubeGeometry.NoTaper;
  54773. 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;
  54774. for (this.tangents = D,
  54775. this.normals = N,
  54776. this.binormals = B,
  54777. v = 0; v < P; v++)
  54778. for (M[v] = [],
  54779. u = v / (P - 1),
  54780. m = e.getPointAt(u),
  54781. l = D[v],
  54782. c = N[v],
  54783. h = B[v],
  54784. p = i * a(u),
  54785. A = 0; A < r; A++)
  54786. d = A / r * 2 * Math.PI,
  54787. f = -p * Math.cos(d),
  54788. g = p * Math.sin(d),
  54789. O.copy(m),
  54790. O.x += f * c.x + g * h.x,
  54791. O.y += f * c.y + g * h.y,
  54792. O.z += f * c.z + g * h.z,
  54793. M[v][A] = s(O.x, O.y, O.z);
  54794. for (v = 0; v < t; v++)
  54795. for (A = 0; A < r; A++)
  54796. y = o ? (v + 1) % t : v + 1,
  54797. C = (A + 1) % r,
  54798. I = M[v][A],
  54799. E = M[y][A],
  54800. b = M[y][C],
  54801. w = M[v][C],
  54802. _ = new n.Vector2(v / t,A / r),
  54803. T = new n.Vector2((v + 1) / t,A / r),
  54804. x = new n.Vector2((v + 1) / t,(A + 1) / r),
  54805. S = new n.Vector2(v / t,(A + 1) / r),
  54806. this.faces.push(new n.Face3(I,E,w)),
  54807. this.faceVertexUvs[0].push([_, T, S]),
  54808. this.faces.push(new n.Face3(E,b,w)),
  54809. this.faceVertexUvs[0].push([T.clone(), x, S.clone()]);
  54810. this.computeFaceNormals(),
  54811. this.computeVertexNormals()
  54812. }
  54813. ,
  54814. n.TubeGeometry.prototype = Object.create(n.Geometry.prototype),
  54815. n.TubeGeometry.prototype.constructor = n.TubeGeometry,
  54816. n.TubeGeometry.NoTaper = function(e) {
  54817. return 1
  54818. }
  54819. ,
  54820. n.TubeGeometry.SinusoidalTaper = function(e) {
  54821. return Math.sin(Math.PI * e)
  54822. }
  54823. ,
  54824. n.TubeGeometry.FrenetFrames = function(e, t, i) {
  54825. function r() {
  54826. f[0] = new n.Vector3,
  54827. g[0] = new n.Vector3,
  54828. a = Number.MAX_VALUE,
  54829. s = Math.abs(p[0].x),
  54830. l = Math.abs(p[0].y),
  54831. c = Math.abs(p[0].z),
  54832. s <= a && (a = s,
  54833. d.set(1, 0, 0)),
  54834. l <= a && (a = l,
  54835. d.set(0, 1, 0)),
  54836. c <= a && d.set(0, 0, 1),
  54837. m.crossVectors(p[0], d).normalize(),
  54838. f[0].crossVectors(p[0], m),
  54839. g[0].crossVectors(p[0], f[0])
  54840. }
  54841. 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;
  54842. for (this.tangents = p,
  54843. this.normals = f,
  54844. this.binormals = g,
  54845. h = 0; h < A; h++)
  54846. u = h / (A - 1),
  54847. p[h] = e.getTangentAt(u),
  54848. p[h].normalize();
  54849. for (r(),
  54850. h = 1; h < A; h++)
  54851. f[h] = f[h - 1].clone(),
  54852. g[h] = g[h - 1].clone(),
  54853. m.crossVectors(p[h - 1], p[h]),
  54854. m.length() > Number.EPSILON && (m.normalize(),
  54855. o = Math.acos(n.Math.clamp(p[h - 1].dot(p[h]), -1, 1)),
  54856. f[h].applyMatrix4(v.makeRotationAxis(m, o))),
  54857. g[h].crossVectors(p[h], f[h]);
  54858. if (i)
  54859. for (o = Math.acos(n.Math.clamp(f[0].dot(f[A - 1]), -1, 1)),
  54860. o /= A - 1,
  54861. p[0].dot(m.crossVectors(f[0], f[A - 1])) > 0 && (o = -o),
  54862. h = 1; h < A; h++)
  54863. f[h].applyMatrix4(v.makeRotationAxis(p[h], o * h)),
  54864. g[h].crossVectors(p[h], f[h])
  54865. }
  54866. ,
  54867. n.PolyhedronGeometry = function(e, t, i, r) {
  54868. function o(e) {
  54869. var t = e.normalize().clone();
  54870. t.index = u.vertices.push(t) - 1;
  54871. var i = l(e) / 2 / Math.PI + .5
  54872. , r = c(e) / Math.PI + .5;
  54873. return t.uv = new n.Vector2(i,1 - r),
  54874. t
  54875. }
  54876. function a(e, t, i, r) {
  54877. var o = new n.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,r);
  54878. u.faces.push(o),
  54879. C.copy(e).add(t).add(i).divideScalar(3);
  54880. var a = l(C);
  54881. u.faceVertexUvs[0].push([h(e.uv, e, a), h(t.uv, t, a), h(i.uv, i, a)])
  54882. }
  54883. function s(e, t) {
  54884. 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++) {
  54885. l[h] = [];
  54886. 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++)
  54887. 0 === g && h === i ? l[h][g] = d : l[h][g] = o(d.clone().lerp(p, g / f))
  54888. }
  54889. for (var h = 0; h < i; h++)
  54890. for (var g = 0; g < 2 * (i - h) - 1; g++) {
  54891. var m = Math.floor(g / 2);
  54892. 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)
  54893. }
  54894. }
  54895. function l(e) {
  54896. return Math.atan2(e.z, -e.x)
  54897. }
  54898. function c(e) {
  54899. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  54900. }
  54901. function h(e, t, i) {
  54902. return i < 0 && 1 === e.x && (e = new n.Vector2(e.x - 1,e.y)),
  54903. 0 === t.x && 0 === t.z && (e = new n.Vector2(i / 2 / Math.PI + .5,e.y)),
  54904. e.clone()
  54905. }
  54906. n.Geometry.call(this),
  54907. this.type = "PolyhedronGeometry",
  54908. this.parameters = {
  54909. vertices: e,
  54910. indices: t,
  54911. radius: i,
  54912. detail: r
  54913. },
  54914. i = i || 1,
  54915. r = r || 0;
  54916. for (var u = this, d = 0, p = e.length; d < p; d += 3)
  54917. o(new n.Vector3(e[d],e[d + 1],e[d + 2]));
  54918. for (var f = this.vertices, g = [], d = 0, m = 0, p = t.length; d < p; d += 3,
  54919. m++) {
  54920. var v = f[t[d]]
  54921. , A = f[t[d + 1]]
  54922. , y = f[t[d + 2]];
  54923. g[m] = new n.Face3(v.index,A.index,y.index,[v.clone(), A.clone(), y.clone()],void 0,m)
  54924. }
  54925. for (var C = new n.Vector3, d = 0, p = g.length; d < p; d++)
  54926. s(g[d], r);
  54927. for (var d = 0, p = this.faceVertexUvs[0].length; d < p; d++) {
  54928. var I = this.faceVertexUvs[0][d]
  54929. , E = I[0].x
  54930. , b = I[1].x
  54931. , w = I[2].x
  54932. , _ = Math.max(E, b, w)
  54933. , T = Math.min(E, b, w);
  54934. _ > .9 && T < .1 && (E < .2 && (I[0].x += 1),
  54935. b < .2 && (I[1].x += 1),
  54936. w < .2 && (I[2].x += 1))
  54937. }
  54938. for (var d = 0, p = this.vertices.length; d < p; d++)
  54939. this.vertices[d].multiplyScalar(i);
  54940. this.mergeVertices(),
  54941. this.computeFaceNormals(),
  54942. this.boundingSphere = new n.Sphere(new n.Vector3,i)
  54943. }
  54944. ,
  54945. n.PolyhedronGeometry.prototype = Object.create(n.Geometry.prototype),
  54946. n.PolyhedronGeometry.prototype.constructor = n.PolyhedronGeometry,
  54947. n.DodecahedronGeometry = function(e, t) {
  54948. var i = (1 + Math.sqrt(5)) / 2
  54949. , r = 1 / i
  54950. , 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]
  54951. , 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];
  54952. n.PolyhedronGeometry.call(this, o, a, e, t),
  54953. this.type = "DodecahedronGeometry",
  54954. this.parameters = {
  54955. radius: e,
  54956. detail: t
  54957. }
  54958. }
  54959. ,
  54960. n.DodecahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  54961. n.DodecahedronGeometry.prototype.constructor = n.DodecahedronGeometry,
  54962. n.IcosahedronGeometry = function(e, t) {
  54963. var i = (1 + Math.sqrt(5)) / 2
  54964. , 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]
  54965. , 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];
  54966. n.PolyhedronGeometry.call(this, r, o, e, t),
  54967. this.type = "IcosahedronGeometry",
  54968. this.parameters = {
  54969. radius: e,
  54970. detail: t
  54971. }
  54972. }
  54973. ,
  54974. n.IcosahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  54975. n.IcosahedronGeometry.prototype.constructor = n.IcosahedronGeometry,
  54976. n.OctahedronGeometry = function(e, t) {
  54977. var i = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1]
  54978. , 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];
  54979. n.PolyhedronGeometry.call(this, i, r, e, t),
  54980. this.type = "OctahedronGeometry",
  54981. this.parameters = {
  54982. radius: e,
  54983. detail: t
  54984. }
  54985. }
  54986. ,
  54987. n.OctahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  54988. n.OctahedronGeometry.prototype.constructor = n.OctahedronGeometry,
  54989. n.TetrahedronGeometry = function(e, t) {
  54990. var i = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1]
  54991. , r = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1];
  54992. n.PolyhedronGeometry.call(this, i, r, e, t),
  54993. this.type = "TetrahedronGeometry",
  54994. this.parameters = {
  54995. radius: e,
  54996. detail: t
  54997. }
  54998. }
  54999. ,
  55000. n.TetrahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  55001. n.TetrahedronGeometry.prototype.constructor = n.TetrahedronGeometry,
  55002. n.ParametricGeometry = function(e, t, i) {
  55003. n.Geometry.call(this),
  55004. this.type = "ParametricGeometry",
  55005. this.parameters = {
  55006. func: e,
  55007. slices: t,
  55008. stacks: i
  55009. };
  55010. var r, o, a, s, l, c = this.vertices, h = this.faces, u = this.faceVertexUvs[0], d = t + 1;
  55011. for (r = 0; r <= i; r++)
  55012. for (l = r / i,
  55013. o = 0; o <= t; o++)
  55014. s = o / t,
  55015. a = e(s, l),
  55016. c.push(a);
  55017. var p, f, g, m, v, A, y, C;
  55018. for (r = 0; r < i; r++)
  55019. for (o = 0; o < t; o++)
  55020. p = r * d + o,
  55021. f = r * d + o + 1,
  55022. g = (r + 1) * d + o + 1,
  55023. m = (r + 1) * d + o,
  55024. v = new n.Vector2(o / t,r / i),
  55025. A = new n.Vector2((o + 1) / t,r / i),
  55026. y = new n.Vector2((o + 1) / t,(r + 1) / i),
  55027. C = new n.Vector2(o / t,(r + 1) / i),
  55028. h.push(new n.Face3(p,f,m)),
  55029. u.push([v, A, C]),
  55030. h.push(new n.Face3(f,g,m)),
  55031. u.push([A.clone(), y, C.clone()]);
  55032. this.computeFaceNormals(),
  55033. this.computeVertexNormals()
  55034. }
  55035. ,
  55036. n.ParametricGeometry.prototype = Object.create(n.Geometry.prototype),
  55037. n.ParametricGeometry.prototype.constructor = n.ParametricGeometry,
  55038. n.WireframeGeometry = function(e) {
  55039. function t(e, t) {
  55040. return e - t
  55041. }
  55042. n.BufferGeometry.call(this);
  55043. var i = [0, 0]
  55044. , r = {}
  55045. , o = ["a", "b", "c"];
  55046. if (e instanceof n.Geometry) {
  55047. for (var a = e.vertices, s = e.faces, l = 0, c = new Uint32Array(6 * s.length), h = 0, u = s.length; h < u; h++)
  55048. for (var d = s[h], p = 0; p < 3; p++) {
  55049. i[0] = d[o[p]],
  55050. i[1] = d[o[(p + 1) % 3]],
  55051. i.sort(t);
  55052. var f = i.toString();
  55053. void 0 === r[f] && (c[2 * l] = i[0],
  55054. c[2 * l + 1] = i[1],
  55055. r[f] = !0,
  55056. l++)
  55057. }
  55058. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  55059. for (var p = 0; p < 2; p++) {
  55060. var m = a[c[2 * h + p]]
  55061. , v = 6 * h + 3 * p;
  55062. g[v + 0] = m.x,
  55063. g[v + 1] = m.y,
  55064. g[v + 2] = m.z
  55065. }
  55066. this.addAttribute("position", new n.BufferAttribute(g,3))
  55067. } else if (e instanceof n.BufferGeometry)
  55068. if (null !== e.index) {
  55069. var A = e.index.array
  55070. , a = e.attributes.position
  55071. , y = e.groups
  55072. , l = 0;
  55073. 0 === y.length && e.addGroup(0, A.length);
  55074. for (var c = new Uint32Array(2 * A.length), C = 0, I = y.length; C < I; ++C)
  55075. for (var E = y[C], b = E.start, w = E.count, h = b, _ = b + w; h < _; h += 3)
  55076. for (var p = 0; p < 3; p++) {
  55077. i[0] = A[h + p],
  55078. i[1] = A[h + (p + 1) % 3],
  55079. i.sort(t);
  55080. var f = i.toString();
  55081. void 0 === r[f] && (c[2 * l] = i[0],
  55082. c[2 * l + 1] = i[1],
  55083. r[f] = !0,
  55084. l++)
  55085. }
  55086. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  55087. for (var p = 0; p < 2; p++) {
  55088. var v = 6 * h + 3 * p
  55089. , T = c[2 * h + p];
  55090. g[v + 0] = a.getX(T),
  55091. g[v + 1] = a.getY(T),
  55092. g[v + 2] = a.getZ(T)
  55093. }
  55094. this.addAttribute("position", new n.BufferAttribute(g,3))
  55095. } else {
  55096. 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++)
  55097. for (var p = 0; p < 3; p++) {
  55098. var v = 18 * h + 6 * p
  55099. , S = 9 * h + 3 * p;
  55100. g[v + 0] = a[S],
  55101. g[v + 1] = a[S + 1],
  55102. g[v + 2] = a[S + 2];
  55103. var T = 9 * h + 3 * ((p + 1) % 3);
  55104. g[v + 3] = a[T],
  55105. g[v + 4] = a[T + 1],
  55106. g[v + 5] = a[T + 2]
  55107. }
  55108. this.addAttribute("position", new n.BufferAttribute(g,3))
  55109. }
  55110. }
  55111. ,
  55112. n.WireframeGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55113. n.WireframeGeometry.prototype.constructor = n.WireframeGeometry,
  55114. n.AxisHelper = function(e) {
  55115. e = e || 1;
  55116. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  55117. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  55118. , r = new n.BufferGeometry;
  55119. r.addAttribute("position", new n.BufferAttribute(t,3)),
  55120. r.addAttribute("color", new n.BufferAttribute(i,3));
  55121. var o = new n.LineBasicMaterial({
  55122. vertexColors: n.VertexColors
  55123. });
  55124. n.LineSegments.call(this, r, o)
  55125. }
  55126. ,
  55127. n.AxisHelper.prototype = Object.create(n.LineSegments.prototype),
  55128. n.AxisHelper.prototype.constructor = n.AxisHelper,
  55129. n.ArrowHelper = function() {
  55130. var e = new n.Geometry;
  55131. e.vertices.push(new n.Vector3(0,0,0), new n.Vector3(0,1,0));
  55132. var t = new n.CylinderGeometry(0,.5,1,5,1);
  55133. return t.translate(0, -.5, 0),
  55134. function(i, r, o, a, s, l) {
  55135. n.Object3D.call(this),
  55136. void 0 === a && (a = 16776960),
  55137. void 0 === o && (o = 1),
  55138. void 0 === s && (s = .2 * o),
  55139. void 0 === l && (l = .2 * s),
  55140. this.position.copy(r),
  55141. this.line = new n.Line(e,new n.LineBasicMaterial({
  55142. color: a
  55143. })),
  55144. this.line.matrixAutoUpdate = !1,
  55145. this.add(this.line),
  55146. this.cone = new n.Mesh(t,new n.MeshBasicMaterial({
  55147. color: a
  55148. })),
  55149. this.cone.matrixAutoUpdate = !1,
  55150. this.add(this.cone),
  55151. this.setDirection(i),
  55152. this.setLength(o, s, l)
  55153. }
  55154. }(),
  55155. n.ArrowHelper.prototype = Object.create(n.Object3D.prototype),
  55156. n.ArrowHelper.prototype.constructor = n.ArrowHelper,
  55157. n.ArrowHelper.prototype.setDirection = function() {
  55158. var e, t = new n.Vector3;
  55159. return function(i) {
  55160. 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(),
  55161. e = Math.acos(i.y),
  55162. this.quaternion.setFromAxisAngle(t, e))
  55163. }
  55164. }(),
  55165. n.ArrowHelper.prototype.setLength = function(e, t, i) {
  55166. void 0 === t && (t = .2 * e),
  55167. void 0 === i && (i = .2 * t),
  55168. this.line.scale.set(1, Math.max(0, e - t), 1),
  55169. this.line.updateMatrix(),
  55170. this.cone.scale.set(i, t, i),
  55171. this.cone.position.y = e,
  55172. this.cone.updateMatrix()
  55173. }
  55174. ,
  55175. n.ArrowHelper.prototype.setColor = function(e) {
  55176. this.line.material.color.set(e),
  55177. this.cone.material.color.set(e)
  55178. }
  55179. ,
  55180. n.BoxHelper = function(e) {
  55181. 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])
  55182. , i = new Float32Array(24)
  55183. , r = new n.BufferGeometry;
  55184. r.setIndex(new n.BufferAttribute(t,1)),
  55185. r.addAttribute("position", new n.BufferAttribute(i,3)),
  55186. n.LineSegments.call(this, r, new n.LineBasicMaterial({
  55187. color: 16776960
  55188. })),
  55189. void 0 !== e && this.update(e)
  55190. }
  55191. ,
  55192. n.BoxHelper.prototype = Object.create(n.LineSegments.prototype),
  55193. n.BoxHelper.prototype.constructor = n.BoxHelper,
  55194. n.BoxHelper.prototype.update = function() {
  55195. var e = new n.Box3;
  55196. return function(t) {
  55197. if (e.setFromObject(t),
  55198. !e.isEmpty()) {
  55199. var i = e.min
  55200. , n = e.max
  55201. , r = this.geometry.attributes.position
  55202. , o = r.array;
  55203. o[0] = n.x,
  55204. o[1] = n.y,
  55205. o[2] = n.z,
  55206. o[3] = i.x,
  55207. o[4] = n.y,
  55208. o[5] = n.z,
  55209. o[6] = i.x,
  55210. o[7] = i.y,
  55211. o[8] = n.z,
  55212. o[9] = n.x,
  55213. o[10] = i.y,
  55214. o[11] = n.z,
  55215. o[12] = n.x,
  55216. o[13] = n.y,
  55217. o[14] = i.z,
  55218. o[15] = i.x,
  55219. o[16] = n.y,
  55220. o[17] = i.z,
  55221. o[18] = i.x,
  55222. o[19] = i.y,
  55223. o[20] = i.z,
  55224. o[21] = n.x,
  55225. o[22] = i.y,
  55226. o[23] = i.z,
  55227. r.needsUpdate = !0,
  55228. this.geometry.computeBoundingSphere()
  55229. }
  55230. }
  55231. }(),
  55232. n.BoundingBoxHelper = function(e, t) {
  55233. var i = void 0 !== t ? t : 8947848;
  55234. this.object = e,
  55235. this.box = new n.Box3,
  55236. n.Mesh.call(this, new n.BoxGeometry(1,1,1), new n.MeshBasicMaterial({
  55237. color: i,
  55238. wireframe: !0
  55239. }))
  55240. }
  55241. ,
  55242. n.BoundingBoxHelper.prototype = Object.create(n.Mesh.prototype),
  55243. n.BoundingBoxHelper.prototype.constructor = n.BoundingBoxHelper,
  55244. n.BoundingBoxHelper.prototype.update = function() {
  55245. this.box.setFromObject(this.object),
  55246. this.box.size(this.scale),
  55247. this.box.center(this.position)
  55248. }
  55249. ,
  55250. n.CameraHelper = function(e) {
  55251. function t(e, t, n) {
  55252. i(e, n),
  55253. i(t, n)
  55254. }
  55255. function i(e, t) {
  55256. r.vertices.push(new n.Vector3),
  55257. r.colors.push(new n.Color(t)),
  55258. void 0 === a[e] && (a[e] = []),
  55259. a[e].push(r.vertices.length - 1)
  55260. }
  55261. var r = new n.Geometry
  55262. , o = new n.LineBasicMaterial({
  55263. color: 16777215,
  55264. vertexColors: n.FaceColors
  55265. })
  55266. , a = {}
  55267. , s = 16755200
  55268. , l = 16711680
  55269. , c = 43775
  55270. , h = 16777215
  55271. , u = 3355443;
  55272. t("n1", "n2", s),
  55273. t("n2", "n4", s),
  55274. t("n4", "n3", s),
  55275. t("n3", "n1", s),
  55276. t("f1", "f2", s),
  55277. t("f2", "f4", s),
  55278. t("f4", "f3", s),
  55279. t("f3", "f1", s),
  55280. t("n1", "f1", s),
  55281. t("n2", "f2", s),
  55282. t("n3", "f3", s),
  55283. t("n4", "f4", s),
  55284. t("p", "n1", l),
  55285. t("p", "n2", l),
  55286. t("p", "n3", l),
  55287. t("p", "n4", l),
  55288. t("u1", "u2", c),
  55289. t("u2", "u3", c),
  55290. t("u3", "u1", c),
  55291. t("c", "t", h),
  55292. t("p", "c", u),
  55293. t("cn1", "cn2", u),
  55294. t("cn3", "cn4", u),
  55295. t("cf1", "cf2", u),
  55296. t("cf3", "cf4", u),
  55297. n.LineSegments.call(this, r, o),
  55298. this.camera = e,
  55299. this.camera.updateProjectionMatrix(),
  55300. this.matrix = e.matrixWorld,
  55301. this.matrixAutoUpdate = !1,
  55302. this.pointMap = a,
  55303. this.update()
  55304. }
  55305. ,
  55306. n.CameraHelper.prototype = Object.create(n.LineSegments.prototype),
  55307. n.CameraHelper.prototype.constructor = n.CameraHelper,
  55308. n.CameraHelper.prototype.update = function() {
  55309. function e(e, n, a, s) {
  55310. r.set(n, a, s).unproject(o);
  55311. var l = i[e];
  55312. if (void 0 !== l)
  55313. for (var c = 0, h = l.length; c < h; c++)
  55314. t.vertices[l[c]].copy(r)
  55315. }
  55316. var t, i, r = new n.Vector3, o = new n.Camera;
  55317. return function() {
  55318. t = this.geometry,
  55319. i = this.pointMap;
  55320. var n = 1
  55321. , r = 1;
  55322. o.projectionMatrix.copy(this.camera.projectionMatrix),
  55323. e("c", 0, 0, -1),
  55324. e("t", 0, 0, 1),
  55325. e("n1", -n, -r, -1),
  55326. e("n2", n, -r, -1),
  55327. e("n3", -n, r, -1),
  55328. e("n4", n, r, -1),
  55329. e("f1", -n, -r, 1),
  55330. e("f2", n, -r, 1),
  55331. e("f3", -n, r, 1),
  55332. e("f4", n, r, 1),
  55333. e("u1", .7 * n, 1.1 * r, -1),
  55334. e("u2", .7 * -n, 1.1 * r, -1),
  55335. e("u3", 0, 2 * r, -1),
  55336. e("cf1", -n, 0, 1),
  55337. e("cf2", n, 0, 1),
  55338. e("cf3", 0, -r, 1),
  55339. e("cf4", 0, r, 1),
  55340. e("cn1", -n, 0, -1),
  55341. e("cn2", n, 0, -1),
  55342. e("cn3", 0, -r, -1),
  55343. e("cn4", 0, r, -1),
  55344. t.verticesNeedUpdate = !0
  55345. }
  55346. }(),
  55347. n.DirectionalLightHelper = function(e, t) {
  55348. n.Object3D.call(this),
  55349. this.light = e,
  55350. this.light.updateMatrixWorld(),
  55351. this.matrix = e.matrixWorld,
  55352. this.matrixAutoUpdate = !1,
  55353. t = t || 1;
  55354. var i = new n.Geometry;
  55355. 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));
  55356. var r = new n.LineBasicMaterial({
  55357. fog: !1
  55358. });
  55359. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55360. this.lightPlane = new n.Line(i,r),
  55361. this.add(this.lightPlane),
  55362. i = new n.Geometry,
  55363. i.vertices.push(new n.Vector3, new n.Vector3),
  55364. r = new n.LineBasicMaterial({
  55365. fog: !1
  55366. }),
  55367. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55368. this.targetLine = new n.Line(i,r),
  55369. this.add(this.targetLine),
  55370. this.update()
  55371. }
  55372. ,
  55373. n.DirectionalLightHelper.prototype = Object.create(n.Object3D.prototype),
  55374. n.DirectionalLightHelper.prototype.constructor = n.DirectionalLightHelper,
  55375. n.DirectionalLightHelper.prototype.dispose = function() {
  55376. this.lightPlane.geometry.dispose(),
  55377. this.lightPlane.material.dispose(),
  55378. this.targetLine.geometry.dispose(),
  55379. this.targetLine.material.dispose()
  55380. }
  55381. ,
  55382. n.DirectionalLightHelper.prototype.update = function() {
  55383. var e = new n.Vector3
  55384. , t = new n.Vector3
  55385. , i = new n.Vector3;
  55386. return function() {
  55387. e.setFromMatrixPosition(this.light.matrixWorld),
  55388. t.setFromMatrixPosition(this.light.target.matrixWorld),
  55389. i.subVectors(t, e),
  55390. this.lightPlane.lookAt(i),
  55391. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55392. this.targetLine.geometry.vertices[1].copy(i),
  55393. this.targetLine.geometry.verticesNeedUpdate = !0,
  55394. this.targetLine.material.color.copy(this.lightPlane.material.color)
  55395. }
  55396. }(),
  55397. n.EdgesHelper = function(e, t, i) {
  55398. var r = void 0 !== t ? t : 16777215;
  55399. n.LineSegments.call(this, new n.EdgesGeometry(e.geometry,i), new n.LineBasicMaterial({
  55400. color: r
  55401. })),
  55402. this.matrix = e.matrixWorld,
  55403. this.matrixAutoUpdate = !1
  55404. }
  55405. ,
  55406. n.EdgesHelper.prototype = Object.create(n.LineSegments.prototype),
  55407. n.EdgesHelper.prototype.constructor = n.EdgesHelper,
  55408. n.FaceNormalsHelper = function(e, t, i, r) {
  55409. this.object = e,
  55410. this.size = void 0 !== t ? t : 1;
  55411. var o = void 0 !== i ? i : 16776960
  55412. , a = void 0 !== r ? r : 1
  55413. , s = 0
  55414. , l = this.object.geometry;
  55415. l instanceof n.Geometry ? s = l.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  55416. var c = new n.BufferGeometry
  55417. , h = new n.Float32Attribute(2 * s * 3,3);
  55418. c.addAttribute("position", h),
  55419. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  55420. color: o,
  55421. linewidth: a
  55422. })),
  55423. this.matrixAutoUpdate = !1,
  55424. this.update()
  55425. }
  55426. ,
  55427. n.FaceNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  55428. n.FaceNormalsHelper.prototype.constructor = n.FaceNormalsHelper,
  55429. n.FaceNormalsHelper.prototype.update = function() {
  55430. var e = new n.Vector3
  55431. , t = new n.Vector3
  55432. , i = new n.Matrix3;
  55433. return function() {
  55434. this.object.updateMatrixWorld(!0),
  55435. i.getNormalMatrix(this.object.matrixWorld);
  55436. 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++) {
  55437. var u = s[c]
  55438. , d = u.normal;
  55439. e.copy(a[u.a]).add(a[u.b]).add(a[u.c]).divideScalar(3).applyMatrix4(n),
  55440. t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  55441. r.setXYZ(l, e.x, e.y, e.z),
  55442. l += 1,
  55443. r.setXYZ(l, t.x, t.y, t.z),
  55444. l += 1
  55445. }
  55446. return r.needsUpdate = !0,
  55447. this
  55448. }
  55449. }(),
  55450. n.GridHelper = function(e, t) {
  55451. var i = new n.Geometry
  55452. , r = new n.LineBasicMaterial({
  55453. vertexColors: n.VertexColors
  55454. });
  55455. this.color1 = new n.Color(4473924),
  55456. this.color2 = new n.Color(8947848);
  55457. for (var o = -e; o <= e; o += t) {
  55458. 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));
  55459. var a = 0 === o ? this.color1 : this.color2;
  55460. i.colors.push(a, a, a, a)
  55461. }
  55462. n.LineSegments.call(this, i, r)
  55463. }
  55464. ,
  55465. n.GridHelper.prototype = Object.create(n.LineSegments.prototype),
  55466. n.GridHelper.prototype.constructor = n.GridHelper,
  55467. n.GridHelper.prototype.setColors = function(e, t) {
  55468. this.color1.set(e),
  55469. this.color2.set(t),
  55470. this.geometry.colorsNeedUpdate = !0
  55471. }
  55472. ,
  55473. n.HemisphereLightHelper = function(e, t) {
  55474. n.Object3D.call(this),
  55475. this.light = e,
  55476. this.light.updateMatrixWorld(),
  55477. this.matrix = e.matrixWorld,
  55478. this.matrixAutoUpdate = !1,
  55479. this.colors = [new n.Color, new n.Color];
  55480. var i = new n.SphereGeometry(t,4,2);
  55481. i.rotateX(-Math.PI / 2);
  55482. for (var r = 0, o = 8; r < o; r++)
  55483. i.faces[r].color = this.colors[r < 4 ? 0 : 1];
  55484. var a = new n.MeshBasicMaterial({
  55485. vertexColors: n.FaceColors,
  55486. wireframe: !0
  55487. });
  55488. this.lightSphere = new n.Mesh(i,a),
  55489. this.add(this.lightSphere),
  55490. this.update()
  55491. }
  55492. ,
  55493. n.HemisphereLightHelper.prototype = Object.create(n.Object3D.prototype),
  55494. n.HemisphereLightHelper.prototype.constructor = n.HemisphereLightHelper,
  55495. n.HemisphereLightHelper.prototype.dispose = function() {
  55496. this.lightSphere.geometry.dispose(),
  55497. this.lightSphere.material.dispose()
  55498. }
  55499. ,
  55500. n.HemisphereLightHelper.prototype.update = function() {
  55501. var e = new n.Vector3;
  55502. return function() {
  55503. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  55504. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  55505. this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),
  55506. this.lightSphere.geometry.colorsNeedUpdate = !0
  55507. }
  55508. }(),
  55509. n.PointLightHelper = function(e, t) {
  55510. this.light = e,
  55511. this.light.updateMatrixWorld();
  55512. var i = new n.SphereGeometry(t,4,2)
  55513. , r = new n.MeshBasicMaterial({
  55514. wireframe: !0,
  55515. fog: !1
  55516. });
  55517. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55518. n.Mesh.call(this, i, r),
  55519. this.matrix = this.light.matrixWorld,
  55520. this.matrixAutoUpdate = !1
  55521. }
  55522. ,
  55523. n.PointLightHelper.prototype = Object.create(n.Mesh.prototype),
  55524. n.PointLightHelper.prototype.constructor = n.PointLightHelper,
  55525. n.PointLightHelper.prototype.dispose = function() {
  55526. this.geometry.dispose(),
  55527. this.material.dispose()
  55528. }
  55529. ,
  55530. n.PointLightHelper.prototype.update = function() {
  55531. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  55532. }
  55533. ,
  55534. n.SkeletonHelper = function(e) {
  55535. this.bones = this.getBoneList(e);
  55536. for (var t = new n.Geometry, i = 0; i < this.bones.length; i++) {
  55537. var r = this.bones[i];
  55538. r.parent instanceof n.Bone && (t.vertices.push(new n.Vector3),
  55539. t.vertices.push(new n.Vector3),
  55540. t.colors.push(new n.Color(0,0,1)),
  55541. t.colors.push(new n.Color(0,1,0)))
  55542. }
  55543. t.dynamic = !0;
  55544. var o = new n.LineBasicMaterial({
  55545. vertexColors: n.VertexColors,
  55546. depthTest: !1,
  55547. depthWrite: !1,
  55548. transparent: !0
  55549. });
  55550. n.LineSegments.call(this, t, o),
  55551. this.root = e,
  55552. this.matrix = e.matrixWorld,
  55553. this.matrixAutoUpdate = !1,
  55554. this.update()
  55555. }
  55556. ,
  55557. n.SkeletonHelper.prototype = Object.create(n.LineSegments.prototype),
  55558. n.SkeletonHelper.prototype.constructor = n.SkeletonHelper,
  55559. n.SkeletonHelper.prototype.getBoneList = function(e) {
  55560. var t = [];
  55561. e instanceof n.Bone && t.push(e);
  55562. for (var i = 0; i < e.children.length; i++)
  55563. t.push.apply(t, this.getBoneList(e.children[i]));
  55564. return t
  55565. }
  55566. ,
  55567. n.SkeletonHelper.prototype.update = function() {
  55568. 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++) {
  55569. var a = this.bones[o];
  55570. a.parent instanceof n.Bone && (i.multiplyMatrices(t, a.matrixWorld),
  55571. e.vertices[r].setFromMatrixPosition(i),
  55572. i.multiplyMatrices(t, a.parent.matrixWorld),
  55573. e.vertices[r + 1].setFromMatrixPosition(i),
  55574. r += 2)
  55575. }
  55576. e.verticesNeedUpdate = !0,
  55577. e.computeBoundingSphere()
  55578. }
  55579. ,
  55580. n.SpotLightHelper = function(e) {
  55581. n.Object3D.call(this),
  55582. this.light = e,
  55583. this.light.updateMatrixWorld(),
  55584. this.matrix = e.matrixWorld,
  55585. this.matrixAutoUpdate = !1;
  55586. var t = new n.CylinderGeometry(0,1,1,8,1,!0);
  55587. t.translate(0, -.5, 0),
  55588. t.rotateX(-Math.PI / 2);
  55589. var i = new n.MeshBasicMaterial({
  55590. wireframe: !0,
  55591. fog: !1
  55592. });
  55593. this.cone = new n.Mesh(t,i),
  55594. this.add(this.cone),
  55595. this.update()
  55596. }
  55597. ,
  55598. n.SpotLightHelper.prototype = Object.create(n.Object3D.prototype),
  55599. n.SpotLightHelper.prototype.constructor = n.SpotLightHelper,
  55600. n.SpotLightHelper.prototype.dispose = function() {
  55601. this.cone.geometry.dispose(),
  55602. this.cone.material.dispose()
  55603. }
  55604. ,
  55605. n.SpotLightHelper.prototype.update = function() {
  55606. var e = new n.Vector3
  55607. , t = new n.Vector3;
  55608. return function() {
  55609. var i = this.light.distance ? this.light.distance : 1e4
  55610. , n = i * Math.tan(this.light.angle);
  55611. this.cone.scale.set(n, n, i),
  55612. e.setFromMatrixPosition(this.light.matrixWorld),
  55613. t.setFromMatrixPosition(this.light.target.matrixWorld),
  55614. this.cone.lookAt(t.sub(e)),
  55615. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  55616. }
  55617. }(),
  55618. n.VertexNormalsHelper = function(e, t, i, r) {
  55619. this.object = e,
  55620. this.size = void 0 !== t ? t : 1;
  55621. var o = void 0 !== i ? i : 16711680
  55622. , a = void 0 !== r ? r : 1
  55623. , s = 0
  55624. , l = this.object.geometry;
  55625. l instanceof n.Geometry ? s = 3 * l.faces.length : l instanceof n.BufferGeometry && (s = l.attributes.normal.count);
  55626. var c = new n.BufferGeometry
  55627. , h = new n.Float32Attribute(2 * s * 3,3);
  55628. c.addAttribute("position", h),
  55629. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  55630. color: o,
  55631. linewidth: a
  55632. })),
  55633. this.matrixAutoUpdate = !1,
  55634. this.update()
  55635. }
  55636. ,
  55637. n.VertexNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  55638. n.VertexNormalsHelper.prototype.constructor = n.VertexNormalsHelper,
  55639. n.VertexNormalsHelper.prototype.update = function() {
  55640. var e = new n.Vector3
  55641. , t = new n.Vector3
  55642. , i = new n.Matrix3;
  55643. return function() {
  55644. var r = ["a", "b", "c"];
  55645. this.object.updateMatrixWorld(!0),
  55646. i.getNormalMatrix(this.object.matrixWorld);
  55647. var o = this.object.matrixWorld
  55648. , a = this.geometry.attributes.position
  55649. , s = this.object.geometry;
  55650. if (s instanceof n.Geometry)
  55651. for (var l = s.vertices, c = s.faces, h = 0, u = 0, d = c.length; u < d; u++)
  55652. for (var p = c[u], f = 0, g = p.vertexNormals.length; f < g; f++) {
  55653. var m = l[p[r[f]]]
  55654. , v = p.vertexNormals[f];
  55655. e.copy(m).applyMatrix4(o),
  55656. t.copy(v).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  55657. a.setXYZ(h, e.x, e.y, e.z),
  55658. h += 1,
  55659. a.setXYZ(h, t.x, t.y, t.z),
  55660. h += 1
  55661. }
  55662. else if (s instanceof n.BufferGeometry)
  55663. for (var A = s.attributes.position, y = s.attributes.normal, h = 0, f = 0, g = A.count; f < g; f++)
  55664. e.set(A.getX(f), A.getY(f), A.getZ(f)).applyMatrix4(o),
  55665. t.set(y.getX(f), y.getY(f), y.getZ(f)),
  55666. t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  55667. a.setXYZ(h, e.x, e.y, e.z),
  55668. h += 1,
  55669. a.setXYZ(h, t.x, t.y, t.z),
  55670. h += 1;
  55671. return a.needsUpdate = !0,
  55672. this
  55673. }
  55674. }(),
  55675. n.WireframeHelper = function(e, t) {
  55676. var i = void 0 !== t ? t : 16777215;
  55677. n.LineSegments.call(this, new n.WireframeGeometry(e.geometry), new n.LineBasicMaterial({
  55678. color: i
  55679. })),
  55680. this.matrix = e.matrixWorld,
  55681. this.matrixAutoUpdate = !1
  55682. }
  55683. ,
  55684. n.WireframeHelper.prototype = Object.create(n.LineSegments.prototype),
  55685. n.WireframeHelper.prototype.constructor = n.WireframeHelper,
  55686. n.ImmediateRenderObject = function(e) {
  55687. n.Object3D.call(this),
  55688. this.material = e,
  55689. this.render = function(e) {}
  55690. }
  55691. ,
  55692. n.ImmediateRenderObject.prototype = Object.create(n.Object3D.prototype),
  55693. n.ImmediateRenderObject.prototype.constructor = n.ImmediateRenderObject,
  55694. n.MorphBlendMesh = function(e, t) {
  55695. n.Mesh.call(this, e, t),
  55696. this.animationsMap = {},
  55697. this.animationsList = [];
  55698. var i = this.geometry.morphTargets.length
  55699. , r = "__default"
  55700. , o = 0
  55701. , a = i - 1
  55702. , s = i / 1;
  55703. this.createAnimation(r, o, a, s),
  55704. this.setAnimationWeight(r, 1)
  55705. }
  55706. ,
  55707. n.MorphBlendMesh.prototype = Object.create(n.Mesh.prototype),
  55708. n.MorphBlendMesh.prototype.constructor = n.MorphBlendMesh,
  55709. n.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  55710. var r = {
  55711. start: t,
  55712. end: i,
  55713. length: i - t + 1,
  55714. fps: n,
  55715. duration: (i - t) / n,
  55716. lastFrame: 0,
  55717. currentFrame: 0,
  55718. active: !1,
  55719. time: 0,
  55720. direction: 1,
  55721. weight: 1,
  55722. directionBackwards: !1,
  55723. mirroredLoop: !1
  55724. };
  55725. this.animationsMap[e] = r,
  55726. this.animationsList.push(r)
  55727. }
  55728. ,
  55729. n.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  55730. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  55731. var s = r.morphTargets[o]
  55732. , l = s.name.match(i);
  55733. if (l && l.length > 1) {
  55734. var c = l[1];
  55735. n[c] || (n[c] = {
  55736. start: 1 / 0,
  55737. end: -(1 / 0)
  55738. });
  55739. var h = n[c];
  55740. o < h.start && (h.start = o),
  55741. o > h.end && (h.end = o),
  55742. t || (t = c)
  55743. }
  55744. }
  55745. for (var c in n) {
  55746. var h = n[c];
  55747. this.createAnimation(c, h.start, h.end, e)
  55748. }
  55749. this.firstAnimation = t
  55750. }
  55751. ,
  55752. n.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  55753. var t = this.animationsMap[e];
  55754. t && (t.direction = 1,
  55755. t.directionBackwards = !1)
  55756. }
  55757. ,
  55758. n.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  55759. var t = this.animationsMap[e];
  55760. t && (t.direction = -1,
  55761. t.directionBackwards = !0)
  55762. }
  55763. ,
  55764. n.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  55765. var i = this.animationsMap[e];
  55766. i && (i.fps = t,
  55767. i.duration = (i.end - i.start) / i.fps)
  55768. }
  55769. ,
  55770. n.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  55771. var i = this.animationsMap[e];
  55772. i && (i.duration = t,
  55773. i.fps = (i.end - i.start) / i.duration)
  55774. }
  55775. ,
  55776. n.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  55777. var i = this.animationsMap[e];
  55778. i && (i.weight = t)
  55779. }
  55780. ,
  55781. n.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  55782. var i = this.animationsMap[e];
  55783. i && (i.time = t)
  55784. }
  55785. ,
  55786. n.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  55787. var t = 0
  55788. , i = this.animationsMap[e];
  55789. return i && (t = i.time),
  55790. t
  55791. }
  55792. ,
  55793. n.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  55794. var t = -1
  55795. , i = this.animationsMap[e];
  55796. return i && (t = i.duration),
  55797. t
  55798. }
  55799. ,
  55800. n.MorphBlendMesh.prototype.playAnimation = function(e) {
  55801. var t = this.animationsMap[e];
  55802. t ? (t.time = 0,
  55803. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  55804. }
  55805. ,
  55806. n.MorphBlendMesh.prototype.stopAnimation = function(e) {
  55807. var t = this.animationsMap[e];
  55808. t && (t.active = !1)
  55809. }
  55810. ,
  55811. n.MorphBlendMesh.prototype.update = function(e) {
  55812. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  55813. var r = this.animationsList[t];
  55814. if (r.active) {
  55815. var o = r.duration / r.length;
  55816. r.time += r.direction * e,
  55817. r.mirroredLoop ? (r.time > r.duration || r.time < 0) && (r.direction *= -1,
  55818. r.time > r.duration && (r.time = r.duration,
  55819. r.directionBackwards = !0),
  55820. r.time < 0 && (r.time = 0,
  55821. r.directionBackwards = !1)) : (r.time = r.time % r.duration,
  55822. r.time < 0 && (r.time += r.duration));
  55823. var a = r.start + n.Math.clamp(Math.floor(r.time / o), 0, r.length - 1)
  55824. , s = r.weight;
  55825. a !== r.currentFrame && (this.morphTargetInfluences[r.lastFrame] = 0,
  55826. this.morphTargetInfluences[r.currentFrame] = 1 * s,
  55827. this.morphTargetInfluences[a] = 0,
  55828. r.lastFrame = r.currentFrame,
  55829. r.currentFrame = a);
  55830. var l = r.time % o / o;
  55831. r.directionBackwards && (l = 1 - l),
  55832. r.currentFrame !== r.lastFrame ? (this.morphTargetInfluences[r.currentFrame] = l * s,
  55833. this.morphTargetInfluences[r.lastFrame] = (1 - l) * s) : this.morphTargetInfluences[r.currentFrame] = s
  55834. }
  55835. }
  55836. }
  55837. ,
  55838. "undefined" != typeof i ? ("undefined" != typeof t && t.exports && (i = t.exports = n),
  55839. i.THREE = n) : this.THREE = n
  55840. }
  55841. , {}]
  55842. }, {}, [116]);